From 330ca992be304d0eac79bd59b411980dff294b03 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Wed, 28 Dec 2022 18:25:40 +0000 Subject: [PATCH] [Java] Update auto-generated Java bindings for 0.0.113 --- src/main/java/org/ldk/enums/HTLCClaim.java | 29 + src/main/java/org/ldk/enums/Recipient.java | 6 +- src/main/java/org/ldk/impl/bindings.java | 1659 ++-- src/main/java/org/ldk/structs/APIError.java | 18 +- .../java/org/ldk/structs/AcceptChannel.java | 4 +- .../ldk/structs/AnnouncementSignatures.java | 2 +- .../org/ldk/structs/BackgroundProcessor.java | 2 +- src/main/java/org/ldk/structs/Balance.java | 2 +- src/main/java/org/ldk/structs/BaseSign.java | 164 +- src/main/java/org/ldk/structs/BestBlock.java | 2 +- src/main/java/org/ldk/structs/BlindedHop.java | 20 +- .../java/org/ldk/structs/BlindedPath.java | 78 + .../java/org/ldk/structs/BlindedRoute.java | 60 - .../java/org/ldk/structs/ChainMonitor.java | 23 +- .../java/org/ldk/structs/ChainParameters.java | 4 +- .../org/ldk/structs/ChannelAnnouncement.java | 6 +- .../java/org/ldk/structs/ChannelConfig.java | 2 +- .../org/ldk/structs/ChannelCounterparty.java | 10 +- .../java/org/ldk/structs/ChannelDetails.java | 73 +- .../java/org/ldk/structs/ChannelFeatures.java | 2 +- .../java/org/ldk/structs/ChannelInfo.java | 16 +- .../java/org/ldk/structs/ChannelManager.java | 213 +- .../ldk/structs/ChannelManagerReadArgs.java | 14 +- .../ldk/structs/ChannelMessageHandler.java | 38 +- .../java/org/ldk/structs/ChannelMonitor.java | 38 +- .../org/ldk/structs/ChannelPublicKeys.java | 2 +- .../java/org/ldk/structs/ChannelReady.java | 6 +- .../org/ldk/structs/ChannelReestablish.java | 2 +- .../structs/ChannelTransactionParameters.java | 33 +- .../org/ldk/structs/ChannelTypeFeatures.java | 2 +- .../java/org/ldk/structs/ChannelUpdate.java | 6 +- .../org/ldk/structs/ChannelUpdateInfo.java | 8 +- .../java/org/ldk/structs/ChannelUsage.java | 4 +- .../java/org/ldk/structs/ClosingSigned.java | 6 +- .../ldk/structs/ClosingSignedFeeRange.java | 2 +- .../org/ldk/structs/ClosingTransaction.java | 6 +- .../java/org/ldk/structs/ClosureReason.java | 2 +- .../org/ldk/structs/CommitmentSigned.java | 2 +- .../ldk/structs/CommitmentTransaction.java | 2 +- .../org/ldk/structs/CommitmentUpdate.java | 8 +- src/main/java/org/ldk/structs/Confirm.java | 110 +- ...nterpartyChannelTransactionParameters.java | 4 +- .../org/ldk/structs/CustomMessageHandler.java | 2 +- .../structs/CustomOnionMessageHandler.java | 2 +- .../java/org/ldk/structs/DataLossProtect.java | 2 +- .../java/org/ldk/structs/DecodeError.java | 2 +- .../java/org/ldk/structs/DefaultRouter.java | 5 +- .../DelayedPaymentOutputDescriptor.java | 39 +- .../java/org/ldk/structs/Description.java | 2 +- .../java/org/ldk/structs/Destination.java | 52 +- .../org/ldk/structs/DirectedChannelInfo.java | 15 - .../org/ldk/structs/EffectiveCapacity.java | 11 +- .../java/org/ldk/structs/ErrorAction.java | 6 +- .../java/org/ldk/structs/ErrorMessage.java | 2 +- src/main/java/org/ldk/structs/Event.java | 264 +- .../java/org/ldk/structs/EventHandler.java | 11 +- .../java/org/ldk/structs/EventsProvider.java | 8 +- src/main/java/org/ldk/structs/ExpiryTime.java | 2 +- src/main/java/org/ldk/structs/Fallback.java | 4 +- .../org/ldk/structs/FilesystemPersister.java | 2 +- src/main/java/org/ldk/structs/Filter.java | 2 +- .../java/org/ldk/structs/FundingCreated.java | 2 +- .../java/org/ldk/structs/FundingSigned.java | 2 +- src/main/java/org/ldk/structs/Future.java | 2 +- src/main/java/org/ldk/structs/GossipSync.java | 4 +- .../ldk/structs/GossipTimestampFilter.java | 2 +- .../java/org/ldk/structs/GraphSyncError.java | 4 +- .../java/org/ldk/structs/HTLCDestination.java | 31 +- .../ldk/structs/HTLCOutputInCommitment.java | 6 +- src/main/java/org/ldk/structs/HTLCUpdate.java | 2 +- .../structs/HolderCommitmentTransaction.java | 2 +- src/main/java/org/ldk/structs/Hostname.java | 2 +- .../java/org/ldk/structs/InFlightHtlcs.java | 37 +- .../java/org/ldk/structs/InMemorySigner.java | 97 +- src/main/java/org/ldk/structs/Init.java | 8 +- .../java/org/ldk/structs/InitFeatures.java | 2 +- src/main/java/org/ldk/structs/Invoice.java | 4 +- .../java/org/ldk/structs/InvoiceFeatures.java | 2 +- .../java/org/ldk/structs/InvoicePayer.java | 101 +- .../ldk/structs/InvoiceRequestFeatures.java | 99 + .../org/ldk/structs/InvoiceSignature.java | 2 +- .../java/org/ldk/structs/KeysInterface.java | 107 +- .../java/org/ldk/structs/KeysManager.java | 44 +- .../java/org/ldk/structs/LightningError.java | 4 +- .../java/org/ldk/structs/MessageHandler.java | 8 +- .../org/ldk/structs/MessageSendEvent.java | 40 +- .../org/ldk/structs/MinFinalCltvExpiry.java | 2 +- .../java/org/ldk/structs/MonitorEvent.java | 10 +- .../java/org/ldk/structs/MonitorUpdateId.java | 2 +- .../structs/MultiThreadedLockableScore.java | 2 +- src/main/java/org/ldk/structs/NetAddress.java | 4 +- .../java/org/ldk/structs/NetworkGraph.java | 32 +- .../java/org/ldk/structs/NetworkUpdate.java | 4 +- src/main/java/org/ldk/structs/NodeAlias.java | 2 +- .../org/ldk/structs/NodeAnnouncement.java | 6 +- .../org/ldk/structs/NodeAnnouncementInfo.java | 10 +- .../java/org/ldk/structs/NodeFeatures.java | 2 +- src/main/java/org/ldk/structs/NodeInfo.java | 8 +- .../java/org/ldk/structs/OfferFeatures.java | 99 + .../java/org/ldk/structs/OnionMessage.java | 2 +- .../org/ldk/structs/OnionMessageContents.java | 75 + .../org/ldk/structs/OnionMessageHandler.java | 4 +- .../java/org/ldk/structs/OnionMessenger.java | 26 +- .../java/org/ldk/structs/OpenChannel.java | 4 +- .../java/org/ldk/structs/Option_AccessZ.java | 2 +- .../ldk/structs/Option_C2Tuple_u64u64ZZ.java | 2 +- ...ouncementChannelUpdateChannelUpdateZZ.java | 2 +- .../ldk/structs/Option_ClosureReasonZ.java | 2 +- .../Option_CustomOnionMessageContentsZ.java | 2 +- .../java/org/ldk/structs/Option_EventZ.java | 2 +- .../java/org/ldk/structs/Option_FilterZ.java | 2 +- .../org/ldk/structs/Option_HTLCClaimZ.java | 74 + .../ldk/structs/Option_HTLCDestinationZ.java | 2 +- .../org/ldk/structs/Option_MonitorEventZ.java | 2 +- .../org/ldk/structs/Option_NetAddressZ.java | 2 +- .../ldk/structs/Option_NetworkUpdateZ.java | 2 +- .../java/org/ldk/structs/Option_TypeZ.java | 2 +- .../ldk/structs/Option_WriteableScoreZ.java | 2 +- .../java/org/ldk/structs/Option_u128Z.java | 95 + src/main/java/org/ldk/structs/OutPoint.java | 2 +- .../java/org/ldk/structs/P2PGossipSync.java | 7 +- src/main/java/org/ldk/structs/ParseError.java | 8 +- .../org/ldk/structs/ParseOrSemanticError.java | 4 +- .../java/org/ldk/structs/PayeePubKey.java | 2 +- src/main/java/org/ldk/structs/Payer.java | 64 +- .../java/org/ldk/structs/PaymentError.java | 4 +- .../org/ldk/structs/PaymentParameters.java | 8 +- .../org/ldk/structs/PaymentSendFailure.java | 89 +- .../java/org/ldk/structs/PeerManager.java | 12 +- src/main/java/org/ldk/structs/Persist.java | 4 +- src/main/java/org/ldk/structs/Persister.java | 6 +- .../org/ldk/structs/PhantomKeysManager.java | 5 +- src/main/java/org/ldk/structs/Ping.java | 2 +- src/main/java/org/ldk/structs/Pong.java | 2 +- .../org/ldk/structs/PositiveTimestamp.java | 2 +- .../java/org/ldk/structs/PrintableString.java | 48 + .../java/org/ldk/structs/PrivateRoute.java | 4 +- .../org/ldk/structs/ProbabilisticScorer.java | 14 +- .../org/ldk/structs/QueryChannelRange.java | 2 +- .../org/ldk/structs/QueryShortChannelIds.java | 2 +- .../java/org/ldk/structs/RapidGossipSync.java | 2 +- .../java/org/ldk/structs/RawDataPart.java | 4 +- src/main/java/org/ldk/structs/RawInvoice.java | 4 +- .../org/ldk/structs/ReadOnlyNetworkGraph.java | 2 +- .../org/ldk/structs/ReplyChannelRange.java | 2 +- .../ldk/structs/ReplyShortChannelIdsEnd.java | 2 +- .../Result_AcceptChannelDecodeErrorZ.java | 4 +- ...lt_AnnouncementSignaturesDecodeErrorZ.java | 4 +- .../Result_BlindedHopDecodeErrorZ.java | 30 +- .../Result_BlindedPathDecodeErrorZ.java | 95 + .../ldk/structs/Result_BlindedPathNoneZ.java | 89 + .../Result_BlindedRouteDecodeErrorZ.java | 85 - .../ldk/structs/Result_BlindedRouteNoneZ.java | 79 - ...uiltCommitmentTransactionDecodeErrorZ.java | 4 +- ..._BlockHashChannelManagerZDecodeErrorZ.java | 4 +- ..._BlockHashChannelMonitorZDecodeErrorZ.java | 4 +- ...mentHashPaymentIdZPaymentSendFailureZ.java | 4 +- ...le_PaymentHashPaymentSecretZAPIErrorZ.java | 4 +- ...2Tuple_PaymentHashPaymentSecretZNoneZ.java | 2 +- ...2Tuple_SignatureCVec_SignatureZZNoneZ.java | 2 +- ...sult_C2Tuple_SignatureSignatureZNoneZ.java | 2 +- ...lt_COption_ClosureReasonZDecodeErrorZ.java | 4 +- ...stomOnionMessageContentsZDecodeErrorZ.java | 4 +- .../Result_COption_EventZDecodeErrorZ.java | 4 +- ..._COption_HTLCDestinationZDecodeErrorZ.java | 4 +- ...ult_COption_MonitorEventZDecodeErrorZ.java | 4 +- ...lt_COption_NetworkUpdateZDecodeErrorZ.java | 4 +- .../Result_COption_TypeZDecodeErrorZ.java | 4 +- .../Result_CVec_u8ZPeerHandleErrorZ.java | 2 +- ...esult_ChannelAnnouncementDecodeErrorZ.java | 4 +- .../Result_ChannelConfigDecodeErrorZ.java | 4 +- ...esult_ChannelCounterpartyDecodeErrorZ.java | 4 +- .../Result_ChannelDetailsDecodeErrorZ.java | 4 +- .../Result_ChannelFeaturesDecodeErrorZ.java | 4 +- .../Result_ChannelInfoDecodeErrorZ.java | 4 +- ...sult_ChannelMonitorUpdateDecodeErrorZ.java | 4 +- .../Result_ChannelPublicKeysDecodeErrorZ.java | 4 +- .../Result_ChannelReadyDecodeErrorZ.java | 4 +- ...Result_ChannelReestablishDecodeErrorZ.java | 4 +- ...nnelTransactionParametersDecodeErrorZ.java | 4 +- ...esult_ChannelTypeFeaturesDecodeErrorZ.java | 4 +- .../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_FundingSignedDecodeErrorZ.java | 4 +- ...ult_GossipTimestampFilterDecodeErrorZ.java | 4 +- ...lt_HTLCOutputInCommitmentDecodeErrorZ.java | 4 +- .../Result_HTLCUpdateDecodeErrorZ.java | 4 +- ...lderCommitmentTransactionDecodeErrorZ.java | 4 +- .../Result_InFlightHtlcsDecodeErrorZ.java | 30 +- .../Result_InMemorySignerDecodeErrorZ.java | 4 +- .../ldk/structs/Result_InitDecodeErrorZ.java | 4 +- .../Result_InitFeaturesDecodeErrorZ.java | 4 +- .../Result_InvoiceFeaturesDecodeErrorZ.java | 4 +- .../Result_InvoiceParseOrSemanticErrorZ.java | 4 +- ...lt_InvoiceRequestFeaturesDecodeErrorZ.java | 95 + .../structs/Result_InvoiceSemanticErrorZ.java | 2 +- .../Result_InvoiceSignOrCreationErrorZ.java | 4 +- .../Result_LockedChannelMonitorNoneZ.java | 2 +- .../Result_NetAddressDecodeErrorZ.java | 4 +- .../Result_NetworkGraphDecodeErrorZ.java | 2 +- .../structs/Result_NodeAliasDecodeErrorZ.java | 4 +- .../Result_NodeAnnouncementDecodeErrorZ.java | 4 +- ...sult_NodeAnnouncementInfoDecodeErrorZ.java | 4 +- .../Result_NodeFeaturesDecodeErrorZ.java | 4 +- .../structs/Result_NodeIdDecodeErrorZ.java | 4 +- .../structs/Result_NodeInfoDecodeErrorZ.java | 4 +- .../org/ldk/structs/Result_NoneAPIErrorZ.java | 2 +- .../structs/Result_NoneLightningErrorZ.java | 2 +- .../ldk/structs/Result_NonePaymentErrorZ.java | 88 + .../Result_NonePaymentSendFailureZ.java | 2 +- .../structs/Result_NonePeerHandleErrorZ.java | 2 +- .../ldk/structs/Result_NoneSendErrorZ.java | 2 +- .../Result_OfferFeaturesDecodeErrorZ.java | 95 + .../Result_OnionMessageDecodeErrorZ.java | 4 +- .../Result_OpenChannelDecodeErrorZ.java | 4 +- .../structs/Result_OutPointDecodeErrorZ.java | 4 +- .../ldk/structs/Result_PayeePubKeyErrorZ.java | 2 +- ...Result_PaymentHashPaymentSendFailureZ.java | 91 + .../Result_PaymentIdPaymentErrorZ.java | 2 +- .../Result_PaymentIdPaymentSendFailureZ.java | 91 - .../Result_PaymentParametersDecodeErrorZ.java | 4 +- .../Result_PaymentPreimageAPIErrorZ.java | 2 +- .../Result_PaymentPurposeDecodeErrorZ.java | 4 +- .../Result_PaymentSecretAPIErrorZ.java | 2 +- .../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 | 2 +- .../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 +- .../ldk/structs/Result_SecretKeyErrorZ.java | 88 - .../structs/Result_ShutdownDecodeErrorZ.java | 4 +- .../Result_ShutdownScriptDecodeErrorZ.java | 4 +- ..._ShutdownScriptInvalidShutdownScriptZ.java | 4 +- .../structs/Result_SiPrefixParseErrorZ.java | 2 +- .../ldk/structs/Result_SignDecodeErrorZ.java | 4 +- .../Result_SignedRawInvoiceParseErrorZ.java | 4 +- ...SpendableOutputDescriptorDecodeErrorZ.java | 4 +- ...icPaymentOutputDescriptorDecodeErrorZ.java | 4 +- ...Result_TrustedClosingTransactionNoneZ.java | 2 +- ...ult_TrustedCommitmentTransactionNoneZ.java | 2 +- .../Result_TxCreationKeysDecodeErrorZ.java | 4 +- .../structs/Result_TxCreationKeysErrorZ.java | 92 - .../ldk/structs/Result_TxOutAccessErrorZ.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 +- .../ldk/structs/Result__u832APIErrorZ.java | 2 +- .../structs/Result_boolLightningErrorZ.java | 2 +- .../structs/Result_boolPeerHandleErrorZ.java | 2 +- .../structs/Result_u32GraphSyncErrorZ.java | 2 +- src/main/java/org/ldk/structs/Retry.java | 2 +- .../java/org/ldk/structs/RevokeAndACK.java | 2 +- src/main/java/org/ldk/structs/Route.java | 6 +- src/main/java/org/ldk/structs/RouteHint.java | 2 +- .../java/org/ldk/structs/RouteHintHop.java | 10 +- src/main/java/org/ldk/structs/RouteHop.java | 8 +- .../java/org/ldk/structs/RouteParameters.java | 4 +- src/main/java/org/ldk/structs/Router.java | 70 +- .../java/org/ldk/structs/RoutingFees.java | 2 +- .../ldk/structs/RoutingMessageHandler.java | 16 +- src/main/java/org/ldk/structs/Score.java | 2 +- .../ScorerAccountingForInFlightHtlcs.java | 65 + src/main/java/org/ldk/structs/SendError.java | 55 +- src/main/java/org/ldk/structs/Sha256.java | 2 +- src/main/java/org/ldk/structs/Shutdown.java | 2 +- .../java/org/ldk/structs/ShutdownScript.java | 6 +- src/main/java/org/ldk/structs/Sign.java | 10 +- .../org/ldk/structs/SignOrCreationError.java | 2 +- .../org/ldk/structs/SignedRawInvoice.java | 2 +- .../structs/SpendableOutputDescriptor.java | 87 +- .../StaticPaymentOutputDescriptor.java | 31 +- ...nouncementChannelUpdateChannelUpdateZ.java | 2 +- ..._OutPointCVec_MonitorEventZPublicKeyZ.java | 2 +- ...uple_RawInvoice_u832InvoiceSignatureZ.java | 2 +- .../structs/TrustedCommitmentTransaction.java | 2 +- .../TwoTuple_BlockHashChannelMonitorZ.java | 2 +- ...oTuple_OutPointCVec_MonitorUpdateIdZZ.java | 86 + .../ldk/structs/TwoTuple_OutPointScriptZ.java | 2 +- .../ldk/structs/TwoTuple_PublicKeyTypeZ.java | 2 +- .../ldk/structs/TwoTuple_TxidBlockHashZ.java | 73 + .../org/ldk/structs/TwoTuple_u32TxOutZ.java | 2 +- .../java/org/ldk/structs/TxCreationKeys.java | 12 +- .../structs/UnsignedChannelAnnouncement.java | 4 +- .../ldk/structs/UnsignedChannelUpdate.java | 2 +- .../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 | 2 +- .../org/ldk/structs/UpdateFulfillHTLC.java | 2 +- src/main/java/org/ldk/structs/UserConfig.java | 47 +- .../java/org/ldk/structs/UtilMethods.java | 162 +- .../java/org/ldk/structs/WarningMessage.java | 2 +- src/main/java/org/ldk/structs/Watch.java | 4 +- .../java/org/ldk/structs/WatchedOutput.java | 6 +- src/main/jni/bindings.c | 7981 ++++++++++------- src/main/jni/bindings.c.body | 7981 ++++++++++------- src/main/jni/org_ldk_enums_HTLCClaim.h | 21 + src/main/jni/org_ldk_impl_bindings.h | 3864 ++++---- ..._ldk_impl_bindings_LDKCOption_HTLCClaimZ.h | 21 + .../org_ldk_impl_bindings_LDKCOption_u128Z.h | 21 + ...dk_impl_bindings_LDKOnionMessageContents.h | 21 + 333 files changed, 16537 insertions(+), 10200 deletions(-) create mode 100644 src/main/java/org/ldk/enums/HTLCClaim.java create mode 100644 src/main/java/org/ldk/structs/BlindedPath.java delete mode 100644 src/main/java/org/ldk/structs/BlindedRoute.java create mode 100644 src/main/java/org/ldk/structs/InvoiceRequestFeatures.java create mode 100644 src/main/java/org/ldk/structs/OfferFeatures.java create mode 100644 src/main/java/org/ldk/structs/OnionMessageContents.java create mode 100644 src/main/java/org/ldk/structs/Option_HTLCClaimZ.java create mode 100644 src/main/java/org/ldk/structs/Option_u128Z.java create mode 100644 src/main/java/org/ldk/structs/PrintableString.java create mode 100644 src/main/java/org/ldk/structs/Result_BlindedPathDecodeErrorZ.java create mode 100644 src/main/java/org/ldk/structs/Result_BlindedPathNoneZ.java delete mode 100644 src/main/java/org/ldk/structs/Result_BlindedRouteDecodeErrorZ.java delete mode 100644 src/main/java/org/ldk/structs/Result_BlindedRouteNoneZ.java create mode 100644 src/main/java/org/ldk/structs/Result_InvoiceRequestFeaturesDecodeErrorZ.java create mode 100644 src/main/java/org/ldk/structs/Result_NonePaymentErrorZ.java create mode 100644 src/main/java/org/ldk/structs/Result_OfferFeaturesDecodeErrorZ.java create mode 100644 src/main/java/org/ldk/structs/Result_PaymentHashPaymentSendFailureZ.java delete mode 100644 src/main/java/org/ldk/structs/Result_PaymentIdPaymentSendFailureZ.java delete mode 100644 src/main/java/org/ldk/structs/Result_SecretKeyErrorZ.java delete mode 100644 src/main/java/org/ldk/structs/Result_TxCreationKeysErrorZ.java create mode 100644 src/main/java/org/ldk/structs/ScorerAccountingForInFlightHtlcs.java create mode 100644 src/main/java/org/ldk/structs/TwoTuple_OutPointCVec_MonitorUpdateIdZZ.java create mode 100644 src/main/java/org/ldk/structs/TwoTuple_TxidBlockHashZ.java create mode 100644 src/main/jni/org_ldk_enums_HTLCClaim.h create mode 100644 src/main/jni/org_ldk_impl_bindings_LDKCOption_HTLCClaimZ.h create mode 100644 src/main/jni/org_ldk_impl_bindings_LDKCOption_u128Z.h create mode 100644 src/main/jni/org_ldk_impl_bindings_LDKOnionMessageContents.h diff --git a/src/main/java/org/ldk/enums/HTLCClaim.java b/src/main/java/org/ldk/enums/HTLCClaim.java new file mode 100644 index 00000000..da90c2e0 --- /dev/null +++ b/src/main/java/org/ldk/enums/HTLCClaim.java @@ -0,0 +1,29 @@ +package org.ldk.enums; + +/** + * Describes the type of HTLC claim as determined by analyzing the witness. + */ +public enum HTLCClaim { + /** + * Claims an offered output on a commitment transaction through the timeout path. + */ + LDKHTLCClaim_OfferedTimeout, + /** + * Claims an offered output on a commitment transaction through the success path. + */ + LDKHTLCClaim_OfferedPreimage, + /** + * Claims an accepted output on a commitment transaction through the timeout path. + */ + LDKHTLCClaim_AcceptedTimeout, + /** + * Claims an accepted output on a commitment transaction through the success path. + */ + LDKHTLCClaim_AcceptedPreimage, + /** + * Claims an offered/accepted output on a commitment transaction through the revocation path. + */ + LDKHTLCClaim_Revocation, + ; static native void init(); + static { init(); } +} \ No newline at end of file diff --git a/src/main/java/org/ldk/enums/Recipient.java b/src/main/java/org/ldk/enums/Recipient.java index fb51877c..488ecab3 100644 --- a/src/main/java/org/ldk/enums/Recipient.java +++ b/src/main/java/org/ldk/enums/Recipient.java @@ -1,8 +1,10 @@ package org.ldk.enums; /** - * Specifies the recipient of an invoice, to indicate to [`KeysInterface::sign_invoice`] what node - * secret key should be used to sign the invoice. + * Specifies the recipient of an invoice. + * + * This indicates to [`KeysInterface::sign_invoice`] what node secret key should be used to sign + * the invoice. */ public enum Recipient { /** diff --git a/src/main/java/org/ldk/impl/bindings.java b/src/main/java/org/ldk/impl/bindings.java index 5769b781..f357e10d 100644 --- a/src/main/java/org/ldk/impl/bindings.java +++ b/src/main/java/org/ldk/impl/bindings.java @@ -9,14 +9,6 @@ import java.nio.file.Path; import java.nio.file.StandardCopyOption; public class bindings { - public static class VecOrSliceDef { - public long dataptr; - public long datalen; - public long stride; - public VecOrSliceDef(long dataptr, long datalen, long stride) { - this.dataptr = dataptr; this.datalen = datalen; this.stride = stride; - } - } static { try { // Try to load natively first, this works on Android and in testing. @@ -39,39 +31,27 @@ public class bindings { throw new IllegalArgumentException(e); } } - init(java.lang.Enum.class, VecOrSliceDef.class); + init(java.lang.Enum.class); init_class_cache(); if (!get_lib_version_string().equals(version.get_ldk_java_bindings_version())) throw new IllegalArgumentException("Compiled LDK library and LDK class failes do not match"); // Fetching the LDK versions from C also checks that the header and binaries match - get_ldk_c_bindings_version(); - get_ldk_version(); + System.err.println("Loaded LDK-Java Bindings " + version.get_ldk_java_bindings_version() + " with LDK " + get_ldk_version() + " and LDK-C-Bindings " + get_ldk_c_bindings_version()); } - static native void init(java.lang.Class c, java.lang.Class slicedef); + static native void init(java.lang.Class c); static native void init_class_cache(); static native String get_lib_version_string(); public static native String get_ldk_c_bindings_version(); public static native String get_ldk_version(); - public static native boolean deref_bool(long ptr); - public static native long deref_long(long ptr); - public static native void free_heap_ptr(long ptr); - public static native byte[] read_bytes(long ptr, long len); - public static native byte[] get_u8_slice_bytes(long slice_ptr); - public static native long bytes_to_u8_vec(byte[] bytes); - public static native long new_txpointer_copy_data(byte[] txdata); - public static native void txpointer_free(long ptr); - public static native byte[] txpointer_get_buffer(long ptr); - public static native long vec_slice_len(long vec); - public static native long new_empty_slice_vec(); - static { AccessError.values(); /* Force enum statics to run */ } static { COption_NoneZ.values(); /* Force enum statics to run */ } static { ChannelMonitorUpdateStatus.values(); /* Force enum statics to run */ } static { ConfirmationTarget.values(); /* Force enum statics to run */ } static { CreationError.values(); /* Force enum statics to run */ } static { Currency.values(); /* Force enum statics to run */ } + static { HTLCClaim.values(); /* Force enum statics to run */ } static { IOError.values(); /* Force enum statics to run */ } static { Level.values(); /* Force enum statics to run */ } static { Network.values(); /* Force enum statics to run */ } @@ -116,10 +96,23 @@ public class bindings { public static native byte[] TxOut_get_script_pubkey(long thing); // uint64_t TxOut_get_value (struct LDKTxOut* thing) public static native long TxOut_get_value(long thing); - // struct LDKBlindedRoute CResult_BlindedRouteNoneZ_get_ok(LDKCResult_BlindedRouteNoneZ *NONNULL_PTR owner); - public static native long CResult_BlindedRouteNoneZ_get_ok(long owner); - // void CResult_BlindedRouteNoneZ_get_err(LDKCResult_BlindedRouteNoneZ *NONNULL_PTR owner); - public static native void CResult_BlindedRouteNoneZ_get_err(long owner); + public static class LDKCOption_HTLCClaimZ { + private LDKCOption_HTLCClaimZ() {} + public final static class Some extends LDKCOption_HTLCClaimZ { + public org.ldk.enums.HTLCClaim some; + Some(org.ldk.enums.HTLCClaim some) { this.some = some; } + } + public final static class None extends LDKCOption_HTLCClaimZ { + None() { } + } + static native void init(); + } + static { LDKCOption_HTLCClaimZ.init(); } + public static native LDKCOption_HTLCClaimZ LDKCOption_HTLCClaimZ_ref_from_ptr(long ptr); + // void CResult_NoneNoneZ_get_ok(LDKCResult_NoneNoneZ *NONNULL_PTR owner); + public static native void CResult_NoneNoneZ_get_ok(long owner); + // void CResult_NoneNoneZ_get_err(LDKCResult_NoneNoneZ *NONNULL_PTR owner); + public static native void CResult_NoneNoneZ_get_err(long owner); public static class LDKDecodeError { private LDKDecodeError() {} public final static class UnknownVersion extends LDKDecodeError { @@ -148,30 +141,10 @@ public class bindings { } static { LDKDecodeError.init(); } public static native LDKDecodeError LDKDecodeError_ref_from_ptr(long ptr); - // struct LDKBlindedRoute CResult_BlindedRouteDecodeErrorZ_get_ok(LDKCResult_BlindedRouteDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_BlindedRouteDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_BlindedRouteDecodeErrorZ_get_err(LDKCResult_BlindedRouteDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_BlindedRouteDecodeErrorZ_get_err(long owner); - // struct LDKBlindedHop CResult_BlindedHopDecodeErrorZ_get_ok(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_BlindedHopDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_BlindedHopDecodeErrorZ_get_err(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_BlindedHopDecodeErrorZ_get_err(long owner); - // void CResult_NoneNoneZ_get_ok(LDKCResult_NoneNoneZ *NONNULL_PTR owner); - public static native void CResult_NoneNoneZ_get_ok(long owner); - // void CResult_NoneNoneZ_get_err(LDKCResult_NoneNoneZ *NONNULL_PTR owner); - public static native void CResult_NoneNoneZ_get_err(long owner); // struct LDKCounterpartyCommitmentSecrets CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(long owner); - // struct LDKSecretKey CResult_SecretKeyErrorZ_get_ok(LDKCResult_SecretKeyErrorZ *NONNULL_PTR owner); - public static native byte[] CResult_SecretKeyErrorZ_get_ok(long owner); - // enum LDKSecp256k1Error CResult_SecretKeyErrorZ_get_err(LDKCResult_SecretKeyErrorZ *NONNULL_PTR owner); - public static native Secp256k1Error CResult_SecretKeyErrorZ_get_err(long owner); - // struct LDKPublicKey CResult_PublicKeyErrorZ_get_ok(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner); - public static native byte[] CResult_PublicKeyErrorZ_get_ok(long owner); - // enum LDKSecp256k1Error CResult_PublicKeyErrorZ_get_err(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner); - public static native Secp256k1Error CResult_PublicKeyErrorZ_get_err(long owner); // struct LDKTxCreationKeys CResult_TxCreationKeysDecodeErrorZ_get_ok(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_TxCreationKeysDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_TxCreationKeysDecodeErrorZ_get_err(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR owner); @@ -180,10 +153,6 @@ public class bindings { public static native long CResult_ChannelPublicKeysDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_ChannelPublicKeysDecodeErrorZ_get_err(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_ChannelPublicKeysDecodeErrorZ_get_err(long owner); - // struct LDKTxCreationKeys CResult_TxCreationKeysErrorZ_get_ok(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR owner); - public static native long CResult_TxCreationKeysErrorZ_get_ok(long owner); - // enum LDKSecp256k1Error CResult_TxCreationKeysErrorZ_get_err(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR owner); - public static native Secp256k1Error CResult_TxCreationKeysErrorZ_get_err(long owner); public static class LDKCOption_u32Z { private LDKCOption_u32Z() {} public final static class Some extends LDKCOption_u32Z { @@ -241,6 +210,18 @@ public class bindings { public static native long CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(long owner); // struct LDKInvalidShutdownScript CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR owner); public static native long CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(long owner); + // struct LDKBlindedPath CResult_BlindedPathNoneZ_get_ok(LDKCResult_BlindedPathNoneZ *NONNULL_PTR owner); + public static native long CResult_BlindedPathNoneZ_get_ok(long owner); + // void CResult_BlindedPathNoneZ_get_err(LDKCResult_BlindedPathNoneZ *NONNULL_PTR owner); + public static native void CResult_BlindedPathNoneZ_get_err(long owner); + // struct LDKBlindedPath CResult_BlindedPathDecodeErrorZ_get_ok(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_BlindedPathDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_BlindedPathDecodeErrorZ_get_err(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_BlindedPathDecodeErrorZ_get_err(long owner); + // struct LDKBlindedHop CResult_BlindedHopDecodeErrorZ_get_ok(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_BlindedHopDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_BlindedHopDecodeErrorZ_get_err(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_BlindedHopDecodeErrorZ_get_err(long owner); public 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); @@ -292,18 +273,10 @@ public class bindings { public static native void CResult_NoneErrorZ_get_ok(long owner); // enum LDKIOError CResult_NoneErrorZ_get_err(LDKCResult_NoneErrorZ *NONNULL_PTR owner); public static native IOError CResult_NoneErrorZ_get_err(long owner); - // struct LDKRouteHop CResult_RouteHopDecodeErrorZ_get_ok(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_RouteHopDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_RouteHopDecodeErrorZ_get_err(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_RouteHopDecodeErrorZ_get_err(long owner); - // struct LDKRoute CResult_RouteDecodeErrorZ_get_ok(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_RouteDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_RouteDecodeErrorZ_get_err(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_RouteDecodeErrorZ_get_err(long owner); - // struct LDKRouteParameters CResult_RouteParametersDecodeErrorZ_get_ok(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_RouteParametersDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_RouteParametersDecodeErrorZ_get_err(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_RouteParametersDecodeErrorZ_get_err(long owner); + // struct LDKRoute CResult_RouteLightningErrorZ_get_ok(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner); + public static native long CResult_RouteLightningErrorZ_get_ok(long owner); + // struct LDKLightningError CResult_RouteLightningErrorZ_get_err(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner); + public static native long CResult_RouteLightningErrorZ_get_err(long owner); public static class LDKCOption_u64Z { private LDKCOption_u64Z() {} public final static class Some extends LDKCOption_u64Z { @@ -317,6 +290,22 @@ public class bindings { } static { LDKCOption_u64Z.init(); } public static native LDKCOption_u64Z LDKCOption_u64Z_ref_from_ptr(long ptr); + // struct LDKInFlightHtlcs CResult_InFlightHtlcsDecodeErrorZ_get_ok(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_InFlightHtlcsDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_InFlightHtlcsDecodeErrorZ_get_err(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_InFlightHtlcsDecodeErrorZ_get_err(long owner); + // struct LDKRouteHop CResult_RouteHopDecodeErrorZ_get_ok(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_RouteHopDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_RouteHopDecodeErrorZ_get_err(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_RouteHopDecodeErrorZ_get_err(long owner); + // struct LDKRoute CResult_RouteDecodeErrorZ_get_ok(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_RouteDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_RouteDecodeErrorZ_get_err(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_RouteDecodeErrorZ_get_err(long owner); + // struct LDKRouteParameters CResult_RouteParametersDecodeErrorZ_get_ok(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_RouteParametersDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_RouteParametersDecodeErrorZ_get_err(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_RouteParametersDecodeErrorZ_get_err(long owner); // struct LDKPaymentParameters CResult_PaymentParametersDecodeErrorZ_get_ok(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_PaymentParametersDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_PaymentParametersDecodeErrorZ_get_err(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR owner); @@ -329,10 +318,6 @@ public class bindings { public static native long CResult_RouteHintHopDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_RouteHintHopDecodeErrorZ_get_err(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_RouteHintHopDecodeErrorZ_get_err(long owner); - // struct LDKRoute CResult_RouteLightningErrorZ_get_ok(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner); - public static native long CResult_RouteLightningErrorZ_get_ok(long owner); - // struct LDKLightningError CResult_RouteLightningErrorZ_get_err(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner); - public static native long CResult_RouteLightningErrorZ_get_err(long owner); public static class LDKPaymentPurpose { private LDKPaymentPurpose() {} public final static class InvoicePayment extends LDKPaymentPurpose { @@ -412,6 +397,10 @@ public class bindings { public long requested_forward_scid; UnknownNextHop(long requested_forward_scid) { this.requested_forward_scid = requested_forward_scid; } } + public final static class InvalidForward extends LDKHTLCDestination { + public long requested_forward_scid; + InvalidForward(long requested_forward_scid) { this.requested_forward_scid = requested_forward_scid; } + } public final static class FailedPayment extends LDKHTLCDestination { public byte[] payment_hash; FailedPayment(byte[] payment_hash) { this.payment_hash = payment_hash; } @@ -437,6 +426,19 @@ public class bindings { public static native long CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(long owner); + public static class LDKCOption_u128Z { + private LDKCOption_u128Z() {} + public final static class Some extends LDKCOption_u128Z { + public byte[] some; + Some(byte[] some) { this.some = some; } + } + public final static class None extends LDKCOption_u128Z { + None() { } + } + static native void init(); + } + static { LDKCOption_u128Z.init(); } + public static native LDKCOption_u128Z LDKCOption_u128Z_ref_from_ptr(long ptr); public static class LDKNetworkUpdate { private LDKNetworkUpdate() {} public final static class ChannelUpdateMessage extends LDKNetworkUpdate { @@ -496,20 +498,24 @@ public class bindings { public byte[] counterparty_node_id; public long channel_value_satoshis; public byte[] output_script; - public long 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 byte[] user_channel_id; + FundingGenerationReady(byte[] temporary_channel_id, byte[] counterparty_node_id, long channel_value_satoshis, byte[] output_script, byte[] user_channel_id) { this.temporary_channel_id = temporary_channel_id; this.counterparty_node_id = counterparty_node_id; this.channel_value_satoshis = channel_value_satoshis; this.output_script = output_script; this.user_channel_id = user_channel_id; } } - public final static class PaymentReceived extends LDKEvent { + public final static class PaymentClaimable extends LDKEvent { + public byte[] receiver_node_id; public byte[] payment_hash; 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 byte[] via_channel_id; + public long via_user_channel_id; + PaymentClaimable(byte[] receiver_node_id, byte[] payment_hash, long amount_msat, long purpose, byte[] via_channel_id, long via_user_channel_id) { this.receiver_node_id = receiver_node_id; this.payment_hash = payment_hash; this.amount_msat = amount_msat; this.purpose = purpose; this.via_channel_id = via_channel_id; this.via_user_channel_id = via_user_channel_id; } } public final static class PaymentClaimed extends LDKEvent { + public byte[] receiver_node_id; public byte[] payment_hash; public long amount_msat; public long purpose; - PaymentClaimed(byte[] payment_hash, long amount_msat, long purpose) { this.payment_hash = payment_hash; this.amount_msat = amount_msat; this.purpose = purpose; } + PaymentClaimed(byte[] receiver_node_id, byte[] payment_hash, long amount_msat, long purpose) { this.receiver_node_id = receiver_node_id; this.payment_hash = payment_hash; this.amount_msat = amount_msat; this.purpose = purpose; } } public final static class PaymentSent extends LDKEvent { public byte[] payment_id; @@ -557,6 +563,14 @@ public class bindings { public long time_forwardable; PendingHTLCsForwardable(long time_forwardable) { this.time_forwardable = time_forwardable; } } + public final static class HTLCIntercepted extends LDKEvent { + public byte[] intercept_id; + public long requested_next_hop_scid; + public byte[] payment_hash; + public long inbound_amount_msat; + public long expected_outbound_amount_msat; + HTLCIntercepted(byte[] intercept_id, long requested_next_hop_scid, byte[] payment_hash, long inbound_amount_msat, long expected_outbound_amount_msat) { this.intercept_id = intercept_id; this.requested_next_hop_scid = requested_next_hop_scid; this.payment_hash = payment_hash; this.inbound_amount_msat = inbound_amount_msat; this.expected_outbound_amount_msat = expected_outbound_amount_msat; } + } public final static class SpendableOutputs extends LDKEvent { public long[] outputs; SpendableOutputs(long[] outputs) { this.outputs = outputs; } @@ -568,11 +582,18 @@ public class bindings { public boolean 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 ChannelReady extends LDKEvent { + public byte[] channel_id; + public byte[] user_channel_id; + public byte[] counterparty_node_id; + public long channel_type; + ChannelReady(byte[] channel_id, byte[] user_channel_id, byte[] counterparty_node_id, long channel_type) { this.channel_id = channel_id; this.user_channel_id = user_channel_id; this.counterparty_node_id = counterparty_node_id; this.channel_type = channel_type; } + } public final static class ChannelClosed extends LDKEvent { public byte[] channel_id; - public long user_channel_id; + public byte[] user_channel_id; public long reason; - ChannelClosed(byte[] channel_id, long user_channel_id, long reason) { this.channel_id = channel_id; this.user_channel_id = user_channel_id; this.reason = reason; } + ChannelClosed(byte[] channel_id, byte[] user_channel_id, long reason) { this.channel_id = channel_id; this.user_channel_id = user_channel_id; this.reason = reason; } } public final static class DiscardFunding extends LDKEvent { public byte[] channel_id; @@ -756,6 +777,10 @@ public class bindings { 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); + // struct LDKThirtyTwoBytes C2Tuple_TxidBlockHashZ_get_a(LDKC2Tuple_TxidBlockHashZ *NONNULL_PTR owner); + public static native byte[] C2Tuple_TxidBlockHashZ_get_a(long owner); + // struct LDKThirtyTwoBytes C2Tuple_TxidBlockHashZ_get_b(LDKC2Tuple_TxidBlockHashZ *NONNULL_PTR owner); + public static native byte[] C2Tuple_TxidBlockHashZ_get_b(long owner); public static class LDKMonitorEvent { private LDKMonitorEvent() {} public final static class HTLCEvent extends LDKMonitorEvent { @@ -834,6 +859,14 @@ 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 LDKOfferFeatures CResult_OfferFeaturesDecodeErrorZ_get_ok(LDKCResult_OfferFeaturesDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_OfferFeaturesDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_OfferFeaturesDecodeErrorZ_get_err(LDKCResult_OfferFeaturesDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_OfferFeaturesDecodeErrorZ_get_err(long owner); + // struct LDKInvoiceRequestFeatures CResult_InvoiceRequestFeaturesDecodeErrorZ_get_ok(LDKCResult_InvoiceRequestFeaturesDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_InvoiceRequestFeaturesDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_InvoiceRequestFeaturesDecodeErrorZ_get_err(LDKCResult_InvoiceRequestFeaturesDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_InvoiceRequestFeaturesDecodeErrorZ_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); @@ -1032,7 +1065,7 @@ public class bindings { long sign_closing_transaction(long closing_tx); long sign_holder_anchor_input(byte[] anchor_tx, long input); long sign_channel_announcement(long msg); - void ready_channel(long channel_parameters); + void provide_channel_parameters(long channel_parameters); } public static native long LDKBaseSign_new(LDKBaseSign impl, long pubkeys); // LDKPublicKey BaseSign_get_per_commitment_point LDKBaseSign *NONNULL_PTR this_arg, uint64_t idx @@ -1061,8 +1094,8 @@ public class bindings { public static native long BaseSign_sign_holder_anchor_input(long this_arg, byte[] anchor_tx, long input); // LDKCResult_C2Tuple_SignatureSignatureZNoneZ BaseSign_sign_channel_announcement LDKBaseSign *NONNULL_PTR this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg public static native long BaseSign_sign_channel_announcement(long this_arg, long msg); - // void BaseSign_ready_channel LDKBaseSign *NONNULL_PTR this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters - public static native void BaseSign_ready_channel(long this_arg, long channel_parameters); + // void BaseSign_provide_channel_parameters LDKBaseSign *NONNULL_PTR this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters + public static native void BaseSign_provide_channel_parameters(long this_arg, long channel_parameters); // LDKChannelPublicKeys BaseSign_get_pubkeys LDKBaseSign *NONNULL_PTR this_arg public static native long BaseSign_get_pubkeys(long this_arg); public interface LDKSign { @@ -1124,9 +1157,9 @@ public class bindings { public int feerate; FeeRateTooHigh(java.lang.String err, int feerate) { this.err = err; this.feerate = feerate; } } - public final static class RouteError extends LDKAPIError { + public final static class InvalidRoute extends LDKAPIError { public java.lang.String err; - RouteError(java.lang.String err) { this.err = err; } + InvalidRoute(java.lang.String err) { this.err = err; } } public final static class ChannelUnavailable extends LDKAPIError { public java.lang.String err; @@ -1161,9 +1194,12 @@ public class bindings { public long[] path_parameter_error; PathParameterError(long[] path_parameter_error) { this.path_parameter_error = path_parameter_error; } } - public final static class AllFailedRetrySafe extends LDKPaymentSendFailure { - public long[] all_failed_retry_safe; - AllFailedRetrySafe(long[] all_failed_retry_safe) { this.all_failed_retry_safe = all_failed_retry_safe; } + public final static class AllFailedResendSafe extends LDKPaymentSendFailure { + public long[] all_failed_resend_safe; + AllFailedResendSafe(long[] all_failed_resend_safe) { this.all_failed_resend_safe = all_failed_resend_safe; } + } + public final static class DuplicatePayment extends LDKPaymentSendFailure { + DuplicatePayment() { } } public final static class PartialFailure extends LDKPaymentSendFailure { public long[] results; @@ -1175,14 +1211,14 @@ public class bindings { } static { LDKPaymentSendFailure.init(); } public static native LDKPaymentSendFailure LDKPaymentSendFailure_ref_from_ptr(long ptr); - // struct LDKThirtyTwoBytes CResult_PaymentIdPaymentSendFailureZ_get_ok(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR owner); - public static native byte[] CResult_PaymentIdPaymentSendFailureZ_get_ok(long owner); - // struct LDKPaymentSendFailure CResult_PaymentIdPaymentSendFailureZ_get_err(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR owner); - public static native long CResult_PaymentIdPaymentSendFailureZ_get_err(long owner); // void CResult_NonePaymentSendFailureZ_get_ok(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner); public static native void CResult_NonePaymentSendFailureZ_get_ok(long owner); // struct LDKPaymentSendFailure CResult_NonePaymentSendFailureZ_get_err(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner); public static native long CResult_NonePaymentSendFailureZ_get_err(long owner); + // struct LDKThirtyTwoBytes CResult_PaymentHashPaymentSendFailureZ_get_ok(LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR owner); + public static native byte[] CResult_PaymentHashPaymentSendFailureZ_get_ok(long owner); + // struct LDKPaymentSendFailure CResult_PaymentHashPaymentSendFailureZ_get_err(LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR owner); + public static native long CResult_PaymentHashPaymentSendFailureZ_get_err(long owner); // struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_a(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR owner); public static native byte[] C2Tuple_PaymentHashPaymentIdZ_get_a(long owner); // struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_b(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR owner); @@ -1255,7 +1291,8 @@ public class bindings { long ecdh(Recipient recipient, byte[] other_key, long tweak); byte[] get_destination_script(); long get_shutdown_scriptpubkey(); - long get_channel_signer(boolean inbound, long channel_value_satoshis); + byte[] generate_channel_keys_id(boolean inbound, long channel_value_satoshis, byte[] user_channel_id); + long derive_channel_signer(long channel_value_satoshis, byte[] channel_keys_id); byte[] get_secure_random_bytes(); long read_chan_signer(byte[] reader); long sign_invoice(byte[] hrp_bytes, byte[] invoice_data, Recipient receipient); @@ -1272,13 +1309,15 @@ public class bindings { public static native byte[] KeysInterface_get_destination_script(long this_arg); // LDKShutdownScript KeysInterface_get_shutdown_scriptpubkey LDKKeysInterface *NONNULL_PTR this_arg public static native long KeysInterface_get_shutdown_scriptpubkey(long this_arg); - // LDKSign KeysInterface_get_channel_signer LDKKeysInterface *NONNULL_PTR this_arg, bool inbound, uint64_t channel_value_satoshis - public static native long KeysInterface_get_channel_signer(long this_arg, boolean inbound, long channel_value_satoshis); + // LDKThirtyTwoBytes KeysInterface_generate_channel_keys_id LDKKeysInterface *NONNULL_PTR this_arg, bool inbound, uint64_t channel_value_satoshis, struct LDKU128 user_channel_id + public static native byte[] KeysInterface_generate_channel_keys_id(long this_arg, boolean inbound, long channel_value_satoshis, byte[] user_channel_id); + // LDKSign KeysInterface_derive_channel_signer LDKKeysInterface *NONNULL_PTR this_arg, uint64_t channel_value_satoshis, struct LDKThirtyTwoBytes channel_keys_id + public static native long KeysInterface_derive_channel_signer(long this_arg, long channel_value_satoshis, byte[] channel_keys_id); // LDKThirtyTwoBytes KeysInterface_get_secure_random_bytes LDKKeysInterface *NONNULL_PTR this_arg public static native byte[] KeysInterface_get_secure_random_bytes(long this_arg); // LDKCResult_SignDecodeErrorZ KeysInterface_read_chan_signer LDKKeysInterface *NONNULL_PTR this_arg, struct LDKu8slice reader public static native long KeysInterface_read_chan_signer(long this_arg, byte[] reader); - // LDKCResult_RecoverableSignatureNoneZ KeysInterface_sign_invoice LDKKeysInterface *NONNULL_PTR this_arg, struct LDKu8slice hrp_bytes, struct LDKCVec_u5Z invoice_data, enum LDKRecipient receipient + // LDKCResult_RecoverableSignatureNoneZ KeysInterface_sign_invoice LDKKeysInterface *NONNULL_PTR this_arg, struct LDKu8slice hrp_bytes, struct LDKCVec_U5Z invoice_data, enum LDKRecipient receipient public static native long KeysInterface_sign_invoice(long this_arg, byte[] hrp_bytes, byte[] invoice_data, Recipient receipient); // LDKThirtyTwoBytes KeysInterface_get_inbound_payment_key_material LDKKeysInterface *NONNULL_PTR this_arg public static native byte[] KeysInterface_get_inbound_payment_key_material(long this_arg); @@ -1355,135 +1394,18 @@ public class bindings { public static native byte[] CResult_PaymentIdPaymentErrorZ_get_ok(long owner); // struct LDKPaymentError CResult_PaymentIdPaymentErrorZ_get_err(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR owner); public static native long CResult_PaymentIdPaymentErrorZ_get_err(long owner); - // struct LDKInFlightHtlcs CResult_InFlightHtlcsDecodeErrorZ_get_ok(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_InFlightHtlcsDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_InFlightHtlcsDecodeErrorZ_get_err(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_InFlightHtlcsDecodeErrorZ_get_err(long owner); - public static class LDKParseError { - private LDKParseError() {} - public final static class Bech32Error extends LDKParseError { - public long bech32_error; - Bech32Error(long bech32_error) { this.bech32_error = bech32_error; } - } - public final static class ParseAmountError extends LDKParseError { - public int parse_amount_error; - ParseAmountError(int parse_amount_error) { this.parse_amount_error = parse_amount_error; } - } - public final static class MalformedSignature extends LDKParseError { - public org.ldk.enums.Secp256k1Error malformed_signature; - MalformedSignature(org.ldk.enums.Secp256k1Error malformed_signature) { this.malformed_signature = malformed_signature; } - } - public final static class BadPrefix extends LDKParseError { - BadPrefix() { } - } - public final static class UnknownCurrency extends LDKParseError { - UnknownCurrency() { } - } - public final static class UnknownSiPrefix extends LDKParseError { - UnknownSiPrefix() { } - } - public final static class MalformedHRP extends LDKParseError { - MalformedHRP() { } - } - public final static class TooShortDataPart extends LDKParseError { - TooShortDataPart() { } - } - public final static class UnexpectedEndOfTaggedFields extends LDKParseError { - UnexpectedEndOfTaggedFields() { } - } - public final static class DescriptionDecodeError extends LDKParseError { - public int description_decode_error; - DescriptionDecodeError(int description_decode_error) { this.description_decode_error = description_decode_error; } - } - public final static class PaddingError extends LDKParseError { - PaddingError() { } - } - public final static class IntegerOverflowError extends LDKParseError { - IntegerOverflowError() { } - } - public final static class InvalidSegWitProgramLength extends LDKParseError { - InvalidSegWitProgramLength() { } - } - public final static class InvalidPubKeyHashLength extends LDKParseError { - InvalidPubKeyHashLength() { } - } - public final static class InvalidScriptHashLength extends LDKParseError { - InvalidScriptHashLength() { } - } - public final static class InvalidRecoveryId extends LDKParseError { - InvalidRecoveryId() { } - } - public final static class InvalidSliceLength extends LDKParseError { - public java.lang.String invalid_slice_length; - InvalidSliceLength(java.lang.String invalid_slice_length) { this.invalid_slice_length = invalid_slice_length; } - } - public final static class Skip extends LDKParseError { - Skip() { } - } - static native void init(); - } - static { LDKParseError.init(); } - public static native LDKParseError LDKParseError_ref_from_ptr(long ptr); - // enum LDKSiPrefix CResult_SiPrefixParseErrorZ_get_ok(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner); - public static native SiPrefix CResult_SiPrefixParseErrorZ_get_ok(long owner); - // struct LDKParseError CResult_SiPrefixParseErrorZ_get_err(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner); - public static native long CResult_SiPrefixParseErrorZ_get_err(long owner); - public static class LDKParseOrSemanticError { - private LDKParseOrSemanticError() {} - public final static class ParseError extends LDKParseOrSemanticError { - public long parse_error; - ParseError(long parse_error) { this.parse_error = parse_error; } - } - public final static class SemanticError extends LDKParseOrSemanticError { - public org.ldk.enums.SemanticError semantic_error; - SemanticError(org.ldk.enums.SemanticError semantic_error) { this.semantic_error = semantic_error; } - } - static native void init(); - } - static { LDKParseOrSemanticError.init(); } - public static native LDKParseOrSemanticError LDKParseOrSemanticError_ref_from_ptr(long ptr); - // struct LDKInvoice CResult_InvoiceParseOrSemanticErrorZ_get_ok(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner); - public static native long CResult_InvoiceParseOrSemanticErrorZ_get_ok(long owner); - // struct LDKParseOrSemanticError CResult_InvoiceParseOrSemanticErrorZ_get_err(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner); - public static native long CResult_InvoiceParseOrSemanticErrorZ_get_err(long owner); - // struct LDKSignedRawInvoice CResult_SignedRawInvoiceParseErrorZ_get_ok(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner); - public static native long CResult_SignedRawInvoiceParseErrorZ_get_ok(long owner); - // struct LDKParseError CResult_SignedRawInvoiceParseErrorZ_get_err(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner); - public static native long CResult_SignedRawInvoiceParseErrorZ_get_err(long owner); - // struct LDKRawInvoice C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner); - public static native long C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(long owner); - // struct LDKThirtyTwoBytes C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner); - public static native byte[] C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(long owner); - // struct LDKInvoiceSignature C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner); - public static native long C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(long owner); - // struct LDKPayeePubKey CResult_PayeePubKeyErrorZ_get_ok(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner); - public static native long CResult_PayeePubKeyErrorZ_get_ok(long owner); - // enum LDKSecp256k1Error CResult_PayeePubKeyErrorZ_get_err(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner); - public static native Secp256k1Error CResult_PayeePubKeyErrorZ_get_err(long owner); - // struct LDKPositiveTimestamp CResult_PositiveTimestampCreationErrorZ_get_ok(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner); - public static native long CResult_PositiveTimestampCreationErrorZ_get_ok(long owner); - // enum LDKCreationError CResult_PositiveTimestampCreationErrorZ_get_err(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner); - public static native CreationError CResult_PositiveTimestampCreationErrorZ_get_err(long owner); - // void CResult_NoneSemanticErrorZ_get_ok(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner); - public static native void CResult_NoneSemanticErrorZ_get_ok(long owner); - // enum LDKSemanticError CResult_NoneSemanticErrorZ_get_err(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner); - public static native SemanticError CResult_NoneSemanticErrorZ_get_err(long owner); - // struct LDKInvoice CResult_InvoiceSemanticErrorZ_get_ok(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner); - public static native long CResult_InvoiceSemanticErrorZ_get_ok(long owner); - // enum LDKSemanticError CResult_InvoiceSemanticErrorZ_get_err(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner); - public static native SemanticError CResult_InvoiceSemanticErrorZ_get_err(long owner); - // struct LDKDescription CResult_DescriptionCreationErrorZ_get_ok(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner); - public static native long CResult_DescriptionCreationErrorZ_get_ok(long owner); - // enum LDKCreationError CResult_DescriptionCreationErrorZ_get_err(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner); - public static native CreationError CResult_DescriptionCreationErrorZ_get_err(long owner); - // struct LDKPrivateRoute CResult_PrivateRouteCreationErrorZ_get_ok(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner); - public static native long CResult_PrivateRouteCreationErrorZ_get_ok(long owner); - // enum LDKCreationError CResult_PrivateRouteCreationErrorZ_get_err(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner); - public static native CreationError CResult_PrivateRouteCreationErrorZ_get_err(long owner); + // void CResult_NonePaymentErrorZ_get_ok(LDKCResult_NonePaymentErrorZ *NONNULL_PTR owner); + public static native void CResult_NonePaymentErrorZ_get_ok(long owner); + // struct LDKPaymentError CResult_NonePaymentErrorZ_get_err(LDKCResult_NonePaymentErrorZ *NONNULL_PTR owner); + public static native long CResult_NonePaymentErrorZ_get_err(long owner); // struct LDKStr CResult_StringErrorZ_get_ok(LDKCResult_StringErrorZ *NONNULL_PTR owner); public static native String CResult_StringErrorZ_get_ok(long owner); // enum LDKSecp256k1Error CResult_StringErrorZ_get_err(LDKCResult_StringErrorZ *NONNULL_PTR owner); public static native Secp256k1Error CResult_StringErrorZ_get_err(long owner); + // struct LDKPublicKey CResult_PublicKeyErrorZ_get_ok(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner); + public static native byte[] CResult_PublicKeyErrorZ_get_ok(long owner); + // enum LDKSecp256k1Error CResult_PublicKeyErrorZ_get_err(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner); + public static native Secp256k1Error CResult_PublicKeyErrorZ_get_err(long owner); // struct LDKChannelMonitorUpdate CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(long owner); // struct LDKDecodeError CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner); @@ -1643,6 +1565,12 @@ public class bindings { public final static class BufferFull extends LDKSendError { BufferFull() { } } + public final static class GetNodeIdFailed extends LDKSendError { + GetNodeIdFailed() { } + } + public final static class BlindedPathAdvanceFailed extends LDKSendError { + BlindedPathAdvanceFailed() { } + } static native void init(); } static { LDKSendError.init(); } @@ -1651,47 +1579,168 @@ public class bindings { public static native void CResult_NoneSendErrorZ_get_ok(long owner); // struct LDKSendError CResult_NoneSendErrorZ_get_err(LDKCResult_NoneSendErrorZ *NONNULL_PTR owner); public static native long CResult_NoneSendErrorZ_get_err(long owner); - 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 static class LDKParseError { + private LDKParseError() {} + public final static class Bech32Error extends LDKParseError { + public long bech32_error; + Bech32Error(long bech32_error) { this.bech32_error = bech32_error; } } - public final static class LightningError extends LDKGraphSyncError { - public long lightning_error; - LightningError(long lightning_error) { this.lightning_error = lightning_error; } + public final static class ParseAmountError extends LDKParseError { + public int parse_amount_error; + ParseAmountError(int parse_amount_error) { this.parse_amount_error = parse_amount_error; } } - static native void init(); - } - 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); - public static native long CResult_NetAddressDecodeErrorZ_get_err(long owner); - // struct LDKAcceptChannel CResult_AcceptChannelDecodeErrorZ_get_ok(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_AcceptChannelDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_AcceptChannelDecodeErrorZ_get_err(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_AcceptChannelDecodeErrorZ_get_err(long owner); - // struct LDKAnnouncementSignatures CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_AnnouncementSignaturesDecodeErrorZ_get_err(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_AnnouncementSignaturesDecodeErrorZ_get_err(long owner); - // struct LDKChannelReestablish CResult_ChannelReestablishDecodeErrorZ_get_ok(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_ChannelReestablishDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_ChannelReestablishDecodeErrorZ_get_err(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_ChannelReestablishDecodeErrorZ_get_err(long owner); - // struct LDKClosingSigned CResult_ClosingSignedDecodeErrorZ_get_ok(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_ClosingSignedDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_ClosingSignedDecodeErrorZ_get_err(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_ClosingSignedDecodeErrorZ_get_err(long owner); - // struct LDKClosingSignedFeeRange CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR owner); - public static native long CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(long owner); - // struct LDKDecodeError CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR owner); + public final static class MalformedSignature extends LDKParseError { + public org.ldk.enums.Secp256k1Error malformed_signature; + MalformedSignature(org.ldk.enums.Secp256k1Error malformed_signature) { this.malformed_signature = malformed_signature; } + } + public final static class BadPrefix extends LDKParseError { + BadPrefix() { } + } + public final static class UnknownCurrency extends LDKParseError { + UnknownCurrency() { } + } + public final static class UnknownSiPrefix extends LDKParseError { + UnknownSiPrefix() { } + } + public final static class MalformedHRP extends LDKParseError { + MalformedHRP() { } + } + public final static class TooShortDataPart extends LDKParseError { + TooShortDataPart() { } + } + public final static class UnexpectedEndOfTaggedFields extends LDKParseError { + UnexpectedEndOfTaggedFields() { } + } + public final static class DescriptionDecodeError extends LDKParseError { + public int description_decode_error; + DescriptionDecodeError(int description_decode_error) { this.description_decode_error = description_decode_error; } + } + public final static class PaddingError extends LDKParseError { + PaddingError() { } + } + public final static class IntegerOverflowError extends LDKParseError { + IntegerOverflowError() { } + } + public final static class InvalidSegWitProgramLength extends LDKParseError { + InvalidSegWitProgramLength() { } + } + public final static class InvalidPubKeyHashLength extends LDKParseError { + InvalidPubKeyHashLength() { } + } + public final static class InvalidScriptHashLength extends LDKParseError { + InvalidScriptHashLength() { } + } + public final static class InvalidRecoveryId extends LDKParseError { + InvalidRecoveryId() { } + } + public final static class InvalidSliceLength extends LDKParseError { + public java.lang.String invalid_slice_length; + InvalidSliceLength(java.lang.String invalid_slice_length) { this.invalid_slice_length = invalid_slice_length; } + } + public final static class Skip extends LDKParseError { + Skip() { } + } + static native void init(); + } + static { LDKParseError.init(); } + public static native LDKParseError LDKParseError_ref_from_ptr(long ptr); + // enum LDKSiPrefix CResult_SiPrefixParseErrorZ_get_ok(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner); + public static native SiPrefix CResult_SiPrefixParseErrorZ_get_ok(long owner); + // struct LDKParseError CResult_SiPrefixParseErrorZ_get_err(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner); + public static native long CResult_SiPrefixParseErrorZ_get_err(long owner); + public static class LDKParseOrSemanticError { + private LDKParseOrSemanticError() {} + public final static class ParseError extends LDKParseOrSemanticError { + public long parse_error; + ParseError(long parse_error) { this.parse_error = parse_error; } + } + public final static class SemanticError extends LDKParseOrSemanticError { + public org.ldk.enums.SemanticError semantic_error; + SemanticError(org.ldk.enums.SemanticError semantic_error) { this.semantic_error = semantic_error; } + } + static native void init(); + } + static { LDKParseOrSemanticError.init(); } + public static native LDKParseOrSemanticError LDKParseOrSemanticError_ref_from_ptr(long ptr); + // struct LDKInvoice CResult_InvoiceParseOrSemanticErrorZ_get_ok(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner); + public static native long CResult_InvoiceParseOrSemanticErrorZ_get_ok(long owner); + // struct LDKParseOrSemanticError CResult_InvoiceParseOrSemanticErrorZ_get_err(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner); + public static native long CResult_InvoiceParseOrSemanticErrorZ_get_err(long owner); + // struct LDKSignedRawInvoice CResult_SignedRawInvoiceParseErrorZ_get_ok(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner); + public static native long CResult_SignedRawInvoiceParseErrorZ_get_ok(long owner); + // struct LDKParseError CResult_SignedRawInvoiceParseErrorZ_get_err(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner); + public static native long CResult_SignedRawInvoiceParseErrorZ_get_err(long owner); + // struct LDKRawInvoice C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner); + public static native long C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(long owner); + // struct LDKThirtyTwoBytes C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner); + public static native byte[] C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(long owner); + // struct LDKInvoiceSignature C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner); + public static native long C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(long owner); + // struct LDKPayeePubKey CResult_PayeePubKeyErrorZ_get_ok(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner); + public static native long CResult_PayeePubKeyErrorZ_get_ok(long owner); + // enum LDKSecp256k1Error CResult_PayeePubKeyErrorZ_get_err(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner); + public static native Secp256k1Error CResult_PayeePubKeyErrorZ_get_err(long owner); + // struct LDKPositiveTimestamp CResult_PositiveTimestampCreationErrorZ_get_ok(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner); + public static native long CResult_PositiveTimestampCreationErrorZ_get_ok(long owner); + // enum LDKCreationError CResult_PositiveTimestampCreationErrorZ_get_err(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner); + public static native CreationError CResult_PositiveTimestampCreationErrorZ_get_err(long owner); + // void CResult_NoneSemanticErrorZ_get_ok(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner); + public static native void CResult_NoneSemanticErrorZ_get_ok(long owner); + // enum LDKSemanticError CResult_NoneSemanticErrorZ_get_err(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner); + public static native SemanticError CResult_NoneSemanticErrorZ_get_err(long owner); + // struct LDKInvoice CResult_InvoiceSemanticErrorZ_get_ok(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner); + public static native long CResult_InvoiceSemanticErrorZ_get_ok(long owner); + // enum LDKSemanticError CResult_InvoiceSemanticErrorZ_get_err(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner); + public static native SemanticError CResult_InvoiceSemanticErrorZ_get_err(long owner); + // struct LDKDescription CResult_DescriptionCreationErrorZ_get_ok(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner); + public static native long CResult_DescriptionCreationErrorZ_get_ok(long owner); + // enum LDKCreationError CResult_DescriptionCreationErrorZ_get_err(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner); + public static native CreationError CResult_DescriptionCreationErrorZ_get_err(long owner); + // struct LDKPrivateRoute CResult_PrivateRouteCreationErrorZ_get_ok(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner); + public static native long CResult_PrivateRouteCreationErrorZ_get_ok(long owner); + // enum LDKCreationError CResult_PrivateRouteCreationErrorZ_get_err(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner); + public static native CreationError CResult_PrivateRouteCreationErrorZ_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 LightningError extends LDKGraphSyncError { + public long lightning_error; + LightningError(long lightning_error) { this.lightning_error = lightning_error; } + } + static native void init(); + } + 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); + public static native long CResult_NetAddressDecodeErrorZ_get_err(long owner); + // struct LDKAcceptChannel CResult_AcceptChannelDecodeErrorZ_get_ok(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_AcceptChannelDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_AcceptChannelDecodeErrorZ_get_err(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_AcceptChannelDecodeErrorZ_get_err(long owner); + // struct LDKAnnouncementSignatures CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_AnnouncementSignaturesDecodeErrorZ_get_err(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_AnnouncementSignaturesDecodeErrorZ_get_err(long owner); + // struct LDKChannelReestablish CResult_ChannelReestablishDecodeErrorZ_get_ok(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_ChannelReestablishDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_ChannelReestablishDecodeErrorZ_get_err(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_ChannelReestablishDecodeErrorZ_get_err(long owner); + // struct LDKClosingSigned CResult_ClosingSignedDecodeErrorZ_get_ok(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_ClosingSignedDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_ClosingSignedDecodeErrorZ_get_err(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_ClosingSignedDecodeErrorZ_get_err(long owner); + // struct LDKClosingSignedFeeRange CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR owner); + public static native long CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(long owner); + // struct LDKDecodeError CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(long owner); // struct LDKCommitmentSigned CResult_CommitmentSignedDecodeErrorZ_get_ok(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR owner); public static native long CResult_CommitmentSignedDecodeErrorZ_get_ok(long owner); @@ -1852,6 +1901,10 @@ public class bindings { public static native long CResult_LockedChannelMonitorNoneZ_get_ok(long owner); // void CResult_LockedChannelMonitorNoneZ_get_err(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner); public static native void CResult_LockedChannelMonitorNoneZ_get_err(long owner); + // struct LDKOutPoint C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR owner); + public static native long C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(long owner); + // struct LDKCVec_MonitorUpdateIdZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR owner); + public static native long[] C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(long owner); public interface LDKMessageSendEventsProvider { long[] get_and_clear_pending_msg_events(); } @@ -1868,7 +1921,7 @@ public class bindings { void handle_event(long event); } public static native long LDKEventHandler_new(LDKEventHandler impl); - // void EventHandler_handle_event LDKEventHandler *NONNULL_PTR this_arg, const struct LDKEvent *NONNULL_PTR event + // void EventHandler_handle_event LDKEventHandler *NONNULL_PTR this_arg, struct LDKEvent event public static native void EventHandler_handle_event(long this_arg, long event); public interface LDKEventsProvider { void process_pending_events(long handler); @@ -1910,7 +1963,7 @@ public class bindings { void transactions_confirmed(byte[] header, long[] txdata, int height); void transaction_unconfirmed(byte[] txid); void best_block_updated(byte[] header, int height); - byte[][] get_relevant_txids(); + long[] get_relevant_txids(); } public static native long LDKConfirm_new(LDKConfirm impl); // void Confirm_transactions_confirmed LDKConfirm *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height @@ -1919,8 +1972,8 @@ public class bindings { public static native void Confirm_transaction_unconfirmed(long this_arg, byte[] txid); // void Confirm_best_block_updated LDKConfirm *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height public static native void Confirm_best_block_updated(long this_arg, byte[] header, int height); - // LDKCVec_TxidZ Confirm_get_relevant_txids LDKConfirm *NONNULL_PTR this_arg - public static native byte[][] Confirm_get_relevant_txids(long this_arg); + // LDKCVec_C2Tuple_TxidBlockHashZZ Confirm_get_relevant_txids LDKConfirm *NONNULL_PTR this_arg + public static native long[] Confirm_get_relevant_txids(long this_arg); public interface LDKPersist { ChannelMonitorUpdateStatus persist_new_channel(long channel_id, long data, long update_id); ChannelMonitorUpdateStatus update_persisted_channel(long channel_id, long update, long data, long update_id); @@ -2122,20 +2175,51 @@ public class bindings { } static { LDKEffectiveCapacity.init(); } public static native LDKEffectiveCapacity LDKEffectiveCapacity_ref_from_ptr(long ptr); + public interface LDKRouter { + long find_route(byte[] payer, long route_params, long[] first_hops, long inflight_htlcs); + long find_route_with_id(byte[] payer, long route_params, long[] first_hops, long inflight_htlcs, byte[] _payment_hash, byte[] _payment_id); + void notify_payment_path_failed(long[] path, long short_channel_id); + void notify_payment_path_successful(long[] path); + void notify_payment_probe_successful(long[] path); + void notify_payment_probe_failed(long[] path, long short_channel_id); + } + public static native long LDKRouter_new(LDKRouter impl); + // LDKCResult_RouteLightningErrorZ Router_find_route LDKRouter *NONNULL_PTR this_arg, struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR route_params, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKInFlightHtlcs inflight_htlcs + public static native long Router_find_route(long this_arg, byte[] payer, long route_params, long[] first_hops, long inflight_htlcs); + // LDKCResult_RouteLightningErrorZ Router_find_route_with_id LDKRouter *NONNULL_PTR this_arg, struct LDKPublicKey payer, const struct LDKRouteParameters *NONNULL_PTR route_params, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKInFlightHtlcs inflight_htlcs, struct LDKThirtyTwoBytes _payment_hash, struct LDKThirtyTwoBytes _payment_id + public static native long Router_find_route_with_id(long this_arg, byte[] payer, long route_params, long[] first_hops, long inflight_htlcs, byte[] _payment_hash, byte[] _payment_id); + // void Router_notify_payment_path_failed LDKRouter *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id + public static native void Router_notify_payment_path_failed(long this_arg, long[] path, long short_channel_id); + // void Router_notify_payment_path_successful LDKRouter *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ path + public static native void Router_notify_payment_path_successful(long this_arg, long[] path); + // void Router_notify_payment_probe_successful LDKRouter *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ path + public static native void Router_notify_payment_probe_successful(long this_arg, long[] path); + // void Router_notify_payment_probe_failed LDKRouter *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id + public static native void Router_notify_payment_probe_failed(long this_arg, long[] path, long short_channel_id); public static class LDKDestination { private LDKDestination() {} public final static class Node extends LDKDestination { public byte[] node; Node(byte[] node) { this.node = node; } } - public final static class BlindedRoute extends LDKDestination { - public long blinded_route; - BlindedRoute(long blinded_route) { this.blinded_route = blinded_route; } + public final static class BlindedPath extends LDKDestination { + public long blinded_path; + BlindedPath(long blinded_path) { this.blinded_path = blinded_path; } } static native void init(); } static { LDKDestination.init(); } public static native LDKDestination LDKDestination_ref_from_ptr(long ptr); + public static class LDKOnionMessageContents { + private LDKOnionMessageContents() {} + public final static class Custom extends LDKOnionMessageContents { + public long custom; + Custom(long custom) { this.custom = custom; } + } + static native void init(); + } + static { LDKOnionMessageContents.init(); } + public static native LDKOnionMessageContents LDKOnionMessageContents_ref_from_ptr(long ptr); public static class LDKGossipSync { private LDKGossipSync() {} public final static class P2P extends LDKGossipSync { @@ -2175,42 +2259,27 @@ public class bindings { public interface LDKPayer { byte[] node_id(); long[] first_hops(); - long send_payment(long route, byte[] payment_hash, byte[] payment_secret); - long send_spontaneous_payment(long route, byte[] payment_preimage); + long send_payment(long route, byte[] payment_hash, byte[] payment_secret, byte[] payment_id); + long send_spontaneous_payment(long route, byte[] payment_preimage, byte[] payment_id); long retry_payment(long route, byte[] payment_id); void abandon_payment(byte[] payment_id); + long inflight_htlcs(); } public static native long LDKPayer_new(LDKPayer impl); // LDKPublicKey Payer_node_id LDKPayer *NONNULL_PTR this_arg public static native byte[] Payer_node_id(long this_arg); // LDKCVec_ChannelDetailsZ Payer_first_hops LDKPayer *NONNULL_PTR this_arg public static native long[] Payer_first_hops(long this_arg); - // LDKCResult_PaymentIdPaymentSendFailureZ Payer_send_payment LDKPayer *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret - public static native long Payer_send_payment(long this_arg, long route, byte[] payment_hash, byte[] payment_secret); - // LDKCResult_PaymentIdPaymentSendFailureZ Payer_send_spontaneous_payment LDKPayer *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_preimage - public static native long Payer_send_spontaneous_payment(long this_arg, long route, byte[] payment_preimage); + // LDKCResult_NonePaymentSendFailureZ Payer_send_payment LDKPayer *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret, struct LDKThirtyTwoBytes payment_id + public static native long Payer_send_payment(long this_arg, long route, byte[] payment_hash, byte[] payment_secret, byte[] payment_id); + // LDKCResult_NonePaymentSendFailureZ Payer_send_spontaneous_payment LDKPayer *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_id + public static native long Payer_send_spontaneous_payment(long this_arg, long route, byte[] payment_preimage, byte[] payment_id); // LDKCResult_NonePaymentSendFailureZ Payer_retry_payment LDKPayer *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_id public static native long Payer_retry_payment(long this_arg, long route, byte[] payment_id); // void Payer_abandon_payment LDKPayer *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id public static native void Payer_abandon_payment(long this_arg, byte[] payment_id); - public interface LDKRouter { - long find_route(byte[] payer, long route_params, byte[] payment_hash, long[] first_hops, long inflight_htlcs); - void notify_payment_path_failed(long[] path, long short_channel_id); - void notify_payment_path_successful(long[] path); - void notify_payment_probe_successful(long[] path); - void notify_payment_probe_failed(long[] path, long short_channel_id); - } - 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, struct LDKInFlightHtlcs inflight_htlcs - public static native long Router_find_route(long this_arg, byte[] payer, long route_params, byte[] payment_hash, long[] first_hops, long inflight_htlcs); - // void Router_notify_payment_path_failed LDKRouter *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id - public static native void Router_notify_payment_path_failed(long this_arg, long[] path, long short_channel_id); - // void Router_notify_payment_path_successful LDKRouter *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ path - public static native void Router_notify_payment_path_successful(long this_arg, long[] path); - // void Router_notify_payment_probe_successful LDKRouter *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ path - public static native void Router_notify_payment_probe_successful(long this_arg, long[] path); - // void Router_notify_payment_probe_failed LDKRouter *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ path, uint64_t short_channel_id - public static native void Router_notify_payment_probe_failed(long this_arg, long[] path, long short_channel_id); + // LDKInFlightHtlcs Payer_inflight_htlcs LDKPayer *NONNULL_PTR this_arg + public static native long Payer_inflight_htlcs(long this_arg); public static class LDKRetry { private LDKRetry() {} public final static class Attempts extends LDKRetry { @@ -2229,6 +2298,10 @@ public class bindings { public static native String _ldk_get_compiled_version(); // struct LDKStr _ldk_c_bindings_get_compiled_version(void); public static native String _ldk_c_bindings_get_compiled_version(); + // struct LDKSixteenBytes U128_le_bytes(struct LDKU128 val); + public static native byte[] U128_le_bytes(byte[] val); + // struct LDKU128 U128_new(struct LDKSixteenBytes le_bytes); + public static native byte[] U128_new(byte[] le_bytes); // struct LDKBigEndianScalar BigEndianScalar_new(struct LDKThirtyTwoBytes big_endian_bytes); public static native long BigEndianScalar_new(byte[] big_endian_bytes); // uint64_t Bech32Error_clone_ptr(LDKBech32Error *NONNULL_PTR arg); @@ -2239,6 +2312,8 @@ public class bindings { public static native void Bech32Error_free(long o); // void Transaction_free(struct LDKTransaction _res); public static native void Transaction_free(byte[] _res); + // void Witness_free(struct LDKWitness _res); + public static native void Witness_free(byte[] _res); // struct LDKTxOut TxOut_new(struct LDKCVec_u8Z script_pubkey, uint64_t value); public static native long TxOut_new(byte[] script_pubkey, long value); // void TxOut_free(struct LDKTxOut _res); @@ -2249,32 +2324,12 @@ public class bindings { public static native long TxOut_clone(long orig); // void Str_free(struct LDKStr _res); public static native void Str_free(String _res); - // void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res); - public static native void CVec_PublicKeyZ_free(byte[][] _res); - // struct LDKCResult_BlindedRouteNoneZ CResult_BlindedRouteNoneZ_ok(struct LDKBlindedRoute o); - public static native long CResult_BlindedRouteNoneZ_ok(long o); - // struct LDKCResult_BlindedRouteNoneZ CResult_BlindedRouteNoneZ_err(void); - public static native long CResult_BlindedRouteNoneZ_err(); - // bool CResult_BlindedRouteNoneZ_is_ok(const struct LDKCResult_BlindedRouteNoneZ *NONNULL_PTR o); - public static native boolean CResult_BlindedRouteNoneZ_is_ok(long o); - // void CResult_BlindedRouteNoneZ_free(struct LDKCResult_BlindedRouteNoneZ _res); - public static native void CResult_BlindedRouteNoneZ_free(long _res); - // struct LDKCResult_BlindedRouteDecodeErrorZ CResult_BlindedRouteDecodeErrorZ_ok(struct LDKBlindedRoute o); - public static native long CResult_BlindedRouteDecodeErrorZ_ok(long o); - // struct LDKCResult_BlindedRouteDecodeErrorZ CResult_BlindedRouteDecodeErrorZ_err(struct LDKDecodeError e); - public static native long CResult_BlindedRouteDecodeErrorZ_err(long e); - // bool CResult_BlindedRouteDecodeErrorZ_is_ok(const struct LDKCResult_BlindedRouteDecodeErrorZ *NONNULL_PTR o); - public static native boolean CResult_BlindedRouteDecodeErrorZ_is_ok(long o); - // void CResult_BlindedRouteDecodeErrorZ_free(struct LDKCResult_BlindedRouteDecodeErrorZ _res); - public static native void CResult_BlindedRouteDecodeErrorZ_free(long _res); - // struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_ok(struct LDKBlindedHop o); - public static native long CResult_BlindedHopDecodeErrorZ_ok(long o); - // struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_err(struct LDKDecodeError e); - public static native long CResult_BlindedHopDecodeErrorZ_err(long e); - // bool CResult_BlindedHopDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR o); - public static native boolean CResult_BlindedHopDecodeErrorZ_is_ok(long o); - // void CResult_BlindedHopDecodeErrorZ_free(struct LDKCResult_BlindedHopDecodeErrorZ _res); - public static native void CResult_BlindedHopDecodeErrorZ_free(long _res); + // struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_some(enum LDKHTLCClaim o); + public static native long COption_HTLCClaimZ_some(HTLCClaim o); + // struct LDKCOption_HTLCClaimZ COption_HTLCClaimZ_none(void); + public static native long COption_HTLCClaimZ_none(); + // void COption_HTLCClaimZ_free(struct LDKCOption_HTLCClaimZ _res); + public static native void COption_HTLCClaimZ_free(long _res); // struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_ok(void); public static native long CResult_NoneNoneZ_ok(); // struct LDKCResult_NoneNoneZ CResult_NoneNoneZ_err(void); @@ -2299,30 +2354,6 @@ public class bindings { public static native long CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(const struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(long orig); - // struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_ok(struct LDKSecretKey o); - public static native long CResult_SecretKeyErrorZ_ok(byte[] o); - // struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_err(enum LDKSecp256k1Error e); - public static native long CResult_SecretKeyErrorZ_err(Secp256k1Error e); - // bool CResult_SecretKeyErrorZ_is_ok(const struct LDKCResult_SecretKeyErrorZ *NONNULL_PTR o); - public static native boolean CResult_SecretKeyErrorZ_is_ok(long o); - // void CResult_SecretKeyErrorZ_free(struct LDKCResult_SecretKeyErrorZ _res); - public static native void CResult_SecretKeyErrorZ_free(long _res); - // uint64_t CResult_SecretKeyErrorZ_clone_ptr(LDKCResult_SecretKeyErrorZ *NONNULL_PTR arg); - public static native long CResult_SecretKeyErrorZ_clone_ptr(long arg); - // struct LDKCResult_SecretKeyErrorZ CResult_SecretKeyErrorZ_clone(const struct LDKCResult_SecretKeyErrorZ *NONNULL_PTR orig); - public static native long CResult_SecretKeyErrorZ_clone(long orig); - // struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o); - public static native long CResult_PublicKeyErrorZ_ok(byte[] o); - // struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e); - public static native long CResult_PublicKeyErrorZ_err(Secp256k1Error e); - // bool CResult_PublicKeyErrorZ_is_ok(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR o); - public static native boolean CResult_PublicKeyErrorZ_is_ok(long o); - // void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res); - public static native void CResult_PublicKeyErrorZ_free(long _res); - // uint64_t CResult_PublicKeyErrorZ_clone_ptr(LDKCResult_PublicKeyErrorZ *NONNULL_PTR arg); - public static native long CResult_PublicKeyErrorZ_clone_ptr(long arg); - // struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_clone(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR orig); - public static native long CResult_PublicKeyErrorZ_clone(long orig); // struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_ok(struct LDKTxCreationKeys o); public static native long CResult_TxCreationKeysDecodeErrorZ_ok(long o); // struct LDKCResult_TxCreationKeysDecodeErrorZ CResult_TxCreationKeysDecodeErrorZ_err(struct LDKDecodeError e); @@ -2347,18 +2378,6 @@ public class bindings { public static native long CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_ChannelPublicKeysDecodeErrorZ CResult_ChannelPublicKeysDecodeErrorZ_clone(const struct LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_ChannelPublicKeysDecodeErrorZ_clone(long orig); - // struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_ok(struct LDKTxCreationKeys o); - public static native long CResult_TxCreationKeysErrorZ_ok(long o); - // struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_err(enum LDKSecp256k1Error e); - public static native long CResult_TxCreationKeysErrorZ_err(Secp256k1Error e); - // bool CResult_TxCreationKeysErrorZ_is_ok(const struct LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR o); - public static native boolean CResult_TxCreationKeysErrorZ_is_ok(long o); - // void CResult_TxCreationKeysErrorZ_free(struct LDKCResult_TxCreationKeysErrorZ _res); - public static native void CResult_TxCreationKeysErrorZ_free(long _res); - // uint64_t CResult_TxCreationKeysErrorZ_clone_ptr(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR arg); - public static native long CResult_TxCreationKeysErrorZ_clone_ptr(long arg); - // struct LDKCResult_TxCreationKeysErrorZ CResult_TxCreationKeysErrorZ_clone(const struct LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR orig); - public static native long CResult_TxCreationKeysErrorZ_clone(long orig); // struct LDKCOption_u32Z COption_u32Z_some(uint32_t o); public static native long COption_u32Z_some(int o); // struct LDKCOption_u32Z COption_u32Z_none(void); @@ -2501,6 +2520,44 @@ public class bindings { public static native long CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(long arg); // struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig); public static native long CResult_ShutdownScriptInvalidShutdownScriptZ_clone(long orig); + // void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res); + public static native void CVec_PublicKeyZ_free(byte[][] _res); + // struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_ok(struct LDKBlindedPath o); + public static native long CResult_BlindedPathNoneZ_ok(long o); + // struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_err(void); + public static native long CResult_BlindedPathNoneZ_err(); + // bool CResult_BlindedPathNoneZ_is_ok(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR o); + public static native boolean CResult_BlindedPathNoneZ_is_ok(long o); + // void CResult_BlindedPathNoneZ_free(struct LDKCResult_BlindedPathNoneZ _res); + public static native void CResult_BlindedPathNoneZ_free(long _res); + // uint64_t CResult_BlindedPathNoneZ_clone_ptr(LDKCResult_BlindedPathNoneZ *NONNULL_PTR arg); + public static native long CResult_BlindedPathNoneZ_clone_ptr(long arg); + // struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_clone(const struct LDKCResult_BlindedPathNoneZ *NONNULL_PTR orig); + public static native long CResult_BlindedPathNoneZ_clone(long orig); + // struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_ok(struct LDKBlindedPath o); + public static native long CResult_BlindedPathDecodeErrorZ_ok(long o); + // struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_BlindedPathDecodeErrorZ_err(long e); + // bool CResult_BlindedPathDecodeErrorZ_is_ok(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_BlindedPathDecodeErrorZ_is_ok(long o); + // void CResult_BlindedPathDecodeErrorZ_free(struct LDKCResult_BlindedPathDecodeErrorZ _res); + public static native void CResult_BlindedPathDecodeErrorZ_free(long _res); + // uint64_t CResult_BlindedPathDecodeErrorZ_clone_ptr(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_BlindedPathDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_BlindedPathDecodeErrorZ CResult_BlindedPathDecodeErrorZ_clone(const struct LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_BlindedPathDecodeErrorZ_clone(long orig); + // struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_ok(struct LDKBlindedHop o); + public static native long CResult_BlindedHopDecodeErrorZ_ok(long o); + // struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_BlindedHopDecodeErrorZ_err(long e); + // bool CResult_BlindedHopDecodeErrorZ_is_ok(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_BlindedHopDecodeErrorZ_is_ok(long o); + // void CResult_BlindedHopDecodeErrorZ_free(struct LDKCResult_BlindedHopDecodeErrorZ _res); + public static native void CResult_BlindedHopDecodeErrorZ_free(long _res); + // uint64_t CResult_BlindedHopDecodeErrorZ_clone_ptr(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_BlindedHopDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_BlindedHopDecodeErrorZ CResult_BlindedHopDecodeErrorZ_clone(const struct LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_BlindedHopDecodeErrorZ_clone(long orig); // struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_some(struct LDKWriteableScore o); public static native long COption_WriteableScoreZ_some(long o); // struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_none(void); @@ -2519,6 +2576,44 @@ public class bindings { public static native long CResult_NoneErrorZ_clone_ptr(long arg); // struct LDKCResult_NoneErrorZ CResult_NoneErrorZ_clone(const struct LDKCResult_NoneErrorZ *NONNULL_PTR orig); public static native long CResult_NoneErrorZ_clone(long orig); + // void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res); + public static native void CVec_ChannelDetailsZ_free(long[] _res); + // struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o); + public static native long CResult_RouteLightningErrorZ_ok(long o); + // struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e); + public static native long CResult_RouteLightningErrorZ_err(long e); + // bool CResult_RouteLightningErrorZ_is_ok(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR o); + public static native boolean CResult_RouteLightningErrorZ_is_ok(long o); + // void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res); + public static native void CResult_RouteLightningErrorZ_free(long _res); + // uint64_t CResult_RouteLightningErrorZ_clone_ptr(LDKCResult_RouteLightningErrorZ *NONNULL_PTR arg); + public static native long CResult_RouteLightningErrorZ_clone_ptr(long arg); + // struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_clone(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR orig); + public static native long CResult_RouteLightningErrorZ_clone(long orig); + // void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res); + public static native void CVec_RouteHopZ_free(long[] _res); + // struct LDKCOption_u64Z COption_u64Z_some(uint64_t o); + public static native long COption_u64Z_some(long o); + // struct LDKCOption_u64Z COption_u64Z_none(void); + public static native long COption_u64Z_none(); + // void COption_u64Z_free(struct LDKCOption_u64Z _res); + public static native void COption_u64Z_free(long _res); + // uint64_t COption_u64Z_clone_ptr(LDKCOption_u64Z *NONNULL_PTR arg); + public static native long COption_u64Z_clone_ptr(long arg); + // struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig); + public static native long COption_u64Z_clone(long orig); + // struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_ok(struct LDKInFlightHtlcs o); + public static native long CResult_InFlightHtlcsDecodeErrorZ_ok(long o); + // struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_InFlightHtlcsDecodeErrorZ_err(long e); + // bool CResult_InFlightHtlcsDecodeErrorZ_is_ok(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_InFlightHtlcsDecodeErrorZ_is_ok(long o); + // void CResult_InFlightHtlcsDecodeErrorZ_free(struct LDKCResult_InFlightHtlcsDecodeErrorZ _res); + public static native void CResult_InFlightHtlcsDecodeErrorZ_free(long _res); + // uint64_t CResult_InFlightHtlcsDecodeErrorZ_clone_ptr(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_InFlightHtlcsDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_clone(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_InFlightHtlcsDecodeErrorZ_clone(long orig); // struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_ok(struct LDKRouteHop o); public static native long CResult_RouteHopDecodeErrorZ_ok(long o); // struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_err(struct LDKDecodeError e); @@ -2531,8 +2626,6 @@ public class bindings { public static native long CResult_RouteHopDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_RouteHopDecodeErrorZ CResult_RouteHopDecodeErrorZ_clone(const struct LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_RouteHopDecodeErrorZ_clone(long orig); - // void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res); - public static native void CVec_RouteHopZ_free(long[] _res); // void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res); public static native void CVec_CVec_RouteHopZZ_free(long[][] _res); // struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o); @@ -2561,16 +2654,6 @@ public class bindings { public static native long CResult_RouteParametersDecodeErrorZ_clone(long orig); // void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res); public static native void CVec_RouteHintZ_free(long[] _res); - // struct LDKCOption_u64Z COption_u64Z_some(uint64_t o); - public static native long COption_u64Z_some(long o); - // struct LDKCOption_u64Z COption_u64Z_none(void); - public static native long COption_u64Z_none(); - // void COption_u64Z_free(struct LDKCOption_u64Z _res); - public static native void COption_u64Z_free(long _res); - // uint64_t COption_u64Z_clone_ptr(LDKCOption_u64Z *NONNULL_PTR arg); - public static native long COption_u64Z_clone_ptr(long arg); - // struct LDKCOption_u64Z COption_u64Z_clone(const struct LDKCOption_u64Z *NONNULL_PTR orig); - public static native long COption_u64Z_clone(long orig); // void CVec_u64Z_free(struct LDKCVec_u64Z _res); public static native void CVec_u64Z_free(long[] _res); // struct LDKCResult_PaymentParametersDecodeErrorZ CResult_PaymentParametersDecodeErrorZ_ok(struct LDKPaymentParameters o); @@ -2611,20 +2694,6 @@ public class bindings { public static native long CResult_RouteHintHopDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_RouteHintHopDecodeErrorZ CResult_RouteHintHopDecodeErrorZ_clone(const struct LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_RouteHintHopDecodeErrorZ_clone(long orig); - // void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res); - public static native void CVec_ChannelDetailsZ_free(long[] _res); - // struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o); - public static native long CResult_RouteLightningErrorZ_ok(long o); - // struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e); - public static native long CResult_RouteLightningErrorZ_err(long e); - // bool CResult_RouteLightningErrorZ_is_ok(const struct LDKCResult_RouteLightningErrorZ *NONNULL_PTR o); - public static native boolean CResult_RouteLightningErrorZ_is_ok(long o); - // void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res); - public static native void CResult_RouteLightningErrorZ_free(long _res); - // uint64_t CResult_RouteLightningErrorZ_clone_ptr(LDKCResult_RouteLightningErrorZ *NONNULL_PTR arg); - 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_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); @@ -2681,6 +2750,16 @@ public class bindings { public static native long CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ CResult_COption_HTLCDestinationZDecodeErrorZ_clone(const struct LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_COption_HTLCDestinationZDecodeErrorZ_clone(long orig); + // struct LDKCOption_u128Z COption_u128Z_some(struct LDKU128 o); + public static native long COption_u128Z_some(byte[] o); + // struct LDKCOption_u128Z COption_u128Z_none(void); + public static native long COption_u128Z_none(); + // void COption_u128Z_free(struct LDKCOption_u128Z _res); + public static native void COption_u128Z_free(long _res); + // uint64_t COption_u128Z_clone_ptr(LDKCOption_u128Z *NONNULL_PTR arg); + public static native long COption_u128Z_clone_ptr(long arg); + // struct LDKCOption_u128Z COption_u128Z_clone(const struct LDKCOption_u128Z *NONNULL_PTR orig); + public static native long COption_u128Z_clone(long orig); // struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_some(struct LDKNetworkUpdate o); public static native long COption_NetworkUpdateZ_some(long o); // struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_none(void); @@ -2739,8 +2818,16 @@ public class bindings { 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); + // uint64_t C2Tuple_TxidBlockHashZ_clone_ptr(LDKC2Tuple_TxidBlockHashZ *NONNULL_PTR arg); + public static native long C2Tuple_TxidBlockHashZ_clone_ptr(long arg); + // struct LDKC2Tuple_TxidBlockHashZ C2Tuple_TxidBlockHashZ_clone(const struct LDKC2Tuple_TxidBlockHashZ *NONNULL_PTR orig); + public static native long C2Tuple_TxidBlockHashZ_clone(long orig); + // struct LDKC2Tuple_TxidBlockHashZ C2Tuple_TxidBlockHashZ_new(struct LDKThirtyTwoBytes a, struct LDKThirtyTwoBytes b); + public static native long C2Tuple_TxidBlockHashZ_new(byte[] a, byte[] b); + // void C2Tuple_TxidBlockHashZ_free(struct LDKC2Tuple_TxidBlockHashZ _res); + public static native void C2Tuple_TxidBlockHashZ_free(long _res); + // void CVec_C2Tuple_TxidBlockHashZZ_free(struct LDKCVec_C2Tuple_TxidBlockHashZZ _res); + public static native void CVec_C2Tuple_TxidBlockHashZZ_free(long[] _res); // void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res); public static native void CVec_MonitorEventZ_free(long[] _res); // uint64_t C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR arg); @@ -2853,6 +2940,30 @@ public class bindings { 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_OfferFeaturesDecodeErrorZ CResult_OfferFeaturesDecodeErrorZ_ok(struct LDKOfferFeatures o); + public static native long CResult_OfferFeaturesDecodeErrorZ_ok(long o); + // struct LDKCResult_OfferFeaturesDecodeErrorZ CResult_OfferFeaturesDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_OfferFeaturesDecodeErrorZ_err(long e); + // bool CResult_OfferFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_OfferFeaturesDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_OfferFeaturesDecodeErrorZ_is_ok(long o); + // void CResult_OfferFeaturesDecodeErrorZ_free(struct LDKCResult_OfferFeaturesDecodeErrorZ _res); + public static native void CResult_OfferFeaturesDecodeErrorZ_free(long _res); + // uint64_t CResult_OfferFeaturesDecodeErrorZ_clone_ptr(LDKCResult_OfferFeaturesDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_OfferFeaturesDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_OfferFeaturesDecodeErrorZ CResult_OfferFeaturesDecodeErrorZ_clone(const struct LDKCResult_OfferFeaturesDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_OfferFeaturesDecodeErrorZ_clone(long orig); + // struct LDKCResult_InvoiceRequestFeaturesDecodeErrorZ CResult_InvoiceRequestFeaturesDecodeErrorZ_ok(struct LDKInvoiceRequestFeatures o); + public static native long CResult_InvoiceRequestFeaturesDecodeErrorZ_ok(long o); + // struct LDKCResult_InvoiceRequestFeaturesDecodeErrorZ CResult_InvoiceRequestFeaturesDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_InvoiceRequestFeaturesDecodeErrorZ_err(long e); + // bool CResult_InvoiceRequestFeaturesDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceRequestFeaturesDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_InvoiceRequestFeaturesDecodeErrorZ_is_ok(long o); + // void CResult_InvoiceRequestFeaturesDecodeErrorZ_free(struct LDKCResult_InvoiceRequestFeaturesDecodeErrorZ _res); + public static native void CResult_InvoiceRequestFeaturesDecodeErrorZ_free(long _res); + // uint64_t CResult_InvoiceRequestFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InvoiceRequestFeaturesDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_InvoiceRequestFeaturesDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_InvoiceRequestFeaturesDecodeErrorZ CResult_InvoiceRequestFeaturesDecodeErrorZ_clone(const struct LDKCResult_InvoiceRequestFeaturesDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_InvoiceRequestFeaturesDecodeErrorZ_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); @@ -3161,8 +3272,8 @@ public class bindings { public static native long CResult_SignDecodeErrorZ_clone_ptr(long arg); // struct LDKCResult_SignDecodeErrorZ CResult_SignDecodeErrorZ_clone(const struct LDKCResult_SignDecodeErrorZ *NONNULL_PTR orig); public static native long CResult_SignDecodeErrorZ_clone(long orig); - // void CVec_u5Z_free(struct LDKCVec_u5Z _res); - public static native void CVec_u5Z_free(byte[] _res); + // void CVec_U5Z_free(struct LDKCVec_U5Z _res); + public static native void CVec_U5Z_free(byte[] _res); // struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_ok(struct LDKRecoverableSignature o); public static native long CResult_RecoverableSignatureNoneZ_ok(byte[] o); // struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_err(void); @@ -3277,18 +3388,6 @@ public class bindings { public static native long CResult__u832APIErrorZ_clone_ptr(long arg); // struct LDKCResult__u832APIErrorZ CResult__u832APIErrorZ_clone(const struct LDKCResult__u832APIErrorZ *NONNULL_PTR orig); public static native long CResult__u832APIErrorZ_clone(long orig); - // struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o); - public static native long CResult_PaymentIdPaymentSendFailureZ_ok(byte[] o); - // struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_err(struct LDKPaymentSendFailure e); - public static native long CResult_PaymentIdPaymentSendFailureZ_err(long e); - // bool CResult_PaymentIdPaymentSendFailureZ_is_ok(const struct LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR o); - public static native boolean CResult_PaymentIdPaymentSendFailureZ_is_ok(long o); - // void CResult_PaymentIdPaymentSendFailureZ_free(struct LDKCResult_PaymentIdPaymentSendFailureZ _res); - public static native void CResult_PaymentIdPaymentSendFailureZ_free(long _res); - // uint64_t CResult_PaymentIdPaymentSendFailureZ_clone_ptr(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR arg); - public static native long CResult_PaymentIdPaymentSendFailureZ_clone_ptr(long arg); - // struct LDKCResult_PaymentIdPaymentSendFailureZ CResult_PaymentIdPaymentSendFailureZ_clone(const struct LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR orig); - public static native long CResult_PaymentIdPaymentSendFailureZ_clone(long orig); // struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void); public static native long CResult_NonePaymentSendFailureZ_ok(); // struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e); @@ -3301,6 +3400,18 @@ public class bindings { public static native long CResult_NonePaymentSendFailureZ_clone_ptr(long arg); // struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_clone(const struct LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR orig); public static native long CResult_NonePaymentSendFailureZ_clone(long orig); + // struct LDKCResult_PaymentHashPaymentSendFailureZ CResult_PaymentHashPaymentSendFailureZ_ok(struct LDKThirtyTwoBytes o); + public static native long CResult_PaymentHashPaymentSendFailureZ_ok(byte[] o); + // struct LDKCResult_PaymentHashPaymentSendFailureZ CResult_PaymentHashPaymentSendFailureZ_err(struct LDKPaymentSendFailure e); + public static native long CResult_PaymentHashPaymentSendFailureZ_err(long e); + // bool CResult_PaymentHashPaymentSendFailureZ_is_ok(const struct LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR o); + public static native boolean CResult_PaymentHashPaymentSendFailureZ_is_ok(long o); + // void CResult_PaymentHashPaymentSendFailureZ_free(struct LDKCResult_PaymentHashPaymentSendFailureZ _res); + public static native void CResult_PaymentHashPaymentSendFailureZ_free(long _res); + // uint64_t CResult_PaymentHashPaymentSendFailureZ_clone_ptr(LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR arg); + public static native long CResult_PaymentHashPaymentSendFailureZ_clone_ptr(long arg); + // struct LDKCResult_PaymentHashPaymentSendFailureZ CResult_PaymentHashPaymentSendFailureZ_clone(const struct LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR orig); + public static native long CResult_PaymentHashPaymentSendFailureZ_clone(long orig); // uint64_t C2Tuple_PaymentHashPaymentIdZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR arg); public static native long C2Tuple_PaymentHashPaymentIdZ_clone_ptr(long arg); // struct LDKC2Tuple_PaymentHashPaymentIdZ C2Tuple_PaymentHashPaymentIdZ_clone(const struct LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR orig); @@ -3417,226 +3528,112 @@ public class bindings { public static native long CResult_ChannelCounterpartyDecodeErrorZ_clone(long orig); // struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_ok(struct LDKChannelDetails o); public static native long CResult_ChannelDetailsDecodeErrorZ_ok(long o); - // struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_err(struct LDKDecodeError e); - public static native long CResult_ChannelDetailsDecodeErrorZ_err(long e); - // bool CResult_ChannelDetailsDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR o); - public static native boolean CResult_ChannelDetailsDecodeErrorZ_is_ok(long o); - // void CResult_ChannelDetailsDecodeErrorZ_free(struct LDKCResult_ChannelDetailsDecodeErrorZ _res); - public static native void CResult_ChannelDetailsDecodeErrorZ_free(long _res); - // uint64_t CResult_ChannelDetailsDecodeErrorZ_clone_ptr(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR arg); - public static native long CResult_ChannelDetailsDecodeErrorZ_clone_ptr(long arg); - // struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_clone(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR orig); - public static native long CResult_ChannelDetailsDecodeErrorZ_clone(long orig); - // struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_ok(struct LDKPhantomRouteHints o); - public static native long CResult_PhantomRouteHintsDecodeErrorZ_ok(long o); - // struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_err(struct LDKDecodeError e); - public static native long CResult_PhantomRouteHintsDecodeErrorZ_err(long e); - // bool CResult_PhantomRouteHintsDecodeErrorZ_is_ok(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR o); - public static native boolean CResult_PhantomRouteHintsDecodeErrorZ_is_ok(long o); - // void CResult_PhantomRouteHintsDecodeErrorZ_free(struct LDKCResult_PhantomRouteHintsDecodeErrorZ _res); - public static native void CResult_PhantomRouteHintsDecodeErrorZ_free(long _res); - // uint64_t CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR arg); - public static native long CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(long arg); - // struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_clone(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR orig); - public static native long CResult_PhantomRouteHintsDecodeErrorZ_clone(long orig); - // void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res); - public static native void CVec_ChannelMonitorZ_free(long[] _res); - // struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b); - public static native long C2Tuple_BlockHashChannelManagerZ_new(byte[] a, long b); - // void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res); - public static native void C2Tuple_BlockHashChannelManagerZ_free(long _res); - // struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o); - public static native long CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(long o); - // struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e); - public static native long CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(long e); - // bool CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR o); - public static native boolean CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(long o); - // void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res); - public static native void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(long _res); - // struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o); - public static native long CResult_ChannelConfigDecodeErrorZ_ok(long o); - // struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e); - public static native long CResult_ChannelConfigDecodeErrorZ_err(long e); - // bool CResult_ChannelConfigDecodeErrorZ_is_ok(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR o); - public static native boolean CResult_ChannelConfigDecodeErrorZ_is_ok(long o); - // void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res); - public static native void CResult_ChannelConfigDecodeErrorZ_free(long _res); - // uint64_t CResult_ChannelConfigDecodeErrorZ_clone_ptr(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR arg); - public static native long CResult_ChannelConfigDecodeErrorZ_clone_ptr(long arg); - // struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig); - public static native long CResult_ChannelConfigDecodeErrorZ_clone(long orig); - // struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o); - public static native long CResult_OutPointDecodeErrorZ_ok(long o); - // struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e); - public static native long CResult_OutPointDecodeErrorZ_err(long e); - // bool CResult_OutPointDecodeErrorZ_is_ok(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR o); - public static native boolean CResult_OutPointDecodeErrorZ_is_ok(long o); - // void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res); - public static native void CResult_OutPointDecodeErrorZ_free(long _res); - // uint64_t CResult_OutPointDecodeErrorZ_clone_ptr(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR arg); - public static native long CResult_OutPointDecodeErrorZ_clone_ptr(long arg); - // struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig); - public static native long CResult_OutPointDecodeErrorZ_clone(long orig); - // struct LDKCOption_TypeZ COption_TypeZ_some(struct LDKType o); - public static native long COption_TypeZ_some(long o); - // struct LDKCOption_TypeZ COption_TypeZ_none(void); - public static native long COption_TypeZ_none(); - // void COption_TypeZ_free(struct LDKCOption_TypeZ _res); - public static native void COption_TypeZ_free(long _res); - // uint64_t COption_TypeZ_clone_ptr(LDKCOption_TypeZ *NONNULL_PTR arg); - public static native long COption_TypeZ_clone_ptr(long arg); - // struct LDKCOption_TypeZ COption_TypeZ_clone(const struct LDKCOption_TypeZ *NONNULL_PTR orig); - public static native long COption_TypeZ_clone(long orig); - // struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_ok(struct LDKCOption_TypeZ o); - public static native long CResult_COption_TypeZDecodeErrorZ_ok(long o); - // struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_err(struct LDKDecodeError e); - public static native long CResult_COption_TypeZDecodeErrorZ_err(long e); - // bool CResult_COption_TypeZDecodeErrorZ_is_ok(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR o); - public static native boolean CResult_COption_TypeZDecodeErrorZ_is_ok(long o); - // void CResult_COption_TypeZDecodeErrorZ_free(struct LDKCResult_COption_TypeZDecodeErrorZ _res); - public static native void CResult_COption_TypeZDecodeErrorZ_free(long _res); - // uint64_t CResult_COption_TypeZDecodeErrorZ_clone_ptr(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR arg); - public static native long CResult_COption_TypeZDecodeErrorZ_clone_ptr(long arg); - // struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_clone(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR orig); - public static native long CResult_COption_TypeZDecodeErrorZ_clone(long orig); - // struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_ok(struct LDKThirtyTwoBytes o); - public static native long CResult_PaymentIdPaymentErrorZ_ok(byte[] o); - // struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_err(struct LDKPaymentError e); - public static native long CResult_PaymentIdPaymentErrorZ_err(long e); - // bool CResult_PaymentIdPaymentErrorZ_is_ok(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR o); - public static native boolean CResult_PaymentIdPaymentErrorZ_is_ok(long o); - // void CResult_PaymentIdPaymentErrorZ_free(struct LDKCResult_PaymentIdPaymentErrorZ _res); - public static native void CResult_PaymentIdPaymentErrorZ_free(long _res); - // uint64_t CResult_PaymentIdPaymentErrorZ_clone_ptr(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR arg); - public static native long CResult_PaymentIdPaymentErrorZ_clone_ptr(long arg); - // struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_clone(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR orig); - public static native long CResult_PaymentIdPaymentErrorZ_clone(long orig); - // struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_ok(struct LDKInFlightHtlcs o); - public static native long CResult_InFlightHtlcsDecodeErrorZ_ok(long o); - // struct LDKCResult_InFlightHtlcsDecodeErrorZ CResult_InFlightHtlcsDecodeErrorZ_err(struct LDKDecodeError e); - public static native long CResult_InFlightHtlcsDecodeErrorZ_err(long e); - // bool CResult_InFlightHtlcsDecodeErrorZ_is_ok(const struct LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR o); - public static native boolean CResult_InFlightHtlcsDecodeErrorZ_is_ok(long o); - // void CResult_InFlightHtlcsDecodeErrorZ_free(struct LDKCResult_InFlightHtlcsDecodeErrorZ _res); - public static native void CResult_InFlightHtlcsDecodeErrorZ_free(long _res); - // struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_ok(enum LDKSiPrefix o); - public static native long CResult_SiPrefixParseErrorZ_ok(SiPrefix o); - // struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_err(struct LDKParseError e); - public static native long CResult_SiPrefixParseErrorZ_err(long e); - // bool CResult_SiPrefixParseErrorZ_is_ok(const struct LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR o); - public static native boolean CResult_SiPrefixParseErrorZ_is_ok(long o); - // void CResult_SiPrefixParseErrorZ_free(struct LDKCResult_SiPrefixParseErrorZ _res); - public static native void CResult_SiPrefixParseErrorZ_free(long _res); - // uint64_t CResult_SiPrefixParseErrorZ_clone_ptr(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR arg); - public static native long CResult_SiPrefixParseErrorZ_clone_ptr(long arg); - // struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_clone(const struct LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR orig); - public static native long CResult_SiPrefixParseErrorZ_clone(long orig); - // struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_ok(struct LDKInvoice o); - public static native long CResult_InvoiceParseOrSemanticErrorZ_ok(long o); - // struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_err(struct LDKParseOrSemanticError e); - public static native long CResult_InvoiceParseOrSemanticErrorZ_err(long e); - // bool CResult_InvoiceParseOrSemanticErrorZ_is_ok(const struct LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR o); - public static native boolean CResult_InvoiceParseOrSemanticErrorZ_is_ok(long o); - // void CResult_InvoiceParseOrSemanticErrorZ_free(struct LDKCResult_InvoiceParseOrSemanticErrorZ _res); - public static native void CResult_InvoiceParseOrSemanticErrorZ_free(long _res); - // uint64_t CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR arg); - public static native long CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(long arg); - // struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_clone(const struct LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR orig); - public static native long CResult_InvoiceParseOrSemanticErrorZ_clone(long orig); - // struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_ok(struct LDKSignedRawInvoice o); - public static native long CResult_SignedRawInvoiceParseErrorZ_ok(long o); - // struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_err(struct LDKParseError e); - public static native long CResult_SignedRawInvoiceParseErrorZ_err(long e); - // bool CResult_SignedRawInvoiceParseErrorZ_is_ok(const struct LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR o); - public static native boolean CResult_SignedRawInvoiceParseErrorZ_is_ok(long o); - // void CResult_SignedRawInvoiceParseErrorZ_free(struct LDKCResult_SignedRawInvoiceParseErrorZ _res); - public static native void CResult_SignedRawInvoiceParseErrorZ_free(long _res); - // uint64_t CResult_SignedRawInvoiceParseErrorZ_clone_ptr(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR arg); - public static native long CResult_SignedRawInvoiceParseErrorZ_clone_ptr(long arg); - // struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_clone(const struct LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR orig); - public static native long CResult_SignedRawInvoiceParseErrorZ_clone(long orig); - // uint64_t C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR arg); - public static native long C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(long arg); - // struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR orig); - public static native long C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(long orig); - // struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(struct LDKRawInvoice a, struct LDKThirtyTwoBytes b, struct LDKInvoiceSignature c); - public static native long C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(long a, byte[] b, long c); - // void C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res); - public static native void C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(long _res); - // struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_ok(struct LDKPayeePubKey o); - public static native long CResult_PayeePubKeyErrorZ_ok(long o); - // struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_err(enum LDKSecp256k1Error e); - public static native long CResult_PayeePubKeyErrorZ_err(Secp256k1Error e); - // bool CResult_PayeePubKeyErrorZ_is_ok(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR o); - public static native boolean CResult_PayeePubKeyErrorZ_is_ok(long o); - // void CResult_PayeePubKeyErrorZ_free(struct LDKCResult_PayeePubKeyErrorZ _res); - public static native void CResult_PayeePubKeyErrorZ_free(long _res); - // uint64_t CResult_PayeePubKeyErrorZ_clone_ptr(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR arg); - public static native long CResult_PayeePubKeyErrorZ_clone_ptr(long arg); - // struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_clone(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR orig); - public static native long CResult_PayeePubKeyErrorZ_clone(long orig); - // void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res); - public static native void CVec_PrivateRouteZ_free(long[] _res); - // struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o); - public static native long CResult_PositiveTimestampCreationErrorZ_ok(long o); - // struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e); - public static native long CResult_PositiveTimestampCreationErrorZ_err(CreationError e); - // bool CResult_PositiveTimestampCreationErrorZ_is_ok(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR o); - public static native boolean CResult_PositiveTimestampCreationErrorZ_is_ok(long o); - // void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res); - public static native void CResult_PositiveTimestampCreationErrorZ_free(long _res); - // uint64_t CResult_PositiveTimestampCreationErrorZ_clone_ptr(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR arg); - public static native long CResult_PositiveTimestampCreationErrorZ_clone_ptr(long arg); - // struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig); - public static native long CResult_PositiveTimestampCreationErrorZ_clone(long orig); - // struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_ok(void); - public static native long CResult_NoneSemanticErrorZ_ok(); - // struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_err(enum LDKSemanticError e); - public static native long CResult_NoneSemanticErrorZ_err(SemanticError e); - // bool CResult_NoneSemanticErrorZ_is_ok(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR o); - public static native boolean CResult_NoneSemanticErrorZ_is_ok(long o); - // void CResult_NoneSemanticErrorZ_free(struct LDKCResult_NoneSemanticErrorZ _res); - public static native void CResult_NoneSemanticErrorZ_free(long _res); - // uint64_t CResult_NoneSemanticErrorZ_clone_ptr(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR arg); - public static native long CResult_NoneSemanticErrorZ_clone_ptr(long arg); - // struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_clone(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR orig); - public static native long CResult_NoneSemanticErrorZ_clone(long orig); - // struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_ok(struct LDKInvoice o); - public static native long CResult_InvoiceSemanticErrorZ_ok(long o); - // struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_err(enum LDKSemanticError e); - public static native long CResult_InvoiceSemanticErrorZ_err(SemanticError e); - // bool CResult_InvoiceSemanticErrorZ_is_ok(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR o); - public static native boolean CResult_InvoiceSemanticErrorZ_is_ok(long o); - // void CResult_InvoiceSemanticErrorZ_free(struct LDKCResult_InvoiceSemanticErrorZ _res); - public static native void CResult_InvoiceSemanticErrorZ_free(long _res); - // uint64_t CResult_InvoiceSemanticErrorZ_clone_ptr(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR arg); - public static native long CResult_InvoiceSemanticErrorZ_clone_ptr(long arg); - // struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_clone(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR orig); - public static native long CResult_InvoiceSemanticErrorZ_clone(long orig); - // struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o); - public static native long CResult_DescriptionCreationErrorZ_ok(long o); - // struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e); - public static native long CResult_DescriptionCreationErrorZ_err(CreationError e); - // bool CResult_DescriptionCreationErrorZ_is_ok(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR o); - public static native boolean CResult_DescriptionCreationErrorZ_is_ok(long o); - // void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res); - public static native void CResult_DescriptionCreationErrorZ_free(long _res); - // uint64_t CResult_DescriptionCreationErrorZ_clone_ptr(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR arg); - public static native long CResult_DescriptionCreationErrorZ_clone_ptr(long arg); - // struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig); - public static native long CResult_DescriptionCreationErrorZ_clone(long orig); - // struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o); - public static native long CResult_PrivateRouteCreationErrorZ_ok(long o); - // struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e); - public static native long CResult_PrivateRouteCreationErrorZ_err(CreationError e); - // bool CResult_PrivateRouteCreationErrorZ_is_ok(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR o); - public static native boolean CResult_PrivateRouteCreationErrorZ_is_ok(long o); - // void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res); - public static native void CResult_PrivateRouteCreationErrorZ_free(long _res); - // uint64_t CResult_PrivateRouteCreationErrorZ_clone_ptr(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR arg); - public static native long CResult_PrivateRouteCreationErrorZ_clone_ptr(long arg); - // struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig); - public static native long CResult_PrivateRouteCreationErrorZ_clone(long orig); + // struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_ChannelDetailsDecodeErrorZ_err(long e); + // bool CResult_ChannelDetailsDecodeErrorZ_is_ok(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_ChannelDetailsDecodeErrorZ_is_ok(long o); + // void CResult_ChannelDetailsDecodeErrorZ_free(struct LDKCResult_ChannelDetailsDecodeErrorZ _res); + public static native void CResult_ChannelDetailsDecodeErrorZ_free(long _res); + // uint64_t CResult_ChannelDetailsDecodeErrorZ_clone_ptr(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_ChannelDetailsDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_ChannelDetailsDecodeErrorZ CResult_ChannelDetailsDecodeErrorZ_clone(const struct LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_ChannelDetailsDecodeErrorZ_clone(long orig); + // struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_ok(struct LDKPhantomRouteHints o); + public static native long CResult_PhantomRouteHintsDecodeErrorZ_ok(long o); + // struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_PhantomRouteHintsDecodeErrorZ_err(long e); + // bool CResult_PhantomRouteHintsDecodeErrorZ_is_ok(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_PhantomRouteHintsDecodeErrorZ_is_ok(long o); + // void CResult_PhantomRouteHintsDecodeErrorZ_free(struct LDKCResult_PhantomRouteHintsDecodeErrorZ _res); + public static native void CResult_PhantomRouteHintsDecodeErrorZ_free(long _res); + // uint64_t CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_PhantomRouteHintsDecodeErrorZ CResult_PhantomRouteHintsDecodeErrorZ_clone(const struct LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_PhantomRouteHintsDecodeErrorZ_clone(long orig); + // void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res); + public static native void CVec_ChannelMonitorZ_free(long[] _res); + // struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b); + public static native long C2Tuple_BlockHashChannelManagerZ_new(byte[] a, long b); + // void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res); + public static native void C2Tuple_BlockHashChannelManagerZ_free(long _res); + // struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o); + public static native long CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(long o); + // struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(long e); + // bool CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(long o); + // void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res); + public static native void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(long _res); + // struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_ok(struct LDKChannelConfig o); + public static native long CResult_ChannelConfigDecodeErrorZ_ok(long o); + // struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_ChannelConfigDecodeErrorZ_err(long e); + // bool CResult_ChannelConfigDecodeErrorZ_is_ok(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_ChannelConfigDecodeErrorZ_is_ok(long o); + // void CResult_ChannelConfigDecodeErrorZ_free(struct LDKCResult_ChannelConfigDecodeErrorZ _res); + public static native void CResult_ChannelConfigDecodeErrorZ_free(long _res); + // uint64_t CResult_ChannelConfigDecodeErrorZ_clone_ptr(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_ChannelConfigDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_ChannelConfigDecodeErrorZ CResult_ChannelConfigDecodeErrorZ_clone(const struct LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_ChannelConfigDecodeErrorZ_clone(long orig); + // struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_ok(struct LDKOutPoint o); + public static native long CResult_OutPointDecodeErrorZ_ok(long o); + // struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_OutPointDecodeErrorZ_err(long e); + // bool CResult_OutPointDecodeErrorZ_is_ok(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_OutPointDecodeErrorZ_is_ok(long o); + // void CResult_OutPointDecodeErrorZ_free(struct LDKCResult_OutPointDecodeErrorZ _res); + public static native void CResult_OutPointDecodeErrorZ_free(long _res); + // uint64_t CResult_OutPointDecodeErrorZ_clone_ptr(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_OutPointDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_OutPointDecodeErrorZ CResult_OutPointDecodeErrorZ_clone(const struct LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_OutPointDecodeErrorZ_clone(long orig); + // struct LDKCOption_TypeZ COption_TypeZ_some(struct LDKType o); + public static native long COption_TypeZ_some(long o); + // struct LDKCOption_TypeZ COption_TypeZ_none(void); + public static native long COption_TypeZ_none(); + // void COption_TypeZ_free(struct LDKCOption_TypeZ _res); + public static native void COption_TypeZ_free(long _res); + // uint64_t COption_TypeZ_clone_ptr(LDKCOption_TypeZ *NONNULL_PTR arg); + public static native long COption_TypeZ_clone_ptr(long arg); + // struct LDKCOption_TypeZ COption_TypeZ_clone(const struct LDKCOption_TypeZ *NONNULL_PTR orig); + public static native long COption_TypeZ_clone(long orig); + // struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_ok(struct LDKCOption_TypeZ o); + public static native long CResult_COption_TypeZDecodeErrorZ_ok(long o); + // struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_err(struct LDKDecodeError e); + public static native long CResult_COption_TypeZDecodeErrorZ_err(long e); + // bool CResult_COption_TypeZDecodeErrorZ_is_ok(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR o); + public static native boolean CResult_COption_TypeZDecodeErrorZ_is_ok(long o); + // void CResult_COption_TypeZDecodeErrorZ_free(struct LDKCResult_COption_TypeZDecodeErrorZ _res); + public static native void CResult_COption_TypeZDecodeErrorZ_free(long _res); + // uint64_t CResult_COption_TypeZDecodeErrorZ_clone_ptr(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR arg); + public static native long CResult_COption_TypeZDecodeErrorZ_clone_ptr(long arg); + // struct LDKCResult_COption_TypeZDecodeErrorZ CResult_COption_TypeZDecodeErrorZ_clone(const struct LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR orig); + public static native long CResult_COption_TypeZDecodeErrorZ_clone(long orig); + // struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_ok(struct LDKThirtyTwoBytes o); + public static native long CResult_PaymentIdPaymentErrorZ_ok(byte[] o); + // struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_err(struct LDKPaymentError e); + public static native long CResult_PaymentIdPaymentErrorZ_err(long e); + // bool CResult_PaymentIdPaymentErrorZ_is_ok(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR o); + public static native boolean CResult_PaymentIdPaymentErrorZ_is_ok(long o); + // void CResult_PaymentIdPaymentErrorZ_free(struct LDKCResult_PaymentIdPaymentErrorZ _res); + public static native void CResult_PaymentIdPaymentErrorZ_free(long _res); + // uint64_t CResult_PaymentIdPaymentErrorZ_clone_ptr(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR arg); + public static native long CResult_PaymentIdPaymentErrorZ_clone_ptr(long arg); + // struct LDKCResult_PaymentIdPaymentErrorZ CResult_PaymentIdPaymentErrorZ_clone(const struct LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR orig); + public static native long CResult_PaymentIdPaymentErrorZ_clone(long orig); + // struct LDKCResult_NonePaymentErrorZ CResult_NonePaymentErrorZ_ok(void); + public static native long CResult_NonePaymentErrorZ_ok(); + // struct LDKCResult_NonePaymentErrorZ CResult_NonePaymentErrorZ_err(struct LDKPaymentError e); + public static native long CResult_NonePaymentErrorZ_err(long e); + // bool CResult_NonePaymentErrorZ_is_ok(const struct LDKCResult_NonePaymentErrorZ *NONNULL_PTR o); + public static native boolean CResult_NonePaymentErrorZ_is_ok(long o); + // void CResult_NonePaymentErrorZ_free(struct LDKCResult_NonePaymentErrorZ _res); + public static native void CResult_NonePaymentErrorZ_free(long _res); + // uint64_t CResult_NonePaymentErrorZ_clone_ptr(LDKCResult_NonePaymentErrorZ *NONNULL_PTR arg); + public static native long CResult_NonePaymentErrorZ_clone_ptr(long arg); + // struct LDKCResult_NonePaymentErrorZ CResult_NonePaymentErrorZ_clone(const struct LDKCResult_NonePaymentErrorZ *NONNULL_PTR orig); + public static native long CResult_NonePaymentErrorZ_clone(long orig); // struct LDKCResult_StringErrorZ CResult_StringErrorZ_ok(struct LDKStr o); public static native long CResult_StringErrorZ_ok(String o); // struct LDKCResult_StringErrorZ CResult_StringErrorZ_err(enum LDKSecp256k1Error e); @@ -3649,6 +3646,18 @@ public class bindings { 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_PublicKeyErrorZ CResult_PublicKeyErrorZ_ok(struct LDKPublicKey o); + public static native long CResult_PublicKeyErrorZ_ok(byte[] o); + // struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_err(enum LDKSecp256k1Error e); + public static native long CResult_PublicKeyErrorZ_err(Secp256k1Error e); + // bool CResult_PublicKeyErrorZ_is_ok(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR o); + public static native boolean CResult_PublicKeyErrorZ_is_ok(long o); + // void CResult_PublicKeyErrorZ_free(struct LDKCResult_PublicKeyErrorZ _res); + public static native void CResult_PublicKeyErrorZ_free(long _res); + // uint64_t CResult_PublicKeyErrorZ_clone_ptr(LDKCResult_PublicKeyErrorZ *NONNULL_PTR arg); + public static native long CResult_PublicKeyErrorZ_clone_ptr(long arg); + // struct LDKCResult_PublicKeyErrorZ CResult_PublicKeyErrorZ_clone(const struct LDKCResult_PublicKeyErrorZ *NONNULL_PTR orig); + public static native long CResult_PublicKeyErrorZ_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); @@ -3847,6 +3856,124 @@ public class bindings { public static native boolean CResult_NoneSendErrorZ_is_ok(long o); // void CResult_NoneSendErrorZ_free(struct LDKCResult_NoneSendErrorZ _res); public static native void CResult_NoneSendErrorZ_free(long _res); + // struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_ok(enum LDKSiPrefix o); + public static native long CResult_SiPrefixParseErrorZ_ok(SiPrefix o); + // struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_err(struct LDKParseError e); + public static native long CResult_SiPrefixParseErrorZ_err(long e); + // bool CResult_SiPrefixParseErrorZ_is_ok(const struct LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR o); + public static native boolean CResult_SiPrefixParseErrorZ_is_ok(long o); + // void CResult_SiPrefixParseErrorZ_free(struct LDKCResult_SiPrefixParseErrorZ _res); + public static native void CResult_SiPrefixParseErrorZ_free(long _res); + // uint64_t CResult_SiPrefixParseErrorZ_clone_ptr(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR arg); + public static native long CResult_SiPrefixParseErrorZ_clone_ptr(long arg); + // struct LDKCResult_SiPrefixParseErrorZ CResult_SiPrefixParseErrorZ_clone(const struct LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR orig); + public static native long CResult_SiPrefixParseErrorZ_clone(long orig); + // struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_ok(struct LDKInvoice o); + public static native long CResult_InvoiceParseOrSemanticErrorZ_ok(long o); + // struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_err(struct LDKParseOrSemanticError e); + public static native long CResult_InvoiceParseOrSemanticErrorZ_err(long e); + // bool CResult_InvoiceParseOrSemanticErrorZ_is_ok(const struct LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR o); + public static native boolean CResult_InvoiceParseOrSemanticErrorZ_is_ok(long o); + // void CResult_InvoiceParseOrSemanticErrorZ_free(struct LDKCResult_InvoiceParseOrSemanticErrorZ _res); + public static native void CResult_InvoiceParseOrSemanticErrorZ_free(long _res); + // uint64_t CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR arg); + public static native long CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(long arg); + // struct LDKCResult_InvoiceParseOrSemanticErrorZ CResult_InvoiceParseOrSemanticErrorZ_clone(const struct LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR orig); + public static native long CResult_InvoiceParseOrSemanticErrorZ_clone(long orig); + // struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_ok(struct LDKSignedRawInvoice o); + public static native long CResult_SignedRawInvoiceParseErrorZ_ok(long o); + // struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_err(struct LDKParseError e); + public static native long CResult_SignedRawInvoiceParseErrorZ_err(long e); + // bool CResult_SignedRawInvoiceParseErrorZ_is_ok(const struct LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR o); + public static native boolean CResult_SignedRawInvoiceParseErrorZ_is_ok(long o); + // void CResult_SignedRawInvoiceParseErrorZ_free(struct LDKCResult_SignedRawInvoiceParseErrorZ _res); + public static native void CResult_SignedRawInvoiceParseErrorZ_free(long _res); + // uint64_t CResult_SignedRawInvoiceParseErrorZ_clone_ptr(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR arg); + public static native long CResult_SignedRawInvoiceParseErrorZ_clone_ptr(long arg); + // struct LDKCResult_SignedRawInvoiceParseErrorZ CResult_SignedRawInvoiceParseErrorZ_clone(const struct LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR orig); + public static native long CResult_SignedRawInvoiceParseErrorZ_clone(long orig); + // uint64_t C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR arg); + public static native long C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(long arg); + // struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(const struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR orig); + public static native long C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(long orig); + // struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(struct LDKRawInvoice a, struct LDKThirtyTwoBytes b, struct LDKInvoiceSignature c); + public static native long C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(long a, byte[] b, long c); + // void C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(struct LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res); + public static native void C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(long _res); + // struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_ok(struct LDKPayeePubKey o); + public static native long CResult_PayeePubKeyErrorZ_ok(long o); + // struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_err(enum LDKSecp256k1Error e); + public static native long CResult_PayeePubKeyErrorZ_err(Secp256k1Error e); + // bool CResult_PayeePubKeyErrorZ_is_ok(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR o); + public static native boolean CResult_PayeePubKeyErrorZ_is_ok(long o); + // void CResult_PayeePubKeyErrorZ_free(struct LDKCResult_PayeePubKeyErrorZ _res); + public static native void CResult_PayeePubKeyErrorZ_free(long _res); + // uint64_t CResult_PayeePubKeyErrorZ_clone_ptr(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR arg); + public static native long CResult_PayeePubKeyErrorZ_clone_ptr(long arg); + // struct LDKCResult_PayeePubKeyErrorZ CResult_PayeePubKeyErrorZ_clone(const struct LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR orig); + public static native long CResult_PayeePubKeyErrorZ_clone(long orig); + // void CVec_PrivateRouteZ_free(struct LDKCVec_PrivateRouteZ _res); + public static native void CVec_PrivateRouteZ_free(long[] _res); + // struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_ok(struct LDKPositiveTimestamp o); + public static native long CResult_PositiveTimestampCreationErrorZ_ok(long o); + // struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_err(enum LDKCreationError e); + public static native long CResult_PositiveTimestampCreationErrorZ_err(CreationError e); + // bool CResult_PositiveTimestampCreationErrorZ_is_ok(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR o); + public static native boolean CResult_PositiveTimestampCreationErrorZ_is_ok(long o); + // void CResult_PositiveTimestampCreationErrorZ_free(struct LDKCResult_PositiveTimestampCreationErrorZ _res); + public static native void CResult_PositiveTimestampCreationErrorZ_free(long _res); + // uint64_t CResult_PositiveTimestampCreationErrorZ_clone_ptr(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR arg); + public static native long CResult_PositiveTimestampCreationErrorZ_clone_ptr(long arg); + // struct LDKCResult_PositiveTimestampCreationErrorZ CResult_PositiveTimestampCreationErrorZ_clone(const struct LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR orig); + public static native long CResult_PositiveTimestampCreationErrorZ_clone(long orig); + // struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_ok(void); + public static native long CResult_NoneSemanticErrorZ_ok(); + // struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_err(enum LDKSemanticError e); + public static native long CResult_NoneSemanticErrorZ_err(SemanticError e); + // bool CResult_NoneSemanticErrorZ_is_ok(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR o); + public static native boolean CResult_NoneSemanticErrorZ_is_ok(long o); + // void CResult_NoneSemanticErrorZ_free(struct LDKCResult_NoneSemanticErrorZ _res); + public static native void CResult_NoneSemanticErrorZ_free(long _res); + // uint64_t CResult_NoneSemanticErrorZ_clone_ptr(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR arg); + public static native long CResult_NoneSemanticErrorZ_clone_ptr(long arg); + // struct LDKCResult_NoneSemanticErrorZ CResult_NoneSemanticErrorZ_clone(const struct LDKCResult_NoneSemanticErrorZ *NONNULL_PTR orig); + public static native long CResult_NoneSemanticErrorZ_clone(long orig); + // struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_ok(struct LDKInvoice o); + public static native long CResult_InvoiceSemanticErrorZ_ok(long o); + // struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_err(enum LDKSemanticError e); + public static native long CResult_InvoiceSemanticErrorZ_err(SemanticError e); + // bool CResult_InvoiceSemanticErrorZ_is_ok(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR o); + public static native boolean CResult_InvoiceSemanticErrorZ_is_ok(long o); + // void CResult_InvoiceSemanticErrorZ_free(struct LDKCResult_InvoiceSemanticErrorZ _res); + public static native void CResult_InvoiceSemanticErrorZ_free(long _res); + // uint64_t CResult_InvoiceSemanticErrorZ_clone_ptr(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR arg); + public static native long CResult_InvoiceSemanticErrorZ_clone_ptr(long arg); + // struct LDKCResult_InvoiceSemanticErrorZ CResult_InvoiceSemanticErrorZ_clone(const struct LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR orig); + public static native long CResult_InvoiceSemanticErrorZ_clone(long orig); + // struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_ok(struct LDKDescription o); + public static native long CResult_DescriptionCreationErrorZ_ok(long o); + // struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_err(enum LDKCreationError e); + public static native long CResult_DescriptionCreationErrorZ_err(CreationError e); + // bool CResult_DescriptionCreationErrorZ_is_ok(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR o); + public static native boolean CResult_DescriptionCreationErrorZ_is_ok(long o); + // void CResult_DescriptionCreationErrorZ_free(struct LDKCResult_DescriptionCreationErrorZ _res); + public static native void CResult_DescriptionCreationErrorZ_free(long _res); + // uint64_t CResult_DescriptionCreationErrorZ_clone_ptr(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR arg); + public static native long CResult_DescriptionCreationErrorZ_clone_ptr(long arg); + // struct LDKCResult_DescriptionCreationErrorZ CResult_DescriptionCreationErrorZ_clone(const struct LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR orig); + public static native long CResult_DescriptionCreationErrorZ_clone(long orig); + // struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_ok(struct LDKPrivateRoute o); + public static native long CResult_PrivateRouteCreationErrorZ_ok(long o); + // struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_err(enum LDKCreationError e); + public static native long CResult_PrivateRouteCreationErrorZ_err(CreationError e); + // bool CResult_PrivateRouteCreationErrorZ_is_ok(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR o); + public static native boolean CResult_PrivateRouteCreationErrorZ_is_ok(long o); + // void CResult_PrivateRouteCreationErrorZ_free(struct LDKCResult_PrivateRouteCreationErrorZ _res); + public static native void CResult_PrivateRouteCreationErrorZ_free(long _res); + // uint64_t CResult_PrivateRouteCreationErrorZ_clone_ptr(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR arg); + public static native long CResult_PrivateRouteCreationErrorZ_clone_ptr(long arg); + // struct LDKCResult_PrivateRouteCreationErrorZ CResult_PrivateRouteCreationErrorZ_clone(const struct LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR orig); + public static native long CResult_PrivateRouteCreationErrorZ_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); @@ -4313,6 +4440,18 @@ public class bindings { public static native void CResult_LockedChannelMonitorNoneZ_free(long _res); // void CVec_OutPointZ_free(struct LDKCVec_OutPointZ _res); public static native void CVec_OutPointZ_free(long[] _res); + // void CVec_MonitorUpdateIdZ_free(struct LDKCVec_MonitorUpdateIdZ _res); + public static native void CVec_MonitorUpdateIdZ_free(long[] _res); + // uint64_t C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR arg); + public static native long C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(long arg); + // struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(const struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR orig); + public static native long C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(long orig); + // struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorUpdateIdZ b); + public static native long C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(long a, long[] b); + // void C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(struct LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res); + public static native void C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(long _res); + // void CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res); + public static native void CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(long[] _res); // void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr); public static native void PaymentPurpose_free(long this_ptr); // uint64_t PaymentPurpose_clone_ptr(LDKPaymentPurpose *NONNULL_PTR arg); @@ -4365,6 +4504,8 @@ public class bindings { public static native long HTLCDestination_next_hop_channel(byte[] node_id, byte[] channel_id); // struct LDKHTLCDestination HTLCDestination_unknown_next_hop(uint64_t requested_forward_scid); public static native long HTLCDestination_unknown_next_hop(long requested_forward_scid); + // struct LDKHTLCDestination HTLCDestination_invalid_forward(uint64_t requested_forward_scid); + public static native long HTLCDestination_invalid_forward(long requested_forward_scid); // struct LDKHTLCDestination HTLCDestination_failed_payment(struct LDKThirtyTwoBytes payment_hash); public static native long HTLCDestination_failed_payment(byte[] payment_hash); // bool HTLCDestination_eq(const struct LDKHTLCDestination *NONNULL_PTR a, const struct LDKHTLCDestination *NONNULL_PTR b); @@ -4379,12 +4520,12 @@ 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, 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_funding_generation_ready(struct LDKThirtyTwoBytes temporary_channel_id, struct LDKPublicKey counterparty_node_id, uint64_t channel_value_satoshis, struct LDKCVec_u8Z output_script, struct LDKU128 user_channel_id); + public static native long Event_funding_generation_ready(byte[] temporary_channel_id, byte[] counterparty_node_id, long channel_value_satoshis, byte[] output_script, byte[] user_channel_id); + // struct LDKEvent Event_payment_claimable(struct LDKPublicKey receiver_node_id, struct LDKThirtyTwoBytes payment_hash, uint64_t amount_msat, struct LDKPaymentPurpose purpose, struct LDKThirtyTwoBytes via_channel_id, struct LDKCOption_u128Z via_user_channel_id); + public static native long Event_payment_claimable(byte[] receiver_node_id, byte[] payment_hash, long amount_msat, long purpose, byte[] via_channel_id, long via_user_channel_id); + // struct LDKEvent Event_payment_claimed(struct LDKPublicKey receiver_node_id, struct LDKThirtyTwoBytes payment_hash, uint64_t amount_msat, struct LDKPaymentPurpose purpose); + public static native long Event_payment_claimed(byte[] receiver_node_id, 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_failed(struct LDKThirtyTwoBytes payment_id, struct LDKThirtyTwoBytes payment_hash); @@ -4399,12 +4540,16 @@ public class bindings { public static native long Event_probe_failed(byte[] payment_id, byte[] payment_hash, long[] path, long short_channel_id); // struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable); public static native long Event_pending_htlcs_forwardable(long time_forwardable); + // struct LDKEvent Event_htlcintercepted(struct LDKThirtyTwoBytes intercept_id, uint64_t requested_next_hop_scid, struct LDKThirtyTwoBytes payment_hash, uint64_t inbound_amount_msat, uint64_t expected_outbound_amount_msat); + public static native long Event_htlcintercepted(byte[] intercept_id, long requested_next_hop_scid, byte[] payment_hash, long inbound_amount_msat, long expected_outbound_amount_msat); // struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs); public static native long Event_spendable_outputs(long[] outputs); // 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_channel_ready(struct LDKThirtyTwoBytes channel_id, struct LDKU128 user_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKChannelTypeFeatures channel_type); + public static native long Event_channel_ready(byte[] channel_id, byte[] user_channel_id, byte[] counterparty_node_id, long channel_type); + // struct LDKEvent Event_channel_closed(struct LDKThirtyTwoBytes channel_id, struct LDKU128 user_channel_id, struct LDKClosureReason reason); + public static native long Event_channel_closed(byte[] channel_id, byte[] 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_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); @@ -4479,8 +4624,8 @@ public class bindings { public static native long APIError_apimisuse_error(String err); // struct LDKAPIError APIError_fee_rate_too_high(struct LDKStr err, uint32_t feerate); public static native long APIError_fee_rate_too_high(String err, int feerate); - // struct LDKAPIError APIError_route_error(struct LDKStr err); - public static native long APIError_route_error(String err); + // struct LDKAPIError APIError_invalid_route(struct LDKStr err); + public static native long APIError_invalid_route(String err); // struct LDKAPIError APIError_channel_unavailable(struct LDKStr err); public static native long APIError_channel_unavailable(String err); // struct LDKAPIError APIError_monitor_update_in_progress(void); @@ -4513,10 +4658,18 @@ public class bindings { public static native long recover_pk(byte[] msg, String sig); // bool verify(struct LDKu8slice msg, struct LDKStr sig, struct LDKPublicKey pk); public static native boolean verify(byte[] msg, String sig, byte[] pk); - // struct LDKCVec_u8Z construct_invoice_preimage(struct LDKu8slice hrp_bytes, struct LDKCVec_u5Z data_without_signature); + // 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); + // void PrintableString_free(struct LDKPrintableString this_obj); + public static native void PrintableString_free(long this_obj); + // struct LDKStr PrintableString_get_a(const struct LDKPrintableString *NONNULL_PTR this_ptr); + public static native String PrintableString_get_a(long this_ptr); + // void PrintableString_set_a(struct LDKPrintableString *NONNULL_PTR this_ptr, struct LDKStr val); + public static native void PrintableString_set_a(long this_ptr, String val); + // MUST_USE_RES struct LDKPrintableString PrintableString_new(struct LDKStr a_arg); + public static native long PrintableString_new(String a_arg); // void FutureCallback_free(struct LDKFutureCallback this_ptr); public static native void FutureCallback_free(long this_ptr); // void Future_free(struct LDKFuture this_obj); @@ -4725,8 +4878,12 @@ public class bindings { public static native boolean UserConfig_get_manually_accept_inbound_channels(long this_ptr); // void UserConfig_set_manually_accept_inbound_channels(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val); public static native void UserConfig_set_manually_accept_inbound_channels(long this_ptr, boolean val); - // MUST_USE_RES struct LDKUserConfig UserConfig_new(struct LDKChannelHandshakeConfig channel_handshake_config_arg, struct LDKChannelHandshakeLimits channel_handshake_limits_arg, struct LDKChannelConfig channel_config_arg, bool accept_forwards_to_priv_channels_arg, bool accept_inbound_channels_arg, bool manually_accept_inbound_channels_arg); - public static native long UserConfig_new(long channel_handshake_config_arg, long channel_handshake_limits_arg, long channel_config_arg, boolean accept_forwards_to_priv_channels_arg, boolean accept_inbound_channels_arg, boolean manually_accept_inbound_channels_arg); + // bool UserConfig_get_accept_intercept_htlcs(const struct LDKUserConfig *NONNULL_PTR this_ptr); + public static native boolean UserConfig_get_accept_intercept_htlcs(long this_ptr); + // void UserConfig_set_accept_intercept_htlcs(struct LDKUserConfig *NONNULL_PTR this_ptr, bool val); + public static native void UserConfig_set_accept_intercept_htlcs(long this_ptr, boolean val); + // MUST_USE_RES struct LDKUserConfig UserConfig_new(struct LDKChannelHandshakeConfig channel_handshake_config_arg, struct LDKChannelHandshakeLimits channel_handshake_limits_arg, struct LDKChannelConfig channel_config_arg, bool accept_forwards_to_priv_channels_arg, bool accept_inbound_channels_arg, bool manually_accept_inbound_channels_arg, bool accept_intercept_htlcs_arg); + public static native long UserConfig_new(long channel_handshake_config_arg, long channel_handshake_limits_arg, long channel_config_arg, boolean accept_forwards_to_priv_channels_arg, boolean accept_inbound_channels_arg, boolean manually_accept_inbound_channels_arg, boolean accept_intercept_htlcs_arg); // uint64_t UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg); public static native long UserConfig_clone_ptr(long arg); // struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig); @@ -4809,6 +4966,8 @@ public class bindings { public static native ConfirmationTarget ConfirmationTarget_normal(); // enum LDKConfirmationTarget ConfirmationTarget_high_priority(void); public static native ConfirmationTarget ConfirmationTarget_high_priority(); + // uint64_t ConfirmationTarget_hash(const enum LDKConfirmationTarget *NONNULL_PTR o); + public static native long ConfirmationTarget_hash(long o); // bool ConfirmationTarget_eq(const enum LDKConfirmationTarget *NONNULL_PTR a, const enum LDKConfirmationTarget *NONNULL_PTR b); public static native boolean ConfirmationTarget_eq(long a, long b); // void FeeEstimator_free(struct LDKFeeEstimator this_ptr); @@ -4837,6 +4996,8 @@ public class bindings { public static native long ChainMonitor_get_monitor(long this_arg, long funding_txo); // MUST_USE_RES struct LDKCVec_OutPointZ ChainMonitor_list_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg); public static native long[] ChainMonitor_list_monitors(long this_arg); + // MUST_USE_RES struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ChainMonitor_list_pending_monitor_updates(const struct LDKChainMonitor *NONNULL_PTR this_arg); + public static native long[] ChainMonitor_list_pending_monitor_updates(long this_arg); // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChainMonitor_channel_monitor_updated(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo, struct LDKMonitorUpdateId completed_update_id); public static native long ChainMonitor_channel_monitor_updated(long this_arg, long funding_txo, long completed_update_id); // struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg); @@ -4949,8 +5110,8 @@ public class bindings { public static native void ChannelMonitor_transaction_unconfirmed(long this_arg, byte[] txid, long broadcaster, long fee_estimator, long logger); // MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ChannelMonitor_best_block_updated(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger); public static native long[] ChannelMonitor_best_block_updated(long this_arg, byte[] header, int height, long broadcaster, long fee_estimator, long logger); - // MUST_USE_RES struct LDKCVec_TxidZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg); - public static native byte[][] ChannelMonitor_get_relevant_txids(long this_arg); + // MUST_USE_RES struct LDKCVec_C2Tuple_TxidBlockHashZZ ChannelMonitor_get_relevant_txids(const struct LDKChannelMonitor *NONNULL_PTR this_arg); + public static native long[] ChannelMonitor_get_relevant_txids(long this_arg); // MUST_USE_RES struct LDKBestBlock ChannelMonitor_current_best_block(const struct LDKChannelMonitor *NONNULL_PTR this_arg); public static native long ChannelMonitor_current_best_block(long this_arg); // MUST_USE_RES struct LDKCVec_BalanceZ ChannelMonitor_get_claimable_balances(const struct LDKChannelMonitor *NONNULL_PTR this_arg); @@ -5275,10 +5436,10 @@ public class bindings { public static native long ChannelDetails_get_unspendable_punishment_reserve(long this_ptr); // void ChannelDetails_set_unspendable_punishment_reserve(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); public static native void ChannelDetails_set_unspendable_punishment_reserve(long this_ptr, long val); - // uint64_t ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - public static native long ChannelDetails_get_user_channel_id(long this_ptr); - // void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); - public static native void ChannelDetails_set_user_channel_id(long this_ptr, long val); + // struct LDKU128 ChannelDetails_get_user_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + public static native byte[] ChannelDetails_get_user_channel_id(long this_ptr); + // void ChannelDetails_set_user_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKU128 val); + public static native void ChannelDetails_set_user_channel_id(long this_ptr, byte[] val); // uint64_t ChannelDetails_get_balance_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr); public static native long ChannelDetails_get_balance_msat(long this_ptr); // void ChannelDetails_set_balance_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); @@ -5299,6 +5460,10 @@ public class bindings { public static native long ChannelDetails_get_confirmations_required(long this_ptr); // void ChannelDetails_set_confirmations_required(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val); public static native void ChannelDetails_set_confirmations_required(long this_ptr, long val); + // struct LDKCOption_u32Z ChannelDetails_get_confirmations(const struct LDKChannelDetails *NONNULL_PTR this_ptr); + public static native long ChannelDetails_get_confirmations(long this_ptr); + // void ChannelDetails_set_confirmations(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u32Z val); + public static native void ChannelDetails_set_confirmations(long this_ptr, long val); // struct LDKCOption_u16Z ChannelDetails_get_force_close_spend_delay(const struct LDKChannelDetails *NONNULL_PTR this_ptr); public static native long ChannelDetails_get_force_close_spend_delay(long this_ptr); // void ChannelDetails_set_force_close_spend_delay(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKCOption_u16Z val); @@ -5331,8 +5496,8 @@ public class bindings { public static native long ChannelDetails_get_config(long this_ptr); // void ChannelDetails_set_config(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelConfig val); public static native void ChannelDetails_set_config(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, struct LDKChannelConfig config_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, long config_arg); + // 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, struct LDKU128 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_u32Z confirmations_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, struct LDKChannelConfig config_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, byte[] 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 confirmations_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, long config_arg); // uint64_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg); public static native long ChannelDetails_clone_ptr(long arg); // struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig); @@ -5351,8 +5516,10 @@ public class bindings { public static native long PaymentSendFailure_parameter_error(long a); // struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a); public static native long PaymentSendFailure_path_parameter_error(long[] a); - // struct LDKPaymentSendFailure PaymentSendFailure_all_failed_retry_safe(struct LDKCVec_APIErrorZ a); - public static native long PaymentSendFailure_all_failed_retry_safe(long[] a); + // struct LDKPaymentSendFailure PaymentSendFailure_all_failed_resend_safe(struct LDKCVec_APIErrorZ a); + public static native long PaymentSendFailure_all_failed_resend_safe(long[] a); + // struct LDKPaymentSendFailure PaymentSendFailure_duplicate_payment(void); + public static native long PaymentSendFailure_duplicate_payment(); // struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ results, struct LDKRouteParameters failed_paths_retry, struct LDKThirtyTwoBytes payment_id); public static native long PaymentSendFailure_partial_failure(long[] results, long failed_paths_retry, byte[] payment_id); // void PhantomRouteHints_free(struct LDKPhantomRouteHints this_obj); @@ -5379,8 +5546,8 @@ public class bindings { public static native long ChannelManager_new(long fee_est, long chain_monitor, long tx_broadcaster, long logger, long keys_manager, long config, long params); // MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg); public static native long ChannelManager_get_current_default_configuration(long this_arg); - // MUST_USE_RES struct LDKCResult__u832APIErrorZ ChannelManager_create_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey their_network_key, uint64_t channel_value_satoshis, uint64_t push_msat, uint64_t user_channel_id, struct LDKUserConfig override_config); - public static native long ChannelManager_create_channel(long this_arg, byte[] their_network_key, long channel_value_satoshis, long push_msat, long user_channel_id, long override_config); + // MUST_USE_RES struct LDKCResult__u832APIErrorZ ChannelManager_create_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey their_network_key, uint64_t channel_value_satoshis, uint64_t push_msat, struct LDKU128 user_channel_id, struct LDKUserConfig override_config); + public static native long ChannelManager_create_channel(long this_arg, byte[] their_network_key, long channel_value_satoshis, long push_msat, byte[] user_channel_id, long override_config); // MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg); 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); @@ -5397,20 +5564,24 @@ public class bindings { public static native void ChannelManager_force_close_all_channels_broadcasting_latest_txn(long this_arg); // void ChannelManager_force_close_all_channels_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg); public static native void ChannelManager_force_close_all_channels_without_broadcasting_txn(long this_arg); - // MUST_USE_RES struct LDKCResult_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); - public static native long ChannelManager_send_payment(long this_arg, long route, byte[] payment_hash, byte[] payment_secret); + // MUST_USE_RES struct LDKCResult_NonePaymentSendFailureZ ChannelManager_send_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret, struct LDKThirtyTwoBytes payment_id); + public static native long ChannelManager_send_payment(long this_arg, long route, byte[] payment_hash, byte[] payment_secret, byte[] payment_id); // MUST_USE_RES struct LDKCResult_NonePaymentSendFailureZ ChannelManager_retry_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_id); public static native long ChannelManager_retry_payment(long this_arg, long route, byte[] payment_id); // void ChannelManager_abandon_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_id); public static native void ChannelManager_abandon_payment(long this_arg, byte[] payment_id); - // MUST_USE_RES struct LDKCResult_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_PaymentHashPaymentSendFailureZ ChannelManager_send_spontaneous_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_id); + public static native long ChannelManager_send_spontaneous_payment(long this_arg, long route, byte[] payment_preimage, byte[] payment_id); // MUST_USE_RES struct LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ ChannelManager_send_probe(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCVec_RouteHopZ hops); public static native long ChannelManager_send_probe(long this_arg, long[] hops); // 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); // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_update_channel_config(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id, struct LDKCVec_ThirtyTwoBytesZ channel_ids, const struct LDKChannelConfig *NONNULL_PTR config); public static native long ChannelManager_update_channel_config(long this_arg, byte[] counterparty_node_id, byte[][] channel_ids, long config); + // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_forward_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id, const uint8_t (*next_hop_channel_id)[32], struct LDKPublicKey _next_node_id, uint64_t amt_to_forward_msat); + public static native long ChannelManager_forward_intercepted_htlc(long this_arg, byte[] intercept_id, byte[] next_hop_channel_id, byte[] _next_node_id, long amt_to_forward_msat); + // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_fail_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id); + public static native long ChannelManager_fail_intercepted_htlc(long this_arg, byte[] intercept_id); // 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); @@ -5421,10 +5592,10 @@ public class bindings { 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], 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_NoneAPIErrorZ ChannelManager_accept_inbound_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], struct LDKPublicKey counterparty_node_id, struct LDKU128 user_channel_id); + public static native long ChannelManager_accept_inbound_channel(long this_arg, byte[] temporary_channel_id, byte[] counterparty_node_id, byte[] user_channel_id); + // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], struct LDKPublicKey counterparty_node_id, struct LDKU128 user_channel_id); + public static native long ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(long this_arg, byte[] temporary_channel_id, byte[] counterparty_node_id, byte[] 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); @@ -5439,6 +5610,10 @@ public class bindings { public static native long ChannelManager_get_phantom_scid(long this_arg); // MUST_USE_RES struct LDKPhantomRouteHints ChannelManager_get_phantom_route_hints(const struct LDKChannelManager *NONNULL_PTR this_arg); public static native long ChannelManager_get_phantom_route_hints(long this_arg); + // MUST_USE_RES uint64_t ChannelManager_get_intercept_scid(const struct LDKChannelManager *NONNULL_PTR this_arg); + public static native long ChannelManager_get_intercept_scid(long this_arg); + // MUST_USE_RES struct LDKInFlightHtlcs ChannelManager_compute_inflight_htlcs(const struct LDKChannelManager *NONNULL_PTR this_arg); + public static native long ChannelManager_compute_inflight_htlcs(long this_arg); // struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg); public static native long ChannelManager_as_MessageSendEventsProvider(long this_arg); // struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg); @@ -6751,6 +6926,22 @@ public class bindings { public static native long htlc_success_tx_weight(boolean opt_anchors); // uint64_t htlc_timeout_tx_weight(bool opt_anchors); public static native long htlc_timeout_tx_weight(boolean opt_anchors); + // enum LDKHTLCClaim HTLCClaim_clone(const enum LDKHTLCClaim *NONNULL_PTR orig); + public static native HTLCClaim HTLCClaim_clone(long orig); + // enum LDKHTLCClaim HTLCClaim_offered_timeout(void); + public static native HTLCClaim HTLCClaim_offered_timeout(); + // enum LDKHTLCClaim HTLCClaim_offered_preimage(void); + public static native HTLCClaim HTLCClaim_offered_preimage(); + // enum LDKHTLCClaim HTLCClaim_accepted_timeout(void); + public static native HTLCClaim HTLCClaim_accepted_timeout(); + // enum LDKHTLCClaim HTLCClaim_accepted_preimage(void); + public static native HTLCClaim HTLCClaim_accepted_preimage(); + // enum LDKHTLCClaim HTLCClaim_revocation(void); + public static native HTLCClaim HTLCClaim_revocation(); + // bool HTLCClaim_eq(const enum LDKHTLCClaim *NONNULL_PTR a, const enum LDKHTLCClaim *NONNULL_PTR b); + public static native boolean HTLCClaim_eq(long a, long b); + // MUST_USE_RES struct LDKCOption_HTLCClaimZ HTLCClaim_from_witness(struct LDKWitness witness); + public static native long HTLCClaim_from_witness(byte[] witness); // struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx); public static native byte[] build_commitment_secret(byte[] commitment_seed, long idx); // struct LDKTransaction build_closing_transaction(uint64_t to_holder_value_sat, uint64_t to_counterparty_value_sat, struct LDKCVec_u8Z to_holder_script, struct LDKCVec_u8Z to_counterparty_script, struct LDKOutPoint funding_outpoint); @@ -6773,14 +6964,14 @@ public class bindings { public static native byte[] CounterpartyCommitmentSecrets_write(long obj); // struct LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ CounterpartyCommitmentSecrets_read(struct LDKu8slice ser); public static native long CounterpartyCommitmentSecrets_read(byte[] ser); - // struct LDKCResult_SecretKeyErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]); - public static native long derive_private_key(byte[] per_commitment_point, byte[] base_secret); - // struct LDKCResult_PublicKeyErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point); - public static native long derive_public_key(byte[] per_commitment_point, byte[] base_point); - // struct LDKCResult_SecretKeyErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]); - public static native long derive_private_revocation_key(byte[] per_commitment_secret, byte[] countersignatory_revocation_base_secret); - // struct LDKCResult_PublicKeyErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point); - public static native long derive_public_revocation_key(byte[] per_commitment_point, byte[] countersignatory_revocation_base_point); + // struct LDKSecretKey derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]); + public static native byte[] derive_private_key(byte[] per_commitment_point, byte[] base_secret); + // struct LDKPublicKey derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point); + public static native byte[] derive_public_key(byte[] per_commitment_point, byte[] base_point); + // struct LDKSecretKey derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]); + public static native byte[] derive_private_revocation_key(byte[] per_commitment_secret, byte[] countersignatory_revocation_base_secret); + // struct LDKPublicKey derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point); + public static native byte[] derive_public_revocation_key(byte[] per_commitment_point, byte[] countersignatory_revocation_base_point); // void TxCreationKeys_free(struct LDKTxCreationKeys this_obj); public static native void TxCreationKeys_free(long this_obj); // struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr); @@ -6849,9 +7040,9 @@ public class bindings { public static native byte[] ChannelPublicKeys_write(long obj); // struct LDKCResult_ChannelPublicKeysDecodeErrorZ ChannelPublicKeys_read(struct LDKu8slice ser); public static native long ChannelPublicKeys_read(byte[] ser); - // MUST_USE_RES struct LDKCResult_TxCreationKeysErrorZ TxCreationKeys_derive_new(struct LDKPublicKey per_commitment_point, struct LDKPublicKey broadcaster_delayed_payment_base, struct LDKPublicKey broadcaster_htlc_base, struct LDKPublicKey countersignatory_revocation_base, struct LDKPublicKey countersignatory_htlc_base); + // MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_derive_new(struct LDKPublicKey per_commitment_point, struct LDKPublicKey broadcaster_delayed_payment_base, struct LDKPublicKey broadcaster_htlc_base, struct LDKPublicKey countersignatory_revocation_base, struct LDKPublicKey countersignatory_htlc_base); public static native long TxCreationKeys_derive_new(byte[] per_commitment_point, byte[] broadcaster_delayed_payment_base, byte[] broadcaster_htlc_base, byte[] countersignatory_revocation_base, byte[] countersignatory_htlc_base); - // MUST_USE_RES struct LDKCResult_TxCreationKeysErrorZ TxCreationKeys_from_channel_static_keys(struct LDKPublicKey per_commitment_point, const struct LDKChannelPublicKeys *NONNULL_PTR broadcaster_keys, const struct LDKChannelPublicKeys *NONNULL_PTR countersignatory_keys); + // MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_from_channel_static_keys(struct LDKPublicKey per_commitment_point, const struct LDKChannelPublicKeys *NONNULL_PTR broadcaster_keys, const struct LDKChannelPublicKeys *NONNULL_PTR countersignatory_keys); public static native long TxCreationKeys_from_channel_static_keys(byte[] per_commitment_point, long broadcaster_keys, long countersignatory_keys); // struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key); public static native byte[] get_revokeable_redeemscript(byte[] revocation_key, short contest_delay, byte[] broadcaster_delayed_payment_key); @@ -6893,10 +7084,16 @@ public class bindings { public static native byte[] get_htlc_redeemscript(long htlc, boolean opt_anchors, long keys); // struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory); public static native byte[] make_funding_redeemscript(byte[] broadcaster, byte[] countersignatory); - // struct LDKTransaction build_htlc_transaction(const uint8_t (*commitment_txid)[32], uint32_t feerate_per_kw, uint16_t contest_delay, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, bool opt_anchors, struct LDKPublicKey broadcaster_delayed_payment_key, struct LDKPublicKey revocation_key); - public static native byte[] build_htlc_transaction(byte[] commitment_txid, int feerate_per_kw, short contest_delay, long htlc, boolean opt_anchors, byte[] broadcaster_delayed_payment_key, byte[] revocation_key); + // struct LDKTransaction build_htlc_transaction(const uint8_t (*commitment_txid)[32], uint32_t feerate_per_kw, uint16_t contest_delay, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, bool opt_anchors, bool use_non_zero_fee_anchors, struct LDKPublicKey broadcaster_delayed_payment_key, struct LDKPublicKey revocation_key); + public static native byte[] build_htlc_transaction(byte[] commitment_txid, int feerate_per_kw, short contest_delay, long htlc, boolean opt_anchors, boolean use_non_zero_fee_anchors, byte[] broadcaster_delayed_payment_key, byte[] revocation_key); + // struct LDKWitness build_htlc_input_witness(struct LDKSignature local_sig, struct LDKSignature remote_sig, struct LDKThirtyTwoBytes preimage, struct LDKu8slice redeem_script, bool opt_anchors); + public static native byte[] build_htlc_input_witness(byte[] local_sig, byte[] remote_sig, byte[] preimage, byte[] redeem_script, boolean opt_anchors); + // struct LDKCVec_u8Z get_to_countersignatory_with_anchors_redeemscript(struct LDKPublicKey payment_point); + public static native byte[] get_to_countersignatory_with_anchors_redeemscript(byte[] payment_point); // struct LDKCVec_u8Z get_anchor_redeemscript(struct LDKPublicKey funding_pubkey); public static native byte[] get_anchor_redeemscript(byte[] funding_pubkey); + // struct LDKWitness build_anchor_input_witness(struct LDKPublicKey funding_key, struct LDKSignature funding_sig); + public static native byte[] build_anchor_input_witness(byte[] funding_key, byte[] funding_sig); // void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_obj); public static native void ChannelTransactionParameters_free(long this_obj); // struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr); @@ -6923,8 +7120,12 @@ public class bindings { public static native COption_NoneZ ChannelTransactionParameters_get_opt_anchors(long this_ptr); // void ChannelTransactionParameters_set_opt_anchors(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val); public static native void ChannelTransactionParameters_set_opt_anchors(long this_ptr, COption_NoneZ val); - // MUST_USE_RES struct LDKChannelTransactionParameters ChannelTransactionParameters_new(struct LDKChannelPublicKeys holder_pubkeys_arg, uint16_t holder_selected_contest_delay_arg, bool is_outbound_from_holder_arg, struct LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg, struct LDKOutPoint funding_outpoint_arg, enum LDKCOption_NoneZ opt_anchors_arg); - public static native long ChannelTransactionParameters_new(long holder_pubkeys_arg, short holder_selected_contest_delay_arg, boolean is_outbound_from_holder_arg, long counterparty_parameters_arg, long funding_outpoint_arg, COption_NoneZ opt_anchors_arg); + // enum LDKCOption_NoneZ ChannelTransactionParameters_get_opt_non_zero_fee_anchors(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr); + public static native COption_NoneZ ChannelTransactionParameters_get_opt_non_zero_fee_anchors(long this_ptr); + // void ChannelTransactionParameters_set_opt_non_zero_fee_anchors(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val); + public static native void ChannelTransactionParameters_set_opt_non_zero_fee_anchors(long this_ptr, COption_NoneZ val); + // MUST_USE_RES struct LDKChannelTransactionParameters ChannelTransactionParameters_new(struct LDKChannelPublicKeys holder_pubkeys_arg, uint16_t holder_selected_contest_delay_arg, bool is_outbound_from_holder_arg, struct LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg, struct LDKOutPoint funding_outpoint_arg, enum LDKCOption_NoneZ opt_anchors_arg, enum LDKCOption_NoneZ opt_non_zero_fee_anchors_arg); + public static native long ChannelTransactionParameters_new(long holder_pubkeys_arg, short holder_selected_contest_delay_arg, boolean is_outbound_from_holder_arg, long counterparty_parameters_arg, long funding_outpoint_arg, COption_NoneZ opt_anchors_arg, COption_NoneZ opt_non_zero_fee_anchors_arg); // uint64_t ChannelTransactionParameters_clone_ptr(LDKChannelTransactionParameters *NONNULL_PTR arg); public static native long ChannelTransactionParameters_clone_ptr(long arg); // struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig); @@ -7093,6 +7294,10 @@ public class bindings { public static native boolean ChannelFeatures_eq(long a, long b); // bool InvoiceFeatures_eq(const struct LDKInvoiceFeatures *NONNULL_PTR a, const struct LDKInvoiceFeatures *NONNULL_PTR b); public static native boolean InvoiceFeatures_eq(long a, long b); + // bool OfferFeatures_eq(const struct LDKOfferFeatures *NONNULL_PTR a, const struct LDKOfferFeatures *NONNULL_PTR b); + public static native boolean OfferFeatures_eq(long a, long b); + // bool InvoiceRequestFeatures_eq(const struct LDKInvoiceRequestFeatures *NONNULL_PTR a, const struct LDKInvoiceRequestFeatures *NONNULL_PTR b); + public static native boolean InvoiceRequestFeatures_eq(long a, long b); // bool ChannelTypeFeatures_eq(const struct LDKChannelTypeFeatures *NONNULL_PTR a, const struct LDKChannelTypeFeatures *NONNULL_PTR b); public static native boolean ChannelTypeFeatures_eq(long a, long b); // uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg); @@ -7111,6 +7316,14 @@ public class bindings { public static native long InvoiceFeatures_clone_ptr(long arg); // struct LDKInvoiceFeatures InvoiceFeatures_clone(const struct LDKInvoiceFeatures *NONNULL_PTR orig); public static native long InvoiceFeatures_clone(long orig); + // uint64_t OfferFeatures_clone_ptr(LDKOfferFeatures *NONNULL_PTR arg); + public static native long OfferFeatures_clone_ptr(long arg); + // struct LDKOfferFeatures OfferFeatures_clone(const struct LDKOfferFeatures *NONNULL_PTR orig); + public static native long OfferFeatures_clone(long orig); + // uint64_t InvoiceRequestFeatures_clone_ptr(LDKInvoiceRequestFeatures *NONNULL_PTR arg); + public static native long InvoiceRequestFeatures_clone_ptr(long arg); + // struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_clone(const struct LDKInvoiceRequestFeatures *NONNULL_PTR orig); + public static native long InvoiceRequestFeatures_clone(long orig); // uint64_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg); public static native long ChannelTypeFeatures_clone_ptr(long arg); // struct LDKChannelTypeFeatures ChannelTypeFeatures_clone(const struct LDKChannelTypeFeatures *NONNULL_PTR orig); @@ -7123,6 +7336,10 @@ public class bindings { public static native void ChannelFeatures_free(long this_obj); // void InvoiceFeatures_free(struct LDKInvoiceFeatures this_obj); public static native void InvoiceFeatures_free(long this_obj); + // void OfferFeatures_free(struct LDKOfferFeatures this_obj); + public static native void OfferFeatures_free(long this_obj); + // void InvoiceRequestFeatures_free(struct LDKInvoiceRequestFeatures this_obj); + public static native void InvoiceRequestFeatures_free(long this_obj); // void ChannelTypeFeatures_free(struct LDKChannelTypeFeatures this_obj); public static native void ChannelTypeFeatures_free(long this_obj); // MUST_USE_RES struct LDKInitFeatures InitFeatures_empty(void); @@ -7141,6 +7358,14 @@ public class bindings { public static native long InvoiceFeatures_empty(); // MUST_USE_RES bool InvoiceFeatures_requires_unknown_bits(const struct LDKInvoiceFeatures *NONNULL_PTR this_arg); public static native boolean InvoiceFeatures_requires_unknown_bits(long this_arg); + // MUST_USE_RES struct LDKOfferFeatures OfferFeatures_empty(void); + public static native long OfferFeatures_empty(); + // MUST_USE_RES bool OfferFeatures_requires_unknown_bits(const struct LDKOfferFeatures *NONNULL_PTR this_arg); + public static native boolean OfferFeatures_requires_unknown_bits(long this_arg); + // MUST_USE_RES struct LDKInvoiceRequestFeatures InvoiceRequestFeatures_empty(void); + public static native long InvoiceRequestFeatures_empty(); + // MUST_USE_RES bool InvoiceRequestFeatures_requires_unknown_bits(const struct LDKInvoiceRequestFeatures *NONNULL_PTR this_arg); + public static native boolean InvoiceRequestFeatures_requires_unknown_bits(long this_arg); // MUST_USE_RES struct LDKChannelTypeFeatures ChannelTypeFeatures_empty(void); public static native long ChannelTypeFeatures_empty(); // MUST_USE_RES bool ChannelTypeFeatures_requires_unknown_bits(const struct LDKChannelTypeFeatures *NONNULL_PTR this_arg); @@ -7165,6 +7390,14 @@ 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); + // struct LDKCVec_u8Z OfferFeatures_write(const struct LDKOfferFeatures *NONNULL_PTR obj); + public static native byte[] OfferFeatures_write(long obj); + // struct LDKCResult_OfferFeaturesDecodeErrorZ OfferFeatures_read(struct LDKu8slice ser); + public static native long OfferFeatures_read(byte[] ser); + // struct LDKCVec_u8Z InvoiceRequestFeatures_write(const struct LDKInvoiceRequestFeatures *NONNULL_PTR obj); + public static native byte[] InvoiceRequestFeatures_write(long obj); + // struct LDKCResult_InvoiceRequestFeaturesDecodeErrorZ InvoiceRequestFeatures_read(struct LDKu8slice ser); + public static native long InvoiceRequestFeatures_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); @@ -7523,8 +7756,8 @@ public class bindings { 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); + // void NetworkGraph_handle_network_update(const struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNetworkUpdate *NONNULL_PTR network_update); + public static native void NetworkGraph_handle_network_update(long this_arg, long network_update); // 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); @@ -7621,8 +7854,6 @@ public class bindings { public static native long DirectedChannelInfo_clone(long orig); // MUST_USE_RES struct LDKChannelInfo DirectedChannelInfo_channel(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg); 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); @@ -7637,7 +7868,7 @@ public class bindings { public static native long EffectiveCapacity_exact_liquidity(long liquidity_msat); // struct LDKEffectiveCapacity EffectiveCapacity_maximum_htlc(uint64_t amount_msat); public static native long EffectiveCapacity_maximum_htlc(long amount_msat); - // struct LDKEffectiveCapacity EffectiveCapacity_total(uint64_t capacity_msat, struct LDKCOption_u64Z htlc_maximum_msat); + // struct LDKEffectiveCapacity EffectiveCapacity_total(uint64_t capacity_msat, uint64_t htlc_maximum_msat); public static native long EffectiveCapacity_total(long capacity_msat, long htlc_maximum_msat); // struct LDKEffectiveCapacity EffectiveCapacity_infinite(void); public static native long EffectiveCapacity_infinite(); @@ -7795,6 +8026,36 @@ public class bindings { public static native long[] ReadOnlyNetworkGraph_list_nodes(long this_arg); // MUST_USE_RES struct LDKCOption_CVec_NetAddressZZ ReadOnlyNetworkGraph_get_addresses(const struct LDKReadOnlyNetworkGraph *NONNULL_PTR this_arg, struct LDKPublicKey pubkey); public static native long ReadOnlyNetworkGraph_get_addresses(long this_arg, byte[] pubkey); + // 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, struct LDKLockableScore scorer); + public static native long DefaultRouter_new(long network_graph, long logger, byte[] random_seed_bytes, long scorer); + // struct LDKRouter DefaultRouter_as_Router(const struct LDKDefaultRouter *NONNULL_PTR this_arg); + public static native long DefaultRouter_as_Router(long this_arg); + // void Router_free(struct LDKRouter this_ptr); + public static native void Router_free(long this_ptr); + // void ScorerAccountingForInFlightHtlcs_free(struct LDKScorerAccountingForInFlightHtlcs this_obj); + public static native void ScorerAccountingForInFlightHtlcs_free(long this_obj); + // MUST_USE_RES struct LDKScorerAccountingForInFlightHtlcs ScorerAccountingForInFlightHtlcs_new(struct LDKScore scorer, struct LDKInFlightHtlcs inflight_htlcs); + public static native long ScorerAccountingForInFlightHtlcs_new(long scorer, long inflight_htlcs); + // struct LDKCVec_u8Z ScorerAccountingForInFlightHtlcs_write(const struct LDKScorerAccountingForInFlightHtlcs *NONNULL_PTR obj); + public static native byte[] ScorerAccountingForInFlightHtlcs_write(long obj); + // struct LDKScore ScorerAccountingForInFlightHtlcs_as_Score(const struct LDKScorerAccountingForInFlightHtlcs *NONNULL_PTR this_arg); + public static native long ScorerAccountingForInFlightHtlcs_as_Score(long this_arg); + // void InFlightHtlcs_free(struct LDKInFlightHtlcs this_obj); + public static native void InFlightHtlcs_free(long this_obj); + // uint64_t InFlightHtlcs_clone_ptr(LDKInFlightHtlcs *NONNULL_PTR arg); + public static native long InFlightHtlcs_clone_ptr(long arg); + // struct LDKInFlightHtlcs InFlightHtlcs_clone(const struct LDKInFlightHtlcs *NONNULL_PTR orig); + public static native long InFlightHtlcs_clone(long orig); + // MUST_USE_RES struct LDKInFlightHtlcs InFlightHtlcs_new(void); + public static native long InFlightHtlcs_new(); + // MUST_USE_RES struct LDKCOption_u64Z InFlightHtlcs_used_liquidity_msat(const struct LDKInFlightHtlcs *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target, uint64_t channel_scid); + public static native long InFlightHtlcs_used_liquidity_msat(long this_arg, long source, long target, long channel_scid); + // struct LDKCVec_u8Z InFlightHtlcs_write(const struct LDKInFlightHtlcs *NONNULL_PTR obj); + public static native byte[] InFlightHtlcs_write(long obj); + // struct LDKCResult_InFlightHtlcsDecodeErrorZ InFlightHtlcs_read(struct LDKu8slice ser); + public static native long InFlightHtlcs_read(byte[] ser); // void RouteHop_free(struct LDKRouteHop this_obj); public static native void RouteHop_free(long this_obj); // struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr); @@ -8133,16 +8394,24 @@ public class bindings { 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, struct LDKLogger arg_c); public static native long ProbabilisticScorer_read(byte[] ser, long arg_a, long arg_b, long arg_c); - // void BlindedRoute_free(struct LDKBlindedRoute this_obj); - public static native void BlindedRoute_free(long this_obj); + // void BlindedPath_free(struct LDKBlindedPath this_obj); + public static native void BlindedPath_free(long this_obj); + // uint64_t BlindedPath_clone_ptr(LDKBlindedPath *NONNULL_PTR arg); + public static native long BlindedPath_clone_ptr(long arg); + // struct LDKBlindedPath BlindedPath_clone(const struct LDKBlindedPath *NONNULL_PTR orig); + public static native long BlindedPath_clone(long orig); // void BlindedHop_free(struct LDKBlindedHop this_obj); public static native void BlindedHop_free(long this_obj); - // MUST_USE_RES struct LDKCResult_BlindedRouteNoneZ BlindedRoute_new(struct LDKCVec_PublicKeyZ node_pks, const struct LDKKeysInterface *NONNULL_PTR keys_manager); - public static native long BlindedRoute_new(byte[][] node_pks, long keys_manager); - // struct LDKCVec_u8Z BlindedRoute_write(const struct LDKBlindedRoute *NONNULL_PTR obj); - public static native byte[] BlindedRoute_write(long obj); - // struct LDKCResult_BlindedRouteDecodeErrorZ BlindedRoute_read(struct LDKu8slice ser); - public static native long BlindedRoute_read(byte[] ser); + // uint64_t BlindedHop_clone_ptr(LDKBlindedHop *NONNULL_PTR arg); + public static native long BlindedHop_clone_ptr(long arg); + // struct LDKBlindedHop BlindedHop_clone(const struct LDKBlindedHop *NONNULL_PTR orig); + public static native long BlindedHop_clone(long orig); + // MUST_USE_RES struct LDKCResult_BlindedPathNoneZ BlindedPath_new(struct LDKCVec_PublicKeyZ node_pks, const struct LDKKeysInterface *NONNULL_PTR keys_manager); + public static native long BlindedPath_new(byte[][] node_pks, long keys_manager); + // struct LDKCVec_u8Z BlindedPath_write(const struct LDKBlindedPath *NONNULL_PTR obj); + public static native byte[] BlindedPath_write(long obj); + // struct LDKCResult_BlindedPathDecodeErrorZ BlindedPath_read(struct LDKu8slice ser); + public static native long BlindedPath_read(byte[] ser); // struct LDKCVec_u8Z BlindedHop_write(const struct LDKBlindedHop *NONNULL_PTR obj); public static native byte[] BlindedHop_write(long obj); // struct LDKCResult_BlindedHopDecodeErrorZ BlindedHop_read(struct LDKu8slice ser); @@ -8151,10 +8420,14 @@ public class bindings { public static native void OnionMessenger_free(long this_obj); // void Destination_free(struct LDKDestination this_ptr); public static native void Destination_free(long this_ptr); + // uint64_t Destination_clone_ptr(LDKDestination *NONNULL_PTR arg); + public static native long Destination_clone_ptr(long arg); + // struct LDKDestination Destination_clone(const struct LDKDestination *NONNULL_PTR orig); + public static native long Destination_clone(long orig); // struct LDKDestination Destination_node(struct LDKPublicKey a); public static native long Destination_node(byte[] a); - // struct LDKDestination Destination_blinded_route(struct LDKBlindedRoute a); - public static native long Destination_blinded_route(long a); + // struct LDKDestination Destination_blinded_path(struct LDKBlindedPath a); + public static native long Destination_blinded_path(long a); // void SendError_free(struct LDKSendError this_ptr); public static native void SendError_free(long this_ptr); // uint64_t SendError_clone_ptr(LDKSendError *NONNULL_PTR arg); @@ -8173,18 +8446,30 @@ public class bindings { public static native long SendError_invalid_message(); // struct LDKSendError SendError_buffer_full(void); public static native long SendError_buffer_full(); + // struct LDKSendError SendError_get_node_id_failed(void); + public static native long SendError_get_node_id_failed(); + // struct LDKSendError SendError_blinded_path_advance_failed(void); + public static native long SendError_blinded_path_advance_failed(); // bool SendError_eq(const struct LDKSendError *NONNULL_PTR a, const struct LDKSendError *NONNULL_PTR b); public static native boolean SendError_eq(long a, long b); // void CustomOnionMessageHandler_free(struct LDKCustomOnionMessageHandler this_ptr); public static native void CustomOnionMessageHandler_free(long this_ptr); // MUST_USE_RES struct LDKOnionMessenger OnionMessenger_new(struct LDKKeysInterface keys_manager, struct LDKLogger logger, struct LDKCustomOnionMessageHandler custom_handler); public static native long OnionMessenger_new(long keys_manager, long logger, long custom_handler); - // MUST_USE_RES struct LDKCResult_NoneSendErrorZ OnionMessenger_send_custom_onion_message(const struct LDKOnionMessenger *NONNULL_PTR this_arg, struct LDKCVec_PublicKeyZ intermediate_nodes, struct LDKDestination destination, struct LDKCustomOnionMessageContents msg, struct LDKBlindedRoute reply_path); - public static native long OnionMessenger_send_custom_onion_message(long this_arg, byte[][] intermediate_nodes, long destination, long msg, long reply_path); + // MUST_USE_RES struct LDKCResult_NoneSendErrorZ OnionMessenger_send_onion_message(const struct LDKOnionMessenger *NONNULL_PTR this_arg, struct LDKCVec_PublicKeyZ intermediate_nodes, struct LDKDestination destination, struct LDKOnionMessageContents message, struct LDKBlindedPath reply_path); + public static native long OnionMessenger_send_onion_message(long this_arg, byte[][] intermediate_nodes, long destination, long message, long reply_path); // struct LDKOnionMessageHandler OnionMessenger_as_OnionMessageHandler(const struct LDKOnionMessenger *NONNULL_PTR this_arg); public static native long OnionMessenger_as_OnionMessageHandler(long this_arg); // struct LDKOnionMessageProvider OnionMessenger_as_OnionMessageProvider(const struct LDKOnionMessenger *NONNULL_PTR this_arg); public static native long OnionMessenger_as_OnionMessageProvider(long this_arg); + // void OnionMessageContents_free(struct LDKOnionMessageContents this_ptr); + public static native void OnionMessageContents_free(long this_ptr); + // uint64_t OnionMessageContents_clone_ptr(LDKOnionMessageContents *NONNULL_PTR arg); + public static native long OnionMessageContents_clone_ptr(long arg); + // struct LDKOnionMessageContents OnionMessageContents_clone(const struct LDKOnionMessageContents *NONNULL_PTR orig); + public static native long OnionMessageContents_clone(long orig); + // struct LDKOnionMessageContents OnionMessageContents_custom(struct LDKCustomOnionMessageContents a); + public static native long OnionMessageContents_custom(long a); // uint64_t CustomOnionMessageContents_clone_ptr(LDKCustomOnionMessageContents *NONNULL_PTR arg); public static native long CustomOnionMessageContents_clone_ptr(long arg); // struct LDKCustomOnionMessageContents CustomOnionMessageContents_clone(const struct LDKCustomOnionMessageContents *NONNULL_PTR orig); @@ -8429,7 +8714,7 @@ public class bindings { public static native long Fallback_clone_ptr(long arg); // struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig); public static native long Fallback_clone(long orig); - // struct LDKFallback Fallback_seg_wit_program(struct LDKu5 version, struct LDKCVec_u8Z program); + // struct LDKFallback Fallback_seg_wit_program(struct LDKU5 version, struct LDKCVec_u8Z program); public static native long Fallback_seg_wit_program(byte version, byte[] program); // struct LDKFallback Fallback_pub_key_hash(struct LDKTwentyBytes a); public static native long Fallback_pub_key_hash(byte[] a); @@ -8619,8 +8904,6 @@ public class bindings { public static native void InvoicePayer_free(long this_obj); // void Payer_free(struct LDKPayer this_ptr); 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 Retry_free(struct LDKRetry this_ptr); public static native void Retry_free(long this_ptr); // uint64_t Retry_clone_ptr(LDKRetry *NONNULL_PTR arg); @@ -8651,22 +8934,20 @@ public class bindings { public static native long InvoicePayer_new(long payer, long router, 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_NonePaymentErrorZ InvoicePayer_pay_invoice_with_id(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const struct LDKInvoice *NONNULL_PTR invoice, struct LDKThirtyTwoBytes payment_id); + public static native long InvoicePayer_pay_invoice_with_id(long this_arg, long invoice, byte[] payment_id); // 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); public static native long InvoicePayer_pay_zero_value_invoice(long this_arg, long invoice, long amount_msats); + // MUST_USE_RES struct LDKCResult_NonePaymentErrorZ InvoicePayer_pay_zero_value_invoice_with_id(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const struct LDKInvoice *NONNULL_PTR invoice, uint64_t amount_msats, struct LDKThirtyTwoBytes payment_id); + public static native long InvoicePayer_pay_zero_value_invoice_with_id(long this_arg, long invoice, long amount_msats, byte[] payment_id); // MUST_USE_RES struct LDKCResult_PaymentIdPaymentErrorZ InvoicePayer_pay_pubkey(const struct LDKInvoicePayer *NONNULL_PTR this_arg, struct LDKPublicKey pubkey, struct LDKThirtyTwoBytes payment_preimage, uint64_t amount_msats, uint32_t final_cltv_expiry_delta); public static native long InvoicePayer_pay_pubkey(long this_arg, byte[] pubkey, byte[] payment_preimage, long amount_msats, int final_cltv_expiry_delta); + // MUST_USE_RES struct LDKCResult_NonePaymentErrorZ InvoicePayer_pay_pubkey_with_id(const struct LDKInvoicePayer *NONNULL_PTR this_arg, struct LDKPublicKey pubkey, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_id, uint64_t amount_msats, uint32_t final_cltv_expiry_delta); + public static native long InvoicePayer_pay_pubkey_with_id(long this_arg, byte[] pubkey, byte[] payment_preimage, byte[] payment_id, long amount_msats, int final_cltv_expiry_delta); // void InvoicePayer_remove_cached_payment(const struct LDKInvoicePayer *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32]); 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); - // void InFlightHtlcs_free(struct LDKInFlightHtlcs this_obj); - public static native void InFlightHtlcs_free(long this_obj); - // MUST_USE_RES struct LDKCOption_u64Z InFlightHtlcs_used_liquidity_msat(const struct LDKInFlightHtlcs *NONNULL_PTR this_arg, const struct LDKNodeId *NONNULL_PTR source, const struct LDKNodeId *NONNULL_PTR target, uint64_t channel_scid); - public static native long InFlightHtlcs_used_liquidity_msat(long this_arg, long source, long target, long channel_scid); - // struct LDKCVec_u8Z InFlightHtlcs_write(const struct LDKInFlightHtlcs *NONNULL_PTR obj); - public static native byte[] InFlightHtlcs_write(long obj); - // struct LDKCResult_InFlightHtlcsDecodeErrorZ InFlightHtlcs_read(struct LDKu8slice ser); - public static native long InFlightHtlcs_read(byte[] ser); // 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, struct LDKLogger logger, 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, long logger, 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, struct LDKLogger logger, enum LDKCurrency network); @@ -8679,12 +8960,8 @@ public class bindings { public static native long create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(long channelmanager, long keys_manager, long logger, 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, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs); public static native long create_invoice_from_channelmanager_and_duration_since_epoch(long channelmanager, long keys_manager, long logger, 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, struct LDKLockableScore scorer); - public static native long DefaultRouter_new(long network_graph, long logger, byte[] random_seed_bytes, long scorer); - // struct LDKRouter DefaultRouter_as_Router(const struct LDKDefaultRouter *NONNULL_PTR this_arg); - public static native long DefaultRouter_as_Router(long this_arg); + // struct LDKCResult_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(const struct LDKChannelManager *NONNULL_PTR channelmanager, struct LDKKeysInterface keys_manager, struct LDKLogger logger, enum LDKCurrency network, struct LDKCOption_u64Z amt_msat, struct LDKStr description, uint64_t duration_since_epoch, uint32_t invoice_expiry_delta_secs, struct LDKThirtyTwoBytes payment_hash); + public static native long create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(long channelmanager, long keys_manager, long logger, Currency network, long amt_msat, String description, long duration_since_epoch, int invoice_expiry_delta_secs, byte[] payment_hash); // struct LDKPayer ChannelManager_as_Payer(const struct LDKChannelManager *NONNULL_PTR this_arg); public static native long ChannelManager_as_Payer(long this_arg); // struct LDKCResult_SiPrefixParseErrorZ SiPrefix_from_str(struct LDKStr s); diff --git a/src/main/java/org/ldk/structs/APIError.java b/src/main/java/org/ldk/structs/APIError.java index 1d0e8e18..2ff70592 100644 --- a/src/main/java/org/ldk/structs/APIError.java +++ b/src/main/java/org/ldk/structs/APIError.java @@ -28,8 +28,8 @@ public class APIError extends CommonBase { if (raw_val.getClass() == bindings.LDKAPIError.FeeRateTooHigh.class) { return new FeeRateTooHigh(ptr, (bindings.LDKAPIError.FeeRateTooHigh)raw_val); } - if (raw_val.getClass() == bindings.LDKAPIError.RouteError.class) { - return new RouteError(ptr, (bindings.LDKAPIError.RouteError)raw_val); + if (raw_val.getClass() == bindings.LDKAPIError.InvalidRoute.class) { + return new InvalidRoute(ptr, (bindings.LDKAPIError.InvalidRoute)raw_val); } if (raw_val.getClass() == bindings.LDKAPIError.ChannelUnavailable.class) { return new ChannelUnavailable(ptr, (bindings.LDKAPIError.ChannelUnavailable)raw_val); @@ -81,12 +81,12 @@ public class APIError extends CommonBase { * A malformed Route was provided (eg overflowed value, node id mismatch, overly-looped route, * too-many-hops, etc). */ - public final static class RouteError extends APIError { + public final static class InvalidRoute extends APIError { /** * A human-readable error message */ public final java.lang.String err; - private RouteError(long ptr, bindings.LDKAPIError.RouteError obj) { + private InvalidRoute(long ptr, bindings.LDKAPIError.InvalidRoute obj) { super(null, ptr); this.err = obj.err; } @@ -188,10 +188,10 @@ public class APIError extends CommonBase { } /** - * Utility method to constructs a new RouteError-variant APIError + * Utility method to constructs a new InvalidRoute-variant APIError */ - public static APIError route_error(java.lang.String err) { - long ret = bindings.APIError_route_error(err); + public static APIError invalid_route(java.lang.String err) { + long ret = bindings.APIError_invalid_route(err); Reference.reachabilityFence(err); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.APIError ret_hu_conv = org.ldk.structs.APIError.constr_from_ptr(ret); @@ -225,7 +225,7 @@ public class APIError extends CommonBase { /** * Utility method to constructs a new IncompatibleShutdownScript-variant APIError */ - public static APIError incompatible_shutdown_script(ShutdownScript script) { + public static APIError incompatible_shutdown_script(org.ldk.structs.ShutdownScript script) { long ret = bindings.APIError_incompatible_shutdown_script(script == null ? 0 : script.ptr); Reference.reachabilityFence(script); if (ret >= 0 && ret <= 4096) { return null; } @@ -239,7 +239,7 @@ public class APIError extends CommonBase { * Checks if two APIErrors contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. */ - public boolean eq(APIError b) { + public boolean eq(org.ldk.structs.APIError b) { boolean ret = bindings.APIError_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/AcceptChannel.java b/src/main/java/org/ldk/structs/AcceptChannel.java index 363d4dd8..fd6f23b0 100644 --- a/src/main/java/org/ldk/structs/AcceptChannel.java +++ b/src/main/java/org/ldk/structs/AcceptChannel.java @@ -300,7 +300,7 @@ public class AcceptChannel extends CommonBase { * * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public void set_channel_type(@Nullable ChannelTypeFeatures val) { + public void set_channel_type(@Nullable org.ldk.structs.ChannelTypeFeatures val) { bindings.AcceptChannel_set_channel_type(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -330,7 +330,7 @@ public class AcceptChannel extends CommonBase { * 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(AcceptChannel b) { + public boolean eq(org.ldk.structs.AcceptChannel b) { boolean ret = bindings.AcceptChannel_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/AnnouncementSignatures.java b/src/main/java/org/ldk/structs/AnnouncementSignatures.java index dc87d6af..66c5e2f9 100644 --- a/src/main/java/org/ldk/structs/AnnouncementSignatures.java +++ b/src/main/java/org/ldk/structs/AnnouncementSignatures.java @@ -130,7 +130,7 @@ public class AnnouncementSignatures extends CommonBase { * 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(AnnouncementSignatures b) { + public boolean eq(org.ldk.structs.AnnouncementSignatures b) { boolean ret = bindings.AnnouncementSignatures_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/BackgroundProcessor.java b/src/main/java/org/ldk/structs/BackgroundProcessor.java index d8f30b2a..bba09837 100644 --- a/src/main/java/org/ldk/structs/BackgroundProcessor.java +++ b/src/main/java/org/ldk/structs/BackgroundProcessor.java @@ -90,7 +90,7 @@ public class BackgroundProcessor extends CommonBase { * [`NetworkGraph`]: lightning::routing::gossip::NetworkGraph * [`NetworkGraph::write`]: lightning::routing::gossip::NetworkGraph#impl-Writeable */ - public static BackgroundProcessor start(Persister persister, EventHandler event_handler, ChainMonitor chain_monitor, ChannelManager channel_manager, GossipSync gossip_sync, PeerManager peer_manager, Logger logger, Option_WriteableScoreZ scorer) { + public static BackgroundProcessor start(org.ldk.structs.Persister persister, org.ldk.structs.EventHandler event_handler, org.ldk.structs.ChainMonitor chain_monitor, org.ldk.structs.ChannelManager channel_manager, org.ldk.structs.GossipSync gossip_sync, org.ldk.structs.PeerManager peer_manager, org.ldk.structs.Logger logger, org.ldk.structs.Option_WriteableScoreZ scorer) { long ret = bindings.BackgroundProcessor_start(persister == null ? 0 : persister.ptr, event_handler == null ? 0 : event_handler.ptr, chain_monitor == null ? 0 : chain_monitor.ptr, channel_manager == null ? 0 : channel_manager.ptr, gossip_sync.ptr, peer_manager == null ? 0 : peer_manager.ptr, logger == null ? 0 : logger.ptr, scorer.ptr); Reference.reachabilityFence(persister); Reference.reachabilityFence(event_handler); diff --git a/src/main/java/org/ldk/structs/Balance.java b/src/main/java/org/ldk/structs/Balance.java index 1e59ef23..a516c228 100644 --- a/src/main/java/org/ldk/structs/Balance.java +++ b/src/main/java/org/ldk/structs/Balance.java @@ -270,7 +270,7 @@ public class Balance extends CommonBase { * Checks if two Balances contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. */ - public boolean eq(Balance b) { + public boolean eq(org.ldk.structs.Balance b) { boolean ret = bindings.Balance_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/BaseSign.java b/src/main/java/org/ldk/structs/BaseSign.java index 9deff4d3..ec7aa54a 100644 --- a/src/main/java/org/ldk/structs/BaseSign.java +++ b/src/main/java/org/ldk/structs/BaseSign.java @@ -8,23 +8,13 @@ import java.lang.ref.Reference; import javax.annotation.Nullable; /** - * A trait to sign lightning channel transactions as described in BOLT 3. + * A trait to sign Lightning channel transactions as described in + * [BOLT 3](https://github.com/lightning/bolts/blob/master/03-transactions.md). * - * Signing services could be implemented on a hardware wallet. In this case, - * the current Sign would be a front-end on top of a communication - * channel connected to your secure device and lightning key material wouldn't - * reside on a hot server. Nevertheless, a this deployment would still need - * to trust the ChannelManager to avoid loss of funds as this latest component - * could ask to sign commitment transaction with HTLCs paying to attacker pubkeys. - * - * A more secure iteration would be to use hashlock (or payment points) to pair - * invoice/incoming HTLCs with outgoing HTLCs to implement a no-trust-ChannelManager - * at the price of more state and computation on the hardware wallet side. In the future, - * we are looking forward to design such interface. - * - * In any case, ChannelMonitor or fallback watchtowers are always going to be trusted - * to act, as liveness and breach reply correctness are always going to be hard requirements - * of LN security model, orthogonal of key management issues. + * Signing services could be implemented on a hardware wallet and should implement signing + * policies in order to be secure. Please refer to the [VLS Policy + * Controls](https://gitlab.com/lightning-signer/validating-lightning-signer/-/blob/main/docs/policy-controls.md) + * for an example of such policies. */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class BaseSign extends CommonBase { @@ -44,7 +34,7 @@ public class BaseSign extends CommonBase { /** * Gets the per-commitment point for a specific commitment number * - * Note that the commitment number starts at (1 << 48) - 1 and counts backwards. + * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards. */ byte[] get_per_commitment_point(long idx); /** @@ -55,7 +45,7 @@ public class BaseSign extends CommonBase { * * May be called more than once for the same index. * - * Note that the commitment number starts at (1 << 48) - 1 and counts backwards. + * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards. */ byte[] release_commitment_secret(long idx); /** @@ -70,14 +60,14 @@ public class BaseSign extends CommonBase { * A validating signer should ensure that an HTLC output is removed only when the matching * preimage is provided, or when the value to holder is restored. * - * NOTE: all the relevant preimages will be provided, but there may also be additional + * Note that all the relevant preimages will be provided, but there may also be additional * irrelevant or duplicate preimages. */ Result_NoneNoneZ validate_holder_commitment(HolderCommitmentTransaction holder_tx, byte[][] preimages); /** - * Gets an arbitrary identifier describing the set of keys which are provided back to you in - * some SpendableOutputDescriptor types. This should be sufficient to identify this - * Sign object uniquely and lookup or re-derive its keys. + * Returns an arbitrary identifier describing the set of keys which are provided back to you in + * some [`SpendableOutputDescriptor`] types. This should be sufficient to identify this + * [`BaseSign`] object uniquely and lookup or re-derive its keys. */ byte[] channel_keys_id(); /** @@ -92,7 +82,7 @@ public class BaseSign extends CommonBase { * A validating signer should ensure that an HTLC output is removed only when the matching * preimage is provided, or when the value to holder is restored. * - * NOTE: all the relevant preimages will be provided, but there may also be additional + * Note that all the relevant preimages will be provided, but there may also be additional * irrelevant or duplicate preimages. */ Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment(CommitmentTransaction commitment_tx, byte[][] preimages); @@ -104,17 +94,21 @@ public class BaseSign extends CommonBase { */ Result_NoneNoneZ validate_counterparty_revocation(long idx, byte[] secret); /** - * Create a signatures for a holder's commitment transaction and its claiming HTLC transactions. - * This will only ever be called with a non-revoked commitment_tx. This will be called with the - * latest commitment_tx when we initiate a force-close. - * This will be called with the previous latest, just to get claiming HTLC signatures, if we are - * reacting to a ChannelMonitor replica that decided to broadcast before it had been updated to - * the latest. + * Creates a signature for a holder's commitment transaction and its claiming HTLC transactions. + * + * This will be called + * - with a non-revoked `commitment_tx`. + * - with the latest `commitment_tx` when we initiate a force-close. + * - with the previous `commitment_tx`, just to get claiming HTLC + * signatures, if we are reacting to a [`ChannelMonitor`] + * [replica](https://github.com/lightningdevkit/rust-lightning/blob/main/GLOSSARY.md#monitor-replicas) + * that decided to broadcast before it had been updated to the latest `commitment_tx`. + * * This may be called multiple times for the same transaction. * * An external signer implementation should check that the commitment has not been revoked. * - * May return Err if key derivation fails. Callers, such as ChannelMonitor, will panic in such a case. + * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor */ Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs(HolderCommitmentTransaction commitment_tx); /** @@ -128,9 +122,9 @@ public class BaseSign extends CommonBase { * * Amount is value of the output spent by this input, committed to in the BIP 143 signature. * - * per_commitment_key is revocation secret which was provided by our counterparty when they + * `per_commitment_key` is revocation secret which was provided by our counterparty when they * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does - * not allow the spending of any funds by itself (you need our holder revocation_secret to do + * not allow the spending of any funds by itself (you need our holder `revocation_secret` to do * so). */ Result_SignatureNoneZ sign_justice_revoked_output(byte[] justice_tx, long input, long amount, byte[] per_commitment_key); @@ -143,14 +137,15 @@ public class BaseSign extends CommonBase { * It may be called multiple times for same output(s) if a fee-bump is needed with regards * to an upcoming timelock expiration. * - * Amount is value of the output spent by this input, committed to in the BIP 143 signature. + * `amount` is the value of the output spent by this input, committed to in the BIP 143 + * signature. * - * per_commitment_key is revocation secret which was provided by our counterparty when they + * `per_commitment_key` is revocation secret which was provided by our counterparty when they * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does * not allow the spending of any funds by itself (you need our holder revocation_secret to do * so). * - * htlc holds HTLC elements (hash, timelock), thus changing the format of the witness script + * `htlc` holds HTLC elements (hash, timelock), thus changing the format of the witness script * (which is committed to in the BIP 143 signatures). */ Result_SignatureNoneZ sign_justice_revoked_htlc(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, HTLCOutputInCommitment htlc); @@ -163,12 +158,12 @@ public class BaseSign extends CommonBase { * signed for here. It may be called multiple times for same output(s) if a fee-bump is * needed with regards to an upcoming timelock expiration. * - * Witness_script is either a offered or received script as defined in BOLT3 for HTLC + * `witness_script` is either an offered or received script as defined in BOLT3 for HTLC * outputs. * - * Amount is value of the output spent by this input, committed to in the BIP 143 signature. + * `amount` is value of the output spent by this input, committed to in the BIP 143 signature. * - * Per_commitment_point is the dynamic point corresponding to the channel state + * `per_commitment_point` is the dynamic point corresponding to the channel state * detected onchain. It has been generated by our counterparty and is used to derive * channel state keys, which are then included in the witness script and committed to in the * BIP 143 signature. @@ -200,17 +195,13 @@ public class BaseSign extends CommonBase { Result_C2Tuple_SignatureSignatureZNoneZ sign_channel_announcement(UnsignedChannelAnnouncement msg); /** * Set the counterparty static channel data, including basepoints, - * counterparty_selected/holder_selected_contest_delay and funding outpoint. - * This is done as soon as the funding outpoint is known. Since these are static channel data, - * they MUST NOT be allowed to change to different values once set. + * `counterparty_selected`/`holder_selected_contest_delay` and funding outpoint. Since these + * are static channel data, they MUST NOT be allowed to change to different values once set, + * as LDK may call this method more than once. * * channel_parameters.is_populated() MUST be true. - * - * We bind holder_selected_contest_delay late here for API convenience. - * - * Will be called before any signatures are applied. */ - void ready_channel(ChannelTransactionParameters channel_parameters); + void provide_channel_parameters(ChannelTransactionParameters channel_parameters); } private static class LDKBaseSignHolder { BaseSign held; } public static BaseSign new_impl(BaseSignInterface arg, ChannelPublicKeys pubkeys) { @@ -301,9 +292,9 @@ public class BaseSign extends CommonBase { long result = ret == null ? 0 : ret.clone_ptr(); return result; } - @Override public void ready_channel(long channel_parameters) { + @Override public void provide_channel_parameters(long 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); + arg.provide_channel_parameters(channel_parameters_hu_conv); Reference.reachabilityFence(arg); } }, pubkeys); @@ -312,7 +303,7 @@ public class BaseSign extends CommonBase { /** * Gets the per-commitment point for a specific commitment number * - * Note that the commitment number starts at (1 << 48) - 1 and counts backwards. + * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards. */ public byte[] get_per_commitment_point(long idx) { byte[] ret = bindings.BaseSign_get_per_commitment_point(this.ptr, idx); @@ -329,7 +320,7 @@ public class BaseSign extends CommonBase { * * May be called more than once for the same index. * - * Note that the commitment number starts at (1 << 48) - 1 and counts backwards. + * Note that the commitment number starts at `(1 << 48) - 1` and counts backwards. */ public byte[] release_commitment_secret(long idx) { byte[] ret = bindings.BaseSign_release_commitment_secret(this.ptr, idx); @@ -350,10 +341,10 @@ public class BaseSign extends CommonBase { * A validating signer should ensure that an HTLC output is removed only when the matching * preimage is provided, or when the value to holder is restored. * - * NOTE: all the relevant preimages will be provided, but there may also be additional + * Note that all the relevant preimages will be provided, but there may also be additional * irrelevant or duplicate preimages. */ - public Result_NoneNoneZ validate_holder_commitment(HolderCommitmentTransaction holder_tx, byte[][] preimages) { + public Result_NoneNoneZ validate_holder_commitment(org.ldk.structs.HolderCommitmentTransaction holder_tx, byte[][] preimages) { long ret = bindings.BaseSign_validate_holder_commitment(this.ptr, holder_tx == null ? 0 : holder_tx.ptr, preimages != null ? Arrays.stream(preimages).map(preimages_conv_8 -> InternalUtils.check_arr_len(preimages_conv_8, 32)).toArray(byte[][]::new) : null); Reference.reachabilityFence(this); Reference.reachabilityFence(holder_tx); @@ -365,9 +356,9 @@ public class BaseSign extends CommonBase { } /** - * Gets an arbitrary identifier describing the set of keys which are provided back to you in - * some SpendableOutputDescriptor types. This should be sufficient to identify this - * Sign object uniquely and lookup or re-derive its keys. + * Returns an arbitrary identifier describing the set of keys which are provided back to you in + * some [`SpendableOutputDescriptor`] types. This should be sufficient to identify this + * [`BaseSign`] object uniquely and lookup or re-derive its keys. */ public byte[] channel_keys_id() { byte[] ret = bindings.BaseSign_channel_keys_id(this.ptr); @@ -387,10 +378,10 @@ public class BaseSign extends CommonBase { * A validating signer should ensure that an HTLC output is removed only when the matching * preimage is provided, or when the value to holder is restored. * - * NOTE: all the relevant preimages will be provided, but there may also be additional + * Note that all the relevant preimages will be provided, but there may also be additional * irrelevant or duplicate preimages. */ - public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment(CommitmentTransaction commitment_tx, byte[][] preimages) { + public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment(org.ldk.structs.CommitmentTransaction commitment_tx, byte[][] preimages) { long ret = bindings.BaseSign_sign_counterparty_commitment(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr, preimages != null ? Arrays.stream(preimages).map(preimages_conv_8 -> InternalUtils.check_arr_len(preimages_conv_8, 32)).toArray(byte[][]::new) : null); Reference.reachabilityFence(this); Reference.reachabilityFence(commitment_tx); @@ -418,19 +409,23 @@ public class BaseSign extends CommonBase { } /** - * Create a signatures for a holder's commitment transaction and its claiming HTLC transactions. - * This will only ever be called with a non-revoked commitment_tx. This will be called with the - * latest commitment_tx when we initiate a force-close. - * This will be called with the previous latest, just to get claiming HTLC signatures, if we are - * reacting to a ChannelMonitor replica that decided to broadcast before it had been updated to - * the latest. + * Creates a signature for a holder's commitment transaction and its claiming HTLC transactions. + * + * This will be called + * - with a non-revoked `commitment_tx`. + * - with the latest `commitment_tx` when we initiate a force-close. + * - with the previous `commitment_tx`, just to get claiming HTLC + * signatures, if we are reacting to a [`ChannelMonitor`] + * [replica](https://github.com/lightningdevkit/rust-lightning/blob/main/GLOSSARY.md#monitor-replicas) + * that decided to broadcast before it had been updated to the latest `commitment_tx`. + * * This may be called multiple times for the same transaction. * * An external signer implementation should check that the commitment has not been revoked. * - * May return Err if key derivation fails. Callers, such as ChannelMonitor, will panic in such a case. + * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor */ - public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs(HolderCommitmentTransaction commitment_tx) { + public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs(org.ldk.structs.HolderCommitmentTransaction commitment_tx) { long ret = bindings.BaseSign_sign_holder_commitment_and_htlcs(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(commitment_tx); @@ -451,9 +446,9 @@ public class BaseSign extends CommonBase { * * Amount is value of the output spent by this input, committed to in the BIP 143 signature. * - * per_commitment_key is revocation secret which was provided by our counterparty when they + * `per_commitment_key` is revocation secret which was provided by our counterparty when they * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does - * not allow the spending of any funds by itself (you need our holder revocation_secret to do + * not allow the spending of any funds by itself (you need our holder `revocation_secret` to do * so). */ public Result_SignatureNoneZ sign_justice_revoked_output(byte[] justice_tx, long input, long amount, byte[] per_commitment_key) { @@ -477,17 +472,18 @@ public class BaseSign extends CommonBase { * It may be called multiple times for same output(s) if a fee-bump is needed with regards * to an upcoming timelock expiration. * - * Amount is value of the output spent by this input, committed to in the BIP 143 signature. + * `amount` is the value of the output spent by this input, committed to in the BIP 143 + * signature. * - * per_commitment_key is revocation secret which was provided by our counterparty when they + * `per_commitment_key` is revocation secret which was provided by our counterparty when they * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does * not allow the spending of any funds by itself (you need our holder revocation_secret to do * so). * - * htlc holds HTLC elements (hash, timelock), thus changing the format of the witness script + * `htlc` holds HTLC elements (hash, timelock), thus changing the format of the witness script * (which is committed to in the BIP 143 signatures). */ - public Result_SignatureNoneZ sign_justice_revoked_htlc(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, HTLCOutputInCommitment htlc) { + public Result_SignatureNoneZ sign_justice_revoked_htlc(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, org.ldk.structs.HTLCOutputInCommitment htlc) { long ret = bindings.BaseSign_sign_justice_revoked_htlc(this.ptr, justice_tx, input, amount, InternalUtils.check_arr_len(per_commitment_key, 32), htlc == null ? 0 : htlc.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(justice_tx); @@ -510,17 +506,17 @@ public class BaseSign extends CommonBase { * signed for here. It may be called multiple times for same output(s) if a fee-bump is * needed with regards to an upcoming timelock expiration. * - * Witness_script is either a offered or received script as defined in BOLT3 for HTLC + * `witness_script` is either an offered or received script as defined in BOLT3 for HTLC * outputs. * - * Amount is value of the output spent by this input, committed to in the BIP 143 signature. + * `amount` is value of the output spent by this input, committed to in the BIP 143 signature. * - * Per_commitment_point is the dynamic point corresponding to the channel state + * `per_commitment_point` is the dynamic point corresponding to the channel state * detected onchain. It has been generated by our counterparty and is used to derive * channel state keys, which are then included in the witness script and committed to in the * BIP 143 signature. */ - public Result_SignatureNoneZ sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, HTLCOutputInCommitment htlc) { + public Result_SignatureNoneZ sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, org.ldk.structs.HTLCOutputInCommitment htlc) { long ret = bindings.BaseSign_sign_counterparty_htlc_transaction(this.ptr, htlc_tx, input, amount, InternalUtils.check_arr_len(per_commitment_point, 33), htlc == null ? 0 : htlc.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(htlc_tx); @@ -540,7 +536,7 @@ public class BaseSign extends CommonBase { * Note that, due to rounding, there may be one \"missing\" satoshi, and either party may have * chosen to forgo their output as dust. */ - public Result_SignatureNoneZ sign_closing_transaction(ClosingTransaction closing_tx) { + public Result_SignatureNoneZ sign_closing_transaction(org.ldk.structs.ClosingTransaction closing_tx) { long ret = bindings.BaseSign_sign_closing_transaction(this.ptr, closing_tx == null ? 0 : closing_tx.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(closing_tx); @@ -575,7 +571,7 @@ public class BaseSign extends CommonBase { * our counterparty may (though likely will not) close the channel on us for violating the * protocol. */ - public Result_C2Tuple_SignatureSignatureZNoneZ sign_channel_announcement(UnsignedChannelAnnouncement msg) { + public Result_C2Tuple_SignatureSignatureZNoneZ sign_channel_announcement(org.ldk.structs.UnsignedChannelAnnouncement msg) { long ret = bindings.BaseSign_sign_channel_announcement(this.ptr, msg == null ? 0 : msg.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(msg); @@ -587,18 +583,14 @@ public class BaseSign extends CommonBase { /** * Set the counterparty static channel data, including basepoints, - * counterparty_selected/holder_selected_contest_delay and funding outpoint. - * This is done as soon as the funding outpoint is known. Since these are static channel data, - * they MUST NOT be allowed to change to different values once set. + * `counterparty_selected`/`holder_selected_contest_delay` and funding outpoint. Since these + * are static channel data, they MUST NOT be allowed to change to different values once set, + * as LDK may call this method more than once. * * channel_parameters.is_populated() MUST be true. - * - * We bind holder_selected_contest_delay late here for API convenience. - * - * Will be called before any signatures are applied. */ - public void ready_channel(ChannelTransactionParameters channel_parameters) { - bindings.BaseSign_ready_channel(this.ptr, channel_parameters == null ? 0 : channel_parameters.ptr); + public void provide_channel_parameters(org.ldk.structs.ChannelTransactionParameters channel_parameters) { + bindings.BaseSign_provide_channel_parameters(this.ptr, channel_parameters == null ? 0 : channel_parameters.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(channel_parameters); if (this != null) { this.ptrs_to.add(channel_parameters); }; diff --git a/src/main/java/org/ldk/structs/BestBlock.java b/src/main/java/org/ldk/structs/BestBlock.java index 325b8069..8857c045 100644 --- a/src/main/java/org/ldk/structs/BestBlock.java +++ b/src/main/java/org/ldk/structs/BestBlock.java @@ -43,7 +43,7 @@ public class BestBlock extends CommonBase { * 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(BestBlock b) { + public boolean eq(org.ldk.structs.BestBlock b) { boolean ret = bindings.BestBlock_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/BlindedHop.java b/src/main/java/org/ldk/structs/BlindedHop.java index 5432512e..cc038631 100644 --- a/src/main/java/org/ldk/structs/BlindedHop.java +++ b/src/main/java/org/ldk/structs/BlindedHop.java @@ -9,7 +9,7 @@ import javax.annotation.Nullable; /** - * Used to construct the blinded hops portion of a blinded route. These hops cannot be identified + * Used to construct the blinded hops portion of a blinded path. These hops cannot be identified * by outside observers and thus can be used to hide the identity of the recipient. */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays @@ -21,6 +21,24 @@ public class BlindedHop extends CommonBase { if (ptr != 0) { bindings.BlindedHop_free(ptr); } } + long clone_ptr() { + long ret = bindings.BlindedHop_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the BlindedHop + */ + public BlindedHop clone() { + long ret = bindings.BlindedHop_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.BlindedHop ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedHop(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + /** * Serialize the BlindedHop object into a byte array which can be read by BlindedHop_read */ diff --git a/src/main/java/org/ldk/structs/BlindedPath.java b/src/main/java/org/ldk/structs/BlindedPath.java new file mode 100644 index 00000000..756855da --- /dev/null +++ b/src/main/java/org/ldk/structs/BlindedPath.java @@ -0,0 +1,78 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * Onion messages can be sent and received to blinded paths, which serve to hide the identity of + * the recipient. + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class BlindedPath extends CommonBase { + BlindedPath(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.BlindedPath_free(ptr); } + } + + long clone_ptr() { + long ret = bindings.BlindedPath_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the BlindedPath + */ + public BlindedPath clone() { + long ret = bindings.BlindedPath_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.BlindedPath ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedPath(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Create a blinded path to be forwarded along `node_pks`. The last node pubkey in `node_pks` + * will be the destination node. + * + * Errors if less than two hops are provided or if `node_pk`(s) are invalid. + */ + public static Result_BlindedPathNoneZ of(byte[][] node_pks, org.ldk.structs.KeysInterface keys_manager) { + long ret = bindings.BlindedPath_new(node_pks != null ? Arrays.stream(node_pks).map(node_pks_conv_8 -> InternalUtils.check_arr_len(node_pks_conv_8, 33)).toArray(byte[][]::new) : null, keys_manager == null ? 0 : keys_manager.ptr); + Reference.reachabilityFence(node_pks); + Reference.reachabilityFence(keys_manager); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedPathNoneZ ret_hu_conv = Result_BlindedPathNoneZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(keys_manager); }; + return ret_hu_conv; + } + + /** + * Serialize the BlindedPath object into a byte array which can be read by BlindedPath_read + */ + public byte[] write() { + byte[] ret = bindings.BlindedPath_write(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Read a BlindedPath from a byte array, created by BlindedPath_write + */ + public static Result_BlindedPathDecodeErrorZ read(byte[] ser) { + long ret = bindings.BlindedPath_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedPathDecodeErrorZ ret_hu_conv = Result_BlindedPathDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/BlindedRoute.java b/src/main/java/org/ldk/structs/BlindedRoute.java deleted file mode 100644 index d35db030..00000000 --- a/src/main/java/org/ldk/structs/BlindedRoute.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.ldk.structs; - -import org.ldk.impl.bindings; -import org.ldk.enums.*; -import org.ldk.util.*; -import java.util.Arrays; -import java.lang.ref.Reference; -import javax.annotation.Nullable; - - -/** - * Onion messages can be sent and received to blinded routes, which serve to hide the identity of - * the recipient. - */ -@SuppressWarnings("unchecked") // We correctly assign various generic arrays -public class BlindedRoute extends CommonBase { - BlindedRoute(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.BlindedRoute_free(ptr); } - } - - /** - * Create a blinded route to be forwarded along `node_pks`. The last node pubkey in `node_pks` - * will be the destination node. - * - * Errors if less than two hops are provided or if `node_pk`(s) are invalid. - */ - public static Result_BlindedRouteNoneZ of(byte[][] node_pks, KeysInterface keys_manager) { - long ret = bindings.BlindedRoute_new(node_pks != null ? Arrays.stream(node_pks).map(node_pks_conv_8 -> InternalUtils.check_arr_len(node_pks_conv_8, 33)).toArray(byte[][]::new) : null, keys_manager == null ? 0 : keys_manager.ptr); - Reference.reachabilityFence(node_pks); - Reference.reachabilityFence(keys_manager); - if (ret >= 0 && ret <= 4096) { return null; } - Result_BlindedRouteNoneZ ret_hu_conv = Result_BlindedRouteNoneZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(keys_manager); }; - return ret_hu_conv; - } - - /** - * Serialize the BlindedRoute object into a byte array which can be read by BlindedRoute_read - */ - public byte[] write() { - byte[] ret = bindings.BlindedRoute_write(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Read a BlindedRoute from a byte array, created by BlindedRoute_write - */ - public static Result_BlindedRouteDecodeErrorZ read(byte[] ser) { - long ret = bindings.BlindedRoute_read(ser); - Reference.reachabilityFence(ser); - if (ret >= 0 && ret <= 4096) { return null; } - Result_BlindedRouteDecodeErrorZ ret_hu_conv = Result_BlindedRouteDecodeErrorZ.constr_from_ptr(ret); - 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 0a3d9fe8..5d2f5080 100644 --- a/src/main/java/org/ldk/structs/ChainMonitor.java +++ b/src/main/java/org/ldk/structs/ChainMonitor.java @@ -37,7 +37,7 @@ public class ChainMonitor extends CommonBase { * always need to fetch full blocks absent another means for determining which blocks contain * transactions relevant to the watched channels. */ - public static ChainMonitor of(Option_FilterZ chain_source, BroadcasterInterface broadcaster, Logger logger, FeeEstimator feeest, Persist persister) { + public static ChainMonitor of(org.ldk.structs.Option_FilterZ chain_source, org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.Logger logger, org.ldk.structs.FeeEstimator feeest, org.ldk.structs.Persist persister) { long ret = bindings.ChainMonitor_new(chain_source.ptr, broadcaster == null ? 0 : broadcaster.ptr, logger == null ? 0 : logger.ptr, feeest == null ? 0 : feeest.ptr, persister == null ? 0 : persister.ptr); Reference.reachabilityFence(chain_source); Reference.reachabilityFence(broadcaster); @@ -89,7 +89,7 @@ public class ChainMonitor extends CommonBase { * Note that the result holds a mutex over our monitor set, and should not be held * indefinitely. */ - public Result_LockedChannelMonitorNoneZ get_monitor(OutPoint funding_txo) { + public Result_LockedChannelMonitorNoneZ get_monitor(org.ldk.structs.OutPoint funding_txo) { long ret = bindings.ChainMonitor_get_monitor(this.ptr, funding_txo == null ? 0 : funding_txo.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(funding_txo); @@ -119,6 +119,23 @@ public class ChainMonitor extends CommonBase { return ret_conv_10_arr; } + /** + * Lists the pending updates for each [`ChannelMonitor`] (by `OutPoint` being monitored). + */ + public TwoTuple_OutPointCVec_MonitorUpdateIdZZ[] list_pending_monitor_updates() { + long[] ret = bindings.ChainMonitor_list_pending_monitor_updates(this.ptr); + Reference.reachabilityFence(this); + int ret_conv_41_len = ret.length; + TwoTuple_OutPointCVec_MonitorUpdateIdZZ[] ret_conv_41_arr = new TwoTuple_OutPointCVec_MonitorUpdateIdZZ[ret_conv_41_len]; + for (int p = 0; p < ret_conv_41_len; p++) { + long ret_conv_41 = ret[p]; + TwoTuple_OutPointCVec_MonitorUpdateIdZZ ret_conv_41_hu_conv = new TwoTuple_OutPointCVec_MonitorUpdateIdZZ(null, ret_conv_41); + if (ret_conv_41_hu_conv != null) { ret_conv_41_hu_conv.ptrs_to.add(this); }; + ret_conv_41_arr[p] = ret_conv_41_hu_conv; + } + return ret_conv_41_arr; + } + /** * Indicates the persistence of a [`ChannelMonitor`] has completed after * [`ChannelMonitorUpdateStatus::InProgress`] was returned from an update operation. @@ -134,7 +151,7 @@ public class ChainMonitor extends CommonBase { * Returns an [`APIError::APIMisuseError`] if `funding_txo` does not match any currently * registered [`ChannelMonitor`]s. */ - public Result_NoneAPIErrorZ channel_monitor_updated(OutPoint funding_txo, MonitorUpdateId completed_update_id) { + public Result_NoneAPIErrorZ channel_monitor_updated(org.ldk.structs.OutPoint funding_txo, org.ldk.structs.MonitorUpdateId completed_update_id) { long ret = bindings.ChainMonitor_channel_monitor_updated(this.ptr, funding_txo == null ? 0 : funding_txo.ptr, completed_update_id == null ? 0 : completed_update_id.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(funding_txo); diff --git a/src/main/java/org/ldk/structs/ChainParameters.java b/src/main/java/org/ldk/structs/ChainParameters.java index 64ab2a9c..77c65ccd 100644 --- a/src/main/java/org/ldk/structs/ChainParameters.java +++ b/src/main/java/org/ldk/structs/ChainParameters.java @@ -61,7 +61,7 @@ public class ChainParameters extends CommonBase { * * Used to track on-chain channel funding outputs and send payments with reliable timelocks. */ - public void set_best_block(BestBlock val) { + public void set_best_block(org.ldk.structs.BestBlock val) { bindings.ChainParameters_set_best_block(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -71,7 +71,7 @@ public class ChainParameters extends CommonBase { /** * Constructs a new ChainParameters given each field */ - public static ChainParameters of(org.ldk.enums.Network network_arg, BestBlock best_block_arg) { + public static ChainParameters of(org.ldk.enums.Network network_arg, org.ldk.structs.BestBlock best_block_arg) { long ret = bindings.ChainParameters_new(network_arg, best_block_arg == null ? 0 : best_block_arg.ptr); Reference.reachabilityFence(network_arg); Reference.reachabilityFence(best_block_arg); diff --git a/src/main/java/org/ldk/structs/ChannelAnnouncement.java b/src/main/java/org/ldk/structs/ChannelAnnouncement.java index 443aeeb1..f5bb9de8 100644 --- a/src/main/java/org/ldk/structs/ChannelAnnouncement.java +++ b/src/main/java/org/ldk/structs/ChannelAnnouncement.java @@ -107,7 +107,7 @@ public class ChannelAnnouncement extends CommonBase { /** * The actual announcement */ - public void set_contents(UnsignedChannelAnnouncement val) { + public void set_contents(org.ldk.structs.UnsignedChannelAnnouncement val) { bindings.ChannelAnnouncement_set_contents(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -117,7 +117,7 @@ public class ChannelAnnouncement extends CommonBase { /** * Constructs a new ChannelAnnouncement given each field */ - public static ChannelAnnouncement of(byte[] node_signature_1_arg, byte[] node_signature_2_arg, byte[] bitcoin_signature_1_arg, byte[] bitcoin_signature_2_arg, UnsignedChannelAnnouncement contents_arg) { + public static ChannelAnnouncement of(byte[] node_signature_1_arg, byte[] node_signature_2_arg, byte[] bitcoin_signature_1_arg, byte[] bitcoin_signature_2_arg, org.ldk.structs.UnsignedChannelAnnouncement contents_arg) { long ret = bindings.ChannelAnnouncement_new(InternalUtils.check_arr_len(node_signature_1_arg, 64), InternalUtils.check_arr_len(node_signature_2_arg, 64), InternalUtils.check_arr_len(bitcoin_signature_1_arg, 64), InternalUtils.check_arr_len(bitcoin_signature_2_arg, 64), contents_arg == null ? 0 : contents_arg.ptr); Reference.reachabilityFence(node_signature_1_arg); Reference.reachabilityFence(node_signature_2_arg); @@ -154,7 +154,7 @@ public class ChannelAnnouncement extends CommonBase { * 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(ChannelAnnouncement b) { + public boolean eq(org.ldk.structs.ChannelAnnouncement b) { boolean ret = bindings.ChannelAnnouncement_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/ChannelConfig.java b/src/main/java/org/ldk/structs/ChannelConfig.java index 71e83fdd..bdeef303 100644 --- a/src/main/java/org/ldk/structs/ChannelConfig.java +++ b/src/main/java/org/ldk/structs/ChannelConfig.java @@ -300,7 +300,7 @@ public class ChannelConfig extends CommonBase { * 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(ChannelConfig b) { + public boolean eq(org.ldk.structs.ChannelConfig b) { boolean ret = bindings.ChannelConfig_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/ChannelCounterparty.java b/src/main/java/org/ldk/structs/ChannelCounterparty.java index c35b6017..185e5cd7 100644 --- a/src/main/java/org/ldk/structs/ChannelCounterparty.java +++ b/src/main/java/org/ldk/structs/ChannelCounterparty.java @@ -58,7 +58,7 @@ public class ChannelCounterparty extends CommonBase { * Useful for routing as it is the most up-to-date copy of the counterparty's features and * many routing-relevant features are present in the init context. */ - public void set_features(InitFeatures val) { + public void set_features(org.ldk.structs.InitFeatures val) { bindings.ChannelCounterparty_set_features(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -117,7 +117,7 @@ public class ChannelCounterparty extends CommonBase { * * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public void set_forwarding_info(@Nullable CounterpartyForwardingInfo val) { + public void set_forwarding_info(@Nullable org.ldk.structs.CounterpartyForwardingInfo val) { bindings.ChannelCounterparty_set_forwarding_info(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -143,7 +143,7 @@ public class ChannelCounterparty extends CommonBase { * 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) { + public void set_outbound_htlc_minimum_msat(org.ldk.structs.Option_u64Z val) { bindings.ChannelCounterparty_set_outbound_htlc_minimum_msat(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -164,7 +164,7 @@ public class ChannelCounterparty extends CommonBase { /** * 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) { + public void set_outbound_htlc_maximum_msat(org.ldk.structs.Option_u64Z val) { bindings.ChannelCounterparty_set_outbound_htlc_maximum_msat(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -173,7 +173,7 @@ public class ChannelCounterparty extends CommonBase { /** * 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, Option_u64Z outbound_htlc_minimum_msat_arg, Option_u64Z outbound_htlc_maximum_msat_arg) { + public static ChannelCounterparty of(byte[] node_id_arg, org.ldk.structs.InitFeatures features_arg, long unspendable_punishment_reserve_arg, org.ldk.structs.CounterpartyForwardingInfo forwarding_info_arg, org.ldk.structs.Option_u64Z outbound_htlc_minimum_msat_arg, org.ldk.structs.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, unspendable_punishment_reserve_arg, forwarding_info_arg == null ? 0 : forwarding_info_arg.ptr, outbound_htlc_minimum_msat_arg.ptr, outbound_htlc_maximum_msat_arg.ptr); Reference.reachabilityFence(node_id_arg); Reference.reachabilityFence(features_arg); diff --git a/src/main/java/org/ldk/structs/ChannelDetails.java b/src/main/java/org/ldk/structs/ChannelDetails.java index e3051798..6975a876 100644 --- a/src/main/java/org/ldk/structs/ChannelDetails.java +++ b/src/main/java/org/ldk/structs/ChannelDetails.java @@ -59,7 +59,7 @@ public class ChannelDetails extends CommonBase { /** * Parameters which apply to our counterparty. See individual fields for more information. */ - public void set_counterparty(ChannelCounterparty val) { + public void set_counterparty(org.ldk.structs.ChannelCounterparty val) { bindings.ChannelDetails_set_counterparty(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -94,7 +94,7 @@ public class ChannelDetails extends CommonBase { * * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public void set_funding_txo(@Nullable OutPoint val) { + public void set_funding_txo(@Nullable org.ldk.structs.OutPoint val) { bindings.ChannelDetails_set_funding_txo(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -125,7 +125,7 @@ public class ChannelDetails extends CommonBase { * * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public void set_channel_type(@Nullable ChannelTypeFeatures val) { + public void set_channel_type(@Nullable org.ldk.structs.ChannelTypeFeatures val) { bindings.ChannelDetails_set_channel_type(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -173,7 +173,7 @@ public class ChannelDetails extends CommonBase { * [`get_outbound_payment_scid`]: Self::get_outbound_payment_scid * [`confirmations_required`]: Self::confirmations_required */ - public void set_short_channel_id(Option_u64Z val) { + public void set_short_channel_id(org.ldk.structs.Option_u64Z val) { bindings.ChannelDetails_set_short_channel_id(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -210,7 +210,7 @@ public class ChannelDetails extends CommonBase { * [`short_channel_id`]: Self::short_channel_id * [`confirmations_required`]: Self::confirmations_required */ - public void set_outbound_scid_alias(Option_u64Z val) { + public void set_outbound_scid_alias(org.ldk.structs.Option_u64Z val) { bindings.ChannelDetails_set_outbound_scid_alias(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -247,7 +247,7 @@ public class ChannelDetails extends CommonBase { * * [`short_channel_id`]: Self::short_channel_id */ - public void set_inbound_scid_alias(Option_u64Z val) { + public void set_inbound_scid_alias(org.ldk.structs.Option_u64Z val) { bindings.ChannelDetails_set_inbound_scid_alias(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -302,26 +302,31 @@ public class ChannelDetails extends CommonBase { * * [`outbound_capacity_msat`]: ChannelDetails::outbound_capacity_msat */ - public void set_unspendable_punishment_reserve(Option_u64Z val) { + public void set_unspendable_punishment_reserve(org.ldk.structs.Option_u64Z val) { bindings.ChannelDetails_set_unspendable_punishment_reserve(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); } /** - * The `user_channel_id` passed in to create_channel, or 0 if the channel was inbound. + * The `user_channel_id` passed in to create_channel, or a random value if the channel was + * inbound. This may be zero for inbound channels serialized with LDK versions prior to + * 0.0.113. */ - public long get_user_channel_id() { - long ret = bindings.ChannelDetails_get_user_channel_id(this.ptr); + public UInt128 get_user_channel_id() { + byte[] ret = bindings.ChannelDetails_get_user_channel_id(this.ptr); Reference.reachabilityFence(this); - return ret; + org.ldk.util.UInt128 ret_conv = new org.ldk.util.UInt128(ret); + return ret_conv; } /** - * The `user_channel_id` passed in to create_channel, or 0 if the channel was inbound. + * The `user_channel_id` passed in to create_channel, or a random value if the channel was + * inbound. This may be zero for inbound channels serialized with LDK versions prior to + * 0.0.113. */ - public void set_user_channel_id(long val) { - bindings.ChannelDetails_set_user_channel_id(this.ptr, val); + public void set_user_channel_id(org.ldk.util.UInt128 val) { + bindings.ChannelDetails_set_user_channel_id(this.ptr, val.getLEBytes()); Reference.reachabilityFence(this); Reference.reachabilityFence(val); } @@ -495,12 +500,37 @@ public class ChannelDetails extends CommonBase { * [`ChannelHandshakeConfig::minimum_depth`]: crate::util::config::ChannelHandshakeConfig::minimum_depth * [`ChannelHandshakeLimits::max_minimum_depth`]: crate::util::config::ChannelHandshakeLimits::max_minimum_depth */ - public void set_confirmations_required(Option_u32Z val) { + public void set_confirmations_required(org.ldk.structs.Option_u32Z val) { bindings.ChannelDetails_set_confirmations_required(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); } + /** + * The current number of confirmations on the funding transaction. + * + * This value will be `None` for objects serialized with LDK versions prior to 0.0.113. + */ + public Option_u32Z get_confirmations() { + long ret = bindings.ChannelDetails_get_confirmations(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_u32Z ret_hu_conv = org.ldk.structs.Option_u32Z.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * The current number of confirmations on the funding transaction. + * + * This value will be `None` for objects serialized with LDK versions prior to 0.0.113. + */ + public void set_confirmations(org.ldk.structs.Option_u32Z val) { + bindings.ChannelDetails_set_confirmations(this.ptr, val.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + /** * The number of blocks (after our commitment transaction confirms) that we will need to wait * until we can claim our funds after we force-close the channel. During this time our @@ -528,7 +558,7 @@ public class ChannelDetails extends CommonBase { * * This value will be `None` for outbound channels until the counterparty accepts the channel. */ - public void set_force_close_spend_delay(Option_u16Z val) { + public void set_force_close_spend_delay(org.ldk.structs.Option_u16Z val) { bindings.ChannelDetails_set_force_close_spend_delay(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -641,7 +671,7 @@ public class ChannelDetails extends CommonBase { * 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) { + public void set_inbound_htlc_minimum_msat(org.ldk.structs.Option_u64Z val) { bindings.ChannelDetails_set_inbound_htlc_minimum_msat(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -662,7 +692,7 @@ public class ChannelDetails extends CommonBase { /** * The largest value HTLC (in msat) we currently will accept, for this channel. */ - public void set_inbound_htlc_maximum_msat(Option_u64Z val) { + public void set_inbound_htlc_maximum_msat(org.ldk.structs.Option_u64Z val) { bindings.ChannelDetails_set_inbound_htlc_maximum_msat(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -692,7 +722,7 @@ public class ChannelDetails extends CommonBase { * * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public void set_config(@Nullable ChannelConfig val) { + public void set_config(@Nullable org.ldk.structs.ChannelConfig val) { bindings.ChannelDetails_set_config(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -702,8 +732,8 @@ public class ChannelDetails extends CommonBase { /** * 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 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, ChannelConfig config_arg) { - long ret = bindings.ChannelDetails_new(InternalUtils.check_arr_len(channel_id_arg, 32), counterparty_arg == null ? 0 : counterparty_arg.ptr, funding_txo_arg == null ? 0 : funding_txo_arg.ptr, channel_type_arg == null ? 0 : channel_type_arg.ptr, short_channel_id_arg.ptr, outbound_scid_alias_arg.ptr, inbound_scid_alias_arg.ptr, channel_value_satoshis_arg, unspendable_punishment_reserve_arg.ptr, user_channel_id_arg, 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, config_arg == null ? 0 : config_arg.ptr); + public static ChannelDetails of(byte[] channel_id_arg, org.ldk.structs.ChannelCounterparty counterparty_arg, org.ldk.structs.OutPoint funding_txo_arg, org.ldk.structs.ChannelTypeFeatures channel_type_arg, org.ldk.structs.Option_u64Z short_channel_id_arg, org.ldk.structs.Option_u64Z outbound_scid_alias_arg, org.ldk.structs.Option_u64Z inbound_scid_alias_arg, long channel_value_satoshis_arg, org.ldk.structs.Option_u64Z unspendable_punishment_reserve_arg, org.ldk.util.UInt128 user_channel_id_arg, long balance_msat_arg, long outbound_capacity_msat_arg, long next_outbound_htlc_limit_msat_arg, long inbound_capacity_msat_arg, org.ldk.structs.Option_u32Z confirmations_required_arg, org.ldk.structs.Option_u32Z confirmations_arg, org.ldk.structs.Option_u16Z force_close_spend_delay_arg, boolean is_outbound_arg, boolean is_channel_ready_arg, boolean is_usable_arg, boolean is_public_arg, org.ldk.structs.Option_u64Z inbound_htlc_minimum_msat_arg, org.ldk.structs.Option_u64Z inbound_htlc_maximum_msat_arg, org.ldk.structs.ChannelConfig config_arg) { + long ret = bindings.ChannelDetails_new(InternalUtils.check_arr_len(channel_id_arg, 32), counterparty_arg == null ? 0 : counterparty_arg.ptr, funding_txo_arg == null ? 0 : funding_txo_arg.ptr, channel_type_arg == null ? 0 : channel_type_arg.ptr, short_channel_id_arg.ptr, outbound_scid_alias_arg.ptr, inbound_scid_alias_arg.ptr, channel_value_satoshis_arg, unspendable_punishment_reserve_arg.ptr, user_channel_id_arg.getLEBytes(), balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg.ptr, confirmations_arg.ptr, force_close_spend_delay_arg.ptr, is_outbound_arg, is_channel_ready_arg, is_usable_arg, is_public_arg, inbound_htlc_minimum_msat_arg.ptr, inbound_htlc_maximum_msat_arg.ptr, config_arg == null ? 0 : config_arg.ptr); Reference.reachabilityFence(channel_id_arg); Reference.reachabilityFence(counterparty_arg); Reference.reachabilityFence(funding_txo_arg); @@ -719,6 +749,7 @@ public class ChannelDetails extends CommonBase { Reference.reachabilityFence(next_outbound_htlc_limit_msat_arg); Reference.reachabilityFence(inbound_capacity_msat_arg); Reference.reachabilityFence(confirmations_required_arg); + Reference.reachabilityFence(confirmations_arg); Reference.reachabilityFence(force_close_spend_delay_arg); Reference.reachabilityFence(is_outbound_arg); Reference.reachabilityFence(is_channel_ready_arg); diff --git a/src/main/java/org/ldk/structs/ChannelFeatures.java b/src/main/java/org/ldk/structs/ChannelFeatures.java index 1735e936..bf30226a 100644 --- a/src/main/java/org/ldk/structs/ChannelFeatures.java +++ b/src/main/java/org/ldk/structs/ChannelFeatures.java @@ -25,7 +25,7 @@ public class ChannelFeatures extends CommonBase { * 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(ChannelFeatures b) { + public boolean eq(org.ldk.structs.ChannelFeatures b) { boolean ret = bindings.ChannelFeatures_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/ChannelInfo.java b/src/main/java/org/ldk/structs/ChannelInfo.java index ea695c3d..864f64e2 100644 --- a/src/main/java/org/ldk/structs/ChannelInfo.java +++ b/src/main/java/org/ldk/structs/ChannelInfo.java @@ -36,7 +36,7 @@ public class ChannelInfo extends CommonBase { /** * Protocol features of a channel communicated during its announcement */ - public void set_features(ChannelFeatures val) { + public void set_features(org.ldk.structs.ChannelFeatures val) { bindings.ChannelInfo_set_features(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -58,7 +58,7 @@ public class ChannelInfo extends CommonBase { /** * Source node of the first direction of a channel */ - public void set_node_one(NodeId val) { + public void set_node_one(org.ldk.structs.NodeId val) { bindings.ChannelInfo_set_node_one(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -85,7 +85,7 @@ public class ChannelInfo extends CommonBase { * * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public void set_one_to_two(@Nullable ChannelUpdateInfo val) { + public void set_one_to_two(@Nullable org.ldk.structs.ChannelUpdateInfo val) { bindings.ChannelInfo_set_one_to_two(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -107,7 +107,7 @@ public class ChannelInfo extends CommonBase { /** * Source node of the second direction of a channel */ - public void set_node_two(NodeId val) { + public void set_node_two(org.ldk.structs.NodeId val) { bindings.ChannelInfo_set_node_two(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -134,7 +134,7 @@ public class ChannelInfo extends CommonBase { * * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public void set_two_to_one(@Nullable ChannelUpdateInfo val) { + public void set_two_to_one(@Nullable org.ldk.structs.ChannelUpdateInfo val) { bindings.ChannelInfo_set_two_to_one(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -156,7 +156,7 @@ public class ChannelInfo extends CommonBase { /** * The channel capacity as seen on-chain, if chain lookup is available. */ - public void set_capacity_sats(Option_u64Z val) { + public void set_capacity_sats(org.ldk.structs.Option_u64Z val) { bindings.ChannelInfo_set_capacity_sats(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -188,7 +188,7 @@ public class ChannelInfo extends CommonBase { * * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public void set_announcement_message(@Nullable ChannelAnnouncement val) { + public void set_announcement_message(@Nullable org.ldk.structs.ChannelAnnouncement val) { bindings.ChannelInfo_set_announcement_message(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -218,7 +218,7 @@ public class ChannelInfo extends CommonBase { * 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(ChannelInfo b) { + public boolean eq(org.ldk.structs.ChannelInfo b) { boolean ret = bindings.ChannelInfo_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/ChannelManager.java b/src/main/java/org/ldk/structs/ChannelManager.java index 75a26751..902b633b 100644 --- a/src/main/java/org/ldk/structs/ChannelManager.java +++ b/src/main/java/org/ldk/structs/ChannelManager.java @@ -67,7 +67,7 @@ public class ChannelManager extends CommonBase { * disconnected using its `block_connected` and `block_disconnected` methods, starting * from after `params.latest_hash`. */ - public static ChannelManager of(FeeEstimator fee_est, Watch chain_monitor, BroadcasterInterface tx_broadcaster, Logger logger, KeysInterface keys_manager, UserConfig config, ChainParameters params) { + public static ChannelManager of(org.ldk.structs.FeeEstimator fee_est, org.ldk.structs.Watch chain_monitor, org.ldk.structs.BroadcasterInterface tx_broadcaster, org.ldk.structs.Logger logger, org.ldk.structs.KeysInterface keys_manager, org.ldk.structs.UserConfig config, org.ldk.structs.ChainParameters params) { long ret = bindings.ChannelManager_new(fee_est == null ? 0 : fee_est.ptr, chain_monitor == null ? 0 : chain_monitor.ptr, tx_broadcaster == null ? 0 : tx_broadcaster.ptr, logger == null ? 0 : logger.ptr, keys_manager == null ? 0 : keys_manager.ptr, config == null ? 0 : config.ptr, params == null ? 0 : params.ptr); Reference.reachabilityFence(fee_est); Reference.reachabilityFence(chain_monitor); @@ -106,10 +106,9 @@ public class ChannelManager extends CommonBase { * * `user_channel_id` will be provided back as in * [`Event::FundingGenerationReady::user_channel_id`] to allow tracking of which events - * correspond with which `create_channel` call. Note that the `user_channel_id` defaults to 0 - * for inbound channels, so you may wish to avoid using 0 for `user_channel_id` here. - * `user_channel_id` has no meaning inside of LDK, it is simply copied to events and otherwise - * ignored. + * correspond with which `create_channel` call. Note that the `user_channel_id` defaults to a + * randomized value for inbound channels. `user_channel_id` has no meaning inside of LDK, it + * is simply copied to events and otherwise ignored. * * Raises [`APIError::APIMisuseError`] when `channel_value_satoshis` > 2**24 or `push_msat` is * greater than `channel_value_satoshis * 1k` or `channel_value_satoshis < 1000`. @@ -131,8 +130,8 @@ public class ChannelManager extends CommonBase { * * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public Result__u832APIErrorZ create_channel(byte[] their_network_key, long channel_value_satoshis, long push_msat, long user_channel_id, @Nullable UserConfig override_config) { - long ret = bindings.ChannelManager_create_channel(this.ptr, InternalUtils.check_arr_len(their_network_key, 33), channel_value_satoshis, push_msat, user_channel_id, override_config == null ? 0 : override_config.ptr); + public Result__u832APIErrorZ create_channel(byte[] their_network_key, long channel_value_satoshis, long push_msat, org.ldk.util.UInt128 user_channel_id, @Nullable org.ldk.structs.UserConfig override_config) { + long ret = bindings.ChannelManager_create_channel(this.ptr, InternalUtils.check_arr_len(their_network_key, 33), channel_value_satoshis, push_msat, user_channel_id.getLEBytes(), override_config == null ? 0 : override_config.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(their_network_key); Reference.reachabilityFence(channel_value_satoshis); @@ -306,21 +305,27 @@ public class ChannelManager extends CommonBase { * Value parameters are provided via the last hop in route, see documentation for RouteHop * fields for more info. * - * Note that if the payment_hash already exists elsewhere (eg you're sending a duplicative - * payment), we don't do anything to stop you! We always try to ensure that if the provided - * next hop knows the preimage to payment_hash they can claim an additional amount as - * specified in the last hop in the route! Thus, you should probably do your own - * payment_preimage tracking (which you should already be doing as they represent \"proof of - * payment\") and prevent double-sends yourself. + * If a pending payment is currently in-flight with the same [`PaymentId`] provided, this + * method will error with an [`APIError::InvalidRoute`]. Note, however, that once a payment + * is no longer pending (either via [`ChannelManager::abandon_payment`], or handling of an + * [`Event::PaymentSent`]) LDK will not stop you from sending a second payment with the same + * [`PaymentId`]. * - * May generate SendHTLCs message(s) event on success, which should be relayed. + * Thus, in order to ensure duplicate payments are not sent, you should implement your own + * tracking of payments, including state to indicate once a payment has completed. Because you + * should also ensure that [`PaymentHash`]es are not re-used, for simplicity, you should + * consider using the [`PaymentHash`] as the key for tracking payments. In that case, the + * [`PaymentId`] should be a copy of the [`PaymentHash`] bytes. + * + * May generate SendHTLCs message(s) event on success, which should be relayed (e.g. via + * [`PeerManager::process_events`]). * * Each path may have a different return value, and PaymentSendValue may return a Vec with * each entry matching the corresponding-index entry in the route paths, see * PaymentSendFailure for more info. * * In general, a path may raise: - * [`APIError::RouteError`] when an invalid route or forwarding parameter (cltv_delta, fee, + * [`APIError::InvalidRoute`] when an invalid route or forwarding parameter (cltv_delta, fee, * node public key) is specified. * [`APIError::ChannelUnavailable`] if the next-hop channel is not available for updates * (including due to previous monitor update failure or new permanent monitor update @@ -337,20 +342,25 @@ public class ChannelManager extends CommonBase { * newer nodes, it will be provided to you in the invoice. If you do not have one, the Route * must not contain multiple paths as multi-path payments require a recipient-provided * payment_secret. + * * If a payment_secret *is* provided, we assume that the invoice had the payment_secret feature * bit set (either as required or as available). If multiple paths are present in the Route, * we assume the invoice had the basic_mpp feature set. * + * [`Event::PaymentSent`]: events::Event::PaymentSent + * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events + * * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public Result_PaymentIdPaymentSendFailureZ send_payment(Route route, byte[] payment_hash, @Nullable byte[] payment_secret) { - long ret = bindings.ChannelManager_send_payment(this.ptr, route == null ? 0 : route.ptr, InternalUtils.check_arr_len(payment_hash, 32), InternalUtils.check_arr_len(payment_secret, 32)); + public Result_NonePaymentSendFailureZ send_payment(org.ldk.structs.Route route, byte[] payment_hash, @Nullable byte[] payment_secret, byte[] payment_id) { + long ret = bindings.ChannelManager_send_payment(this.ptr, route == null ? 0 : route.ptr, InternalUtils.check_arr_len(payment_hash, 32), InternalUtils.check_arr_len(payment_secret, 32), InternalUtils.check_arr_len(payment_id, 32)); Reference.reachabilityFence(this); Reference.reachabilityFence(route); Reference.reachabilityFence(payment_hash); Reference.reachabilityFence(payment_secret); + Reference.reachabilityFence(payment_id); if (ret >= 0 && ret <= 4096) { return null; } - Result_PaymentIdPaymentSendFailureZ ret_hu_conv = Result_PaymentIdPaymentSendFailureZ.constr_from_ptr(ret); + Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.add(route); }; return ret_hu_conv; } @@ -367,7 +377,7 @@ public class ChannelManager extends CommonBase { * [`send_payment`]: [`ChannelManager::send_payment`] * [`abandon_payment`]: [`ChannelManager::abandon_payment`] */ - public Result_NonePaymentSendFailureZ retry_payment(Route route, byte[] payment_id) { + public Result_NonePaymentSendFailureZ retry_payment(org.ldk.structs.Route route, byte[] payment_id) { long ret = bindings.ChannelManager_retry_payment(this.ptr, route == null ? 0 : route.ptr, InternalUtils.check_arr_len(payment_id, 32)); Reference.reachabilityFence(this); Reference.reachabilityFence(route); @@ -381,15 +391,21 @@ public class ChannelManager extends CommonBase { /** * Signals that no further retries for the given payment will occur. * - * After this method returns, any future calls to [`retry_payment`] for the given `payment_id` - * will fail with [`PaymentSendFailure::ParameterError`]. If no such event has been generated, - * an [`Event::PaymentFailed`] event will be generated as soon as there are no remaining - * pending HTLCs for this payment. + * After this method returns, no future calls to [`retry_payment`] for the given `payment_id` + * are allowed. If no [`Event::PaymentFailed`] event had been generated before, one will be + * generated as soon as there are no remaining pending HTLCs for this payment. * * Note that calling this method does *not* prevent a payment from succeeding. You must still * wait until you receive either a [`Event::PaymentFailed`] or [`Event::PaymentSent`] event to * determine the ultimate status of a payment. * + * If an [`Event::PaymentFailed`] event is generated and we restart without this + * [`ChannelManager`] having been persisted, the payment may still be in the pending state + * upon restart. This allows further calls to [`retry_payment`] (and requiring a second call + * to [`abandon_payment`] to mark the payment as failed again). Otherwise, future calls to + * [`retry_payment`] will fail with [`PaymentSendFailure::ParameterError`]. + * + * [`abandon_payment`]: Self::abandon_payment * [`retry_payment`]: Self::retry_payment * [`Event::PaymentFailed`]: events::Event::PaymentFailed * [`Event::PaymentSent`]: events::Event::PaymentSent @@ -407,7 +423,8 @@ public class ChannelManager extends CommonBase { * would be able to guess -- otherwise, an intermediate node may claim the payment and it will * never reach the recipient. * - * See [`send_payment`] documentation for more details on the return value of this function. + * See [`send_payment`] documentation for more details on the return value of this function + * and idempotency guarantees provided by the [`PaymentId`] key. * * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See * [`send_payment`] for more information about the risks of duplicate preimage usage. @@ -418,13 +435,14 @@ public class ChannelManager extends CommonBase { * * Note that payment_preimage (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ send_spontaneous_payment(Route route, @Nullable byte[] payment_preimage) { - long ret = bindings.ChannelManager_send_spontaneous_payment(this.ptr, route == null ? 0 : route.ptr, InternalUtils.check_arr_len(payment_preimage, 32)); + public Result_PaymentHashPaymentSendFailureZ send_spontaneous_payment(org.ldk.structs.Route route, @Nullable byte[] payment_preimage, byte[] payment_id) { + long ret = bindings.ChannelManager_send_spontaneous_payment(this.ptr, route == null ? 0 : route.ptr, InternalUtils.check_arr_len(payment_preimage, 32), InternalUtils.check_arr_len(payment_id, 32)); Reference.reachabilityFence(this); Reference.reachabilityFence(route); Reference.reachabilityFence(payment_preimage); + Reference.reachabilityFence(payment_id); if (ret >= 0 && ret <= 4096) { return null; } - Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ ret_hu_conv = Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.constr_from_ptr(ret); + Result_PaymentHashPaymentSendFailureZ ret_hu_conv = Result_PaymentHashPaymentSendFailureZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.add(route); }; return ret_hu_conv; } @@ -511,7 +529,7 @@ public class ChannelManager extends CommonBase { * [`ChannelUnavailable`]: APIError::ChannelUnavailable * [`APIMisuseError`]: APIError::APIMisuseError */ - public Result_NoneAPIErrorZ update_channel_config(byte[] counterparty_node_id, byte[][] channel_ids, ChannelConfig config) { + public Result_NoneAPIErrorZ update_channel_config(byte[] counterparty_node_id, byte[][] channel_ids, org.ldk.structs.ChannelConfig config) { long ret = bindings.ChannelManager_update_channel_config(this.ptr, InternalUtils.check_arr_len(counterparty_node_id, 33), channel_ids != null ? Arrays.stream(channel_ids).map(channel_ids_conv_8 -> InternalUtils.check_arr_len(channel_ids_conv_8, 32)).toArray(byte[][]::new) : null, config == null ? 0 : config.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(counterparty_node_id); @@ -523,6 +541,58 @@ public class ChannelManager extends CommonBase { return ret_hu_conv; } + /** + * Attempts to forward an intercepted HTLC over the provided channel id and with the provided + * amount to forward. Should only be called in response to an [`HTLCIntercepted`] event. + * + * Intercepted HTLCs can be useful for Lightning Service Providers (LSPs) to open a just-in-time + * channel to a receiving node if the node lacks sufficient inbound liquidity. + * + * To make use of intercepted HTLCs, set [`UserConfig::accept_intercept_htlcs`] and use + * [`ChannelManager::get_intercept_scid`] to generate short channel id(s) to put in the + * receiver's invoice route hints. These route hints will signal to LDK to generate an + * [`HTLCIntercepted`] event when it receives the forwarded HTLC, and this method or + * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to the event. + * + * Note that LDK does not enforce fee requirements in `amt_to_forward_msat`, and will not stop + * you from forwarding more than you received. + * + * Errors if the event was not handled in time, in which case the HTLC was automatically failed + * backwards. + * + * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs + * [`HTLCIntercepted`]: events::Event::HTLCIntercepted + */ + public Result_NoneAPIErrorZ forward_intercepted_htlc(byte[] intercept_id, byte[] next_hop_channel_id, byte[] _next_node_id, long amt_to_forward_msat) { + long ret = bindings.ChannelManager_forward_intercepted_htlc(this.ptr, InternalUtils.check_arr_len(intercept_id, 32), InternalUtils.check_arr_len(next_hop_channel_id, 32), InternalUtils.check_arr_len(_next_node_id, 33), amt_to_forward_msat); + Reference.reachabilityFence(this); + Reference.reachabilityFence(intercept_id); + Reference.reachabilityFence(next_hop_channel_id); + Reference.reachabilityFence(_next_node_id); + Reference.reachabilityFence(amt_to_forward_msat); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Fails the intercepted HTLC indicated by intercept_id. Should only be called in response to + * an [`HTLCIntercepted`] event. See [`ChannelManager::forward_intercepted_htlc`]. + * + * Errors if the event was not handled in time, in which case the HTLC was automatically failed + * backwards. + * + * [`HTLCIntercepted`]: events::Event::HTLCIntercepted + */ + public Result_NoneAPIErrorZ fail_intercepted_htlc(byte[] intercept_id) { + long ret = bindings.ChannelManager_fail_intercepted_htlc(this.ptr, InternalUtils.check_arr_len(intercept_id, 32)); + Reference.reachabilityFence(this); + Reference.reachabilityFence(intercept_id); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + /** * Processes HTLCs which are pending waiting on random forward delay. * @@ -555,12 +625,12 @@ 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 + * after a PaymentClaimable event, failing the HTLC back to its origin and freeing resources * along the path (including in our own channel on which we received it). * * 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 + * second copy of) the [`events::Event::PaymentClaimable`] 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 @@ -575,7 +645,7 @@ public class ChannelManager extends CommonBase { } /** - * Provides a payment preimage in response to [`Event::PaymentReceived`], generating any + * Provides a payment preimage in response to [`Event::PaymentClaimable`], generating any * [`MessageSendEvent`]s needed to claim the payment. * * Note that calling this method does *not* guarantee that the payment has been claimed. You @@ -583,16 +653,15 @@ public class ChannelManager extends CommonBase { * 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` + * [`create_inbound_payment_for_hash`] you must check that the amount in the `PaymentClaimable` * 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. * - * [`Event::PaymentReceived`]: crate::util::events::Event::PaymentReceived + * [`Event::PaymentClaimable`]: crate::util::events::Event::PaymentClaimable * [`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 void claim_funds(byte[] payment_preimage) { bindings.ChannelManager_claim_funds(this.ptr, InternalUtils.check_arr_len(payment_preimage, 32)); @@ -627,8 +696,8 @@ public class ChannelManager extends CommonBase { * [`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); + public Result_NoneAPIErrorZ accept_inbound_channel(byte[] temporary_channel_id, byte[] counterparty_node_id, org.ldk.util.UInt128 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.getLEBytes()); Reference.reachabilityFence(this); Reference.reachabilityFence(temporary_channel_id); Reference.reachabilityFence(counterparty_node_id); @@ -658,8 +727,8 @@ public class ChannelManager extends CommonBase { * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::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); + public Result_NoneAPIErrorZ accept_inbound_channel_from_trusted_peer_0conf(byte[] temporary_channel_id, byte[] counterparty_node_id, org.ldk.util.UInt128 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.getLEBytes()); Reference.reachabilityFence(this); Reference.reachabilityFence(temporary_channel_id); Reference.reachabilityFence(counterparty_node_id); @@ -676,8 +745,8 @@ public class ChannelManager extends CommonBase { * This differs from [`create_inbound_payment_for_hash`] only in that it generates the * [`PaymentHash`] and [`PaymentPreimage`] for you. * - * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentReceived`], which - * will have the [`PaymentReceived::payment_preimage`] field filled in. That should then be + * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentClaimable`], which + * will have the [`PaymentClaimable::payment_preimage`] field filled in. That should then be * passed directly to [`claim_funds`]. * * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements. @@ -693,11 +762,11 @@ public class ChannelManager extends CommonBase { * Errors if `min_value_msat` is greater than total bitcoin supply. * * [`claim_funds`]: Self::claim_funds - * [`PaymentReceived`]: events::Event::PaymentReceived - * [`PaymentReceived::payment_preimage`]: events::Event::PaymentReceived::payment_preimage + * [`PaymentClaimable`]: events::Event::PaymentClaimable + * [`PaymentClaimable::payment_preimage`]: events::Event::PaymentClaimable::payment_preimage * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash */ - public Result_C2Tuple_PaymentHashPaymentSecretZNoneZ create_inbound_payment(Option_u64Z min_value_msat, int invoice_expiry_delta_secs) { + public Result_C2Tuple_PaymentHashPaymentSecretZNoneZ create_inbound_payment(org.ldk.structs.Option_u64Z min_value_msat, int invoice_expiry_delta_secs) { long ret = bindings.ChannelManager_create_inbound_payment(this.ptr, min_value_msat.ptr, invoice_expiry_delta_secs); Reference.reachabilityFence(this); Reference.reachabilityFence(min_value_msat); @@ -718,7 +787,7 @@ public class ChannelManager extends CommonBase { * * [`create_inbound_payment`]: Self::create_inbound_payment */ - public Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ create_inbound_payment_legacy(Option_u64Z min_value_msat, int invoice_expiry_delta_secs) { + public Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ create_inbound_payment_legacy(org.ldk.structs.Option_u64Z min_value_msat, int invoice_expiry_delta_secs) { long ret = bindings.ChannelManager_create_inbound_payment_legacy(this.ptr, min_value_msat.ptr, invoice_expiry_delta_secs); Reference.reachabilityFence(this); Reference.reachabilityFence(min_value_msat); @@ -732,7 +801,7 @@ public class ChannelManager extends CommonBase { * Gets a [`PaymentSecret`] for a given [`PaymentHash`], for which the payment preimage is * stored external to LDK. * - * A [`PaymentReceived`] event will only be generated if the [`PaymentSecret`] matches a + * A [`PaymentClaimable`] event will only be generated if the [`PaymentSecret`] matches a * payment secret fetched via this method or [`create_inbound_payment`], and which is at least * the `min_value_msat` provided here, if one is provided. * @@ -742,7 +811,7 @@ public class ChannelManager extends CommonBase { * * `min_value_msat` should be set if the invoice being generated contains a value. Any payment * received for the returned [`PaymentHash`] will be required to be at least `min_value_msat` - * before a [`PaymentReceived`] event will be generated, ensuring that we do not provide the + * before a [`PaymentClaimable`] event will be generated, ensuring that we do not provide the * sender \"proof-of-payment\" unless they have paid the required amount. * * `invoice_expiry_delta_secs` describes the number of seconds that the invoice is valid for @@ -753,9 +822,9 @@ public class ChannelManager extends CommonBase { * * Note that we use block header time to time-out pending inbound payments (with some margin * to compensate for the inaccuracy of block header timestamps). Thus, in practice we will - * accept a payment and generate a [`PaymentReceived`] event for some time after the expiry. + * accept a payment and generate a [`PaymentClaimable`] event for some time after the expiry. * If you need exact expiry semantics, you should enforce them upon receipt of - * [`PaymentReceived`]. + * [`PaymentClaimable`]. * * Note that invoices generated for inbound payments should have their `min_final_cltv_expiry` * set to at least [`MIN_FINAL_CLTV_EXPIRY`]. @@ -771,9 +840,9 @@ public class ChannelManager extends CommonBase { * Errors if `min_value_msat` is greater than total bitcoin supply. * * [`create_inbound_payment`]: Self::create_inbound_payment - * [`PaymentReceived`]: events::Event::PaymentReceived + * [`PaymentClaimable`]: events::Event::PaymentClaimable */ - public Result_PaymentSecretNoneZ create_inbound_payment_for_hash(byte[] payment_hash, Option_u64Z min_value_msat, int invoice_expiry_delta_secs) { + public Result_PaymentSecretNoneZ create_inbound_payment_for_hash(byte[] payment_hash, org.ldk.structs.Option_u64Z min_value_msat, int invoice_expiry_delta_secs) { long ret = bindings.ChannelManager_create_inbound_payment_for_hash(this.ptr, InternalUtils.check_arr_len(payment_hash, 32), min_value_msat.ptr, invoice_expiry_delta_secs); Reference.reachabilityFence(this); Reference.reachabilityFence(payment_hash); @@ -795,7 +864,7 @@ public class ChannelManager extends CommonBase { * * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash */ - public Result_PaymentSecretAPIErrorZ create_inbound_payment_for_hash_legacy(byte[] payment_hash, Option_u64Z min_value_msat, int invoice_expiry_delta_secs) { + public Result_PaymentSecretAPIErrorZ create_inbound_payment_for_hash_legacy(byte[] payment_hash, org.ldk.structs.Option_u64Z min_value_msat, int invoice_expiry_delta_secs) { long ret = bindings.ChannelManager_create_inbound_payment_for_hash_legacy(this.ptr, InternalUtils.check_arr_len(payment_hash, 32), min_value_msat.ptr, invoice_expiry_delta_secs); Reference.reachabilityFence(this); Reference.reachabilityFence(payment_hash); @@ -848,6 +917,33 @@ public class ChannelManager extends CommonBase { return ret_hu_conv; } + /** + * Gets a fake short channel id for use in receiving intercepted payments. These fake scids are + * used when constructing the route hints for HTLCs intended to be intercepted. See + * [`ChannelManager::forward_intercepted_htlc`]. + * + * Note that this method is not guaranteed to return unique values, you may need to call it a few + * times to get a unique scid. + */ + public long get_intercept_scid() { + long ret = bindings.ChannelManager_get_intercept_scid(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Gets inflight HTLC information by processing pending outbound payments that are in + * our channels. May be used during pathfinding to account for in-use channel liquidity. + */ + public InFlightHtlcs compute_inflight_htlcs() { + long ret = bindings.ChannelManager_compute_inflight_htlcs(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.InFlightHtlcs ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InFlightHtlcs(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + /** * Constructs a new MessageSendEventsProvider which calls the relevant methods on this_arg. * This copies the `inner` pointer in this_arg and thus the returned MessageSendEventsProvider must be freed before this_arg is @@ -903,10 +999,14 @@ public class ChannelManager extends CommonBase { /** * Blocks until ChannelManager needs to be persisted or a timeout is reached. It returns a bool * indicating whether persistence is necessary. Only one listener on - * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken - * up. + * [`await_persistable_update`], [`await_persistable_update_timeout`], or a future returned by + * [`get_persistable_update_future`] is guaranteed to be woken up. * * Note that this method is not available with the `no-std` feature. + * + * [`await_persistable_update`]: Self::await_persistable_update + * [`await_persistable_update_timeout`]: Self::await_persistable_update_timeout + * [`get_persistable_update_future`]: Self::get_persistable_update_future */ public boolean await_persistable_update_timeout(long max_wait) { boolean ret = bindings.ChannelManager_await_persistable_update_timeout(this.ptr, max_wait); @@ -917,8 +1017,11 @@ public class ChannelManager extends CommonBase { /** * Blocks until ChannelManager needs to be persisted. Only one listener on - * `await_persistable_update` or `await_persistable_update_timeout` is guaranteed to be woken - * up. + * [`await_persistable_update`], `await_persistable_update_timeout`, or a future returned by + * [`get_persistable_update_future`] is guaranteed to be woken up. + * + * [`await_persistable_update`]: Self::await_persistable_update + * [`get_persistable_update_future`]: Self::get_persistable_update_future */ public void await_persistable_update() { bindings.ChannelManager_await_persistable_update(this.ptr); diff --git a/src/main/java/org/ldk/structs/ChannelManagerReadArgs.java b/src/main/java/org/ldk/structs/ChannelManagerReadArgs.java index 376661e7..cfe4274b 100644 --- a/src/main/java/org/ldk/structs/ChannelManagerReadArgs.java +++ b/src/main/java/org/ldk/structs/ChannelManagerReadArgs.java @@ -70,7 +70,7 @@ public class ChannelManagerReadArgs extends CommonBase { * deserialization and KeysInterface::read_chan_signer will be used to read per-Channel * signing data. */ - public void set_keys_manager(KeysInterface val) { + public void set_keys_manager(org.ldk.structs.KeysInterface val) { bindings.ChannelManagerReadArgs_set_keys_manager(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -96,7 +96,7 @@ public class ChannelManagerReadArgs extends CommonBase { * * No calls to the FeeEstimator will be made during deserialization. */ - public void set_fee_estimator(FeeEstimator val) { + public void set_fee_estimator(org.ldk.structs.FeeEstimator val) { bindings.ChannelManagerReadArgs_set_fee_estimator(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -126,7 +126,7 @@ public class ChannelManagerReadArgs extends CommonBase { * you have deserialized ChannelMonitors separately and will add them to your * chain::Watch after deserializing this ChannelManager. */ - public void set_chain_monitor(Watch val) { + public void set_chain_monitor(org.ldk.structs.Watch val) { bindings.ChannelManagerReadArgs_set_chain_monitor(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -152,7 +152,7 @@ public class ChannelManagerReadArgs extends CommonBase { * used to broadcast the latest local commitment transactions of channels which must be * force-closed during deserialization. */ - public void set_tx_broadcaster(BroadcasterInterface val) { + public void set_tx_broadcaster(org.ldk.structs.BroadcasterInterface val) { bindings.ChannelManagerReadArgs_set_tx_broadcaster(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -176,7 +176,7 @@ public class ChannelManagerReadArgs extends CommonBase { * The Logger for use in the ChannelManager and which may be used to log information during * deserialization. */ - public void set_logger(Logger val) { + public void set_logger(org.ldk.structs.Logger val) { bindings.ChannelManagerReadArgs_set_logger(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -200,7 +200,7 @@ public class ChannelManagerReadArgs extends CommonBase { * Default settings used for new channels. Any existing channels will continue to use the * runtime settings which were stored when the ChannelManager was serialized. */ - public void set_default_config(UserConfig val) { + public void set_default_config(org.ldk.structs.UserConfig val) { bindings.ChannelManagerReadArgs_set_default_config(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -212,7 +212,7 @@ public class ChannelManagerReadArgs extends CommonBase { * HashMap for you. This is primarily useful for C bindings where it is not practical to * populate a HashMap directly from C. */ - public static ChannelManagerReadArgs of(KeysInterface keys_manager, FeeEstimator fee_estimator, Watch chain_monitor, BroadcasterInterface tx_broadcaster, Logger logger, UserConfig default_config, ChannelMonitor[] channel_monitors) { + public static ChannelManagerReadArgs of(org.ldk.structs.KeysInterface keys_manager, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Watch chain_monitor, org.ldk.structs.BroadcasterInterface tx_broadcaster, org.ldk.structs.Logger logger, org.ldk.structs.UserConfig default_config, ChannelMonitor[] channel_monitors) { long ret = bindings.ChannelManagerReadArgs_new(keys_manager == null ? 0 : keys_manager.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, chain_monitor == null ? 0 : chain_monitor.ptr, tx_broadcaster == null ? 0 : tx_broadcaster.ptr, logger == null ? 0 : logger.ptr, default_config == null ? 0 : default_config.ptr, channel_monitors != null ? Arrays.stream(channel_monitors).mapToLong(channel_monitors_conv_16 -> channel_monitors_conv_16 == null ? 0 : channel_monitors_conv_16.ptr).toArray() : null); Reference.reachabilityFence(keys_manager); Reference.reachabilityFence(fee_estimator); diff --git a/src/main/java/org/ldk/structs/ChannelMessageHandler.java b/src/main/java/org/ldk/structs/ChannelMessageHandler.java index b8367adc..19192e04 100644 --- a/src/main/java/org/ldk/structs/ChannelMessageHandler.java +++ b/src/main/java/org/ldk/structs/ChannelMessageHandler.java @@ -272,7 +272,7 @@ public class ChannelMessageHandler extends CommonBase { /** * Handle an incoming open_channel message from the given peer. */ - public void handle_open_channel(byte[] their_node_id, InitFeatures their_features, OpenChannel msg) { + public void handle_open_channel(byte[] their_node_id, org.ldk.structs.InitFeatures their_features, org.ldk.structs.OpenChannel msg) { bindings.ChannelMessageHandler_handle_open_channel(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), their_features == null ? 0 : their_features.ptr, msg == null ? 0 : msg.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(their_node_id); @@ -285,7 +285,7 @@ public class ChannelMessageHandler extends CommonBase { /** * Handle an incoming accept_channel message from the given peer. */ - public void handle_accept_channel(byte[] their_node_id, InitFeatures their_features, AcceptChannel msg) { + public void handle_accept_channel(byte[] their_node_id, org.ldk.structs.InitFeatures their_features, org.ldk.structs.AcceptChannel msg) { bindings.ChannelMessageHandler_handle_accept_channel(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), their_features == null ? 0 : their_features.ptr, msg == null ? 0 : msg.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(their_node_id); @@ -298,7 +298,7 @@ public class ChannelMessageHandler extends CommonBase { /** * Handle an incoming funding_created message from the given peer. */ - public void handle_funding_created(byte[] their_node_id, FundingCreated msg) { + public void handle_funding_created(byte[] their_node_id, org.ldk.structs.FundingCreated msg) { bindings.ChannelMessageHandler_handle_funding_created(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(their_node_id); @@ -309,7 +309,7 @@ public class ChannelMessageHandler extends CommonBase { /** * Handle an incoming funding_signed message from the given peer. */ - public void handle_funding_signed(byte[] their_node_id, FundingSigned msg) { + public void handle_funding_signed(byte[] their_node_id, org.ldk.structs.FundingSigned msg) { bindings.ChannelMessageHandler_handle_funding_signed(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(their_node_id); @@ -320,7 +320,7 @@ public class ChannelMessageHandler extends CommonBase { /** * Handle an incoming channel_ready message from the given peer. */ - public void handle_channel_ready(byte[] their_node_id, ChannelReady msg) { + public void handle_channel_ready(byte[] their_node_id, org.ldk.structs.ChannelReady msg) { bindings.ChannelMessageHandler_handle_channel_ready(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(their_node_id); @@ -331,7 +331,7 @@ public class ChannelMessageHandler extends CommonBase { /** * Handle an incoming shutdown message from the given peer. */ - public void handle_shutdown(byte[] their_node_id, InitFeatures their_features, Shutdown msg) { + public void handle_shutdown(byte[] their_node_id, org.ldk.structs.InitFeatures their_features, org.ldk.structs.Shutdown msg) { bindings.ChannelMessageHandler_handle_shutdown(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), their_features == null ? 0 : their_features.ptr, msg == null ? 0 : msg.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(their_node_id); @@ -344,7 +344,7 @@ public class ChannelMessageHandler extends CommonBase { /** * Handle an incoming closing_signed message from the given peer. */ - public void handle_closing_signed(byte[] their_node_id, ClosingSigned msg) { + public void handle_closing_signed(byte[] their_node_id, org.ldk.structs.ClosingSigned msg) { bindings.ChannelMessageHandler_handle_closing_signed(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(their_node_id); @@ -355,7 +355,7 @@ public class ChannelMessageHandler extends CommonBase { /** * Handle an incoming update_add_htlc message from the given peer. */ - public void handle_update_add_htlc(byte[] their_node_id, UpdateAddHTLC msg) { + public void handle_update_add_htlc(byte[] their_node_id, org.ldk.structs.UpdateAddHTLC msg) { bindings.ChannelMessageHandler_handle_update_add_htlc(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(their_node_id); @@ -366,7 +366,7 @@ public class ChannelMessageHandler extends CommonBase { /** * Handle an incoming update_fulfill_htlc message from the given peer. */ - public void handle_update_fulfill_htlc(byte[] their_node_id, UpdateFulfillHTLC msg) { + public void handle_update_fulfill_htlc(byte[] their_node_id, org.ldk.structs.UpdateFulfillHTLC msg) { bindings.ChannelMessageHandler_handle_update_fulfill_htlc(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(their_node_id); @@ -377,7 +377,7 @@ public class ChannelMessageHandler extends CommonBase { /** * Handle an incoming update_fail_htlc message from the given peer. */ - public void handle_update_fail_htlc(byte[] their_node_id, UpdateFailHTLC msg) { + public void handle_update_fail_htlc(byte[] their_node_id, org.ldk.structs.UpdateFailHTLC msg) { bindings.ChannelMessageHandler_handle_update_fail_htlc(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(their_node_id); @@ -388,7 +388,7 @@ public class ChannelMessageHandler extends CommonBase { /** * Handle an incoming update_fail_malformed_htlc message from the given peer. */ - public void handle_update_fail_malformed_htlc(byte[] their_node_id, UpdateFailMalformedHTLC msg) { + public void handle_update_fail_malformed_htlc(byte[] their_node_id, org.ldk.structs.UpdateFailMalformedHTLC msg) { bindings.ChannelMessageHandler_handle_update_fail_malformed_htlc(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(their_node_id); @@ -399,7 +399,7 @@ public class ChannelMessageHandler extends CommonBase { /** * Handle an incoming commitment_signed message from the given peer. */ - public void handle_commitment_signed(byte[] their_node_id, CommitmentSigned msg) { + public void handle_commitment_signed(byte[] their_node_id, org.ldk.structs.CommitmentSigned msg) { bindings.ChannelMessageHandler_handle_commitment_signed(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(their_node_id); @@ -410,7 +410,7 @@ public class ChannelMessageHandler extends CommonBase { /** * Handle an incoming revoke_and_ack message from the given peer. */ - public void handle_revoke_and_ack(byte[] their_node_id, RevokeAndACK msg) { + public void handle_revoke_and_ack(byte[] their_node_id, org.ldk.structs.RevokeAndACK msg) { bindings.ChannelMessageHandler_handle_revoke_and_ack(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(their_node_id); @@ -421,7 +421,7 @@ public class ChannelMessageHandler extends CommonBase { /** * Handle an incoming update_fee message from the given peer. */ - public void handle_update_fee(byte[] their_node_id, UpdateFee msg) { + public void handle_update_fee(byte[] their_node_id, org.ldk.structs.UpdateFee msg) { bindings.ChannelMessageHandler_handle_update_fee(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(their_node_id); @@ -432,7 +432,7 @@ public class ChannelMessageHandler extends CommonBase { /** * Handle an incoming announcement_signatures message from the given peer. */ - public void handle_announcement_signatures(byte[] their_node_id, AnnouncementSignatures msg) { + public void handle_announcement_signatures(byte[] their_node_id, org.ldk.structs.AnnouncementSignatures msg) { bindings.ChannelMessageHandler_handle_announcement_signatures(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(their_node_id); @@ -463,7 +463,7 @@ public class ChannelMessageHandler extends CommonBase { * with us. Implementors should be somewhat conservative about doing so, however, as other * message handlers may still wish to communicate with this peer. */ - public Result_NoneNoneZ peer_connected(byte[] their_node_id, Init msg) { + public Result_NoneNoneZ peer_connected(byte[] their_node_id, org.ldk.structs.Init msg) { long ret = bindings.ChannelMessageHandler_peer_connected(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(their_node_id); @@ -477,7 +477,7 @@ public class ChannelMessageHandler extends CommonBase { /** * Handle an incoming channel_reestablish message from the given peer. */ - public void handle_channel_reestablish(byte[] their_node_id, ChannelReestablish msg) { + public void handle_channel_reestablish(byte[] their_node_id, org.ldk.structs.ChannelReestablish msg) { bindings.ChannelMessageHandler_handle_channel_reestablish(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(their_node_id); @@ -488,7 +488,7 @@ public class ChannelMessageHandler extends CommonBase { /** * Handle an incoming channel update from the given peer. */ - public void handle_channel_update(byte[] their_node_id, ChannelUpdate msg) { + public void handle_channel_update(byte[] their_node_id, org.ldk.structs.ChannelUpdate msg) { bindings.ChannelMessageHandler_handle_channel_update(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(their_node_id); @@ -499,7 +499,7 @@ public class ChannelMessageHandler extends CommonBase { /** * Handle an incoming error message from the given peer. */ - public void handle_error(byte[] their_node_id, ErrorMessage msg) { + public void handle_error(byte[] their_node_id, org.ldk.structs.ErrorMessage msg) { bindings.ChannelMessageHandler_handle_error(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(their_node_id); diff --git a/src/main/java/org/ldk/structs/ChannelMonitor.java b/src/main/java/org/ldk/structs/ChannelMonitor.java index 1e4fa35b..53d68dc2 100644 --- a/src/main/java/org/ldk/structs/ChannelMonitor.java +++ b/src/main/java/org/ldk/structs/ChannelMonitor.java @@ -68,7 +68,7 @@ public class ChannelMonitor extends CommonBase { * * panics if the given update is not the next update by update_id. */ - public Result_NoneNoneZ update_monitor(ChannelMonitorUpdate updates, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) { + public Result_NoneNoneZ update_monitor(org.ldk.structs.ChannelMonitorUpdate updates, org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Logger logger) { long ret = bindings.ChannelMonitor_update_monitor(this.ptr, updates == null ? 0 : updates.ptr, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(updates); @@ -129,7 +129,7 @@ public class ChannelMonitor extends CommonBase { * calling `chain::Filter::register_output` and `chain::Filter::register_tx` until all outputs * have been registered. */ - public void load_outputs_to_watch(Filter filter) { + public void load_outputs_to_watch(org.ldk.structs.Filter filter) { bindings.ChannelMonitor_load_outputs_to_watch(this.ptr, filter == null ? 0 : filter.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(filter); @@ -158,9 +158,11 @@ public class ChannelMonitor extends CommonBase { * Gets the list of pending events which were generated by previous actions, clearing the list * in the process. * - * This is called by ChainMonitor::get_and_clear_pending_events() and is equivalent to - * EventsProvider::get_and_clear_pending_events() except that it requires &mut self as we do - * no internal locking in ChannelMonitors. + * This is called by the [`EventsProvider::process_pending_events`] implementation for + * [`ChainMonitor`]. + * + * [`EventsProvider::process_pending_events`]: crate::util::events::EventsProvider::process_pending_events + * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor */ public Event[] get_and_clear_pending_events() { long[] ret = bindings.ChannelMonitor_get_and_clear_pending_events(this.ptr); @@ -208,7 +210,7 @@ public class ChannelMonitor extends CommonBase { * * [`ChannelMonitorUpdateStatus::PermanentFailure`]: super::ChannelMonitorUpdateStatus::PermanentFailure */ - public byte[][] get_latest_holder_commitment_txn(Logger logger) { + public byte[][] get_latest_holder_commitment_txn(org.ldk.structs.Logger logger) { byte[][] ret = bindings.ChannelMonitor_get_latest_holder_commitment_txn(this.ptr, logger == null ? 0 : logger.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(logger); @@ -229,7 +231,7 @@ public class ChannelMonitor extends CommonBase { * * [`get_outputs_to_watch`]: #method.get_outputs_to_watch */ - public TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] block_connected(byte[] header, TwoTuple_usizeTransactionZ[] txdata, int height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) { + public TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] block_connected(byte[] header, TwoTuple_usizeTransactionZ[] txdata, int height, org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Logger logger) { long[] ret = bindings.ChannelMonitor_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, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(header); @@ -256,7 +258,7 @@ public class ChannelMonitor extends CommonBase { * Determines if the disconnected block contained any transactions of interest and updates * appropriately. */ - public void block_disconnected(byte[] header, int height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) { + public void block_disconnected(byte[] header, int height, org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Logger logger) { bindings.ChannelMonitor_block_disconnected(this.ptr, InternalUtils.check_arr_len(header, 80), height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(header); @@ -278,7 +280,7 @@ public class ChannelMonitor extends CommonBase { * * [`block_connected`]: Self::block_connected */ - public TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] transactions_confirmed(byte[] header, TwoTuple_usizeTransactionZ[] txdata, int height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) { + public TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] transactions_confirmed(byte[] header, TwoTuple_usizeTransactionZ[] txdata, int height, org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Logger logger) { long[] ret = bindings.ChannelMonitor_transactions_confirmed(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, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(header); @@ -309,7 +311,7 @@ public class ChannelMonitor extends CommonBase { * * [`block_disconnected`]: Self::block_disconnected */ - public void transaction_unconfirmed(byte[] txid, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) { + public void transaction_unconfirmed(byte[] txid, org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Logger logger) { bindings.ChannelMonitor_transaction_unconfirmed(this.ptr, InternalUtils.check_arr_len(txid, 32), broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(txid); @@ -330,7 +332,7 @@ public class ChannelMonitor extends CommonBase { * * [`block_connected`]: Self::block_connected */ - public TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] best_block_updated(byte[] header, int height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) { + public TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] best_block_updated(byte[] header, int height, org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Logger logger) { long[] ret = bindings.ChannelMonitor_best_block_updated(this.ptr, InternalUtils.check_arr_len(header, 80), height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(header); @@ -355,10 +357,18 @@ public class ChannelMonitor extends CommonBase { /** * Returns the set of txids that should be monitored for re-organization out of the chain. */ - public byte[][] get_relevant_txids() { - byte[][] ret = bindings.ChannelMonitor_get_relevant_txids(this.ptr); + public TwoTuple_TxidBlockHashZ[] get_relevant_txids() { + long[] ret = bindings.ChannelMonitor_get_relevant_txids(this.ptr); Reference.reachabilityFence(this); - return ret; + int ret_conv_25_len = ret.length; + TwoTuple_TxidBlockHashZ[] ret_conv_25_arr = new TwoTuple_TxidBlockHashZ[ret_conv_25_len]; + for (int z = 0; z < ret_conv_25_len; z++) { + long ret_conv_25 = ret[z]; + TwoTuple_TxidBlockHashZ ret_conv_25_hu_conv = new TwoTuple_TxidBlockHashZ(null, ret_conv_25); + if (ret_conv_25_hu_conv != null) { ret_conv_25_hu_conv.ptrs_to.add(this); }; + ret_conv_25_arr[z] = ret_conv_25_hu_conv; + } + return ret_conv_25_arr; } /** diff --git a/src/main/java/org/ldk/structs/ChannelPublicKeys.java b/src/main/java/org/ldk/structs/ChannelPublicKeys.java index d122e039..e458ae5a 100644 --- a/src/main/java/org/ldk/structs/ChannelPublicKeys.java +++ b/src/main/java/org/ldk/structs/ChannelPublicKeys.java @@ -167,7 +167,7 @@ public class ChannelPublicKeys extends CommonBase { * 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(ChannelPublicKeys b) { + public boolean eq(org.ldk.structs.ChannelPublicKeys b) { boolean ret = bindings.ChannelPublicKeys_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/ChannelReady.java b/src/main/java/org/ldk/structs/ChannelReady.java index f0fd3e8a..c3eb0ca2 100644 --- a/src/main/java/org/ldk/structs/ChannelReady.java +++ b/src/main/java/org/ldk/structs/ChannelReady.java @@ -73,7 +73,7 @@ public class ChannelReady extends CommonBase { * If set, provides a short_channel_id alias for this channel. The sender will accept payments * to be forwarded over this SCID and forward them to this messages' recipient. */ - public void set_short_channel_id_alias(Option_u64Z val) { + public void set_short_channel_id_alias(org.ldk.structs.Option_u64Z val) { bindings.ChannelReady_set_short_channel_id_alias(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -82,7 +82,7 @@ public class ChannelReady extends CommonBase { /** * Constructs a new ChannelReady given each field */ - public static ChannelReady of(byte[] channel_id_arg, byte[] next_per_commitment_point_arg, Option_u64Z short_channel_id_alias_arg) { + public static ChannelReady of(byte[] channel_id_arg, byte[] next_per_commitment_point_arg, org.ldk.structs.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); @@ -116,7 +116,7 @@ public class ChannelReady extends CommonBase { * 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(ChannelReady b) { + public boolean eq(org.ldk.structs.ChannelReady b) { boolean ret = bindings.ChannelReady_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/ChannelReestablish.java b/src/main/java/org/ldk/structs/ChannelReestablish.java index ae89ef23..a60f3fbe 100644 --- a/src/main/java/org/ldk/structs/ChannelReestablish.java +++ b/src/main/java/org/ldk/structs/ChannelReestablish.java @@ -97,7 +97,7 @@ public class ChannelReestablish extends CommonBase { * 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(ChannelReestablish b) { + public boolean eq(org.ldk.structs.ChannelReestablish b) { boolean ret = bindings.ChannelReestablish_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/ChannelTransactionParameters.java b/src/main/java/org/ldk/structs/ChannelTransactionParameters.java index 2a510c74..be9f47f6 100644 --- a/src/main/java/org/ldk/structs/ChannelTransactionParameters.java +++ b/src/main/java/org/ldk/structs/ChannelTransactionParameters.java @@ -39,7 +39,7 @@ public class ChannelTransactionParameters extends CommonBase { /** * Holder public keys */ - public void set_holder_pubkeys(ChannelPublicKeys val) { + public void set_holder_pubkeys(org.ldk.structs.ChannelPublicKeys val) { bindings.ChannelTransactionParameters_set_holder_pubkeys(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -106,7 +106,7 @@ public class ChannelTransactionParameters extends CommonBase { * * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public void set_counterparty_parameters(@Nullable CounterpartyChannelTransactionParameters val) { + public void set_counterparty_parameters(@Nullable org.ldk.structs.CounterpartyChannelTransactionParameters val) { bindings.ChannelTransactionParameters_set_counterparty_parameters(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -133,7 +133,7 @@ public class ChannelTransactionParameters extends CommonBase { * * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public void set_funding_outpoint(@Nullable OutPoint val) { + public void set_funding_outpoint(@Nullable org.ldk.structs.OutPoint val) { bindings.ChannelTransactionParameters_set_funding_outpoint(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -160,17 +160,40 @@ public class ChannelTransactionParameters extends CommonBase { Reference.reachabilityFence(val); } + /** + * Are non-zero-fee anchors are enabled (used in conjuction with opt_anchors) + * It is intended merely for backwards compatibility with signers that need it. + * There is no support for this feature in LDK channel negotiation. + */ + public COption_NoneZ get_opt_non_zero_fee_anchors() { + COption_NoneZ ret = bindings.ChannelTransactionParameters_get_opt_non_zero_fee_anchors(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Are non-zero-fee anchors are enabled (used in conjuction with opt_anchors) + * It is intended merely for backwards compatibility with signers that need it. + * There is no support for this feature in LDK channel negotiation. + */ + public void set_opt_non_zero_fee_anchors(org.ldk.enums.COption_NoneZ val) { + bindings.ChannelTransactionParameters_set_opt_non_zero_fee_anchors(this.ptr, val); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + /** * Constructs a new ChannelTransactionParameters given each field */ - public static ChannelTransactionParameters of(ChannelPublicKeys holder_pubkeys_arg, short holder_selected_contest_delay_arg, boolean is_outbound_from_holder_arg, CounterpartyChannelTransactionParameters counterparty_parameters_arg, OutPoint funding_outpoint_arg, org.ldk.enums.COption_NoneZ opt_anchors_arg) { - long ret = bindings.ChannelTransactionParameters_new(holder_pubkeys_arg == null ? 0 : holder_pubkeys_arg.ptr, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg == null ? 0 : counterparty_parameters_arg.ptr, funding_outpoint_arg == null ? 0 : funding_outpoint_arg.ptr, opt_anchors_arg); + public static ChannelTransactionParameters of(org.ldk.structs.ChannelPublicKeys holder_pubkeys_arg, short holder_selected_contest_delay_arg, boolean is_outbound_from_holder_arg, org.ldk.structs.CounterpartyChannelTransactionParameters counterparty_parameters_arg, org.ldk.structs.OutPoint funding_outpoint_arg, org.ldk.enums.COption_NoneZ opt_anchors_arg, org.ldk.enums.COption_NoneZ opt_non_zero_fee_anchors_arg) { + long ret = bindings.ChannelTransactionParameters_new(holder_pubkeys_arg == null ? 0 : holder_pubkeys_arg.ptr, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg == null ? 0 : counterparty_parameters_arg.ptr, funding_outpoint_arg == null ? 0 : funding_outpoint_arg.ptr, opt_anchors_arg, opt_non_zero_fee_anchors_arg); Reference.reachabilityFence(holder_pubkeys_arg); Reference.reachabilityFence(holder_selected_contest_delay_arg); Reference.reachabilityFence(is_outbound_from_holder_arg); Reference.reachabilityFence(counterparty_parameters_arg); Reference.reachabilityFence(funding_outpoint_arg); Reference.reachabilityFence(opt_anchors_arg); + Reference.reachabilityFence(opt_non_zero_fee_anchors_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelTransactionParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTransactionParameters(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; diff --git a/src/main/java/org/ldk/structs/ChannelTypeFeatures.java b/src/main/java/org/ldk/structs/ChannelTypeFeatures.java index 4636f30a..54b7de0b 100644 --- a/src/main/java/org/ldk/structs/ChannelTypeFeatures.java +++ b/src/main/java/org/ldk/structs/ChannelTypeFeatures.java @@ -34,7 +34,7 @@ public class ChannelTypeFeatures extends CommonBase { * 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(ChannelTypeFeatures b) { + public boolean eq(org.ldk.structs.ChannelTypeFeatures b) { boolean ret = bindings.ChannelTypeFeatures_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/ChannelUpdate.java b/src/main/java/org/ldk/structs/ChannelUpdate.java index 784f1754..2063afc4 100644 --- a/src/main/java/org/ldk/structs/ChannelUpdate.java +++ b/src/main/java/org/ldk/structs/ChannelUpdate.java @@ -53,7 +53,7 @@ public class ChannelUpdate extends CommonBase { /** * The actual channel update */ - public void set_contents(UnsignedChannelUpdate val) { + public void set_contents(org.ldk.structs.UnsignedChannelUpdate val) { bindings.ChannelUpdate_set_contents(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -63,7 +63,7 @@ public class ChannelUpdate extends CommonBase { /** * Constructs a new ChannelUpdate given each field */ - public static ChannelUpdate of(byte[] signature_arg, UnsignedChannelUpdate contents_arg) { + public static ChannelUpdate of(byte[] signature_arg, org.ldk.structs.UnsignedChannelUpdate contents_arg) { long ret = bindings.ChannelUpdate_new(InternalUtils.check_arr_len(signature_arg, 64), contents_arg == null ? 0 : contents_arg.ptr); Reference.reachabilityFence(signature_arg); Reference.reachabilityFence(contents_arg); @@ -97,7 +97,7 @@ public class ChannelUpdate extends CommonBase { * 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(ChannelUpdate b) { + public boolean eq(org.ldk.structs.ChannelUpdate b) { boolean ret = bindings.ChannelUpdate_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/ChannelUpdateInfo.java b/src/main/java/org/ldk/structs/ChannelUpdateInfo.java index b485f3c0..303ccde3 100644 --- a/src/main/java/org/ldk/structs/ChannelUpdateInfo.java +++ b/src/main/java/org/ldk/structs/ChannelUpdateInfo.java @@ -127,7 +127,7 @@ public class ChannelUpdateInfo extends CommonBase { /** * Fees charged when the channel is used for routing */ - public void set_fees(RoutingFees val) { + public void set_fees(org.ldk.structs.RoutingFees val) { bindings.ChannelUpdateInfo_set_fees(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -160,7 +160,7 @@ public class ChannelUpdateInfo extends CommonBase { * * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public void set_last_update_message(@Nullable ChannelUpdate val) { + public void set_last_update_message(@Nullable org.ldk.structs.ChannelUpdate val) { bindings.ChannelUpdateInfo_set_last_update_message(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -170,7 +170,7 @@ public class ChannelUpdateInfo extends CommonBase { /** * Constructs a new ChannelUpdateInfo given each field */ - public static ChannelUpdateInfo of(int last_update_arg, boolean enabled_arg, short cltv_expiry_delta_arg, long htlc_minimum_msat_arg, long htlc_maximum_msat_arg, RoutingFees fees_arg, ChannelUpdate last_update_message_arg) { + public static ChannelUpdateInfo of(int last_update_arg, boolean enabled_arg, short cltv_expiry_delta_arg, long htlc_minimum_msat_arg, long htlc_maximum_msat_arg, org.ldk.structs.RoutingFees fees_arg, org.ldk.structs.ChannelUpdate last_update_message_arg) { long ret = bindings.ChannelUpdateInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, fees_arg == null ? 0 : fees_arg.ptr, last_update_message_arg == null ? 0 : last_update_message_arg.ptr); Reference.reachabilityFence(last_update_arg); Reference.reachabilityFence(enabled_arg); @@ -210,7 +210,7 @@ public class ChannelUpdateInfo extends CommonBase { * 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(ChannelUpdateInfo b) { + public boolean eq(org.ldk.structs.ChannelUpdateInfo b) { boolean ret = bindings.ChannelUpdateInfo_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/ChannelUsage.java b/src/main/java/org/ldk/structs/ChannelUsage.java index 2edd4f63..7795c2fe 100644 --- a/src/main/java/org/ldk/structs/ChannelUsage.java +++ b/src/main/java/org/ldk/structs/ChannelUsage.java @@ -73,7 +73,7 @@ public class ChannelUsage extends CommonBase { /** * The effective capacity of the channel. */ - public void set_effective_capacity(EffectiveCapacity val) { + public void set_effective_capacity(org.ldk.structs.EffectiveCapacity val) { bindings.ChannelUsage_set_effective_capacity(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -82,7 +82,7 @@ public class ChannelUsage extends CommonBase { /** * Constructs a new ChannelUsage given each field */ - public static ChannelUsage of(long amount_msat_arg, long inflight_htlc_msat_arg, EffectiveCapacity effective_capacity_arg) { + public static ChannelUsage of(long amount_msat_arg, long inflight_htlc_msat_arg, org.ldk.structs.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); diff --git a/src/main/java/org/ldk/structs/ClosingSigned.java b/src/main/java/org/ldk/structs/ClosingSigned.java index eee1fcd1..55a537bf 100644 --- a/src/main/java/org/ldk/structs/ClosingSigned.java +++ b/src/main/java/org/ldk/structs/ClosingSigned.java @@ -96,7 +96,7 @@ public class ClosingSigned extends CommonBase { * * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public void set_fee_range(@Nullable ClosingSignedFeeRange val) { + public void set_fee_range(@Nullable org.ldk.structs.ClosingSignedFeeRange val) { bindings.ClosingSigned_set_fee_range(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -106,7 +106,7 @@ public class ClosingSigned extends CommonBase { /** * Constructs a new ClosingSigned given each field */ - public static ClosingSigned of(byte[] channel_id_arg, long fee_satoshis_arg, byte[] signature_arg, ClosingSignedFeeRange fee_range_arg) { + public static ClosingSigned of(byte[] channel_id_arg, long fee_satoshis_arg, byte[] signature_arg, org.ldk.structs.ClosingSignedFeeRange fee_range_arg) { long ret = bindings.ClosingSigned_new(InternalUtils.check_arr_len(channel_id_arg, 32), fee_satoshis_arg, InternalUtils.check_arr_len(signature_arg, 64), fee_range_arg == null ? 0 : fee_range_arg.ptr); Reference.reachabilityFence(channel_id_arg); Reference.reachabilityFence(fee_satoshis_arg); @@ -142,7 +142,7 @@ public class ClosingSigned extends CommonBase { * 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(ClosingSigned b) { + public boolean eq(org.ldk.structs.ClosingSigned b) { boolean ret = bindings.ClosingSigned_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/ClosingSignedFeeRange.java b/src/main/java/org/ldk/structs/ClosingSignedFeeRange.java index 5c238244..e576e3a7 100644 --- a/src/main/java/org/ldk/structs/ClosingSignedFeeRange.java +++ b/src/main/java/org/ldk/structs/ClosingSignedFeeRange.java @@ -98,7 +98,7 @@ public class ClosingSignedFeeRange extends CommonBase { * 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(ClosingSignedFeeRange b) { + public boolean eq(org.ldk.structs.ClosingSignedFeeRange b) { boolean ret = bindings.ClosingSignedFeeRange_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/ClosingTransaction.java b/src/main/java/org/ldk/structs/ClosingTransaction.java index 0ac6fc60..c3cd91be 100644 --- a/src/main/java/org/ldk/structs/ClosingTransaction.java +++ b/src/main/java/org/ldk/structs/ClosingTransaction.java @@ -59,7 +59,7 @@ public class ClosingTransaction extends CommonBase { * 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(ClosingTransaction b) { + public boolean eq(org.ldk.structs.ClosingTransaction b) { boolean ret = bindings.ClosingTransaction_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); @@ -74,7 +74,7 @@ public class ClosingTransaction extends CommonBase { /** * Construct an object of the class */ - public static ClosingTransaction of(long to_holder_value_sat, long to_counterparty_value_sat, byte[] to_holder_script, byte[] to_counterparty_script, OutPoint funding_outpoint) { + public static ClosingTransaction of(long to_holder_value_sat, long to_counterparty_value_sat, byte[] to_holder_script, byte[] to_counterparty_script, org.ldk.structs.OutPoint funding_outpoint) { long ret = bindings.ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, to_holder_script, to_counterparty_script, funding_outpoint == null ? 0 : funding_outpoint.ptr); Reference.reachabilityFence(to_holder_value_sat); Reference.reachabilityFence(to_counterparty_value_sat); @@ -113,7 +113,7 @@ public class ClosingTransaction extends CommonBase { * An external validating signer must call this method before signing * or using the built transaction. */ - public Result_TrustedClosingTransactionNoneZ verify(OutPoint funding_outpoint) { + public Result_TrustedClosingTransactionNoneZ verify(org.ldk.structs.OutPoint funding_outpoint) { long ret = bindings.ClosingTransaction_verify(this.ptr, funding_outpoint == null ? 0 : funding_outpoint.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(funding_outpoint); diff --git a/src/main/java/org/ldk/structs/ClosureReason.java b/src/main/java/org/ldk/structs/ClosureReason.java index 7c957603..2993d934 100644 --- a/src/main/java/org/ldk/structs/ClosureReason.java +++ b/src/main/java/org/ldk/structs/ClosureReason.java @@ -259,7 +259,7 @@ public class ClosureReason extends CommonBase { * Checks if two ClosureReasons contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. */ - public boolean eq(ClosureReason b) { + public boolean eq(org.ldk.structs.ClosureReason b) { boolean ret = bindings.ClosureReason_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/CommitmentSigned.java b/src/main/java/org/ldk/structs/CommitmentSigned.java index a0207f07..4e336240 100644 --- a/src/main/java/org/ldk/structs/CommitmentSigned.java +++ b/src/main/java/org/ldk/structs/CommitmentSigned.java @@ -113,7 +113,7 @@ public class CommitmentSigned extends CommonBase { * 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(CommitmentSigned b) { + public boolean eq(org.ldk.structs.CommitmentSigned b) { boolean ret = bindings.CommitmentSigned_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/CommitmentTransaction.java b/src/main/java/org/ldk/structs/CommitmentTransaction.java index 0a3ec030..63910b51 100644 --- a/src/main/java/org/ldk/structs/CommitmentTransaction.java +++ b/src/main/java/org/ldk/structs/CommitmentTransaction.java @@ -124,7 +124,7 @@ public class CommitmentTransaction extends CommonBase { * An external validating signer must call this method before signing * or using the built transaction. */ - public Result_TrustedCommitmentTransactionNoneZ verify(DirectedChannelTransactionParameters channel_parameters, ChannelPublicKeys broadcaster_keys, ChannelPublicKeys countersignatory_keys) { + public Result_TrustedCommitmentTransactionNoneZ verify(org.ldk.structs.DirectedChannelTransactionParameters channel_parameters, org.ldk.structs.ChannelPublicKeys broadcaster_keys, org.ldk.structs.ChannelPublicKeys countersignatory_keys) { long ret = bindings.CommitmentTransaction_verify(this.ptr, channel_parameters == null ? 0 : channel_parameters.ptr, broadcaster_keys == null ? 0 : broadcaster_keys.ptr, countersignatory_keys == null ? 0 : countersignatory_keys.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(channel_parameters); diff --git a/src/main/java/org/ldk/structs/CommitmentUpdate.java b/src/main/java/org/ldk/structs/CommitmentUpdate.java index babcd3c4..a2b8ff0c 100644 --- a/src/main/java/org/ldk/structs/CommitmentUpdate.java +++ b/src/main/java/org/ldk/structs/CommitmentUpdate.java @@ -149,7 +149,7 @@ public class CommitmentUpdate extends CommonBase { * * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public void set_update_fee(@Nullable UpdateFee val) { + public void set_update_fee(@Nullable org.ldk.structs.UpdateFee val) { bindings.CommitmentUpdate_set_update_fee(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -171,7 +171,7 @@ public class CommitmentUpdate extends CommonBase { /** * Finally, the commitment_signed message which should be sent */ - public void set_commitment_signed(CommitmentSigned val) { + public void set_commitment_signed(org.ldk.structs.CommitmentSigned val) { bindings.CommitmentUpdate_set_commitment_signed(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -181,7 +181,7 @@ public class CommitmentUpdate extends CommonBase { /** * Constructs a new CommitmentUpdate given each field */ - public static CommitmentUpdate of(UpdateAddHTLC[] update_add_htlcs_arg, UpdateFulfillHTLC[] update_fulfill_htlcs_arg, UpdateFailHTLC[] update_fail_htlcs_arg, UpdateFailMalformedHTLC[] update_fail_malformed_htlcs_arg, UpdateFee update_fee_arg, CommitmentSigned commitment_signed_arg) { + public static CommitmentUpdate of(UpdateAddHTLC[] update_add_htlcs_arg, UpdateFulfillHTLC[] update_fulfill_htlcs_arg, UpdateFailHTLC[] update_fail_htlcs_arg, UpdateFailMalformedHTLC[] update_fail_malformed_htlcs_arg, org.ldk.structs.UpdateFee update_fee_arg, org.ldk.structs.CommitmentSigned commitment_signed_arg) { long ret = bindings.CommitmentUpdate_new(update_add_htlcs_arg != null ? Arrays.stream(update_add_htlcs_arg).mapToLong(update_add_htlcs_arg_conv_15 -> update_add_htlcs_arg_conv_15 == null ? 0 : update_add_htlcs_arg_conv_15.ptr).toArray() : null, update_fulfill_htlcs_arg != null ? Arrays.stream(update_fulfill_htlcs_arg).mapToLong(update_fulfill_htlcs_arg_conv_19 -> update_fulfill_htlcs_arg_conv_19 == null ? 0 : update_fulfill_htlcs_arg_conv_19.ptr).toArray() : null, update_fail_htlcs_arg != null ? Arrays.stream(update_fail_htlcs_arg).mapToLong(update_fail_htlcs_arg_conv_16 -> update_fail_htlcs_arg_conv_16 == null ? 0 : update_fail_htlcs_arg_conv_16.ptr).toArray() : null, update_fail_malformed_htlcs_arg != null ? Arrays.stream(update_fail_malformed_htlcs_arg).mapToLong(update_fail_malformed_htlcs_arg_conv_25 -> update_fail_malformed_htlcs_arg_conv_25 == null ? 0 : update_fail_malformed_htlcs_arg_conv_25.ptr).toArray() : null, update_fee_arg == null ? 0 : update_fee_arg.ptr, commitment_signed_arg == null ? 0 : commitment_signed_arg.ptr); Reference.reachabilityFence(update_add_htlcs_arg); Reference.reachabilityFence(update_fulfill_htlcs_arg); @@ -224,7 +224,7 @@ public class CommitmentUpdate extends CommonBase { * 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(CommitmentUpdate b) { + public boolean eq(org.ldk.structs.CommitmentUpdate b) { boolean ret = bindings.CommitmentUpdate_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/Confirm.java b/src/main/java/org/ldk/structs/Confirm.java index 4ecf6a8c..8894da4e 100644 --- a/src/main/java/org/ldk/structs/Confirm.java +++ b/src/main/java/org/ldk/structs/Confirm.java @@ -8,31 +8,35 @@ import java.lang.ref.Reference; import javax.annotation.Nullable; /** - * The `Confirm` trait is used to notify when transactions have been confirmed on chain or - * unconfirmed during a chain reorganization. + * The `Confirm` trait is used to notify LDK when relevant transactions have been confirmed on + * chain or unconfirmed during a chain reorganization. * * Clients sourcing chain data using a transaction-oriented API should prefer this interface over - * [`Listen`]. For instance, an Electrum client may implement [`Filter`] by subscribing to activity - * related to registered transactions and outputs. Upon notification, it would pass along the - * matching transactions using this interface. + * [`Listen`]. For instance, an Electrum-based transaction sync implementation may implement + * [`Filter`] to subscribe to relevant transactions and unspent outputs it should monitor for + * on-chain activity. Then, it needs to notify LDK via this interface upon observing any changes + * with reference to the confirmation status of the monitored objects. * * # Use - * * The intended use is as follows: - * - Call [`transactions_confirmed`] to process any on-chain activity of interest. - * - Call [`transaction_unconfirmed`] to process any transaction returned by [`get_relevant_txids`] - * that has been reorganized out of the chain. - * - Call [`best_block_updated`] whenever a new chain tip becomes available. + * - Call [`transactions_confirmed`] to notify LDK whenever any of the registered transactions or + * outputs are, respectively, confirmed or spent on chain. + * - Call [`transaction_unconfirmed`] to notify LDK whenever any transaction returned by + * [`get_relevant_txids`] is no longer confirmed in the block with the given block hash. + * - Call [`best_block_updated`] to notify LDK whenever a new chain tip becomes available. * * # Order * * Clients must call these methods in chain order. Specifically: - * - Transactions confirmed in a block must be given before transactions confirmed in a later - * block. + * - Transactions which are confirmed in a particular block must be given before transactions + * confirmed in a later block. * - Dependent transactions within the same block must be given in topological order, possibly in * separate calls. - * - Unconfirmed transactions must be given after the original confirmations and before any - * reconfirmation. + * - All unconfirmed transactions must be given after the original confirmations and before *any* + * reconfirmations, i.e., [`transactions_confirmed`] and [`transaction_unconfirmed`] calls should + * never be interleaved, but always conduced *en bloc*. + * - Any reconfirmed transactions need to be explicitly unconfirmed before they are reconfirmed + * in regard to the new block. * * See individual method documentation for further details. * @@ -57,9 +61,9 @@ public class Confirm extends CommonBase { public static interface ConfirmInterface { /** - * Processes transactions confirmed in a block with a given header and height. + * Notifies LDK of transactions confirmed in a block with a given header and height. * - * Should be called for any transactions registered by [`Filter::register_tx`] or any + * Must be called for any transactions registered by [`Filter::register_tx`] or any * transactions spending an output registered by [`Filter::register_output`]. Such transactions * appearing in the same block do not need to be included in the same call; instead, multiple * calls with additional transactions may be made so long as they are made in [chain order]. @@ -73,10 +77,11 @@ public class Confirm extends CommonBase { */ void transactions_confirmed(byte[] header, TwoTuple_usizeTransactionZ[] txdata, int height); /** - * Processes a transaction that is no longer confirmed as result of a chain reorganization. + * Notifies LDK of a transaction that is no longer confirmed as result of a chain reorganization. * - * Should be called for any transaction returned by [`get_relevant_txids`] if it has been - * reorganized out of the best chain. Once called, the given transaction will not be returned + * Must be called for any transaction returned by [`get_relevant_txids`] if it has been + * reorganized out of the best chain or if it is no longer confirmed in the block with the + * given block hash. Once called, the given transaction will not be returned * by [`get_relevant_txids`], unless it has been reconfirmed via [`transactions_confirmed`]. * * [`get_relevant_txids`]: Self::get_relevant_txids @@ -84,28 +89,33 @@ public class Confirm extends CommonBase { */ void transaction_unconfirmed(byte[] txid); /** - * Processes an update to the best header connected at the given height. + * Notifies LDK of an update to the best header connected at the given height. * - * Should be called when a new header is available but may be skipped for intermediary blocks - * if they become available at the same time. + * Must be called whenever a new chain tip becomes available. May be skipped for intermediary + * blocks. */ void best_block_updated(byte[] header, int height); /** - * Returns transactions that should be monitored for reorganization out of the chain. + * Returns transactions that must be monitored for reorganization out of the chain along + * with the hash of the block as part of which it had been previously confirmed. * * Will include any transactions passed to [`transactions_confirmed`] that have insufficient * confirmations to be safe from a chain reorganization. Will not include any transactions * passed to [`transaction_unconfirmed`], unless later reconfirmed. * - * May be called to determine the subset of transactions that must still be monitored for + * Must be called to determine the subset of transactions that must be monitored for * reorganization. Will be idempotent between calls but may change as a result of calls to the - * other interface methods. Thus, this is useful to determine which transactions may need to be + * other interface methods. Thus, this is useful to determine which transactions must be * given to [`transaction_unconfirmed`]. * + * If any of the returned transactions are confirmed in a block other than the one with the + * given hash, they need to be unconfirmed and reconfirmed via [`transaction_unconfirmed`] and + * [`transactions_confirmed`], respectively. + * * [`transactions_confirmed`]: Self::transactions_confirmed * [`transaction_unconfirmed`]: Self::transaction_unconfirmed */ - byte[][] get_relevant_txids(); + TwoTuple_TxidBlockHashZ[] get_relevant_txids(); } private static class LDKConfirmHolder { Confirm held; } public static Confirm new_impl(ConfirmInterface arg) { @@ -131,19 +141,19 @@ public class Confirm extends CommonBase { arg.best_block_updated(header, height); Reference.reachabilityFence(arg); } - @Override public byte[][] get_relevant_txids() { - byte[][] ret = arg.get_relevant_txids(); + @Override public long[] get_relevant_txids() { + TwoTuple_TxidBlockHashZ[] ret = arg.get_relevant_txids(); Reference.reachabilityFence(arg); - byte[][] result = ret != null ? Arrays.stream(ret).map(ret_conv_8 -> InternalUtils.check_arr_len(ret_conv_8, 32)).toArray(byte[][]::new) : null; + long[] result = ret != null ? Arrays.stream(ret).mapToLong(ret_conv_25 -> ret_conv_25 == null ? 0 : ret_conv_25.clone_ptr()).toArray() : null; return result; } }); return impl_holder.held; } /** - * Processes transactions confirmed in a block with a given header and height. + * Notifies LDK of transactions confirmed in a block with a given header and height. * - * Should be called for any transactions registered by [`Filter::register_tx`] or any + * Must be called for any transactions registered by [`Filter::register_tx`] or any * transactions spending an output registered by [`Filter::register_output`]. Such transactions * appearing in the same block do not need to be included in the same call; instead, multiple * calls with additional transactions may be made so long as they are made in [chain order]. @@ -164,10 +174,11 @@ public class Confirm extends CommonBase { } /** - * Processes a transaction that is no longer confirmed as result of a chain reorganization. + * Notifies LDK of a transaction that is no longer confirmed as result of a chain reorganization. * - * Should be called for any transaction returned by [`get_relevant_txids`] if it has been - * reorganized out of the best chain. Once called, the given transaction will not be returned + * Must be called for any transaction returned by [`get_relevant_txids`] if it has been + * reorganized out of the best chain or if it is no longer confirmed in the block with the + * given block hash. Once called, the given transaction will not be returned * by [`get_relevant_txids`], unless it has been reconfirmed via [`transactions_confirmed`]. * * [`get_relevant_txids`]: Self::get_relevant_txids @@ -180,10 +191,10 @@ public class Confirm extends CommonBase { } /** - * Processes an update to the best header connected at the given height. + * Notifies LDK of an update to the best header connected at the given height. * - * Should be called when a new header is available but may be skipped for intermediary blocks - * if they become available at the same time. + * Must be called whenever a new chain tip becomes available. May be skipped for intermediary + * blocks. */ public void best_block_updated(byte[] header, int height) { bindings.Confirm_best_block_updated(this.ptr, InternalUtils.check_arr_len(header, 80), height); @@ -193,24 +204,37 @@ public class Confirm extends CommonBase { } /** - * Returns transactions that should be monitored for reorganization out of the chain. + * Returns transactions that must be monitored for reorganization out of the chain along + * with the hash of the block as part of which it had been previously confirmed. * * Will include any transactions passed to [`transactions_confirmed`] that have insufficient * confirmations to be safe from a chain reorganization. Will not include any transactions * passed to [`transaction_unconfirmed`], unless later reconfirmed. * - * May be called to determine the subset of transactions that must still be monitored for + * Must be called to determine the subset of transactions that must be monitored for * reorganization. Will be idempotent between calls but may change as a result of calls to the - * other interface methods. Thus, this is useful to determine which transactions may need to be + * other interface methods. Thus, this is useful to determine which transactions must be * given to [`transaction_unconfirmed`]. * + * If any of the returned transactions are confirmed in a block other than the one with the + * given hash, they need to be unconfirmed and reconfirmed via [`transaction_unconfirmed`] and + * [`transactions_confirmed`], respectively. + * * [`transactions_confirmed`]: Self::transactions_confirmed * [`transaction_unconfirmed`]: Self::transaction_unconfirmed */ - public byte[][] get_relevant_txids() { - byte[][] ret = bindings.Confirm_get_relevant_txids(this.ptr); + public TwoTuple_TxidBlockHashZ[] get_relevant_txids() { + long[] ret = bindings.Confirm_get_relevant_txids(this.ptr); Reference.reachabilityFence(this); - return ret; + int ret_conv_25_len = ret.length; + TwoTuple_TxidBlockHashZ[] ret_conv_25_arr = new TwoTuple_TxidBlockHashZ[ret_conv_25_len]; + for (int z = 0; z < ret_conv_25_len; z++) { + long ret_conv_25 = ret[z]; + TwoTuple_TxidBlockHashZ ret_conv_25_hu_conv = new TwoTuple_TxidBlockHashZ(null, ret_conv_25); + if (ret_conv_25_hu_conv != null) { ret_conv_25_hu_conv.ptrs_to.add(this); }; + ret_conv_25_arr[z] = ret_conv_25_hu_conv; + } + return ret_conv_25_arr; } } diff --git a/src/main/java/org/ldk/structs/CounterpartyChannelTransactionParameters.java b/src/main/java/org/ldk/structs/CounterpartyChannelTransactionParameters.java index 9bcf308c..10fa2cbb 100644 --- a/src/main/java/org/ldk/structs/CounterpartyChannelTransactionParameters.java +++ b/src/main/java/org/ldk/structs/CounterpartyChannelTransactionParameters.java @@ -35,7 +35,7 @@ public class CounterpartyChannelTransactionParameters extends CommonBase { /** * Counter-party public keys */ - public void set_pubkeys(ChannelPublicKeys val) { + public void set_pubkeys(org.ldk.structs.ChannelPublicKeys val) { bindings.CounterpartyChannelTransactionParameters_set_pubkeys(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -63,7 +63,7 @@ public class CounterpartyChannelTransactionParameters extends CommonBase { /** * Constructs a new CounterpartyChannelTransactionParameters given each field */ - public static CounterpartyChannelTransactionParameters of(ChannelPublicKeys pubkeys_arg, short selected_contest_delay_arg) { + public static CounterpartyChannelTransactionParameters of(org.ldk.structs.ChannelPublicKeys pubkeys_arg, short selected_contest_delay_arg) { long ret = bindings.CounterpartyChannelTransactionParameters_new(pubkeys_arg == null ? 0 : pubkeys_arg.ptr, selected_contest_delay_arg); Reference.reachabilityFence(pubkeys_arg); Reference.reachabilityFence(selected_contest_delay_arg); diff --git a/src/main/java/org/ldk/structs/CustomMessageHandler.java b/src/main/java/org/ldk/structs/CustomMessageHandler.java index 23d82501..5d1586b6 100644 --- a/src/main/java/org/ldk/structs/CustomMessageHandler.java +++ b/src/main/java/org/ldk/structs/CustomMessageHandler.java @@ -74,7 +74,7 @@ public class CustomMessageHandler extends CommonBase { * Called with the message type that was received and the buffer to be read. * Can return a `MessageHandlingError` if the message could not be handled. */ - public Result_NoneLightningErrorZ handle_custom_message(Type msg, byte[] sender_node_id) { + public Result_NoneLightningErrorZ handle_custom_message(org.ldk.structs.Type msg, byte[] sender_node_id) { long ret = bindings.CustomMessageHandler_handle_custom_message(this.ptr, msg == null ? 0 : msg.ptr, InternalUtils.check_arr_len(sender_node_id, 33)); Reference.reachabilityFence(this); Reference.reachabilityFence(msg); diff --git a/src/main/java/org/ldk/structs/CustomOnionMessageHandler.java b/src/main/java/org/ldk/structs/CustomOnionMessageHandler.java index 1cf4f383..ae8f6044 100644 --- a/src/main/java/org/ldk/structs/CustomOnionMessageHandler.java +++ b/src/main/java/org/ldk/structs/CustomOnionMessageHandler.java @@ -66,7 +66,7 @@ public class CustomOnionMessageHandler extends CommonBase { /** * Called with the custom message that was received. */ - public void handle_custom_message(CustomOnionMessageContents msg) { + public void handle_custom_message(org.ldk.structs.CustomOnionMessageContents msg) { bindings.CustomOnionMessageHandler_handle_custom_message(this.ptr, msg == null ? 0 : msg.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(msg); diff --git a/src/main/java/org/ldk/structs/DataLossProtect.java b/src/main/java/org/ldk/structs/DataLossProtect.java index 2b68a20a..d094c5dc 100644 --- a/src/main/java/org/ldk/structs/DataLossProtect.java +++ b/src/main/java/org/ldk/structs/DataLossProtect.java @@ -97,7 +97,7 @@ public class DataLossProtect extends CommonBase { * 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(DataLossProtect b) { + public boolean eq(org.ldk.structs.DataLossProtect b) { boolean ret = bindings.DataLossProtect_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/DecodeError.java b/src/main/java/org/ldk/structs/DecodeError.java index 69d91e70..0dc34a05 100644 --- a/src/main/java/org/ldk/structs/DecodeError.java +++ b/src/main/java/org/ldk/structs/DecodeError.java @@ -206,7 +206,7 @@ public class DecodeError extends CommonBase { * Checks if two DecodeErrors contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. */ - public boolean eq(DecodeError b) { + public boolean eq(org.ldk.structs.DecodeError b) { boolean ret = bindings.DecodeError_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/DefaultRouter.java b/src/main/java/org/ldk/structs/DefaultRouter.java index 248af1b3..3f491961 100644 --- a/src/main/java/org/ldk/structs/DefaultRouter.java +++ b/src/main/java/org/ldk/structs/DefaultRouter.java @@ -21,10 +21,9 @@ public class DefaultRouter extends CommonBase { } /** - * Creates a new router using the given [`NetworkGraph`], a [`Logger`], and a randomness source - * `random_seed_bytes`. + * Creates a new router. */ - public static DefaultRouter of(NetworkGraph network_graph, Logger logger, byte[] random_seed_bytes, LockableScore scorer) { + public static DefaultRouter of(org.ldk.structs.NetworkGraph network_graph, org.ldk.structs.Logger logger, byte[] random_seed_bytes, org.ldk.structs.LockableScore scorer) { long ret = bindings.DefaultRouter_new(network_graph == null ? 0 : network_graph.ptr, logger == null ? 0 : logger.ptr, InternalUtils.check_arr_len(random_seed_bytes, 32), scorer == null ? 0 : scorer.ptr); Reference.reachabilityFence(network_graph); Reference.reachabilityFence(logger); diff --git a/src/main/java/org/ldk/structs/DelayedPaymentOutputDescriptor.java b/src/main/java/org/ldk/structs/DelayedPaymentOutputDescriptor.java index e4d9f5ef..57710427 100644 --- a/src/main/java/org/ldk/structs/DelayedPaymentOutputDescriptor.java +++ b/src/main/java/org/ldk/structs/DelayedPaymentOutputDescriptor.java @@ -9,8 +9,9 @@ import javax.annotation.Nullable; /** - * Information about a spendable output to a P2WSH script. See - * SpendableOutputDescriptor::DelayedPaymentOutput for more details on how to spend this. + * Information about a spendable output to a P2WSH script. + * + * See [`SpendableOutputDescriptor::DelayedPaymentOutput`] for more details on how to spend this. */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class DelayedPaymentOutputDescriptor extends CommonBase { @@ -22,7 +23,7 @@ public class DelayedPaymentOutputDescriptor extends CommonBase { } /** - * The outpoint which is spendable + * The outpoint which is spendable. */ public OutPoint get_outpoint() { long ret = bindings.DelayedPaymentOutputDescriptor_get_outpoint(this.ptr); @@ -34,9 +35,9 @@ public class DelayedPaymentOutputDescriptor extends CommonBase { } /** - * The outpoint which is spendable + * The outpoint which is spendable. */ - public void set_outpoint(OutPoint val) { + public void set_outpoint(org.ldk.structs.OutPoint val) { bindings.DelayedPaymentOutputDescriptor_set_outpoint(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -44,7 +45,7 @@ public class DelayedPaymentOutputDescriptor extends CommonBase { } /** - * Per commitment point to derive delayed_payment_key by key holder + * Per commitment point to derive the delayed payment key by key holder. */ public byte[] get_per_commitment_point() { byte[] ret = bindings.DelayedPaymentOutputDescriptor_get_per_commitment_point(this.ptr); @@ -53,7 +54,7 @@ public class DelayedPaymentOutputDescriptor extends CommonBase { } /** - * Per commitment point to derive delayed_payment_key by key holder + * Per commitment point to derive the delayed payment key by key holder. */ public void set_per_commitment_point(byte[] val) { bindings.DelayedPaymentOutputDescriptor_set_per_commitment_point(this.ptr, InternalUtils.check_arr_len(val, 33)); @@ -62,7 +63,7 @@ public class DelayedPaymentOutputDescriptor extends CommonBase { } /** - * The nSequence value which must be set in the spending input to satisfy the OP_CSV in + * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in * the witness_script. */ public short get_to_self_delay() { @@ -72,7 +73,7 @@ public class DelayedPaymentOutputDescriptor extends CommonBase { } /** - * The nSequence value which must be set in the spending input to satisfy the OP_CSV in + * The `nSequence` value which must be set in the spending input to satisfy the `OP_CSV` in * the witness_script. */ public void set_to_self_delay(short val) { @@ -82,7 +83,7 @@ public class DelayedPaymentOutputDescriptor extends CommonBase { } /** - * The output which is referenced by the given outpoint + * The output which is referenced by the given outpoint. * * Returns a copy of the field. */ @@ -95,9 +96,9 @@ public class DelayedPaymentOutputDescriptor extends CommonBase { } /** - * The output which is referenced by the given outpoint + * The output which is referenced by the given outpoint. */ - public void set_output(TxOut val) { + public void set_output(org.ldk.structs.TxOut val) { bindings.DelayedPaymentOutputDescriptor_set_output(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -124,9 +125,8 @@ public class DelayedPaymentOutputDescriptor extends CommonBase { } /** - * Arbitrary identification information returned by a call to - * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in - * the channel to spend the output. + * Arbitrary identification information returned by a call to [`BaseSign::channel_keys_id`]. + * This may be useful in re-deriving keys used in the channel to spend the output. */ public byte[] get_channel_keys_id() { byte[] ret = bindings.DelayedPaymentOutputDescriptor_get_channel_keys_id(this.ptr); @@ -135,9 +135,8 @@ public class DelayedPaymentOutputDescriptor extends CommonBase { } /** - * Arbitrary identification information returned by a call to - * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in - * the channel to spend the output. + * Arbitrary identification information returned by a call to [`BaseSign::channel_keys_id`]. + * This may be useful in re-deriving keys used in the channel to spend the output. */ public void set_channel_keys_id(byte[] val) { bindings.DelayedPaymentOutputDescriptor_set_channel_keys_id(this.ptr, InternalUtils.check_arr_len(val, 32)); @@ -166,7 +165,7 @@ public class DelayedPaymentOutputDescriptor extends CommonBase { /** * Constructs a new DelayedPaymentOutputDescriptor given each field */ - public static DelayedPaymentOutputDescriptor of(OutPoint outpoint_arg, byte[] per_commitment_point_arg, short to_self_delay_arg, TxOut output_arg, byte[] revocation_pubkey_arg, byte[] channel_keys_id_arg, long channel_value_satoshis_arg) { + public static DelayedPaymentOutputDescriptor of(org.ldk.structs.OutPoint outpoint_arg, byte[] per_commitment_point_arg, short to_self_delay_arg, org.ldk.structs.TxOut output_arg, byte[] revocation_pubkey_arg, byte[] channel_keys_id_arg, long channel_value_satoshis_arg) { long ret = bindings.DelayedPaymentOutputDescriptor_new(outpoint_arg == null ? 0 : outpoint_arg.ptr, InternalUtils.check_arr_len(per_commitment_point_arg, 33), to_self_delay_arg, output_arg.ptr, InternalUtils.check_arr_len(revocation_pubkey_arg, 33), InternalUtils.check_arr_len(channel_keys_id_arg, 32), channel_value_satoshis_arg); Reference.reachabilityFence(outpoint_arg); Reference.reachabilityFence(per_commitment_point_arg); @@ -205,7 +204,7 @@ public class DelayedPaymentOutputDescriptor extends CommonBase { * 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(DelayedPaymentOutputDescriptor b) { + public boolean eq(org.ldk.structs.DelayedPaymentOutputDescriptor b) { boolean ret = bindings.DelayedPaymentOutputDescriptor_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/Description.java b/src/main/java/org/ldk/structs/Description.java index 8d7762d6..1490ddea 100644 --- a/src/main/java/org/ldk/structs/Description.java +++ b/src/main/java/org/ldk/structs/Description.java @@ -58,7 +58,7 @@ public class Description extends CommonBase { * 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(Description b) { + public boolean eq(org.ldk.structs.Description b) { boolean ret = bindings.Description_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/Destination.java b/src/main/java/org/ldk/structs/Destination.java index 8ff6799d..e41c8223 100644 --- a/src/main/java/org/ldk/structs/Destination.java +++ b/src/main/java/org/ldk/structs/Destination.java @@ -24,8 +24,8 @@ public class Destination extends CommonBase { if (raw_val.getClass() == bindings.LDKDestination.Node.class) { return new Node(ptr, (bindings.LDKDestination.Node)raw_val); } - if (raw_val.getClass() == bindings.LDKDestination.BlindedRoute.class) { - return new BlindedRoute(ptr, (bindings.LDKDestination.BlindedRoute)raw_val); + if (raw_val.getClass() == bindings.LDKDestination.BlindedPath.class) { + return new BlindedPath(ptr, (bindings.LDKDestination.BlindedPath)raw_val); } assert false; return null; // Unreachable without extending the (internal) bindings interface } @@ -41,18 +41,36 @@ public class Destination extends CommonBase { } } /** - * We're sending this onion message to a blinded route. + * We're sending this onion message to a blinded path. */ - public final static class BlindedRoute extends Destination { - public final org.ldk.structs.BlindedRoute blinded_route; - private BlindedRoute(long ptr, bindings.LDKDestination.BlindedRoute obj) { + public final static class BlindedPath extends Destination { + public final org.ldk.structs.BlindedPath blinded_path; + private BlindedPath(long ptr, bindings.LDKDestination.BlindedPath obj) { super(null, ptr); - long blinded_route = obj.blinded_route; - org.ldk.structs.BlindedRoute blinded_route_hu_conv = null; if (blinded_route < 0 || blinded_route > 4096) { blinded_route_hu_conv = new org.ldk.structs.BlindedRoute(null, blinded_route); } - if (blinded_route_hu_conv != null) { blinded_route_hu_conv.ptrs_to.add(this); }; - this.blinded_route = blinded_route_hu_conv; + long blinded_path = obj.blinded_path; + org.ldk.structs.BlindedPath blinded_path_hu_conv = null; if (blinded_path < 0 || blinded_path > 4096) { blinded_path_hu_conv = new org.ldk.structs.BlindedPath(null, blinded_path); } + if (blinded_path_hu_conv != null) { blinded_path_hu_conv.ptrs_to.add(this); }; + this.blinded_path = blinded_path_hu_conv; } } + long clone_ptr() { + long ret = bindings.Destination_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the Destination + */ + public Destination clone() { + long ret = bindings.Destination_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Destination ret_hu_conv = org.ldk.structs.Destination.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + /** * Utility method to constructs a new Node-variant Destination */ @@ -66,23 +84,15 @@ public class Destination extends CommonBase { } /** - * Utility method to constructs a new BlindedRoute-variant Destination + * Utility method to constructs a new BlindedPath-variant Destination */ - public static Destination blinded_route(BlindedRoute a) { - long ret = bindings.Destination_blinded_route(a == null ? 0 : a.ptr); + public static Destination blinded_path(org.ldk.structs.BlindedPath a) { + long ret = bindings.Destination_blinded_path(a == null ? 0 : a.ptr); Reference.reachabilityFence(a); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Destination ret_hu_conv = org.ldk.structs.Destination.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; - // Due to rust's strict-ownership memory model, in some cases we need to "move" - // an object to pass exclusive ownership to the function being called. - // In most cases, we avoid ret_hu_conv being visible in GC'd languages by cloning the object - // at the FFI layer, creating a new object which Rust can claim ownership of - // However, in some cases (eg here), there is no way to clone an object, and thus - // we actually have to pass full ownership to Rust. - // Thus, after ret_hu_conv call, a is reset to null and is now a dummy object. - a.ptr = 0;; 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 9b216199..e6164ba0 100644 --- a/src/main/java/org/ldk/structs/DirectedChannelInfo.java +++ b/src/main/java/org/ldk/structs/DirectedChannelInfo.java @@ -51,21 +51,6 @@ public class DirectedChannelInfo extends CommonBase { return ret_hu_conv; } - /** - * Returns information for the direction. - * - * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None - */ - @Nullable - public ChannelUpdateInfo direction() { - long ret = bindings.DirectedChannelInfo_direction(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ChannelUpdateInfo ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelUpdateInfo(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - return ret_hu_conv; - } - /** * Returns the maximum HTLC amount allowed over the channel in the direction. */ diff --git a/src/main/java/org/ldk/structs/EffectiveCapacity.java b/src/main/java/org/ldk/structs/EffectiveCapacity.java index 923e1bdb..7dce1a0b 100644 --- a/src/main/java/org/ldk/structs/EffectiveCapacity.java +++ b/src/main/java/org/ldk/structs/EffectiveCapacity.java @@ -81,14 +81,11 @@ public class EffectiveCapacity extends CommonBase { /** * The maximum HTLC amount denominated in millisatoshi. */ - public final org.ldk.structs.Option_u64Z htlc_maximum_msat; + public final long htlc_maximum_msat; private Total(long ptr, bindings.LDKEffectiveCapacity.Total obj) { super(null, ptr); this.capacity_msat = obj.capacity_msat; - long htlc_maximum_msat = obj.htlc_maximum_msat; - org.ldk.structs.Option_u64Z htlc_maximum_msat_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(htlc_maximum_msat); - if (htlc_maximum_msat_hu_conv != null) { htlc_maximum_msat_hu_conv.ptrs_to.add(this); }; - this.htlc_maximum_msat = htlc_maximum_msat_hu_conv; + this.htlc_maximum_msat = obj.htlc_maximum_msat; } } /** @@ -154,8 +151,8 @@ public class EffectiveCapacity extends CommonBase { /** * Utility method to constructs a new Total-variant EffectiveCapacity */ - public static EffectiveCapacity total(long capacity_msat, Option_u64Z htlc_maximum_msat) { - long ret = bindings.EffectiveCapacity_total(capacity_msat, htlc_maximum_msat.ptr); + public static EffectiveCapacity total(long capacity_msat, long htlc_maximum_msat) { + long ret = bindings.EffectiveCapacity_total(capacity_msat, htlc_maximum_msat); Reference.reachabilityFence(capacity_msat); Reference.reachabilityFence(htlc_maximum_msat); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/ErrorAction.java b/src/main/java/org/ldk/structs/ErrorAction.java index 768f5fc6..167dbdc4 100644 --- a/src/main/java/org/ldk/structs/ErrorAction.java +++ b/src/main/java/org/ldk/structs/ErrorAction.java @@ -149,7 +149,7 @@ public class ErrorAction extends CommonBase { /** * Utility method to constructs a new DisconnectPeer-variant ErrorAction */ - public static ErrorAction disconnect_peer(ErrorMessage msg) { + public static ErrorAction disconnect_peer(org.ldk.structs.ErrorMessage msg) { long ret = bindings.ErrorAction_disconnect_peer(msg == null ? 0 : msg.ptr); Reference.reachabilityFence(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -196,7 +196,7 @@ public class ErrorAction extends CommonBase { /** * Utility method to constructs a new SendErrorMessage-variant ErrorAction */ - public static ErrorAction send_error_message(ErrorMessage msg) { + public static ErrorAction send_error_message(org.ldk.structs.ErrorMessage msg) { long ret = bindings.ErrorAction_send_error_message(msg == null ? 0 : msg.ptr); Reference.reachabilityFence(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -209,7 +209,7 @@ public class ErrorAction extends CommonBase { /** * Utility method to constructs a new SendWarningMessage-variant ErrorAction */ - public static ErrorAction send_warning_message(WarningMessage msg, org.ldk.enums.Level log_level) { + public static ErrorAction send_warning_message(org.ldk.structs.WarningMessage msg, org.ldk.enums.Level log_level) { long ret = bindings.ErrorAction_send_warning_message(msg == null ? 0 : msg.ptr, log_level); Reference.reachabilityFence(msg); Reference.reachabilityFence(log_level); diff --git a/src/main/java/org/ldk/structs/ErrorMessage.java b/src/main/java/org/ldk/structs/ErrorMessage.java index 18a4d4bd..84dcc822 100644 --- a/src/main/java/org/ldk/structs/ErrorMessage.java +++ b/src/main/java/org/ldk/structs/ErrorMessage.java @@ -104,7 +104,7 @@ public class ErrorMessage extends CommonBase { * 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(ErrorMessage b) { + public boolean eq(org.ldk.structs.ErrorMessage b) { boolean ret = bindings.ErrorMessage_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/Event.java b/src/main/java/org/ldk/structs/Event.java index 8663e761..26e3333a 100644 --- a/src/main/java/org/ldk/structs/Event.java +++ b/src/main/java/org/ldk/structs/Event.java @@ -28,8 +28,8 @@ public class Event extends CommonBase { if (raw_val.getClass() == bindings.LDKEvent.FundingGenerationReady.class) { return new FundingGenerationReady(ptr, (bindings.LDKEvent.FundingGenerationReady)raw_val); } - if (raw_val.getClass() == bindings.LDKEvent.PaymentReceived.class) { - return new PaymentReceived(ptr, (bindings.LDKEvent.PaymentReceived)raw_val); + if (raw_val.getClass() == bindings.LDKEvent.PaymentClaimable.class) { + return new PaymentClaimable(ptr, (bindings.LDKEvent.PaymentClaimable)raw_val); } if (raw_val.getClass() == bindings.LDKEvent.PaymentClaimed.class) { return new PaymentClaimed(ptr, (bindings.LDKEvent.PaymentClaimed)raw_val); @@ -55,12 +55,18 @@ public class Event extends CommonBase { if (raw_val.getClass() == bindings.LDKEvent.PendingHTLCsForwardable.class) { return new PendingHTLCsForwardable(ptr, (bindings.LDKEvent.PendingHTLCsForwardable)raw_val); } + if (raw_val.getClass() == bindings.LDKEvent.HTLCIntercepted.class) { + return new HTLCIntercepted(ptr, (bindings.LDKEvent.HTLCIntercepted)raw_val); + } if (raw_val.getClass() == bindings.LDKEvent.SpendableOutputs.class) { return new SpendableOutputs(ptr, (bindings.LDKEvent.SpendableOutputs)raw_val); } if (raw_val.getClass() == bindings.LDKEvent.PaymentForwarded.class) { return new PaymentForwarded(ptr, (bindings.LDKEvent.PaymentForwarded)raw_val); } + if (raw_val.getClass() == bindings.LDKEvent.ChannelReady.class) { + return new ChannelReady(ptr, (bindings.LDKEvent.ChannelReady)raw_val); + } if (raw_val.getClass() == bindings.LDKEvent.ChannelClosed.class) { return new ChannelClosed(ptr, (bindings.LDKEvent.ChannelClosed)raw_val); } @@ -110,24 +116,27 @@ public class Event extends CommonBase { */ public final byte[] output_script; /** - * The `user_channel_id` value passed in to [`ChannelManager::create_channel`], or 0 for - * an inbound channel. + * The `user_channel_id` value passed in to [`ChannelManager::create_channel`], or a + * random value for an inbound channel. This may be zero for objects serialized with LDK + * versions prior to 0.0.113. * * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel */ - public final long user_channel_id; + public final org.ldk.util.UInt128 user_channel_id; 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; + byte[] user_channel_id = obj.user_channel_id; + org.ldk.util.UInt128 user_channel_id_conv = new org.ldk.util.UInt128(user_channel_id); + this.user_channel_id = user_channel_id_conv; } } /** - * 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.... + * Indicates that we've been offered a payment and it needs to be claimed via calling + * [`ChannelManager::claim_funds`] with the preimage given in [`PaymentPurpose`]. * * Note that if the preimage is not known, you should call * [`ChannelManager::fail_htlc_backwards`] to free up resources for this HTLC and avoid @@ -138,12 +147,26 @@ public class Event extends CommonBase { * * # Note * LDK will not stop an inbound payment from being paid multiple times, so multiple - * `PaymentReceived` events may be generated for the same payment. + * `PaymentClaimable` events may be generated for the same payment. + * + * # Note + * This event used to be called `PaymentReceived` in LDK versions 0.0.112 and earlier. * * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds * [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards */ - public final static class PaymentReceived extends Event { + public final static class PaymentClaimable extends Event { + /** + * The node that will receive the payment after it has been claimed. + * This is useful to identify payments received via [phantom nodes]. + * This field will always be filled in when the event was generated by LDK versions + * 0.0.113 and above. + * + * [phantom nodes]: crate::chain::keysinterface::PhantomKeysManager + * + * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + @Nullable public final byte[] receiver_node_id; /** * The hash for which the preimage should be handed to the ChannelManager. Note that LDK will * not stop you from registering duplicate payment hashes for inbound payments. @@ -158,33 +181,60 @@ public class Event extends CommonBase { * payment is to pay an invoice or to send a spontaneous payment. */ public final org.ldk.structs.PaymentPurpose purpose; - private PaymentReceived(long ptr, bindings.LDKEvent.PaymentReceived obj) { + /** + * The `channel_id` indicating over which channel we received the payment. + * + * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + @Nullable public final byte[] via_channel_id; + /** + * The `user_channel_id` indicating over which channel we received the payment. + */ + public final org.ldk.structs.Option_u128Z via_user_channel_id; + private PaymentClaimable(long ptr, bindings.LDKEvent.PaymentClaimable obj) { super(null, ptr); + this.receiver_node_id = obj.receiver_node_id; 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); if (purpose_hu_conv != null) { purpose_hu_conv.ptrs_to.add(this); }; this.purpose = purpose_hu_conv; + this.via_channel_id = obj.via_channel_id; + long via_user_channel_id = obj.via_user_channel_id; + org.ldk.structs.Option_u128Z via_user_channel_id_hu_conv = org.ldk.structs.Option_u128Z.constr_from_ptr(via_user_channel_id); + if (via_user_channel_id_hu_conv != null) { via_user_channel_id_hu_conv.ptrs_to.add(this); }; + this.via_user_channel_id = via_user_channel_id_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 + * to an [`Event::PaymentClaimable`]. However, if we previously crashed during a * [`ChannelManager::claim_funds`] call you may see this event without a corresponding - * [`Event::PaymentReceived`] event. + * [`Event::PaymentClaimable`] 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 + * `PaymentClaimable` events may be generated for the same payment. If you then call + * [`ChannelManager::claim_funds`] twice for the same [`Event::PaymentClaimable`] you may get * multiple `PaymentClaimed` events. * * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds */ public final static class PaymentClaimed extends Event { + /** + * The node that received the payment. + * This is useful to identify payments which were received via [phantom nodes]. + * This field will always be filled in when the event was generated by LDK versions + * 0.0.113 and above. + * + * [phantom nodes]: crate::chain::keysinterface::PhantomKeysManager + * + * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + @Nullable public final byte[] receiver_node_id; /** * The payment hash of the claimed payment. Note that LDK will not stop you from * registering duplicate payment hashes for inbound payments. @@ -195,12 +245,13 @@ public class Event extends CommonBase { */ public final long amount_msat; /** - * The purpose of this claimed payment, i.e. whether the payment was for an invoice or a + * The purpose of the 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.receiver_node_id = obj.receiver_node_id; this.payment_hash = obj.payment_hash; this.amount_msat = obj.amount_msat; long purpose = obj.purpose; @@ -267,8 +318,8 @@ public class Event extends CommonBase { * 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. + * payment is no longer retryable due to [`ChannelManager::abandon_payment`] having been + * called for the corresponding payment. * * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment */ @@ -343,9 +394,14 @@ public class Event extends CommonBase { * Indicates an outbound HTLC we sent failed. Probably some intermediary node dropped * something. You may wish to retry with a different route. * + * If you have given up retrying this payment and wish to fail it, you MUST call + * [`ChannelManager::abandon_payment`] at least once for a given [`PaymentId`] or memory + * related to payment tracking will leak. + * * Note that this does *not* indicate that all paths for an MPP payment have failed, see * [`Event::PaymentFailed`] and [`all_paths_failed`]. * + * [`ChannelManager::abandon_payment`]: crate::ln::channelmanager::ChannelManager::abandon_payment * [`all_paths_failed`]: Self::PaymentPathFailed::all_paths_failed */ public final static class PaymentPathFailed extends Event { @@ -561,6 +617,58 @@ public class Event extends CommonBase { this.time_forwardable = obj.time_forwardable; } } + /** + * Used to indicate that we've intercepted an HTLC forward. This event will only be generated if + * you've encoded an intercept scid in the receiver's invoice route hints using + * [`ChannelManager::get_intercept_scid`] and have set [`UserConfig::accept_intercept_htlcs`]. + * + * [`ChannelManager::forward_intercepted_htlc`] or + * [`ChannelManager::fail_intercepted_htlc`] MUST be called in response to this event. See + * their docs for more information. + * + * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid + * [`UserConfig::accept_intercept_htlcs`]: crate::util::config::UserConfig::accept_intercept_htlcs + * [`ChannelManager::forward_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::forward_intercepted_htlc + * [`ChannelManager::fail_intercepted_htlc`]: crate::ln::channelmanager::ChannelManager::fail_intercepted_htlc + */ + public final static class HTLCIntercepted extends Event { + /** + * An id to help LDK identify which HTLC is being forwarded or failed. + */ + public final byte[] intercept_id; + /** + * The fake scid that was programmed as the next hop's scid, generated using + * [`ChannelManager::get_intercept_scid`]. + * + * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid + */ + public final long requested_next_hop_scid; + /** + * The payment hash used for this HTLC. + */ + public final byte[] payment_hash; + /** + * How many msats were received on the inbound edge of this HTLC. + */ + public final long inbound_amount_msat; + /** + * How many msats the payer intended to route to the next node. Depending on the reason you are + * intercepting this payment, you might take a fee by forwarding less than this amount. + * + * Note that LDK will NOT check that expected fees were factored into this value. You MUST + * check that whatever fee you want has been included here or subtract it as required. Further, + * LDK will not stop you from forwarding more than you received. + */ + public final long expected_outbound_amount_msat; + private HTLCIntercepted(long ptr, bindings.LDKEvent.HTLCIntercepted obj) { + super(null, ptr); + this.intercept_id = obj.intercept_id; + this.requested_next_hop_scid = obj.requested_next_hop_scid; + this.payment_hash = obj.payment_hash; + this.inbound_amount_msat = obj.inbound_amount_msat; + this.expected_outbound_amount_msat = obj.expected_outbound_amount_msat; + } + } /** * Used to indicate that an output which you should know how to spend was confirmed on chain * and is now spendable. @@ -638,6 +746,49 @@ public class Event extends CommonBase { this.claim_from_onchain_tx = obj.claim_from_onchain_tx; } } + /** + * Used to indicate that a channel with the given `channel_id` is ready to + * be used. This event is emitted either when the funding transaction has been confirmed + * on-chain, or, in case of a 0conf channel, when both parties have confirmed the channel + * establishment. + */ + public final static class ChannelReady extends Event { + /** + * The channel_id of the channel that is ready. + */ + public final byte[] channel_id; + /** + * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound + * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if + * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise + * `user_channel_id` will be randomized for an inbound channel. + * + * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel + * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel + * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels + */ + public final org.ldk.util.UInt128 user_channel_id; + /** + * The node_id of the channel counterparty. + */ + public final byte[] counterparty_node_id; + /** + * The features that this channel will operate with. + */ + public final org.ldk.structs.ChannelTypeFeatures channel_type; + private ChannelReady(long ptr, bindings.LDKEvent.ChannelReady obj) { + super(null, ptr); + this.channel_id = obj.channel_id; + byte[] user_channel_id = obj.user_channel_id; + org.ldk.util.UInt128 user_channel_id_conv = new org.ldk.util.UInt128(user_channel_id); + this.user_channel_id = user_channel_id_conv; + this.counterparty_node_id = obj.counterparty_node_id; + long channel_type = obj.channel_type; + org.ldk.structs.ChannelTypeFeatures channel_type_hu_conv = null; if (channel_type < 0 || channel_type > 4096) { channel_type_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, channel_type); } + if (channel_type_hu_conv != null) { channel_type_hu_conv.ptrs_to.add(this); }; + this.channel_type = channel_type_hu_conv; + } + } /** * Used to indicate that a previously opened channel with the given `channel_id` is in the * process of closure. @@ -652,14 +803,15 @@ public class Event extends CommonBase { * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if * [`UserConfig::manually_accept_inbound_channels`] config flag is set to true. Otherwise - * `user_channel_id` will be 0 for an inbound channel. - * This will always be zero for objects serialized with LDK versions prior to 0.0.102. + * `user_channel_id` will be randomized for inbound channels. + * This may be zero for inbound channels serialized prior to 0.0.113 and will always be + * zero for objects serialized with LDK versions prior to 0.0.102. * * [`ChannelManager::create_channel`]: crate::ln::channelmanager::ChannelManager::create_channel * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel * [`UserConfig::manually_accept_inbound_channels`]: crate::util::config::UserConfig::manually_accept_inbound_channels */ - public final long user_channel_id; + public final org.ldk.util.UInt128 user_channel_id; /** * The reason the channel was closed. */ @@ -667,7 +819,9 @@ public class Event extends CommonBase { private ChannelClosed(long ptr, bindings.LDKEvent.ChannelClosed obj) { super(null, ptr); this.channel_id = obj.channel_id; - this.user_channel_id = obj.user_channel_id; + byte[] user_channel_id = obj.user_channel_id; + org.ldk.util.UInt128 user_channel_id_conv = new org.ldk.util.UInt128(user_channel_id); + this.user_channel_id = user_channel_id_conv; long reason = obj.reason; org.ldk.structs.ClosureReason reason_hu_conv = org.ldk.structs.ClosureReason.constr_from_ptr(reason); if (reason_hu_conv != null) { reason_hu_conv.ptrs_to.add(this); }; @@ -821,8 +975,8 @@ public class Event extends CommonBase { /** * Utility method to constructs a new FundingGenerationReady-variant Event */ - 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); + public static Event funding_generation_ready(byte[] temporary_channel_id, byte[] counterparty_node_id, long channel_value_satoshis, byte[] output_script, org.ldk.util.UInt128 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.getLEBytes()); Reference.reachabilityFence(temporary_channel_id); Reference.reachabilityFence(counterparty_node_id); Reference.reachabilityFence(channel_value_satoshis); @@ -835,13 +989,16 @@ public class Event extends CommonBase { } /** - * Utility method to constructs a new PaymentReceived-variant Event + * Utility method to constructs a new PaymentClaimable-variant Event */ - 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); + public static Event payment_claimable(byte[] receiver_node_id, byte[] payment_hash, long amount_msat, org.ldk.structs.PaymentPurpose purpose, byte[] via_channel_id, org.ldk.structs.Option_u128Z via_user_channel_id) { + long ret = bindings.Event_payment_claimable(InternalUtils.check_arr_len(receiver_node_id, 33), InternalUtils.check_arr_len(payment_hash, 32), amount_msat, purpose.ptr, InternalUtils.check_arr_len(via_channel_id, 32), via_user_channel_id.ptr); + Reference.reachabilityFence(receiver_node_id); Reference.reachabilityFence(payment_hash); Reference.reachabilityFence(amount_msat); Reference.reachabilityFence(purpose); + Reference.reachabilityFence(via_channel_id); + Reference.reachabilityFence(via_user_channel_id); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; @@ -851,8 +1008,9 @@ public class Event extends CommonBase { /** * 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); + public static Event payment_claimed(byte[] receiver_node_id, byte[] payment_hash, long amount_msat, org.ldk.structs.PaymentPurpose purpose) { + long ret = bindings.Event_payment_claimed(InternalUtils.check_arr_len(receiver_node_id, 33), InternalUtils.check_arr_len(payment_hash, 32), amount_msat, purpose.ptr); + Reference.reachabilityFence(receiver_node_id); Reference.reachabilityFence(payment_hash); Reference.reachabilityFence(amount_msat); Reference.reachabilityFence(purpose); @@ -865,7 +1023,7 @@ public class Event extends CommonBase { /** * Utility method to constructs a new PaymentSent-variant Event */ - public static Event payment_sent(byte[] payment_id, byte[] payment_preimage, byte[] payment_hash, Option_u64Z fee_paid_msat) { + public static Event payment_sent(byte[] payment_id, byte[] payment_preimage, byte[] payment_hash, org.ldk.structs.Option_u64Z fee_paid_msat) { long ret = bindings.Event_payment_sent(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_preimage, 32), InternalUtils.check_arr_len(payment_hash, 32), fee_paid_msat.ptr); Reference.reachabilityFence(payment_id); Reference.reachabilityFence(payment_preimage); @@ -908,7 +1066,7 @@ public class Event extends CommonBase { /** * Utility method to constructs a new PaymentPathFailed-variant Event */ - public static Event payment_path_failed(byte[] payment_id, byte[] payment_hash, boolean payment_failed_permanently, Option_NetworkUpdateZ network_update, boolean all_paths_failed, RouteHop[] path, Option_u64Z short_channel_id, RouteParameters retry) { + public static Event payment_path_failed(byte[] payment_id, byte[] payment_hash, boolean payment_failed_permanently, org.ldk.structs.Option_NetworkUpdateZ network_update, boolean all_paths_failed, RouteHop[] path, org.ldk.structs.Option_u64Z short_channel_id, org.ldk.structs.RouteParameters retry) { long ret = bindings.Event_payment_path_failed(InternalUtils.check_arr_len(payment_id, 32), InternalUtils.check_arr_len(payment_hash, 32), payment_failed_permanently, network_update.ptr, all_paths_failed, path != null ? Arrays.stream(path).mapToLong(path_conv_10 -> path_conv_10 == null ? 0 : path_conv_10.ptr).toArray() : null, short_channel_id.ptr, retry == null ? 0 : retry.ptr); Reference.reachabilityFence(payment_id); Reference.reachabilityFence(payment_hash); @@ -944,7 +1102,7 @@ public class Event extends CommonBase { /** * Utility method to constructs a new ProbeFailed-variant Event */ - public static Event probe_failed(byte[] payment_id, byte[] payment_hash, RouteHop[] path, Option_u64Z short_channel_id) { + public static Event probe_failed(byte[] payment_id, byte[] payment_hash, RouteHop[] path, org.ldk.structs.Option_u64Z short_channel_id) { long ret = bindings.Event_probe_failed(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).toArray() : null, short_channel_id.ptr); Reference.reachabilityFence(payment_id); Reference.reachabilityFence(payment_hash); @@ -969,6 +1127,22 @@ public class Event extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new HTLCIntercepted-variant Event + */ + public static Event htlcintercepted(byte[] intercept_id, long requested_next_hop_scid, byte[] payment_hash, long inbound_amount_msat, long expected_outbound_amount_msat) { + long ret = bindings.Event_htlcintercepted(InternalUtils.check_arr_len(intercept_id, 32), requested_next_hop_scid, InternalUtils.check_arr_len(payment_hash, 32), inbound_amount_msat, expected_outbound_amount_msat); + Reference.reachabilityFence(intercept_id); + Reference.reachabilityFence(requested_next_hop_scid); + Reference.reachabilityFence(payment_hash); + Reference.reachabilityFence(inbound_amount_msat); + Reference.reachabilityFence(expected_outbound_amount_msat); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + /** * Utility method to constructs a new SpendableOutputs-variant Event */ @@ -984,7 +1158,7 @@ public class Event extends CommonBase { /** * Utility method to constructs a new PaymentForwarded-variant Event */ - public static Event payment_forwarded(byte[] prev_channel_id, byte[] next_channel_id, Option_u64Z fee_earned_msat, boolean claim_from_onchain_tx) { + public static Event payment_forwarded(byte[] prev_channel_id, byte[] next_channel_id, org.ldk.structs.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); @@ -996,11 +1170,27 @@ public class Event extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new ChannelReady-variant Event + */ + public static Event channel_ready(byte[] channel_id, org.ldk.util.UInt128 user_channel_id, byte[] counterparty_node_id, org.ldk.structs.ChannelTypeFeatures channel_type) { + long ret = bindings.Event_channel_ready(InternalUtils.check_arr_len(channel_id, 32), user_channel_id.getLEBytes(), InternalUtils.check_arr_len(counterparty_node_id, 33), channel_type == null ? 0 : channel_type.ptr); + Reference.reachabilityFence(channel_id); + Reference.reachabilityFence(user_channel_id); + Reference.reachabilityFence(counterparty_node_id); + Reference.reachabilityFence(channel_type); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channel_type); }; + return ret_hu_conv; + } + /** * Utility method to constructs a new ChannelClosed-variant Event */ - public static Event channel_closed(byte[] channel_id, long user_channel_id, ClosureReason reason) { - long ret = bindings.Event_channel_closed(InternalUtils.check_arr_len(channel_id, 32), user_channel_id, reason.ptr); + public static Event channel_closed(byte[] channel_id, org.ldk.util.UInt128 user_channel_id, org.ldk.structs.ClosureReason reason) { + long ret = bindings.Event_channel_closed(InternalUtils.check_arr_len(channel_id, 32), user_channel_id.getLEBytes(), reason.ptr); Reference.reachabilityFence(channel_id); Reference.reachabilityFence(user_channel_id); Reference.reachabilityFence(reason); @@ -1026,7 +1216,7 @@ public class Event extends CommonBase { /** * Utility method to constructs a new OpenChannelRequest-variant Event */ - public static Event open_channel_request(byte[] temporary_channel_id, byte[] counterparty_node_id, long funding_satoshis, long push_msat, ChannelTypeFeatures channel_type) { + public static Event open_channel_request(byte[] temporary_channel_id, byte[] counterparty_node_id, long funding_satoshis, long push_msat, org.ldk.structs.ChannelTypeFeatures channel_type) { long ret = bindings.Event_open_channel_request(InternalUtils.check_arr_len(temporary_channel_id, 32), InternalUtils.check_arr_len(counterparty_node_id, 33), funding_satoshis, push_msat, channel_type == null ? 0 : channel_type.ptr); Reference.reachabilityFence(temporary_channel_id); Reference.reachabilityFence(counterparty_node_id); @@ -1043,7 +1233,7 @@ public class Event extends CommonBase { /** * Utility method to constructs a new HTLCHandlingFailed-variant Event */ - public static Event htlchandling_failed(byte[] prev_channel_id, HTLCDestination failed_next_destination) { + public static Event htlchandling_failed(byte[] prev_channel_id, org.ldk.structs.HTLCDestination failed_next_destination) { long ret = bindings.Event_htlchandling_failed(InternalUtils.check_arr_len(prev_channel_id, 32), failed_next_destination.ptr); Reference.reachabilityFence(prev_channel_id); Reference.reachabilityFence(failed_next_destination); diff --git a/src/main/java/org/ldk/structs/EventHandler.java b/src/main/java/org/ldk/structs/EventHandler.java index cb740752..6dfd4512 100644 --- a/src/main/java/org/ldk/structs/EventHandler.java +++ b/src/main/java/org/ldk/structs/EventHandler.java @@ -9,6 +9,10 @@ import javax.annotation.Nullable; /** * A trait implemented for objects handling events from [`EventsProvider`]. + * + * An async variation also exists for implementations of [`EventsProvider`] that support async + * event handling. The async event handler should satisfy the generic bounds: `F: + * core::future::Future, H: Fn(Event) -> F`. */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class EventHandler extends CommonBase { @@ -37,7 +41,8 @@ public class EventHandler extends CommonBase { final LDKEventHandlerHolder impl_holder = new LDKEventHandlerHolder(); impl_holder.held = new EventHandler(new bindings.LDKEventHandler() { @Override public void handle_event(long event) { - Event event_hu_conv = Event.constr_from_ptr(event); + org.ldk.structs.Event event_hu_conv = org.ldk.structs.Event.constr_from_ptr(event); + if (event_hu_conv != null) { event_hu_conv.ptrs_to.add(this); }; arg.handle_event(event_hu_conv); Reference.reachabilityFence(arg); } @@ -49,8 +54,8 @@ public class EventHandler extends CommonBase { * * See [`EventsProvider`] for details that must be considered when implementing this method. */ - public void handle_event(Event event) { - bindings.EventHandler_handle_event(this.ptr, event == null ? 0 : event.ptr); + public void handle_event(org.ldk.structs.Event event) { + bindings.EventHandler_handle_event(this.ptr, event.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(event); } diff --git a/src/main/java/org/ldk/structs/EventsProvider.java b/src/main/java/org/ldk/structs/EventsProvider.java index f4f22f39..8c34829c 100644 --- a/src/main/java/org/ldk/structs/EventsProvider.java +++ b/src/main/java/org/ldk/structs/EventsProvider.java @@ -12,6 +12,10 @@ import javax.annotation.Nullable; * * Events are processed by passing an [`EventHandler`] to [`process_pending_events`]. * + * Implementations of this trait may also feature an async version of event handling, as shown with + * [`ChannelManager::process_pending_events_async`] and + * [`ChainMonitor::process_pending_events_async`]. + * * # Requirements * * When using this trait, [`process_pending_events`] will call [`handle_event`] for each pending @@ -38,6 +42,8 @@ import javax.annotation.Nullable; * [`handle_event`]: EventHandler::handle_event * [`ChannelManager::process_pending_events`]: crate::ln::channelmanager::ChannelManager#method.process_pending_events * [`ChainMonitor::process_pending_events`]: crate::chain::chainmonitor::ChainMonitor#method.process_pending_events + * [`ChannelManager::process_pending_events_async`]: crate::ln::channelmanager::ChannelManager::process_pending_events_async + * [`ChainMonitor::process_pending_events_async`]: crate::chain::chainmonitor::ChainMonitor::process_pending_events_async */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class EventsProvider extends CommonBase { @@ -79,7 +85,7 @@ public class EventsProvider extends CommonBase { * * See the trait-level documentation for requirements. */ - public void process_pending_events(EventHandler handler) { + public void process_pending_events(org.ldk.structs.EventHandler handler) { bindings.EventsProvider_process_pending_events(this.ptr, handler == null ? 0 : handler.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(handler); diff --git a/src/main/java/org/ldk/structs/ExpiryTime.java b/src/main/java/org/ldk/structs/ExpiryTime.java index 2d0d0805..bc1176a9 100644 --- a/src/main/java/org/ldk/structs/ExpiryTime.java +++ b/src/main/java/org/ldk/structs/ExpiryTime.java @@ -56,7 +56,7 @@ public class ExpiryTime extends CommonBase { * 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(ExpiryTime b) { + public boolean eq(org.ldk.structs.ExpiryTime b) { boolean ret = bindings.ExpiryTime_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/Fallback.java b/src/main/java/org/ldk/structs/Fallback.java index a7498674..d8357180 100644 --- a/src/main/java/org/ldk/structs/Fallback.java +++ b/src/main/java/org/ldk/structs/Fallback.java @@ -79,7 +79,7 @@ public class Fallback extends CommonBase { /** * Utility method to constructs a new SegWitProgram-variant Fallback */ - public static Fallback seg_wit_program(UInt5 version, byte[] program) { + public static Fallback seg_wit_program(org.ldk.util.UInt5 version, byte[] program) { long ret = bindings.Fallback_seg_wit_program(version.getVal(), program); Reference.reachabilityFence(version); Reference.reachabilityFence(program); @@ -129,7 +129,7 @@ public class Fallback extends CommonBase { * Checks if two Fallbacks contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. */ - public boolean eq(Fallback b) { + public boolean eq(org.ldk.structs.Fallback b) { boolean ret = bindings.Fallback_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/FilesystemPersister.java b/src/main/java/org/ldk/structs/FilesystemPersister.java index 753d4e0c..c6235e61 100644 --- a/src/main/java/org/ldk/structs/FilesystemPersister.java +++ b/src/main/java/org/ldk/structs/FilesystemPersister.java @@ -56,7 +56,7 @@ public class FilesystemPersister extends CommonBase { /** * Read `ChannelMonitor`s from disk. */ - public Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ read_channelmonitors(KeysInterface keys_manager) { + public Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ read_channelmonitors(org.ldk.structs.KeysInterface keys_manager) { long ret = bindings.FilesystemPersister_read_channelmonitors(this.ptr, keys_manager == null ? 0 : keys_manager.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(keys_manager); diff --git a/src/main/java/org/ldk/structs/Filter.java b/src/main/java/org/ldk/structs/Filter.java index f26427c2..f35fa9dc 100644 --- a/src/main/java/org/ldk/structs/Filter.java +++ b/src/main/java/org/ldk/structs/Filter.java @@ -95,7 +95,7 @@ public class Filter extends CommonBase { * handled, e.g., by re-scanning the block in question whenever new outputs have been * registered mid-processing. */ - public void register_output(WatchedOutput output) { + public void register_output(org.ldk.structs.WatchedOutput output) { bindings.Filter_register_output(this.ptr, output == null ? 0 : output.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(output); diff --git a/src/main/java/org/ldk/structs/FundingCreated.java b/src/main/java/org/ldk/structs/FundingCreated.java index bb45b88b..d0ec746a 100644 --- a/src/main/java/org/ldk/structs/FundingCreated.java +++ b/src/main/java/org/ldk/structs/FundingCreated.java @@ -130,7 +130,7 @@ public class FundingCreated extends CommonBase { * 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(FundingCreated b) { + public boolean eq(org.ldk.structs.FundingCreated b) { boolean ret = bindings.FundingCreated_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/FundingSigned.java b/src/main/java/org/ldk/structs/FundingSigned.java index 9b2f3f5f..24658fe2 100644 --- a/src/main/java/org/ldk/structs/FundingSigned.java +++ b/src/main/java/org/ldk/structs/FundingSigned.java @@ -92,7 +92,7 @@ public class FundingSigned extends CommonBase { * 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(FundingSigned b) { + public boolean eq(org.ldk.structs.FundingSigned b) { boolean ret = bindings.FundingSigned_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/Future.java b/src/main/java/org/ldk/structs/Future.java index b59563a1..4a9d0c5e 100644 --- a/src/main/java/org/ldk/structs/Future.java +++ b/src/main/java/org/ldk/structs/Future.java @@ -24,7 +24,7 @@ public class Future extends CommonBase { * Registers a callback to be called upon completion of this future. If the future has already * completed, the callback will be called immediately. */ - public void register_callback_fn(FutureCallback callback) { + public void register_callback_fn(org.ldk.structs.FutureCallback callback) { bindings.Future_register_callback_fn(this.ptr, callback == null ? 0 : callback.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(callback); diff --git a/src/main/java/org/ldk/structs/GossipSync.java b/src/main/java/org/ldk/structs/GossipSync.java index b13bc75e..47a9a82a 100644 --- a/src/main/java/org/ldk/structs/GossipSync.java +++ b/src/main/java/org/ldk/structs/GossipSync.java @@ -70,7 +70,7 @@ public class GossipSync extends CommonBase { /** * Utility method to constructs a new P2P-variant GossipSync */ - public static GossipSync p2_p(P2PGossipSync a) { + public static GossipSync p2_p(org.ldk.structs.P2PGossipSync a) { long ret = bindings.GossipSync_p2_p(a == null ? 0 : a.ptr); Reference.reachabilityFence(a); if (ret >= 0 && ret <= 4096) { return null; } @@ -83,7 +83,7 @@ public class GossipSync extends CommonBase { /** * Utility method to constructs a new Rapid-variant GossipSync */ - public static GossipSync rapid(RapidGossipSync a) { + public static GossipSync rapid(org.ldk.structs.RapidGossipSync a) { long ret = bindings.GossipSync_rapid(a == null ? 0 : a.ptr); Reference.reachabilityFence(a); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/GossipTimestampFilter.java b/src/main/java/org/ldk/structs/GossipTimestampFilter.java index ac7b20f3..ddb158f6 100644 --- a/src/main/java/org/ldk/structs/GossipTimestampFilter.java +++ b/src/main/java/org/ldk/structs/GossipTimestampFilter.java @@ -113,7 +113,7 @@ public class GossipTimestampFilter extends CommonBase { * 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(GossipTimestampFilter b) { + public boolean eq(org.ldk.structs.GossipTimestampFilter b) { boolean ret = bindings.GossipTimestampFilter_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/GraphSyncError.java b/src/main/java/org/ldk/structs/GraphSyncError.java index 368c6170..0febba31 100644 --- a/src/main/java/org/ldk/structs/GraphSyncError.java +++ b/src/main/java/org/ldk/structs/GraphSyncError.java @@ -79,7 +79,7 @@ public class GraphSyncError extends CommonBase { /** * Utility method to constructs a new DecodeError-variant GraphSyncError */ - public static GraphSyncError decode_error(DecodeError a) { + public static GraphSyncError decode_error(org.ldk.structs.DecodeError a) { long ret = bindings.GraphSyncError_decode_error(a.ptr); Reference.reachabilityFence(a); if (ret >= 0 && ret <= 4096) { return null; } @@ -91,7 +91,7 @@ public class GraphSyncError extends CommonBase { /** * Utility method to constructs a new LightningError-variant GraphSyncError */ - public static GraphSyncError lightning_error(LightningError a) { + public static GraphSyncError lightning_error(org.ldk.structs.LightningError a) { long ret = bindings.GraphSyncError_lightning_error(a == null ? 0 : a.ptr); Reference.reachabilityFence(a); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/HTLCDestination.java b/src/main/java/org/ldk/structs/HTLCDestination.java index 8d0c94bd..9c873801 100644 --- a/src/main/java/org/ldk/structs/HTLCDestination.java +++ b/src/main/java/org/ldk/structs/HTLCDestination.java @@ -27,6 +27,9 @@ public class HTLCDestination extends CommonBase { if (raw_val.getClass() == bindings.LDKHTLCDestination.UnknownNextHop.class) { return new UnknownNextHop(ptr, (bindings.LDKHTLCDestination.UnknownNextHop)raw_val); } + if (raw_val.getClass() == bindings.LDKHTLCDestination.InvalidForward.class) { + return new InvalidForward(ptr, (bindings.LDKHTLCDestination.InvalidForward)raw_val); + } if (raw_val.getClass() == bindings.LDKHTLCDestination.FailedPayment.class) { return new FailedPayment(ptr, (bindings.LDKHTLCDestination.FailedPayment)raw_val); } @@ -69,6 +72,20 @@ public class HTLCDestination extends CommonBase { this.requested_forward_scid = obj.requested_forward_scid; } } + /** + * We couldn't forward to the outgoing scid. An example would be attempting to send a duplicate + * intercept HTLC. + */ + public final static class InvalidForward extends HTLCDestination { + /** + * Short channel id we are requesting to forward an HTLC to. + */ + public final long requested_forward_scid; + private InvalidForward(long ptr, bindings.LDKHTLCDestination.InvalidForward obj) { + super(null, ptr); + this.requested_forward_scid = obj.requested_forward_scid; + } + } /** * Failure scenario where an HTLC may have been forwarded to be intended for us, * but is invalid for some reason, so we reject it. @@ -131,6 +148,18 @@ public class HTLCDestination extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new InvalidForward-variant HTLCDestination + */ + public static HTLCDestination invalid_forward(long requested_forward_scid) { + long ret = bindings.HTLCDestination_invalid_forward(requested_forward_scid); + Reference.reachabilityFence(requested_forward_scid); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.HTLCDestination ret_hu_conv = org.ldk.structs.HTLCDestination.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + /** * Utility method to constructs a new FailedPayment-variant HTLCDestination */ @@ -147,7 +176,7 @@ public class HTLCDestination extends CommonBase { * Checks if two HTLCDestinations contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. */ - public boolean eq(HTLCDestination b) { + public boolean eq(org.ldk.structs.HTLCDestination b) { boolean ret = bindings.HTLCDestination_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/HTLCOutputInCommitment.java b/src/main/java/org/ldk/structs/HTLCOutputInCommitment.java index 7936b2a8..a69d0373 100644 --- a/src/main/java/org/ldk/structs/HTLCOutputInCommitment.java +++ b/src/main/java/org/ldk/structs/HTLCOutputInCommitment.java @@ -119,7 +119,7 @@ public class HTLCOutputInCommitment extends CommonBase { * below the dust limit (in which case no output appears in the commitment transaction and the * value is spent to additional transaction fees). */ - public void set_transaction_output_index(Option_u32Z val) { + public void set_transaction_output_index(org.ldk.structs.Option_u32Z val) { bindings.HTLCOutputInCommitment_set_transaction_output_index(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -128,7 +128,7 @@ public class HTLCOutputInCommitment extends CommonBase { /** * Constructs a new HTLCOutputInCommitment given each field */ - public static HTLCOutputInCommitment of(boolean offered_arg, long amount_msat_arg, int cltv_expiry_arg, byte[] payment_hash_arg, Option_u32Z transaction_output_index_arg) { + public static HTLCOutputInCommitment of(boolean offered_arg, long amount_msat_arg, int cltv_expiry_arg, byte[] payment_hash_arg, org.ldk.structs.Option_u32Z transaction_output_index_arg) { long ret = bindings.HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, InternalUtils.check_arr_len(payment_hash_arg, 32), transaction_output_index_arg.ptr); Reference.reachabilityFence(offered_arg); Reference.reachabilityFence(amount_msat_arg); @@ -164,7 +164,7 @@ public class HTLCOutputInCommitment extends CommonBase { * 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(HTLCOutputInCommitment b) { + public boolean eq(org.ldk.structs.HTLCOutputInCommitment b) { boolean ret = bindings.HTLCOutputInCommitment_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/HTLCUpdate.java b/src/main/java/org/ldk/structs/HTLCUpdate.java index ccf422ec..67050a5b 100644 --- a/src/main/java/org/ldk/structs/HTLCUpdate.java +++ b/src/main/java/org/ldk/structs/HTLCUpdate.java @@ -45,7 +45,7 @@ public class HTLCUpdate extends CommonBase { * 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(HTLCUpdate b) { + public boolean eq(org.ldk.structs.HTLCUpdate b) { boolean ret = bindings.HTLCUpdate_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/HolderCommitmentTransaction.java b/src/main/java/org/ldk/structs/HolderCommitmentTransaction.java index 18ef54e6..7458cc9b 100644 --- a/src/main/java/org/ldk/structs/HolderCommitmentTransaction.java +++ b/src/main/java/org/ldk/structs/HolderCommitmentTransaction.java @@ -102,7 +102,7 @@ public class HolderCommitmentTransaction extends CommonBase { * Create a new holder transaction with the given counterparty signatures. * The funding keys are used to figure out which signature should go first when building the transaction for broadcast. */ - public static HolderCommitmentTransaction of(CommitmentTransaction commitment_tx, byte[] counterparty_sig, byte[][] counterparty_htlc_sigs, byte[] holder_funding_key, byte[] counterparty_funding_key) { + public static HolderCommitmentTransaction of(org.ldk.structs.CommitmentTransaction commitment_tx, byte[] counterparty_sig, byte[][] counterparty_htlc_sigs, byte[] holder_funding_key, byte[] counterparty_funding_key) { long ret = bindings.HolderCommitmentTransaction_new(commitment_tx == null ? 0 : commitment_tx.ptr, InternalUtils.check_arr_len(counterparty_sig, 64), counterparty_htlc_sigs != null ? Arrays.stream(counterparty_htlc_sigs).map(counterparty_htlc_sigs_conv_8 -> InternalUtils.check_arr_len(counterparty_htlc_sigs_conv_8, 64)).toArray(byte[][]::new) : null, InternalUtils.check_arr_len(holder_funding_key, 33), InternalUtils.check_arr_len(counterparty_funding_key, 33)); Reference.reachabilityFence(commitment_tx); Reference.reachabilityFence(counterparty_sig); diff --git a/src/main/java/org/ldk/structs/Hostname.java b/src/main/java/org/ldk/structs/Hostname.java index 64994b72..fdf18a3a 100644 --- a/src/main/java/org/ldk/structs/Hostname.java +++ b/src/main/java/org/ldk/structs/Hostname.java @@ -47,7 +47,7 @@ public class Hostname extends CommonBase { * 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(Hostname b) { + public boolean eq(org.ldk.structs.Hostname b) { boolean ret = bindings.Hostname_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/InFlightHtlcs.java b/src/main/java/org/ldk/structs/InFlightHtlcs.java index d19c7128..1164d586 100644 --- a/src/main/java/org/ldk/structs/InFlightHtlcs.java +++ b/src/main/java/org/ldk/structs/InFlightHtlcs.java @@ -9,10 +9,8 @@ import javax.annotation.Nullable; /** - * A map with liquidity value (in msat) keyed by a short channel id and the direction the HTLC - * is traveling in. The direction boolean is determined by checking if the HTLC source's public - * key is less than its destination. See [`InFlightHtlcs::used_liquidity_msat`] for more - * details. + * A data structure for tracking in-flight HTLCs. May be used during pathfinding to account for + * in-use channel liquidity. */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class InFlightHtlcs extends CommonBase { @@ -23,11 +21,40 @@ public class InFlightHtlcs extends CommonBase { if (ptr != 0) { bindings.InFlightHtlcs_free(ptr); } } + long clone_ptr() { + long ret = bindings.InFlightHtlcs_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the InFlightHtlcs + */ + public InFlightHtlcs clone() { + long ret = bindings.InFlightHtlcs_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.InFlightHtlcs ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InFlightHtlcs(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Constructs an empty `InFlightHtlcs`. + */ + public static InFlightHtlcs of() { + long ret = bindings.InFlightHtlcs_new(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.InFlightHtlcs ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InFlightHtlcs(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + /** * Returns liquidity in msat given the public key of the HTLC source, target, and short channel * id. */ - public Option_u64Z used_liquidity_msat(NodeId source, NodeId target, long channel_scid) { + public Option_u64Z used_liquidity_msat(org.ldk.structs.NodeId source, org.ldk.structs.NodeId target, long channel_scid) { long ret = bindings.InFlightHtlcs_used_liquidity_msat(this.ptr, source == null ? 0 : source.ptr, target == null ? 0 : target.ptr, channel_scid); Reference.reachabilityFence(this); Reference.reachabilityFence(source); diff --git a/src/main/java/org/ldk/structs/InMemorySigner.java b/src/main/java/org/ldk/structs/InMemorySigner.java index bc90a526..af36de28 100644 --- a/src/main/java/org/ldk/structs/InMemorySigner.java +++ b/src/main/java/org/ldk/structs/InMemorySigner.java @@ -9,7 +9,7 @@ import javax.annotation.Nullable; /** - * A simple implementation of Sign that just keeps the private keys in memory. + * A simple implementation of [`Sign`] that just keeps the private keys in memory. * * This implementation performs no policy checks and is insufficient by itself as * a secure external signer. @@ -24,7 +24,8 @@ public class InMemorySigner extends CommonBase { } /** - * Private key of anchor tx + * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the + * holder's anchor output in a commitment transaction, if one is present. */ public byte[] get_funding_key() { byte[] ret = bindings.InMemorySigner_get_funding_key(this.ptr); @@ -33,7 +34,8 @@ public class InMemorySigner extends CommonBase { } /** - * Private key of anchor tx + * Holder secret key in the 2-of-2 multisig script of a channel. This key also backs the + * holder's anchor output in a commitment transaction, if one is present. */ public void set_funding_key(byte[] val) { bindings.InMemorySigner_set_funding_key(this.ptr, InternalUtils.check_arr_len(val, 32)); @@ -42,7 +44,7 @@ public class InMemorySigner extends CommonBase { } /** - * Holder secret key for blinded revocation pubkey + * Holder secret key for blinded revocation pubkey. */ public byte[] get_revocation_base_key() { byte[] ret = bindings.InMemorySigner_get_revocation_base_key(this.ptr); @@ -51,7 +53,7 @@ public class InMemorySigner extends CommonBase { } /** - * Holder secret key for blinded revocation pubkey + * Holder secret key for blinded revocation pubkey. */ public void set_revocation_base_key(byte[] val) { bindings.InMemorySigner_set_revocation_base_key(this.ptr, InternalUtils.check_arr_len(val, 32)); @@ -60,7 +62,7 @@ public class InMemorySigner extends CommonBase { } /** - * Holder secret key used for our balance in counterparty-broadcasted commitment transactions + * Holder secret key used for our balance in counterparty-broadcasted commitment transactions. */ public byte[] get_payment_key() { byte[] ret = bindings.InMemorySigner_get_payment_key(this.ptr); @@ -69,7 +71,7 @@ public class InMemorySigner extends CommonBase { } /** - * Holder secret key used for our balance in counterparty-broadcasted commitment transactions + * Holder secret key used for our balance in counterparty-broadcasted commitment transactions. */ public void set_payment_key(byte[] val) { bindings.InMemorySigner_set_payment_key(this.ptr, InternalUtils.check_arr_len(val, 32)); @@ -78,7 +80,7 @@ public class InMemorySigner extends CommonBase { } /** - * Holder secret key used in HTLC tx + * Holder secret key used in an HTLC transaction. */ public byte[] get_delayed_payment_base_key() { byte[] ret = bindings.InMemorySigner_get_delayed_payment_base_key(this.ptr); @@ -87,7 +89,7 @@ public class InMemorySigner extends CommonBase { } /** - * Holder secret key used in HTLC tx + * Holder secret key used in an HTLC transaction. */ public void set_delayed_payment_base_key(byte[] val) { bindings.InMemorySigner_set_delayed_payment_base_key(this.ptr, InternalUtils.check_arr_len(val, 32)); @@ -96,7 +98,7 @@ public class InMemorySigner extends CommonBase { } /** - * Holder htlc secret key used in commitment tx htlc outputs + * Holder HTLC secret key used in commitment transaction HTLC outputs. */ public byte[] get_htlc_base_key() { byte[] ret = bindings.InMemorySigner_get_htlc_base_key(this.ptr); @@ -105,7 +107,7 @@ public class InMemorySigner extends CommonBase { } /** - * Holder htlc secret key used in commitment tx htlc outputs + * Holder HTLC secret key used in commitment transaction HTLC outputs. */ public void set_htlc_base_key(byte[] val) { bindings.InMemorySigner_set_htlc_base_key(this.ptr, InternalUtils.check_arr_len(val, 32)); @@ -114,7 +116,7 @@ public class InMemorySigner extends CommonBase { } /** - * Commitment seed + * Commitment seed. */ public byte[] get_commitment_seed() { byte[] ret = bindings.InMemorySigner_get_commitment_seed(this.ptr); @@ -123,7 +125,7 @@ public class InMemorySigner extends CommonBase { } /** - * Commitment seed + * Commitment seed. */ public void set_commitment_seed(byte[] val) { bindings.InMemorySigner_set_commitment_seed(this.ptr, InternalUtils.check_arr_len(val, 32)); @@ -150,7 +152,7 @@ public class InMemorySigner extends CommonBase { } /** - * Create a new InMemorySigner + * Creates a new [`InMemorySigner`]. */ public static InMemorySigner of(byte[] node_secret, byte[] funding_key, byte[] revocation_base_key, byte[] payment_key, byte[] delayed_payment_base_key, byte[] htlc_base_key, byte[] commitment_seed, long channel_value_satoshis, byte[] channel_keys_id) { long ret = bindings.InMemorySigner_new(InternalUtils.check_arr_len(node_secret, 32), InternalUtils.check_arr_len(funding_key, 32), InternalUtils.check_arr_len(revocation_base_key, 32), InternalUtils.check_arr_len(payment_key, 32), InternalUtils.check_arr_len(delayed_payment_base_key, 32), InternalUtils.check_arr_len(htlc_base_key, 32), InternalUtils.check_arr_len(commitment_seed, 32), channel_value_satoshis, InternalUtils.check_arr_len(channel_keys_id, 32)); @@ -170,8 +172,9 @@ public class InMemorySigner extends CommonBase { } /** - * Counterparty pubkeys. - * Will panic if ready_channel wasn't called. + * Returns the counterparty's pubkeys. + * + * Will panic if [`BaseSign::provide_channel_parameters`] has not been called before. */ public ChannelPublicKeys counterparty_pubkeys() { long ret = bindings.InMemorySigner_counterparty_pubkeys(this.ptr); @@ -183,10 +186,11 @@ public class InMemorySigner extends CommonBase { } /** - * The contest_delay value specified by our counterparty and applied on holder-broadcastable - * transactions, ie the amount of time that we have to wait to recover our funds if we + * Returns the `contest_delay` value specified by our counterparty and applied on holder-broadcastable + * transactions, i.e., the amount of time that we have to wait to recover our funds if we * broadcast a transaction. - * Will panic if ready_channel wasn't called. + * + * Will panic if [`BaseSign::provide_channel_parameters`] has not been called before. */ public short counterparty_selected_contest_delay() { short ret = bindings.InMemorySigner_counterparty_selected_contest_delay(this.ptr); @@ -195,10 +199,11 @@ public class InMemorySigner extends CommonBase { } /** - * The contest_delay value specified by us and applied on transactions broadcastable - * by our counterparty, ie the amount of time that they have to wait to recover their funds + * Returns the `contest_delay` value specified by us and applied on transactions broadcastable + * by our counterparty, i.e., the amount of time that they have to wait to recover their funds * if they broadcast a transaction. - * Will panic if ready_channel wasn't called. + * + * Will panic if [`BaseSign::provide_channel_parameters`] has not been called before. */ public short holder_selected_contest_delay() { short ret = bindings.InMemorySigner_holder_selected_contest_delay(this.ptr); @@ -207,8 +212,9 @@ public class InMemorySigner extends CommonBase { } /** - * Whether the holder is the initiator - * Will panic if ready_channel wasn't called. + * Returns whether the holder is the initiator. + * + * Will panic if [`BaseSign::provide_channel_parameters`] has not been called before. */ public boolean is_outbound() { boolean ret = bindings.InMemorySigner_is_outbound(this.ptr); @@ -218,7 +224,8 @@ public class InMemorySigner extends CommonBase { /** * Funding outpoint - * Will panic if ready_channel wasn't called. + * + * Will panic if [`BaseSign::provide_channel_parameters`] has not been called before. */ public OutPoint funding_outpoint() { long ret = bindings.InMemorySigner_funding_outpoint(this.ptr); @@ -230,10 +237,10 @@ public class InMemorySigner extends CommonBase { } /** - * Obtain a ChannelTransactionParameters for this channel, to be used when verifying or + * Returns a [`ChannelTransactionParameters`] for this channel, to be used when verifying or * building transactions. * - * Will panic if ready_channel wasn't called. + * Will panic if [`BaseSign::provide_channel_parameters`] has not been called before. */ public ChannelTransactionParameters get_channel_parameters() { long ret = bindings.InMemorySigner_get_channel_parameters(this.ptr); @@ -245,8 +252,9 @@ public class InMemorySigner extends CommonBase { } /** - * Whether anchors should be used. - * Will panic if ready_channel wasn't called. + * Returns whether anchors should be used. + * + * Will panic if [`BaseSign::provide_channel_parameters`] has not been called before. */ public boolean opt_anchors() { boolean ret = bindings.InMemorySigner_opt_anchors(this.ptr); @@ -255,14 +263,16 @@ public class InMemorySigner extends CommonBase { } /** - * Sign the single input of spend_tx at index `input_idx` which spends the output - * described by descriptor, returning the witness stack for the input. + * Sign the single input of `spend_tx` at index `input_idx`, which spends the output described + * by `descriptor`, returning the witness stack for the input. * - * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig, - * is not spending the outpoint described by `descriptor.outpoint`, - * or if an output descriptor script_pubkey does not match the one we can spend. + * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`, + * is not spending the outpoint described by [`descriptor.outpoint`], + * or if an output descriptor `script_pubkey` does not match the one we can spend. + * + * [`descriptor.outpoint`]: StaticPaymentOutputDescriptor::outpoint */ - public Result_CVec_CVec_u8ZZNoneZ sign_counterparty_payment_input(byte[] spend_tx, long input_idx, StaticPaymentOutputDescriptor descriptor) { + public Result_CVec_CVec_u8ZZNoneZ sign_counterparty_payment_input(byte[] spend_tx, long input_idx, org.ldk.structs.StaticPaymentOutputDescriptor descriptor) { long ret = bindings.InMemorySigner_sign_counterparty_payment_input(this.ptr, spend_tx, input_idx, descriptor == null ? 0 : descriptor.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(spend_tx); @@ -275,15 +285,18 @@ public class InMemorySigner extends CommonBase { } /** - * Sign the single input of spend_tx at index `input_idx` which spends the output - * described by descriptor, returning the witness stack for the input. + * Sign the single input of `spend_tx` at index `input_idx` which spends the output + * described by `descriptor`, returning the witness stack for the input. + * + * Returns an error if the input at `input_idx` does not exist, has a non-empty `script_sig`, + * is not spending the outpoint described by [`descriptor.outpoint`], does not have a + * sequence set to [`descriptor.to_self_delay`], or if an output descriptor + * `script_pubkey` does not match the one we can spend. * - * Returns an Err if the input at input_idx does not exist, has a non-empty script_sig, - * is not spending the outpoint described by `descriptor.outpoint`, does not have a - * sequence set to `descriptor.to_self_delay`, or if an output descriptor - * script_pubkey does not match the one we can spend. + * [`descriptor.outpoint`]: DelayedPaymentOutputDescriptor::outpoint + * [`descriptor.to_self_delay`]: DelayedPaymentOutputDescriptor::to_self_delay */ - public Result_CVec_CVec_u8ZZNoneZ sign_dynamic_p2wsh_input(byte[] spend_tx, long input_idx, DelayedPaymentOutputDescriptor descriptor) { + public Result_CVec_CVec_u8ZZNoneZ sign_dynamic_p2wsh_input(byte[] spend_tx, long input_idx, org.ldk.structs.DelayedPaymentOutputDescriptor descriptor) { long ret = bindings.InMemorySigner_sign_dynamic_p2wsh_input(this.ptr, spend_tx, input_idx, descriptor == null ? 0 : descriptor.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(spend_tx); diff --git a/src/main/java/org/ldk/structs/Init.java b/src/main/java/org/ldk/structs/Init.java index 767ecfd3..7015c4d2 100644 --- a/src/main/java/org/ldk/structs/Init.java +++ b/src/main/java/org/ldk/structs/Init.java @@ -35,7 +35,7 @@ public class Init extends CommonBase { /** * The relevant features which the sender supports */ - public void set_features(InitFeatures val) { + public void set_features(org.ldk.structs.InitFeatures val) { bindings.Init_set_features(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -63,7 +63,7 @@ public class Init extends CommonBase { * to discover a potential update to its public IPv4 address (NAT) and use * that for a node_announcement update message containing the new address. */ - public void set_remote_network_address(Option_NetAddressZ val) { + public void set_remote_network_address(org.ldk.structs.Option_NetAddressZ val) { bindings.Init_set_remote_network_address(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -72,7 +72,7 @@ public class Init extends CommonBase { /** * Constructs a new Init given each field */ - public static Init of(InitFeatures features_arg, Option_NetAddressZ remote_network_address_arg) { + public static Init of(org.ldk.structs.InitFeatures features_arg, org.ldk.structs.Option_NetAddressZ remote_network_address_arg) { long ret = bindings.Init_new(features_arg == null ? 0 : features_arg.ptr, remote_network_address_arg.ptr); Reference.reachabilityFence(features_arg); Reference.reachabilityFence(remote_network_address_arg); @@ -106,7 +106,7 @@ public class Init extends CommonBase { * 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(Init b) { + public boolean eq(org.ldk.structs.Init b) { boolean ret = bindings.Init_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/InitFeatures.java b/src/main/java/org/ldk/structs/InitFeatures.java index d6effca4..820f0d2b 100644 --- a/src/main/java/org/ldk/structs/InitFeatures.java +++ b/src/main/java/org/ldk/structs/InitFeatures.java @@ -25,7 +25,7 @@ public class InitFeatures extends CommonBase { * 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(InitFeatures b) { + public boolean eq(org.ldk.structs.InitFeatures b) { boolean ret = bindings.InitFeatures_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/Invoice.java b/src/main/java/org/ldk/structs/Invoice.java index 5bc61db4..596982ab 100644 --- a/src/main/java/org/ldk/structs/Invoice.java +++ b/src/main/java/org/ldk/structs/Invoice.java @@ -30,7 +30,7 @@ public class Invoice extends CommonBase { * 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(Invoice b) { + public boolean eq(org.ldk.structs.Invoice b) { boolean ret = bindings.Invoice_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); @@ -118,7 +118,7 @@ public class Invoice extends CommonBase { * assert!(Invoice::from_signed(signed).is_ok()); * ``` */ - public static Result_InvoiceSemanticErrorZ from_signed(SignedRawInvoice signed_invoice) { + public static Result_InvoiceSemanticErrorZ from_signed(org.ldk.structs.SignedRawInvoice signed_invoice) { long ret = bindings.Invoice_from_signed(signed_invoice == null ? 0 : signed_invoice.ptr); Reference.reachabilityFence(signed_invoice); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/InvoiceFeatures.java b/src/main/java/org/ldk/structs/InvoiceFeatures.java index f70294f5..b05a6987 100644 --- a/src/main/java/org/ldk/structs/InvoiceFeatures.java +++ b/src/main/java/org/ldk/structs/InvoiceFeatures.java @@ -25,7 +25,7 @@ public class InvoiceFeatures extends CommonBase { * 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(InvoiceFeatures b) { + public boolean eq(org.ldk.structs.InvoiceFeatures b) { boolean ret = bindings.InvoiceFeatures_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/InvoicePayer.java b/src/main/java/org/ldk/structs/InvoicePayer.java index a7add5e8..67e0d213 100644 --- a/src/main/java/org/ldk/structs/InvoicePayer.java +++ b/src/main/java/org/ldk/structs/InvoicePayer.java @@ -30,7 +30,7 @@ public class InvoicePayer extends CommonBase { * Will forward any [`Event::PaymentPathFailed`] events to the decorated `event_handler` once * `retry` has been exceeded for a given [`Invoice`]. */ - public static InvoicePayer of(Payer payer, Router router, Logger logger, EventHandler event_handler, Retry retry) { + public static InvoicePayer of(org.ldk.structs.Payer payer, org.ldk.structs.Router router, org.ldk.structs.Logger logger, org.ldk.structs.EventHandler event_handler, org.ldk.structs.Retry retry) { long ret = bindings.InvoicePayer_new(payer == null ? 0 : payer.ptr, router == null ? 0 : router.ptr, logger == null ? 0 : logger.ptr, event_handler == null ? 0 : event_handler.ptr, retry.ptr); Reference.reachabilityFence(payer); Reference.reachabilityFence(router); @@ -50,11 +50,14 @@ public class InvoicePayer extends CommonBase { /** * Pays the given [`Invoice`], caching it for later use in case a retry is needed. * - * You should ensure that the `invoice.payment_hash()` is unique and the same payment_hash has - * never been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so - * for you. + * [`Invoice::payment_hash`] is used as the [`PaymentId`], which ensures idempotency as long + * as the payment is still pending. Once the payment completes or fails, you must ensure that + * a second payment with the same [`PaymentHash`] is never sent. + * + * If you wish to use a different payment idempotency token, see + * [`Self::pay_invoice_with_id`]. */ - public Result_PaymentIdPaymentErrorZ pay_invoice(Invoice invoice) { + public Result_PaymentIdPaymentErrorZ pay_invoice(org.ldk.structs.Invoice invoice) { long ret = bindings.InvoicePayer_pay_invoice(this.ptr, invoice == null ? 0 : invoice.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(invoice); @@ -64,15 +67,42 @@ public class InvoicePayer extends CommonBase { return ret_hu_conv; } + /** + * Pays the given [`Invoice`] with a custom idempotency key, caching the invoice for later use + * in case a retry is needed. + * + * Note that idempotency is only guaranteed as long as the payment is still pending. Once the + * payment completes or fails, no idempotency guarantees are made. + * + * You should ensure that the [`Invoice::payment_hash`] is unique and the same [`PaymentHash`] + * has never been paid before. + * + * See [`Self::pay_invoice`] for a variant which uses the [`PaymentHash`] for the idempotency + * token. + */ + public Result_NonePaymentErrorZ pay_invoice_with_id(org.ldk.structs.Invoice invoice, byte[] payment_id) { + long ret = bindings.InvoicePayer_pay_invoice_with_id(this.ptr, invoice == null ? 0 : invoice.ptr, InternalUtils.check_arr_len(payment_id, 32)); + Reference.reachabilityFence(this); + Reference.reachabilityFence(invoice); + Reference.reachabilityFence(payment_id); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NonePaymentErrorZ ret_hu_conv = Result_NonePaymentErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.add(invoice); }; + return ret_hu_conv; + } + /** * Pays the given zero-value [`Invoice`] using the given amount, caching it for later use in * case a retry is needed. * - * You should ensure that the `invoice.payment_hash()` is unique and the same payment_hash has - * never been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so - * for you. + * [`Invoice::payment_hash`] is used as the [`PaymentId`], which ensures idempotency as long + * as the payment is still pending. Once the payment completes or fails, you must ensure that + * a second payment with the same [`PaymentHash`] is never sent. + * + * If you wish to use a different payment idempotency token, see + * [`Self::pay_zero_value_invoice_with_id`]. */ - public Result_PaymentIdPaymentErrorZ pay_zero_value_invoice(Invoice invoice, long amount_msats) { + public Result_PaymentIdPaymentErrorZ pay_zero_value_invoice(org.ldk.structs.Invoice invoice, long amount_msats) { long ret = bindings.InvoicePayer_pay_zero_value_invoice(this.ptr, invoice == null ? 0 : invoice.ptr, amount_msats); Reference.reachabilityFence(this); Reference.reachabilityFence(invoice); @@ -83,12 +113,38 @@ public class InvoicePayer extends CommonBase { return ret_hu_conv; } + /** + * Pays the given zero-value [`Invoice`] using the given amount and custom idempotency key, + * caching the invoice for later use in case a retry is needed. + * + * Note that idempotency is only guaranteed as long as the payment is still pending. Once the + * payment completes or fails, no idempotency guarantees are made. + * + * You should ensure that the [`Invoice::payment_hash`] is unique and the same [`PaymentHash`] + * has never been paid before. + * + * See [`Self::pay_zero_value_invoice`] for a variant which uses the [`PaymentHash`] for the + * idempotency token. + */ + public Result_NonePaymentErrorZ pay_zero_value_invoice_with_id(org.ldk.structs.Invoice invoice, long amount_msats, byte[] payment_id) { + long ret = bindings.InvoicePayer_pay_zero_value_invoice_with_id(this.ptr, invoice == null ? 0 : invoice.ptr, amount_msats, InternalUtils.check_arr_len(payment_id, 32)); + Reference.reachabilityFence(this); + Reference.reachabilityFence(invoice); + Reference.reachabilityFence(amount_msats); + Reference.reachabilityFence(payment_id); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NonePaymentErrorZ ret_hu_conv = Result_NonePaymentErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.add(invoice); }; + return ret_hu_conv; + } + /** * Pays `pubkey` an amount using the hash of the given preimage, caching it for later use in * case a retry is needed. * - * You should ensure that `payment_preimage` is unique and that its `payment_hash` has never - * been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so for you. + * The hash of the [`PaymentPreimage`] is used as the [`PaymentId`], which ensures idempotency + * as long as the payment is still pending. Once the payment completes or fails, you must + * ensure that a second payment with the same [`PaymentPreimage`] is never sent. */ public Result_PaymentIdPaymentErrorZ pay_pubkey(byte[] pubkey, byte[] payment_preimage, long amount_msats, int final_cltv_expiry_delta) { long ret = bindings.InvoicePayer_pay_pubkey(this.ptr, InternalUtils.check_arr_len(pubkey, 33), InternalUtils.check_arr_len(payment_preimage, 32), amount_msats, final_cltv_expiry_delta); @@ -102,6 +158,29 @@ public class InvoicePayer extends CommonBase { return ret_hu_conv; } + /** + * Pays `pubkey` an amount using the hash of the given preimage and a custom idempotency key, + * caching the invoice for later use in case a retry is needed. + * + * Note that idempotency is only guaranteed as long as the payment is still pending. Once the + * payment completes or fails, no idempotency guarantees are made. + * + * You should ensure that the [`PaymentPreimage`] is unique and the corresponding + * [`PaymentHash`] has never been paid before. + */ + public Result_NonePaymentErrorZ pay_pubkey_with_id(byte[] pubkey, byte[] payment_preimage, byte[] payment_id, long amount_msats, int final_cltv_expiry_delta) { + long ret = bindings.InvoicePayer_pay_pubkey_with_id(this.ptr, InternalUtils.check_arr_len(pubkey, 33), InternalUtils.check_arr_len(payment_preimage, 32), InternalUtils.check_arr_len(payment_id, 32), amount_msats, final_cltv_expiry_delta); + Reference.reachabilityFence(this); + Reference.reachabilityFence(pubkey); + Reference.reachabilityFence(payment_preimage); + Reference.reachabilityFence(payment_id); + Reference.reachabilityFence(amount_msats); + Reference.reachabilityFence(final_cltv_expiry_delta); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NonePaymentErrorZ ret_hu_conv = Result_NonePaymentErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + /** * Removes the payment cached by the given payment hash. * diff --git a/src/main/java/org/ldk/structs/InvoiceRequestFeatures.java b/src/main/java/org/ldk/structs/InvoiceRequestFeatures.java new file mode 100644 index 00000000..a36cd855 --- /dev/null +++ b/src/main/java/org/ldk/structs/InvoiceRequestFeatures.java @@ -0,0 +1,99 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * Features used within an `invoice_request`. + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class InvoiceRequestFeatures extends CommonBase { + InvoiceRequestFeatures(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.InvoiceRequestFeatures_free(ptr); } + } + + /** + * Checks if two InvoiceRequestFeaturess contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public boolean eq(org.ldk.structs.InvoiceRequestFeatures b) { + boolean ret = bindings.InvoiceRequestFeatures_eq(this.ptr, b == null ? 0 : b.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(b); + if (this != null) { this.ptrs_to.add(b); }; + return ret; + } + + @Override public boolean equals(Object o) { + if (!(o instanceof InvoiceRequestFeatures)) return false; + return this.eq((InvoiceRequestFeatures)o); + } + long clone_ptr() { + long ret = bindings.InvoiceRequestFeatures_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the InvoiceRequestFeatures + */ + public InvoiceRequestFeatures clone() { + long ret = bindings.InvoiceRequestFeatures_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.InvoiceRequestFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceRequestFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Create a blank Features with no features set + */ + public static InvoiceRequestFeatures empty() { + long ret = bindings.InvoiceRequestFeatures_empty(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.InvoiceRequestFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceRequestFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Returns true if this `Features` object contains unknown feature flags which are set as + * \"required\". + */ + public boolean requires_unknown_bits() { + boolean ret = bindings.InvoiceRequestFeatures_requires_unknown_bits(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Serialize the InvoiceRequestFeatures object into a byte array which can be read by InvoiceRequestFeatures_read + */ + public byte[] write() { + byte[] ret = bindings.InvoiceRequestFeatures_write(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Read a InvoiceRequestFeatures from a byte array, created by InvoiceRequestFeatures_write + */ + public static Result_InvoiceRequestFeaturesDecodeErrorZ read(byte[] ser) { + long ret = bindings.InvoiceRequestFeatures_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceRequestFeaturesDecodeErrorZ ret_hu_conv = Result_InvoiceRequestFeaturesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/InvoiceSignature.java b/src/main/java/org/ldk/structs/InvoiceSignature.java index 3f9c50ad..fee74a17 100644 --- a/src/main/java/org/ldk/structs/InvoiceSignature.java +++ b/src/main/java/org/ldk/structs/InvoiceSignature.java @@ -55,7 +55,7 @@ public class InvoiceSignature extends CommonBase { * 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(InvoiceSignature b) { + public boolean eq(org.ldk.structs.InvoiceSignature b) { boolean ret = bindings.InvoiceSignature_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/KeysInterface.java b/src/main/java/org/ldk/structs/KeysInterface.java index 8a9a4b13..08bc1ac5 100644 --- a/src/main/java/org/ldk/structs/KeysInterface.java +++ b/src/main/java/org/ldk/structs/KeysInterface.java @@ -28,24 +28,24 @@ public class KeysInterface extends CommonBase { /** * Get node secret key based on the provided [`Recipient`]. * - * The node_id/network_key is the public key that corresponds to this secret key. + * The `node_id`/`network_key` is the public key that corresponds to this secret key. * - * This method must return the same value each time it is called with a given `Recipient` + * This method must return the same value each time it is called with a given [`Recipient`] * parameter. * - * Errors if the `Recipient` variant is not supported by the implementation. + * Errors if the [`Recipient`] variant is not supported by the implementation. */ Result_SecretKeyNoneZ get_node_secret(Recipient recipient); /** * Get node id based on the provided [`Recipient`]. This public key corresponds to the secret in * [`get_node_secret`]. * - * This method must return the same value each time it is called with a given `Recipient` + * This method must return the same value each time it is called with a given [`Recipient`] * parameter. * - * Errors if the `Recipient` variant is not supported by the implementation. + * Errors if the [`Recipient`] variant is not supported by the implementation. * - * [`get_node_secret`]: KeysInterface::get_node_secret + * [`get_node_secret`]: Self::get_node_secret */ Result_PublicKeyNoneZ get_node_id(Recipient recipient); /** @@ -53,7 +53,7 @@ public class KeysInterface extends CommonBase { * one is provided. Note that this tweak can be applied to `other_key` instead of our node * secret, though this is less efficient. * - * Errors if the `Recipient` variant is not supported by the implementation. + * Errors if the [`Recipient`] variant is not supported by the implementation. * * [`node secret`]: Self::get_node_secret */ @@ -73,12 +73,21 @@ public class KeysInterface extends CommonBase { */ ShutdownScript get_shutdown_scriptpubkey(); /** - * Get a new set of Sign for per-channel secrets. These MUST be unique even if you + * Get a new set of [`Sign`] for per-channel secrets. These MUST be unique even if you * restarted with some stale data! * * This method must return a different value each time it is called. */ - Sign get_channel_signer(boolean inbound, long channel_value_satoshis); + byte[] generate_channel_keys_id(boolean inbound, long channel_value_satoshis, UInt128 user_channel_id); + /** + * Derives the private key material backing a `Signer`. + * + * To derive a new `Signer`, a fresh `channel_keys_id` should be obtained through + * [`KeysInterface::generate_channel_keys_id`]. Otherwise, an existing `Signer` can be + * re-derived from its `channel_keys_id`, which can be obtained through its trait method + * [`BaseSign::channel_keys_id`]. + */ + Sign derive_channel_signer(long channel_value_satoshis, byte[] channel_keys_id); /** * Gets a unique, cryptographically-secure, random 32 byte value. This is used for encrypting * onion packets and for temporary channel IDs. There is no requirement that these be @@ -88,12 +97,19 @@ public class KeysInterface extends CommonBase { */ byte[] get_secure_random_bytes(); /** - * Reads a `Signer` for this `KeysInterface` from the given input stream. + * Reads a [`Signer`] for this [`KeysInterface`] from the given input stream. * This is only called during deserialization of other objects which contain - * `Sign`-implementing objects (ie `ChannelMonitor`s and `ChannelManager`s). + * [`Sign`]-implementing objects (i.e., [`ChannelMonitor`]s and [`ChannelManager`]s). * The bytes are exactly those which `::write()` writes, and * contain no versioning scheme. You may wish to include your own version prefix and ensure * you've read all of the provided bytes to ensure no corruption occurred. + * + * This method is slowly being phased out -- it will only be called when reading objects + * written by LDK versions prior to 0.0.113. + * + * [`Signer`]: Self::Signer + * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor + * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager */ Result_SignDecodeErrorZ read_chan_signer(byte[] reader); /** @@ -101,11 +117,11 @@ public class KeysInterface extends CommonBase { * By parameterizing by the raw invoice bytes instead of the hash, we allow implementors of * this trait to parse the invoice and make sure they're signing what they expect, rather than * blindly signing the hash. - * The hrp is ascii bytes, while the invoice data is base32. + * The `hrp` is ASCII bytes, while the invoice data is base32-encoded. * * The secret key used to sign the invoice is dependent on the [`Recipient`]. * - * Errors if the `Recipient` variant is not supported by the implementation. + * Errors if the [`Recipient`] variant is not supported by the implementation. */ Result_RecoverableSignatureNoneZ sign_invoice(byte[] hrp_bytes, UInt5[] invoice_data, Recipient receipient); /** @@ -156,8 +172,15 @@ public class KeysInterface extends CommonBase { long result = ret == null ? 0 : ret.clone_ptr(); return result; } - @Override public long get_channel_signer(boolean inbound, long channel_value_satoshis) { - Sign ret = arg.get_channel_signer(inbound, channel_value_satoshis); + @Override public byte[] generate_channel_keys_id(boolean inbound, long channel_value_satoshis, byte[] user_channel_id) { + org.ldk.util.UInt128 user_channel_id_conv = new org.ldk.util.UInt128(user_channel_id); + byte[] ret = arg.generate_channel_keys_id(inbound, channel_value_satoshis, user_channel_id_conv); + Reference.reachabilityFence(arg); + byte[] result = InternalUtils.check_arr_len(ret, 32); + return result; + } + @Override public long derive_channel_signer(long channel_value_satoshis, byte[] channel_keys_id) { + Sign ret = arg.derive_channel_signer(channel_value_satoshis, channel_keys_id); Reference.reachabilityFence(arg); long result = ret == null ? 0 : ret.clone_ptr(); if (impl_holder.held != null) { impl_holder.held.ptrs_to.add(ret); }; @@ -200,12 +223,12 @@ public class KeysInterface extends CommonBase { /** * Get node secret key based on the provided [`Recipient`]. * - * The node_id/network_key is the public key that corresponds to this secret key. + * The `node_id`/`network_key` is the public key that corresponds to this secret key. * - * This method must return the same value each time it is called with a given `Recipient` + * This method must return the same value each time it is called with a given [`Recipient`] * parameter. * - * Errors if the `Recipient` variant is not supported by the implementation. + * Errors if the [`Recipient`] variant is not supported by the implementation. */ public Result_SecretKeyNoneZ get_node_secret(org.ldk.enums.Recipient recipient) { long ret = bindings.KeysInterface_get_node_secret(this.ptr, recipient); @@ -220,12 +243,12 @@ public class KeysInterface extends CommonBase { * Get node id based on the provided [`Recipient`]. This public key corresponds to the secret in * [`get_node_secret`]. * - * This method must return the same value each time it is called with a given `Recipient` + * This method must return the same value each time it is called with a given [`Recipient`] * parameter. * - * Errors if the `Recipient` variant is not supported by the implementation. + * Errors if the [`Recipient`] variant is not supported by the implementation. * - * [`get_node_secret`]: KeysInterface::get_node_secret + * [`get_node_secret`]: Self::get_node_secret */ public Result_PublicKeyNoneZ get_node_id(org.ldk.enums.Recipient recipient) { long ret = bindings.KeysInterface_get_node_id(this.ptr, recipient); @@ -241,11 +264,11 @@ public class KeysInterface extends CommonBase { * one is provided. Note that this tweak can be applied to `other_key` instead of our node * secret, though this is less efficient. * - * Errors if the `Recipient` variant is not supported by the implementation. + * Errors if the [`Recipient`] variant is not supported by the implementation. * * [`node secret`]: Self::get_node_secret */ - public Result_SharedSecretNoneZ ecdh(org.ldk.enums.Recipient recipient, byte[] other_key, Option_ScalarZ tweak) { + public Result_SharedSecretNoneZ ecdh(org.ldk.enums.Recipient recipient, byte[] other_key, org.ldk.structs.Option_ScalarZ tweak) { long ret = bindings.KeysInterface_ecdh(this.ptr, recipient, InternalUtils.check_arr_len(other_key, 33), tweak.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(recipient); @@ -284,16 +307,33 @@ public class KeysInterface extends CommonBase { } /** - * Get a new set of Sign for per-channel secrets. These MUST be unique even if you + * Get a new set of [`Sign`] for per-channel secrets. These MUST be unique even if you * restarted with some stale data! * * This method must return a different value each time it is called. */ - public Sign get_channel_signer(boolean inbound, long channel_value_satoshis) { - long ret = bindings.KeysInterface_get_channel_signer(this.ptr, inbound, channel_value_satoshis); + public byte[] generate_channel_keys_id(boolean inbound, long channel_value_satoshis, org.ldk.util.UInt128 user_channel_id) { + byte[] ret = bindings.KeysInterface_generate_channel_keys_id(this.ptr, inbound, channel_value_satoshis, user_channel_id.getLEBytes()); Reference.reachabilityFence(this); Reference.reachabilityFence(inbound); Reference.reachabilityFence(channel_value_satoshis); + Reference.reachabilityFence(user_channel_id); + return ret; + } + + /** + * Derives the private key material backing a `Signer`. + * + * To derive a new `Signer`, a fresh `channel_keys_id` should be obtained through + * [`KeysInterface::generate_channel_keys_id`]. Otherwise, an existing `Signer` can be + * re-derived from its `channel_keys_id`, which can be obtained through its trait method + * [`BaseSign::channel_keys_id`]. + */ + public Sign derive_channel_signer(long channel_value_satoshis, byte[] channel_keys_id) { + long ret = bindings.KeysInterface_derive_channel_signer(this.ptr, channel_value_satoshis, InternalUtils.check_arr_len(channel_keys_id, 32)); + Reference.reachabilityFence(this); + Reference.reachabilityFence(channel_value_satoshis); + Reference.reachabilityFence(channel_keys_id); if (ret >= 0 && ret <= 4096) { return null; } Sign ret_hu_conv = new Sign(null, ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; @@ -314,12 +354,19 @@ public class KeysInterface extends CommonBase { } /** - * Reads a `Signer` for this `KeysInterface` from the given input stream. + * Reads a [`Signer`] for this [`KeysInterface`] from the given input stream. * This is only called during deserialization of other objects which contain - * `Sign`-implementing objects (ie `ChannelMonitor`s and `ChannelManager`s). + * [`Sign`]-implementing objects (i.e., [`ChannelMonitor`]s and [`ChannelManager`]s). * The bytes are exactly those which `::write()` writes, and * contain no versioning scheme. You may wish to include your own version prefix and ensure * you've read all of the provided bytes to ensure no corruption occurred. + * + * This method is slowly being phased out -- it will only be called when reading objects + * written by LDK versions prior to 0.0.113. + * + * [`Signer`]: Self::Signer + * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor + * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager */ public Result_SignDecodeErrorZ read_chan_signer(byte[] reader) { long ret = bindings.KeysInterface_read_chan_signer(this.ptr, reader); @@ -335,11 +382,11 @@ public class KeysInterface extends CommonBase { * By parameterizing by the raw invoice bytes instead of the hash, we allow implementors of * this trait to parse the invoice and make sure they're signing what they expect, rather than * blindly signing the hash. - * The hrp is ascii bytes, while the invoice data is base32. + * The `hrp` is ASCII bytes, while the invoice data is base32-encoded. * * The secret key used to sign the invoice is dependent on the [`Recipient`]. * - * Errors if the `Recipient` variant is not supported by the implementation. + * Errors if the [`Recipient`] variant is not supported by the implementation. */ public Result_RecoverableSignatureNoneZ sign_invoice(byte[] hrp_bytes, UInt5[] invoice_data, org.ldk.enums.Recipient receipient) { long ret = bindings.KeysInterface_sign_invoice(this.ptr, hrp_bytes, invoice_data != null ? InternalUtils.convUInt5Array(invoice_data) : null, receipient); diff --git a/src/main/java/org/ldk/structs/KeysManager.java b/src/main/java/org/ldk/structs/KeysManager.java index d92016a7..840f8a63 100644 --- a/src/main/java/org/ldk/structs/KeysManager.java +++ b/src/main/java/org/ldk/structs/KeysManager.java @@ -9,12 +9,12 @@ import javax.annotation.Nullable; /** - * Simple KeysInterface implementor that takes a 32-byte seed for use as a BIP 32 extended key - * and derives keys from that. + * Simple [`KeysInterface`] implementation that takes a 32-byte seed for use as a BIP 32 extended + * key and derives keys from that. * - * Your node_id is seed/0' - * ChannelMonitor closes may use seed/1' - * Cooperative closes may use seed/2' + * Your `node_id` is seed/0'. + * Unilateral closes may use seed/1'. + * Cooperative closes may use seed/2'. * The two close keys may be needed to claim on-chain funds! * * This struct cannot be used for nodes that wish to support receiving phantom payments; @@ -33,25 +33,23 @@ public class KeysManager extends CommonBase { } /** - * Constructs a KeysManager from a 32-byte seed. If the seed is in some way biased (eg your - * CSRNG is busted) this may panic (but more importantly, you will possibly lose funds). - * starting_time isn't strictly required to actually be a time, but it must absolutely, + * Constructs a [`KeysManager`] from a 32-byte seed. If the seed is in some way biased (e.g., + * your CSRNG is busted) this may panic (but more importantly, you will possibly lose funds). + * `starting_time` isn't strictly required to actually be a time, but it must absolutely, * without a doubt, be unique to this instance. ie if you start multiple times with the same - * seed, starting_time must be unique to each run. Thus, the easiest way to achieve this is to - * simply use the current time (with very high precision). + * `seed`, `starting_time` must be unique to each run. Thus, the easiest way to achieve this + * is to simply use the current time (with very high precision). * - * The seed MUST be backed up safely prior to use so that the keys can be re-created, however, - * obviously, starting_time should be unique every time you reload the library - it is only + * The `seed` MUST be backed up safely prior to use so that the keys can be re-created, however, + * obviously, `starting_time` should be unique every time you reload the library - it is only * used to generate new ephemeral key data (which will be stored by the individual channel if * necessary). * * Note that the seed is required to recover certain on-chain funds independent of - * ChannelMonitor data, though a current copy of ChannelMonitor data is also required for any - * channel, and some on-chain during-closing funds. + * [`ChannelMonitor`] data, though a current copy of [`ChannelMonitor`] data is also required + * for any channel, and some on-chain during-closing funds. * - * Note that until the 0.1 release there is no guarantee of backward compatibility between - * versions. Once the library is more fully supported, the docs will be updated to include a - * detailed description of the guarantee. + * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor */ public static KeysManager of(byte[] seed, long starting_time_secs, int starting_time_nanos) { long ret = bindings.KeysManager_new(InternalUtils.check_arr_len(seed, 32), starting_time_secs, starting_time_nanos); @@ -65,11 +63,7 @@ public class KeysManager extends CommonBase { } /** - * Derive an old Sign containing per-channel secrets based on a key derivation parameters. - * - * Key derivation parameters are accessible through a per-channel secrets - * Sign::channel_keys_id and is provided inside DynamicOuputP2WSH in case of - * onchain output detection for which a corresponding delayed_payment_key must be derived. + * Derive an old [`Sign`] containing per-channel secrets based on a key derivation parameters. */ public InMemorySigner derive_channel_keys(long channel_value_satoshis, byte[] params) { long ret = bindings.KeysManager_derive_channel_keys(this.ptr, channel_value_satoshis, InternalUtils.check_arr_len(params, 32)); @@ -83,7 +77,7 @@ public class KeysManager extends CommonBase { } /** - * Creates a Transaction which spends the given descriptors to the given outputs, plus an + * Creates a [`Transaction`] which spends the given descriptors to the given outputs, plus an * output to the given change destination (if sufficient change value remains). The * transaction will have a feerate, at least, of the given value. * @@ -93,8 +87,8 @@ public class KeysManager extends CommonBase { * * We do not enforce that outputs meet the dust limit or that any output scripts are standard. * - * May panic if the `SpendableOutputDescriptor`s were not generated by Channels which used - * this KeysManager or one of the `InMemorySigner` created by this KeysManager. + * May panic if the [`SpendableOutputDescriptor`]s were not generated by channels which used + * this [`KeysManager`] or one of the [`InMemorySigner`] created by this [`KeysManager`]. */ public Result_TransactionNoneZ spend_spendable_outputs(SpendableOutputDescriptor[] descriptors, TxOut[] outputs, byte[] change_destination_script, int feerate_sat_per_1000_weight) { long ret = bindings.KeysManager_spend_spendable_outputs(this.ptr, descriptors != null ? Arrays.stream(descriptors).mapToLong(descriptors_conv_27 -> descriptors_conv_27.ptr).toArray() : null, outputs != null ? Arrays.stream(outputs).mapToLong(outputs_conv_7 -> outputs_conv_7.ptr).toArray() : null, change_destination_script, feerate_sat_per_1000_weight); diff --git a/src/main/java/org/ldk/structs/LightningError.java b/src/main/java/org/ldk/structs/LightningError.java index b9e2f991..08beb58d 100644 --- a/src/main/java/org/ldk/structs/LightningError.java +++ b/src/main/java/org/ldk/structs/LightningError.java @@ -53,7 +53,7 @@ public class LightningError extends CommonBase { /** * The action which should be taken against the offending peer. */ - public void set_action(ErrorAction val) { + public void set_action(org.ldk.structs.ErrorAction val) { bindings.LightningError_set_action(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -62,7 +62,7 @@ public class LightningError extends CommonBase { /** * Constructs a new LightningError given each field */ - public static LightningError of(java.lang.String err_arg, ErrorAction action_arg) { + public static LightningError of(java.lang.String err_arg, org.ldk.structs.ErrorAction action_arg) { long ret = bindings.LightningError_new(err_arg, action_arg.ptr); Reference.reachabilityFence(err_arg); Reference.reachabilityFence(action_arg); diff --git a/src/main/java/org/ldk/structs/MessageHandler.java b/src/main/java/org/ldk/structs/MessageHandler.java index aeb3d04f..20d74af3 100644 --- a/src/main/java/org/ldk/structs/MessageHandler.java +++ b/src/main/java/org/ldk/structs/MessageHandler.java @@ -41,7 +41,7 @@ public class MessageHandler extends CommonBase { * * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager */ - public void set_chan_handler(ChannelMessageHandler val) { + public void set_chan_handler(org.ldk.structs.ChannelMessageHandler val) { bindings.MessageHandler_set_chan_handler(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -69,7 +69,7 @@ public class MessageHandler extends CommonBase { * * [`P2PGossipSync`]: crate::routing::gossip::P2PGossipSync */ - public void set_route_handler(RoutingMessageHandler val) { + public void set_route_handler(org.ldk.structs.RoutingMessageHandler val) { bindings.MessageHandler_set_route_handler(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -93,7 +93,7 @@ public class MessageHandler extends CommonBase { * A message handler which handles onion messages. For now, this can only be an * [`IgnoringMessageHandler`]. */ - public void set_onion_message_handler(OnionMessageHandler val) { + public void set_onion_message_handler(org.ldk.structs.OnionMessageHandler val) { bindings.MessageHandler_set_onion_message_handler(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -103,7 +103,7 @@ public class MessageHandler extends CommonBase { /** * Constructs a new MessageHandler given each field */ - public static MessageHandler of(ChannelMessageHandler chan_handler_arg, RoutingMessageHandler route_handler_arg, OnionMessageHandler onion_message_handler_arg) { + public static MessageHandler of(org.ldk.structs.ChannelMessageHandler chan_handler_arg, org.ldk.structs.RoutingMessageHandler route_handler_arg, org.ldk.structs.OnionMessageHandler onion_message_handler_arg) { long ret = bindings.MessageHandler_new(chan_handler_arg == null ? 0 : chan_handler_arg.ptr, route_handler_arg == null ? 0 : route_handler_arg.ptr, onion_message_handler_arg == null ? 0 : onion_message_handler_arg.ptr); Reference.reachabilityFence(chan_handler_arg); Reference.reachabilityFence(route_handler_arg); diff --git a/src/main/java/org/ldk/structs/MessageSendEvent.java b/src/main/java/org/ldk/structs/MessageSendEvent.java index c7be3256..28ba63a5 100644 --- a/src/main/java/org/ldk/structs/MessageSendEvent.java +++ b/src/main/java/org/ldk/structs/MessageSendEvent.java @@ -551,7 +551,7 @@ public class MessageSendEvent extends CommonBase { /** * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent */ - public static MessageSendEvent send_accept_channel(byte[] node_id, AcceptChannel msg) { + public static MessageSendEvent send_accept_channel(byte[] node_id, org.ldk.structs.AcceptChannel msg) { long ret = bindings.MessageSendEvent_send_accept_channel(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(node_id); Reference.reachabilityFence(msg); @@ -565,7 +565,7 @@ public class MessageSendEvent extends CommonBase { /** * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent */ - public static MessageSendEvent send_open_channel(byte[] node_id, OpenChannel msg) { + public static MessageSendEvent send_open_channel(byte[] node_id, org.ldk.structs.OpenChannel msg) { long ret = bindings.MessageSendEvent_send_open_channel(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(node_id); Reference.reachabilityFence(msg); @@ -579,7 +579,7 @@ public class MessageSendEvent extends CommonBase { /** * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent */ - public static MessageSendEvent send_funding_created(byte[] node_id, FundingCreated msg) { + public static MessageSendEvent send_funding_created(byte[] node_id, org.ldk.structs.FundingCreated msg) { long ret = bindings.MessageSendEvent_send_funding_created(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(node_id); Reference.reachabilityFence(msg); @@ -593,7 +593,7 @@ public class MessageSendEvent extends CommonBase { /** * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent */ - public static MessageSendEvent send_funding_signed(byte[] node_id, FundingSigned msg) { + public static MessageSendEvent send_funding_signed(byte[] node_id, org.ldk.structs.FundingSigned msg) { long ret = bindings.MessageSendEvent_send_funding_signed(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(node_id); Reference.reachabilityFence(msg); @@ -607,7 +607,7 @@ public class MessageSendEvent extends CommonBase { /** * Utility method to constructs a new SendChannelReady-variant MessageSendEvent */ - public static MessageSendEvent send_channel_ready(byte[] node_id, ChannelReady msg) { + public static MessageSendEvent send_channel_ready(byte[] node_id, org.ldk.structs.ChannelReady msg) { long ret = bindings.MessageSendEvent_send_channel_ready(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(node_id); Reference.reachabilityFence(msg); @@ -621,7 +621,7 @@ public class MessageSendEvent extends CommonBase { /** * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent */ - public static MessageSendEvent send_announcement_signatures(byte[] node_id, AnnouncementSignatures msg) { + public static MessageSendEvent send_announcement_signatures(byte[] node_id, org.ldk.structs.AnnouncementSignatures msg) { long ret = bindings.MessageSendEvent_send_announcement_signatures(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(node_id); Reference.reachabilityFence(msg); @@ -635,7 +635,7 @@ public class MessageSendEvent extends CommonBase { /** * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent */ - public static MessageSendEvent update_htlcs(byte[] node_id, CommitmentUpdate updates) { + public static MessageSendEvent update_htlcs(byte[] node_id, org.ldk.structs.CommitmentUpdate updates) { long ret = bindings.MessageSendEvent_update_htlcs(InternalUtils.check_arr_len(node_id, 33), updates == null ? 0 : updates.ptr); Reference.reachabilityFence(node_id); Reference.reachabilityFence(updates); @@ -649,7 +649,7 @@ public class MessageSendEvent extends CommonBase { /** * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent */ - public static MessageSendEvent send_revoke_and_ack(byte[] node_id, RevokeAndACK msg) { + public static MessageSendEvent send_revoke_and_ack(byte[] node_id, org.ldk.structs.RevokeAndACK msg) { long ret = bindings.MessageSendEvent_send_revoke_and_ack(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(node_id); Reference.reachabilityFence(msg); @@ -663,7 +663,7 @@ public class MessageSendEvent extends CommonBase { /** * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent */ - public static MessageSendEvent send_closing_signed(byte[] node_id, ClosingSigned msg) { + public static MessageSendEvent send_closing_signed(byte[] node_id, org.ldk.structs.ClosingSigned msg) { long ret = bindings.MessageSendEvent_send_closing_signed(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(node_id); Reference.reachabilityFence(msg); @@ -677,7 +677,7 @@ public class MessageSendEvent extends CommonBase { /** * Utility method to constructs a new SendShutdown-variant MessageSendEvent */ - public static MessageSendEvent send_shutdown(byte[] node_id, Shutdown msg) { + public static MessageSendEvent send_shutdown(byte[] node_id, org.ldk.structs.Shutdown msg) { long ret = bindings.MessageSendEvent_send_shutdown(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(node_id); Reference.reachabilityFence(msg); @@ -691,7 +691,7 @@ public class MessageSendEvent extends CommonBase { /** * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent */ - public static MessageSendEvent send_channel_reestablish(byte[] node_id, ChannelReestablish msg) { + public static MessageSendEvent send_channel_reestablish(byte[] node_id, org.ldk.structs.ChannelReestablish msg) { long ret = bindings.MessageSendEvent_send_channel_reestablish(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(node_id); Reference.reachabilityFence(msg); @@ -705,7 +705,7 @@ public class MessageSendEvent extends CommonBase { /** * Utility method to constructs a new SendChannelAnnouncement-variant MessageSendEvent */ - public static MessageSendEvent send_channel_announcement(byte[] node_id, ChannelAnnouncement msg, ChannelUpdate update_msg) { + public static MessageSendEvent send_channel_announcement(byte[] node_id, org.ldk.structs.ChannelAnnouncement msg, org.ldk.structs.ChannelUpdate update_msg) { long ret = bindings.MessageSendEvent_send_channel_announcement(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr, update_msg == null ? 0 : update_msg.ptr); Reference.reachabilityFence(node_id); Reference.reachabilityFence(msg); @@ -721,7 +721,7 @@ public class MessageSendEvent extends CommonBase { /** * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent */ - public static MessageSendEvent broadcast_channel_announcement(ChannelAnnouncement msg, ChannelUpdate update_msg) { + public static MessageSendEvent broadcast_channel_announcement(org.ldk.structs.ChannelAnnouncement msg, org.ldk.structs.ChannelUpdate update_msg) { long ret = bindings.MessageSendEvent_broadcast_channel_announcement(msg == null ? 0 : msg.ptr, update_msg == null ? 0 : update_msg.ptr); Reference.reachabilityFence(msg); Reference.reachabilityFence(update_msg); @@ -736,7 +736,7 @@ public class MessageSendEvent extends CommonBase { /** * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent */ - public static MessageSendEvent broadcast_channel_update(ChannelUpdate msg) { + public static MessageSendEvent broadcast_channel_update(org.ldk.structs.ChannelUpdate msg) { long ret = bindings.MessageSendEvent_broadcast_channel_update(msg == null ? 0 : msg.ptr); Reference.reachabilityFence(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -749,7 +749,7 @@ public class MessageSendEvent extends CommonBase { /** * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent */ - public static MessageSendEvent send_channel_update(byte[] node_id, ChannelUpdate msg) { + public static MessageSendEvent send_channel_update(byte[] node_id, org.ldk.structs.ChannelUpdate msg) { long ret = bindings.MessageSendEvent_send_channel_update(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(node_id); Reference.reachabilityFence(msg); @@ -763,7 +763,7 @@ public class MessageSendEvent extends CommonBase { /** * Utility method to constructs a new HandleError-variant MessageSendEvent */ - public static MessageSendEvent handle_error(byte[] node_id, ErrorAction action) { + public static MessageSendEvent handle_error(byte[] node_id, org.ldk.structs.ErrorAction action) { long ret = bindings.MessageSendEvent_handle_error(InternalUtils.check_arr_len(node_id, 33), action.ptr); Reference.reachabilityFence(node_id); Reference.reachabilityFence(action); @@ -776,7 +776,7 @@ public class MessageSendEvent extends CommonBase { /** * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent */ - public static MessageSendEvent send_channel_range_query(byte[] node_id, QueryChannelRange msg) { + public static MessageSendEvent send_channel_range_query(byte[] node_id, org.ldk.structs.QueryChannelRange msg) { long ret = bindings.MessageSendEvent_send_channel_range_query(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(node_id); Reference.reachabilityFence(msg); @@ -790,7 +790,7 @@ public class MessageSendEvent extends CommonBase { /** * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent */ - public static MessageSendEvent send_short_ids_query(byte[] node_id, QueryShortChannelIds msg) { + public static MessageSendEvent send_short_ids_query(byte[] node_id, org.ldk.structs.QueryShortChannelIds msg) { long ret = bindings.MessageSendEvent_send_short_ids_query(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(node_id); Reference.reachabilityFence(msg); @@ -804,7 +804,7 @@ public class MessageSendEvent extends CommonBase { /** * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent */ - public static MessageSendEvent send_reply_channel_range(byte[] node_id, ReplyChannelRange msg) { + public static MessageSendEvent send_reply_channel_range(byte[] node_id, org.ldk.structs.ReplyChannelRange msg) { long ret = bindings.MessageSendEvent_send_reply_channel_range(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(node_id); Reference.reachabilityFence(msg); @@ -818,7 +818,7 @@ public class MessageSendEvent extends CommonBase { /** * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent */ - public static MessageSendEvent send_gossip_timestamp_filter(byte[] node_id, GossipTimestampFilter msg) { + public static MessageSendEvent send_gossip_timestamp_filter(byte[] node_id, org.ldk.structs.GossipTimestampFilter msg) { long ret = bindings.MessageSendEvent_send_gossip_timestamp_filter(InternalUtils.check_arr_len(node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(node_id); Reference.reachabilityFence(msg); diff --git a/src/main/java/org/ldk/structs/MinFinalCltvExpiry.java b/src/main/java/org/ldk/structs/MinFinalCltvExpiry.java index 2ce302fb..fcd10f9d 100644 --- a/src/main/java/org/ldk/structs/MinFinalCltvExpiry.java +++ b/src/main/java/org/ldk/structs/MinFinalCltvExpiry.java @@ -79,7 +79,7 @@ public class MinFinalCltvExpiry extends CommonBase { * 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(MinFinalCltvExpiry b) { + public boolean eq(org.ldk.structs.MinFinalCltvExpiry b) { boolean ret = bindings.MinFinalCltvExpiry_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/MonitorEvent.java b/src/main/java/org/ldk/structs/MonitorEvent.java index dec1118f..72564a64 100644 --- a/src/main/java/org/ldk/structs/MonitorEvent.java +++ b/src/main/java/org/ldk/structs/MonitorEvent.java @@ -127,7 +127,7 @@ public class MonitorEvent extends CommonBase { /** * Utility method to constructs a new HTLCEvent-variant MonitorEvent */ - public static MonitorEvent htlcevent(HTLCUpdate a) { + public static MonitorEvent htlcevent(org.ldk.structs.HTLCUpdate a) { long ret = bindings.MonitorEvent_htlcevent(a == null ? 0 : a.ptr); Reference.reachabilityFence(a); if (ret >= 0 && ret <= 4096) { return null; } @@ -140,7 +140,7 @@ public class MonitorEvent extends CommonBase { /** * Utility method to constructs a new CommitmentTxConfirmed-variant MonitorEvent */ - public static MonitorEvent commitment_tx_confirmed(OutPoint a) { + public static MonitorEvent commitment_tx_confirmed(org.ldk.structs.OutPoint a) { long ret = bindings.MonitorEvent_commitment_tx_confirmed(a == null ? 0 : a.ptr); Reference.reachabilityFence(a); if (ret >= 0 && ret <= 4096) { return null; } @@ -153,7 +153,7 @@ public class MonitorEvent extends CommonBase { /** * Utility method to constructs a new Completed-variant MonitorEvent */ - public static MonitorEvent completed(OutPoint funding_txo, long monitor_update_id) { + public static MonitorEvent completed(org.ldk.structs.OutPoint funding_txo, long monitor_update_id) { long ret = bindings.MonitorEvent_completed(funding_txo == null ? 0 : funding_txo.ptr, monitor_update_id); Reference.reachabilityFence(funding_txo); Reference.reachabilityFence(monitor_update_id); @@ -167,7 +167,7 @@ public class MonitorEvent extends CommonBase { /** * Utility method to constructs a new UpdateFailed-variant MonitorEvent */ - public static MonitorEvent update_failed(OutPoint a) { + public static MonitorEvent update_failed(org.ldk.structs.OutPoint a) { long ret = bindings.MonitorEvent_update_failed(a == null ? 0 : a.ptr); Reference.reachabilityFence(a); if (ret >= 0 && ret <= 4096) { return null; } @@ -181,7 +181,7 @@ public class MonitorEvent extends CommonBase { * Checks if two MonitorEvents contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. */ - public boolean eq(MonitorEvent b) { + public boolean eq(org.ldk.structs.MonitorEvent b) { boolean ret = bindings.MonitorEvent_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/MonitorUpdateId.java b/src/main/java/org/ldk/structs/MonitorUpdateId.java index c3dac9e4..267d9786 100644 --- a/src/main/java/org/ldk/structs/MonitorUpdateId.java +++ b/src/main/java/org/ldk/structs/MonitorUpdateId.java @@ -55,7 +55,7 @@ public class MonitorUpdateId extends CommonBase { * 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(MonitorUpdateId b) { + public boolean eq(org.ldk.structs.MonitorUpdateId b) { boolean ret = bindings.MonitorUpdateId_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/MultiThreadedLockableScore.java b/src/main/java/org/ldk/structs/MultiThreadedLockableScore.java index b23d1b40..3a7f2baf 100644 --- a/src/main/java/org/ldk/structs/MultiThreadedLockableScore.java +++ b/src/main/java/org/ldk/structs/MultiThreadedLockableScore.java @@ -58,7 +58,7 @@ public class MultiThreadedLockableScore extends CommonBase { /** * Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`]. */ - public static MultiThreadedLockableScore of(Score score) { + public static MultiThreadedLockableScore of(org.ldk.structs.Score score) { long ret = bindings.MultiThreadedLockableScore_new(score == null ? 0 : score.ptr); Reference.reachabilityFence(score); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/NetAddress.java b/src/main/java/org/ldk/structs/NetAddress.java index f4f729ff..47f94b85 100644 --- a/src/main/java/org/ldk/structs/NetAddress.java +++ b/src/main/java/org/ldk/structs/NetAddress.java @@ -213,7 +213,7 @@ public class NetAddress extends CommonBase { /** * Utility method to constructs a new Hostname-variant NetAddress */ - public static NetAddress hostname(Hostname hostname, short port) { + public static NetAddress hostname(org.ldk.structs.Hostname hostname, short port) { long ret = bindings.NetAddress_hostname(hostname == null ? 0 : hostname.ptr, port); Reference.reachabilityFence(hostname); Reference.reachabilityFence(port); @@ -228,7 +228,7 @@ public class NetAddress extends CommonBase { * Checks if two NetAddresss contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. */ - public boolean eq(NetAddress b) { + public boolean eq(org.ldk.structs.NetAddress b) { boolean ret = bindings.NetAddress_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/NetworkGraph.java b/src/main/java/org/ldk/structs/NetworkGraph.java index e3414f48..ed4027d3 100644 --- a/src/main/java/org/ldk/structs/NetworkGraph.java +++ b/src/main/java/org/ldk/structs/NetworkGraph.java @@ -21,16 +21,14 @@ public class NetworkGraph extends CommonBase { } /** - * 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 + * Handles any network updates originating from [`Event`]s. + * + * [`Event`]: crate::util::events::Event */ - public EventHandler as_EventHandler() { - long ret = bindings.NetworkGraph_as_EventHandler(this.ptr); + public void handle_network_update(org.ldk.structs.NetworkUpdate network_update) { + bindings.NetworkGraph_handle_network_update(this.ptr, network_update == null ? 0 : network_update.ptr); Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - EventHandler ret_hu_conv = new EventHandler(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; - return ret_hu_conv; + Reference.reachabilityFence(network_update); } /** @@ -45,7 +43,7 @@ public class NetworkGraph extends CommonBase { /** * Read a NetworkGraph from a byte array, created by NetworkGraph_write */ - public static Result_NetworkGraphDecodeErrorZ read(byte[] ser, Logger arg) { + public static Result_NetworkGraphDecodeErrorZ read(byte[] ser, org.ldk.structs.Logger arg) { long ret = bindings.NetworkGraph_read(ser, arg == null ? 0 : arg.ptr); Reference.reachabilityFence(ser); Reference.reachabilityFence(arg); @@ -58,7 +56,7 @@ public class NetworkGraph extends CommonBase { /** * Creates a new, empty, network graph. */ - public static NetworkGraph of(byte[] genesis_hash, Logger logger) { + public static NetworkGraph of(byte[] genesis_hash, org.ldk.structs.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); @@ -112,7 +110,7 @@ public class NetworkGraph extends CommonBase { * RoutingMessageHandler implementation to call it indirectly. This may be useful to accept * routing messages from a source using a protocol other than the lightning P2P protocol. */ - public Result_NoneLightningErrorZ update_node_from_announcement(NodeAnnouncement msg) { + public Result_NoneLightningErrorZ update_node_from_announcement(org.ldk.structs.NodeAnnouncement msg) { long ret = bindings.NetworkGraph_update_node_from_announcement(this.ptr, msg == null ? 0 : msg.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(msg); @@ -128,7 +126,7 @@ public class NetworkGraph extends CommonBase { * given the associated signatures here we cannot relay the node announcement to any of our * peers. */ - public Result_NoneLightningErrorZ update_node_from_unsigned_announcement(UnsignedNodeAnnouncement msg) { + public Result_NoneLightningErrorZ update_node_from_unsigned_announcement(org.ldk.structs.UnsignedNodeAnnouncement msg) { long ret = bindings.NetworkGraph_update_node_from_unsigned_announcement(this.ptr, msg == null ? 0 : msg.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(msg); @@ -148,7 +146,7 @@ public class NetworkGraph extends CommonBase { * If a `chain::Access` object is provided via `chain_access`, it will be called to verify * the corresponding UTXO exists on chain and is correctly-formatted. */ - public Result_NoneLightningErrorZ update_channel_from_announcement(ChannelAnnouncement msg, Option_AccessZ chain_access) { + public Result_NoneLightningErrorZ update_channel_from_announcement(org.ldk.structs.ChannelAnnouncement msg, org.ldk.structs.Option_AccessZ chain_access) { long ret = bindings.NetworkGraph_update_channel_from_announcement(this.ptr, msg == null ? 0 : msg.ptr, chain_access.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(msg); @@ -168,7 +166,7 @@ public class NetworkGraph extends CommonBase { * If a `chain::Access` object is provided via `chain_access`, it will be called to verify * the corresponding UTXO exists on chain and is correctly-formatted. */ - public Result_NoneLightningErrorZ update_channel_from_unsigned_announcement(UnsignedChannelAnnouncement msg, Option_AccessZ chain_access) { + public Result_NoneLightningErrorZ update_channel_from_unsigned_announcement(org.ldk.structs.UnsignedChannelAnnouncement msg, org.ldk.structs.Option_AccessZ chain_access) { long ret = bindings.NetworkGraph_update_channel_from_unsigned_announcement(this.ptr, msg == null ? 0 : msg.ptr, chain_access.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(msg); @@ -188,7 +186,7 @@ public class NetworkGraph extends CommonBase { * * 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) { + public Result_NoneLightningErrorZ add_channel_from_partial_announcement(long short_channel_id, long timestamp, org.ldk.structs.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, InternalUtils.check_arr_len(node_id_1, 33), InternalUtils.check_arr_len(node_id_2, 33)); Reference.reachabilityFence(this); Reference.reachabilityFence(short_channel_id); @@ -280,7 +278,7 @@ public class NetworkGraph extends CommonBase { * If built with `no-std`, any updates with a timestamp more than two weeks in the past or * materially in the future will be rejected. */ - public Result_NoneLightningErrorZ update_channel(ChannelUpdate msg) { + public Result_NoneLightningErrorZ update_channel(org.ldk.structs.ChannelUpdate msg) { long ret = bindings.NetworkGraph_update_channel(this.ptr, msg == null ? 0 : msg.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(msg); @@ -298,7 +296,7 @@ public class NetworkGraph extends CommonBase { * If built with `no-std`, any updates with a timestamp more than two weeks in the past or * materially in the future will be rejected. */ - public Result_NoneLightningErrorZ update_channel_unsigned(UnsignedChannelUpdate msg) { + public Result_NoneLightningErrorZ update_channel_unsigned(org.ldk.structs.UnsignedChannelUpdate msg) { long ret = bindings.NetworkGraph_update_channel_unsigned(this.ptr, msg == null ? 0 : msg.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(msg); diff --git a/src/main/java/org/ldk/structs/NetworkUpdate.java b/src/main/java/org/ldk/structs/NetworkUpdate.java index 60d3bfd5..7f4a8251 100644 --- a/src/main/java/org/ldk/structs/NetworkUpdate.java +++ b/src/main/java/org/ldk/structs/NetworkUpdate.java @@ -114,7 +114,7 @@ public class NetworkUpdate extends CommonBase { /** * Utility method to constructs a new ChannelUpdateMessage-variant NetworkUpdate */ - public static NetworkUpdate channel_update_message(ChannelUpdate msg) { + public static NetworkUpdate channel_update_message(org.ldk.structs.ChannelUpdate msg) { long ret = bindings.NetworkUpdate_channel_update_message(msg == null ? 0 : msg.ptr); Reference.reachabilityFence(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -154,7 +154,7 @@ public class NetworkUpdate extends CommonBase { * Checks if two NetworkUpdates contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. */ - public boolean eq(NetworkUpdate b) { + public boolean eq(org.ldk.structs.NetworkUpdate b) { boolean ret = bindings.NetworkUpdate_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/NodeAlias.java b/src/main/java/org/ldk/structs/NodeAlias.java index ca4dbe04..5f4881b9 100644 --- a/src/main/java/org/ldk/structs/NodeAlias.java +++ b/src/main/java/org/ldk/structs/NodeAlias.java @@ -70,7 +70,7 @@ public class NodeAlias extends CommonBase { * 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(NodeAlias b) { + public boolean eq(org.ldk.structs.NodeAlias b) { boolean ret = bindings.NodeAlias_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/NodeAnnouncement.java b/src/main/java/org/ldk/structs/NodeAnnouncement.java index 6f1799e4..e4ed9012 100644 --- a/src/main/java/org/ldk/structs/NodeAnnouncement.java +++ b/src/main/java/org/ldk/structs/NodeAnnouncement.java @@ -53,7 +53,7 @@ public class NodeAnnouncement extends CommonBase { /** * The actual content of the announcement */ - public void set_contents(UnsignedNodeAnnouncement val) { + public void set_contents(org.ldk.structs.UnsignedNodeAnnouncement val) { bindings.NodeAnnouncement_set_contents(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -63,7 +63,7 @@ public class NodeAnnouncement extends CommonBase { /** * Constructs a new NodeAnnouncement given each field */ - public static NodeAnnouncement of(byte[] signature_arg, UnsignedNodeAnnouncement contents_arg) { + public static NodeAnnouncement of(byte[] signature_arg, org.ldk.structs.UnsignedNodeAnnouncement contents_arg) { long ret = bindings.NodeAnnouncement_new(InternalUtils.check_arr_len(signature_arg, 64), contents_arg == null ? 0 : contents_arg.ptr); Reference.reachabilityFence(signature_arg); Reference.reachabilityFence(contents_arg); @@ -97,7 +97,7 @@ public class NodeAnnouncement extends CommonBase { * 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(NodeAnnouncement b) { + public boolean eq(org.ldk.structs.NodeAnnouncement b) { boolean ret = bindings.NodeAnnouncement_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/NodeAnnouncementInfo.java b/src/main/java/org/ldk/structs/NodeAnnouncementInfo.java index ce4fc644..c9765feb 100644 --- a/src/main/java/org/ldk/structs/NodeAnnouncementInfo.java +++ b/src/main/java/org/ldk/structs/NodeAnnouncementInfo.java @@ -35,7 +35,7 @@ public class NodeAnnouncementInfo extends CommonBase { /** * Protocol features the node announced support for */ - public void set_features(NodeFeatures val) { + public void set_features(org.ldk.structs.NodeFeatures val) { bindings.NodeAnnouncementInfo_set_features(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -99,7 +99,7 @@ public class NodeAnnouncementInfo extends CommonBase { * May be invalid or malicious (eg control chars), * should not be exposed to the user. */ - public void set_alias(NodeAlias val) { + public void set_alias(org.ldk.structs.NodeAlias val) { bindings.NodeAnnouncementInfo_set_alias(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -160,7 +160,7 @@ public class NodeAnnouncementInfo extends CommonBase { * * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public void set_announcement_message(@Nullable NodeAnnouncement val) { + public void set_announcement_message(@Nullable org.ldk.structs.NodeAnnouncement val) { bindings.NodeAnnouncementInfo_set_announcement_message(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -170,7 +170,7 @@ public class NodeAnnouncementInfo extends CommonBase { /** * Constructs a new NodeAnnouncementInfo given each field */ - public static NodeAnnouncementInfo of(NodeFeatures features_arg, int last_update_arg, byte[] rgb_arg, NodeAlias alias_arg, NetAddress[] addresses_arg, NodeAnnouncement announcement_message_arg) { + public static NodeAnnouncementInfo of(org.ldk.structs.NodeFeatures features_arg, int last_update_arg, byte[] rgb_arg, org.ldk.structs.NodeAlias alias_arg, NetAddress[] addresses_arg, org.ldk.structs.NodeAnnouncement announcement_message_arg) { long ret = bindings.NodeAnnouncementInfo_new(features_arg == null ? 0 : features_arg.ptr, last_update_arg, InternalUtils.check_arr_len(rgb_arg, 3), alias_arg == null ? 0 : alias_arg.ptr, addresses_arg != null ? Arrays.stream(addresses_arg).mapToLong(addresses_arg_conv_12 -> addresses_arg_conv_12.ptr).toArray() : null, announcement_message_arg == null ? 0 : announcement_message_arg.ptr); Reference.reachabilityFence(features_arg); Reference.reachabilityFence(last_update_arg); @@ -210,7 +210,7 @@ public class NodeAnnouncementInfo extends CommonBase { * 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(NodeAnnouncementInfo b) { + public boolean eq(org.ldk.structs.NodeAnnouncementInfo b) { boolean ret = bindings.NodeAnnouncementInfo_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/NodeFeatures.java b/src/main/java/org/ldk/structs/NodeFeatures.java index 37fd1461..b13f837b 100644 --- a/src/main/java/org/ldk/structs/NodeFeatures.java +++ b/src/main/java/org/ldk/structs/NodeFeatures.java @@ -25,7 +25,7 @@ public class NodeFeatures extends CommonBase { * 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(NodeFeatures b) { + public boolean eq(org.ldk.structs.NodeFeatures b) { boolean ret = bindings.NodeFeatures_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/NodeInfo.java b/src/main/java/org/ldk/structs/NodeInfo.java index 25d73883..69773f31 100644 --- a/src/main/java/org/ldk/structs/NodeInfo.java +++ b/src/main/java/org/ldk/structs/NodeInfo.java @@ -64,7 +64,7 @@ public class NodeInfo extends CommonBase { * * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public void set_lowest_inbound_channel_fees(@Nullable RoutingFees val) { + public void set_lowest_inbound_channel_fees(@Nullable org.ldk.structs.RoutingFees val) { bindings.NodeInfo_set_lowest_inbound_channel_fees(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -95,7 +95,7 @@ public class NodeInfo extends CommonBase { * * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public void set_announcement_info(@Nullable NodeAnnouncementInfo val) { + public void set_announcement_info(@Nullable org.ldk.structs.NodeAnnouncementInfo val) { bindings.NodeInfo_set_announcement_info(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -105,7 +105,7 @@ public class NodeInfo extends CommonBase { /** * Constructs a new NodeInfo given each field */ - public static NodeInfo of(long[] channels_arg, RoutingFees lowest_inbound_channel_fees_arg, NodeAnnouncementInfo announcement_info_arg) { + public static NodeInfo of(long[] channels_arg, org.ldk.structs.RoutingFees lowest_inbound_channel_fees_arg, org.ldk.structs.NodeAnnouncementInfo announcement_info_arg) { long ret = bindings.NodeInfo_new(channels_arg, lowest_inbound_channel_fees_arg == null ? 0 : lowest_inbound_channel_fees_arg.ptr, announcement_info_arg == null ? 0 : announcement_info_arg.ptr); Reference.reachabilityFence(channels_arg); Reference.reachabilityFence(lowest_inbound_channel_fees_arg); @@ -141,7 +141,7 @@ public class NodeInfo extends CommonBase { * 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(NodeInfo b) { + public boolean eq(org.ldk.structs.NodeInfo b) { boolean ret = bindings.NodeInfo_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/OfferFeatures.java b/src/main/java/org/ldk/structs/OfferFeatures.java new file mode 100644 index 00000000..9ff632c9 --- /dev/null +++ b/src/main/java/org/ldk/structs/OfferFeatures.java @@ -0,0 +1,99 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * Features used within an `offer`. + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class OfferFeatures extends CommonBase { + OfferFeatures(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.OfferFeatures_free(ptr); } + } + + /** + * Checks if two OfferFeaturess contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public boolean eq(org.ldk.structs.OfferFeatures b) { + boolean ret = bindings.OfferFeatures_eq(this.ptr, b == null ? 0 : b.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(b); + if (this != null) { this.ptrs_to.add(b); }; + return ret; + } + + @Override public boolean equals(Object o) { + if (!(o instanceof OfferFeatures)) return false; + return this.eq((OfferFeatures)o); + } + long clone_ptr() { + long ret = bindings.OfferFeatures_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the OfferFeatures + */ + public OfferFeatures clone() { + long ret = bindings.OfferFeatures_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OfferFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OfferFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Create a blank Features with no features set + */ + public static OfferFeatures empty() { + long ret = bindings.OfferFeatures_empty(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OfferFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OfferFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Returns true if this `Features` object contains unknown feature flags which are set as + * \"required\". + */ + public boolean requires_unknown_bits() { + boolean ret = bindings.OfferFeatures_requires_unknown_bits(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Serialize the OfferFeatures object into a byte array which can be read by OfferFeatures_read + */ + public byte[] write() { + byte[] ret = bindings.OfferFeatures_write(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Read a OfferFeatures from a byte array, created by OfferFeatures_write + */ + public static Result_OfferFeaturesDecodeErrorZ read(byte[] ser) { + long ret = bindings.OfferFeatures_read(ser); + Reference.reachabilityFence(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OfferFeaturesDecodeErrorZ ret_hu_conv = Result_OfferFeaturesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/OnionMessage.java b/src/main/java/org/ldk/structs/OnionMessage.java index 1c03a6b6..be9ca77d 100644 --- a/src/main/java/org/ldk/structs/OnionMessage.java +++ b/src/main/java/org/ldk/structs/OnionMessage.java @@ -61,7 +61,7 @@ public class OnionMessage extends CommonBase { * 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(OnionMessage b) { + public boolean eq(org.ldk.structs.OnionMessage b) { boolean ret = bindings.OnionMessage_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/OnionMessageContents.java b/src/main/java/org/ldk/structs/OnionMessageContents.java new file mode 100644 index 00000000..f2aba0ee --- /dev/null +++ b/src/main/java/org/ldk/structs/OnionMessageContents.java @@ -0,0 +1,75 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * The contents of an onion message. In the context of offers, this would be the invoice, invoice + * request, or invoice error. + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class OnionMessageContents extends CommonBase { + private OnionMessageContents(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.OnionMessageContents_free(ptr); } + } + static OnionMessageContents constr_from_ptr(long ptr) { + bindings.LDKOnionMessageContents raw_val = bindings.LDKOnionMessageContents_ref_from_ptr(ptr); + if (raw_val.getClass() == bindings.LDKOnionMessageContents.Custom.class) { + return new Custom(ptr, (bindings.LDKOnionMessageContents.Custom)raw_val); + } + assert false; return null; // Unreachable without extending the (internal) bindings interface + } + + /** + * A custom onion message specified by the user. + */ + public final static class Custom extends OnionMessageContents { + public final org.ldk.structs.CustomOnionMessageContents custom; + private Custom(long ptr, bindings.LDKOnionMessageContents.Custom obj) { + super(null, ptr); + long custom = obj.custom; + CustomOnionMessageContents ret_hu_conv = new CustomOnionMessageContents(null, custom); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + this.custom = ret_hu_conv; + } + } + long clone_ptr() { + long ret = bindings.OnionMessageContents_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a copy of the OnionMessageContents + */ + public OnionMessageContents clone() { + long ret = bindings.OnionMessageContents_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OnionMessageContents ret_hu_conv = org.ldk.structs.OnionMessageContents.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new Custom-variant OnionMessageContents + */ + public static OnionMessageContents custom(org.ldk.structs.CustomOnionMessageContents a) { + long ret = bindings.OnionMessageContents_custom(a == null ? 0 : a.ptr); + Reference.reachabilityFence(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OnionMessageContents ret_hu_conv = org.ldk.structs.OnionMessageContents.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/OnionMessageHandler.java b/src/main/java/org/ldk/structs/OnionMessageHandler.java index 13c6ddfd..0fdc68b6 100644 --- a/src/main/java/org/ldk/structs/OnionMessageHandler.java +++ b/src/main/java/org/ldk/structs/OnionMessageHandler.java @@ -110,7 +110,7 @@ public class OnionMessageHandler extends CommonBase { /** * Handle an incoming onion_message message from the given peer. */ - public void handle_onion_message(byte[] peer_node_id, OnionMessage msg) { + public void handle_onion_message(byte[] peer_node_id, org.ldk.structs.OnionMessage msg) { bindings.OnionMessageHandler_handle_onion_message(this.ptr, InternalUtils.check_arr_len(peer_node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(peer_node_id); @@ -126,7 +126,7 @@ public class OnionMessageHandler extends CommonBase { * with us. Implementors should be somewhat conservative about doing so, however, as other * message handlers may still wish to communicate with this peer. */ - public Result_NoneNoneZ peer_connected(byte[] their_node_id, Init init) { + public Result_NoneNoneZ peer_connected(byte[] their_node_id, org.ldk.structs.Init init) { long ret = bindings.OnionMessageHandler_peer_connected(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), init == null ? 0 : init.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(their_node_id); diff --git a/src/main/java/org/ldk/structs/OnionMessenger.java b/src/main/java/org/ldk/structs/OnionMessenger.java index 23faf7ac..a0a81c4d 100644 --- a/src/main/java/org/ldk/structs/OnionMessenger.java +++ b/src/main/java/org/ldk/structs/OnionMessenger.java @@ -22,9 +22,8 @@ import javax.annotation.Nullable; * # use lightning::chain::keysinterface::{InMemorySigner, KeysManager, KeysInterface}; * # use lightning::ln::msgs::DecodeError; * # use lightning::ln::peer_handler::IgnoringMessageHandler; - * # use lightning::onion_message::messenger::{Destination, OnionMessenger}; - * # use lightning::onion_message::packet::CustomOnionMessageContents; - * # use lightning::onion_message::blinded_route::BlindedRoute; + * # use lightning::onion_message::blinded_path::BlindedPath; + * # use lightning::onion_message::messenger::{CustomOnionMessageContents, Destination, OnionMessageContents, OnionMessenger}; * # use lightning::util::logger::{Logger, Record}; * # use lightning::util::ser::{Writeable, Writer}; * # use lightning::io; @@ -65,18 +64,20 @@ import javax.annotation.Nullable; * let intermediate_hops = [hop_node_id1, hop_node_id2]; * let reply_path = None; * # let your_custom_message = YourCustomMessage {}; - * onion_messenger.send_custom_onion_message(&intermediate_hops, Destination::Node(destination_node_id), your_custom_message, reply_path); + * let message = OnionMessageContents::Custom(your_custom_message); + * onion_messenger.send_onion_message(&intermediate_hops, Destination::Node(destination_node_id), message, reply_path); * - * Create a blinded route to yourself, for someone to send an onion message to. + * Create a blinded path to yourself, for someone to send an onion message to. * # let your_node_id = hop_node_id1; * let hops = [hop_node_id3, hop_node_id4, your_node_id]; - * let blinded_route = BlindedRoute::new(&hops, &keys_manager, &secp_ctx).unwrap(); + * let blinded_path = BlindedPath::new(&hops, &keys_manager, &secp_ctx).unwrap(); * - * Send a custom onion message to a blinded route. + * Send a custom onion message to a blinded path. * # let intermediate_hops = [hop_node_id1, hop_node_id2]; * let reply_path = None; * # let your_custom_message = YourCustomMessage {}; - * onion_messenger.send_custom_onion_message(&intermediate_hops, Destination::BlindedRoute(blinded_route), your_custom_message, reply_path); + * let message = OnionMessageContents::Custom(your_custom_message); + * onion_messenger.send_onion_message(&intermediate_hops, Destination::BlindedPath(blinded_path), message, reply_path); * ``` * * [offers]: @@ -95,7 +96,7 @@ public class OnionMessenger extends CommonBase { * Constructs a new `OnionMessenger` to send, forward, and delegate received onion messages to * their respective handlers. */ - public static OnionMessenger of(KeysInterface keys_manager, Logger logger, CustomOnionMessageHandler custom_handler) { + public static OnionMessenger of(org.ldk.structs.KeysInterface keys_manager, org.ldk.structs.Logger logger, org.ldk.structs.CustomOnionMessageHandler custom_handler) { long ret = bindings.OnionMessenger_new(keys_manager == null ? 0 : keys_manager.ptr, logger == null ? 0 : logger.ptr, custom_handler == null ? 0 : custom_handler.ptr); Reference.reachabilityFence(keys_manager); Reference.reachabilityFence(logger); @@ -115,16 +116,15 @@ public class OnionMessenger extends CommonBase { * * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public Result_NoneSendErrorZ send_custom_onion_message(byte[][] intermediate_nodes, Destination destination, CustomOnionMessageContents msg, @Nullable BlindedRoute reply_path) { - long ret = bindings.OnionMessenger_send_custom_onion_message(this.ptr, intermediate_nodes != null ? Arrays.stream(intermediate_nodes).map(intermediate_nodes_conv_8 -> InternalUtils.check_arr_len(intermediate_nodes_conv_8, 33)).toArray(byte[][]::new) : null, destination.ptr, msg == null ? 0 : msg.ptr, reply_path == null ? 0 : reply_path.ptr); + public Result_NoneSendErrorZ send_onion_message(byte[][] intermediate_nodes, org.ldk.structs.Destination destination, org.ldk.structs.OnionMessageContents message, @Nullable org.ldk.structs.BlindedPath reply_path) { + long ret = bindings.OnionMessenger_send_onion_message(this.ptr, intermediate_nodes != null ? Arrays.stream(intermediate_nodes).map(intermediate_nodes_conv_8 -> InternalUtils.check_arr_len(intermediate_nodes_conv_8, 33)).toArray(byte[][]::new) : null, destination.ptr, message.ptr, reply_path == null ? 0 : reply_path.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(intermediate_nodes); Reference.reachabilityFence(destination); - Reference.reachabilityFence(msg); + Reference.reachabilityFence(message); Reference.reachabilityFence(reply_path); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneSendErrorZ ret_hu_conv = Result_NoneSendErrorZ.constr_from_ptr(ret); - if (this != null) { this.ptrs_to.add(msg); }; if (this != null) { this.ptrs_to.add(reply_path); }; 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 dab4f591..cf1289c8 100644 --- a/src/main/java/org/ldk/structs/OpenChannel.java +++ b/src/main/java/org/ldk/structs/OpenChannel.java @@ -368,7 +368,7 @@ public class OpenChannel extends CommonBase { * * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public void set_channel_type(@Nullable ChannelTypeFeatures val) { + public void set_channel_type(@Nullable org.ldk.structs.ChannelTypeFeatures val) { bindings.OpenChannel_set_channel_type(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -398,7 +398,7 @@ public class OpenChannel extends CommonBase { * 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(OpenChannel b) { + public boolean eq(org.ldk.structs.OpenChannel b) { boolean ret = bindings.OpenChannel_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/Option_AccessZ.java b/src/main/java/org/ldk/structs/Option_AccessZ.java index ca16eb5d..e19784ac 100644 --- a/src/main/java/org/ldk/structs/Option_AccessZ.java +++ b/src/main/java/org/ldk/structs/Option_AccessZ.java @@ -54,7 +54,7 @@ public class Option_AccessZ extends CommonBase { /** * Constructs a new COption_AccessZ containing a crate::lightning::chain::Access */ - public static Option_AccessZ some(Access o) { + public static Option_AccessZ some(org.ldk.structs.Access o) { long ret = bindings.COption_AccessZ_some(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Option_C2Tuple_u64u64ZZ.java b/src/main/java/org/ldk/structs/Option_C2Tuple_u64u64ZZ.java index cd24dca9..c8ba0da5 100644 --- a/src/main/java/org/ldk/structs/Option_C2Tuple_u64u64ZZ.java +++ b/src/main/java/org/ldk/structs/Option_C2Tuple_u64u64ZZ.java @@ -54,7 +54,7 @@ public class Option_C2Tuple_u64u64ZZ extends CommonBase { /** * Constructs a new COption_C2Tuple_u64u64ZZ containing a crate::c_types::derived::C2Tuple_u64u64Z */ - public static Option_C2Tuple_u64u64ZZ some(TwoTuple_u64u64Z o) { + public static Option_C2Tuple_u64u64ZZ some(org.ldk.structs.TwoTuple_u64u64Z o) { long ret = bindings.COption_C2Tuple_u64u64ZZ_some(o != null ? o.ptr : 0); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ.java b/src/main/java/org/ldk/structs/Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ.java index 6b3443e7..4e9f8d38 100644 --- a/src/main/java/org/ldk/structs/Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ.java +++ b/src/main/java/org/ldk/structs/Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ.java @@ -54,7 +54,7 @@ public class Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ exte /** * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ */ - public static Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ some(ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ o) { + public static Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ some(org.ldk.structs.ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ o) { long ret = bindings.COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some(o != null ? o.ptr : 0); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Option_ClosureReasonZ.java b/src/main/java/org/ldk/structs/Option_ClosureReasonZ.java index 8d4cc1e0..ffd496ec 100644 --- a/src/main/java/org/ldk/structs/Option_ClosureReasonZ.java +++ b/src/main/java/org/ldk/structs/Option_ClosureReasonZ.java @@ -54,7 +54,7 @@ public class Option_ClosureReasonZ extends CommonBase { /** * Constructs a new COption_ClosureReasonZ containing a crate::lightning::util::events::ClosureReason */ - public static Option_ClosureReasonZ some(ClosureReason o) { + public static Option_ClosureReasonZ some(org.ldk.structs.ClosureReason o) { long ret = bindings.COption_ClosureReasonZ_some(o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Option_CustomOnionMessageContentsZ.java b/src/main/java/org/ldk/structs/Option_CustomOnionMessageContentsZ.java index 021b346e..a7254c11 100644 --- a/src/main/java/org/ldk/structs/Option_CustomOnionMessageContentsZ.java +++ b/src/main/java/org/ldk/structs/Option_CustomOnionMessageContentsZ.java @@ -54,7 +54,7 @@ public class Option_CustomOnionMessageContentsZ extends CommonBase { /** * Constructs a new COption_CustomOnionMessageContentsZ containing a crate::lightning::onion_message::packet::CustomOnionMessageContents */ - public static Option_CustomOnionMessageContentsZ some(CustomOnionMessageContents o) { + public static Option_CustomOnionMessageContentsZ some(org.ldk.structs.CustomOnionMessageContents o) { long ret = bindings.COption_CustomOnionMessageContentsZ_some(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Option_EventZ.java b/src/main/java/org/ldk/structs/Option_EventZ.java index bdeaae22..450406b4 100644 --- a/src/main/java/org/ldk/structs/Option_EventZ.java +++ b/src/main/java/org/ldk/structs/Option_EventZ.java @@ -54,7 +54,7 @@ public class Option_EventZ extends CommonBase { /** * Constructs a new COption_EventZ containing a crate::lightning::util::events::Event */ - public static Option_EventZ some(Event o) { + public static Option_EventZ some(org.ldk.structs.Event o) { long ret = bindings.COption_EventZ_some(o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Option_FilterZ.java b/src/main/java/org/ldk/structs/Option_FilterZ.java index 36a88ce3..279be2f2 100644 --- a/src/main/java/org/ldk/structs/Option_FilterZ.java +++ b/src/main/java/org/ldk/structs/Option_FilterZ.java @@ -54,7 +54,7 @@ public class Option_FilterZ extends CommonBase { /** * Constructs a new COption_FilterZ containing a crate::lightning::chain::Filter */ - public static Option_FilterZ some(Filter o) { + public static Option_FilterZ some(org.ldk.structs.Filter o) { long ret = bindings.COption_FilterZ_some(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Option_HTLCClaimZ.java b/src/main/java/org/ldk/structs/Option_HTLCClaimZ.java new file mode 100644 index 00000000..07c629d8 --- /dev/null +++ b/src/main/java/org/ldk/structs/Option_HTLCClaimZ.java @@ -0,0 +1,74 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * An enum which can either contain a crate::lightning::ln::chan_utils::HTLCClaim or not + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Option_HTLCClaimZ extends CommonBase { + private Option_HTLCClaimZ(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.COption_HTLCClaimZ_free(ptr); } + } + static Option_HTLCClaimZ constr_from_ptr(long ptr) { + bindings.LDKCOption_HTLCClaimZ raw_val = bindings.LDKCOption_HTLCClaimZ_ref_from_ptr(ptr); + if (raw_val.getClass() == bindings.LDKCOption_HTLCClaimZ.Some.class) { + return new Some(ptr, (bindings.LDKCOption_HTLCClaimZ.Some)raw_val); + } + if (raw_val.getClass() == bindings.LDKCOption_HTLCClaimZ.None.class) { + return new None(ptr, (bindings.LDKCOption_HTLCClaimZ.None)raw_val); + } + assert false; return null; // Unreachable without extending the (internal) bindings interface + } + + /** + * When we're in this state, this COption_HTLCClaimZ contains a crate::lightning::ln::chan_utils::HTLCClaim + */ + public final static class Some extends Option_HTLCClaimZ { + public final org.ldk.enums.HTLCClaim some; + private Some(long ptr, bindings.LDKCOption_HTLCClaimZ.Some obj) { + super(null, ptr); + this.some = obj.some; + } + } + /** + * When we're in this state, this COption_HTLCClaimZ contains nothing + */ + public final static class None extends Option_HTLCClaimZ { + private None(long ptr, bindings.LDKCOption_HTLCClaimZ.None obj) { + super(null, ptr); + } + } + /** + * Constructs a new COption_HTLCClaimZ containing a crate::lightning::ln::chan_utils::HTLCClaim + */ + public static Option_HTLCClaimZ some(org.ldk.enums.HTLCClaim o) { + long ret = bindings.COption_HTLCClaimZ_some(o); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_HTLCClaimZ ret_hu_conv = org.ldk.structs.Option_HTLCClaimZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Constructs a new COption_HTLCClaimZ containing nothing + */ + public static Option_HTLCClaimZ none() { + long ret = bindings.COption_HTLCClaimZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_HTLCClaimZ ret_hu_conv = org.ldk.structs.Option_HTLCClaimZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Option_HTLCDestinationZ.java b/src/main/java/org/ldk/structs/Option_HTLCDestinationZ.java index fb887227..30567637 100644 --- a/src/main/java/org/ldk/structs/Option_HTLCDestinationZ.java +++ b/src/main/java/org/ldk/structs/Option_HTLCDestinationZ.java @@ -54,7 +54,7 @@ public class Option_HTLCDestinationZ extends CommonBase { /** * Constructs a new COption_HTLCDestinationZ containing a crate::lightning::util::events::HTLCDestination */ - public static Option_HTLCDestinationZ some(HTLCDestination o) { + public static Option_HTLCDestinationZ some(org.ldk.structs.HTLCDestination o) { long ret = bindings.COption_HTLCDestinationZ_some(o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Option_MonitorEventZ.java b/src/main/java/org/ldk/structs/Option_MonitorEventZ.java index defc35b6..b2fa91a8 100644 --- a/src/main/java/org/ldk/structs/Option_MonitorEventZ.java +++ b/src/main/java/org/ldk/structs/Option_MonitorEventZ.java @@ -54,7 +54,7 @@ public class Option_MonitorEventZ extends CommonBase { /** * Constructs a new COption_MonitorEventZ containing a crate::lightning::chain::channelmonitor::MonitorEvent */ - public static Option_MonitorEventZ some(MonitorEvent o) { + public static Option_MonitorEventZ some(org.ldk.structs.MonitorEvent o) { long ret = bindings.COption_MonitorEventZ_some(o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Option_NetAddressZ.java b/src/main/java/org/ldk/structs/Option_NetAddressZ.java index d34a74e9..e1bca693 100644 --- a/src/main/java/org/ldk/structs/Option_NetAddressZ.java +++ b/src/main/java/org/ldk/structs/Option_NetAddressZ.java @@ -54,7 +54,7 @@ public class Option_NetAddressZ extends CommonBase { /** * Constructs a new COption_NetAddressZ containing a crate::lightning::ln::msgs::NetAddress */ - public static Option_NetAddressZ some(NetAddress o) { + public static Option_NetAddressZ some(org.ldk.structs.NetAddress o) { long ret = bindings.COption_NetAddressZ_some(o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Option_NetworkUpdateZ.java b/src/main/java/org/ldk/structs/Option_NetworkUpdateZ.java index fb7e6f12..fbee2dc3 100644 --- a/src/main/java/org/ldk/structs/Option_NetworkUpdateZ.java +++ b/src/main/java/org/ldk/structs/Option_NetworkUpdateZ.java @@ -54,7 +54,7 @@ public class Option_NetworkUpdateZ extends CommonBase { /** * Constructs a new COption_NetworkUpdateZ containing a crate::lightning::routing::gossip::NetworkUpdate */ - public static Option_NetworkUpdateZ some(NetworkUpdate o) { + public static Option_NetworkUpdateZ some(org.ldk.structs.NetworkUpdate o) { long ret = bindings.COption_NetworkUpdateZ_some(o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Option_TypeZ.java b/src/main/java/org/ldk/structs/Option_TypeZ.java index fb0e5986..e71c9224 100644 --- a/src/main/java/org/ldk/structs/Option_TypeZ.java +++ b/src/main/java/org/ldk/structs/Option_TypeZ.java @@ -54,7 +54,7 @@ public class Option_TypeZ extends CommonBase { /** * Constructs a new COption_TypeZ containing a crate::lightning::ln::wire::Type */ - public static Option_TypeZ some(Type o) { + public static Option_TypeZ some(org.ldk.structs.Type o) { long ret = bindings.COption_TypeZ_some(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Option_WriteableScoreZ.java b/src/main/java/org/ldk/structs/Option_WriteableScoreZ.java index 4310e16e..7ed1adf1 100644 --- a/src/main/java/org/ldk/structs/Option_WriteableScoreZ.java +++ b/src/main/java/org/ldk/structs/Option_WriteableScoreZ.java @@ -54,7 +54,7 @@ public class Option_WriteableScoreZ extends CommonBase { /** * Constructs a new COption_WriteableScoreZ containing a crate::lightning::routing::scoring::WriteableScore */ - public static Option_WriteableScoreZ some(WriteableScore o) { + public static Option_WriteableScoreZ some(org.ldk.structs.WriteableScore o) { long ret = bindings.COption_WriteableScoreZ_some(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Option_u128Z.java b/src/main/java/org/ldk/structs/Option_u128Z.java new file mode 100644 index 00000000..43b28077 --- /dev/null +++ b/src/main/java/org/ldk/structs/Option_u128Z.java @@ -0,0 +1,95 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * An enum which can either contain a crate::c_types::U128 or not + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class Option_u128Z extends CommonBase { + private Option_u128Z(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.COption_u128Z_free(ptr); } + } + static Option_u128Z constr_from_ptr(long ptr) { + bindings.LDKCOption_u128Z raw_val = bindings.LDKCOption_u128Z_ref_from_ptr(ptr); + if (raw_val.getClass() == bindings.LDKCOption_u128Z.Some.class) { + return new Some(ptr, (bindings.LDKCOption_u128Z.Some)raw_val); + } + if (raw_val.getClass() == bindings.LDKCOption_u128Z.None.class) { + return new None(ptr, (bindings.LDKCOption_u128Z.None)raw_val); + } + assert false; return null; // Unreachable without extending the (internal) bindings interface + } + + /** + * When we're in this state, this COption_u128Z contains a crate::c_types::U128 + */ + public final static class Some extends Option_u128Z { + public final org.ldk.util.UInt128 some; + private Some(long ptr, bindings.LDKCOption_u128Z.Some obj) { + super(null, ptr); + byte[] some = obj.some; + org.ldk.util.UInt128 some_conv = new org.ldk.util.UInt128(some); + this.some = some_conv; + } + } + /** + * When we're in this state, this COption_u128Z contains nothing + */ + public final static class None extends Option_u128Z { + private None(long ptr, bindings.LDKCOption_u128Z.None obj) { + super(null, ptr); + } + } + /** + * Constructs a new COption_u128Z containing a crate::c_types::U128 + */ + public static Option_u128Z some(org.ldk.util.UInt128 o) { + long ret = bindings.COption_u128Z_some(o.getLEBytes()); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_u128Z ret_hu_conv = org.ldk.structs.Option_u128Z.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Constructs a new COption_u128Z containing nothing + */ + public static Option_u128Z none() { + long ret = bindings.COption_u128Z_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_u128Z ret_hu_conv = org.ldk.structs.Option_u128Z.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + long clone_ptr() { + long ret = bindings.COption_u128Z_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new COption_u128Z which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_u128Z clone() { + long ret = bindings.COption_u128Z_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_u128Z ret_hu_conv = org.ldk.structs.Option_u128Z.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/OutPoint.java b/src/main/java/org/ldk/structs/OutPoint.java index 0916e022..c7b7fbf9 100644 --- a/src/main/java/org/ldk/structs/OutPoint.java +++ b/src/main/java/org/ldk/structs/OutPoint.java @@ -95,7 +95,7 @@ public class OutPoint extends CommonBase { * 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(OutPoint b) { + public boolean eq(org.ldk.structs.OutPoint b) { boolean ret = bindings.OutPoint_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/P2PGossipSync.java b/src/main/java/org/ldk/structs/P2PGossipSync.java index 0e068a41..0e4f8ed2 100644 --- a/src/main/java/org/ldk/structs/P2PGossipSync.java +++ b/src/main/java/org/ldk/structs/P2PGossipSync.java @@ -14,9 +14,6 @@ import javax.annotation.Nullable; * This network graph is then used for routing payments. * Provides interface to help with initial routing sync by * serving historical announcements. - * - * Serves as an [`EventHandler`] for applying updates from [`Event::PaymentPathFailed`] to the - * [`NetworkGraph`]. */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class P2PGossipSync extends CommonBase { @@ -34,7 +31,7 @@ public class P2PGossipSync extends CommonBase { * channel data is correct, and that the announcement is signed with * channel owners' keys. */ - public static P2PGossipSync of(NetworkGraph network_graph, Option_AccessZ chain_access, Logger logger) { + public static P2PGossipSync of(org.ldk.structs.NetworkGraph network_graph, org.ldk.structs.Option_AccessZ chain_access, org.ldk.structs.Logger logger) { long ret = bindings.P2PGossipSync_new(network_graph == null ? 0 : network_graph.ptr, chain_access.ptr, logger == null ? 0 : logger.ptr); Reference.reachabilityFence(network_graph); Reference.reachabilityFence(chain_access); @@ -53,7 +50,7 @@ public class P2PGossipSync extends CommonBase { * existing announcements unless they are updated. * Add, update or remove the provider would replace the current one. */ - public void add_chain_access(Option_AccessZ chain_access) { + public void add_chain_access(org.ldk.structs.Option_AccessZ chain_access) { bindings.P2PGossipSync_add_chain_access(this.ptr, chain_access.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(chain_access); diff --git a/src/main/java/org/ldk/structs/ParseError.java b/src/main/java/org/ldk/structs/ParseError.java index 4fcdc2a7..17ac2417 100644 --- a/src/main/java/org/ldk/structs/ParseError.java +++ b/src/main/java/org/ldk/structs/ParseError.java @@ -211,7 +211,7 @@ public class ParseError extends CommonBase { /** * Utility method to constructs a new Bech32Error-variant ParseError */ - public static ParseError bech32_error(Bech32Error a) { + public static ParseError bech32_error(org.ldk.structs.Bech32Error a) { long ret = bindings.ParseError_bech32_error(a.ptr); Reference.reachabilityFence(a); if (ret >= 0 && ret <= 4096) { return null; } @@ -223,7 +223,7 @@ public class ParseError extends CommonBase { /** * Utility method to constructs a new ParseAmountError-variant ParseError */ - public static ParseError parse_amount_error(UnqualifiedError a) { + public static ParseError parse_amount_error(org.ldk.util.UnqualifiedError a) { long ret = bindings.ParseError_parse_amount_error(0); Reference.reachabilityFence(a); if (ret >= 0 && ret <= 4096) { return null; } @@ -313,7 +313,7 @@ public class ParseError extends CommonBase { /** * Utility method to constructs a new DescriptionDecodeError-variant ParseError */ - public static ParseError description_decode_error(UnqualifiedError a) { + public static ParseError description_decode_error(org.ldk.util.UnqualifiedError a) { long ret = bindings.ParseError_description_decode_error(0); Reference.reachabilityFence(a); if (ret >= 0 && ret <= 4096) { return null; } @@ -415,7 +415,7 @@ public class ParseError extends CommonBase { * Checks if two ParseErrors contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. */ - public boolean eq(ParseError b) { + public boolean eq(org.ldk.structs.ParseError b) { boolean ret = bindings.ParseError_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/ParseOrSemanticError.java b/src/main/java/org/ldk/structs/ParseOrSemanticError.java index a6f4efe3..65155cae 100644 --- a/src/main/java/org/ldk/structs/ParseOrSemanticError.java +++ b/src/main/java/org/ldk/structs/ParseOrSemanticError.java @@ -76,7 +76,7 @@ public class ParseOrSemanticError extends CommonBase { /** * Utility method to constructs a new ParseError-variant ParseOrSemanticError */ - public static ParseOrSemanticError parse_error(ParseError a) { + public static ParseOrSemanticError parse_error(org.ldk.structs.ParseError a) { long ret = bindings.ParseOrSemanticError_parse_error(a.ptr); Reference.reachabilityFence(a); if (ret >= 0 && ret <= 4096) { return null; } @@ -101,7 +101,7 @@ public class ParseOrSemanticError extends CommonBase { * Checks if two ParseOrSemanticErrors contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. */ - public boolean eq(ParseOrSemanticError b) { + public boolean eq(org.ldk.structs.ParseOrSemanticError b) { boolean ret = bindings.ParseOrSemanticError_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/PayeePubKey.java b/src/main/java/org/ldk/structs/PayeePubKey.java index 8494ebcc..7fb02575 100644 --- a/src/main/java/org/ldk/structs/PayeePubKey.java +++ b/src/main/java/org/ldk/structs/PayeePubKey.java @@ -79,7 +79,7 @@ public class PayeePubKey extends CommonBase { * 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(PayeePubKey b) { + public boolean eq(org.ldk.structs.PayeePubKey b) { boolean ret = bindings.PayeePubKey_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/Payer.java b/src/main/java/org/ldk/structs/Payer.java index 8cefcd05..206d184d 100644 --- a/src/main/java/org/ldk/structs/Payer.java +++ b/src/main/java/org/ldk/structs/Payer.java @@ -9,6 +9,18 @@ import javax.annotation.Nullable; /** * A trait defining behavior of an [`Invoice`] payer. + * + * While the behavior of [`InvoicePayer`] provides idempotency of duplicate `send_*payment` calls + * with the same [`PaymentHash`], it is up to the `Payer` to provide idempotency across restarts. + * + * [`ChannelManager`] provides idempotency for duplicate payments with the same [`PaymentId`]. + * + * In order to trivially ensure idempotency for payments, the default `Payer` implementation + * reuses the [`PaymentHash`] bytes as the [`PaymentId`]. Custom implementations wishing to + * provide payment idempotency with a different idempotency key (i.e. [`PaymentId`]) should map + * the [`Invoice`] or spontaneous payment target pubkey to their own idempotency key. + * + * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Payer extends CommonBase { @@ -38,11 +50,11 @@ public class Payer extends CommonBase { * * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None */ - Result_PaymentIdPaymentSendFailureZ send_payment(Route route, byte[] payment_hash, byte[] payment_secret); + Result_NonePaymentSendFailureZ send_payment(Route route, byte[] payment_hash, byte[] payment_secret, byte[] payment_id); /** * Sends a spontaneous payment over the Lightning Network using the given [`Route`]. */ - Result_PaymentIdPaymentSendFailureZ send_spontaneous_payment(Route route, byte[] payment_preimage); + Result_NonePaymentSendFailureZ send_spontaneous_payment(Route route, byte[] payment_preimage, byte[] payment_id); /** * Retries a failed payment path for the [`PaymentId`] using the given [`Route`]. */ @@ -51,6 +63,11 @@ public class Payer extends CommonBase { * Signals that no further retries for the given payment will occur. */ void abandon_payment(byte[] payment_id); + /** + * Construct an [`InFlightHtlcs`] containing information about currently used up liquidity + * across payments. + */ + InFlightHtlcs inflight_htlcs(); } private static class LDKPayerHolder { Payer held; } public static Payer new_impl(PayerInterface arg) { @@ -68,16 +85,16 @@ public class Payer extends CommonBase { long[] result = ret != null ? Arrays.stream(ret).mapToLong(ret_conv_16 -> ret_conv_16 == null ? 0 : ret_conv_16.clone_ptr()).toArray() : null; return result; } - @Override public long send_payment(long route, byte[] payment_hash, byte[] payment_secret) { + @Override public long send_payment(long route, byte[] payment_hash, byte[] payment_secret, byte[] payment_id) { 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); + Result_NonePaymentSendFailureZ ret = arg.send_payment(route_hu_conv, payment_hash, payment_secret, payment_id); Reference.reachabilityFence(arg); long result = ret == null ? 0 : ret.clone_ptr(); return result; } - @Override public long send_spontaneous_payment(long route, byte[] payment_preimage) { + @Override public long send_spontaneous_payment(long route, byte[] payment_preimage, byte[] payment_id) { 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); + Result_NonePaymentSendFailureZ ret = arg.send_spontaneous_payment(route_hu_conv, payment_preimage, payment_id); Reference.reachabilityFence(arg); long result = ret == null ? 0 : ret.clone_ptr(); return result; @@ -93,6 +110,12 @@ public class Payer extends CommonBase { arg.abandon_payment(payment_id); Reference.reachabilityFence(arg); } + @Override public long inflight_htlcs() { + InFlightHtlcs ret = arg.inflight_htlcs(); + Reference.reachabilityFence(arg); + long result = ret == null ? 0 : ret.clone_ptr(); + return result; + } }); return impl_holder.held; } @@ -127,14 +150,15 @@ public class Payer extends CommonBase { * * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public Result_PaymentIdPaymentSendFailureZ send_payment(Route route, byte[] payment_hash, @Nullable byte[] payment_secret) { - long ret = bindings.Payer_send_payment(this.ptr, route == null ? 0 : route.ptr, InternalUtils.check_arr_len(payment_hash, 32), InternalUtils.check_arr_len(payment_secret, 32)); + public Result_NonePaymentSendFailureZ send_payment(org.ldk.structs.Route route, byte[] payment_hash, @Nullable byte[] payment_secret, byte[] payment_id) { + long ret = bindings.Payer_send_payment(this.ptr, route == null ? 0 : route.ptr, InternalUtils.check_arr_len(payment_hash, 32), InternalUtils.check_arr_len(payment_secret, 32), InternalUtils.check_arr_len(payment_id, 32)); Reference.reachabilityFence(this); Reference.reachabilityFence(route); Reference.reachabilityFence(payment_hash); Reference.reachabilityFence(payment_secret); + Reference.reachabilityFence(payment_id); if (ret >= 0 && ret <= 4096) { return null; } - Result_PaymentIdPaymentSendFailureZ ret_hu_conv = Result_PaymentIdPaymentSendFailureZ.constr_from_ptr(ret); + Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.add(route); }; return ret_hu_conv; } @@ -142,13 +166,14 @@ public class Payer extends CommonBase { /** * Sends a spontaneous payment over the Lightning Network using the given [`Route`]. */ - public Result_PaymentIdPaymentSendFailureZ send_spontaneous_payment(Route route, byte[] payment_preimage) { - long ret = bindings.Payer_send_spontaneous_payment(this.ptr, route == null ? 0 : route.ptr, InternalUtils.check_arr_len(payment_preimage, 32)); + public Result_NonePaymentSendFailureZ send_spontaneous_payment(org.ldk.structs.Route route, byte[] payment_preimage, byte[] payment_id) { + long ret = bindings.Payer_send_spontaneous_payment(this.ptr, route == null ? 0 : route.ptr, InternalUtils.check_arr_len(payment_preimage, 32), InternalUtils.check_arr_len(payment_id, 32)); Reference.reachabilityFence(this); Reference.reachabilityFence(route); Reference.reachabilityFence(payment_preimage); + Reference.reachabilityFence(payment_id); if (ret >= 0 && ret <= 4096) { return null; } - Result_PaymentIdPaymentSendFailureZ ret_hu_conv = Result_PaymentIdPaymentSendFailureZ.constr_from_ptr(ret); + Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.add(route); }; return ret_hu_conv; } @@ -156,7 +181,7 @@ public class Payer extends CommonBase { /** * Retries a failed payment path for the [`PaymentId`] using the given [`Route`]. */ - public Result_NonePaymentSendFailureZ retry_payment(Route route, byte[] payment_id) { + public Result_NonePaymentSendFailureZ retry_payment(org.ldk.structs.Route route, byte[] payment_id) { long ret = bindings.Payer_retry_payment(this.ptr, route == null ? 0 : route.ptr, InternalUtils.check_arr_len(payment_id, 32)); Reference.reachabilityFence(this); Reference.reachabilityFence(route); @@ -176,4 +201,17 @@ public class Payer extends CommonBase { Reference.reachabilityFence(payment_id); } + /** + * Construct an [`InFlightHtlcs`] containing information about currently used up liquidity + * across payments. + */ + public InFlightHtlcs inflight_htlcs() { + long ret = bindings.Payer_inflight_htlcs(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.InFlightHtlcs ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InFlightHtlcs(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/PaymentError.java b/src/main/java/org/ldk/structs/PaymentError.java index d6f33c4f..e4bc100a 100644 --- a/src/main/java/org/ldk/structs/PaymentError.java +++ b/src/main/java/org/ldk/structs/PaymentError.java @@ -102,7 +102,7 @@ public class PaymentError extends CommonBase { /** * Utility method to constructs a new Routing-variant PaymentError */ - public static PaymentError routing(LightningError a) { + public static PaymentError routing(org.ldk.structs.LightningError a) { long ret = bindings.PaymentError_routing(a == null ? 0 : a.ptr); Reference.reachabilityFence(a); if (ret >= 0 && ret <= 4096) { return null; } @@ -115,7 +115,7 @@ public class PaymentError extends CommonBase { /** * Utility method to constructs a new Sending-variant PaymentError */ - public static PaymentError sending(PaymentSendFailure a) { + public static PaymentError sending(org.ldk.structs.PaymentSendFailure a) { long ret = bindings.PaymentError_sending(a.ptr); Reference.reachabilityFence(a); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/PaymentParameters.java b/src/main/java/org/ldk/structs/PaymentParameters.java index 690f800e..600b9d6e 100644 --- a/src/main/java/org/ldk/structs/PaymentParameters.java +++ b/src/main/java/org/ldk/structs/PaymentParameters.java @@ -68,7 +68,7 @@ public class PaymentParameters extends CommonBase { * * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public void set_features(@Nullable InvoiceFeatures val) { + public void set_features(@Nullable org.ldk.structs.InvoiceFeatures val) { bindings.PaymentParameters_set_features(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -117,7 +117,7 @@ public class PaymentParameters extends CommonBase { /** * Expiration of a payment to the payee, in seconds relative to the UNIX epoch. */ - public void set_expiry_time(Option_u64Z val) { + public void set_expiry_time(org.ldk.structs.Option_u64Z val) { bindings.PaymentParameters_set_expiry_time(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -232,7 +232,7 @@ public class PaymentParameters extends CommonBase { /** * Constructs a new PaymentParameters given each field */ - public static PaymentParameters of(byte[] payee_pubkey_arg, InvoiceFeatures features_arg, RouteHint[] route_hints_arg, Option_u64Z expiry_time_arg, int max_total_cltv_expiry_delta_arg, byte max_path_count_arg, byte max_channel_saturation_power_of_half_arg, long[] previously_failed_channels_arg) { + public static PaymentParameters of(byte[] payee_pubkey_arg, org.ldk.structs.InvoiceFeatures features_arg, RouteHint[] route_hints_arg, org.ldk.structs.Option_u64Z expiry_time_arg, int max_total_cltv_expiry_delta_arg, byte max_path_count_arg, byte max_channel_saturation_power_of_half_arg, long[] previously_failed_channels_arg) { long ret = bindings.PaymentParameters_new(InternalUtils.check_arr_len(payee_pubkey_arg, 33), features_arg == null ? 0 : features_arg.ptr, route_hints_arg != null ? Arrays.stream(route_hints_arg).mapToLong(route_hints_arg_conv_11 -> route_hints_arg_conv_11 == null ? 0 : route_hints_arg_conv_11.ptr).toArray() : null, expiry_time_arg.ptr, max_total_cltv_expiry_delta_arg, max_path_count_arg, max_channel_saturation_power_of_half_arg, previously_failed_channels_arg); Reference.reachabilityFence(payee_pubkey_arg); Reference.reachabilityFence(features_arg); @@ -285,7 +285,7 @@ public class PaymentParameters extends CommonBase { * 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(PaymentParameters b) { + public boolean eq(org.ldk.structs.PaymentParameters b) { boolean ret = bindings.PaymentParameters_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/PaymentSendFailure.java b/src/main/java/org/ldk/structs/PaymentSendFailure.java index 8d9ccef3..7066e754 100644 --- a/src/main/java/org/ldk/structs/PaymentSendFailure.java +++ b/src/main/java/org/ldk/structs/PaymentSendFailure.java @@ -29,8 +29,11 @@ public class PaymentSendFailure extends CommonBase { if (raw_val.getClass() == bindings.LDKPaymentSendFailure.PathParameterError.class) { return new PathParameterError(ptr, (bindings.LDKPaymentSendFailure.PathParameterError)raw_val); } - if (raw_val.getClass() == bindings.LDKPaymentSendFailure.AllFailedRetrySafe.class) { - return new AllFailedRetrySafe(ptr, (bindings.LDKPaymentSendFailure.AllFailedRetrySafe)raw_val); + if (raw_val.getClass() == bindings.LDKPaymentSendFailure.AllFailedResendSafe.class) { + return new AllFailedResendSafe(ptr, (bindings.LDKPaymentSendFailure.AllFailedResendSafe)raw_val); + } + if (raw_val.getClass() == bindings.LDKPaymentSendFailure.DuplicatePayment.class) { + return new DuplicatePayment(ptr, (bindings.LDKPaymentSendFailure.DuplicatePayment)raw_val); } if (raw_val.getClass() == bindings.LDKPaymentSendFailure.PartialFailure.class) { return new PartialFailure(ptr, (bindings.LDKPaymentSendFailure.PartialFailure)raw_val); @@ -40,8 +43,13 @@ public class PaymentSendFailure extends CommonBase { /** * A parameter which was passed to send_payment was invalid, preventing us from attempting to - * send the payment at all. No channel state has been changed or messages sent to peers, and - * once you've changed the parameter at error, you can freely retry the payment in full. + * send the payment at all. + * + * You can freely resend the payment in full (with the parameter error fixed). + * + * Because the payment failed outright, no payment tracking is done, you do not need to call + * [`ChannelManager::abandon_payment`] and [`ChannelManager::retry_payment`] will *not* work + * for this payment. */ public final static class ParameterError extends PaymentSendFailure { public final org.ldk.structs.APIError parameter_error; @@ -55,12 +63,16 @@ public class PaymentSendFailure extends CommonBase { } /** * A parameter in a single path which was passed to send_payment was invalid, preventing us - * from attempting to send the payment at all. No channel state has been changed or messages - * sent to peers, and once you've changed the parameter at error, you can freely retry the - * payment in full. + * from attempting to send the payment at all. + * + * You can freely resend the payment in full (with the parameter error fixed). * * The results here are ordered the same as the paths in the route object which was passed to * send_payment. + * + * Because the payment failed outright, no payment tracking is done, you do not need to call + * [`ChannelManager::abandon_payment`] and [`ChannelManager::retry_payment`] will *not* work + * for this payment. */ public final static class PathParameterError extends PaymentSendFailure { public final Result_NoneAPIErrorZ[] path_parameter_error; @@ -79,23 +91,39 @@ public class PaymentSendFailure extends CommonBase { } /** * All paths which were attempted failed to send, with no channel state change taking place. - * You can freely retry the payment in full (though you probably want to do so over different + * You can freely resend the payment in full (though you probably want to do so over different * paths than the ones selected). + * + * Because the payment failed outright, no payment tracking is done, you do not need to call + * [`ChannelManager::abandon_payment`] and [`ChannelManager::retry_payment`] will *not* work + * for this payment. */ - public final static class AllFailedRetrySafe extends PaymentSendFailure { - public final APIError[] all_failed_retry_safe; - private AllFailedRetrySafe(long ptr, bindings.LDKPaymentSendFailure.AllFailedRetrySafe obj) { + public final static class AllFailedResendSafe extends PaymentSendFailure { + public final APIError[] all_failed_resend_safe; + private AllFailedResendSafe(long ptr, bindings.LDKPaymentSendFailure.AllFailedResendSafe obj) { super(null, ptr); - long[] all_failed_retry_safe = obj.all_failed_retry_safe; - int all_failed_retry_safe_conv_10_len = all_failed_retry_safe.length; - APIError[] all_failed_retry_safe_conv_10_arr = new APIError[all_failed_retry_safe_conv_10_len]; - for (int k = 0; k < all_failed_retry_safe_conv_10_len; k++) { - long all_failed_retry_safe_conv_10 = all_failed_retry_safe[k]; - org.ldk.structs.APIError all_failed_retry_safe_conv_10_hu_conv = org.ldk.structs.APIError.constr_from_ptr(all_failed_retry_safe_conv_10); - if (all_failed_retry_safe_conv_10_hu_conv != null) { all_failed_retry_safe_conv_10_hu_conv.ptrs_to.add(this); }; - all_failed_retry_safe_conv_10_arr[k] = all_failed_retry_safe_conv_10_hu_conv; + long[] all_failed_resend_safe = obj.all_failed_resend_safe; + int all_failed_resend_safe_conv_10_len = all_failed_resend_safe.length; + APIError[] all_failed_resend_safe_conv_10_arr = new APIError[all_failed_resend_safe_conv_10_len]; + for (int k = 0; k < all_failed_resend_safe_conv_10_len; k++) { + long all_failed_resend_safe_conv_10 = all_failed_resend_safe[k]; + org.ldk.structs.APIError all_failed_resend_safe_conv_10_hu_conv = org.ldk.structs.APIError.constr_from_ptr(all_failed_resend_safe_conv_10); + if (all_failed_resend_safe_conv_10_hu_conv != null) { all_failed_resend_safe_conv_10_hu_conv.ptrs_to.add(this); }; + all_failed_resend_safe_conv_10_arr[k] = all_failed_resend_safe_conv_10_hu_conv; } - this.all_failed_retry_safe = all_failed_retry_safe_conv_10_arr; + this.all_failed_resend_safe = all_failed_resend_safe_conv_10_arr; + } + } + /** + * Indicates that a payment for the provided [`PaymentId`] is already in-flight and has not + * yet completed (i.e. generated an [`Event::PaymentSent`]) or been abandoned (via + * [`ChannelManager::abandon_payment`]). + * + * [`Event::PaymentSent`]: events::Event::PaymentSent + */ + public final static class DuplicatePayment extends PaymentSendFailure { + private DuplicatePayment(long ptr, bindings.LDKPaymentSendFailure.DuplicatePayment obj) { + super(null, ptr); } } /** @@ -168,7 +196,7 @@ public class PaymentSendFailure extends CommonBase { /** * Utility method to constructs a new ParameterError-variant PaymentSendFailure */ - public static PaymentSendFailure parameter_error(APIError a) { + public static PaymentSendFailure parameter_error(org.ldk.structs.APIError a) { long ret = bindings.PaymentSendFailure_parameter_error(a.ptr); Reference.reachabilityFence(a); if (ret >= 0 && ret <= 4096) { return null; } @@ -190,10 +218,10 @@ public class PaymentSendFailure extends CommonBase { } /** - * Utility method to constructs a new AllFailedRetrySafe-variant PaymentSendFailure + * Utility method to constructs a new AllFailedResendSafe-variant PaymentSendFailure */ - public static PaymentSendFailure all_failed_retry_safe(APIError[] a) { - long ret = bindings.PaymentSendFailure_all_failed_retry_safe(a != null ? Arrays.stream(a).mapToLong(a_conv_10 -> a_conv_10.ptr).toArray() : null); + public static PaymentSendFailure all_failed_resend_safe(APIError[] a) { + long ret = bindings.PaymentSendFailure_all_failed_resend_safe(a != null ? Arrays.stream(a).mapToLong(a_conv_10 -> a_conv_10.ptr).toArray() : null); Reference.reachabilityFence(a); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PaymentSendFailure ret_hu_conv = org.ldk.structs.PaymentSendFailure.constr_from_ptr(ret); @@ -201,10 +229,21 @@ public class PaymentSendFailure extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new DuplicatePayment-variant PaymentSendFailure + */ + public static PaymentSendFailure duplicate_payment() { + long ret = bindings.PaymentSendFailure_duplicate_payment(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.PaymentSendFailure ret_hu_conv = org.ldk.structs.PaymentSendFailure.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + /** * Utility method to constructs a new PartialFailure-variant PaymentSendFailure */ - public static PaymentSendFailure partial_failure(Result_NoneAPIErrorZ[] results, RouteParameters failed_paths_retry, byte[] payment_id) { + public static PaymentSendFailure partial_failure(Result_NoneAPIErrorZ[] results, org.ldk.structs.RouteParameters failed_paths_retry, byte[] payment_id) { long ret = bindings.PaymentSendFailure_partial_failure(results != null ? Arrays.stream(results).mapToLong(results_conv_22 -> results_conv_22 != null ? results_conv_22.ptr : 0).toArray() : null, failed_paths_retry == null ? 0 : failed_paths_retry.ptr, InternalUtils.check_arr_len(payment_id, 32)); Reference.reachabilityFence(results); Reference.reachabilityFence(failed_paths_retry); diff --git a/src/main/java/org/ldk/structs/PeerManager.java b/src/main/java/org/ldk/structs/PeerManager.java index ab061b20..e44bc321 100644 --- a/src/main/java/org/ldk/structs/PeerManager.java +++ b/src/main/java/org/ldk/structs/PeerManager.java @@ -48,7 +48,7 @@ public class PeerManager extends CommonBase { * timestamp, however if it is not available a persistent counter that increases once per * minute should suffice. */ - public static PeerManager of(ChannelMessageHandler message_handler_chan_handler_arg, RoutingMessageHandler message_handler_route_handler_arg, OnionMessageHandler message_handler_onion_message_handler_arg, byte[] our_node_secret, int current_time, byte[] ephemeral_random_data, Logger logger, CustomMessageHandler custom_message_handler) { + public static PeerManager of(ChannelMessageHandler message_handler_chan_handler_arg, RoutingMessageHandler message_handler_route_handler_arg, OnionMessageHandler message_handler_onion_message_handler_arg, byte[] our_node_secret, int current_time, byte[] ephemeral_random_data, org.ldk.structs.Logger logger, org.ldk.structs.CustomMessageHandler custom_message_handler) { long ret = bindings.PeerManager_new(bindings.MessageHandler_new(message_handler_chan_handler_arg == null ? 0 : message_handler_chan_handler_arg.ptr, message_handler_route_handler_arg == null ? 0 : message_handler_route_handler_arg.ptr, message_handler_onion_message_handler_arg == null ? 0 : message_handler_onion_message_handler_arg.ptr), InternalUtils.check_arr_len(our_node_secret, 32), current_time, InternalUtils.check_arr_len(ephemeral_random_data, 32), logger == null ? 0 : logger.ptr, custom_message_handler == null ? 0 : custom_message_handler.ptr); Reference.reachabilityFence(message_handler_chan_handler_arg); Reference.reachabilityFence(message_handler_route_handler_arg); @@ -99,7 +99,7 @@ public class PeerManager extends CommonBase { * * [`socket_disconnected()`]: PeerManager::socket_disconnected */ - public Result_CVec_u8ZPeerHandleErrorZ new_outbound_connection(byte[] their_node_id, SocketDescriptor descriptor, Option_NetAddressZ remote_network_address) { + public Result_CVec_u8ZPeerHandleErrorZ new_outbound_connection(byte[] their_node_id, org.ldk.structs.SocketDescriptor descriptor, org.ldk.structs.Option_NetAddressZ remote_network_address) { long ret = bindings.PeerManager_new_outbound_connection(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), descriptor == null ? 0 : descriptor.ptr, remote_network_address.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(their_node_id); @@ -128,7 +128,7 @@ public class PeerManager extends CommonBase { * * [`socket_disconnected()`]: PeerManager::socket_disconnected */ - public Result_NonePeerHandleErrorZ new_inbound_connection(SocketDescriptor descriptor, Option_NetAddressZ remote_network_address) { + public Result_NonePeerHandleErrorZ new_inbound_connection(org.ldk.structs.SocketDescriptor descriptor, org.ldk.structs.Option_NetAddressZ remote_network_address) { long ret = bindings.PeerManager_new_inbound_connection(this.ptr, descriptor == null ? 0 : descriptor.ptr, remote_network_address.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(descriptor); @@ -153,7 +153,7 @@ public class PeerManager extends CommonBase { * [`send_data`]: SocketDescriptor::send_data * [`write_buffer_space_avail`]: PeerManager::write_buffer_space_avail */ - public Result_NonePeerHandleErrorZ write_buffer_space_avail(SocketDescriptor descriptor) { + public Result_NonePeerHandleErrorZ write_buffer_space_avail(org.ldk.structs.SocketDescriptor descriptor) { long ret = bindings.PeerManager_write_buffer_space_avail(this.ptr, descriptor == null ? 0 : descriptor.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(descriptor); @@ -178,7 +178,7 @@ public class PeerManager extends CommonBase { * [`send_data`]: SocketDescriptor::send_data * [`process_events`]: PeerManager::process_events */ - public Result_boolPeerHandleErrorZ read_event(SocketDescriptor peer_descriptor, byte[] data) { + public Result_boolPeerHandleErrorZ read_event(org.ldk.structs.SocketDescriptor peer_descriptor, byte[] data) { long ret = bindings.PeerManager_read_event(this.ptr, peer_descriptor == null ? 0 : peer_descriptor.ptr, data); Reference.reachabilityFence(this); Reference.reachabilityFence(peer_descriptor); @@ -215,7 +215,7 @@ public class PeerManager extends CommonBase { /** * Indicates that the given socket descriptor's connection is now closed. */ - public void socket_disconnected(SocketDescriptor descriptor) { + public void socket_disconnected(org.ldk.structs.SocketDescriptor descriptor) { bindings.PeerManager_socket_disconnected(this.ptr, descriptor == null ? 0 : descriptor.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(descriptor); diff --git a/src/main/java/org/ldk/structs/Persist.java b/src/main/java/org/ldk/structs/Persist.java index b6c56ab9..5ce6a580 100644 --- a/src/main/java/org/ldk/structs/Persist.java +++ b/src/main/java/org/ldk/structs/Persist.java @@ -146,7 +146,7 @@ public class Persist extends CommonBase { * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager * [`Writeable::write`]: crate::util::ser::Writeable::write */ - public ChannelMonitorUpdateStatus persist_new_channel(OutPoint channel_id, ChannelMonitor data, MonitorUpdateId update_id) { + public ChannelMonitorUpdateStatus persist_new_channel(org.ldk.structs.OutPoint channel_id, org.ldk.structs.ChannelMonitor data, org.ldk.structs.MonitorUpdateId update_id) { ChannelMonitorUpdateStatus ret = bindings.Persist_persist_new_channel(this.ptr, channel_id == null ? 0 : channel_id.ptr, data == null ? 0 : data.ptr, update_id == null ? 0 : update_id.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(channel_id); @@ -195,7 +195,7 @@ public class Persist extends CommonBase { * * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public ChannelMonitorUpdateStatus update_persisted_channel(OutPoint channel_id, @Nullable ChannelMonitorUpdate update, ChannelMonitor data, MonitorUpdateId update_id) { + public ChannelMonitorUpdateStatus update_persisted_channel(org.ldk.structs.OutPoint channel_id, @Nullable org.ldk.structs.ChannelMonitorUpdate update, org.ldk.structs.ChannelMonitor data, org.ldk.structs.MonitorUpdateId update_id) { ChannelMonitorUpdateStatus ret = bindings.Persist_update_persisted_channel(this.ptr, channel_id == null ? 0 : channel_id.ptr, update == null ? 0 : update.ptr, data == null ? 0 : data.ptr, update_id == null ? 0 : update_id.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(channel_id); diff --git a/src/main/java/org/ldk/structs/Persister.java b/src/main/java/org/ldk/structs/Persister.java index 96f93b56..63293035 100644 --- a/src/main/java/org/ldk/structs/Persister.java +++ b/src/main/java/org/ldk/structs/Persister.java @@ -70,7 +70,7 @@ public class Persister extends CommonBase { /** * Persist the given ['ChannelManager'] to disk, returning an error if persistence failed. */ - public Result_NoneErrorZ persist_manager(ChannelManager channel_manager) { + public Result_NoneErrorZ persist_manager(org.ldk.structs.ChannelManager channel_manager) { long ret = bindings.Persister_persist_manager(this.ptr, channel_manager == null ? 0 : channel_manager.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(channel_manager); @@ -83,7 +83,7 @@ public class Persister extends CommonBase { /** * Persist the given [`NetworkGraph`] to disk, returning an error if persistence failed. */ - public Result_NoneErrorZ persist_graph(NetworkGraph network_graph) { + public Result_NoneErrorZ persist_graph(org.ldk.structs.NetworkGraph network_graph) { long ret = bindings.Persister_persist_graph(this.ptr, network_graph == null ? 0 : network_graph.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(network_graph); @@ -96,7 +96,7 @@ public class Persister extends CommonBase { /** * Persist the given [`WriteableScore`] to disk, returning an error if persistence failed. */ - public Result_NoneErrorZ persist_scorer(WriteableScore scorer) { + public Result_NoneErrorZ persist_scorer(org.ldk.structs.WriteableScore scorer) { long ret = bindings.Persister_persist_scorer(this.ptr, scorer == null ? 0 : scorer.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(scorer); diff --git a/src/main/java/org/ldk/structs/PhantomKeysManager.java b/src/main/java/org/ldk/structs/PhantomKeysManager.java index c75aaec4..2a192680 100644 --- a/src/main/java/org/ldk/structs/PhantomKeysManager.java +++ b/src/main/java/org/ldk/structs/PhantomKeysManager.java @@ -48,8 +48,9 @@ public class PhantomKeysManager extends CommonBase { } /** - * Constructs a `PhantomKeysManager` given a 32-byte seed and an additional `cross_node_seed` - * that is shared across all nodes that intend to participate in [phantom node payments] together. + * Constructs a [`PhantomKeysManager`] given a 32-byte seed and an additional `cross_node_seed` + * that is shared across all nodes that intend to participate in [phantom node payments] + * together. * * See [`KeysManager::new`] for more information on `seed`, `starting_time_secs`, and * `starting_time_nanos`. diff --git a/src/main/java/org/ldk/structs/Ping.java b/src/main/java/org/ldk/structs/Ping.java index fc20cc32..912f5f74 100644 --- a/src/main/java/org/ldk/structs/Ping.java +++ b/src/main/java/org/ldk/structs/Ping.java @@ -94,7 +94,7 @@ public class Ping extends CommonBase { * 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(Ping b) { + public boolean eq(org.ldk.structs.Ping b) { boolean ret = bindings.Ping_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/Pong.java b/src/main/java/org/ldk/structs/Pong.java index 5b7823f6..536f0010 100644 --- a/src/main/java/org/ldk/structs/Pong.java +++ b/src/main/java/org/ldk/structs/Pong.java @@ -75,7 +75,7 @@ public class Pong extends CommonBase { * 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(Pong b) { + public boolean eq(org.ldk.structs.Pong b) { boolean ret = bindings.Pong_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/PositiveTimestamp.java b/src/main/java/org/ldk/structs/PositiveTimestamp.java index 7e1f32be..463fe925 100644 --- a/src/main/java/org/ldk/structs/PositiveTimestamp.java +++ b/src/main/java/org/ldk/structs/PositiveTimestamp.java @@ -30,7 +30,7 @@ public class PositiveTimestamp extends CommonBase { * 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(PositiveTimestamp b) { + public boolean eq(org.ldk.structs.PositiveTimestamp b) { boolean ret = bindings.PositiveTimestamp_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/PrintableString.java b/src/main/java/org/ldk/structs/PrintableString.java new file mode 100644 index 00000000..4279074f --- /dev/null +++ b/src/main/java/org/ldk/structs/PrintableString.java @@ -0,0 +1,48 @@ +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 string that displays only printable characters, replacing control characters with + * [`core::char::REPLACEMENT_CHARACTER`]. + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class PrintableString extends CommonBase { + PrintableString(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.PrintableString_free(ptr); } + } + + public String get_a() { + String ret = bindings.PrintableString_get_a(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + public void set_a(java.lang.String val) { + bindings.PrintableString_set_a(this.ptr, val); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + + /** + * Constructs a new PrintableString given each field + */ + public static PrintableString of(java.lang.String a_arg) { + long ret = bindings.PrintableString_new(a_arg); + Reference.reachabilityFence(a_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.PrintableString ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PrintableString(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/PrivateRoute.java b/src/main/java/org/ldk/structs/PrivateRoute.java index f839d1a3..60972ce1 100644 --- a/src/main/java/org/ldk/structs/PrivateRoute.java +++ b/src/main/java/org/ldk/structs/PrivateRoute.java @@ -58,7 +58,7 @@ public class PrivateRoute extends CommonBase { * 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(PrivateRoute b) { + public boolean eq(org.ldk.structs.PrivateRoute b) { boolean ret = bindings.PrivateRoute_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); @@ -73,7 +73,7 @@ public class PrivateRoute extends CommonBase { /** * Creates a new (partial) route from a list of hops */ - public static Result_PrivateRouteCreationErrorZ of(RouteHint hops) { + public static Result_PrivateRouteCreationErrorZ of(org.ldk.structs.RouteHint hops) { long ret = bindings.PrivateRoute_new(hops == null ? 0 : hops.ptr); Reference.reachabilityFence(hops); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/ProbabilisticScorer.java b/src/main/java/org/ldk/structs/ProbabilisticScorer.java index 71658b3f..61048c57 100644 --- a/src/main/java/org/ldk/structs/ProbabilisticScorer.java +++ b/src/main/java/org/ldk/structs/ProbabilisticScorer.java @@ -59,7 +59,7 @@ 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, Logger logger) { + public static ProbabilisticScorer of(org.ldk.structs.ProbabilisticScoringParameters params, org.ldk.structs.NetworkGraph network_graph, org.ldk.structs.Logger logger) { long ret = bindings.ProbabilisticScorer_new(params == null ? 0 : params.ptr, network_graph == null ? 0 : network_graph.ptr, logger == null ? 0 : logger.ptr); Reference.reachabilityFence(params); Reference.reachabilityFence(network_graph); @@ -88,7 +88,7 @@ public class ProbabilisticScorer extends CommonBase { * Query the estimated minimum and maximum liquidity available for sending a payment over the * channel with `scid` towards the given `target` node. */ - public Option_C2Tuple_u64u64ZZ estimated_channel_liquidity_range(long scid, NodeId target) { + public Option_C2Tuple_u64u64ZZ estimated_channel_liquidity_range(long scid, org.ldk.structs.NodeId target) { long ret = bindings.ProbabilisticScorer_estimated_channel_liquidity_range(this.ptr, scid, target == null ? 0 : target.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(scid); @@ -104,7 +104,7 @@ public class ProbabilisticScorer extends CommonBase { * Marks the node with the given `node_id` as banned, i.e., * it will be avoided during path finding. */ - public void add_banned(NodeId node_id) { + public void add_banned(org.ldk.structs.NodeId node_id) { bindings.ProbabilisticScorer_add_banned(this.ptr, node_id == null ? 0 : node_id.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(node_id); @@ -114,7 +114,7 @@ public class ProbabilisticScorer extends CommonBase { /** * Removes the node with the given `node_id` from the list of nodes to avoid. */ - public void remove_banned(NodeId node_id) { + public void remove_banned(org.ldk.structs.NodeId node_id) { bindings.ProbabilisticScorer_remove_banned(this.ptr, node_id == null ? 0 : node_id.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(node_id); @@ -124,7 +124,7 @@ public class ProbabilisticScorer extends CommonBase { /** * Sets a manual penalty for the given node. */ - public void set_manual_penalty(NodeId node_id, long penalty) { + public void set_manual_penalty(org.ldk.structs.NodeId node_id, long penalty) { bindings.ProbabilisticScorer_set_manual_penalty(this.ptr, node_id == null ? 0 : node_id.ptr, penalty); Reference.reachabilityFence(this); Reference.reachabilityFence(node_id); @@ -135,7 +135,7 @@ public class ProbabilisticScorer extends CommonBase { /** * Removes the node with the given `node_id` from the list of manual penalties. */ - public void remove_manual_penalty(NodeId node_id) { + public void remove_manual_penalty(org.ldk.structs.NodeId node_id) { bindings.ProbabilisticScorer_remove_manual_penalty(this.ptr, node_id == null ? 0 : node_id.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(node_id); @@ -175,7 +175,7 @@ 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, Logger arg_c) { + public static Result_ProbabilisticScorerDecodeErrorZ read(byte[] ser, org.ldk.structs.ProbabilisticScoringParameters arg_a, org.ldk.structs.NetworkGraph arg_b, org.ldk.structs.Logger arg_c) { long ret = bindings.ProbabilisticScorer_read(ser, arg_a == null ? 0 : arg_a.ptr, arg_b == null ? 0 : arg_b.ptr, arg_c == null ? 0 : arg_c.ptr); Reference.reachabilityFence(ser); Reference.reachabilityFence(arg_a); diff --git a/src/main/java/org/ldk/structs/QueryChannelRange.java b/src/main/java/org/ldk/structs/QueryChannelRange.java index 238aa7fd..a17db50e 100644 --- a/src/main/java/org/ldk/structs/QueryChannelRange.java +++ b/src/main/java/org/ldk/structs/QueryChannelRange.java @@ -114,7 +114,7 @@ public class QueryChannelRange extends CommonBase { * 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(QueryChannelRange b) { + public boolean eq(org.ldk.structs.QueryChannelRange b) { boolean ret = bindings.QueryChannelRange_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/QueryShortChannelIds.java b/src/main/java/org/ldk/structs/QueryShortChannelIds.java index ce912431..20a27f89 100644 --- a/src/main/java/org/ldk/structs/QueryShortChannelIds.java +++ b/src/main/java/org/ldk/structs/QueryShortChannelIds.java @@ -101,7 +101,7 @@ public class QueryShortChannelIds extends CommonBase { * 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(QueryShortChannelIds b) { + public boolean eq(org.ldk.structs.QueryShortChannelIds b) { boolean ret = bindings.QueryShortChannelIds_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/RapidGossipSync.java b/src/main/java/org/ldk/structs/RapidGossipSync.java index cb5d6701..f9b22d31 100644 --- a/src/main/java/org/ldk/structs/RapidGossipSync.java +++ b/src/main/java/org/ldk/structs/RapidGossipSync.java @@ -27,7 +27,7 @@ public class RapidGossipSync extends CommonBase { /** * Instantiate a new [`RapidGossipSync`] instance. */ - public static RapidGossipSync of(NetworkGraph network_graph) { + public static RapidGossipSync of(org.ldk.structs.NetworkGraph network_graph) { long ret = bindings.RapidGossipSync_new(network_graph == null ? 0 : network_graph.ptr); Reference.reachabilityFence(network_graph); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/RawDataPart.java b/src/main/java/org/ldk/structs/RawDataPart.java index 5f68e056..b7d7de16 100644 --- a/src/main/java/org/ldk/structs/RawDataPart.java +++ b/src/main/java/org/ldk/structs/RawDataPart.java @@ -35,7 +35,7 @@ public class RawDataPart extends CommonBase { /** * generation time of the invoice */ - public void set_timestamp(PositiveTimestamp val) { + public void set_timestamp(org.ldk.structs.PositiveTimestamp val) { bindings.RawDataPart_set_timestamp(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -47,7 +47,7 @@ public class RawDataPart extends CommonBase { * 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(RawDataPart b) { + public boolean eq(org.ldk.structs.RawDataPart b) { boolean ret = bindings.RawDataPart_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/RawInvoice.java b/src/main/java/org/ldk/structs/RawInvoice.java index 107e6c0e..f65b3a40 100644 --- a/src/main/java/org/ldk/structs/RawInvoice.java +++ b/src/main/java/org/ldk/structs/RawInvoice.java @@ -39,7 +39,7 @@ public class RawInvoice extends CommonBase { /** * data part */ - public void set_data(RawDataPart val) { + public void set_data(org.ldk.structs.RawDataPart val) { bindings.RawInvoice_set_data(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -51,7 +51,7 @@ public class RawInvoice extends CommonBase { * 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(RawInvoice b) { + public boolean eq(org.ldk.structs.RawInvoice b) { boolean ret = bindings.RawInvoice_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/ReadOnlyNetworkGraph.java b/src/main/java/org/ldk/structs/ReadOnlyNetworkGraph.java index ae0278a9..b7e08370 100644 --- a/src/main/java/org/ldk/structs/ReadOnlyNetworkGraph.java +++ b/src/main/java/org/ldk/structs/ReadOnlyNetworkGraph.java @@ -49,7 +49,7 @@ public class ReadOnlyNetworkGraph extends CommonBase implements AutoCloseable { * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ @Nullable - public NodeInfo node(NodeId node_id) { + public NodeInfo node(org.ldk.structs.NodeId node_id) { long ret = bindings.ReadOnlyNetworkGraph_node(this.ptr, node_id == null ? 0 : node_id.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(node_id); diff --git a/src/main/java/org/ldk/structs/ReplyChannelRange.java b/src/main/java/org/ldk/structs/ReplyChannelRange.java index bb3e9aac..2799beda 100644 --- a/src/main/java/org/ldk/structs/ReplyChannelRange.java +++ b/src/main/java/org/ldk/structs/ReplyChannelRange.java @@ -157,7 +157,7 @@ public class ReplyChannelRange extends CommonBase { * 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(ReplyChannelRange b) { + public boolean eq(org.ldk.structs.ReplyChannelRange b) { boolean ret = bindings.ReplyChannelRange_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/ReplyShortChannelIdsEnd.java b/src/main/java/org/ldk/structs/ReplyShortChannelIdsEnd.java index f18e5e44..7bb3b65f 100644 --- a/src/main/java/org/ldk/structs/ReplyShortChannelIdsEnd.java +++ b/src/main/java/org/ldk/structs/ReplyShortChannelIdsEnd.java @@ -97,7 +97,7 @@ public class ReplyShortChannelIdsEnd extends CommonBase { * 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(ReplyShortChannelIdsEnd b) { + public boolean eq(org.ldk.structs.ReplyShortChannelIdsEnd b) { boolean ret = bindings.ReplyShortChannelIdsEnd_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.java index b03e60d1..f6d58ac8 100644 --- a/src/main/java/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_AcceptChannelDecodeErrorZ extends CommonBase { /** * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state. */ - public static Result_AcceptChannelDecodeErrorZ ok(AcceptChannel o) { + public static Result_AcceptChannelDecodeErrorZ ok(org.ldk.structs.AcceptChannel o) { long ret = bindings.CResult_AcceptChannelDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_AcceptChannelDecodeErrorZ extends CommonBase { /** * Creates a new CResult_AcceptChannelDecodeErrorZ in the error state. */ - public static Result_AcceptChannelDecodeErrorZ err(DecodeError e) { + public static Result_AcceptChannelDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_AcceptChannelDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.java index a7af3920..abbcab5f 100644 --- a/src/main/java/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_AnnouncementSignaturesDecodeErrorZ extends CommonBase { /** * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state. */ - public static Result_AnnouncementSignaturesDecodeErrorZ ok(AnnouncementSignatures o) { + public static Result_AnnouncementSignaturesDecodeErrorZ ok(org.ldk.structs.AnnouncementSignatures o) { long ret = bindings.CResult_AnnouncementSignaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_AnnouncementSignaturesDecodeErrorZ extends CommonBase { /** * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the error state. */ - public static Result_AnnouncementSignaturesDecodeErrorZ err(DecodeError e) { + public static Result_AnnouncementSignaturesDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_AnnouncementSignaturesDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_BlindedHopDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_BlindedHopDecodeErrorZ.java index 885d8d56..dec3ce27 100644 --- a/src/main/java/org/ldk/structs/Result_BlindedHopDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_BlindedHopDecodeErrorZ.java @@ -45,27 +45,19 @@ public class Result_BlindedHopDecodeErrorZ extends CommonBase { /** * Creates a new CResult_BlindedHopDecodeErrorZ in the success state. */ - public static Result_BlindedHopDecodeErrorZ ok(BlindedHop o) { + public static Result_BlindedHopDecodeErrorZ ok(org.ldk.structs.BlindedHop o) { long ret = bindings.CResult_BlindedHopDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_BlindedHopDecodeErrorZ ret_hu_conv = Result_BlindedHopDecodeErrorZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; - // Due to rust's strict-ownership memory model, in some cases we need to "move" - // an object to pass exclusive ownership to the function being called. - // In most cases, we avoid ret_hu_conv being visible in GC'd languages by cloning the object - // at the FFI layer, creating a new object which Rust can claim ownership of - // However, in some cases (eg here), there is no way to clone an object, and thus - // we actually have to pass full ownership to Rust. - // Thus, after ret_hu_conv call, o is reset to null and is now a dummy object. - o.ptr = 0;; return ret_hu_conv; } /** * Creates a new CResult_BlindedHopDecodeErrorZ in the error state. */ - public static Result_BlindedHopDecodeErrorZ err(DecodeError e) { + public static Result_BlindedHopDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_BlindedHopDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } @@ -82,4 +74,22 @@ public class Result_BlindedHopDecodeErrorZ extends CommonBase { return ret; } + long clone_ptr() { + long ret = bindings.CResult_BlindedHopDecodeErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_BlindedHopDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_BlindedHopDecodeErrorZ clone() { + long ret = bindings.CResult_BlindedHopDecodeErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedHopDecodeErrorZ ret_hu_conv = Result_BlindedHopDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_BlindedPathDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_BlindedPathDecodeErrorZ.java new file mode 100644 index 00000000..f9bdcd51 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_BlindedPathDecodeErrorZ.java @@ -0,0 +1,95 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + +public class Result_BlindedPathDecodeErrorZ extends CommonBase { + private Result_BlindedPathDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_BlindedPathDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_BlindedPathDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_BlindedPathDecodeErrorZ_is_ok(ptr)) { + return new Result_BlindedPathDecodeErrorZ_OK(null, ptr); + } else { + return new Result_BlindedPathDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_BlindedPathDecodeErrorZ_OK extends Result_BlindedPathDecodeErrorZ { + public final BlindedPath res; + private Result_BlindedPathDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.CResult_BlindedPathDecodeErrorZ_get_ok(ptr); + org.ldk.structs.BlindedPath res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.BlindedPath(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; + this.res = res_hu_conv; + } + } + + public static final class Result_BlindedPathDecodeErrorZ_Err extends Result_BlindedPathDecodeErrorZ { + public final DecodeError err; + private Result_BlindedPathDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.CResult_BlindedPathDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_BlindedPathDecodeErrorZ in the success state. + */ + public static Result_BlindedPathDecodeErrorZ ok(org.ldk.structs.BlindedPath o) { + long ret = bindings.CResult_BlindedPathDecodeErrorZ_ok(o == null ? 0 : o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedPathDecodeErrorZ ret_hu_conv = Result_BlindedPathDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_BlindedPathDecodeErrorZ in the error state. + */ + public static Result_BlindedPathDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_BlindedPathDecodeErrorZ_err(e.ptr); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedPathDecodeErrorZ ret_hu_conv = Result_BlindedPathDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_BlindedPathDecodeErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_BlindedPathDecodeErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_BlindedPathDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_BlindedPathDecodeErrorZ clone() { + long ret = bindings.CResult_BlindedPathDecodeErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedPathDecodeErrorZ ret_hu_conv = Result_BlindedPathDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_BlindedPathNoneZ.java b/src/main/java/org/ldk/structs/Result_BlindedPathNoneZ.java new file mode 100644 index 00000000..6dcd916d --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_BlindedPathNoneZ.java @@ -0,0 +1,89 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + +public class Result_BlindedPathNoneZ extends CommonBase { + private Result_BlindedPathNoneZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_BlindedPathNoneZ_free(ptr); } super.finalize(); + } + + static Result_BlindedPathNoneZ constr_from_ptr(long ptr) { + if (bindings.CResult_BlindedPathNoneZ_is_ok(ptr)) { + return new Result_BlindedPathNoneZ_OK(null, ptr); + } else { + return new Result_BlindedPathNoneZ_Err(null, ptr); + } + } + public static final class Result_BlindedPathNoneZ_OK extends Result_BlindedPathNoneZ { + public final BlindedPath res; + private Result_BlindedPathNoneZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.CResult_BlindedPathNoneZ_get_ok(ptr); + org.ldk.structs.BlindedPath res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.BlindedPath(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; + this.res = res_hu_conv; + } + } + + public static final class Result_BlindedPathNoneZ_Err extends Result_BlindedPathNoneZ { + private Result_BlindedPathNoneZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + } + } + + /** + * Creates a new CResult_BlindedPathNoneZ in the success state. + */ + public static Result_BlindedPathNoneZ ok(org.ldk.structs.BlindedPath o) { + long ret = bindings.CResult_BlindedPathNoneZ_ok(o == null ? 0 : o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedPathNoneZ ret_hu_conv = Result_BlindedPathNoneZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_BlindedPathNoneZ in the error state. + */ + public static Result_BlindedPathNoneZ err() { + long ret = bindings.CResult_BlindedPathNoneZ_err(); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedPathNoneZ ret_hu_conv = Result_BlindedPathNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public boolean is_ok() { + boolean ret = bindings.CResult_BlindedPathNoneZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_BlindedPathNoneZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_BlindedPathNoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_BlindedPathNoneZ clone() { + long ret = bindings.CResult_BlindedPathNoneZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BlindedPathNoneZ ret_hu_conv = Result_BlindedPathNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_BlindedRouteDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_BlindedRouteDecodeErrorZ.java deleted file mode 100644 index 7f33ada1..00000000 --- a/src/main/java/org/ldk/structs/Result_BlindedRouteDecodeErrorZ.java +++ /dev/null @@ -1,85 +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_BlindedRouteDecodeErrorZ extends CommonBase { - private Result_BlindedRouteDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } - protected void finalize() throws Throwable { - if (ptr != 0) { bindings.CResult_BlindedRouteDecodeErrorZ_free(ptr); } super.finalize(); - } - - static Result_BlindedRouteDecodeErrorZ constr_from_ptr(long ptr) { - if (bindings.CResult_BlindedRouteDecodeErrorZ_is_ok(ptr)) { - return new Result_BlindedRouteDecodeErrorZ_OK(null, ptr); - } else { - return new Result_BlindedRouteDecodeErrorZ_Err(null, ptr); - } - } - public static final class Result_BlindedRouteDecodeErrorZ_OK extends Result_BlindedRouteDecodeErrorZ { - public final BlindedRoute res; - private Result_BlindedRouteDecodeErrorZ_OK(Object _dummy, long ptr) { - super(_dummy, ptr); - long res = bindings.CResult_BlindedRouteDecodeErrorZ_get_ok(ptr); - org.ldk.structs.BlindedRoute res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.BlindedRoute(null, res); } - if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; - this.res = res_hu_conv; - } - } - - public static final class Result_BlindedRouteDecodeErrorZ_Err extends Result_BlindedRouteDecodeErrorZ { - public final DecodeError err; - private Result_BlindedRouteDecodeErrorZ_Err(Object _dummy, long ptr) { - super(_dummy, ptr); - long err = bindings.CResult_BlindedRouteDecodeErrorZ_get_err(ptr); - org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); - if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); }; - this.err = err_hu_conv; - } - } - - /** - * Creates a new CResult_BlindedRouteDecodeErrorZ in the success state. - */ - public static Result_BlindedRouteDecodeErrorZ ok(BlindedRoute o) { - long ret = bindings.CResult_BlindedRouteDecodeErrorZ_ok(o == null ? 0 : o.ptr); - Reference.reachabilityFence(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_BlindedRouteDecodeErrorZ ret_hu_conv = Result_BlindedRouteDecodeErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; - // Due to rust's strict-ownership memory model, in some cases we need to "move" - // an object to pass exclusive ownership to the function being called. - // In most cases, we avoid ret_hu_conv being visible in GC'd languages by cloning the object - // at the FFI layer, creating a new object which Rust can claim ownership of - // However, in some cases (eg here), there is no way to clone an object, and thus - // we actually have to pass full ownership to Rust. - // Thus, after ret_hu_conv call, o is reset to null and is now a dummy object. - o.ptr = 0;; - return ret_hu_conv; - } - - /** - * Creates a new CResult_BlindedRouteDecodeErrorZ in the error state. - */ - public static Result_BlindedRouteDecodeErrorZ err(DecodeError e) { - long ret = bindings.CResult_BlindedRouteDecodeErrorZ_err(e.ptr); - Reference.reachabilityFence(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_BlindedRouteDecodeErrorZ ret_hu_conv = Result_BlindedRouteDecodeErrorZ.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_BlindedRouteDecodeErrorZ_is_ok(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - -} diff --git a/src/main/java/org/ldk/structs/Result_BlindedRouteNoneZ.java b/src/main/java/org/ldk/structs/Result_BlindedRouteNoneZ.java deleted file mode 100644 index f6448349..00000000 --- a/src/main/java/org/ldk/structs/Result_BlindedRouteNoneZ.java +++ /dev/null @@ -1,79 +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_BlindedRouteNoneZ extends CommonBase { - private Result_BlindedRouteNoneZ(Object _dummy, long ptr) { super(ptr); } - protected void finalize() throws Throwable { - if (ptr != 0) { bindings.CResult_BlindedRouteNoneZ_free(ptr); } super.finalize(); - } - - static Result_BlindedRouteNoneZ constr_from_ptr(long ptr) { - if (bindings.CResult_BlindedRouteNoneZ_is_ok(ptr)) { - return new Result_BlindedRouteNoneZ_OK(null, ptr); - } else { - return new Result_BlindedRouteNoneZ_Err(null, ptr); - } - } - public static final class Result_BlindedRouteNoneZ_OK extends Result_BlindedRouteNoneZ { - public final BlindedRoute res; - private Result_BlindedRouteNoneZ_OK(Object _dummy, long ptr) { - super(_dummy, ptr); - long res = bindings.CResult_BlindedRouteNoneZ_get_ok(ptr); - org.ldk.structs.BlindedRoute res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.BlindedRoute(null, res); } - if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; - this.res = res_hu_conv; - } - } - - public static final class Result_BlindedRouteNoneZ_Err extends Result_BlindedRouteNoneZ { - private Result_BlindedRouteNoneZ_Err(Object _dummy, long ptr) { - super(_dummy, ptr); - } - } - - /** - * Creates a new CResult_BlindedRouteNoneZ in the success state. - */ - public static Result_BlindedRouteNoneZ ok(BlindedRoute o) { - long ret = bindings.CResult_BlindedRouteNoneZ_ok(o == null ? 0 : o.ptr); - Reference.reachabilityFence(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_BlindedRouteNoneZ ret_hu_conv = Result_BlindedRouteNoneZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; - // Due to rust's strict-ownership memory model, in some cases we need to "move" - // an object to pass exclusive ownership to the function being called. - // In most cases, we avoid ret_hu_conv being visible in GC'd languages by cloning the object - // at the FFI layer, creating a new object which Rust can claim ownership of - // However, in some cases (eg here), there is no way to clone an object, and thus - // we actually have to pass full ownership to Rust. - // Thus, after ret_hu_conv call, o is reset to null and is now a dummy object. - o.ptr = 0;; - return ret_hu_conv; - } - - /** - * Creates a new CResult_BlindedRouteNoneZ in the error state. - */ - public static Result_BlindedRouteNoneZ err() { - long ret = bindings.CResult_BlindedRouteNoneZ_err(); - if (ret >= 0 && ret <= 4096) { return null; } - Result_BlindedRouteNoneZ ret_hu_conv = Result_BlindedRouteNoneZ.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_BlindedRouteNoneZ_is_ok(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - -} diff --git a/src/main/java/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.java index 3f611c74..97704aa5 100644 --- a/src/main/java/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_BuiltCommitmentTransactionDecodeErrorZ extends CommonBase { /** * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state. */ - public static Result_BuiltCommitmentTransactionDecodeErrorZ ok(BuiltCommitmentTransaction o) { + public static Result_BuiltCommitmentTransactionDecodeErrorZ ok(org.ldk.structs.BuiltCommitmentTransaction o) { long ret = bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_BuiltCommitmentTransactionDecodeErrorZ extends CommonBase { /** * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the error state. */ - public static Result_BuiltCommitmentTransactionDecodeErrorZ err(DecodeError e) { + public static Result_BuiltCommitmentTransactionDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } 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 ebd086db..5ef2eb4c 100644 --- a/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ extends CommonB /** * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the success state. */ - public static Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ ok(TwoTuple_BlockHashChannelManagerZ o) { + public static Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ ok(org.ldk.structs.TwoTuple_BlockHashChannelManagerZ o) { long ret = bindings.CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(o != null ? o.ptr : 0); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -56,7 +56,7 @@ public class Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ extends CommonB /** * Creates a new CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ in the error state. */ - public static Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ err(DecodeError e) { + public static Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } 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 24b90576..b08bd9ec 100644 --- a/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ extends CommonB /** * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the success state. */ - public static Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ ok(TwoTuple_BlockHashChannelMonitorZ o) { + public static Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ ok(org.ldk.structs.TwoTuple_BlockHashChannelMonitorZ o) { long ret = bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(o != null ? o.ptr : 0); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -56,7 +56,7 @@ public class Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ extends CommonB /** * Creates a new CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ in the error state. */ - public static Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ err(DecodeError e) { + public static Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.java b/src/main/java/org/ldk/structs/Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.java index 594fd74a..3544733d 100644 --- a/src/main/java/org/ldk/structs/Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.java +++ b/src/main/java/org/ldk/structs/Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ.java @@ -45,7 +45,7 @@ public class Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ extends Com /** * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ in the success state. */ - public static Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ ok(TwoTuple_PaymentHashPaymentIdZ o) { + public static Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ ok(org.ldk.structs.TwoTuple_PaymentHashPaymentIdZ o) { long ret = bindings.CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(o != null ? o.ptr : 0); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -56,7 +56,7 @@ public class Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ extends Com /** * Creates a new CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ in the error state. */ - public static Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ err(PaymentSendFailure e) { + public static Result_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ err(org.ldk.structs.PaymentSendFailure e) { long ret = bindings.CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.java b/src/main/java/org/ldk/structs/Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.java index 44111e6f..28503d29 100644 --- a/src/main/java/org/ldk/structs/Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ.java @@ -45,7 +45,7 @@ public class Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ extends CommonBas /** * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the success state. */ - public static Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ ok(TwoTuple_PaymentHashPaymentSecretZ o) { + public static Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ ok(org.ldk.structs.TwoTuple_PaymentHashPaymentSecretZ o) { long ret = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(o != null ? o.ptr : 0); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -56,7 +56,7 @@ public class Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ extends CommonBas /** * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ in the error state. */ - public static Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ err(APIError e) { + public static Result_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ err(org.ldk.structs.APIError e) { long ret = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_C2Tuple_PaymentHashPaymentSecretZNoneZ.java b/src/main/java/org/ldk/structs/Result_C2Tuple_PaymentHashPaymentSecretZNoneZ.java index 27c3a567..5d79cad9 100644 --- a/src/main/java/org/ldk/structs/Result_C2Tuple_PaymentHashPaymentSecretZNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_C2Tuple_PaymentHashPaymentSecretZNoneZ.java @@ -40,7 +40,7 @@ public class Result_C2Tuple_PaymentHashPaymentSecretZNoneZ extends CommonBase { /** * Creates a new CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ in the success state. */ - public static Result_C2Tuple_PaymentHashPaymentSecretZNoneZ ok(TwoTuple_PaymentHashPaymentSecretZ o) { + public static Result_C2Tuple_PaymentHashPaymentSecretZNoneZ ok(org.ldk.structs.TwoTuple_PaymentHashPaymentSecretZ o) { long ret = bindings.CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(o != null ? o.ptr : 0); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.java b/src/main/java/org/ldk/structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.java index 15d10042..eb710840 100644 --- a/src/main/java/org/ldk/structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.java @@ -40,7 +40,7 @@ public class Result_C2Tuple_SignatureCVec_SignatureZZNoneZ extends CommonBase { /** * Creates a new CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ in the success state. */ - public static Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ok(TwoTuple_SignatureCVec_SignatureZZ o) { + public static Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ok(org.ldk.structs.TwoTuple_SignatureCVec_SignatureZZ o) { long ret = bindings.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(o != null ? o.ptr : 0); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_C2Tuple_SignatureSignatureZNoneZ.java b/src/main/java/org/ldk/structs/Result_C2Tuple_SignatureSignatureZNoneZ.java index 4a76cbe5..02fd1898 100644 --- a/src/main/java/org/ldk/structs/Result_C2Tuple_SignatureSignatureZNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_C2Tuple_SignatureSignatureZNoneZ.java @@ -40,7 +40,7 @@ public class Result_C2Tuple_SignatureSignatureZNoneZ extends CommonBase { /** * Creates a new CResult_C2Tuple_SignatureSignatureZNoneZ in the success state. */ - public static Result_C2Tuple_SignatureSignatureZNoneZ ok(TwoTuple_SignatureSignatureZ o) { + public static Result_C2Tuple_SignatureSignatureZNoneZ ok(org.ldk.structs.TwoTuple_SignatureSignatureZ o) { long ret = bindings.CResult_C2Tuple_SignatureSignatureZNoneZ_ok(o != null ? o.ptr : 0); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } 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 9567e9a0..683e3fff 100644 --- a/src/main/java/org/ldk/structs/Result_COption_ClosureReasonZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_COption_ClosureReasonZDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_COption_ClosureReasonZDecodeErrorZ extends CommonBase { /** * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the success state. */ - public static Result_COption_ClosureReasonZDecodeErrorZ ok(Option_ClosureReasonZ o) { + public static Result_COption_ClosureReasonZDecodeErrorZ ok(org.ldk.structs.Option_ClosureReasonZ o) { long ret = bindings.CResult_COption_ClosureReasonZDecodeErrorZ_ok(o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -56,7 +56,7 @@ public class Result_COption_ClosureReasonZDecodeErrorZ extends CommonBase { /** * Creates a new CResult_COption_ClosureReasonZDecodeErrorZ in the error state. */ - public static Result_COption_ClosureReasonZDecodeErrorZ err(DecodeError e) { + public static Result_COption_ClosureReasonZDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_COption_ClosureReasonZDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_COption_CustomOnionMessageContentsZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_COption_CustomOnionMessageContentsZDecodeErrorZ.java index ddcaeac8..860db7cb 100644 --- a/src/main/java/org/ldk/structs/Result_COption_CustomOnionMessageContentsZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_COption_CustomOnionMessageContentsZDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_COption_CustomOnionMessageContentsZDecodeErrorZ extends Comm /** * Creates a new CResult_COption_CustomOnionMessageContentsZDecodeErrorZ in the success state. */ - public static Result_COption_CustomOnionMessageContentsZDecodeErrorZ ok(Option_CustomOnionMessageContentsZ o) { + public static Result_COption_CustomOnionMessageContentsZDecodeErrorZ ok(org.ldk.structs.Option_CustomOnionMessageContentsZ o) { long ret = bindings.CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_ok(o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -56,7 +56,7 @@ public class Result_COption_CustomOnionMessageContentsZDecodeErrorZ extends Comm /** * Creates a new CResult_COption_CustomOnionMessageContentsZDecodeErrorZ in the error state. */ - public static Result_COption_CustomOnionMessageContentsZDecodeErrorZ err(DecodeError e) { + public static Result_COption_CustomOnionMessageContentsZDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } 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 ad1ee9b3..3ceca9cd 100644 --- a/src/main/java/org/ldk/structs/Result_COption_EventZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_COption_EventZDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_COption_EventZDecodeErrorZ extends CommonBase { /** * Creates a new CResult_COption_EventZDecodeErrorZ in the success state. */ - public static Result_COption_EventZDecodeErrorZ ok(Option_EventZ o) { + public static Result_COption_EventZDecodeErrorZ ok(org.ldk.structs.Option_EventZ o) { long ret = bindings.CResult_COption_EventZDecodeErrorZ_ok(o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -56,7 +56,7 @@ public class Result_COption_EventZDecodeErrorZ extends CommonBase { /** * Creates a new CResult_COption_EventZDecodeErrorZ in the error state. */ - public static Result_COption_EventZDecodeErrorZ err(DecodeError e) { + public static Result_COption_EventZDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_COption_EventZDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_COption_HTLCDestinationZDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_COption_HTLCDestinationZDecodeErrorZ.java index 74a2aea5..f9e5e50a 100644 --- a/src/main/java/org/ldk/structs/Result_COption_HTLCDestinationZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_COption_HTLCDestinationZDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_COption_HTLCDestinationZDecodeErrorZ extends CommonBase { /** * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the success state. */ - public static Result_COption_HTLCDestinationZDecodeErrorZ ok(Option_HTLCDestinationZ o) { + public static Result_COption_HTLCDestinationZDecodeErrorZ ok(org.ldk.structs.Option_HTLCDestinationZ o) { long ret = bindings.CResult_COption_HTLCDestinationZDecodeErrorZ_ok(o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -56,7 +56,7 @@ public class Result_COption_HTLCDestinationZDecodeErrorZ extends CommonBase { /** * Creates a new CResult_COption_HTLCDestinationZDecodeErrorZ in the error state. */ - public static Result_COption_HTLCDestinationZDecodeErrorZ err(DecodeError e) { + public static Result_COption_HTLCDestinationZDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_COption_HTLCDestinationZDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } 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 a20c5aba..5ebfcbe9 100644 --- a/src/main/java/org/ldk/structs/Result_COption_MonitorEventZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_COption_MonitorEventZDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_COption_MonitorEventZDecodeErrorZ extends CommonBase { /** * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the success state. */ - public static Result_COption_MonitorEventZDecodeErrorZ ok(Option_MonitorEventZ o) { + public static Result_COption_MonitorEventZDecodeErrorZ ok(org.ldk.structs.Option_MonitorEventZ o) { long ret = bindings.CResult_COption_MonitorEventZDecodeErrorZ_ok(o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -56,7 +56,7 @@ public class Result_COption_MonitorEventZDecodeErrorZ extends CommonBase { /** * Creates a new CResult_COption_MonitorEventZDecodeErrorZ in the error state. */ - public static Result_COption_MonitorEventZDecodeErrorZ err(DecodeError e) { + public static Result_COption_MonitorEventZDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_COption_MonitorEventZDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } 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 71552e25..ed223cc0 100644 --- a/src/main/java/org/ldk/structs/Result_COption_NetworkUpdateZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_COption_NetworkUpdateZDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_COption_NetworkUpdateZDecodeErrorZ extends CommonBase { /** * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the success state. */ - public static Result_COption_NetworkUpdateZDecodeErrorZ ok(Option_NetworkUpdateZ o) { + public static Result_COption_NetworkUpdateZDecodeErrorZ ok(org.ldk.structs.Option_NetworkUpdateZ o) { long ret = bindings.CResult_COption_NetworkUpdateZDecodeErrorZ_ok(o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -56,7 +56,7 @@ public class Result_COption_NetworkUpdateZDecodeErrorZ extends CommonBase { /** * Creates a new CResult_COption_NetworkUpdateZDecodeErrorZ in the error state. */ - public static Result_COption_NetworkUpdateZDecodeErrorZ err(DecodeError e) { + public static Result_COption_NetworkUpdateZDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_COption_NetworkUpdateZDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } 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 7514dfbf..c549e436 100644 --- a/src/main/java/org/ldk/structs/Result_COption_TypeZDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_COption_TypeZDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_COption_TypeZDecodeErrorZ extends CommonBase { /** * Creates a new CResult_COption_TypeZDecodeErrorZ in the success state. */ - public static Result_COption_TypeZDecodeErrorZ ok(Option_TypeZ o) { + public static Result_COption_TypeZDecodeErrorZ ok(org.ldk.structs.Option_TypeZ o) { long ret = bindings.CResult_COption_TypeZDecodeErrorZ_ok(o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -56,7 +56,7 @@ public class Result_COption_TypeZDecodeErrorZ extends CommonBase { /** * Creates a new CResult_COption_TypeZDecodeErrorZ in the error state. */ - public static Result_COption_TypeZDecodeErrorZ err(DecodeError e) { + public static Result_COption_TypeZDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_COption_TypeZDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } 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 e30deff5..8b2b9ce7 100644 --- a/src/main/java/org/ldk/structs/Result_CVec_u8ZPeerHandleErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_CVec_u8ZPeerHandleErrorZ.java @@ -53,7 +53,7 @@ public class Result_CVec_u8ZPeerHandleErrorZ extends CommonBase { /** * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state. */ - public static Result_CVec_u8ZPeerHandleErrorZ err(PeerHandleError e) { + public static Result_CVec_u8ZPeerHandleErrorZ err(org.ldk.structs.PeerHandleError e) { long ret = bindings.CResult_CVec_u8ZPeerHandleErrorZ_err(e == null ? 0 : e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.java index 08a4f77b..b710488a 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_ChannelAnnouncementDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state. */ - public static Result_ChannelAnnouncementDecodeErrorZ ok(ChannelAnnouncement o) { + public static Result_ChannelAnnouncementDecodeErrorZ ok(org.ldk.structs.ChannelAnnouncement o) { long ret = bindings.CResult_ChannelAnnouncementDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_ChannelAnnouncementDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the error state. */ - public static Result_ChannelAnnouncementDecodeErrorZ err(DecodeError e) { + public static Result_ChannelAnnouncementDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_ChannelAnnouncementDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.java index 9bbb221c..c481a0e3 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_ChannelConfigDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state. */ - public static Result_ChannelConfigDecodeErrorZ ok(ChannelConfig o) { + public static Result_ChannelConfigDecodeErrorZ ok(org.ldk.structs.ChannelConfig o) { long ret = bindings.CResult_ChannelConfigDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_ChannelConfigDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ChannelConfigDecodeErrorZ in the error state. */ - public static Result_ChannelConfigDecodeErrorZ err(DecodeError e) { + public static Result_ChannelConfigDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_ChannelConfigDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelCounterpartyDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelCounterpartyDecodeErrorZ.java index e91c4625..5fa1e0ae 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelCounterpartyDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelCounterpartyDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_ChannelCounterpartyDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the success state. */ - public static Result_ChannelCounterpartyDecodeErrorZ ok(ChannelCounterparty o) { + public static Result_ChannelCounterpartyDecodeErrorZ ok(org.ldk.structs.ChannelCounterparty o) { long ret = bindings.CResult_ChannelCounterpartyDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_ChannelCounterpartyDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the error state. */ - public static Result_ChannelCounterpartyDecodeErrorZ err(DecodeError e) { + public static Result_ChannelCounterpartyDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_ChannelCounterpartyDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelDetailsDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelDetailsDecodeErrorZ.java index 6d81560d..f9cbb1ca 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelDetailsDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelDetailsDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_ChannelDetailsDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ChannelDetailsDecodeErrorZ in the success state. */ - public static Result_ChannelDetailsDecodeErrorZ ok(ChannelDetails o) { + public static Result_ChannelDetailsDecodeErrorZ ok(org.ldk.structs.ChannelDetails o) { long ret = bindings.CResult_ChannelDetailsDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_ChannelDetailsDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ChannelDetailsDecodeErrorZ in the error state. */ - public static Result_ChannelDetailsDecodeErrorZ err(DecodeError e) { + public static Result_ChannelDetailsDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_ChannelDetailsDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.java index 7271abf4..6cc56347 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_ChannelFeaturesDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state. */ - public static Result_ChannelFeaturesDecodeErrorZ ok(ChannelFeatures o) { + public static Result_ChannelFeaturesDecodeErrorZ ok(org.ldk.structs.ChannelFeatures o) { long ret = bindings.CResult_ChannelFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_ChannelFeaturesDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the error state. */ - public static Result_ChannelFeaturesDecodeErrorZ err(DecodeError e) { + public static Result_ChannelFeaturesDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_ChannelFeaturesDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.java index 1273c74c..d36ac5a9 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_ChannelInfoDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state. */ - public static Result_ChannelInfoDecodeErrorZ ok(ChannelInfo o) { + public static Result_ChannelInfoDecodeErrorZ ok(org.ldk.structs.ChannelInfo o) { long ret = bindings.CResult_ChannelInfoDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_ChannelInfoDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ChannelInfoDecodeErrorZ in the error state. */ - public static Result_ChannelInfoDecodeErrorZ err(DecodeError e) { + public static Result_ChannelInfoDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_ChannelInfoDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.java index e45f178e..40cb1740 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_ChannelMonitorUpdateDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state. */ - public static Result_ChannelMonitorUpdateDecodeErrorZ ok(ChannelMonitorUpdate o) { + public static Result_ChannelMonitorUpdateDecodeErrorZ ok(org.ldk.structs.ChannelMonitorUpdate o) { long ret = bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_ChannelMonitorUpdateDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the error state. */ - public static Result_ChannelMonitorUpdateDecodeErrorZ err(DecodeError e) { + public static Result_ChannelMonitorUpdateDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.java index 17bb92eb..9115fac1 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_ChannelPublicKeysDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state. */ - public static Result_ChannelPublicKeysDecodeErrorZ ok(ChannelPublicKeys o) { + public static Result_ChannelPublicKeysDecodeErrorZ ok(org.ldk.structs.ChannelPublicKeys o) { long ret = bindings.CResult_ChannelPublicKeysDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_ChannelPublicKeysDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the error state. */ - public static Result_ChannelPublicKeysDecodeErrorZ err(DecodeError e) { + public static Result_ChannelPublicKeysDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_ChannelPublicKeysDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelReadyDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelReadyDecodeErrorZ.java index d689e6a8..40f30b6f 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelReadyDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelReadyDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_ChannelReadyDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ChannelReadyDecodeErrorZ in the success state. */ - public static Result_ChannelReadyDecodeErrorZ ok(ChannelReady o) { + public static Result_ChannelReadyDecodeErrorZ ok(org.ldk.structs.ChannelReady o) { long ret = bindings.CResult_ChannelReadyDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_ChannelReadyDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ChannelReadyDecodeErrorZ in the error state. */ - public static Result_ChannelReadyDecodeErrorZ err(DecodeError e) { + public static Result_ChannelReadyDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_ChannelReadyDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.java index 4b2a0cf4..9079d7e8 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_ChannelReestablishDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state. */ - public static Result_ChannelReestablishDecodeErrorZ ok(ChannelReestablish o) { + public static Result_ChannelReestablishDecodeErrorZ ok(org.ldk.structs.ChannelReestablish o) { long ret = bindings.CResult_ChannelReestablishDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_ChannelReestablishDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ChannelReestablishDecodeErrorZ in the error state. */ - public static Result_ChannelReestablishDecodeErrorZ err(DecodeError e) { + public static Result_ChannelReestablishDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_ChannelReestablishDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.java index ef325e45..5bfc9297 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_ChannelTransactionParametersDecodeErrorZ extends CommonBase /** * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state. */ - public static Result_ChannelTransactionParametersDecodeErrorZ ok(ChannelTransactionParameters o) { + public static Result_ChannelTransactionParametersDecodeErrorZ ok(org.ldk.structs.ChannelTransactionParameters o) { long ret = bindings.CResult_ChannelTransactionParametersDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_ChannelTransactionParametersDecodeErrorZ extends CommonBase /** * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the error state. */ - public static Result_ChannelTransactionParametersDecodeErrorZ err(DecodeError e) { + public static Result_ChannelTransactionParametersDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_ChannelTransactionParametersDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelTypeFeaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelTypeFeaturesDecodeErrorZ.java index ea96cd98..f503e7cf 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelTypeFeaturesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelTypeFeaturesDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_ChannelTypeFeaturesDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the success state. */ - public static Result_ChannelTypeFeaturesDecodeErrorZ ok(ChannelTypeFeatures o) { + public static Result_ChannelTypeFeaturesDecodeErrorZ ok(org.ldk.structs.ChannelTypeFeatures o) { long ret = bindings.CResult_ChannelTypeFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_ChannelTypeFeaturesDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the error state. */ - public static Result_ChannelTypeFeaturesDecodeErrorZ err(DecodeError e) { + public static Result_ChannelTypeFeaturesDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_ChannelTypeFeaturesDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.java index 187b3823..efe33a93 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_ChannelUpdateDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state. */ - public static Result_ChannelUpdateDecodeErrorZ ok(ChannelUpdate o) { + public static Result_ChannelUpdateDecodeErrorZ ok(org.ldk.structs.ChannelUpdate o) { long ret = bindings.CResult_ChannelUpdateDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_ChannelUpdateDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ChannelUpdateDecodeErrorZ in the error state. */ - public static Result_ChannelUpdateDecodeErrorZ err(DecodeError e) { + public static Result_ChannelUpdateDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_ChannelUpdateDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_ChannelUpdateInfoDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ChannelUpdateInfoDecodeErrorZ.java index 86516cd5..80dbf162 100644 --- a/src/main/java/org/ldk/structs/Result_ChannelUpdateInfoDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ChannelUpdateInfoDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_ChannelUpdateInfoDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the success state. */ - public static Result_ChannelUpdateInfoDecodeErrorZ ok(ChannelUpdateInfo o) { + public static Result_ChannelUpdateInfoDecodeErrorZ ok(org.ldk.structs.ChannelUpdateInfo o) { long ret = bindings.CResult_ChannelUpdateInfoDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_ChannelUpdateInfoDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the error state. */ - public static Result_ChannelUpdateInfoDecodeErrorZ err(DecodeError e) { + public static Result_ChannelUpdateInfoDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_ChannelUpdateInfoDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.java index 50b60ff3..f87d0950 100644 --- a/src/main/java/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_ClosingSignedDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state. */ - public static Result_ClosingSignedDecodeErrorZ ok(ClosingSigned o) { + public static Result_ClosingSignedDecodeErrorZ ok(org.ldk.structs.ClosingSigned o) { long ret = bindings.CResult_ClosingSignedDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_ClosingSignedDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ClosingSignedDecodeErrorZ in the error state. */ - public static Result_ClosingSignedDecodeErrorZ err(DecodeError e) { + public static Result_ClosingSignedDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_ClosingSignedDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.java index 784acc15..cb0fa799 100644 --- a/src/main/java/org/ldk/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_ClosingSignedFeeRangeDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the success state. */ - public static Result_ClosingSignedFeeRangeDecodeErrorZ ok(ClosingSignedFeeRange o) { + public static Result_ClosingSignedFeeRangeDecodeErrorZ ok(org.ldk.structs.ClosingSignedFeeRange o) { long ret = bindings.CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_ClosingSignedFeeRangeDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the error state. */ - public static Result_ClosingSignedFeeRangeDecodeErrorZ err(DecodeError e) { + public static Result_ClosingSignedFeeRangeDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_ClosingSignedFeeRangeDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.java index 28a2da47..0b0148f5 100644 --- a/src/main/java/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_CommitmentSignedDecodeErrorZ extends CommonBase { /** * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state. */ - public static Result_CommitmentSignedDecodeErrorZ ok(CommitmentSigned o) { + public static Result_CommitmentSignedDecodeErrorZ ok(org.ldk.structs.CommitmentSigned o) { long ret = bindings.CResult_CommitmentSignedDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_CommitmentSignedDecodeErrorZ extends CommonBase { /** * Creates a new CResult_CommitmentSignedDecodeErrorZ in the error state. */ - public static Result_CommitmentSignedDecodeErrorZ err(DecodeError e) { + public static Result_CommitmentSignedDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_CommitmentSignedDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.java index 9c872797..99e1d770 100644 --- a/src/main/java/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_CommitmentTransactionDecodeErrorZ extends CommonBase { /** * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state. */ - public static Result_CommitmentTransactionDecodeErrorZ ok(CommitmentTransaction o) { + public static Result_CommitmentTransactionDecodeErrorZ ok(org.ldk.structs.CommitmentTransaction o) { long ret = bindings.CResult_CommitmentTransactionDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_CommitmentTransactionDecodeErrorZ extends CommonBase { /** * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the error state. */ - public static Result_CommitmentTransactionDecodeErrorZ err(DecodeError e) { + public static Result_CommitmentTransactionDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_CommitmentTransactionDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.java index 68f1fef5..20a8f489 100644 --- a/src/main/java/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_CounterpartyChannelTransactionParametersDecodeErrorZ extends /** * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state. */ - public static Result_CounterpartyChannelTransactionParametersDecodeErrorZ ok(CounterpartyChannelTransactionParameters o) { + public static Result_CounterpartyChannelTransactionParametersDecodeErrorZ ok(org.ldk.structs.CounterpartyChannelTransactionParameters o) { long ret = bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_CounterpartyChannelTransactionParametersDecodeErrorZ extends /** * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the error state. */ - public static Result_CounterpartyChannelTransactionParametersDecodeErrorZ err(DecodeError e) { + public static Result_CounterpartyChannelTransactionParametersDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_CounterpartyCommitmentSecretsDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_CounterpartyCommitmentSecretsDecodeErrorZ.java index bc115351..bfd3bfc0 100644 --- a/src/main/java/org/ldk/structs/Result_CounterpartyCommitmentSecretsDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_CounterpartyCommitmentSecretsDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_CounterpartyCommitmentSecretsDecodeErrorZ extends CommonBase /** * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the success state. */ - public static Result_CounterpartyCommitmentSecretsDecodeErrorZ ok(CounterpartyCommitmentSecrets o) { + public static Result_CounterpartyCommitmentSecretsDecodeErrorZ ok(org.ldk.structs.CounterpartyCommitmentSecrets o) { long ret = bindings.CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_CounterpartyCommitmentSecretsDecodeErrorZ extends CommonBase /** * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the error state. */ - public static Result_CounterpartyCommitmentSecretsDecodeErrorZ err(DecodeError e) { + public static Result_CounterpartyCommitmentSecretsDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_CounterpartyForwardingInfoDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_CounterpartyForwardingInfoDecodeErrorZ.java index f6054131..e48f0068 100644 --- a/src/main/java/org/ldk/structs/Result_CounterpartyForwardingInfoDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_CounterpartyForwardingInfoDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_CounterpartyForwardingInfoDecodeErrorZ extends CommonBase { /** * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the success state. */ - public static Result_CounterpartyForwardingInfoDecodeErrorZ ok(CounterpartyForwardingInfo o) { + public static Result_CounterpartyForwardingInfoDecodeErrorZ ok(org.ldk.structs.CounterpartyForwardingInfo o) { long ret = bindings.CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_CounterpartyForwardingInfoDecodeErrorZ extends CommonBase { /** * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the error state. */ - public static Result_CounterpartyForwardingInfoDecodeErrorZ err(DecodeError e) { + public static Result_CounterpartyForwardingInfoDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_CounterpartyForwardingInfoDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.java index b90d69aa..d8cddc27 100644 --- a/src/main/java/org/ldk/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_DelayedPaymentOutputDescriptorDecodeErrorZ extends CommonBas /** * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state. */ - public static Result_DelayedPaymentOutputDescriptorDecodeErrorZ ok(DelayedPaymentOutputDescriptor o) { + public static Result_DelayedPaymentOutputDescriptorDecodeErrorZ ok(org.ldk.structs.DelayedPaymentOutputDescriptor o) { long ret = bindings.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_DelayedPaymentOutputDescriptorDecodeErrorZ extends CommonBas /** * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the error state. */ - public static Result_DelayedPaymentOutputDescriptorDecodeErrorZ err(DecodeError e) { + public static Result_DelayedPaymentOutputDescriptorDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_DescriptionCreationErrorZ.java b/src/main/java/org/ldk/structs/Result_DescriptionCreationErrorZ.java index d260cac8..f141a163 100644 --- a/src/main/java/org/ldk/structs/Result_DescriptionCreationErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_DescriptionCreationErrorZ.java @@ -42,7 +42,7 @@ public class Result_DescriptionCreationErrorZ extends CommonBase { /** * Creates a new CResult_DescriptionCreationErrorZ in the success state. */ - public static Result_DescriptionCreationErrorZ ok(Description o) { + public static Result_DescriptionCreationErrorZ ok(org.ldk.structs.Description o) { long ret = bindings.CResult_DescriptionCreationErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.java index 12199032..80eae4b5 100644 --- a/src/main/java/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_ErrorMessageDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state. */ - public static Result_ErrorMessageDecodeErrorZ ok(ErrorMessage o) { + public static Result_ErrorMessageDecodeErrorZ ok(org.ldk.structs.ErrorMessage o) { long ret = bindings.CResult_ErrorMessageDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_ErrorMessageDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ErrorMessageDecodeErrorZ in the error state. */ - public static Result_ErrorMessageDecodeErrorZ err(DecodeError e) { + public static Result_ErrorMessageDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_ErrorMessageDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_FixedPenaltyScorerDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_FixedPenaltyScorerDecodeErrorZ.java index d01454b9..9cae4c48 100644 --- a/src/main/java/org/ldk/structs/Result_FixedPenaltyScorerDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_FixedPenaltyScorerDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_FixedPenaltyScorerDecodeErrorZ extends CommonBase { /** * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the success state. */ - public static Result_FixedPenaltyScorerDecodeErrorZ ok(FixedPenaltyScorer o) { + public static Result_FixedPenaltyScorerDecodeErrorZ ok(org.ldk.structs.FixedPenaltyScorer o) { long ret = bindings.CResult_FixedPenaltyScorerDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_FixedPenaltyScorerDecodeErrorZ extends CommonBase { /** * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the error state. */ - public static Result_FixedPenaltyScorerDecodeErrorZ err(DecodeError e) { + public static Result_FixedPenaltyScorerDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_FixedPenaltyScorerDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.java index 0fd8f15e..a798503a 100644 --- a/src/main/java/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_FundingCreatedDecodeErrorZ extends CommonBase { /** * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state. */ - public static Result_FundingCreatedDecodeErrorZ ok(FundingCreated o) { + public static Result_FundingCreatedDecodeErrorZ ok(org.ldk.structs.FundingCreated o) { long ret = bindings.CResult_FundingCreatedDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_FundingCreatedDecodeErrorZ extends CommonBase { /** * Creates a new CResult_FundingCreatedDecodeErrorZ in the error state. */ - public static Result_FundingCreatedDecodeErrorZ err(DecodeError e) { + public static Result_FundingCreatedDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_FundingCreatedDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_FundingSignedDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_FundingSignedDecodeErrorZ.java index 6a7d8dde..17d5464e 100644 --- a/src/main/java/org/ldk/structs/Result_FundingSignedDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_FundingSignedDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_FundingSignedDecodeErrorZ extends CommonBase { /** * Creates a new CResult_FundingSignedDecodeErrorZ in the success state. */ - public static Result_FundingSignedDecodeErrorZ ok(FundingSigned o) { + public static Result_FundingSignedDecodeErrorZ ok(org.ldk.structs.FundingSigned o) { long ret = bindings.CResult_FundingSignedDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_FundingSignedDecodeErrorZ extends CommonBase { /** * Creates a new CResult_FundingSignedDecodeErrorZ in the error state. */ - public static Result_FundingSignedDecodeErrorZ err(DecodeError e) { + public static Result_FundingSignedDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_FundingSignedDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.java index d4762ba2..ec6fcaa0 100644 --- a/src/main/java/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_GossipTimestampFilterDecodeErrorZ extends CommonBase { /** * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state. */ - public static Result_GossipTimestampFilterDecodeErrorZ ok(GossipTimestampFilter o) { + public static Result_GossipTimestampFilterDecodeErrorZ ok(org.ldk.structs.GossipTimestampFilter o) { long ret = bindings.CResult_GossipTimestampFilterDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_GossipTimestampFilterDecodeErrorZ extends CommonBase { /** * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the error state. */ - public static Result_GossipTimestampFilterDecodeErrorZ err(DecodeError e) { + public static Result_GossipTimestampFilterDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_GossipTimestampFilterDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.java index 6c196093..ccc39e76 100644 --- a/src/main/java/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_HTLCOutputInCommitmentDecodeErrorZ extends CommonBase { /** * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state. */ - public static Result_HTLCOutputInCommitmentDecodeErrorZ ok(HTLCOutputInCommitment o) { + public static Result_HTLCOutputInCommitmentDecodeErrorZ ok(org.ldk.structs.HTLCOutputInCommitment o) { long ret = bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_HTLCOutputInCommitmentDecodeErrorZ extends CommonBase { /** * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the error state. */ - public static Result_HTLCOutputInCommitmentDecodeErrorZ err(DecodeError e) { + public static Result_HTLCOutputInCommitmentDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.java index e9ac6289..2280933c 100644 --- a/src/main/java/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_HTLCUpdateDecodeErrorZ extends CommonBase { /** * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state. */ - public static Result_HTLCUpdateDecodeErrorZ ok(HTLCUpdate o) { + public static Result_HTLCUpdateDecodeErrorZ ok(org.ldk.structs.HTLCUpdate o) { long ret = bindings.CResult_HTLCUpdateDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_HTLCUpdateDecodeErrorZ extends CommonBase { /** * Creates a new CResult_HTLCUpdateDecodeErrorZ in the error state. */ - public static Result_HTLCUpdateDecodeErrorZ err(DecodeError e) { + public static Result_HTLCUpdateDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_HTLCUpdateDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.java index f54a5686..34a55904 100644 --- a/src/main/java/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_HolderCommitmentTransactionDecodeErrorZ extends CommonBase { /** * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state. */ - public static Result_HolderCommitmentTransactionDecodeErrorZ ok(HolderCommitmentTransaction o) { + public static Result_HolderCommitmentTransactionDecodeErrorZ ok(org.ldk.structs.HolderCommitmentTransaction o) { long ret = bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_HolderCommitmentTransactionDecodeErrorZ extends CommonBase { /** * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the error state. */ - public static Result_HolderCommitmentTransactionDecodeErrorZ err(DecodeError e) { + public static Result_HolderCommitmentTransactionDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_InFlightHtlcsDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_InFlightHtlcsDecodeErrorZ.java index 244f783f..d40acacb 100644 --- a/src/main/java/org/ldk/structs/Result_InFlightHtlcsDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InFlightHtlcsDecodeErrorZ.java @@ -45,27 +45,19 @@ public class Result_InFlightHtlcsDecodeErrorZ extends CommonBase { /** * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the success state. */ - public static Result_InFlightHtlcsDecodeErrorZ ok(InFlightHtlcs o) { + public static Result_InFlightHtlcsDecodeErrorZ ok(org.ldk.structs.InFlightHtlcs o) { long ret = bindings.CResult_InFlightHtlcsDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } Result_InFlightHtlcsDecodeErrorZ ret_hu_conv = Result_InFlightHtlcsDecodeErrorZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; - // Due to rust's strict-ownership memory model, in some cases we need to "move" - // an object to pass exclusive ownership to the function being called. - // In most cases, we avoid ret_hu_conv being visible in GC'd languages by cloning the object - // at the FFI layer, creating a new object which Rust can claim ownership of - // However, in some cases (eg here), there is no way to clone an object, and thus - // we actually have to pass full ownership to Rust. - // Thus, after ret_hu_conv call, o is reset to null and is now a dummy object. - o.ptr = 0;; return ret_hu_conv; } /** * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the error state. */ - public static Result_InFlightHtlcsDecodeErrorZ err(DecodeError e) { + public static Result_InFlightHtlcsDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_InFlightHtlcsDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } @@ -82,4 +74,22 @@ public class Result_InFlightHtlcsDecodeErrorZ extends CommonBase { return ret; } + long clone_ptr() { + long ret = bindings.CResult_InFlightHtlcsDecodeErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_InFlightHtlcsDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_InFlightHtlcsDecodeErrorZ clone() { + long ret = bindings.CResult_InFlightHtlcsDecodeErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InFlightHtlcsDecodeErrorZ ret_hu_conv = Result_InFlightHtlcsDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } diff --git a/src/main/java/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.java index 407625e7..4408c75b 100644 --- a/src/main/java/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_InMemorySignerDecodeErrorZ extends CommonBase { /** * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state. */ - public static Result_InMemorySignerDecodeErrorZ ok(InMemorySigner o) { + public static Result_InMemorySignerDecodeErrorZ ok(org.ldk.structs.InMemorySigner o) { long ret = bindings.CResult_InMemorySignerDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_InMemorySignerDecodeErrorZ extends CommonBase { /** * Creates a new CResult_InMemorySignerDecodeErrorZ in the error state. */ - public static Result_InMemorySignerDecodeErrorZ err(DecodeError e) { + public static Result_InMemorySignerDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_InMemorySignerDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_InitDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_InitDecodeErrorZ.java index d698f749..a4168ada 100644 --- a/src/main/java/org/ldk/structs/Result_InitDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InitDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_InitDecodeErrorZ extends CommonBase { /** * Creates a new CResult_InitDecodeErrorZ in the success state. */ - public static Result_InitDecodeErrorZ ok(Init o) { + public static Result_InitDecodeErrorZ ok(org.ldk.structs.Init o) { long ret = bindings.CResult_InitDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_InitDecodeErrorZ extends CommonBase { /** * Creates a new CResult_InitDecodeErrorZ in the error state. */ - public static Result_InitDecodeErrorZ err(DecodeError e) { + public static Result_InitDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_InitDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.java index 70a28990..b9bda8c1 100644 --- a/src/main/java/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_InitFeaturesDecodeErrorZ extends CommonBase { /** * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state. */ - public static Result_InitFeaturesDecodeErrorZ ok(InitFeatures o) { + public static Result_InitFeaturesDecodeErrorZ ok(org.ldk.structs.InitFeatures o) { long ret = bindings.CResult_InitFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_InitFeaturesDecodeErrorZ extends CommonBase { /** * Creates a new CResult_InitFeaturesDecodeErrorZ in the error state. */ - public static Result_InitFeaturesDecodeErrorZ err(DecodeError e) { + public static Result_InitFeaturesDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_InitFeaturesDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_InvoiceFeaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_InvoiceFeaturesDecodeErrorZ.java index ff5da758..3d87850b 100644 --- a/src/main/java/org/ldk/structs/Result_InvoiceFeaturesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InvoiceFeaturesDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_InvoiceFeaturesDecodeErrorZ extends CommonBase { /** * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the success state. */ - public static Result_InvoiceFeaturesDecodeErrorZ ok(InvoiceFeatures o) { + public static Result_InvoiceFeaturesDecodeErrorZ ok(org.ldk.structs.InvoiceFeatures o) { long ret = bindings.CResult_InvoiceFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_InvoiceFeaturesDecodeErrorZ extends CommonBase { /** * Creates a new CResult_InvoiceFeaturesDecodeErrorZ in the error state. */ - public static Result_InvoiceFeaturesDecodeErrorZ err(DecodeError e) { + public static Result_InvoiceFeaturesDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_InvoiceFeaturesDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_InvoiceParseOrSemanticErrorZ.java b/src/main/java/org/ldk/structs/Result_InvoiceParseOrSemanticErrorZ.java index 8197cbf9..f0013147 100644 --- a/src/main/java/org/ldk/structs/Result_InvoiceParseOrSemanticErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InvoiceParseOrSemanticErrorZ.java @@ -45,7 +45,7 @@ public class Result_InvoiceParseOrSemanticErrorZ extends CommonBase { /** * Creates a new CResult_InvoiceParseOrSemanticErrorZ in the success state. */ - public static Result_InvoiceParseOrSemanticErrorZ ok(Invoice o) { + public static Result_InvoiceParseOrSemanticErrorZ ok(org.ldk.structs.Invoice o) { long ret = bindings.CResult_InvoiceParseOrSemanticErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_InvoiceParseOrSemanticErrorZ extends CommonBase { /** * Creates a new CResult_InvoiceParseOrSemanticErrorZ in the error state. */ - public static Result_InvoiceParseOrSemanticErrorZ err(ParseOrSemanticError e) { + public static Result_InvoiceParseOrSemanticErrorZ err(org.ldk.structs.ParseOrSemanticError e) { long ret = bindings.CResult_InvoiceParseOrSemanticErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_InvoiceRequestFeaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_InvoiceRequestFeaturesDecodeErrorZ.java new file mode 100644 index 00000000..d5017d7c --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_InvoiceRequestFeaturesDecodeErrorZ.java @@ -0,0 +1,95 @@ +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_InvoiceRequestFeaturesDecodeErrorZ extends CommonBase { + private Result_InvoiceRequestFeaturesDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_InvoiceRequestFeaturesDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_InvoiceRequestFeaturesDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_InvoiceRequestFeaturesDecodeErrorZ_is_ok(ptr)) { + return new Result_InvoiceRequestFeaturesDecodeErrorZ_OK(null, ptr); + } else { + return new Result_InvoiceRequestFeaturesDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_InvoiceRequestFeaturesDecodeErrorZ_OK extends Result_InvoiceRequestFeaturesDecodeErrorZ { + public final InvoiceRequestFeatures res; + private Result_InvoiceRequestFeaturesDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.CResult_InvoiceRequestFeaturesDecodeErrorZ_get_ok(ptr); + org.ldk.structs.InvoiceRequestFeatures res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.InvoiceRequestFeatures(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; + this.res = res_hu_conv; + } + } + + public static final class Result_InvoiceRequestFeaturesDecodeErrorZ_Err extends Result_InvoiceRequestFeaturesDecodeErrorZ { + public final DecodeError err; + private Result_InvoiceRequestFeaturesDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.CResult_InvoiceRequestFeaturesDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_InvoiceRequestFeaturesDecodeErrorZ in the success state. + */ + public static Result_InvoiceRequestFeaturesDecodeErrorZ ok(org.ldk.structs.InvoiceRequestFeatures o) { + long ret = bindings.CResult_InvoiceRequestFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceRequestFeaturesDecodeErrorZ ret_hu_conv = Result_InvoiceRequestFeaturesDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_InvoiceRequestFeaturesDecodeErrorZ in the error state. + */ + public static Result_InvoiceRequestFeaturesDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_InvoiceRequestFeaturesDecodeErrorZ_err(e.ptr); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceRequestFeaturesDecodeErrorZ ret_hu_conv = Result_InvoiceRequestFeaturesDecodeErrorZ.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_InvoiceRequestFeaturesDecodeErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_InvoiceRequestFeaturesDecodeErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_InvoiceRequestFeaturesDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_InvoiceRequestFeaturesDecodeErrorZ clone() { + long ret = bindings.CResult_InvoiceRequestFeaturesDecodeErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceRequestFeaturesDecodeErrorZ ret_hu_conv = Result_InvoiceRequestFeaturesDecodeErrorZ.constr_from_ptr(ret); + return ret_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 a076e106..69d49027 100644 --- a/src/main/java/org/ldk/structs/Result_InvoiceSemanticErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InvoiceSemanticErrorZ.java @@ -42,7 +42,7 @@ public class Result_InvoiceSemanticErrorZ extends CommonBase { /** * Creates a new CResult_InvoiceSemanticErrorZ in the success state. */ - public static Result_InvoiceSemanticErrorZ ok(Invoice o) { + public static Result_InvoiceSemanticErrorZ ok(org.ldk.structs.Invoice o) { long ret = bindings.CResult_InvoiceSemanticErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_InvoiceSignOrCreationErrorZ.java b/src/main/java/org/ldk/structs/Result_InvoiceSignOrCreationErrorZ.java index c886fb39..73648043 100644 --- a/src/main/java/org/ldk/structs/Result_InvoiceSignOrCreationErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_InvoiceSignOrCreationErrorZ.java @@ -45,7 +45,7 @@ public class Result_InvoiceSignOrCreationErrorZ extends CommonBase { /** * Creates a new CResult_InvoiceSignOrCreationErrorZ in the success state. */ - public static Result_InvoiceSignOrCreationErrorZ ok(Invoice o) { + public static Result_InvoiceSignOrCreationErrorZ ok(org.ldk.structs.Invoice o) { long ret = bindings.CResult_InvoiceSignOrCreationErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_InvoiceSignOrCreationErrorZ extends CommonBase { /** * Creates a new CResult_InvoiceSignOrCreationErrorZ in the error state. */ - public static Result_InvoiceSignOrCreationErrorZ err(SignOrCreationError e) { + public static Result_InvoiceSignOrCreationErrorZ err(org.ldk.structs.SignOrCreationError e) { long ret = bindings.CResult_InvoiceSignOrCreationErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_LockedChannelMonitorNoneZ.java b/src/main/java/org/ldk/structs/Result_LockedChannelMonitorNoneZ.java index bbf05394..47332e4c 100644 --- a/src/main/java/org/ldk/structs/Result_LockedChannelMonitorNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_LockedChannelMonitorNoneZ.java @@ -40,7 +40,7 @@ public class Result_LockedChannelMonitorNoneZ extends CommonBase { /** * Creates a new CResult_LockedChannelMonitorNoneZ in the success state. */ - public static Result_LockedChannelMonitorNoneZ ok(LockedChannelMonitor o) { + public static Result_LockedChannelMonitorNoneZ ok(org.ldk.structs.LockedChannelMonitor o) { long ret = bindings.CResult_LockedChannelMonitorNoneZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_NetAddressDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NetAddressDecodeErrorZ.java index 0fb1183a..6048c1fd 100644 --- a/src/main/java/org/ldk/structs/Result_NetAddressDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NetAddressDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_NetAddressDecodeErrorZ extends CommonBase { /** * Creates a new CResult_NetAddressDecodeErrorZ in the success state. */ - public static Result_NetAddressDecodeErrorZ ok(NetAddress o) { + public static Result_NetAddressDecodeErrorZ ok(org.ldk.structs.NetAddress o) { long ret = bindings.CResult_NetAddressDecodeErrorZ_ok(o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -56,7 +56,7 @@ public class Result_NetAddressDecodeErrorZ extends CommonBase { /** * Creates a new CResult_NetAddressDecodeErrorZ in the error state. */ - public static Result_NetAddressDecodeErrorZ err(DecodeError e) { + public static Result_NetAddressDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_NetAddressDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.java index 4ef6bca7..87451a60 100644 --- a/src/main/java/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.java @@ -59,7 +59,7 @@ public class Result_NetworkGraphDecodeErrorZ extends CommonBase { /** * Creates a new CResult_NetworkGraphDecodeErrorZ in the error state. */ - public static Result_NetworkGraphDecodeErrorZ err(DecodeError e) { + public static Result_NetworkGraphDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_NetworkGraphDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_NodeAliasDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NodeAliasDecodeErrorZ.java index 27a82aef..a0052ef8 100644 --- a/src/main/java/org/ldk/structs/Result_NodeAliasDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NodeAliasDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_NodeAliasDecodeErrorZ extends CommonBase { /** * Creates a new CResult_NodeAliasDecodeErrorZ in the success state. */ - public static Result_NodeAliasDecodeErrorZ ok(NodeAlias o) { + public static Result_NodeAliasDecodeErrorZ ok(org.ldk.structs.NodeAlias o) { long ret = bindings.CResult_NodeAliasDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_NodeAliasDecodeErrorZ extends CommonBase { /** * Creates a new CResult_NodeAliasDecodeErrorZ in the error state. */ - public static Result_NodeAliasDecodeErrorZ err(DecodeError e) { + public static Result_NodeAliasDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_NodeAliasDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.java index 99bb36af..acb7db62 100644 --- a/src/main/java/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_NodeAnnouncementDecodeErrorZ extends CommonBase { /** * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state. */ - public static Result_NodeAnnouncementDecodeErrorZ ok(NodeAnnouncement o) { + public static Result_NodeAnnouncementDecodeErrorZ ok(org.ldk.structs.NodeAnnouncement o) { long ret = bindings.CResult_NodeAnnouncementDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_NodeAnnouncementDecodeErrorZ extends CommonBase { /** * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the error state. */ - public static Result_NodeAnnouncementDecodeErrorZ err(DecodeError e) { + public static Result_NodeAnnouncementDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_NodeAnnouncementDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.java index 98f054d1..7a35f67f 100644 --- a/src/main/java/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_NodeAnnouncementInfoDecodeErrorZ extends CommonBase { /** * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state. */ - public static Result_NodeAnnouncementInfoDecodeErrorZ ok(NodeAnnouncementInfo o) { + public static Result_NodeAnnouncementInfoDecodeErrorZ ok(org.ldk.structs.NodeAnnouncementInfo o) { long ret = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_NodeAnnouncementInfoDecodeErrorZ extends CommonBase { /** * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the error state. */ - public static Result_NodeAnnouncementInfoDecodeErrorZ err(DecodeError e) { + public static Result_NodeAnnouncementInfoDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.java index 80c373fb..c2ecc005 100644 --- a/src/main/java/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_NodeFeaturesDecodeErrorZ extends CommonBase { /** * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state. */ - public static Result_NodeFeaturesDecodeErrorZ ok(NodeFeatures o) { + public static Result_NodeFeaturesDecodeErrorZ ok(org.ldk.structs.NodeFeatures o) { long ret = bindings.CResult_NodeFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_NodeFeaturesDecodeErrorZ extends CommonBase { /** * Creates a new CResult_NodeFeaturesDecodeErrorZ in the error state. */ - public static Result_NodeFeaturesDecodeErrorZ err(DecodeError e) { + public static Result_NodeFeaturesDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_NodeFeaturesDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_NodeIdDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NodeIdDecodeErrorZ.java index 91ef8d69..16c17231 100644 --- a/src/main/java/org/ldk/structs/Result_NodeIdDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NodeIdDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_NodeIdDecodeErrorZ extends CommonBase { /** * Creates a new CResult_NodeIdDecodeErrorZ in the success state. */ - public static Result_NodeIdDecodeErrorZ ok(NodeId o) { + public static Result_NodeIdDecodeErrorZ ok(org.ldk.structs.NodeId o) { long ret = bindings.CResult_NodeIdDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_NodeIdDecodeErrorZ extends CommonBase { /** * Creates a new CResult_NodeIdDecodeErrorZ in the error state. */ - public static Result_NodeIdDecodeErrorZ err(DecodeError e) { + public static Result_NodeIdDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_NodeIdDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_NodeInfoDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_NodeInfoDecodeErrorZ.java index e90fc2fc..cc03cf9f 100644 --- a/src/main/java/org/ldk/structs/Result_NodeInfoDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NodeInfoDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_NodeInfoDecodeErrorZ extends CommonBase { /** * Creates a new CResult_NodeInfoDecodeErrorZ in the success state. */ - public static Result_NodeInfoDecodeErrorZ ok(NodeInfo o) { + public static Result_NodeInfoDecodeErrorZ ok(org.ldk.structs.NodeInfo o) { long ret = bindings.CResult_NodeInfoDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_NodeInfoDecodeErrorZ extends CommonBase { /** * Creates a new CResult_NodeInfoDecodeErrorZ in the error state. */ - public static Result_NodeInfoDecodeErrorZ err(DecodeError e) { + public static Result_NodeInfoDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_NodeInfoDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_NoneAPIErrorZ.java b/src/main/java/org/ldk/structs/Result_NoneAPIErrorZ.java index 2367878f..dd7b843a 100644 --- a/src/main/java/org/ldk/structs/Result_NoneAPIErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NoneAPIErrorZ.java @@ -50,7 +50,7 @@ public class Result_NoneAPIErrorZ extends CommonBase { /** * Creates a new CResult_NoneAPIErrorZ in the error state. */ - public static Result_NoneAPIErrorZ err(APIError e) { + public static Result_NoneAPIErrorZ err(org.ldk.structs.APIError e) { long ret = bindings.CResult_NoneAPIErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_NoneLightningErrorZ.java b/src/main/java/org/ldk/structs/Result_NoneLightningErrorZ.java index 934c1599..823a07e3 100644 --- a/src/main/java/org/ldk/structs/Result_NoneLightningErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NoneLightningErrorZ.java @@ -50,7 +50,7 @@ public class Result_NoneLightningErrorZ extends CommonBase { /** * Creates a new CResult_NoneLightningErrorZ in the error state. */ - public static Result_NoneLightningErrorZ err(LightningError e) { + public static Result_NoneLightningErrorZ err(org.ldk.structs.LightningError e) { long ret = bindings.CResult_NoneLightningErrorZ_err(e == null ? 0 : e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_NonePaymentErrorZ.java b/src/main/java/org/ldk/structs/Result_NonePaymentErrorZ.java new file mode 100644 index 00000000..7bccf9a3 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_NonePaymentErrorZ.java @@ -0,0 +1,88 @@ +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_NonePaymentErrorZ extends CommonBase { + private Result_NonePaymentErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_NonePaymentErrorZ_free(ptr); } super.finalize(); + } + + static Result_NonePaymentErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_NonePaymentErrorZ_is_ok(ptr)) { + return new Result_NonePaymentErrorZ_OK(null, ptr); + } else { + return new Result_NonePaymentErrorZ_Err(null, ptr); + } + } + public static final class Result_NonePaymentErrorZ_OK extends Result_NonePaymentErrorZ { + private Result_NonePaymentErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + } + } + + public static final class Result_NonePaymentErrorZ_Err extends Result_NonePaymentErrorZ { + public final PaymentError err; + private Result_NonePaymentErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.CResult_NonePaymentErrorZ_get_err(ptr); + org.ldk.structs.PaymentError err_hu_conv = org.ldk.structs.PaymentError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_NonePaymentErrorZ in the success state. + */ + public static Result_NonePaymentErrorZ ok() { + long ret = bindings.CResult_NonePaymentErrorZ_ok(); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NonePaymentErrorZ ret_hu_conv = Result_NonePaymentErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_NonePaymentErrorZ in the error state. + */ + public static Result_NonePaymentErrorZ err(org.ldk.structs.PaymentError e) { + long ret = bindings.CResult_NonePaymentErrorZ_err(e.ptr); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NonePaymentErrorZ ret_hu_conv = Result_NonePaymentErrorZ.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_NonePaymentErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_NonePaymentErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_NonePaymentErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_NonePaymentErrorZ clone() { + long ret = bindings.CResult_NonePaymentErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NonePaymentErrorZ ret_hu_conv = Result_NonePaymentErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_NonePaymentSendFailureZ.java b/src/main/java/org/ldk/structs/Result_NonePaymentSendFailureZ.java index eaf618a5..712e4179 100644 --- a/src/main/java/org/ldk/structs/Result_NonePaymentSendFailureZ.java +++ b/src/main/java/org/ldk/structs/Result_NonePaymentSendFailureZ.java @@ -50,7 +50,7 @@ public class Result_NonePaymentSendFailureZ extends CommonBase { /** * Creates a new CResult_NonePaymentSendFailureZ in the error state. */ - public static Result_NonePaymentSendFailureZ err(PaymentSendFailure e) { + public static Result_NonePaymentSendFailureZ err(org.ldk.structs.PaymentSendFailure e) { long ret = bindings.CResult_NonePaymentSendFailureZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_NonePeerHandleErrorZ.java b/src/main/java/org/ldk/structs/Result_NonePeerHandleErrorZ.java index 40ce60e4..58114ca6 100644 --- a/src/main/java/org/ldk/structs/Result_NonePeerHandleErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NonePeerHandleErrorZ.java @@ -50,7 +50,7 @@ public class Result_NonePeerHandleErrorZ extends CommonBase { /** * Creates a new CResult_NonePeerHandleErrorZ in the error state. */ - public static Result_NonePeerHandleErrorZ err(PeerHandleError e) { + public static Result_NonePeerHandleErrorZ err(org.ldk.structs.PeerHandleError e) { long ret = bindings.CResult_NonePeerHandleErrorZ_err(e == null ? 0 : e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_NoneSendErrorZ.java b/src/main/java/org/ldk/structs/Result_NoneSendErrorZ.java index 9aed4238..b99691d8 100644 --- a/src/main/java/org/ldk/structs/Result_NoneSendErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_NoneSendErrorZ.java @@ -50,7 +50,7 @@ public class Result_NoneSendErrorZ extends CommonBase { /** * Creates a new CResult_NoneSendErrorZ in the error state. */ - public static Result_NoneSendErrorZ err(SendError e) { + public static Result_NoneSendErrorZ err(org.ldk.structs.SendError e) { long ret = bindings.CResult_NoneSendErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_OfferFeaturesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_OfferFeaturesDecodeErrorZ.java new file mode 100644 index 00000000..64f19c90 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_OfferFeaturesDecodeErrorZ.java @@ -0,0 +1,95 @@ +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_OfferFeaturesDecodeErrorZ extends CommonBase { + private Result_OfferFeaturesDecodeErrorZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_OfferFeaturesDecodeErrorZ_free(ptr); } super.finalize(); + } + + static Result_OfferFeaturesDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_OfferFeaturesDecodeErrorZ_is_ok(ptr)) { + return new Result_OfferFeaturesDecodeErrorZ_OK(null, ptr); + } else { + return new Result_OfferFeaturesDecodeErrorZ_Err(null, ptr); + } + } + public static final class Result_OfferFeaturesDecodeErrorZ_OK extends Result_OfferFeaturesDecodeErrorZ { + public final OfferFeatures res; + private Result_OfferFeaturesDecodeErrorZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + long res = bindings.CResult_OfferFeaturesDecodeErrorZ_get_ok(ptr); + org.ldk.structs.OfferFeatures res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.OfferFeatures(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; + this.res = res_hu_conv; + } + } + + public static final class Result_OfferFeaturesDecodeErrorZ_Err extends Result_OfferFeaturesDecodeErrorZ { + public final DecodeError err; + private Result_OfferFeaturesDecodeErrorZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.CResult_OfferFeaturesDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_OfferFeaturesDecodeErrorZ in the success state. + */ + public static Result_OfferFeaturesDecodeErrorZ ok(org.ldk.structs.OfferFeatures o) { + long ret = bindings.CResult_OfferFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OfferFeaturesDecodeErrorZ ret_hu_conv = Result_OfferFeaturesDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_OfferFeaturesDecodeErrorZ in the error state. + */ + public static Result_OfferFeaturesDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_OfferFeaturesDecodeErrorZ_err(e.ptr); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OfferFeaturesDecodeErrorZ ret_hu_conv = Result_OfferFeaturesDecodeErrorZ.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_OfferFeaturesDecodeErrorZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_OfferFeaturesDecodeErrorZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_OfferFeaturesDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_OfferFeaturesDecodeErrorZ clone() { + long ret = bindings.CResult_OfferFeaturesDecodeErrorZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OfferFeaturesDecodeErrorZ ret_hu_conv = Result_OfferFeaturesDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_OnionMessageDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_OnionMessageDecodeErrorZ.java index 10b544fc..f4264902 100644 --- a/src/main/java/org/ldk/structs/Result_OnionMessageDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_OnionMessageDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_OnionMessageDecodeErrorZ extends CommonBase { /** * Creates a new CResult_OnionMessageDecodeErrorZ in the success state. */ - public static Result_OnionMessageDecodeErrorZ ok(OnionMessage o) { + public static Result_OnionMessageDecodeErrorZ ok(org.ldk.structs.OnionMessage o) { long ret = bindings.CResult_OnionMessageDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_OnionMessageDecodeErrorZ extends CommonBase { /** * Creates a new CResult_OnionMessageDecodeErrorZ in the error state. */ - public static Result_OnionMessageDecodeErrorZ err(DecodeError e) { + public static Result_OnionMessageDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_OnionMessageDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_OpenChannelDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_OpenChannelDecodeErrorZ.java index cb20b4ee..b0db16ef 100644 --- a/src/main/java/org/ldk/structs/Result_OpenChannelDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_OpenChannelDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_OpenChannelDecodeErrorZ extends CommonBase { /** * Creates a new CResult_OpenChannelDecodeErrorZ in the success state. */ - public static Result_OpenChannelDecodeErrorZ ok(OpenChannel o) { + public static Result_OpenChannelDecodeErrorZ ok(org.ldk.structs.OpenChannel o) { long ret = bindings.CResult_OpenChannelDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_OpenChannelDecodeErrorZ extends CommonBase { /** * Creates a new CResult_OpenChannelDecodeErrorZ in the error state. */ - public static Result_OpenChannelDecodeErrorZ err(DecodeError e) { + public static Result_OpenChannelDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_OpenChannelDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_OutPointDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_OutPointDecodeErrorZ.java index 264d98e7..893188ef 100644 --- a/src/main/java/org/ldk/structs/Result_OutPointDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_OutPointDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_OutPointDecodeErrorZ extends CommonBase { /** * Creates a new CResult_OutPointDecodeErrorZ in the success state. */ - public static Result_OutPointDecodeErrorZ ok(OutPoint o) { + public static Result_OutPointDecodeErrorZ ok(org.ldk.structs.OutPoint o) { long ret = bindings.CResult_OutPointDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_OutPointDecodeErrorZ extends CommonBase { /** * Creates a new CResult_OutPointDecodeErrorZ in the error state. */ - public static Result_OutPointDecodeErrorZ err(DecodeError e) { + public static Result_OutPointDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_OutPointDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_PayeePubKeyErrorZ.java b/src/main/java/org/ldk/structs/Result_PayeePubKeyErrorZ.java index 6b618e27..22b0ab93 100644 --- a/src/main/java/org/ldk/structs/Result_PayeePubKeyErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PayeePubKeyErrorZ.java @@ -42,7 +42,7 @@ public class Result_PayeePubKeyErrorZ extends CommonBase { /** * Creates a new CResult_PayeePubKeyErrorZ in the success state. */ - public static Result_PayeePubKeyErrorZ ok(PayeePubKey o) { + public static Result_PayeePubKeyErrorZ ok(org.ldk.structs.PayeePubKey o) { long ret = bindings.CResult_PayeePubKeyErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_PaymentHashPaymentSendFailureZ.java b/src/main/java/org/ldk/structs/Result_PaymentHashPaymentSendFailureZ.java new file mode 100644 index 00000000..fa614c63 --- /dev/null +++ b/src/main/java/org/ldk/structs/Result_PaymentHashPaymentSendFailureZ.java @@ -0,0 +1,91 @@ +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_PaymentHashPaymentSendFailureZ extends CommonBase { + private Result_PaymentHashPaymentSendFailureZ(Object _dummy, long ptr) { super(ptr); } + protected void finalize() throws Throwable { + if (ptr != 0) { bindings.CResult_PaymentHashPaymentSendFailureZ_free(ptr); } super.finalize(); + } + + static Result_PaymentHashPaymentSendFailureZ constr_from_ptr(long ptr) { + if (bindings.CResult_PaymentHashPaymentSendFailureZ_is_ok(ptr)) { + return new Result_PaymentHashPaymentSendFailureZ_OK(null, ptr); + } else { + return new Result_PaymentHashPaymentSendFailureZ_Err(null, ptr); + } + } + public static final class Result_PaymentHashPaymentSendFailureZ_OK extends Result_PaymentHashPaymentSendFailureZ { + public final byte[] res; + private Result_PaymentHashPaymentSendFailureZ_OK(Object _dummy, long ptr) { + super(_dummy, ptr); + this.res = bindings.CResult_PaymentHashPaymentSendFailureZ_get_ok(ptr); + } + } + + public static final class Result_PaymentHashPaymentSendFailureZ_Err extends Result_PaymentHashPaymentSendFailureZ { + public final PaymentSendFailure err; + private Result_PaymentHashPaymentSendFailureZ_Err(Object _dummy, long ptr) { + super(_dummy, ptr); + long err = bindings.CResult_PaymentHashPaymentSendFailureZ_get_err(ptr); + org.ldk.structs.PaymentSendFailure err_hu_conv = org.ldk.structs.PaymentSendFailure.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_PaymentHashPaymentSendFailureZ in the success state. + */ + public static Result_PaymentHashPaymentSendFailureZ ok(byte[] o) { + long ret = bindings.CResult_PaymentHashPaymentSendFailureZ_ok(InternalUtils.check_arr_len(o, 32)); + Reference.reachabilityFence(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_PaymentHashPaymentSendFailureZ ret_hu_conv = Result_PaymentHashPaymentSendFailureZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_PaymentHashPaymentSendFailureZ in the error state. + */ + public static Result_PaymentHashPaymentSendFailureZ err(org.ldk.structs.PaymentSendFailure e) { + long ret = bindings.CResult_PaymentHashPaymentSendFailureZ_err(e.ptr); + Reference.reachabilityFence(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_PaymentHashPaymentSendFailureZ ret_hu_conv = Result_PaymentHashPaymentSendFailureZ.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_PaymentHashPaymentSendFailureZ_is_ok(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.CResult_PaymentHashPaymentSendFailureZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new CResult_PaymentHashPaymentSendFailureZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_PaymentHashPaymentSendFailureZ clone() { + long ret = bindings.CResult_PaymentHashPaymentSendFailureZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_PaymentHashPaymentSendFailureZ ret_hu_conv = Result_PaymentHashPaymentSendFailureZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/Result_PaymentIdPaymentErrorZ.java b/src/main/java/org/ldk/structs/Result_PaymentIdPaymentErrorZ.java index 209936a8..dcd3da06 100644 --- a/src/main/java/org/ldk/structs/Result_PaymentIdPaymentErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PaymentIdPaymentErrorZ.java @@ -53,7 +53,7 @@ public class Result_PaymentIdPaymentErrorZ extends CommonBase { /** * Creates a new CResult_PaymentIdPaymentErrorZ in the error state. */ - public static Result_PaymentIdPaymentErrorZ err(PaymentError e) { + public static Result_PaymentIdPaymentErrorZ err(org.ldk.structs.PaymentError e) { long ret = bindings.CResult_PaymentIdPaymentErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_PaymentIdPaymentSendFailureZ.java b/src/main/java/org/ldk/structs/Result_PaymentIdPaymentSendFailureZ.java deleted file mode 100644 index 8bb8799e..00000000 --- a/src/main/java/org/ldk/structs/Result_PaymentIdPaymentSendFailureZ.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; - -public class Result_PaymentIdPaymentSendFailureZ extends CommonBase { - private Result_PaymentIdPaymentSendFailureZ(Object _dummy, long ptr) { super(ptr); } - protected void finalize() throws Throwable { - if (ptr != 0) { bindings.CResult_PaymentIdPaymentSendFailureZ_free(ptr); } super.finalize(); - } - - static Result_PaymentIdPaymentSendFailureZ constr_from_ptr(long ptr) { - if (bindings.CResult_PaymentIdPaymentSendFailureZ_is_ok(ptr)) { - return new Result_PaymentIdPaymentSendFailureZ_OK(null, ptr); - } else { - return new Result_PaymentIdPaymentSendFailureZ_Err(null, ptr); - } - } - public static final class Result_PaymentIdPaymentSendFailureZ_OK extends Result_PaymentIdPaymentSendFailureZ { - public final byte[] res; - private Result_PaymentIdPaymentSendFailureZ_OK(Object _dummy, long ptr) { - super(_dummy, ptr); - this.res = bindings.CResult_PaymentIdPaymentSendFailureZ_get_ok(ptr); - } - } - - public static final class Result_PaymentIdPaymentSendFailureZ_Err extends Result_PaymentIdPaymentSendFailureZ { - public final PaymentSendFailure err; - private Result_PaymentIdPaymentSendFailureZ_Err(Object _dummy, long ptr) { - super(_dummy, ptr); - long err = bindings.CResult_PaymentIdPaymentSendFailureZ_get_err(ptr); - org.ldk.structs.PaymentSendFailure err_hu_conv = org.ldk.structs.PaymentSendFailure.constr_from_ptr(err); - if (err_hu_conv != null) { err_hu_conv.ptrs_to.add(this); }; - this.err = err_hu_conv; - } - } - - /** - * Creates a new CResult_PaymentIdPaymentSendFailureZ in the success state. - */ - public static Result_PaymentIdPaymentSendFailureZ ok(byte[] o) { - long ret = bindings.CResult_PaymentIdPaymentSendFailureZ_ok(InternalUtils.check_arr_len(o, 32)); - Reference.reachabilityFence(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_PaymentIdPaymentSendFailureZ ret_hu_conv = Result_PaymentIdPaymentSendFailureZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Creates a new CResult_PaymentIdPaymentSendFailureZ in the error state. - */ - public static Result_PaymentIdPaymentSendFailureZ err(PaymentSendFailure e) { - long ret = bindings.CResult_PaymentIdPaymentSendFailureZ_err(e.ptr); - Reference.reachabilityFence(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_PaymentIdPaymentSendFailureZ ret_hu_conv = Result_PaymentIdPaymentSendFailureZ.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_PaymentIdPaymentSendFailureZ_is_ok(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - long clone_ptr() { - long ret = bindings.CResult_PaymentIdPaymentSendFailureZ_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a new CResult_PaymentIdPaymentSendFailureZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_PaymentIdPaymentSendFailureZ clone() { - long ret = bindings.CResult_PaymentIdPaymentSendFailureZ_clone(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_PaymentIdPaymentSendFailureZ ret_hu_conv = Result_PaymentIdPaymentSendFailureZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} diff --git a/src/main/java/org/ldk/structs/Result_PaymentParametersDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_PaymentParametersDecodeErrorZ.java index d67e6972..7b922870 100644 --- a/src/main/java/org/ldk/structs/Result_PaymentParametersDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PaymentParametersDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_PaymentParametersDecodeErrorZ extends CommonBase { /** * Creates a new CResult_PaymentParametersDecodeErrorZ in the success state. */ - public static Result_PaymentParametersDecodeErrorZ ok(PaymentParameters o) { + public static Result_PaymentParametersDecodeErrorZ ok(org.ldk.structs.PaymentParameters o) { long ret = bindings.CResult_PaymentParametersDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_PaymentParametersDecodeErrorZ extends CommonBase { /** * Creates a new CResult_PaymentParametersDecodeErrorZ in the error state. */ - public static Result_PaymentParametersDecodeErrorZ err(DecodeError e) { + public static Result_PaymentParametersDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_PaymentParametersDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_PaymentPreimageAPIErrorZ.java b/src/main/java/org/ldk/structs/Result_PaymentPreimageAPIErrorZ.java index 4dc39228..4307ba65 100644 --- a/src/main/java/org/ldk/structs/Result_PaymentPreimageAPIErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PaymentPreimageAPIErrorZ.java @@ -53,7 +53,7 @@ public class Result_PaymentPreimageAPIErrorZ extends CommonBase { /** * Creates a new CResult_PaymentPreimageAPIErrorZ in the error state. */ - public static Result_PaymentPreimageAPIErrorZ err(APIError e) { + public static Result_PaymentPreimageAPIErrorZ err(org.ldk.structs.APIError e) { long ret = bindings.CResult_PaymentPreimageAPIErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_PaymentPurposeDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_PaymentPurposeDecodeErrorZ.java index 9b87d603..7f1c2371 100644 --- a/src/main/java/org/ldk/structs/Result_PaymentPurposeDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PaymentPurposeDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_PaymentPurposeDecodeErrorZ extends CommonBase { /** * Creates a new CResult_PaymentPurposeDecodeErrorZ in the success state. */ - public static Result_PaymentPurposeDecodeErrorZ ok(PaymentPurpose o) { + public static Result_PaymentPurposeDecodeErrorZ ok(org.ldk.structs.PaymentPurpose o) { long ret = bindings.CResult_PaymentPurposeDecodeErrorZ_ok(o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -56,7 +56,7 @@ public class Result_PaymentPurposeDecodeErrorZ extends CommonBase { /** * Creates a new CResult_PaymentPurposeDecodeErrorZ in the error state. */ - public static Result_PaymentPurposeDecodeErrorZ err(DecodeError e) { + public static Result_PaymentPurposeDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_PaymentPurposeDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_PaymentSecretAPIErrorZ.java b/src/main/java/org/ldk/structs/Result_PaymentSecretAPIErrorZ.java index b718a39f..7d086cf6 100644 --- a/src/main/java/org/ldk/structs/Result_PaymentSecretAPIErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PaymentSecretAPIErrorZ.java @@ -53,7 +53,7 @@ public class Result_PaymentSecretAPIErrorZ extends CommonBase { /** * Creates a new CResult_PaymentSecretAPIErrorZ in the error state. */ - public static Result_PaymentSecretAPIErrorZ err(APIError e) { + public static Result_PaymentSecretAPIErrorZ err(org.ldk.structs.APIError e) { long ret = bindings.CResult_PaymentSecretAPIErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_PhantomRouteHintsDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_PhantomRouteHintsDecodeErrorZ.java index 5c213ff6..c49411b3 100644 --- a/src/main/java/org/ldk/structs/Result_PhantomRouteHintsDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PhantomRouteHintsDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_PhantomRouteHintsDecodeErrorZ extends CommonBase { /** * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the success state. */ - public static Result_PhantomRouteHintsDecodeErrorZ ok(PhantomRouteHints o) { + public static Result_PhantomRouteHintsDecodeErrorZ ok(org.ldk.structs.PhantomRouteHints o) { long ret = bindings.CResult_PhantomRouteHintsDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_PhantomRouteHintsDecodeErrorZ extends CommonBase { /** * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the error state. */ - public static Result_PhantomRouteHintsDecodeErrorZ err(DecodeError e) { + public static Result_PhantomRouteHintsDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_PhantomRouteHintsDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_PingDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_PingDecodeErrorZ.java index cb042b89..3be8daad 100644 --- a/src/main/java/org/ldk/structs/Result_PingDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PingDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_PingDecodeErrorZ extends CommonBase { /** * Creates a new CResult_PingDecodeErrorZ in the success state. */ - public static Result_PingDecodeErrorZ ok(Ping o) { + public static Result_PingDecodeErrorZ ok(org.ldk.structs.Ping o) { long ret = bindings.CResult_PingDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_PingDecodeErrorZ extends CommonBase { /** * Creates a new CResult_PingDecodeErrorZ in the error state. */ - public static Result_PingDecodeErrorZ err(DecodeError e) { + public static Result_PingDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_PingDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_PongDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_PongDecodeErrorZ.java index 8412a352..dc5ee0c4 100644 --- a/src/main/java/org/ldk/structs/Result_PongDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PongDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_PongDecodeErrorZ extends CommonBase { /** * Creates a new CResult_PongDecodeErrorZ in the success state. */ - public static Result_PongDecodeErrorZ ok(Pong o) { + public static Result_PongDecodeErrorZ ok(org.ldk.structs.Pong o) { long ret = bindings.CResult_PongDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_PongDecodeErrorZ extends CommonBase { /** * Creates a new CResult_PongDecodeErrorZ in the error state. */ - public static Result_PongDecodeErrorZ err(DecodeError e) { + public static Result_PongDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_PongDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_PositiveTimestampCreationErrorZ.java b/src/main/java/org/ldk/structs/Result_PositiveTimestampCreationErrorZ.java index 364386e3..62c3ba5e 100644 --- a/src/main/java/org/ldk/structs/Result_PositiveTimestampCreationErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PositiveTimestampCreationErrorZ.java @@ -42,7 +42,7 @@ public class Result_PositiveTimestampCreationErrorZ extends CommonBase { /** * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state. */ - public static Result_PositiveTimestampCreationErrorZ ok(PositiveTimestamp o) { + public static Result_PositiveTimestampCreationErrorZ ok(org.ldk.structs.PositiveTimestamp o) { long ret = bindings.CResult_PositiveTimestampCreationErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_PrivateRouteCreationErrorZ.java b/src/main/java/org/ldk/structs/Result_PrivateRouteCreationErrorZ.java index ca1ff97e..25213ffa 100644 --- a/src/main/java/org/ldk/structs/Result_PrivateRouteCreationErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_PrivateRouteCreationErrorZ.java @@ -42,7 +42,7 @@ public class Result_PrivateRouteCreationErrorZ extends CommonBase { /** * Creates a new CResult_PrivateRouteCreationErrorZ in the success state. */ - public static Result_PrivateRouteCreationErrorZ ok(PrivateRoute o) { + public static Result_PrivateRouteCreationErrorZ ok(org.ldk.structs.PrivateRoute o) { long ret = bindings.CResult_PrivateRouteCreationErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_ProbabilisticScorerDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ProbabilisticScorerDecodeErrorZ.java index f4a26e10..a7dc1c02 100644 --- a/src/main/java/org/ldk/structs/Result_ProbabilisticScorerDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ProbabilisticScorerDecodeErrorZ.java @@ -61,7 +61,7 @@ public class Result_ProbabilisticScorerDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the error state. */ - public static Result_ProbabilisticScorerDecodeErrorZ err(DecodeError e) { + public static Result_ProbabilisticScorerDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_ProbabilisticScorerDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.java index 0982c198..d920183d 100644 --- a/src/main/java/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_QueryChannelRangeDecodeErrorZ extends CommonBase { /** * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state. */ - public static Result_QueryChannelRangeDecodeErrorZ ok(QueryChannelRange o) { + public static Result_QueryChannelRangeDecodeErrorZ ok(org.ldk.structs.QueryChannelRange o) { long ret = bindings.CResult_QueryChannelRangeDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_QueryChannelRangeDecodeErrorZ extends CommonBase { /** * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the error state. */ - public static Result_QueryChannelRangeDecodeErrorZ err(DecodeError e) { + public static Result_QueryChannelRangeDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_QueryChannelRangeDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.java index 3908876d..8b481bd8 100644 --- a/src/main/java/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_QueryShortChannelIdsDecodeErrorZ extends CommonBase { /** * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state. */ - public static Result_QueryShortChannelIdsDecodeErrorZ ok(QueryShortChannelIds o) { + public static Result_QueryShortChannelIdsDecodeErrorZ ok(org.ldk.structs.QueryShortChannelIds o) { long ret = bindings.CResult_QueryShortChannelIdsDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_QueryShortChannelIdsDecodeErrorZ extends CommonBase { /** * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the error state. */ - public static Result_QueryShortChannelIdsDecodeErrorZ err(DecodeError e) { + public static Result_QueryShortChannelIdsDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_QueryShortChannelIdsDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.java index 8721492a..9e00d6e5 100644 --- a/src/main/java/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_ReplyChannelRangeDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state. */ - public static Result_ReplyChannelRangeDecodeErrorZ ok(ReplyChannelRange o) { + public static Result_ReplyChannelRangeDecodeErrorZ ok(org.ldk.structs.ReplyChannelRange o) { long ret = bindings.CResult_ReplyChannelRangeDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_ReplyChannelRangeDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the error state. */ - public static Result_ReplyChannelRangeDecodeErrorZ err(DecodeError e) { + public static Result_ReplyChannelRangeDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_ReplyChannelRangeDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.java index 1fd7ff0c..dde7fb81 100644 --- a/src/main/java/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_ReplyShortChannelIdsEndDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state. */ - public static Result_ReplyShortChannelIdsEndDecodeErrorZ ok(ReplyShortChannelIdsEnd o) { + public static Result_ReplyShortChannelIdsEndDecodeErrorZ ok(org.ldk.structs.ReplyShortChannelIdsEnd o) { long ret = bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_ReplyShortChannelIdsEndDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the error state. */ - public static Result_ReplyShortChannelIdsEndDecodeErrorZ err(DecodeError e) { + public static Result_ReplyShortChannelIdsEndDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.java index 1fae0ec1..b98baeb5 100644 --- a/src/main/java/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_RevokeAndACKDecodeErrorZ extends CommonBase { /** * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state. */ - public static Result_RevokeAndACKDecodeErrorZ ok(RevokeAndACK o) { + public static Result_RevokeAndACKDecodeErrorZ ok(org.ldk.structs.RevokeAndACK o) { long ret = bindings.CResult_RevokeAndACKDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_RevokeAndACKDecodeErrorZ extends CommonBase { /** * Creates a new CResult_RevokeAndACKDecodeErrorZ in the error state. */ - public static Result_RevokeAndACKDecodeErrorZ err(DecodeError e) { + public static Result_RevokeAndACKDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_RevokeAndACKDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_RouteDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RouteDecodeErrorZ.java index a11e2790..a69dcf66 100644 --- a/src/main/java/org/ldk/structs/Result_RouteDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RouteDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_RouteDecodeErrorZ extends CommonBase { /** * Creates a new CResult_RouteDecodeErrorZ in the success state. */ - public static Result_RouteDecodeErrorZ ok(Route o) { + public static Result_RouteDecodeErrorZ ok(org.ldk.structs.Route o) { long ret = bindings.CResult_RouteDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_RouteDecodeErrorZ extends CommonBase { /** * Creates a new CResult_RouteDecodeErrorZ in the error state. */ - public static Result_RouteDecodeErrorZ err(DecodeError e) { + public static Result_RouteDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_RouteDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_RouteHintDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RouteHintDecodeErrorZ.java index 517abd98..f7d5fbb9 100644 --- a/src/main/java/org/ldk/structs/Result_RouteHintDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RouteHintDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_RouteHintDecodeErrorZ extends CommonBase { /** * Creates a new CResult_RouteHintDecodeErrorZ in the success state. */ - public static Result_RouteHintDecodeErrorZ ok(RouteHint o) { + public static Result_RouteHintDecodeErrorZ ok(org.ldk.structs.RouteHint o) { long ret = bindings.CResult_RouteHintDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_RouteHintDecodeErrorZ extends CommonBase { /** * Creates a new CResult_RouteHintDecodeErrorZ in the error state. */ - public static Result_RouteHintDecodeErrorZ err(DecodeError e) { + public static Result_RouteHintDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_RouteHintDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_RouteHintHopDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RouteHintHopDecodeErrorZ.java index 476ad683..0774f744 100644 --- a/src/main/java/org/ldk/structs/Result_RouteHintHopDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RouteHintHopDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_RouteHintHopDecodeErrorZ extends CommonBase { /** * Creates a new CResult_RouteHintHopDecodeErrorZ in the success state. */ - public static Result_RouteHintHopDecodeErrorZ ok(RouteHintHop o) { + public static Result_RouteHintHopDecodeErrorZ ok(org.ldk.structs.RouteHintHop o) { long ret = bindings.CResult_RouteHintHopDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_RouteHintHopDecodeErrorZ extends CommonBase { /** * Creates a new CResult_RouteHintHopDecodeErrorZ in the error state. */ - public static Result_RouteHintHopDecodeErrorZ err(DecodeError e) { + public static Result_RouteHintHopDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_RouteHintHopDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_RouteHopDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RouteHopDecodeErrorZ.java index fe1af140..adde55fd 100644 --- a/src/main/java/org/ldk/structs/Result_RouteHopDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RouteHopDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_RouteHopDecodeErrorZ extends CommonBase { /** * Creates a new CResult_RouteHopDecodeErrorZ in the success state. */ - public static Result_RouteHopDecodeErrorZ ok(RouteHop o) { + public static Result_RouteHopDecodeErrorZ ok(org.ldk.structs.RouteHop o) { long ret = bindings.CResult_RouteHopDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_RouteHopDecodeErrorZ extends CommonBase { /** * Creates a new CResult_RouteHopDecodeErrorZ in the error state. */ - public static Result_RouteHopDecodeErrorZ err(DecodeError e) { + public static Result_RouteHopDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_RouteHopDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_RouteLightningErrorZ.java b/src/main/java/org/ldk/structs/Result_RouteLightningErrorZ.java index 055da55b..83b7b8b1 100644 --- a/src/main/java/org/ldk/structs/Result_RouteLightningErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RouteLightningErrorZ.java @@ -45,7 +45,7 @@ public class Result_RouteLightningErrorZ extends CommonBase { /** * Creates a new CResult_RouteLightningErrorZ in the success state. */ - public static Result_RouteLightningErrorZ ok(Route o) { + public static Result_RouteLightningErrorZ ok(org.ldk.structs.Route o) { long ret = bindings.CResult_RouteLightningErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_RouteLightningErrorZ extends CommonBase { /** * Creates a new CResult_RouteLightningErrorZ in the error state. */ - public static Result_RouteLightningErrorZ err(LightningError e) { + public static Result_RouteLightningErrorZ err(org.ldk.structs.LightningError e) { long ret = bindings.CResult_RouteLightningErrorZ_err(e == null ? 0 : e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_RouteParametersDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RouteParametersDecodeErrorZ.java index 1d725555..6b340b33 100644 --- a/src/main/java/org/ldk/structs/Result_RouteParametersDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RouteParametersDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_RouteParametersDecodeErrorZ extends CommonBase { /** * Creates a new CResult_RouteParametersDecodeErrorZ in the success state. */ - public static Result_RouteParametersDecodeErrorZ ok(RouteParameters o) { + public static Result_RouteParametersDecodeErrorZ ok(org.ldk.structs.RouteParameters o) { long ret = bindings.CResult_RouteParametersDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_RouteParametersDecodeErrorZ extends CommonBase { /** * Creates a new CResult_RouteParametersDecodeErrorZ in the error state. */ - public static Result_RouteParametersDecodeErrorZ err(DecodeError e) { + public static Result_RouteParametersDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_RouteParametersDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.java index 962132e9..0f957e65 100644 --- a/src/main/java/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_RoutingFeesDecodeErrorZ extends CommonBase { /** * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state. */ - public static Result_RoutingFeesDecodeErrorZ ok(RoutingFees o) { + public static Result_RoutingFeesDecodeErrorZ ok(org.ldk.structs.RoutingFees o) { long ret = bindings.CResult_RoutingFeesDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_RoutingFeesDecodeErrorZ extends CommonBase { /** * Creates a new CResult_RoutingFeesDecodeErrorZ in the error state. */ - public static Result_RoutingFeesDecodeErrorZ err(DecodeError e) { + public static Result_RoutingFeesDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_RoutingFeesDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_SecretKeyErrorZ.java b/src/main/java/org/ldk/structs/Result_SecretKeyErrorZ.java deleted file mode 100644 index a363f510..00000000 --- a/src/main/java/org/ldk/structs/Result_SecretKeyErrorZ.java +++ /dev/null @@ -1,88 +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_SecretKeyErrorZ extends CommonBase { - private Result_SecretKeyErrorZ(Object _dummy, long ptr) { super(ptr); } - protected void finalize() throws Throwable { - if (ptr != 0) { bindings.CResult_SecretKeyErrorZ_free(ptr); } super.finalize(); - } - - static Result_SecretKeyErrorZ constr_from_ptr(long ptr) { - if (bindings.CResult_SecretKeyErrorZ_is_ok(ptr)) { - return new Result_SecretKeyErrorZ_OK(null, ptr); - } else { - return new Result_SecretKeyErrorZ_Err(null, ptr); - } - } - public static final class Result_SecretKeyErrorZ_OK extends Result_SecretKeyErrorZ { - public final byte[] res; - private Result_SecretKeyErrorZ_OK(Object _dummy, long ptr) { - super(_dummy, ptr); - this.res = bindings.CResult_SecretKeyErrorZ_get_ok(ptr); - } - } - - public static final class Result_SecretKeyErrorZ_Err extends Result_SecretKeyErrorZ { - public final Secp256k1Error err; - private Result_SecretKeyErrorZ_Err(Object _dummy, long ptr) { - super(_dummy, ptr); - this.err = bindings.CResult_SecretKeyErrorZ_get_err(ptr); - } - } - - /** - * Creates a new CResult_SecretKeyErrorZ in the success state. - */ - public static Result_SecretKeyErrorZ ok(byte[] o) { - long ret = bindings.CResult_SecretKeyErrorZ_ok(InternalUtils.check_arr_len(o, 32)); - Reference.reachabilityFence(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_SecretKeyErrorZ ret_hu_conv = Result_SecretKeyErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - - /** - * Creates a new CResult_SecretKeyErrorZ in the error state. - */ - public static Result_SecretKeyErrorZ err(org.ldk.enums.Secp256k1Error e) { - long ret = bindings.CResult_SecretKeyErrorZ_err(e); - Reference.reachabilityFence(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_SecretKeyErrorZ ret_hu_conv = Result_SecretKeyErrorZ.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_SecretKeyErrorZ_is_ok(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - long clone_ptr() { - long ret = bindings.CResult_SecretKeyErrorZ_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a new CResult_SecretKeyErrorZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_SecretKeyErrorZ clone() { - long ret = bindings.CResult_SecretKeyErrorZ_clone(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_SecretKeyErrorZ ret_hu_conv = Result_SecretKeyErrorZ.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 45e942fb..85cc7140 100644 --- a/src/main/java/org/ldk/structs/Result_ShutdownDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ShutdownDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_ShutdownDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ShutdownDecodeErrorZ in the success state. */ - public static Result_ShutdownDecodeErrorZ ok(Shutdown o) { + public static Result_ShutdownDecodeErrorZ ok(org.ldk.structs.Shutdown o) { long ret = bindings.CResult_ShutdownDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_ShutdownDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ShutdownDecodeErrorZ in the error state. */ - public static Result_ShutdownDecodeErrorZ err(DecodeError e) { + public static Result_ShutdownDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_ShutdownDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_ShutdownScriptDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_ShutdownScriptDecodeErrorZ.java index aad00334..72730434 100644 --- a/src/main/java/org/ldk/structs/Result_ShutdownScriptDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_ShutdownScriptDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_ShutdownScriptDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ShutdownScriptDecodeErrorZ in the success state. */ - public static Result_ShutdownScriptDecodeErrorZ ok(ShutdownScript o) { + public static Result_ShutdownScriptDecodeErrorZ ok(org.ldk.structs.ShutdownScript o) { long ret = bindings.CResult_ShutdownScriptDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_ShutdownScriptDecodeErrorZ extends CommonBase { /** * Creates a new CResult_ShutdownScriptDecodeErrorZ in the error state. */ - public static Result_ShutdownScriptDecodeErrorZ err(DecodeError e) { + public static Result_ShutdownScriptDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_ShutdownScriptDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_ShutdownScriptInvalidShutdownScriptZ.java b/src/main/java/org/ldk/structs/Result_ShutdownScriptInvalidShutdownScriptZ.java index 81ecc53a..af239094 100644 --- a/src/main/java/org/ldk/structs/Result_ShutdownScriptInvalidShutdownScriptZ.java +++ b/src/main/java/org/ldk/structs/Result_ShutdownScriptInvalidShutdownScriptZ.java @@ -45,7 +45,7 @@ public class Result_ShutdownScriptInvalidShutdownScriptZ extends CommonBase { /** * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the success state. */ - public static Result_ShutdownScriptInvalidShutdownScriptZ ok(ShutdownScript o) { + public static Result_ShutdownScriptInvalidShutdownScriptZ ok(org.ldk.structs.ShutdownScript o) { long ret = bindings.CResult_ShutdownScriptInvalidShutdownScriptZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_ShutdownScriptInvalidShutdownScriptZ extends CommonBase { /** * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the error state. */ - public static Result_ShutdownScriptInvalidShutdownScriptZ err(InvalidShutdownScript e) { + public static Result_ShutdownScriptInvalidShutdownScriptZ err(org.ldk.structs.InvalidShutdownScript e) { long ret = bindings.CResult_ShutdownScriptInvalidShutdownScriptZ_err(e == null ? 0 : e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_SiPrefixParseErrorZ.java b/src/main/java/org/ldk/structs/Result_SiPrefixParseErrorZ.java index 11efd12f..0afe372c 100644 --- a/src/main/java/org/ldk/structs/Result_SiPrefixParseErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_SiPrefixParseErrorZ.java @@ -53,7 +53,7 @@ public class Result_SiPrefixParseErrorZ extends CommonBase { /** * Creates a new CResult_SiPrefixParseErrorZ in the error state. */ - public static Result_SiPrefixParseErrorZ err(ParseError e) { + public static Result_SiPrefixParseErrorZ err(org.ldk.structs.ParseError e) { long ret = bindings.CResult_SiPrefixParseErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_SignDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_SignDecodeErrorZ.java index 97dcda4a..f1f759b1 100644 --- a/src/main/java/org/ldk/structs/Result_SignDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_SignDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_SignDecodeErrorZ extends CommonBase { /** * Creates a new CResult_SignDecodeErrorZ in the success state. */ - public static Result_SignDecodeErrorZ ok(Sign o) { + public static Result_SignDecodeErrorZ ok(org.ldk.structs.Sign o) { long ret = bindings.CResult_SignDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_SignDecodeErrorZ extends CommonBase { /** * Creates a new CResult_SignDecodeErrorZ in the error state. */ - public static Result_SignDecodeErrorZ err(DecodeError e) { + public static Result_SignDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_SignDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_SignedRawInvoiceParseErrorZ.java b/src/main/java/org/ldk/structs/Result_SignedRawInvoiceParseErrorZ.java index 0553403d..b75d3530 100644 --- a/src/main/java/org/ldk/structs/Result_SignedRawInvoiceParseErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_SignedRawInvoiceParseErrorZ.java @@ -45,7 +45,7 @@ public class Result_SignedRawInvoiceParseErrorZ extends CommonBase { /** * Creates a new CResult_SignedRawInvoiceParseErrorZ in the success state. */ - public static Result_SignedRawInvoiceParseErrorZ ok(SignedRawInvoice o) { + public static Result_SignedRawInvoiceParseErrorZ ok(org.ldk.structs.SignedRawInvoice o) { long ret = bindings.CResult_SignedRawInvoiceParseErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_SignedRawInvoiceParseErrorZ extends CommonBase { /** * Creates a new CResult_SignedRawInvoiceParseErrorZ in the error state. */ - public static Result_SignedRawInvoiceParseErrorZ err(ParseError e) { + public static Result_SignedRawInvoiceParseErrorZ err(org.ldk.structs.ParseError e) { long ret = bindings.CResult_SignedRawInvoiceParseErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.java index d4e197cc..2f9994c0 100644 --- a/src/main/java/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_SpendableOutputDescriptorDecodeErrorZ extends CommonBase { /** * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the success state. */ - public static Result_SpendableOutputDescriptorDecodeErrorZ ok(SpendableOutputDescriptor o) { + public static Result_SpendableOutputDescriptorDecodeErrorZ ok(org.ldk.structs.SpendableOutputDescriptor o) { long ret = bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_ok(o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -56,7 +56,7 @@ public class Result_SpendableOutputDescriptorDecodeErrorZ extends CommonBase { /** * Creates a new CResult_SpendableOutputDescriptorDecodeErrorZ in the error state. */ - public static Result_SpendableOutputDescriptorDecodeErrorZ err(DecodeError e) { + public static Result_SpendableOutputDescriptorDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.java index 3a35afd5..fbb2c0b9 100644 --- a/src/main/java/org/ldk/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_StaticPaymentOutputDescriptorDecodeErrorZ extends CommonBase /** * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the success state. */ - public static Result_StaticPaymentOutputDescriptorDecodeErrorZ ok(StaticPaymentOutputDescriptor o) { + public static Result_StaticPaymentOutputDescriptorDecodeErrorZ ok(org.ldk.structs.StaticPaymentOutputDescriptor o) { long ret = bindings.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_StaticPaymentOutputDescriptorDecodeErrorZ extends CommonBase /** * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the error state. */ - public static Result_StaticPaymentOutputDescriptorDecodeErrorZ err(DecodeError e) { + public static Result_StaticPaymentOutputDescriptorDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_TrustedClosingTransactionNoneZ.java b/src/main/java/org/ldk/structs/Result_TrustedClosingTransactionNoneZ.java index 449dfce3..618a55d8 100644 --- a/src/main/java/org/ldk/structs/Result_TrustedClosingTransactionNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_TrustedClosingTransactionNoneZ.java @@ -40,7 +40,7 @@ public class Result_TrustedClosingTransactionNoneZ extends CommonBase { /** * Creates a new CResult_TrustedClosingTransactionNoneZ in the success state. */ - public static Result_TrustedClosingTransactionNoneZ ok(TrustedClosingTransaction o) { + public static Result_TrustedClosingTransactionNoneZ ok(org.ldk.structs.TrustedClosingTransaction o) { long ret = bindings.CResult_TrustedClosingTransactionNoneZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_TrustedCommitmentTransactionNoneZ.java b/src/main/java/org/ldk/structs/Result_TrustedCommitmentTransactionNoneZ.java index 390f84ec..20b98f07 100644 --- a/src/main/java/org/ldk/structs/Result_TrustedCommitmentTransactionNoneZ.java +++ b/src/main/java/org/ldk/structs/Result_TrustedCommitmentTransactionNoneZ.java @@ -40,7 +40,7 @@ public class Result_TrustedCommitmentTransactionNoneZ extends CommonBase { /** * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state. */ - public static Result_TrustedCommitmentTransactionNoneZ ok(TrustedCommitmentTransaction o) { + public static Result_TrustedCommitmentTransactionNoneZ ok(org.ldk.structs.TrustedCommitmentTransaction o) { long ret = bindings.CResult_TrustedCommitmentTransactionNoneZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.java index f65e0a2f..ab701e1a 100644 --- a/src/main/java/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_TxCreationKeysDecodeErrorZ extends CommonBase { /** * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state. */ - public static Result_TxCreationKeysDecodeErrorZ ok(TxCreationKeys o) { + public static Result_TxCreationKeysDecodeErrorZ ok(org.ldk.structs.TxCreationKeys o) { long ret = bindings.CResult_TxCreationKeysDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_TxCreationKeysDecodeErrorZ extends CommonBase { /** * Creates a new CResult_TxCreationKeysDecodeErrorZ in the error state. */ - public static Result_TxCreationKeysDecodeErrorZ err(DecodeError e) { + public static Result_TxCreationKeysDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_TxCreationKeysDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_TxCreationKeysErrorZ.java b/src/main/java/org/ldk/structs/Result_TxCreationKeysErrorZ.java deleted file mode 100644 index d4b89c1a..00000000 --- a/src/main/java/org/ldk/structs/Result_TxCreationKeysErrorZ.java +++ /dev/null @@ -1,92 +0,0 @@ -package org.ldk.structs; - -import org.ldk.impl.bindings; -import org.ldk.enums.*; -import org.ldk.util.*; -import java.util.Arrays; -import java.lang.ref.Reference; -import javax.annotation.Nullable; - -public class Result_TxCreationKeysErrorZ extends CommonBase { - private Result_TxCreationKeysErrorZ(Object _dummy, long ptr) { super(ptr); } - protected void finalize() throws Throwable { - if (ptr != 0) { bindings.CResult_TxCreationKeysErrorZ_free(ptr); } super.finalize(); - } - - static Result_TxCreationKeysErrorZ constr_from_ptr(long ptr) { - if (bindings.CResult_TxCreationKeysErrorZ_is_ok(ptr)) { - return new Result_TxCreationKeysErrorZ_OK(null, ptr); - } else { - return new Result_TxCreationKeysErrorZ_Err(null, ptr); - } - } - public static final class Result_TxCreationKeysErrorZ_OK extends Result_TxCreationKeysErrorZ { - public final TxCreationKeys res; - private Result_TxCreationKeysErrorZ_OK(Object _dummy, long ptr) { - super(_dummy, ptr); - long res = bindings.CResult_TxCreationKeysErrorZ_get_ok(ptr); - org.ldk.structs.TxCreationKeys res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.TxCreationKeys(null, res); } - if (res_hu_conv != null) { res_hu_conv.ptrs_to.add(this); }; - this.res = res_hu_conv; - } - } - - public static final class Result_TxCreationKeysErrorZ_Err extends Result_TxCreationKeysErrorZ { - public final Secp256k1Error err; - private Result_TxCreationKeysErrorZ_Err(Object _dummy, long ptr) { - super(_dummy, ptr); - this.err = bindings.CResult_TxCreationKeysErrorZ_get_err(ptr); - } - } - - /** - * Creates a new CResult_TxCreationKeysErrorZ in the success state. - */ - public static Result_TxCreationKeysErrorZ ok(TxCreationKeys o) { - long ret = bindings.CResult_TxCreationKeysErrorZ_ok(o == null ? 0 : o.ptr); - Reference.reachabilityFence(o); - if (ret >= 0 && ret <= 4096) { return null; } - Result_TxCreationKeysErrorZ ret_hu_conv = Result_TxCreationKeysErrorZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(o); }; - return ret_hu_conv; - } - - /** - * Creates a new CResult_TxCreationKeysErrorZ in the error state. - */ - public static Result_TxCreationKeysErrorZ err(org.ldk.enums.Secp256k1Error e) { - long ret = bindings.CResult_TxCreationKeysErrorZ_err(e); - Reference.reachabilityFence(e); - if (ret >= 0 && ret <= 4096) { return null; } - Result_TxCreationKeysErrorZ ret_hu_conv = Result_TxCreationKeysErrorZ.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_TxCreationKeysErrorZ_is_ok(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - long clone_ptr() { - long ret = bindings.CResult_TxCreationKeysErrorZ_clone_ptr(this.ptr); - Reference.reachabilityFence(this); - return ret; - } - - /** - * Creates a new CResult_TxCreationKeysErrorZ which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public Result_TxCreationKeysErrorZ clone() { - long ret = bindings.CResult_TxCreationKeysErrorZ_clone(this.ptr); - Reference.reachabilityFence(this); - if (ret >= 0 && ret <= 4096) { return null; } - Result_TxCreationKeysErrorZ ret_hu_conv = Result_TxCreationKeysErrorZ.constr_from_ptr(ret); - return ret_hu_conv; - } - -} diff --git a/src/main/java/org/ldk/structs/Result_TxOutAccessErrorZ.java b/src/main/java/org/ldk/structs/Result_TxOutAccessErrorZ.java index eff5bea5..dacbe8eb 100644 --- a/src/main/java/org/ldk/structs/Result_TxOutAccessErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_TxOutAccessErrorZ.java @@ -41,7 +41,7 @@ public class Result_TxOutAccessErrorZ extends CommonBase { /** * Creates a new CResult_TxOutAccessErrorZ in the success state. */ - public static Result_TxOutAccessErrorZ ok(TxOut o) { + public static Result_TxOutAccessErrorZ ok(org.ldk.structs.TxOut o) { long ret = bindings.CResult_TxOutAccessErrorZ_ok(o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.java index 22f6c2e1..c6f832ed 100644 --- a/src/main/java/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_UnsignedChannelAnnouncementDecodeErrorZ extends CommonBase { /** * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state. */ - public static Result_UnsignedChannelAnnouncementDecodeErrorZ ok(UnsignedChannelAnnouncement o) { + public static Result_UnsignedChannelAnnouncementDecodeErrorZ ok(org.ldk.structs.UnsignedChannelAnnouncement o) { long ret = bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_UnsignedChannelAnnouncementDecodeErrorZ extends CommonBase { /** * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the error state. */ - public static Result_UnsignedChannelAnnouncementDecodeErrorZ err(DecodeError e) { + public static Result_UnsignedChannelAnnouncementDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.java index 6e7b9f46..800df2b0 100644 --- a/src/main/java/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_UnsignedChannelUpdateDecodeErrorZ extends CommonBase { /** * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state. */ - public static Result_UnsignedChannelUpdateDecodeErrorZ ok(UnsignedChannelUpdate o) { + public static Result_UnsignedChannelUpdateDecodeErrorZ ok(org.ldk.structs.UnsignedChannelUpdate o) { long ret = bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_UnsignedChannelUpdateDecodeErrorZ extends CommonBase { /** * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the error state. */ - public static Result_UnsignedChannelUpdateDecodeErrorZ err(DecodeError e) { + public static Result_UnsignedChannelUpdateDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.java index 83cb46e1..6e941786 100644 --- a/src/main/java/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_UnsignedNodeAnnouncementDecodeErrorZ extends CommonBase { /** * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state. */ - public static Result_UnsignedNodeAnnouncementDecodeErrorZ ok(UnsignedNodeAnnouncement o) { + public static Result_UnsignedNodeAnnouncementDecodeErrorZ ok(org.ldk.structs.UnsignedNodeAnnouncement o) { long ret = bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_UnsignedNodeAnnouncementDecodeErrorZ extends CommonBase { /** * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the error state. */ - public static Result_UnsignedNodeAnnouncementDecodeErrorZ err(DecodeError e) { + public static Result_UnsignedNodeAnnouncementDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.java index 7cd76e5a..d6d77f72 100644 --- a/src/main/java/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_UpdateAddHTLCDecodeErrorZ extends CommonBase { /** * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state. */ - public static Result_UpdateAddHTLCDecodeErrorZ ok(UpdateAddHTLC o) { + public static Result_UpdateAddHTLCDecodeErrorZ ok(org.ldk.structs.UpdateAddHTLC o) { long ret = bindings.CResult_UpdateAddHTLCDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_UpdateAddHTLCDecodeErrorZ extends CommonBase { /** * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the error state. */ - public static Result_UpdateAddHTLCDecodeErrorZ err(DecodeError e) { + public static Result_UpdateAddHTLCDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_UpdateAddHTLCDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.java index c0940e9a..ac87ccca 100644 --- a/src/main/java/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_UpdateFailHTLCDecodeErrorZ extends CommonBase { /** * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state. */ - public static Result_UpdateFailHTLCDecodeErrorZ ok(UpdateFailHTLC o) { + public static Result_UpdateFailHTLCDecodeErrorZ ok(org.ldk.structs.UpdateFailHTLC o) { long ret = bindings.CResult_UpdateFailHTLCDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_UpdateFailHTLCDecodeErrorZ extends CommonBase { /** * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the error state. */ - public static Result_UpdateFailHTLCDecodeErrorZ err(DecodeError e) { + public static Result_UpdateFailHTLCDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_UpdateFailHTLCDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.java index b2083a0b..c5ef4ba9 100644 --- a/src/main/java/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_UpdateFailMalformedHTLCDecodeErrorZ extends CommonBase { /** * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state. */ - public static Result_UpdateFailMalformedHTLCDecodeErrorZ ok(UpdateFailMalformedHTLC o) { + public static Result_UpdateFailMalformedHTLCDecodeErrorZ ok(org.ldk.structs.UpdateFailMalformedHTLC o) { long ret = bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_UpdateFailMalformedHTLCDecodeErrorZ extends CommonBase { /** * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the error state. */ - public static Result_UpdateFailMalformedHTLCDecodeErrorZ err(DecodeError e) { + public static Result_UpdateFailMalformedHTLCDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.java index e2bbce1c..cd8c35a2 100644 --- a/src/main/java/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_UpdateFeeDecodeErrorZ extends CommonBase { /** * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state. */ - public static Result_UpdateFeeDecodeErrorZ ok(UpdateFee o) { + public static Result_UpdateFeeDecodeErrorZ ok(org.ldk.structs.UpdateFee o) { long ret = bindings.CResult_UpdateFeeDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_UpdateFeeDecodeErrorZ extends CommonBase { /** * Creates a new CResult_UpdateFeeDecodeErrorZ in the error state. */ - public static Result_UpdateFeeDecodeErrorZ err(DecodeError e) { + public static Result_UpdateFeeDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_UpdateFeeDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.java index 9e9a550c..09f4bfd9 100644 --- a/src/main/java/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_UpdateFulfillHTLCDecodeErrorZ extends CommonBase { /** * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state. */ - public static Result_UpdateFulfillHTLCDecodeErrorZ ok(UpdateFulfillHTLC o) { + public static Result_UpdateFulfillHTLCDecodeErrorZ ok(org.ldk.structs.UpdateFulfillHTLC o) { long ret = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_UpdateFulfillHTLCDecodeErrorZ extends CommonBase { /** * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the error state. */ - public static Result_UpdateFulfillHTLCDecodeErrorZ err(DecodeError e) { + public static Result_UpdateFulfillHTLCDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_WarningMessageDecodeErrorZ.java b/src/main/java/org/ldk/structs/Result_WarningMessageDecodeErrorZ.java index e76f4c9e..758a829a 100644 --- a/src/main/java/org/ldk/structs/Result_WarningMessageDecodeErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_WarningMessageDecodeErrorZ.java @@ -45,7 +45,7 @@ public class Result_WarningMessageDecodeErrorZ extends CommonBase { /** * Creates a new CResult_WarningMessageDecodeErrorZ in the success state. */ - public static Result_WarningMessageDecodeErrorZ ok(WarningMessage o) { + public static Result_WarningMessageDecodeErrorZ ok(org.ldk.structs.WarningMessage o) { long ret = bindings.CResult_WarningMessageDecodeErrorZ_ok(o == null ? 0 : o.ptr); Reference.reachabilityFence(o); if (ret >= 0 && ret <= 4096) { return null; } @@ -57,7 +57,7 @@ public class Result_WarningMessageDecodeErrorZ extends CommonBase { /** * Creates a new CResult_WarningMessageDecodeErrorZ in the error state. */ - public static Result_WarningMessageDecodeErrorZ err(DecodeError e) { + public static Result_WarningMessageDecodeErrorZ err(org.ldk.structs.DecodeError e) { long ret = bindings.CResult_WarningMessageDecodeErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result__u832APIErrorZ.java b/src/main/java/org/ldk/structs/Result__u832APIErrorZ.java index a614629a..8064b2ee 100644 --- a/src/main/java/org/ldk/structs/Result__u832APIErrorZ.java +++ b/src/main/java/org/ldk/structs/Result__u832APIErrorZ.java @@ -53,7 +53,7 @@ public class Result__u832APIErrorZ extends CommonBase { /** * Creates a new CResult__u832APIErrorZ in the error state. */ - public static Result__u832APIErrorZ err(APIError e) { + public static Result__u832APIErrorZ err(org.ldk.structs.APIError e) { long ret = bindings.CResult__u832APIErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_boolLightningErrorZ.java b/src/main/java/org/ldk/structs/Result_boolLightningErrorZ.java index 2ae271f3..48488d82 100644 --- a/src/main/java/org/ldk/structs/Result_boolLightningErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_boolLightningErrorZ.java @@ -53,7 +53,7 @@ public class Result_boolLightningErrorZ extends CommonBase { /** * Creates a new CResult_boolLightningErrorZ in the error state. */ - public static Result_boolLightningErrorZ err(LightningError e) { + public static Result_boolLightningErrorZ err(org.ldk.structs.LightningError e) { long ret = bindings.CResult_boolLightningErrorZ_err(e == null ? 0 : e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_boolPeerHandleErrorZ.java b/src/main/java/org/ldk/structs/Result_boolPeerHandleErrorZ.java index 342b6c4b..43880448 100644 --- a/src/main/java/org/ldk/structs/Result_boolPeerHandleErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_boolPeerHandleErrorZ.java @@ -53,7 +53,7 @@ public class Result_boolPeerHandleErrorZ extends CommonBase { /** * Creates a new CResult_boolPeerHandleErrorZ in the error state. */ - public static Result_boolPeerHandleErrorZ err(PeerHandleError e) { + public static Result_boolPeerHandleErrorZ err(org.ldk.structs.PeerHandleError e) { long ret = bindings.CResult_boolPeerHandleErrorZ_err(e == null ? 0 : e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Result_u32GraphSyncErrorZ.java b/src/main/java/org/ldk/structs/Result_u32GraphSyncErrorZ.java index bc1f0f80..52368a49 100644 --- a/src/main/java/org/ldk/structs/Result_u32GraphSyncErrorZ.java +++ b/src/main/java/org/ldk/structs/Result_u32GraphSyncErrorZ.java @@ -53,7 +53,7 @@ public class Result_u32GraphSyncErrorZ extends CommonBase { /** * Creates a new CResult_u32GraphSyncErrorZ in the error state. */ - public static Result_u32GraphSyncErrorZ err(GraphSyncError e) { + public static Result_u32GraphSyncErrorZ err(org.ldk.structs.GraphSyncError e) { long ret = bindings.CResult_u32GraphSyncErrorZ_err(e.ptr); Reference.reachabilityFence(e); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/src/main/java/org/ldk/structs/Retry.java b/src/main/java/org/ldk/structs/Retry.java index dc1274e9..18988df0 100644 --- a/src/main/java/org/ldk/structs/Retry.java +++ b/src/main/java/org/ldk/structs/Retry.java @@ -100,7 +100,7 @@ public class Retry extends CommonBase { * 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) { + public boolean eq(org.ldk.structs.Retry b) { boolean ret = bindings.Retry_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/RevokeAndACK.java b/src/main/java/org/ldk/structs/RevokeAndACK.java index f41264e0..6e42eaa9 100644 --- a/src/main/java/org/ldk/structs/RevokeAndACK.java +++ b/src/main/java/org/ldk/structs/RevokeAndACK.java @@ -111,7 +111,7 @@ public class RevokeAndACK extends CommonBase { * 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(RevokeAndACK b) { + public boolean eq(org.ldk.structs.RevokeAndACK b) { boolean ret = bindings.RevokeAndACK_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/Route.java b/src/main/java/org/ldk/structs/Route.java index ed1574ad..9b6a0722 100644 --- a/src/main/java/org/ldk/structs/Route.java +++ b/src/main/java/org/ldk/structs/Route.java @@ -90,7 +90,7 @@ public class Route extends CommonBase { * * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public void set_payment_params(@Nullable PaymentParameters val) { + public void set_payment_params(@Nullable org.ldk.structs.PaymentParameters val) { bindings.Route_set_payment_params(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -100,7 +100,7 @@ public class Route extends CommonBase { /** * Constructs a new Route given each field */ - public static Route of(RouteHop[][] paths_arg, PaymentParameters payment_params_arg) { + public static Route of(RouteHop[][] paths_arg, org.ldk.structs.PaymentParameters payment_params_arg) { long ret = bindings.Route_new(paths_arg != null ? Arrays.stream(paths_arg).map(paths_arg_conv_12 -> paths_arg_conv_12 != null ? Arrays.stream(paths_arg_conv_12).mapToLong(paths_arg_conv_12_conv_10 -> paths_arg_conv_12_conv_10 == null ? 0 : paths_arg_conv_12_conv_10.ptr).toArray() : null).toArray(long[][]::new) : null, payment_params_arg == null ? 0 : payment_params_arg.ptr); Reference.reachabilityFence(paths_arg); Reference.reachabilityFence(payment_params_arg); @@ -147,7 +147,7 @@ public class Route extends CommonBase { * 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(Route b) { + public boolean eq(org.ldk.structs.Route b) { boolean ret = bindings.Route_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/RouteHint.java b/src/main/java/org/ldk/structs/RouteHint.java index 2e950d55..7eb9cdee 100644 --- a/src/main/java/org/ldk/structs/RouteHint.java +++ b/src/main/java/org/ldk/structs/RouteHint.java @@ -89,7 +89,7 @@ public class RouteHint extends CommonBase { * 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(RouteHint b) { + public boolean eq(org.ldk.structs.RouteHint b) { boolean ret = bindings.RouteHint_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/RouteHintHop.java b/src/main/java/org/ldk/structs/RouteHintHop.java index 28789432..857af539 100644 --- a/src/main/java/org/ldk/structs/RouteHintHop.java +++ b/src/main/java/org/ldk/structs/RouteHintHop.java @@ -71,7 +71,7 @@ public class RouteHintHop extends CommonBase { /** * The fees which must be paid to use this channel */ - public void set_fees(RoutingFees val) { + public void set_fees(org.ldk.structs.RoutingFees val) { bindings.RouteHintHop_set_fees(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -111,7 +111,7 @@ public class RouteHintHop extends CommonBase { /** * The minimum value, in msat, which must be relayed to the next hop. */ - public void set_htlc_minimum_msat(Option_u64Z val) { + public void set_htlc_minimum_msat(org.ldk.structs.Option_u64Z val) { bindings.RouteHintHop_set_htlc_minimum_msat(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -132,7 +132,7 @@ public class RouteHintHop extends CommonBase { /** * The maximum value in msat available for routing with a single HTLC. */ - public void set_htlc_maximum_msat(Option_u64Z val) { + public void set_htlc_maximum_msat(org.ldk.structs.Option_u64Z val) { bindings.RouteHintHop_set_htlc_maximum_msat(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -141,7 +141,7 @@ public class RouteHintHop extends CommonBase { /** * Constructs a new RouteHintHop given each field */ - public static RouteHintHop of(byte[] src_node_id_arg, long short_channel_id_arg, RoutingFees fees_arg, short cltv_expiry_delta_arg, Option_u64Z htlc_minimum_msat_arg, Option_u64Z htlc_maximum_msat_arg) { + public static RouteHintHop of(byte[] src_node_id_arg, long short_channel_id_arg, org.ldk.structs.RoutingFees fees_arg, short cltv_expiry_delta_arg, org.ldk.structs.Option_u64Z htlc_minimum_msat_arg, org.ldk.structs.Option_u64Z htlc_maximum_msat_arg) { long ret = bindings.RouteHintHop_new(InternalUtils.check_arr_len(src_node_id_arg, 33), short_channel_id_arg, fees_arg == null ? 0 : fees_arg.ptr, cltv_expiry_delta_arg, htlc_minimum_msat_arg.ptr, htlc_maximum_msat_arg.ptr); Reference.reachabilityFence(src_node_id_arg); Reference.reachabilityFence(short_channel_id_arg); @@ -191,7 +191,7 @@ public class RouteHintHop extends CommonBase { * 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(RouteHintHop b) { + public boolean eq(org.ldk.structs.RouteHintHop b) { boolean ret = bindings.RouteHintHop_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/RouteHop.java b/src/main/java/org/ldk/structs/RouteHop.java index 97014d57..46b749c1 100644 --- a/src/main/java/org/ldk/structs/RouteHop.java +++ b/src/main/java/org/ldk/structs/RouteHop.java @@ -55,7 +55,7 @@ public class RouteHop extends CommonBase { * The node_announcement features of the node at this hop. For the last hop, these may be * amended to match the features present in the invoice this node generated. */ - public void set_node_features(NodeFeatures val) { + public void set_node_features(org.ldk.structs.NodeFeatures val) { bindings.RouteHop_set_node_features(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -97,7 +97,7 @@ public class RouteHop extends CommonBase { * The channel_announcement features of the channel that should be used from the previous hop * to reach this node. */ - public void set_channel_features(ChannelFeatures val) { + public void set_channel_features(org.ldk.structs.ChannelFeatures val) { bindings.RouteHop_set_channel_features(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -149,7 +149,7 @@ public class RouteHop extends CommonBase { /** * Constructs a new RouteHop given each field */ - public static RouteHop of(byte[] pubkey_arg, NodeFeatures node_features_arg, long short_channel_id_arg, ChannelFeatures channel_features_arg, long fee_msat_arg, int cltv_expiry_delta_arg) { + public static RouteHop of(byte[] pubkey_arg, org.ldk.structs.NodeFeatures node_features_arg, long short_channel_id_arg, org.ldk.structs.ChannelFeatures channel_features_arg, long fee_msat_arg, int cltv_expiry_delta_arg) { long ret = bindings.RouteHop_new(InternalUtils.check_arr_len(pubkey_arg, 33), node_features_arg == null ? 0 : node_features_arg.ptr, short_channel_id_arg, channel_features_arg == null ? 0 : channel_features_arg.ptr, fee_msat_arg, cltv_expiry_delta_arg); Reference.reachabilityFence(pubkey_arg); Reference.reachabilityFence(node_features_arg); @@ -200,7 +200,7 @@ public class RouteHop extends CommonBase { * 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(RouteHop b) { + public boolean eq(org.ldk.structs.RouteHop b) { boolean ret = bindings.RouteHop_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/RouteParameters.java b/src/main/java/org/ldk/structs/RouteParameters.java index 88b2ba22..0d4ac699 100644 --- a/src/main/java/org/ldk/structs/RouteParameters.java +++ b/src/main/java/org/ldk/structs/RouteParameters.java @@ -40,7 +40,7 @@ public class RouteParameters extends CommonBase { /** * The parameters of the failed payment path. */ - public void set_payment_params(PaymentParameters val) { + public void set_payment_params(org.ldk.structs.PaymentParameters val) { bindings.RouteParameters_set_payment_params(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -86,7 +86,7 @@ public class RouteParameters extends CommonBase { /** * Constructs a new RouteParameters given each field */ - public static RouteParameters of(PaymentParameters payment_params_arg, long final_value_msat_arg, int final_cltv_expiry_delta_arg) { + public static RouteParameters of(org.ldk.structs.PaymentParameters payment_params_arg, long final_value_msat_arg, int final_cltv_expiry_delta_arg) { long ret = bindings.RouteParameters_new(payment_params_arg == null ? 0 : payment_params_arg.ptr, final_value_msat_arg, final_cltv_expiry_delta_arg); Reference.reachabilityFence(payment_params_arg); Reference.reachabilityFence(final_value_msat_arg); diff --git a/src/main/java/org/ldk/structs/Router.java b/src/main/java/org/ldk/structs/Router.java index 85f83425..8770a3b3 100644 --- a/src/main/java/org/ldk/structs/Router.java +++ b/src/main/java/org/ldk/structs/Router.java @@ -8,7 +8,7 @@ import java.lang.ref.Reference; import javax.annotation.Nullable; /** - * A trait defining behavior for routing an [`Invoice`] payment. + * A trait defining behavior for routing a payment. */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Router extends CommonBase { @@ -30,7 +30,14 @@ public class Router extends CommonBase { * * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None */ - Result_RouteLightningErrorZ find_route(byte[] payer, RouteParameters route_params, byte[] payment_hash, ChannelDetails[] first_hops, InFlightHtlcs inflight_htlcs); + Result_RouteLightningErrorZ find_route(byte[] payer, RouteParameters route_params, ChannelDetails[] first_hops, InFlightHtlcs inflight_htlcs); + /** + * Finds a [`Route`] between `payer` and `payee` for a payment with the given values. Includes + * `PaymentHash` and `PaymentId` to be able to correlate the request with a specific payment. + * + * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + Result_RouteLightningErrorZ find_route_with_id(byte[] payer, RouteParameters route_params, ChannelDetails[] first_hops, InFlightHtlcs inflight_htlcs, byte[] _payment_hash, byte[] _payment_id); /** * Lets the router know that payment through a specific path has failed. */ @@ -52,7 +59,26 @@ public class Router extends CommonBase { public static Router new_impl(RouterInterface arg) { final LDKRouterHolder impl_holder = new LDKRouterHolder(); impl_holder.held = new Router(new bindings.LDKRouter() { - @Override public long find_route(byte[] payer, long route_params, byte[] payment_hash, long[] first_hops, long inflight_htlcs) { + @Override public long find_route(byte[] payer, long route_params, long[] first_hops, long inflight_htlcs) { + 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]; + if (first_hops != null) { + for (int q = 0; q < first_hops_conv_16_len; q++) { + long first_hops_conv_16 = first_hops[q]; + 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); } + if (first_hops_conv_16_hu_conv != null) { first_hops_conv_16_hu_conv.ptrs_to.add(this); }; + first_hops_conv_16_arr[q] = first_hops_conv_16_hu_conv; + } + } + org.ldk.structs.InFlightHtlcs inflight_htlcs_hu_conv = null; if (inflight_htlcs < 0 || inflight_htlcs > 4096) { inflight_htlcs_hu_conv = new org.ldk.structs.InFlightHtlcs(null, inflight_htlcs); } + if (inflight_htlcs_hu_conv != null) { inflight_htlcs_hu_conv.ptrs_to.add(this); }; + Result_RouteLightningErrorZ ret = arg.find_route(payer, route_params_hu_conv, first_hops_conv_16_arr, inflight_htlcs_hu_conv); + Reference.reachabilityFence(arg); + long result = ret == null ? 0 : ret.clone_ptr(); + return result; + } + @Override public long find_route_with_id(byte[] payer, long route_params, long[] first_hops, long inflight_htlcs, byte[] _payment_hash, byte[] _payment_id) { 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]; @@ -66,7 +92,7 @@ public class Router extends CommonBase { } org.ldk.structs.InFlightHtlcs inflight_htlcs_hu_conv = null; if (inflight_htlcs < 0 || inflight_htlcs > 4096) { inflight_htlcs_hu_conv = new org.ldk.structs.InFlightHtlcs(null, inflight_htlcs); } if (inflight_htlcs_hu_conv != null) { inflight_htlcs_hu_conv.ptrs_to.add(this); }; - Result_RouteLightningErrorZ ret = arg.find_route(payer, route_params_hu_conv, payment_hash, first_hops_conv_16_arr, inflight_htlcs_hu_conv); + Result_RouteLightningErrorZ ret = arg.find_route_with_id(payer, route_params_hu_conv, first_hops_conv_16_arr, inflight_htlcs_hu_conv, _payment_hash, _payment_id); Reference.reachabilityFence(arg); long result = ret == null ? 0 : ret.clone_ptr(); return result; @@ -127,27 +153,41 @@ public class Router extends CommonBase { * * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public Result_RouteLightningErrorZ find_route(byte[] payer, RouteParameters route_params, byte[] payment_hash, @Nullable ChannelDetails[] first_hops, InFlightHtlcs inflight_htlcs) { - long ret = bindings.Router_find_route(this.ptr, InternalUtils.check_arr_len(payer, 33), route_params == null ? 0 : route_params.ptr, InternalUtils.check_arr_len(payment_hash, 32), first_hops != null ? Arrays.stream(first_hops).mapToLong(first_hops_conv_16 -> first_hops_conv_16 == null ? 0 : first_hops_conv_16.ptr).toArray() : null, inflight_htlcs == null ? 0 : inflight_htlcs.ptr); + public Result_RouteLightningErrorZ find_route(byte[] payer, org.ldk.structs.RouteParameters route_params, @Nullable ChannelDetails[] first_hops, org.ldk.structs.InFlightHtlcs inflight_htlcs) { + long ret = bindings.Router_find_route(this.ptr, InternalUtils.check_arr_len(payer, 33), route_params == null ? 0 : route_params.ptr, first_hops != null ? Arrays.stream(first_hops).mapToLong(first_hops_conv_16 -> first_hops_conv_16 == null ? 0 : first_hops_conv_16.ptr).toArray() : null, inflight_htlcs == null ? 0 : inflight_htlcs.ptr); + Reference.reachabilityFence(this); + Reference.reachabilityFence(payer); + Reference.reachabilityFence(route_params); + Reference.reachabilityFence(first_hops); + Reference.reachabilityFence(inflight_htlcs); + if (ret >= 0 && ret <= 4096) { return null; } + Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.add(route_params); }; + if (first_hops != null) { for (ChannelDetails first_hops_conv_16: first_hops) { if (this != null) { this.ptrs_to.add(first_hops_conv_16); }; } }; + if (this != null) { this.ptrs_to.add(inflight_htlcs); }; + return ret_hu_conv; + } + + /** + * Finds a [`Route`] between `payer` and `payee` for a payment with the given values. Includes + * `PaymentHash` and `PaymentId` to be able to correlate the request with a specific payment. + * + * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public Result_RouteLightningErrorZ find_route_with_id(byte[] payer, org.ldk.structs.RouteParameters route_params, @Nullable ChannelDetails[] first_hops, org.ldk.structs.InFlightHtlcs inflight_htlcs, byte[] _payment_hash, byte[] _payment_id) { + long ret = bindings.Router_find_route_with_id(this.ptr, InternalUtils.check_arr_len(payer, 33), route_params == null ? 0 : route_params.ptr, first_hops != null ? Arrays.stream(first_hops).mapToLong(first_hops_conv_16 -> first_hops_conv_16 == null ? 0 : first_hops_conv_16.ptr).toArray() : null, inflight_htlcs == null ? 0 : inflight_htlcs.ptr, InternalUtils.check_arr_len(_payment_hash, 32), InternalUtils.check_arr_len(_payment_id, 32)); Reference.reachabilityFence(this); Reference.reachabilityFence(payer); Reference.reachabilityFence(route_params); - Reference.reachabilityFence(payment_hash); Reference.reachabilityFence(first_hops); Reference.reachabilityFence(inflight_htlcs); + Reference.reachabilityFence(_payment_hash); + Reference.reachabilityFence(_payment_id); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.add(route_params); }; if (first_hops != null) { for (ChannelDetails first_hops_conv_16: first_hops) { if (this != null) { this.ptrs_to.add(first_hops_conv_16); }; } }; if (this != null) { this.ptrs_to.add(inflight_htlcs); }; - // Due to rust's strict-ownership memory model, in some cases we need to "move" - // an object to pass exclusive ownership to the function being called. - // In most cases, we avoid this being visible in GC'd languages by cloning the object - // at the FFI layer, creating a new object which Rust can claim ownership of - // However, in some cases (eg here), there is no way to clone an object, and thus - // we actually have to pass full ownership to Rust. - // Thus, after this call, inflight_htlcs is reset to null and is now a dummy object. - inflight_htlcs.ptr = 0;; return ret_hu_conv; } diff --git a/src/main/java/org/ldk/structs/RoutingFees.java b/src/main/java/org/ldk/structs/RoutingFees.java index 1c076851..8cbc480e 100644 --- a/src/main/java/org/ldk/structs/RoutingFees.java +++ b/src/main/java/org/ldk/structs/RoutingFees.java @@ -76,7 +76,7 @@ public class RoutingFees extends CommonBase { * 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(RoutingFees b) { + public boolean eq(org.ldk.structs.RoutingFees b) { boolean ret = bindings.RoutingFees_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/RoutingMessageHandler.java b/src/main/java/org/ldk/structs/RoutingMessageHandler.java index efccb4bf..094779c6 100644 --- a/src/main/java/org/ldk/structs/RoutingMessageHandler.java +++ b/src/main/java/org/ldk/structs/RoutingMessageHandler.java @@ -216,7 +216,7 @@ public class RoutingMessageHandler extends CommonBase { * Handle an incoming node_announcement message, returning true if it should be forwarded on, * false or returning an Err otherwise. */ - public Result_boolLightningErrorZ handle_node_announcement(NodeAnnouncement msg) { + public Result_boolLightningErrorZ handle_node_announcement(org.ldk.structs.NodeAnnouncement msg) { long ret = bindings.RoutingMessageHandler_handle_node_announcement(this.ptr, msg == null ? 0 : msg.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(msg); @@ -230,7 +230,7 @@ public class RoutingMessageHandler extends CommonBase { * Handle a channel_announcement message, returning true if it should be forwarded on, false * or returning an Err otherwise. */ - public Result_boolLightningErrorZ handle_channel_announcement(ChannelAnnouncement msg) { + public Result_boolLightningErrorZ handle_channel_announcement(org.ldk.structs.ChannelAnnouncement msg) { long ret = bindings.RoutingMessageHandler_handle_channel_announcement(this.ptr, msg == null ? 0 : msg.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(msg); @@ -244,7 +244,7 @@ public class RoutingMessageHandler extends CommonBase { * Handle an incoming channel_update message, returning true if it should be forwarded on, * false or returning an Err otherwise. */ - public Result_boolLightningErrorZ handle_channel_update(ChannelUpdate msg) { + public Result_boolLightningErrorZ handle_channel_update(org.ldk.structs.ChannelUpdate msg) { long ret = bindings.RoutingMessageHandler_handle_channel_update(this.ptr, msg == null ? 0 : msg.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(msg); @@ -298,7 +298,7 @@ public class RoutingMessageHandler extends CommonBase { * with us. Implementors should be somewhat conservative about doing so, however, as other * message handlers may still wish to communicate with this peer. */ - public Result_NoneNoneZ peer_connected(byte[] their_node_id, Init init) { + public Result_NoneNoneZ peer_connected(byte[] their_node_id, org.ldk.structs.Init init) { long ret = bindings.RoutingMessageHandler_peer_connected(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), init == null ? 0 : init.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(their_node_id); @@ -314,7 +314,7 @@ public class RoutingMessageHandler extends CommonBase { * for a given range of blocks. We can expect to receive one or more * replies to a single query. */ - public Result_NoneLightningErrorZ handle_reply_channel_range(byte[] their_node_id, ReplyChannelRange msg) { + public Result_NoneLightningErrorZ handle_reply_channel_range(byte[] their_node_id, org.ldk.structs.ReplyChannelRange msg) { long ret = bindings.RoutingMessageHandler_handle_reply_channel_range(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(their_node_id); @@ -331,7 +331,7 @@ public class RoutingMessageHandler extends CommonBase { * a node has completed its best effort to send us the pertaining routing * gossip messages. */ - public Result_NoneLightningErrorZ handle_reply_short_channel_ids_end(byte[] their_node_id, ReplyShortChannelIdsEnd msg) { + public Result_NoneLightningErrorZ handle_reply_short_channel_ids_end(byte[] their_node_id, org.ldk.structs.ReplyShortChannelIdsEnd msg) { long ret = bindings.RoutingMessageHandler_handle_reply_short_channel_ids_end(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(their_node_id); @@ -346,7 +346,7 @@ public class RoutingMessageHandler extends CommonBase { * Handles when a peer asks us to send a list of short_channel_ids * for the requested range of blocks. */ - public Result_NoneLightningErrorZ handle_query_channel_range(byte[] their_node_id, QueryChannelRange msg) { + public Result_NoneLightningErrorZ handle_query_channel_range(byte[] their_node_id, org.ldk.structs.QueryChannelRange msg) { long ret = bindings.RoutingMessageHandler_handle_query_channel_range(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(their_node_id); @@ -361,7 +361,7 @@ public class RoutingMessageHandler extends CommonBase { * Handles when a peer asks us to send routing gossip messages for a * list of short_channel_ids. */ - public Result_NoneLightningErrorZ handle_query_short_channel_ids(byte[] their_node_id, QueryShortChannelIds msg) { + public Result_NoneLightningErrorZ handle_query_short_channel_ids(byte[] their_node_id, org.ldk.structs.QueryShortChannelIds msg) { long ret = bindings.RoutingMessageHandler_handle_query_short_channel_ids(this.ptr, InternalUtils.check_arr_len(their_node_id, 33), msg == null ? 0 : msg.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(their_node_id); diff --git a/src/main/java/org/ldk/structs/Score.java b/src/main/java/org/ldk/structs/Score.java index 5e7fd85f..c51a88b2 100644 --- a/src/main/java/org/ldk/structs/Score.java +++ b/src/main/java/org/ldk/structs/Score.java @@ -138,7 +138,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. */ - public long channel_penalty_msat(long short_channel_id, NodeId source, NodeId target, ChannelUsage usage) { + public long channel_penalty_msat(long short_channel_id, org.ldk.structs.NodeId source, org.ldk.structs.NodeId target, org.ldk.structs.ChannelUsage usage) { long ret = bindings.Score_channel_penalty_msat(this.ptr, short_channel_id, source == null ? 0 : source.ptr, target == null ? 0 : target.ptr, usage == null ? 0 : usage.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(short_channel_id); diff --git a/src/main/java/org/ldk/structs/ScorerAccountingForInFlightHtlcs.java b/src/main/java/org/ldk/structs/ScorerAccountingForInFlightHtlcs.java new file mode 100644 index 00000000..ffc3dea9 --- /dev/null +++ b/src/main/java/org/ldk/structs/ScorerAccountingForInFlightHtlcs.java @@ -0,0 +1,65 @@ +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 factors in in-flight HTLC liquidity. + * + * Useful for custom [`Router`] implementations to wrap their [`Score`] on-the-fly when calling + * [`find_route`]. + * + * [`Score`]: crate::routing::scoring::Score + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class ScorerAccountingForInFlightHtlcs extends CommonBase { + ScorerAccountingForInFlightHtlcs(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.ScorerAccountingForInFlightHtlcs_free(ptr); } + } + + /** + * Initialize a new `ScorerAccountingForInFlightHtlcs`. + */ + public static ScorerAccountingForInFlightHtlcs of(org.ldk.structs.Score scorer, org.ldk.structs.InFlightHtlcs inflight_htlcs) { + long ret = bindings.ScorerAccountingForInFlightHtlcs_new(scorer == null ? 0 : scorer.ptr, inflight_htlcs == null ? 0 : inflight_htlcs.ptr); + Reference.reachabilityFence(scorer); + Reference.reachabilityFence(inflight_htlcs); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ScorerAccountingForInFlightHtlcs ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ScorerAccountingForInFlightHtlcs(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(scorer); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(inflight_htlcs); }; + return ret_hu_conv; + } + + /** + * Serialize the ScorerAccountingForInFlightHtlcs object into a byte array which can be read by ScorerAccountingForInFlightHtlcs_read + */ + public byte[] write() { + byte[] ret = bindings.ScorerAccountingForInFlightHtlcs_write(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * 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.ScorerAccountingForInFlightHtlcs_as_Score(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + Score ret_hu_conv = new Score(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/SendError.java b/src/main/java/org/ldk/structs/SendError.java index a79de309..7f8e7585 100644 --- a/src/main/java/org/ldk/structs/SendError.java +++ b/src/main/java/org/ldk/structs/SendError.java @@ -11,7 +11,7 @@ import javax.annotation.Nullable; /** * Errors that may occur when [sending an onion message]. * - * [sending an onion message]: OnionMessenger::send_custom_onion_message + * [sending an onion message]: OnionMessenger::send_onion_message */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class SendError extends CommonBase { @@ -41,6 +41,12 @@ public class SendError extends CommonBase { if (raw_val.getClass() == bindings.LDKSendError.BufferFull.class) { return new BufferFull(ptr, (bindings.LDKSendError.BufferFull)raw_val); } + if (raw_val.getClass() == bindings.LDKSendError.GetNodeIdFailed.class) { + return new GetNodeIdFailed(ptr, (bindings.LDKSendError.GetNodeIdFailed)raw_val); + } + if (raw_val.getClass() == bindings.LDKSendError.BlindedPathAdvanceFailed.class) { + return new BlindedPathAdvanceFailed(ptr, (bindings.LDKSendError.BlindedPathAdvanceFailed)raw_val); + } assert false; return null; // Unreachable without extending the (internal) bindings interface } @@ -64,7 +70,7 @@ public class SendError extends CommonBase { } } /** - * The provided [`Destination`] was an invalid [`BlindedRoute`], due to having fewer than two + * The provided [`Destination`] was an invalid [`BlindedPath`], due to having fewer than two * blinded hops. */ public final static class TooFewBlindedHops extends SendError { @@ -96,6 +102,27 @@ public class SendError extends CommonBase { super(null, ptr); } } + /** + * Failed to retrieve our node id from the provided [`KeysInterface`]. + * + * [`KeysInterface`]: crate::chain::keysinterface::KeysInterface + */ + public final static class GetNodeIdFailed extends SendError { + private GetNodeIdFailed(long ptr, bindings.LDKSendError.GetNodeIdFailed obj) { + super(null, ptr); + } + } + /** + * We attempted to send to a blinded path where we are the introduction node, and failed to + * advance the blinded path to make the second hop the new introduction node. Either + * [`KeysInterface::ecdh`] failed, we failed to tweak the current blinding point to get the + * new blinding point, or we were attempting to send to ourselves. + */ + public final static class BlindedPathAdvanceFailed extends SendError { + private BlindedPathAdvanceFailed(long ptr, bindings.LDKSendError.BlindedPathAdvanceFailed obj) { + super(null, ptr); + } + } long clone_ptr() { long ret = bindings.SendError_clone_ptr(this.ptr); Reference.reachabilityFence(this); @@ -181,11 +208,33 @@ public class SendError extends CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new GetNodeIdFailed-variant SendError + */ + public static SendError get_node_id_failed() { + long ret = bindings.SendError_get_node_id_failed(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.SendError ret_hu_conv = org.ldk.structs.SendError.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new BlindedPathAdvanceFailed-variant SendError + */ + public static SendError blinded_path_advance_failed() { + long ret = bindings.SendError_blinded_path_advance_failed(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.SendError ret_hu_conv = org.ldk.structs.SendError.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + /** * Checks if two SendErrors contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. */ - public boolean eq(SendError b) { + public boolean eq(org.ldk.structs.SendError b) { boolean ret = bindings.SendError_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/Sha256.java b/src/main/java/org/ldk/structs/Sha256.java index 6daa4ecd..d18cf826 100644 --- a/src/main/java/org/ldk/structs/Sha256.java +++ b/src/main/java/org/ldk/structs/Sha256.java @@ -55,7 +55,7 @@ public class Sha256 extends CommonBase { * 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(Sha256 b) { + public boolean eq(org.ldk.structs.Sha256 b) { boolean ret = bindings.Sha256_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/Shutdown.java b/src/main/java/org/ldk/structs/Shutdown.java index 9520c78d..e814ce54 100644 --- a/src/main/java/org/ldk/structs/Shutdown.java +++ b/src/main/java/org/ldk/structs/Shutdown.java @@ -94,7 +94,7 @@ public class Shutdown extends CommonBase { * 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(Shutdown b) { + public boolean eq(org.ldk.structs.Shutdown b) { boolean ret = bindings.Shutdown_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/ShutdownScript.java b/src/main/java/org/ldk/structs/ShutdownScript.java index 6fa57b2d..821aa586 100644 --- a/src/main/java/org/ldk/structs/ShutdownScript.java +++ b/src/main/java/org/ldk/structs/ShutdownScript.java @@ -45,7 +45,7 @@ public class ShutdownScript extends CommonBase { * 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(ShutdownScript b) { + public boolean eq(org.ldk.structs.ShutdownScript b) { boolean ret = bindings.ShutdownScript_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); @@ -111,7 +111,7 @@ 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(WitnessVersion version, byte[] program) { + public static Result_ShutdownScriptInvalidShutdownScriptZ new_witness_program(org.ldk.util.WitnessVersion version, byte[] program) { long ret = bindings.ShutdownScript_new_witness_program(version.getVal(), program); Reference.reachabilityFence(version); Reference.reachabilityFence(program); @@ -147,7 +147,7 @@ public class ShutdownScript extends CommonBase { * * Specifically, checks for compliance with feature `option_shutdown_anysegwit`. */ - public boolean is_compatible(InitFeatures features) { + public boolean is_compatible(org.ldk.structs.InitFeatures features) { boolean ret = bindings.ShutdownScript_is_compatible(this.ptr, features == null ? 0 : features.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(features); diff --git a/src/main/java/org/ldk/structs/Sign.java b/src/main/java/org/ldk/structs/Sign.java index 1c14591d..b68379f9 100644 --- a/src/main/java/org/ldk/structs/Sign.java +++ b/src/main/java/org/ldk/structs/Sign.java @@ -8,11 +8,13 @@ import java.lang.ref.Reference; import javax.annotation.Nullable; /** - * A cloneable signer. + * A writeable signer. * - * Although we require signers to be cloneable, it may be useful for developers to be able to use - * signers in an un-sized way, for example as `dyn BaseSign`. Therefore we separate the Clone trait, - * which implies Sized, into this derived trait. + * There will always be two instances of a signer per channel, one occupied by the + * [`ChannelManager`] and another by the channel's [`ChannelMonitor`]. + * + * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager + * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class Sign extends CommonBase { diff --git a/src/main/java/org/ldk/structs/SignOrCreationError.java b/src/main/java/org/ldk/structs/SignOrCreationError.java index 98930701..9cb6cdd3 100644 --- a/src/main/java/org/ldk/structs/SignOrCreationError.java +++ b/src/main/java/org/ldk/structs/SignOrCreationError.java @@ -94,7 +94,7 @@ public class SignOrCreationError extends CommonBase { * Checks if two SignOrCreationErrors contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. */ - public boolean eq(SignOrCreationError b) { + public boolean eq(org.ldk.structs.SignOrCreationError b) { boolean ret = bindings.SignOrCreationError_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/SignedRawInvoice.java b/src/main/java/org/ldk/structs/SignedRawInvoice.java index b8e83300..248ffc6b 100644 --- a/src/main/java/org/ldk/structs/SignedRawInvoice.java +++ b/src/main/java/org/ldk/structs/SignedRawInvoice.java @@ -29,7 +29,7 @@ public class SignedRawInvoice extends CommonBase { * 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(SignedRawInvoice b) { + public boolean eq(org.ldk.structs.SignedRawInvoice b) { boolean ret = bindings.SignedRawInvoice_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/SpendableOutputDescriptor.java b/src/main/java/org/ldk/structs/SpendableOutputDescriptor.java index e2cf0b2f..460a9b98 100644 --- a/src/main/java/org/ldk/structs/SpendableOutputDescriptor.java +++ b/src/main/java/org/ldk/structs/SpendableOutputDescriptor.java @@ -9,11 +9,15 @@ import javax.annotation.Nullable; /** - * When on-chain outputs are created by rust-lightning (which our counterparty is not able to - * claim at any point in the future) an event is generated which you must track and be able to - * spend on-chain. The information needed to do this is provided in this enum, including the - * outpoint describing which txid and output index is available, the full output which exists at - * that txid/index, and any keys or other information required to sign. + * Describes the necessary information to spend a spendable output. + * + * When on-chain outputs are created by LDK (which our counterparty is not able to claim at any + * point in the future) a [`SpendableOutputs`] event is generated which you must track and be able + * to spend on-chain. The information needed to do this is provided in this enum, including the + * outpoint describing which `txid` and output `index` is available, the full output which exists + * at that `txid`/`index`, and any keys or other information required to sign. + * + * [`SpendableOutputs`]: crate::util::events::Event::SpendableOutputs */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class SpendableOutputDescriptor extends CommonBase { @@ -38,15 +42,18 @@ public class SpendableOutputDescriptor extends CommonBase { } /** - * An output to a script which was provided via KeysInterface directly, either from - * `get_destination_script()` or `get_shutdown_scriptpubkey()`, thus you should already know - * how to spend it. No secret keys are provided as rust-lightning was never given any key. + * An output to a script which was provided via [`KeysInterface`] directly, either from + * [`get_destination_script`] or [`get_shutdown_scriptpubkey`], thus you should already + * know how to spend it. No secret keys are provided as LDK was never given any key. * These may include outputs from a transaction punishing our counterparty or claiming an HTLC * on-chain using the payment preimage or after it has timed out. + * + * [`get_shutdown_scriptpubkey`]: KeysInterface::get_shutdown_scriptpubkey + * [`get_destination_script`]: KeysInterface::get_shutdown_scriptpubkey */ public final static class StaticOutput extends SpendableOutputDescriptor { /** - * The outpoint which is spendable + * The outpoint which is spendable. */ public final org.ldk.structs.OutPoint outpoint; /** @@ -65,34 +72,44 @@ public class SpendableOutputDescriptor extends CommonBase { } } /** - * An output to a P2WSH script which can be spent with a single signature after a CSV delay. + * An output to a P2WSH script which can be spent with a single signature after an `OP_CSV` + * delay. * * The witness in the spending input should be: + * ```bitcoin * (MINIMALIF standard rule) + * ``` * - * Note that the nSequence field in the spending input must be set to to_self_delay - * (which means the transaction is not broadcastable until at least to_self_delay - * blocks after the outpoint confirms). + * Note that the `nSequence` field in the spending input must be set to + * [`DelayedPaymentOutputDescriptor::to_self_delay`] (which means the transaction is not + * broadcastable until at least [`DelayedPaymentOutputDescriptor::to_self_delay`] blocks after + * the outpoint confirms, see [BIP + * 68](https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki)). Also note that LDK + * won't generate a [`SpendableOutputDescriptor`] until the corresponding block height + * is reached. * * These are generally the result of a \"revocable\" output to us, spendable only by us unless * it is an output from an old state which we broadcast (which should never happen). * - * To derive the delayed_payment key which is used to sign for this input, you must pass the - * holder delayed_payment_base_key (ie the private key which corresponds to the pubkey in - * Sign::pubkeys().delayed_payment_basepoint) and the provided per_commitment_point to - * chan_utils::derive_private_key. The public key can be generated without the secret key - * using chan_utils::derive_public_key and only the delayed_payment_basepoint which appears in - * Sign::pubkeys(). + * To derive the delayed payment key which is used to sign this input, you must pass the + * holder [`InMemorySigner::delayed_payment_base_key`] (i.e., the private key which corresponds to the + * [`ChannelPublicKeys::delayed_payment_basepoint`] in [`BaseSign::pubkeys`]) and the provided + * [`DelayedPaymentOutputDescriptor::per_commitment_point`] to [`chan_utils::derive_private_key`]. The public key can be + * generated without the secret key using [`chan_utils::derive_public_key`] and only the + * [`ChannelPublicKeys::delayed_payment_basepoint`] which appears in [`BaseSign::pubkeys`]. * - * To derive the revocation_pubkey provided here (which is used in the witness - * script generation), you must pass the counterparty revocation_basepoint (which appears in the - * call to Sign::ready_channel) and the provided per_commitment point - * to chan_utils::derive_public_revocation_key. + * To derive the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] provided here (which is + * used in the witness script generation), you must pass the counterparty + * [`ChannelPublicKeys::revocation_basepoint`] (which appears in the call to + * [`BaseSign::provide_channel_parameters`]) and the provided + * [`DelayedPaymentOutputDescriptor::per_commitment_point`] to + * [`chan_utils::derive_public_revocation_key`]. * - * The witness script which is hashed and included in the output script_pubkey may be - * regenerated by passing the revocation_pubkey (derived as above), our delayed_payment pubkey - * (derived as above), and the to_self_delay contained here to - * chan_utils::get_revokeable_redeemscript. + * The witness script which is hashed and included in the output `script_pubkey` may be + * regenerated by passing the [`DelayedPaymentOutputDescriptor::revocation_pubkey`] (derived + * as explained above), our delayed payment pubkey (derived as explained above), and the + * [`DelayedPaymentOutputDescriptor::to_self_delay`] contained here to + * [`chan_utils::get_revokeable_redeemscript`]. */ public final static class DelayedPaymentOutput extends SpendableOutputDescriptor { public final org.ldk.structs.DelayedPaymentOutputDescriptor delayed_payment_output; @@ -105,10 +122,12 @@ public class SpendableOutputDescriptor extends CommonBase { } } /** - * An output to a P2WPKH, spendable exclusively by our payment key (ie the private key which - * corresponds to the public key in Sign::pubkeys().payment_point). - * The witness in the spending input, is, thus, simply: + * An output to a P2WPKH, spendable exclusively by our payment key (i.e., the private key + * which corresponds to the `payment_point` in [`BaseSign::pubkeys`]). The witness + * in the spending input is, thus, simply: + * ```bitcoin * + * ``` * * These are generally the result of our counterparty having broadcast the current state, * allowing us to claim the non-HTLC-encumbered outputs immediately. @@ -144,7 +163,7 @@ public class SpendableOutputDescriptor extends CommonBase { /** * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor */ - public static SpendableOutputDescriptor static_output(OutPoint outpoint, TxOut output) { + public static SpendableOutputDescriptor static_output(org.ldk.structs.OutPoint outpoint, org.ldk.structs.TxOut output) { long ret = bindings.SpendableOutputDescriptor_static_output(outpoint == null ? 0 : outpoint.ptr, output.ptr); Reference.reachabilityFence(outpoint); Reference.reachabilityFence(output); @@ -158,7 +177,7 @@ public class SpendableOutputDescriptor extends CommonBase { /** * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor */ - public static SpendableOutputDescriptor delayed_payment_output(DelayedPaymentOutputDescriptor a) { + public static SpendableOutputDescriptor delayed_payment_output(org.ldk.structs.DelayedPaymentOutputDescriptor a) { long ret = bindings.SpendableOutputDescriptor_delayed_payment_output(a == null ? 0 : a.ptr); Reference.reachabilityFence(a); if (ret >= 0 && ret <= 4096) { return null; } @@ -171,7 +190,7 @@ public class SpendableOutputDescriptor extends CommonBase { /** * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor */ - public static SpendableOutputDescriptor static_payment_output(StaticPaymentOutputDescriptor a) { + public static SpendableOutputDescriptor static_payment_output(org.ldk.structs.StaticPaymentOutputDescriptor a) { long ret = bindings.SpendableOutputDescriptor_static_payment_output(a == null ? 0 : a.ptr); Reference.reachabilityFence(a); if (ret >= 0 && ret <= 4096) { return null; } @@ -185,7 +204,7 @@ public class SpendableOutputDescriptor extends CommonBase { * Checks if two SpendableOutputDescriptors contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. */ - public boolean eq(SpendableOutputDescriptor b) { + public boolean eq(org.ldk.structs.SpendableOutputDescriptor b) { boolean ret = bindings.SpendableOutputDescriptor_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/StaticPaymentOutputDescriptor.java b/src/main/java/org/ldk/structs/StaticPaymentOutputDescriptor.java index b226186b..b9ae73b8 100644 --- a/src/main/java/org/ldk/structs/StaticPaymentOutputDescriptor.java +++ b/src/main/java/org/ldk/structs/StaticPaymentOutputDescriptor.java @@ -9,8 +9,9 @@ import javax.annotation.Nullable; /** - * Information about a spendable output to our \"payment key\". See - * SpendableOutputDescriptor::StaticPaymentOutput for more details on how to spend this. + * Information about a spendable output to our \"payment key\". + * + * See [`SpendableOutputDescriptor::StaticPaymentOutput`] for more details on how to spend this. */ @SuppressWarnings("unchecked") // We correctly assign various generic arrays public class StaticPaymentOutputDescriptor extends CommonBase { @@ -22,7 +23,7 @@ public class StaticPaymentOutputDescriptor extends CommonBase { } /** - * The outpoint which is spendable + * The outpoint which is spendable. */ public OutPoint get_outpoint() { long ret = bindings.StaticPaymentOutputDescriptor_get_outpoint(this.ptr); @@ -34,9 +35,9 @@ public class StaticPaymentOutputDescriptor extends CommonBase { } /** - * The outpoint which is spendable + * The outpoint which is spendable. */ - public void set_outpoint(OutPoint val) { + public void set_outpoint(org.ldk.structs.OutPoint val) { bindings.StaticPaymentOutputDescriptor_set_outpoint(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -44,7 +45,7 @@ public class StaticPaymentOutputDescriptor extends CommonBase { } /** - * The output which is referenced by the given outpoint + * The output which is referenced by the given outpoint. * * Returns a copy of the field. */ @@ -57,18 +58,17 @@ public class StaticPaymentOutputDescriptor extends CommonBase { } /** - * The output which is referenced by the given outpoint + * The output which is referenced by the given outpoint. */ - public void set_output(TxOut val) { + public void set_output(org.ldk.structs.TxOut val) { bindings.StaticPaymentOutputDescriptor_set_output(this.ptr, val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); } /** - * Arbitrary identification information returned by a call to - * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in - * the channel to spend the output. + * Arbitrary identification information returned by a call to [`BaseSign::channel_keys_id`]. + * This may be useful in re-deriving keys used in the channel to spend the output. */ public byte[] get_channel_keys_id() { byte[] ret = bindings.StaticPaymentOutputDescriptor_get_channel_keys_id(this.ptr); @@ -77,9 +77,8 @@ public class StaticPaymentOutputDescriptor extends CommonBase { } /** - * Arbitrary identification information returned by a call to - * `Sign::channel_keys_id()`. This may be useful in re-deriving keys used in - * the channel to spend the output. + * Arbitrary identification information returned by a call to [`BaseSign::channel_keys_id`]. + * This may be useful in re-deriving keys used in the channel to spend the output. */ public void set_channel_keys_id(byte[] val) { bindings.StaticPaymentOutputDescriptor_set_channel_keys_id(this.ptr, InternalUtils.check_arr_len(val, 32)); @@ -108,7 +107,7 @@ public class StaticPaymentOutputDescriptor extends CommonBase { /** * Constructs a new StaticPaymentOutputDescriptor given each field */ - public static StaticPaymentOutputDescriptor of(OutPoint outpoint_arg, TxOut output_arg, byte[] channel_keys_id_arg, long channel_value_satoshis_arg) { + public static StaticPaymentOutputDescriptor of(org.ldk.structs.OutPoint outpoint_arg, org.ldk.structs.TxOut output_arg, byte[] channel_keys_id_arg, long channel_value_satoshis_arg) { long ret = bindings.StaticPaymentOutputDescriptor_new(outpoint_arg == null ? 0 : outpoint_arg.ptr, output_arg.ptr, InternalUtils.check_arr_len(channel_keys_id_arg, 32), channel_value_satoshis_arg); Reference.reachabilityFence(outpoint_arg); Reference.reachabilityFence(output_arg); @@ -144,7 +143,7 @@ public class StaticPaymentOutputDescriptor extends CommonBase { * 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(StaticPaymentOutputDescriptor b) { + public boolean eq(org.ldk.structs.StaticPaymentOutputDescriptor b) { boolean ret = bindings.StaticPaymentOutputDescriptor_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.java b/src/main/java/org/ldk/structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.java index 802564ac..84ee50f9 100644 --- a/src/main/java/org/ldk/structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.java +++ b/src/main/java/org/ldk/structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.java @@ -78,7 +78,7 @@ public class ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ extends C /** * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements. */ - public static ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ of(ChannelAnnouncement a, ChannelUpdate b, ChannelUpdate c) { + public static ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ of(org.ldk.structs.ChannelAnnouncement a, org.ldk.structs.ChannelUpdate b, org.ldk.structs.ChannelUpdate c) { long ret = bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a == null ? 0 : a.ptr, b == null ? 0 : b.ptr, c == null ? 0 : c.ptr); Reference.reachabilityFence(a); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ.java b/src/main/java/org/ldk/structs/ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ.java index 741f0681..d7df71fe 100644 --- a/src/main/java/org/ldk/structs/ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ.java +++ b/src/main/java/org/ldk/structs/ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ.java @@ -80,7 +80,7 @@ public class ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ extends CommonBase /** * Creates a new C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ from the contained elements. */ - public static ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ of(OutPoint a, MonitorEvent[] b, byte[] c) { + public static ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ of(org.ldk.structs.OutPoint a, MonitorEvent[] b, byte[] c) { long ret = bindings.C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(a == null ? 0 : a.ptr, b != null ? Arrays.stream(b).mapToLong(b_conv_14 -> b_conv_14.ptr).toArray() : null, InternalUtils.check_arr_len(c, 33)); Reference.reachabilityFence(a); Reference.reachabilityFence(b); 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 024a0486..fc943321 100644 --- a/src/main/java/org/ldk/structs/ThreeTuple_RawInvoice_u832InvoiceSignatureZ.java +++ b/src/main/java/org/ldk/structs/ThreeTuple_RawInvoice_u832InvoiceSignatureZ.java @@ -75,7 +75,7 @@ public class ThreeTuple_RawInvoice_u832InvoiceSignatureZ extends CommonBase { /** * Creates a new C3Tuple_RawInvoice_u832InvoiceSignatureZ from the contained elements. */ - public static ThreeTuple_RawInvoice_u832InvoiceSignatureZ of(RawInvoice a, byte[] b, InvoiceSignature c) { + public static ThreeTuple_RawInvoice_u832InvoiceSignatureZ of(org.ldk.structs.RawInvoice a, byte[] b, org.ldk.structs.InvoiceSignature c) { long ret = bindings.C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(a == null ? 0 : a.ptr, InternalUtils.check_arr_len(b, 32), c == null ? 0 : c.ptr); Reference.reachabilityFence(a); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/TrustedCommitmentTransaction.java b/src/main/java/org/ldk/structs/TrustedCommitmentTransaction.java index ac6f7cd7..3f020e6e 100644 --- a/src/main/java/org/ldk/structs/TrustedCommitmentTransaction.java +++ b/src/main/java/org/ldk/structs/TrustedCommitmentTransaction.java @@ -75,7 +75,7 @@ public class TrustedCommitmentTransaction extends CommonBase { * * 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) { + public Result_CVec_SignatureZNoneZ get_htlc_sigs(byte[] htlc_base_key, org.ldk.structs.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); Reference.reachabilityFence(this); Reference.reachabilityFence(htlc_base_key); diff --git a/src/main/java/org/ldk/structs/TwoTuple_BlockHashChannelMonitorZ.java b/src/main/java/org/ldk/structs/TwoTuple_BlockHashChannelMonitorZ.java index 20f35494..b81079bb 100644 --- a/src/main/java/org/ldk/structs/TwoTuple_BlockHashChannelMonitorZ.java +++ b/src/main/java/org/ldk/structs/TwoTuple_BlockHashChannelMonitorZ.java @@ -63,7 +63,7 @@ public class TwoTuple_BlockHashChannelMonitorZ extends CommonBase { /** * Creates a new C2Tuple_BlockHashChannelMonitorZ from the contained elements. */ - public static TwoTuple_BlockHashChannelMonitorZ of(byte[] a, ChannelMonitor b) { + public static TwoTuple_BlockHashChannelMonitorZ of(byte[] a, org.ldk.structs.ChannelMonitor b) { long ret = bindings.C2Tuple_BlockHashChannelMonitorZ_new(InternalUtils.check_arr_len(a, 32), b == null ? 0 : b.ptr); Reference.reachabilityFence(a); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/TwoTuple_OutPointCVec_MonitorUpdateIdZZ.java b/src/main/java/org/ldk/structs/TwoTuple_OutPointCVec_MonitorUpdateIdZZ.java new file mode 100644 index 00000000..6fe50d48 --- /dev/null +++ b/src/main/java/org/ldk/structs/TwoTuple_OutPointCVec_MonitorUpdateIdZZ.java @@ -0,0 +1,86 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * A Tuple + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class TwoTuple_OutPointCVec_MonitorUpdateIdZZ extends CommonBase { + TwoTuple_OutPointCVec_MonitorUpdateIdZZ(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(ptr); } + } + + /** + * + */ + public OutPoint get_a() { + long ret = bindings.C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutPoint(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * + */ + public MonitorUpdateId[] get_b() { + long[] ret = bindings.C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(this.ptr); + Reference.reachabilityFence(this); + int ret_conv_17_len = ret.length; + MonitorUpdateId[] ret_conv_17_arr = new MonitorUpdateId[ret_conv_17_len]; + for (int r = 0; r < ret_conv_17_len; r++) { + long ret_conv_17 = ret[r]; + org.ldk.structs.MonitorUpdateId ret_conv_17_hu_conv = null; if (ret_conv_17 < 0 || ret_conv_17 > 4096) { ret_conv_17_hu_conv = new org.ldk.structs.MonitorUpdateId(null, ret_conv_17); } + if (ret_conv_17_hu_conv != null) { ret_conv_17_hu_conv.ptrs_to.add(this); }; + ret_conv_17_arr[r] = ret_conv_17_hu_conv; + } + return ret_conv_17_arr; + } + + long clone_ptr() { + long ret = bindings.C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * Creates a new tuple which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public TwoTuple_OutPointCVec_MonitorUpdateIdZZ clone() { + long ret = bindings.C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_OutPointCVec_MonitorUpdateIdZZ ret_hu_conv = new TwoTuple_OutPointCVec_MonitorUpdateIdZZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C2Tuple_OutPointCVec_MonitorUpdateIdZZ from the contained elements. + */ + public static TwoTuple_OutPointCVec_MonitorUpdateIdZZ of(org.ldk.structs.OutPoint a, MonitorUpdateId[] b) { + long ret = bindings.C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(a == null ? 0 : a.ptr, b != null ? Arrays.stream(b).mapToLong(b_conv_17 -> b_conv_17 == null ? 0 : b_conv_17.ptr).toArray() : null); + Reference.reachabilityFence(a); + Reference.reachabilityFence(b); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_OutPointCVec_MonitorUpdateIdZZ ret_hu_conv = new TwoTuple_OutPointCVec_MonitorUpdateIdZZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(a); }; + for (MonitorUpdateId b_conv_17: b) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(b_conv_17); }; }; + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/TwoTuple_OutPointScriptZ.java b/src/main/java/org/ldk/structs/TwoTuple_OutPointScriptZ.java index c0f48c10..64df41c0 100644 --- a/src/main/java/org/ldk/structs/TwoTuple_OutPointScriptZ.java +++ b/src/main/java/org/ldk/structs/TwoTuple_OutPointScriptZ.java @@ -63,7 +63,7 @@ public class TwoTuple_OutPointScriptZ extends CommonBase { /** * Creates a new C2Tuple_OutPointScriptZ from the contained elements. */ - public static TwoTuple_OutPointScriptZ of(OutPoint a, byte[] b) { + public static TwoTuple_OutPointScriptZ of(org.ldk.structs.OutPoint a, byte[] b) { long ret = bindings.C2Tuple_OutPointScriptZ_new(a == null ? 0 : a.ptr, b); Reference.reachabilityFence(a); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/TwoTuple_PublicKeyTypeZ.java b/src/main/java/org/ldk/structs/TwoTuple_PublicKeyTypeZ.java index 67db1d93..f6326afc 100644 --- a/src/main/java/org/ldk/structs/TwoTuple_PublicKeyTypeZ.java +++ b/src/main/java/org/ldk/structs/TwoTuple_PublicKeyTypeZ.java @@ -63,7 +63,7 @@ public class TwoTuple_PublicKeyTypeZ extends CommonBase { /** * Creates a new C2Tuple_PublicKeyTypeZ from the contained elements. */ - public static TwoTuple_PublicKeyTypeZ of(byte[] a, Type b) { + public static TwoTuple_PublicKeyTypeZ of(byte[] a, org.ldk.structs.Type b) { long ret = bindings.C2Tuple_PublicKeyTypeZ_new(InternalUtils.check_arr_len(a, 33), b == null ? 0 : b.ptr); Reference.reachabilityFence(a); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/TwoTuple_TxidBlockHashZ.java b/src/main/java/org/ldk/structs/TwoTuple_TxidBlockHashZ.java new file mode 100644 index 00000000..23645362 --- /dev/null +++ b/src/main/java/org/ldk/structs/TwoTuple_TxidBlockHashZ.java @@ -0,0 +1,73 @@ +package org.ldk.structs; + +import org.ldk.impl.bindings; +import org.ldk.enums.*; +import org.ldk.util.*; +import java.util.Arrays; +import java.lang.ref.Reference; +import javax.annotation.Nullable; + + +/** + * A Tuple + */ +@SuppressWarnings("unchecked") // We correctly assign various generic arrays +public class TwoTuple_TxidBlockHashZ extends CommonBase { + TwoTuple_TxidBlockHashZ(Object _dummy, long ptr) { super(ptr); } + @Override @SuppressWarnings("deprecation") + protected void finalize() throws Throwable { + super.finalize(); + if (ptr != 0) { bindings.C2Tuple_TxidBlockHashZ_free(ptr); } + } + + /** + * + */ + public byte[] get_a() { + byte[] ret = bindings.C2Tuple_TxidBlockHashZ_get_a(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * + */ + public byte[] get_b() { + byte[] ret = bindings.C2Tuple_TxidBlockHashZ_get_b(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + long clone_ptr() { + long ret = bindings.C2Tuple_TxidBlockHashZ_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_TxidBlockHashZ clone() { + long ret = bindings.C2Tuple_TxidBlockHashZ_clone(this.ptr); + Reference.reachabilityFence(this); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_TxidBlockHashZ ret_hu_conv = new TwoTuple_TxidBlockHashZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C2Tuple_TxidBlockHashZ from the contained elements. + */ + public static TwoTuple_TxidBlockHashZ of(byte[] a, byte[] b) { + long ret = bindings.C2Tuple_TxidBlockHashZ_new(InternalUtils.check_arr_len(a, 32), InternalUtils.check_arr_len(b, 32)); + Reference.reachabilityFence(a); + Reference.reachabilityFence(b); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_TxidBlockHashZ ret_hu_conv = new TwoTuple_TxidBlockHashZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + +} diff --git a/src/main/java/org/ldk/structs/TwoTuple_u32TxOutZ.java b/src/main/java/org/ldk/structs/TwoTuple_u32TxOutZ.java index b9ae4b77..7c2a6102 100644 --- a/src/main/java/org/ldk/structs/TwoTuple_u32TxOutZ.java +++ b/src/main/java/org/ldk/structs/TwoTuple_u32TxOutZ.java @@ -62,7 +62,7 @@ public class TwoTuple_u32TxOutZ extends CommonBase { /** * Creates a new C2Tuple_u32TxOutZ from the contained elements. */ - public static TwoTuple_u32TxOutZ of(int a, TxOut b) { + public static TwoTuple_u32TxOutZ of(int a, org.ldk.structs.TxOut b) { long ret = bindings.C2Tuple_u32TxOutZ_new(a, b.ptr); Reference.reachabilityFence(a); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/TxCreationKeys.java b/src/main/java/org/ldk/structs/TxCreationKeys.java index e02ea664..1fe8e9d1 100644 --- a/src/main/java/org/ldk/structs/TxCreationKeys.java +++ b/src/main/java/org/ldk/structs/TxCreationKeys.java @@ -145,7 +145,7 @@ public class TxCreationKeys extends CommonBase { * 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(TxCreationKeys b) { + public boolean eq(org.ldk.structs.TxCreationKeys b) { boolean ret = bindings.TxCreationKeys_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); @@ -199,7 +199,7 @@ public class TxCreationKeys extends CommonBase { * Create per-state keys from channel base points and the per-commitment point. * Key set is asymmetric and can't be used as part of counter-signatory set of transactions. */ - public static Result_TxCreationKeysErrorZ derive_new(byte[] per_commitment_point, byte[] broadcaster_delayed_payment_base, byte[] broadcaster_htlc_base, byte[] countersignatory_revocation_base, byte[] countersignatory_htlc_base) { + public static TxCreationKeys derive_new(byte[] per_commitment_point, byte[] broadcaster_delayed_payment_base, byte[] broadcaster_htlc_base, byte[] countersignatory_revocation_base, byte[] countersignatory_htlc_base) { long ret = bindings.TxCreationKeys_derive_new(InternalUtils.check_arr_len(per_commitment_point, 33), InternalUtils.check_arr_len(broadcaster_delayed_payment_base, 33), InternalUtils.check_arr_len(broadcaster_htlc_base, 33), InternalUtils.check_arr_len(countersignatory_revocation_base, 33), InternalUtils.check_arr_len(countersignatory_htlc_base, 33)); Reference.reachabilityFence(per_commitment_point); Reference.reachabilityFence(broadcaster_delayed_payment_base); @@ -207,7 +207,8 @@ public class TxCreationKeys extends CommonBase { Reference.reachabilityFence(countersignatory_revocation_base); Reference.reachabilityFence(countersignatory_htlc_base); if (ret >= 0 && ret <= 4096) { return null; } - Result_TxCreationKeysErrorZ ret_hu_conv = Result_TxCreationKeysErrorZ.constr_from_ptr(ret); + org.ldk.structs.TxCreationKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxCreationKeys(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; return ret_hu_conv; } @@ -215,13 +216,14 @@ public class TxCreationKeys extends CommonBase { * Generate per-state keys from channel static keys. * Key set is asymmetric and can't be used as part of counter-signatory set of transactions. */ - public static Result_TxCreationKeysErrorZ from_channel_static_keys(byte[] per_commitment_point, ChannelPublicKeys broadcaster_keys, ChannelPublicKeys countersignatory_keys) { + public static TxCreationKeys from_channel_static_keys(byte[] per_commitment_point, org.ldk.structs.ChannelPublicKeys broadcaster_keys, org.ldk.structs.ChannelPublicKeys countersignatory_keys) { long ret = bindings.TxCreationKeys_from_channel_static_keys(InternalUtils.check_arr_len(per_commitment_point, 33), broadcaster_keys == null ? 0 : broadcaster_keys.ptr, countersignatory_keys == null ? 0 : countersignatory_keys.ptr); Reference.reachabilityFence(per_commitment_point); Reference.reachabilityFence(broadcaster_keys); Reference.reachabilityFence(countersignatory_keys); if (ret >= 0 && ret <= 4096) { return null; } - Result_TxCreationKeysErrorZ ret_hu_conv = Result_TxCreationKeysErrorZ.constr_from_ptr(ret); + org.ldk.structs.TxCreationKeys ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxCreationKeys(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(broadcaster_keys); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(countersignatory_keys); }; 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 d042e41b..f77c766b 100644 --- a/src/main/java/org/ldk/structs/UnsignedChannelAnnouncement.java +++ b/src/main/java/org/ldk/structs/UnsignedChannelAnnouncement.java @@ -35,7 +35,7 @@ public class UnsignedChannelAnnouncement extends CommonBase { /** * The advertised channel features */ - public void set_features(ChannelFeatures val) { + public void set_features(org.ldk.structs.ChannelFeatures val) { bindings.UnsignedChannelAnnouncement_set_features(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -173,7 +173,7 @@ public class UnsignedChannelAnnouncement extends CommonBase { * 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(UnsignedChannelAnnouncement b) { + public boolean eq(org.ldk.structs.UnsignedChannelAnnouncement b) { boolean ret = bindings.UnsignedChannelAnnouncement_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/UnsignedChannelUpdate.java b/src/main/java/org/ldk/structs/UnsignedChannelUpdate.java index 7805cc07..91ed2a7d 100644 --- a/src/main/java/org/ldk/structs/UnsignedChannelUpdate.java +++ b/src/main/java/org/ldk/structs/UnsignedChannelUpdate.java @@ -264,7 +264,7 @@ public class UnsignedChannelUpdate extends CommonBase { * 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(UnsignedChannelUpdate b) { + public boolean eq(org.ldk.structs.UnsignedChannelUpdate b) { boolean ret = bindings.UnsignedChannelUpdate_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java b/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java index f9152c40..afecabf1 100644 --- a/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java +++ b/src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java @@ -35,7 +35,7 @@ public class UnsignedNodeAnnouncement extends CommonBase { /** * The advertised features */ - public void set_features(NodeFeatures val) { + public void set_features(org.ldk.structs.NodeFeatures val) { bindings.UnsignedNodeAnnouncement_set_features(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -169,7 +169,7 @@ public class UnsignedNodeAnnouncement extends CommonBase { * 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(UnsignedNodeAnnouncement b) { + public boolean eq(org.ldk.structs.UnsignedNodeAnnouncement b) { boolean ret = bindings.UnsignedNodeAnnouncement_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/UpdateAddHTLC.java b/src/main/java/org/ldk/structs/UpdateAddHTLC.java index d8275771..84ab2d94 100644 --- a/src/main/java/org/ldk/structs/UpdateAddHTLC.java +++ b/src/main/java/org/ldk/structs/UpdateAddHTLC.java @@ -133,7 +133,7 @@ public class UpdateAddHTLC extends CommonBase { * 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(UpdateAddHTLC b) { + public boolean eq(org.ldk.structs.UpdateAddHTLC b) { boolean ret = bindings.UpdateAddHTLC_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/UpdateFailHTLC.java b/src/main/java/org/ldk/structs/UpdateFailHTLC.java index 5d62006e..64982c97 100644 --- a/src/main/java/org/ldk/structs/UpdateFailHTLC.java +++ b/src/main/java/org/ldk/structs/UpdateFailHTLC.java @@ -79,7 +79,7 @@ public class UpdateFailHTLC extends CommonBase { * 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(UpdateFailHTLC b) { + public boolean eq(org.ldk.structs.UpdateFailHTLC b) { boolean ret = bindings.UpdateFailHTLC_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/UpdateFailMalformedHTLC.java b/src/main/java/org/ldk/structs/UpdateFailMalformedHTLC.java index c1188c03..fd8f75b8 100644 --- a/src/main/java/org/ldk/structs/UpdateFailMalformedHTLC.java +++ b/src/main/java/org/ldk/structs/UpdateFailMalformedHTLC.java @@ -97,7 +97,7 @@ public class UpdateFailMalformedHTLC extends CommonBase { * 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(UpdateFailMalformedHTLC b) { + public boolean eq(org.ldk.structs.UpdateFailMalformedHTLC b) { boolean ret = bindings.UpdateFailMalformedHTLC_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/UpdateFee.java b/src/main/java/org/ldk/structs/UpdateFee.java index 1d1a6429..5795555f 100644 --- a/src/main/java/org/ldk/structs/UpdateFee.java +++ b/src/main/java/org/ldk/structs/UpdateFee.java @@ -92,7 +92,7 @@ public class UpdateFee extends CommonBase { * 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(UpdateFee b) { + public boolean eq(org.ldk.structs.UpdateFee b) { boolean ret = bindings.UpdateFee_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/UpdateFulfillHTLC.java b/src/main/java/org/ldk/structs/UpdateFulfillHTLC.java index 9e66df6f..63332291 100644 --- a/src/main/java/org/ldk/structs/UpdateFulfillHTLC.java +++ b/src/main/java/org/ldk/structs/UpdateFulfillHTLC.java @@ -111,7 +111,7 @@ public class UpdateFulfillHTLC extends CommonBase { * 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(UpdateFulfillHTLC b) { + public boolean eq(org.ldk.structs.UpdateFulfillHTLC b) { boolean ret = bindings.UpdateFulfillHTLC_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/UserConfig.java b/src/main/java/org/ldk/structs/UserConfig.java index 32eca6f6..2861b06e 100644 --- a/src/main/java/org/ldk/structs/UserConfig.java +++ b/src/main/java/org/ldk/structs/UserConfig.java @@ -38,7 +38,7 @@ public class UserConfig extends CommonBase { /** * Channel handshake config that we propose to our counterparty. */ - public void set_channel_handshake_config(ChannelHandshakeConfig val) { + public void set_channel_handshake_config(org.ldk.structs.ChannelHandshakeConfig val) { bindings.UserConfig_set_channel_handshake_config(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -60,7 +60,7 @@ public class UserConfig extends CommonBase { /** * Limits applied to our counterparty's proposed channel handshake config settings. */ - public void set_channel_handshake_limits(ChannelHandshakeLimits val) { + public void set_channel_handshake_limits(org.ldk.structs.ChannelHandshakeLimits val) { bindings.UserConfig_set_channel_handshake_limits(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -82,7 +82,7 @@ public class UserConfig extends CommonBase { /** * Channel config which affects behavior during channel lifetime. */ - public void set_channel_config(ChannelConfig val) { + public void set_channel_config(org.ldk.structs.ChannelConfig val) { bindings.UserConfig_set_channel_config(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -199,17 +199,54 @@ public class UserConfig extends CommonBase { Reference.reachabilityFence(val); } + /** + * If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over + * fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC + * intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user. + * + * Setting this to true may break backwards compatibility with LDK versions < 0.0.113. + * + * Default value: false. + * + * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid + * [`Event::HTLCIntercepted`]: crate::util::events::Event::HTLCIntercepted + */ + public boolean get_accept_intercept_htlcs() { + boolean ret = bindings.UserConfig_get_accept_intercept_htlcs(this.ptr); + Reference.reachabilityFence(this); + return ret; + } + + /** + * If this is set to true, LDK will intercept HTLCs that are attempting to be forwarded over + * fake short channel ids generated via [`ChannelManager::get_intercept_scid`]. Upon HTLC + * intercept, LDK will generate an [`Event::HTLCIntercepted`] which MUST be handled by the user. + * + * Setting this to true may break backwards compatibility with LDK versions < 0.0.113. + * + * Default value: false. + * + * [`ChannelManager::get_intercept_scid`]: crate::ln::channelmanager::ChannelManager::get_intercept_scid + * [`Event::HTLCIntercepted`]: crate::util::events::Event::HTLCIntercepted + */ + public void set_accept_intercept_htlcs(boolean val) { + bindings.UserConfig_set_accept_intercept_htlcs(this.ptr, val); + Reference.reachabilityFence(this); + Reference.reachabilityFence(val); + } + /** * Constructs a new UserConfig given each field */ - public static UserConfig of(ChannelHandshakeConfig channel_handshake_config_arg, ChannelHandshakeLimits channel_handshake_limits_arg, ChannelConfig channel_config_arg, boolean accept_forwards_to_priv_channels_arg, boolean accept_inbound_channels_arg, boolean manually_accept_inbound_channels_arg) { - long ret = bindings.UserConfig_new(channel_handshake_config_arg == null ? 0 : channel_handshake_config_arg.ptr, channel_handshake_limits_arg == null ? 0 : channel_handshake_limits_arg.ptr, channel_config_arg == null ? 0 : channel_config_arg.ptr, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg, manually_accept_inbound_channels_arg); + public static UserConfig of(org.ldk.structs.ChannelHandshakeConfig channel_handshake_config_arg, org.ldk.structs.ChannelHandshakeLimits channel_handshake_limits_arg, org.ldk.structs.ChannelConfig channel_config_arg, boolean accept_forwards_to_priv_channels_arg, boolean accept_inbound_channels_arg, boolean manually_accept_inbound_channels_arg, boolean accept_intercept_htlcs_arg) { + long ret = bindings.UserConfig_new(channel_handshake_config_arg == null ? 0 : channel_handshake_config_arg.ptr, channel_handshake_limits_arg == null ? 0 : channel_handshake_limits_arg.ptr, channel_config_arg == null ? 0 : channel_config_arg.ptr, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg, manually_accept_inbound_channels_arg, accept_intercept_htlcs_arg); Reference.reachabilityFence(channel_handshake_config_arg); Reference.reachabilityFence(channel_handshake_limits_arg); Reference.reachabilityFence(channel_config_arg); Reference.reachabilityFence(accept_forwards_to_priv_channels_arg); Reference.reachabilityFence(accept_inbound_channels_arg); Reference.reachabilityFence(manually_accept_inbound_channels_arg); + Reference.reachabilityFence(accept_intercept_htlcs_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.UserConfig ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UserConfig(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; diff --git a/src/main/java/org/ldk/structs/UtilMethods.java b/src/main/java/org/ldk/structs/UtilMethods.java index db35dc91..6565229a 100644 --- a/src/main/java/org/ldk/structs/UtilMethods.java +++ b/src/main/java/org/ldk/structs/UtilMethods.java @@ -7,6 +7,25 @@ import java.lang.ref.Reference; import javax.annotation.Nullable; public class UtilMethods { + /** + * Gets the 128-bit integer, as 16 little-endian bytes + */ + public static byte[] U128_le_bytes(org.ldk.util.UInt128 val) { + byte[] ret = bindings.U128_le_bytes(val.getLEBytes()); + Reference.reachabilityFence(val); + return ret; + } + + /** + * Constructs a new U128 from 16 little-endian bytes + */ + public static UInt128 U128_new(byte[] le_bytes) { + byte[] ret = bindings.U128_new(InternalUtils.check_arr_len(le_bytes, 16)); + Reference.reachabilityFence(le_bytes); + org.ldk.util.UInt128 ret_conv = new org.ldk.util.UInt128(ret); + return ret_conv; + } + /** * Constructs a new COption_NoneZ containing a */ @@ -118,7 +137,7 @@ public class UtilMethods { /** * Read a C2Tuple_BlockHashChannelMonitorZ from a byte array, created by C2Tuple_BlockHashChannelMonitorZ_write */ - public static Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(byte[] ser, KeysInterface arg) { + public static Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(byte[] ser, org.ldk.structs.KeysInterface arg) { long ret = bindings.C2Tuple_BlockHashChannelMonitorZ_read(ser, arg == null ? 0 : arg.ptr); Reference.reachabilityFence(ser); Reference.reachabilityFence(arg); @@ -202,7 +221,7 @@ public class UtilMethods { * * [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) { + public static Result_C2Tuple_PaymentHashPaymentSecretZNoneZ create(org.ldk.structs.ExpandedKey keys, org.ldk.structs.Option_u64Z min_value_msat, int invoice_expiry_delta_secs, org.ldk.structs.KeysInterface keys_manager, long current_time) { long ret = bindings.create(keys == null ? 0 : keys.ptr, 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); @@ -225,7 +244,7 @@ public class UtilMethods { * * [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) { + public static Result_PaymentSecretNoneZ create_from_hash(org.ldk.structs.ExpandedKey keys, org.ldk.structs.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, 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); @@ -256,6 +275,18 @@ public class UtilMethods { return ret; } + /** + * Check if a given input witness attempts to claim a HTLC. + */ + public static Option_HTLCClaimZ HTLCClaim_from_witness(byte[] witness) { + long ret = bindings.HTLCClaim_from_witness(witness); + Reference.reachabilityFence(witness); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_HTLCClaimZ ret_hu_conv = org.ldk.structs.Option_HTLCClaimZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(ret_hu_conv); }; + return ret_hu_conv; + } + /** * Build the commitment secret from the seed and the commitment number */ @@ -269,7 +300,7 @@ public class UtilMethods { /** * Build a closing transaction */ - public static byte[] build_closing_transaction(long to_holder_value_sat, long to_counterparty_value_sat, byte[] to_holder_script, byte[] to_counterparty_script, OutPoint funding_outpoint) { + public static byte[] build_closing_transaction(long to_holder_value_sat, long to_counterparty_value_sat, byte[] to_holder_script, byte[] to_counterparty_script, org.ldk.structs.OutPoint funding_outpoint) { byte[] ret = bindings.build_closing_transaction(to_holder_value_sat, to_counterparty_value_sat, to_holder_script, to_counterparty_script, funding_outpoint == null ? 0 : funding_outpoint.ptr); Reference.reachabilityFence(to_holder_value_sat); Reference.reachabilityFence(to_counterparty_value_sat); @@ -282,34 +313,24 @@ public class UtilMethods { /** * Derives a per-commitment-transaction private key (eg an htlc key or delayed_payment key) * from the base secret and the per_commitment_point. - * - * Note that this is infallible iff we trust that at least one of the two input keys are randomly - * generated (ie our own). */ - public static Result_SecretKeyErrorZ derive_private_key(byte[] per_commitment_point, byte[] base_secret) { - long ret = bindings.derive_private_key(InternalUtils.check_arr_len(per_commitment_point, 33), InternalUtils.check_arr_len(base_secret, 32)); + public static byte[] derive_private_key(byte[] per_commitment_point, byte[] base_secret) { + byte[] ret = bindings.derive_private_key(InternalUtils.check_arr_len(per_commitment_point, 33), InternalUtils.check_arr_len(base_secret, 32)); Reference.reachabilityFence(per_commitment_point); Reference.reachabilityFence(base_secret); - if (ret >= 0 && ret <= 4096) { return null; } - Result_SecretKeyErrorZ ret_hu_conv = Result_SecretKeyErrorZ.constr_from_ptr(ret); - return ret_hu_conv; + return ret; } /** * Derives a per-commitment-transaction public key (eg an htlc key or a delayed_payment key) * from the base point and the per_commitment_key. This is the public equivalent of * derive_private_key - using only public keys to derive a public key instead of private keys. - * - * Note that this is infallible iff we trust that at least one of the two input keys are randomly - * generated (ie our own). */ - public static Result_PublicKeyErrorZ derive_public_key(byte[] per_commitment_point, byte[] base_point) { - long ret = bindings.derive_public_key(InternalUtils.check_arr_len(per_commitment_point, 33), InternalUtils.check_arr_len(base_point, 33)); + public static byte[] derive_public_key(byte[] per_commitment_point, byte[] base_point) { + byte[] ret = bindings.derive_public_key(InternalUtils.check_arr_len(per_commitment_point, 33), InternalUtils.check_arr_len(base_point, 33)); Reference.reachabilityFence(per_commitment_point); Reference.reachabilityFence(base_point); - if (ret >= 0 && ret <= 4096) { return null; } - Result_PublicKeyErrorZ ret_hu_conv = Result_PublicKeyErrorZ.constr_from_ptr(ret); - return ret_hu_conv; + return ret; } /** @@ -319,17 +340,12 @@ public class UtilMethods { * commitment transaction, thus per_commitment_secret always come from cheater * and revocation_base_secret always come from punisher, which is the broadcaster * of the transaction spending with this key knowledge. - * - * Note that this is infallible iff we trust that at least one of the two input keys are randomly - * generated (ie our own). */ - public static Result_SecretKeyErrorZ derive_private_revocation_key(byte[] per_commitment_secret, byte[] countersignatory_revocation_base_secret) { - long ret = bindings.derive_private_revocation_key(InternalUtils.check_arr_len(per_commitment_secret, 32), InternalUtils.check_arr_len(countersignatory_revocation_base_secret, 32)); + public static byte[] derive_private_revocation_key(byte[] per_commitment_secret, byte[] countersignatory_revocation_base_secret) { + byte[] ret = bindings.derive_private_revocation_key(InternalUtils.check_arr_len(per_commitment_secret, 32), InternalUtils.check_arr_len(countersignatory_revocation_base_secret, 32)); Reference.reachabilityFence(per_commitment_secret); Reference.reachabilityFence(countersignatory_revocation_base_secret); - if (ret >= 0 && ret <= 4096) { return null; } - Result_SecretKeyErrorZ ret_hu_conv = Result_SecretKeyErrorZ.constr_from_ptr(ret); - return ret_hu_conv; + return ret; } /** @@ -345,13 +361,11 @@ public class UtilMethods { * Note that this is infallible iff we trust that at least one of the two input keys are randomly * generated (ie our own). */ - public static Result_PublicKeyErrorZ derive_public_revocation_key(byte[] per_commitment_point, byte[] countersignatory_revocation_base_point) { - long ret = bindings.derive_public_revocation_key(InternalUtils.check_arr_len(per_commitment_point, 33), InternalUtils.check_arr_len(countersignatory_revocation_base_point, 33)); + public static byte[] derive_public_revocation_key(byte[] per_commitment_point, byte[] countersignatory_revocation_base_point) { + byte[] ret = bindings.derive_public_revocation_key(InternalUtils.check_arr_len(per_commitment_point, 33), InternalUtils.check_arr_len(countersignatory_revocation_base_point, 33)); Reference.reachabilityFence(per_commitment_point); Reference.reachabilityFence(countersignatory_revocation_base_point); - if (ret >= 0 && ret <= 4096) { return null; } - Result_PublicKeyErrorZ ret_hu_conv = Result_PublicKeyErrorZ.constr_from_ptr(ret); - return ret_hu_conv; + return ret; } /** @@ -371,7 +385,7 @@ public class UtilMethods { * Gets the witness redeemscript for an HTLC output in a commitment transaction. Note that htlc * does not need to have its previous_output_index filled. */ - public static byte[] get_htlc_redeemscript(HTLCOutputInCommitment htlc, boolean opt_anchors, TxCreationKeys keys) { + public static byte[] get_htlc_redeemscript(org.ldk.structs.HTLCOutputInCommitment htlc, boolean opt_anchors, org.ldk.structs.TxCreationKeys keys) { byte[] ret = bindings.get_htlc_redeemscript(htlc == null ? 0 : htlc.ptr, opt_anchors, keys == null ? 0 : keys.ptr); Reference.reachabilityFence(htlc); Reference.reachabilityFence(opt_anchors); @@ -399,18 +413,43 @@ public class UtilMethods { * Panics if htlc.transaction_output_index.is_none() (as such HTLCs do not appear in the * commitment transaction). */ - public static byte[] build_htlc_transaction(byte[] commitment_txid, int feerate_per_kw, short contest_delay, HTLCOutputInCommitment htlc, boolean opt_anchors, byte[] broadcaster_delayed_payment_key, byte[] revocation_key) { - byte[] ret = bindings.build_htlc_transaction(InternalUtils.check_arr_len(commitment_txid, 32), feerate_per_kw, contest_delay, htlc == null ? 0 : htlc.ptr, opt_anchors, InternalUtils.check_arr_len(broadcaster_delayed_payment_key, 33), InternalUtils.check_arr_len(revocation_key, 33)); + public static byte[] build_htlc_transaction(byte[] commitment_txid, int feerate_per_kw, short contest_delay, org.ldk.structs.HTLCOutputInCommitment htlc, boolean opt_anchors, boolean use_non_zero_fee_anchors, byte[] broadcaster_delayed_payment_key, byte[] revocation_key) { + byte[] ret = bindings.build_htlc_transaction(InternalUtils.check_arr_len(commitment_txid, 32), feerate_per_kw, contest_delay, htlc == null ? 0 : htlc.ptr, opt_anchors, use_non_zero_fee_anchors, InternalUtils.check_arr_len(broadcaster_delayed_payment_key, 33), InternalUtils.check_arr_len(revocation_key, 33)); Reference.reachabilityFence(commitment_txid); Reference.reachabilityFence(feerate_per_kw); Reference.reachabilityFence(contest_delay); Reference.reachabilityFence(htlc); Reference.reachabilityFence(opt_anchors); + Reference.reachabilityFence(use_non_zero_fee_anchors); Reference.reachabilityFence(broadcaster_delayed_payment_key); Reference.reachabilityFence(revocation_key); return ret; } + /** + * Returns the witness required to satisfy and spend a HTLC input. + * + * Note that preimage (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public static byte[] build_htlc_input_witness(byte[] local_sig, byte[] remote_sig, @Nullable byte[] preimage, byte[] redeem_script, boolean opt_anchors) { + byte[] ret = bindings.build_htlc_input_witness(InternalUtils.check_arr_len(local_sig, 64), InternalUtils.check_arr_len(remote_sig, 64), InternalUtils.check_arr_len(preimage, 32), redeem_script, opt_anchors); + Reference.reachabilityFence(local_sig); + Reference.reachabilityFence(remote_sig); + Reference.reachabilityFence(preimage); + Reference.reachabilityFence(redeem_script); + Reference.reachabilityFence(opt_anchors); + return ret; + } + + /** + * Gets the witnessScript for the to_remote output when anchors are enabled. + */ + public static byte[] get_to_countersignatory_with_anchors_redeemscript(byte[] payment_point) { + byte[] ret = bindings.get_to_countersignatory_with_anchors_redeemscript(InternalUtils.check_arr_len(payment_point, 33)); + Reference.reachabilityFence(payment_point); + return ret; + } + /** * Gets the witnessScript for an anchor output from the funding public key. * The witness in the spending input must be: @@ -425,6 +464,16 @@ public class UtilMethods { return ret; } + /** + * Returns the witness required to satisfy and spend an anchor input. + */ + public static byte[] build_anchor_input_witness(byte[] funding_key, byte[] funding_sig) { + byte[] ret = bindings.build_anchor_input_witness(InternalUtils.check_arr_len(funding_key, 33), InternalUtils.check_arr_len(funding_sig, 64)); + Reference.reachabilityFence(funding_key); + Reference.reachabilityFence(funding_sig); + return ret; + } + /** * Commitment transaction numbers which appear in the transactions themselves are XOR'd with a * shared secret first. This prevents on-chain observers from discovering how many commitment @@ -485,7 +534,7 @@ public class UtilMethods { * * 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_graph, @Nullable ChannelDetails[] first_hops, Logger logger, Score scorer, byte[] random_seed_bytes) { + public static Result_RouteLightningErrorZ find_route(byte[] our_node_pubkey, org.ldk.structs.RouteParameters route_params, org.ldk.structs.NetworkGraph network_graph, @Nullable ChannelDetails[] first_hops, org.ldk.structs.Logger logger, org.ldk.structs.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, network_graph == null ? 0 : network_graph.ptr, first_hops != null ? Arrays.stream(first_hops).mapToLong(first_hops_conv_16 -> first_hops_conv_16 == null ? 0 : first_hops_conv_16.ptr).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); @@ -510,7 +559,7 @@ public class UtilMethods { * * Re-uses logic from `find_route`, so the restrictions described there also apply here. */ - 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) { + public static Result_RouteLightningErrorZ build_route_from_hops(byte[] our_node_pubkey, byte[][] hops, org.ldk.structs.RouteParameters route_params, org.ldk.structs.NetworkGraph network_graph, org.ldk.structs.Logger logger, byte[] random_seed_bytes) { long ret = bindings.build_route_from_hops(InternalUtils.check_arr_len(our_node_pubkey, 33), hops != null ? Arrays.stream(hops).map(hops_conv_8 -> InternalUtils.check_arr_len(hops_conv_8, 33)).toArray(byte[][]::new) : null, route_params == null ? 0 : route_params.ptr, network_graph == null ? 0 : network_graph.ptr, logger == null ? 0 : logger.ptr, InternalUtils.check_arr_len(random_seed_bytes, 32)); Reference.reachabilityFence(our_node_pubkey); Reference.reachabilityFence(hops); @@ -559,7 +608,7 @@ public class UtilMethods { * * 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, @Nullable byte[] payment_hash, java.lang.String description, int invoice_expiry_delta_secs, PhantomRouteHints[] phantom_route_hints, KeysInterface keys_manager, Logger logger, org.ldk.enums.Currency network) { + public static Result_InvoiceSignOrCreationErrorZ create_phantom_invoice(org.ldk.structs.Option_u64Z amt_msat, @Nullable byte[] payment_hash, java.lang.String description, int invoice_expiry_delta_secs, PhantomRouteHints[] phantom_route_hints, org.ldk.structs.KeysInterface keys_manager, org.ldk.structs.Logger logger, 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).toArray() : null, keys_manager == null ? 0 : keys_manager.ptr, logger == null ? 0 : logger.ptr, network); Reference.reachabilityFence(amt_msat); Reference.reachabilityFence(payment_hash); @@ -612,7 +661,7 @@ public class UtilMethods { * * 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, @Nullable byte[] payment_hash, int invoice_expiry_delta_secs, Sha256 description_hash, PhantomRouteHints[] phantom_route_hints, KeysInterface keys_manager, Logger logger, org.ldk.enums.Currency network) { + public static Result_InvoiceSignOrCreationErrorZ create_phantom_invoice_with_description_hash(org.ldk.structs.Option_u64Z amt_msat, @Nullable byte[] payment_hash, int invoice_expiry_delta_secs, org.ldk.structs.Sha256 description_hash, PhantomRouteHints[] phantom_route_hints, org.ldk.structs.KeysInterface keys_manager, org.ldk.structs.Logger logger, 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, 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).toArray() : null, keys_manager == null ? 0 : keys_manager.ptr, logger == null ? 0 : logger.ptr, network); Reference.reachabilityFence(amt_msat); Reference.reachabilityFence(payment_hash); @@ -641,7 +690,7 @@ public class UtilMethods { * `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, Logger logger, org.ldk.enums.Currency network, Option_u64Z amt_msat, java.lang.String description, int invoice_expiry_delta_secs) { + public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.KeysInterface keys_manager, org.ldk.structs.Logger logger, org.ldk.enums.Currency network, org.ldk.structs.Option_u64Z amt_msat, java.lang.String description, int invoice_expiry_delta_secs) { long ret = bindings.create_invoice_from_channelmanager(channelmanager == null ? 0 : channelmanager.ptr, keys_manager == null ? 0 : keys_manager.ptr, logger == null ? 0 : logger.ptr, network, amt_msat.ptr, description, invoice_expiry_delta_secs); Reference.reachabilityFence(channelmanager); Reference.reachabilityFence(keys_manager); @@ -669,7 +718,7 @@ public class UtilMethods { * `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, Logger logger, org.ldk.enums.Currency network, Option_u64Z amt_msat, Sha256 description_hash, int invoice_expiry_delta_secs) { + public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.KeysInterface keys_manager, org.ldk.structs.Logger logger, org.ldk.enums.Currency network, org.ldk.structs.Option_u64Z amt_msat, org.ldk.structs.Sha256 description_hash, int invoice_expiry_delta_secs) { long ret = bindings.create_invoice_from_channelmanager_with_description_hash(channelmanager == null ? 0 : channelmanager.ptr, keys_manager == null ? 0 : keys_manager.ptr, logger == null ? 0 : logger.ptr, network, amt_msat.ptr, description_hash == null ? 0 : description_hash.ptr, invoice_expiry_delta_secs); Reference.reachabilityFence(channelmanager); Reference.reachabilityFence(keys_manager); @@ -692,7 +741,7 @@ 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, Logger logger, org.ldk.enums.Currency network, Option_u64Z amt_msat, Sha256 description_hash, long duration_since_epoch, int invoice_expiry_delta_secs) { + public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.KeysInterface keys_manager, org.ldk.structs.Logger logger, org.ldk.enums.Currency network, org.ldk.structs.Option_u64Z amt_msat, org.ldk.structs.Sha256 description_hash, long duration_since_epoch, int invoice_expiry_delta_secs) { long ret = bindings.create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(channelmanager == null ? 0 : channelmanager.ptr, keys_manager == null ? 0 : keys_manager.ptr, logger == null ? 0 : logger.ptr, network, amt_msat.ptr, description_hash == null ? 0 : description_hash.ptr, duration_since_epoch, invoice_expiry_delta_secs); Reference.reachabilityFence(channelmanager); Reference.reachabilityFence(keys_manager); @@ -716,7 +765,7 @@ 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, Logger logger, org.ldk.enums.Currency network, Option_u64Z amt_msat, java.lang.String description, long duration_since_epoch, int invoice_expiry_delta_secs) { + public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.KeysInterface keys_manager, org.ldk.structs.Logger logger, org.ldk.enums.Currency network, org.ldk.structs.Option_u64Z amt_msat, java.lang.String description, long duration_since_epoch, int invoice_expiry_delta_secs) { long ret = bindings.create_invoice_from_channelmanager_and_duration_since_epoch(channelmanager == null ? 0 : channelmanager.ptr, keys_manager == null ? 0 : keys_manager.ptr, logger == null ? 0 : logger.ptr, network, amt_msat.ptr, description, duration_since_epoch, invoice_expiry_delta_secs); Reference.reachabilityFence(channelmanager); Reference.reachabilityFence(keys_manager); @@ -734,4 +783,29 @@ public class UtilMethods { return ret_hu_conv; } + /** + * See [`create_invoice_from_channelmanager_and_duration_since_epoch`] + * This version allows for providing a custom [`PaymentHash`] for the invoice. + * This may be useful if you're building an on-chain swap or involving another protocol where + * the payment hash is also involved outside the scope of lightning. + */ + public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.KeysInterface keys_manager, org.ldk.structs.Logger logger, org.ldk.enums.Currency network, org.ldk.structs.Option_u64Z amt_msat, java.lang.String description, long duration_since_epoch, int invoice_expiry_delta_secs, byte[] payment_hash) { + long ret = bindings.create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(channelmanager == null ? 0 : channelmanager.ptr, keys_manager == null ? 0 : keys_manager.ptr, logger == null ? 0 : logger.ptr, network, amt_msat.ptr, description, duration_since_epoch, invoice_expiry_delta_secs, InternalUtils.check_arr_len(payment_hash, 32)); + Reference.reachabilityFence(channelmanager); + Reference.reachabilityFence(keys_manager); + Reference.reachabilityFence(logger); + Reference.reachabilityFence(network); + Reference.reachabilityFence(amt_msat); + Reference.reachabilityFence(description); + Reference.reachabilityFence(duration_since_epoch); + Reference.reachabilityFence(invoice_expiry_delta_secs); + Reference.reachabilityFence(payment_hash); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceSignOrCreationErrorZ ret_hu_conv = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(channelmanager); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(keys_manager); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.add(logger); }; + return ret_hu_conv; + } + } \ No newline at end of file diff --git a/src/main/java/org/ldk/structs/WarningMessage.java b/src/main/java/org/ldk/structs/WarningMessage.java index 354cbcfc..d4a6da4d 100644 --- a/src/main/java/org/ldk/structs/WarningMessage.java +++ b/src/main/java/org/ldk/structs/WarningMessage.java @@ -102,7 +102,7 @@ public class WarningMessage extends CommonBase { * 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(WarningMessage b) { + public boolean eq(org.ldk.structs.WarningMessage b) { boolean ret = bindings.WarningMessage_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/java/org/ldk/structs/Watch.java b/src/main/java/org/ldk/structs/Watch.java index dd031111..8da38213 100644 --- a/src/main/java/org/ldk/structs/Watch.java +++ b/src/main/java/org/ldk/structs/Watch.java @@ -125,7 +125,7 @@ public class Watch extends CommonBase { * [`block_connected`]: channelmonitor::ChannelMonitor::block_connected * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected */ - public ChannelMonitorUpdateStatus watch_channel(OutPoint funding_txo, ChannelMonitor monitor) { + public ChannelMonitorUpdateStatus watch_channel(org.ldk.structs.OutPoint funding_txo, org.ldk.structs.ChannelMonitor monitor) { ChannelMonitorUpdateStatus ret = bindings.Watch_watch_channel(this.ptr, funding_txo == null ? 0 : funding_txo.ptr, monitor == null ? 0 : monitor.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(funding_txo); @@ -143,7 +143,7 @@ public class Watch extends CommonBase { * * [`update_monitor`]: channelmonitor::ChannelMonitor::update_monitor */ - public ChannelMonitorUpdateStatus update_channel(OutPoint funding_txo, ChannelMonitorUpdate update) { + public ChannelMonitorUpdateStatus update_channel(org.ldk.structs.OutPoint funding_txo, org.ldk.structs.ChannelMonitorUpdate update) { ChannelMonitorUpdateStatus ret = bindings.Watch_update_channel(this.ptr, funding_txo == null ? 0 : funding_txo.ptr, update == null ? 0 : update.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(funding_txo); diff --git a/src/main/java/org/ldk/structs/WatchedOutput.java b/src/main/java/org/ldk/structs/WatchedOutput.java index ba3a0745..326d129b 100644 --- a/src/main/java/org/ldk/structs/WatchedOutput.java +++ b/src/main/java/org/ldk/structs/WatchedOutput.java @@ -68,7 +68,7 @@ public class WatchedOutput extends CommonBase { /** * Outpoint identifying the transaction output. */ - public void set_outpoint(OutPoint val) { + public void set_outpoint(org.ldk.structs.OutPoint val) { bindings.WatchedOutput_set_outpoint(this.ptr, val == null ? 0 : val.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(val); @@ -96,7 +96,7 @@ public class WatchedOutput extends CommonBase { /** * Constructs a new WatchedOutput given each field */ - public static WatchedOutput of(byte[] block_hash_arg, OutPoint outpoint_arg, byte[] script_pubkey_arg) { + public static WatchedOutput of(byte[] block_hash_arg, org.ldk.structs.OutPoint outpoint_arg, byte[] script_pubkey_arg) { long ret = bindings.WatchedOutput_new(InternalUtils.check_arr_len(block_hash_arg, 32), outpoint_arg == null ? 0 : outpoint_arg.ptr, script_pubkey_arg); Reference.reachabilityFence(block_hash_arg); Reference.reachabilityFence(outpoint_arg); @@ -131,7 +131,7 @@ public class WatchedOutput extends CommonBase { * 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(WatchedOutput b) { + public boolean eq(org.ldk.structs.WatchedOutput b) { boolean ret = bindings.WatchedOutput_eq(this.ptr, b == null ? 0 : b.ptr); Reference.reachabilityFence(this); Reference.reachabilityFence(b); diff --git a/src/main/jni/bindings.c b/src/main/jni/bindings.c index 503dd733..023f1126 100644 --- a/src/main/jni/bindings.c +++ b/src/main/jni/bindings.c @@ -21,84 +21,9 @@ #define CHECK(a) static jmethodID ordinal_meth = NULL; -static jmethodID slicedef_meth = NULL; -static jclass slicedef_cls = NULL; -JNIEXPORT void Java_org_ldk_impl_bindings_init(JNIEnv * env, jclass _b, jclass enum_class, jclass slicedef_class) { +JNIEXPORT void Java_org_ldk_impl_bindings_init(JNIEnv * env, jclass _b, jclass enum_class) { ordinal_meth = (*env)->GetMethodID(env, enum_class, "ordinal", "()I"); CHECK(ordinal_meth != NULL); - slicedef_meth = (*env)->GetMethodID(env, slicedef_class, "", "(JJJ)V"); - CHECK(slicedef_meth != NULL); - slicedef_cls = (*env)->NewGlobalRef(env, slicedef_class); - CHECK(slicedef_cls != NULL); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_deref_1bool (JNIEnv * env, jclass _a, jlong ptr) { - return *((bool*)ptr); -} -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_deref_1long (JNIEnv * env, jclass _a, jlong ptr) { - return *((long*)ptr); -} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_free_1heap_1ptr (JNIEnv * env, jclass _a, jlong ptr) { - FREE((void*)ptr); -} -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_read_1bytes (JNIEnv * env, jclass _b, jlong ptr, jlong len) { - jbyteArray ret_arr = (*env)->NewByteArray(env, len); - (*env)->SetByteArrayRegion(env, ret_arr, 0, len, (unsigned char*)ptr); - return ret_arr; -} -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_get_1u8_1slice_1bytes (JNIEnv * env, jclass _b, jlong slice_ptr) { - LDKu8slice *slice = (LDKu8slice*)slice_ptr; - jbyteArray ret_arr = (*env)->NewByteArray(env, slice->datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, slice->datalen, slice->data); - return ret_arr; -} -JNIEXPORT int64_t impl_bindings_bytes_1to_1u8_1vec (JNIEnv * env, jclass _b, jbyteArray bytes) { - LDKCVec_u8Z *vec = (LDKCVec_u8Z*)MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8"); - vec->datalen = (*env)->GetArrayLength(env, bytes); - vec->data = (uint8_t*)MALLOC(vec->datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion (env, bytes, 0, vec->datalen, vec->data); - return (uint64_t)vec; -} -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_txpointer_1get_1buffer (JNIEnv * env, jclass _b, jlong ptr) { - LDKTransaction *txdata = (LDKTransaction*)ptr; - LDKu8slice slice; - slice.data = txdata->data; - slice.datalen = txdata->datalen; - return Java_org_ldk_impl_bindings_get_1u8_1slice_1bytes(env, _b, (uint64_t)&slice); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_new_1txpointer_1copy_1data (JNIEnv * env, jclass _b, jbyteArray bytes) { - LDKTransaction *txdata = (LDKTransaction*)MALLOC(sizeof(LDKTransaction), "LDKTransaction"); - txdata->datalen = (*env)->GetArrayLength(env, bytes); - txdata->data = (uint8_t*)MALLOC(txdata->datalen, "Tx Data Bytes"); - txdata->data_is_owned = false; - (*env)->GetByteArrayRegion (env, bytes, 0, txdata->datalen, txdata->data); - return (uint64_t)txdata; -} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_txpointer_1free (JNIEnv * env, jclass _b, jlong ptr) { - LDKTransaction *tx = (LDKTransaction*)ptr; - tx->data_is_owned = true; - Transaction_free(*tx); - FREE((void*)ptr); -} -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_vec_1slice_1len (JNIEnv * env, jclass _a, jlong ptr) { - // Check offsets of a few Vec types are all consistent as we're meant to be generic across types - _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKCVec_SignatureZ, datalen), "Vec<*> needs to be mapped identically"); - _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKCVec_MessageSendEventZ, datalen), "Vec<*> needs to be mapped identically"); - _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKCVec_EventZ, datalen), "Vec<*> needs to be mapped identically"); - _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKCVec_C2Tuple_usizeTransactionZZ, datalen), "Vec<*> needs to be mapped identically"); - LDKCVec_u8Z *vec = (LDKCVec_u8Z*)ptr; - return (uint64_t)vec->datalen; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_new_1empty_1slice_1vec (JNIEnv * env, jclass _b) { - // Check sizes of a few Vec types are all consistent as we're meant to be generic across types - _Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKCVec_SignatureZ), "Vec<*> needs to be mapped identically"); - _Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKCVec_MessageSendEventZ), "Vec<*> needs to be mapped identically"); - _Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKCVec_EventZ), "Vec<*> needs to be mapped identically"); - _Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKCVec_C2Tuple_usizeTransactionZZ), "Vec<*> needs to be mapped identically"); - LDKCVec_u8Z *vec = (LDKCVec_u8Z*)MALLOC(sizeof(LDKCVec_u8Z), "Empty LDKCVec"); - vec->data = NULL; - vec->datalen = 0; - return (uint64_t)vec; } // We assume that CVec_u8Z and u8slice are the same size and layout (and thus pointers to the two can be mixed) @@ -463,6 +388,58 @@ static inline jclass LDKCurrency_to_java(JNIEnv *env, LDKCurrency val) { } } +static inline LDKHTLCClaim LDKHTLCClaim_from_java(JNIEnv *env, jclass clz) { + jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to HTLCClaim.ordinal() from rust threw an exception."); + } + switch (ord) { + case 0: return LDKHTLCClaim_OfferedTimeout; + case 1: return LDKHTLCClaim_OfferedPreimage; + case 2: return LDKHTLCClaim_AcceptedTimeout; + case 3: return LDKHTLCClaim_AcceptedPreimage; + case 4: return LDKHTLCClaim_Revocation; + } + (*env)->FatalError(env, "A call to HTLCClaim.ordinal() from rust returned an invalid value."); + abort(); // Unreachable, but will let the compiler know we don't return here +} +static jclass HTLCClaim_class = NULL; +static jfieldID HTLCClaim_LDKHTLCClaim_OfferedTimeout = NULL; +static jfieldID HTLCClaim_LDKHTLCClaim_OfferedPreimage = NULL; +static jfieldID HTLCClaim_LDKHTLCClaim_AcceptedTimeout = NULL; +static jfieldID HTLCClaim_LDKHTLCClaim_AcceptedPreimage = NULL; +static jfieldID HTLCClaim_LDKHTLCClaim_Revocation = NULL; +JNIEXPORT void JNICALL Java_org_ldk_enums_HTLCClaim_init (JNIEnv *env, jclass clz) { + HTLCClaim_class = (*env)->NewGlobalRef(env, clz); + CHECK(HTLCClaim_class != NULL); + HTLCClaim_LDKHTLCClaim_OfferedTimeout = (*env)->GetStaticFieldID(env, HTLCClaim_class, "LDKHTLCClaim_OfferedTimeout", "Lorg/ldk/enums/HTLCClaim;"); + CHECK(HTLCClaim_LDKHTLCClaim_OfferedTimeout != NULL); + HTLCClaim_LDKHTLCClaim_OfferedPreimage = (*env)->GetStaticFieldID(env, HTLCClaim_class, "LDKHTLCClaim_OfferedPreimage", "Lorg/ldk/enums/HTLCClaim;"); + CHECK(HTLCClaim_LDKHTLCClaim_OfferedPreimage != NULL); + HTLCClaim_LDKHTLCClaim_AcceptedTimeout = (*env)->GetStaticFieldID(env, HTLCClaim_class, "LDKHTLCClaim_AcceptedTimeout", "Lorg/ldk/enums/HTLCClaim;"); + CHECK(HTLCClaim_LDKHTLCClaim_AcceptedTimeout != NULL); + HTLCClaim_LDKHTLCClaim_AcceptedPreimage = (*env)->GetStaticFieldID(env, HTLCClaim_class, "LDKHTLCClaim_AcceptedPreimage", "Lorg/ldk/enums/HTLCClaim;"); + CHECK(HTLCClaim_LDKHTLCClaim_AcceptedPreimage != NULL); + HTLCClaim_LDKHTLCClaim_Revocation = (*env)->GetStaticFieldID(env, HTLCClaim_class, "LDKHTLCClaim_Revocation", "Lorg/ldk/enums/HTLCClaim;"); + CHECK(HTLCClaim_LDKHTLCClaim_Revocation != NULL); +} +static inline jclass LDKHTLCClaim_to_java(JNIEnv *env, LDKHTLCClaim val) { + switch (val) { + case LDKHTLCClaim_OfferedTimeout: + return (*env)->GetStaticObjectField(env, HTLCClaim_class, HTLCClaim_LDKHTLCClaim_OfferedTimeout); + case LDKHTLCClaim_OfferedPreimage: + return (*env)->GetStaticObjectField(env, HTLCClaim_class, HTLCClaim_LDKHTLCClaim_OfferedPreimage); + case LDKHTLCClaim_AcceptedTimeout: + return (*env)->GetStaticObjectField(env, HTLCClaim_class, HTLCClaim_LDKHTLCClaim_AcceptedTimeout); + case LDKHTLCClaim_AcceptedPreimage: + return (*env)->GetStaticObjectField(env, HTLCClaim_class, HTLCClaim_LDKHTLCClaim_AcceptedPreimage); + case LDKHTLCClaim_Revocation: + return (*env)->GetStaticObjectField(env, HTLCClaim_class, HTLCClaim_LDKHTLCClaim_Revocation); + default: abort(); + } +} + static inline LDKIOError LDKIOError_from_java(JNIEnv *env, jclass clz) { jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth); if (UNLIKELY((*env)->ExceptionCheck(env))) { @@ -1068,27 +1045,51 @@ uint64_t TxOut_get_value (struct LDKTxOut* thing) { return thing->value;}JNIEXPO return ret_conv; } -static inline struct LDKBlindedRoute CResult_BlindedRouteNoneZ_get_ok(LDKCResult_BlindedRouteNoneZ *NONNULL_PTR owner){ - LDKBlindedRoute ret = *owner->contents.result; - ret.is_owned = false; - return ret; +static jclass LDKCOption_HTLCClaimZ_Some_class = NULL; +static jmethodID LDKCOption_HTLCClaimZ_Some_meth = NULL; +static jclass LDKCOption_HTLCClaimZ_None_class = NULL; +static jmethodID LDKCOption_HTLCClaimZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1HTLCClaimZ_init (JNIEnv *env, jclass clz) { + LDKCOption_HTLCClaimZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_HTLCClaimZ$Some")); + CHECK(LDKCOption_HTLCClaimZ_Some_class != NULL); + LDKCOption_HTLCClaimZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_HTLCClaimZ_Some_class, "", "(Lorg/ldk/enums/HTLCClaim;)V"); + CHECK(LDKCOption_HTLCClaimZ_Some_meth != NULL); + LDKCOption_HTLCClaimZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_HTLCClaimZ$None")); + CHECK(LDKCOption_HTLCClaimZ_None_class != NULL); + LDKCOption_HTLCClaimZ_None_meth = (*env)->GetMethodID(env, LDKCOption_HTLCClaimZ_None_class, "", "()V"); + CHECK(LDKCOption_HTLCClaimZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1HTLCClaimZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_HTLCClaimZ *obj = (LDKCOption_HTLCClaimZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_HTLCClaimZ_Some: { + jclass some_conv = LDKHTLCClaim_to_java(env, obj->some); + return (*env)->NewObject(env, LDKCOption_HTLCClaimZ_Some_class, LDKCOption_HTLCClaimZ_Some_meth, some_conv); + } + case LDKCOption_HTLCClaimZ_None: { + return (*env)->NewObject(env, LDKCOption_HTLCClaimZ_None_class, LDKCOption_HTLCClaimZ_None_meth); + } + default: abort(); + } } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_BlindedRouteNoneZ* owner_conv = (LDKCResult_BlindedRouteNoneZ*)untag_ptr(owner); - LDKBlindedRoute ret_var = CResult_BlindedRouteNoneZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +static inline void CResult_NoneNoneZ_get_ok(LDKCResult_NoneNoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner); + CResult_NoneNoneZ_get_ok(owner_conv); } -static inline void CResult_BlindedRouteNoneZ_get_err(LDKCResult_BlindedRouteNoneZ *NONNULL_PTR owner){ +static inline void CResult_NoneNoneZ_get_err(LDKCResult_NoneNoneZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return *owner->contents.err; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_BlindedRouteNoneZ* owner_conv = (LDKCResult_BlindedRouteNoneZ*)untag_ptr(owner); - CResult_BlindedRouteNoneZ_get_err(owner_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner); + CResult_NoneNoneZ_get_err(owner_conv); } static jclass LDKDecodeError_UnknownVersion_class = NULL; @@ -1170,76 +1171,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDecodeError_1ref_1from_1 default: abort(); } } -static inline struct LDKBlindedRoute CResult_BlindedRouteDecodeErrorZ_get_ok(LDKCResult_BlindedRouteDecodeErrorZ *NONNULL_PTR owner){ - LDKBlindedRoute ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_BlindedRouteDecodeErrorZ* owner_conv = (LDKCResult_BlindedRouteDecodeErrorZ*)untag_ptr(owner); - LDKBlindedRoute ret_var = CResult_BlindedRouteDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline struct LDKDecodeError CResult_BlindedRouteDecodeErrorZ_get_err(LDKCResult_BlindedRouteDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_BlindedRouteDecodeErrorZ* owner_conv = (LDKCResult_BlindedRouteDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_BlindedRouteDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline struct LDKBlindedHop CResult_BlindedHopDecodeErrorZ_get_ok(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){ - LDKBlindedHop ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner); - LDKBlindedHop ret_var = CResult_BlindedHopDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline struct LDKDecodeError CResult_BlindedHopDecodeErrorZ_get_err(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_BlindedHopDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline void CResult_NoneNoneZ_get_ok(LDKCResult_NoneNoneZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner); - CResult_NoneNoneZ_get_ok(owner_conv); -} - -static inline void CResult_NoneNoneZ_get_err(LDKCResult_NoneNoneZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; -} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner); - CResult_NoneNoneZ_get_err(owner_conv); -} - static inline struct LDKCounterpartyCommitmentSecrets CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR owner){ LDKCounterpartyCommitmentSecrets ret = *owner->contents.result; ret.is_owned = false; @@ -1266,48 +1197,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommit return ret_ref; } -static inline struct LDKSecretKey CResult_SecretKeyErrorZ_get_ok(LDKCResult_SecretKeyErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_SecretKeyErrorZ* owner_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(owner); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_SecretKeyErrorZ_get_ok(owner_conv).bytes); - return ret_arr; -} - -static inline enum LDKSecp256k1Error CResult_SecretKeyErrorZ_get_err(LDKCResult_SecretKeyErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; -} -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_SecretKeyErrorZ* owner_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKSecp256k1Error_to_java(env, CResult_SecretKeyErrorZ_get_err(owner_conv)); - return ret_conv; -} - -static inline struct LDKPublicKey CResult_PublicKeyErrorZ_get_ok(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_PublicKeyErrorZ* owner_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(owner); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, CResult_PublicKeyErrorZ_get_ok(owner_conv).compressed_form); - return ret_arr; -} - -static inline enum LDKSecp256k1Error CResult_PublicKeyErrorZ_get_err(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; -} -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_PublicKeyErrorZ* owner_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKSecp256k1Error_to_java(env, CResult_PublicKeyErrorZ_get_err(owner_conv)); - return ret_conv; -} - static inline struct LDKTxCreationKeys CResult_TxCreationKeysDecodeErrorZ_get_ok(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR owner){ LDKTxCreationKeys ret = *owner->contents.result; ret.is_owned = false; @@ -1360,30 +1249,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysD return ret_ref; } -static inline struct LDKTxCreationKeys CResult_TxCreationKeysErrorZ_get_ok(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR owner){ - LDKTxCreationKeys ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_TxCreationKeysErrorZ* owner_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(owner); - LDKTxCreationKeys ret_var = CResult_TxCreationKeysErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline enum LDKSecp256k1Error CResult_TxCreationKeysErrorZ_get_err(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; -} -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_TxCreationKeysErrorZ* owner_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKSecp256k1Error_to_java(env, CResult_TxCreationKeysErrorZ_get_err(owner_conv)); - return ret_conv; -} - static jclass LDKCOption_u32Z_Some_class = NULL; static jmethodID LDKCOption_u32Z_Some_meth = NULL; static jclass LDKCOption_u32Z_None_class = NULL; @@ -1697,6 +1562,81 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInva return ret_ref; } +static inline struct LDKBlindedPath CResult_BlindedPathNoneZ_get_ok(LDKCResult_BlindedPathNoneZ *NONNULL_PTR owner){ + LDKBlindedPath ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedPathNoneZ* owner_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(owner); + LDKBlindedPath ret_var = CResult_BlindedPathNoneZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline void CResult_BlindedPathNoneZ_get_err(LDKCResult_BlindedPathNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedPathNoneZ* owner_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(owner); + CResult_BlindedPathNoneZ_get_err(owner_conv); +} + +static inline struct LDKBlindedPath CResult_BlindedPathDecodeErrorZ_get_ok(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR owner){ + LDKBlindedPath ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedPathDecodeErrorZ* owner_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(owner); + LDKBlindedPath ret_var = CResult_BlindedPathDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_BlindedPathDecodeErrorZ_get_err(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedPathDecodeErrorZ* owner_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_BlindedPathDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKBlindedHop CResult_BlindedHopDecodeErrorZ_get_ok(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){ + LDKBlindedHop ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner); + LDKBlindedHop ret_var = CResult_BlindedHopDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_BlindedHopDecodeErrorZ_get_err(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_BlindedHopDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline LDKCVec_RouteHopZ CVec_RouteHopZ_clone(const LDKCVec_RouteHopZ *orig) { LDKCVec_RouteHopZ ret = { .data = MALLOC(sizeof(LDKRouteHop) * orig->datalen, "LDKCVec_RouteHopZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -2332,98 +2272,41 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1get_1er return ret_conv; } -static inline struct LDKRouteHop CResult_RouteHopDecodeErrorZ_get_ok(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner){ - LDKRouteHop ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(owner); - LDKRouteHop ret_var = CResult_RouteHopDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline struct LDKDecodeError CResult_RouteHopDecodeErrorZ_get_err(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_RouteHopDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline LDKCVec_CVec_RouteHopZZ CVec_CVec_RouteHopZZ_clone(const LDKCVec_CVec_RouteHopZZ *orig) { - LDKCVec_CVec_RouteHopZZ ret = { .data = MALLOC(sizeof(LDKCVec_RouteHopZ) * orig->datalen, "LDKCVec_CVec_RouteHopZZ clone bytes"), .datalen = orig->datalen }; +static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) { + LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = CVec_RouteHopZ_clone(&orig->data[i]); + ret.data[i] = ChannelDetails_clone(&orig->data[i]); } return ret; } -static inline struct LDKRoute CResult_RouteDecodeErrorZ_get_ok(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKRoute CResult_RouteLightningErrorZ_get_ok(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){ LDKRoute ret = *owner->contents.result; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_RouteDecodeErrorZ* owner_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(owner); - LDKRoute ret_var = CResult_RouteDecodeErrorZ_get_ok(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner); + LDKRoute ret_var = CResult_RouteLightningErrorZ_get_ok(owner_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline struct LDKDecodeError CResult_RouteDecodeErrorZ_get_err(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_RouteDecodeErrorZ* owner_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_RouteDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline struct LDKRouteParameters CResult_RouteParametersDecodeErrorZ_get_ok(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner){ - LDKRouteParameters ret = *owner->contents.result; +static inline struct LDKLightningError CResult_RouteLightningErrorZ_get_err(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){ + LDKLightningError ret = *owner->contents.err; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_RouteParametersDecodeErrorZ* owner_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(owner); - LDKRouteParameters ret_var = CResult_RouteParametersDecodeErrorZ_get_ok(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner); + LDKLightningError ret_var = CResult_RouteLightningErrorZ_get_err(owner_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline struct LDKDecodeError CResult_RouteParametersDecodeErrorZ_get_err(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_RouteParametersDecodeErrorZ* owner_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_RouteParametersDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline LDKCVec_RouteHintZ CVec_RouteHintZ_clone(const LDKCVec_RouteHintZ *orig) { - LDKCVec_RouteHintZ ret = { .data = MALLOC(sizeof(LDKRouteHint) * orig->datalen, "LDKCVec_RouteHintZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = RouteHint_clone(&orig->data[i]); - } - return ret; -} static jclass LDKCOption_u64Z_Some_class = NULL; static jmethodID LDKCOption_u64Z_Some_meth = NULL; static jclass LDKCOption_u64Z_None_class = NULL; @@ -2453,6 +2336,124 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u64Z_1ref_1from default: abort(); } } +static inline struct LDKInFlightHtlcs CResult_InFlightHtlcsDecodeErrorZ_get_ok(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner){ + LDKInFlightHtlcs ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_InFlightHtlcsDecodeErrorZ* owner_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(owner); + LDKInFlightHtlcs ret_var = CResult_InFlightHtlcsDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_InFlightHtlcsDecodeErrorZ_get_err(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_InFlightHtlcsDecodeErrorZ* owner_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_InFlightHtlcsDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKRouteHop CResult_RouteHopDecodeErrorZ_get_ok(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner){ + LDKRouteHop ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(owner); + LDKRouteHop ret_var = CResult_RouteHopDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_RouteHopDecodeErrorZ_get_err(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_RouteHopDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline LDKCVec_CVec_RouteHopZZ CVec_CVec_RouteHopZZ_clone(const LDKCVec_CVec_RouteHopZZ *orig) { + LDKCVec_CVec_RouteHopZZ ret = { .data = MALLOC(sizeof(LDKCVec_RouteHopZ) * orig->datalen, "LDKCVec_CVec_RouteHopZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = CVec_RouteHopZ_clone(&orig->data[i]); + } + return ret; +} +static inline struct LDKRoute CResult_RouteDecodeErrorZ_get_ok(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner){ + LDKRoute ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_RouteDecodeErrorZ* owner_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(owner); + LDKRoute ret_var = CResult_RouteDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_RouteDecodeErrorZ_get_err(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_RouteDecodeErrorZ* owner_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_RouteDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKRouteParameters CResult_RouteParametersDecodeErrorZ_get_ok(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner){ + LDKRouteParameters ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_RouteParametersDecodeErrorZ* owner_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(owner); + LDKRouteParameters ret_var = CResult_RouteParametersDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_RouteParametersDecodeErrorZ_get_err(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_RouteParametersDecodeErrorZ* owner_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_RouteParametersDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline LDKCVec_RouteHintZ CVec_RouteHintZ_clone(const LDKCVec_RouteHintZ *orig) { + LDKCVec_RouteHintZ ret = { .data = MALLOC(sizeof(LDKRouteHint) * orig->datalen, "LDKCVec_RouteHintZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = RouteHint_clone(&orig->data[i]); + } + return ret; +} 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); @@ -2543,41 +2544,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecode return ret_ref; } -static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) { - LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = ChannelDetails_clone(&orig->data[i]); - } - return ret; -} -static inline struct LDKRoute CResult_RouteLightningErrorZ_get_ok(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){ - LDKRoute ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner); - LDKRoute ret_var = CResult_RouteLightningErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline struct LDKLightningError CResult_RouteLightningErrorZ_get_err(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){ - LDKLightningError ret = *owner->contents.err; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner); - LDKLightningError ret_var = CResult_RouteLightningErrorZ_get_err(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - static jclass LDKPaymentPurpose_InvoicePayment_class = NULL; static jmethodID LDKPaymentPurpose_InvoicePayment_meth = NULL; static jclass LDKPaymentPurpose_SpontaneousPayment_class = NULL; @@ -2785,6 +2751,8 @@ static jclass LDKHTLCDestination_NextHopChannel_class = NULL; static jmethodID LDKHTLCDestination_NextHopChannel_meth = NULL; static jclass LDKHTLCDestination_UnknownNextHop_class = NULL; static jmethodID LDKHTLCDestination_UnknownNextHop_meth = NULL; +static jclass LDKHTLCDestination_InvalidForward_class = NULL; +static jmethodID LDKHTLCDestination_InvalidForward_meth = NULL; static jclass LDKHTLCDestination_FailedPayment_class = NULL; static jmethodID LDKHTLCDestination_FailedPayment_meth = NULL; JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKHTLCDestination_init (JNIEnv *env, jclass clz) { @@ -2798,6 +2766,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKHTLCDestination_init ( CHECK(LDKHTLCDestination_UnknownNextHop_class != NULL); LDKHTLCDestination_UnknownNextHop_meth = (*env)->GetMethodID(env, LDKHTLCDestination_UnknownNextHop_class, "", "(J)V"); CHECK(LDKHTLCDestination_UnknownNextHop_meth != NULL); + LDKHTLCDestination_InvalidForward_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKHTLCDestination$InvalidForward")); + CHECK(LDKHTLCDestination_InvalidForward_class != NULL); + LDKHTLCDestination_InvalidForward_meth = (*env)->GetMethodID(env, LDKHTLCDestination_InvalidForward_class, "", "(J)V"); + CHECK(LDKHTLCDestination_InvalidForward_meth != NULL); LDKHTLCDestination_FailedPayment_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKHTLCDestination$FailedPayment")); CHECK(LDKHTLCDestination_FailedPayment_class != NULL); @@ -2818,6 +2791,10 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKHTLCDestination_1ref_1fr int64_t requested_forward_scid_conv = obj->unknown_next_hop.requested_forward_scid; return (*env)->NewObject(env, LDKHTLCDestination_UnknownNextHop_class, LDKHTLCDestination_UnknownNextHop_meth, requested_forward_scid_conv); } + case LDKHTLCDestination_InvalidForward: { + int64_t requested_forward_scid_conv = obj->invalid_forward.requested_forward_scid; + return (*env)->NewObject(env, LDKHTLCDestination_InvalidForward_class, LDKHTLCDestination_InvalidForward_meth, requested_forward_scid_conv); + } case LDKHTLCDestination_FailedPayment: { int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->failed_payment.payment_hash.data); @@ -2879,6 +2856,36 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDesti return ret_ref; } +static jclass LDKCOption_u128Z_Some_class = NULL; +static jmethodID LDKCOption_u128Z_Some_meth = NULL; +static jclass LDKCOption_u128Z_None_class = NULL; +static jmethodID LDKCOption_u128Z_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1u128Z_init (JNIEnv *env, jclass clz) { + LDKCOption_u128Z_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u128Z$Some")); + CHECK(LDKCOption_u128Z_Some_class != NULL); + LDKCOption_u128Z_Some_meth = (*env)->GetMethodID(env, LDKCOption_u128Z_Some_class, "", "([B)V"); + CHECK(LDKCOption_u128Z_Some_meth != NULL); + LDKCOption_u128Z_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u128Z$None")); + CHECK(LDKCOption_u128Z_None_class != NULL); + LDKCOption_u128Z_None_meth = (*env)->GetMethodID(env, LDKCOption_u128Z_None_class, "", "()V"); + CHECK(LDKCOption_u128Z_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u128Z_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_u128Z *obj = (LDKCOption_u128Z*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_u128Z_Some: { + int8_tArray some_arr = (*env)->NewByteArray(env, 16); + (*env)->SetByteArrayRegion(env, some_arr, 0, 16, obj->some.le_bytes); + return (*env)->NewObject(env, LDKCOption_u128Z_Some_class, LDKCOption_u128Z_Some_meth, some_arr); + } + case LDKCOption_u128Z_None: { + return (*env)->NewObject(env, LDKCOption_u128Z_None_class, LDKCOption_u128Z_None_meth); + } + default: abort(); + } +} static jclass LDKNetworkUpdate_ChannelUpdateMessage_class = NULL; static jmethodID LDKNetworkUpdate_ChannelUpdateMessage_meth = NULL; static jclass LDKNetworkUpdate_ChannelFailure_class = NULL; @@ -3015,8 +3022,8 @@ static inline LDKCVec_SpendableOutputDescriptorZ CVec_SpendableOutputDescriptorZ } 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_PaymentClaimable_class = NULL; +static jmethodID LDKEvent_PaymentClaimable_meth = NULL; static jclass LDKEvent_PaymentClaimed_class = NULL; static jmethodID LDKEvent_PaymentClaimed_meth = NULL; static jclass LDKEvent_PaymentSent_class = NULL; @@ -3033,10 +3040,14 @@ static jclass LDKEvent_ProbeFailed_class = NULL; static jmethodID LDKEvent_ProbeFailed_meth = NULL; static jclass LDKEvent_PendingHTLCsForwardable_class = NULL; static jmethodID LDKEvent_PendingHTLCsForwardable_meth = NULL; +static jclass LDKEvent_HTLCIntercepted_class = NULL; +static jmethodID LDKEvent_HTLCIntercepted_meth = NULL; static jclass LDKEvent_SpendableOutputs_class = NULL; static jmethodID LDKEvent_SpendableOutputs_meth = NULL; static jclass LDKEvent_PaymentForwarded_class = NULL; static jmethodID LDKEvent_PaymentForwarded_meth = NULL; +static jclass LDKEvent_ChannelReady_class = NULL; +static jmethodID LDKEvent_ChannelReady_meth = NULL; static jclass LDKEvent_ChannelClosed_class = NULL; static jmethodID LDKEvent_ChannelClosed_meth = NULL; static jclass LDKEvent_DiscardFunding_class = NULL; @@ -3049,17 +3060,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *en 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, "", "([B[BJ[BJ)V"); + LDKEvent_FundingGenerationReady_meth = (*env)->GetMethodID(env, LDKEvent_FundingGenerationReady_class, "", "([B[BJ[B[B)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_PaymentClaimable_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentClaimable")); + CHECK(LDKEvent_PaymentClaimable_class != NULL); + LDKEvent_PaymentClaimable_meth = (*env)->GetMethodID(env, LDKEvent_PaymentClaimable_class, "", "([B[BJJ[BJ)V"); + CHECK(LDKEvent_PaymentClaimable_meth != NULL); LDKEvent_PaymentClaimed_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentClaimed")); CHECK(LDKEvent_PaymentClaimed_class != NULL); - LDKEvent_PaymentClaimed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentClaimed_class, "", "([BJJ)V"); + LDKEvent_PaymentClaimed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentClaimed_class, "", "([B[BJJ)V"); CHECK(LDKEvent_PaymentClaimed_meth != NULL); LDKEvent_PaymentSent_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentSent")); @@ -3096,6 +3107,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *en CHECK(LDKEvent_PendingHTLCsForwardable_class != NULL); LDKEvent_PendingHTLCsForwardable_meth = (*env)->GetMethodID(env, LDKEvent_PendingHTLCsForwardable_class, "", "(J)V"); CHECK(LDKEvent_PendingHTLCsForwardable_meth != NULL); + LDKEvent_HTLCIntercepted_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$HTLCIntercepted")); + CHECK(LDKEvent_HTLCIntercepted_class != NULL); + LDKEvent_HTLCIntercepted_meth = (*env)->GetMethodID(env, LDKEvent_HTLCIntercepted_class, "", "([BJ[BJJ)V"); + CHECK(LDKEvent_HTLCIntercepted_meth != NULL); LDKEvent_SpendableOutputs_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$SpendableOutputs")); CHECK(LDKEvent_SpendableOutputs_class != NULL); @@ -3106,10 +3122,15 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *en CHECK(LDKEvent_PaymentForwarded_class != NULL); LDKEvent_PaymentForwarded_meth = (*env)->GetMethodID(env, LDKEvent_PaymentForwarded_class, "", "([B[BJZ)V"); CHECK(LDKEvent_PaymentForwarded_meth != NULL); + LDKEvent_ChannelReady_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$ChannelReady")); + CHECK(LDKEvent_ChannelReady_class != NULL); + LDKEvent_ChannelReady_meth = (*env)->GetMethodID(env, LDKEvent_ChannelReady_class, "", "([B[B[BJ)V"); + CHECK(LDKEvent_ChannelReady_meth != NULL); LDKEvent_ChannelClosed_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$ChannelClosed")); CHECK(LDKEvent_ChannelClosed_class != NULL); - LDKEvent_ChannelClosed_meth = (*env)->GetMethodID(env, LDKEvent_ChannelClosed_class, "", "([BJJ)V"); + LDKEvent_ChannelClosed_meth = (*env)->GetMethodID(env, LDKEvent_ChannelClosed_class, "", "([B[BJ)V"); CHECK(LDKEvent_ChannelClosed_meth != NULL); LDKEvent_DiscardFunding_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$DiscardFunding")); @@ -3139,22 +3160,30 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN 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, counterparty_node_id_arr, channel_value_satoshis_conv, output_script_arr, user_channel_id_conv); + int8_tArray user_channel_id_arr = (*env)->NewByteArray(env, 16); + (*env)->SetByteArrayRegion(env, user_channel_id_arr, 0, 16, obj->funding_generation_ready.user_channel_id.le_bytes); + return (*env)->NewObject(env, LDKEvent_FundingGenerationReady_class, LDKEvent_FundingGenerationReady_meth, temporary_channel_id_arr, counterparty_node_id_arr, channel_value_satoshis_conv, output_script_arr, user_channel_id_arr); } - case LDKEvent_PaymentReceived: { + case LDKEvent_PaymentClaimable: { + int8_tArray receiver_node_id_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, receiver_node_id_arr, 0, 33, obj->payment_claimable.receiver_node_id.compressed_form); 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 amount_msat_conv = obj->payment_received.amount_msat; - int64_t purpose_ref = tag_ptr(&obj->payment_received.purpose, false); - return (*env)->NewObject(env, LDKEvent_PaymentReceived_class, LDKEvent_PaymentReceived_meth, payment_hash_arr, amount_msat_conv, purpose_ref); + (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_claimable.payment_hash.data); + int64_t amount_msat_conv = obj->payment_claimable.amount_msat; + int64_t purpose_ref = tag_ptr(&obj->payment_claimable.purpose, false); + int8_tArray via_channel_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, via_channel_id_arr, 0, 32, obj->payment_claimable.via_channel_id.data); + int64_t via_user_channel_id_ref = tag_ptr(&obj->payment_claimable.via_user_channel_id, false); + return (*env)->NewObject(env, LDKEvent_PaymentClaimable_class, LDKEvent_PaymentClaimable_meth, receiver_node_id_arr, payment_hash_arr, amount_msat_conv, purpose_ref, via_channel_id_arr, via_user_channel_id_ref); } case LDKEvent_PaymentClaimed: { + int8_tArray receiver_node_id_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, receiver_node_id_arr, 0, 33, obj->payment_claimed.receiver_node_id.compressed_form); 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 = tag_ptr(&obj->payment_claimed.purpose, false); - return (*env)->NewObject(env, LDKEvent_PaymentClaimed_class, LDKEvent_PaymentClaimed_meth, payment_hash_arr, amount_msat_conv, purpose_ref); + return (*env)->NewObject(env, LDKEvent_PaymentClaimed_class, LDKEvent_PaymentClaimed_meth, receiver_node_id_arr, payment_hash_arr, amount_msat_conv, purpose_ref); } case LDKEvent_PaymentSent: { int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); @@ -3262,6 +3291,16 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN 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); } + case LDKEvent_HTLCIntercepted: { + int8_tArray intercept_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, intercept_id_arr, 0, 32, obj->htlc_intercepted.intercept_id.data); + int64_t requested_next_hop_scid_conv = obj->htlc_intercepted.requested_next_hop_scid; + int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->htlc_intercepted.payment_hash.data); + int64_t inbound_amount_msat_conv = obj->htlc_intercepted.inbound_amount_msat; + int64_t expected_outbound_amount_msat_conv = obj->htlc_intercepted.expected_outbound_amount_msat; + return (*env)->NewObject(env, LDKEvent_HTLCIntercepted_class, LDKEvent_HTLCIntercepted_meth, intercept_id_arr, requested_next_hop_scid_conv, payment_hash_arr, inbound_amount_msat_conv, expected_outbound_amount_msat_conv); + } case LDKEvent_SpendableOutputs: { LDKCVec_SpendableOutputDescriptorZ outputs_var = obj->spendable_outputs.outputs; int64_tArray outputs_arr = NULL; @@ -3283,12 +3322,26 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN jboolean claim_from_onchain_tx_conv = obj->payment_forwarded.claim_from_onchain_tx; 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_ChannelReady: { + int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, channel_id_arr, 0, 32, obj->channel_ready.channel_id.data); + int8_tArray user_channel_id_arr = (*env)->NewByteArray(env, 16); + (*env)->SetByteArrayRegion(env, user_channel_id_arr, 0, 16, obj->channel_ready.user_channel_id.le_bytes); + int8_tArray counterparty_node_id_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, counterparty_node_id_arr, 0, 33, obj->channel_ready.counterparty_node_id.compressed_form); + LDKChannelTypeFeatures channel_type_var = obj->channel_ready.channel_type; + int64_t channel_type_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_var); + channel_type_ref = tag_ptr(channel_type_var.inner, false); + return (*env)->NewObject(env, LDKEvent_ChannelReady_class, LDKEvent_ChannelReady_meth, channel_id_arr, user_channel_id_arr, counterparty_node_id_arr, channel_type_ref); + } case LDKEvent_ChannelClosed: { int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, channel_id_arr, 0, 32, obj->channel_closed.channel_id.data); - int64_t user_channel_id_conv = obj->channel_closed.user_channel_id; + int8_tArray user_channel_id_arr = (*env)->NewByteArray(env, 16); + (*env)->SetByteArrayRegion(env, user_channel_id_arr, 0, 16, obj->channel_closed.user_channel_id.le_bytes); int64_t reason_ref = tag_ptr(&obj->channel_closed.reason, false); - return (*env)->NewObject(env, LDKEvent_ChannelClosed_class, LDKEvent_ChannelClosed_meth, channel_id_arr, user_channel_id_conv, reason_ref); + return (*env)->NewObject(env, LDKEvent_ChannelClosed_class, LDKEvent_ChannelClosed_meth, channel_id_arr, user_channel_id_arr, reason_ref); } case LDKEvent_DiscardFunding: { int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32); @@ -3839,10 +3892,30 @@ static inline LDKCVec_C2Tuple_usizeTransactionZZ CVec_C2Tuple_usizeTransactionZZ } 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 }; +static inline struct LDKThirtyTwoBytes C2Tuple_TxidBlockHashZ_get_a(LDKC2Tuple_TxidBlockHashZ *NONNULL_PTR owner){ + return ThirtyTwoBytes_clone(&owner->a); +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidBlockHashZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_TxidBlockHashZ* owner_conv = (LDKC2Tuple_TxidBlockHashZ*)untag_ptr(owner); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_TxidBlockHashZ_get_a(owner_conv).data); + return ret_arr; +} + +static inline struct LDKThirtyTwoBytes C2Tuple_TxidBlockHashZ_get_b(LDKC2Tuple_TxidBlockHashZ *NONNULL_PTR owner){ + return ThirtyTwoBytes_clone(&owner->b); +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidBlockHashZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_TxidBlockHashZ* owner_conv = (LDKC2Tuple_TxidBlockHashZ*)untag_ptr(owner); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_TxidBlockHashZ_get_b(owner_conv).data); + return ret_arr; +} + +static inline LDKCVec_C2Tuple_TxidBlockHashZZ CVec_C2Tuple_TxidBlockHashZZ_clone(const LDKCVec_C2Tuple_TxidBlockHashZZ *orig) { + LDKCVec_C2Tuple_TxidBlockHashZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_TxidBlockHashZ) * orig->datalen, "LDKCVec_C2Tuple_TxidBlockHashZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]); + ret.data[i] = C2Tuple_TxidBlockHashZ_clone(&orig->data[i]); } return ret; } @@ -4281,6 +4354,58 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeature return ret_ref; } +static inline struct LDKOfferFeatures CResult_OfferFeaturesDecodeErrorZ_get_ok(LDKCResult_OfferFeaturesDecodeErrorZ *NONNULL_PTR owner){ + LDKOfferFeatures ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OfferFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_OfferFeaturesDecodeErrorZ* owner_conv = (LDKCResult_OfferFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKOfferFeatures ret_var = CResult_OfferFeaturesDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_OfferFeaturesDecodeErrorZ_get_err(LDKCResult_OfferFeaturesDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OfferFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_OfferFeaturesDecodeErrorZ* owner_conv = (LDKCResult_OfferFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_OfferFeaturesDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKInvoiceRequestFeatures CResult_InvoiceRequestFeaturesDecodeErrorZ_get_ok(LDKCResult_InvoiceRequestFeaturesDecodeErrorZ *NONNULL_PTR owner){ + LDKInvoiceRequestFeatures ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_InvoiceRequestFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InvoiceRequestFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKInvoiceRequestFeatures ret_var = CResult_InvoiceRequestFeaturesDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_InvoiceRequestFeaturesDecodeErrorZ_get_err(LDKCResult_InvoiceRequestFeaturesDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_InvoiceRequestFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InvoiceRequestFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_InvoiceRequestFeaturesDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline struct LDKNodeId CResult_NodeIdDecodeErrorZ_get_ok(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){ LDKNodeId ret = *owner->contents.result; ret.is_owned = false; @@ -5175,7 +5300,7 @@ typedef struct LDKBaseSign_JCalls { jmethodID sign_closing_transaction_meth; jmethodID sign_holder_anchor_input_meth; jmethodID sign_channel_announcement_meth; - jmethodID ready_channel_meth; + jmethodID provide_channel_parameters_meth; } LDKBaseSign_JCalls; static void LDKBaseSign_JCalls_free(void* this_arg) { LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg; @@ -5607,7 +5732,7 @@ LDKCResult_C2Tuple_SignatureSignatureZNoneZ sign_channel_announcement_LDKBaseSig } return ret_conv; } -void ready_channel_LDKBaseSign_jcall(void* this_arg, const LDKChannelTransactionParameters * channel_parameters) { +void provide_channel_parameters_LDKBaseSign_jcall(void* this_arg, const LDKChannelTransactionParameters * channel_parameters) { 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); @@ -5623,10 +5748,10 @@ void ready_channel_LDKBaseSign_jcall(void* this_arg, const LDKChannelTransaction channel_parameters_ref = tag_ptr(channel_parameters_var.inner, channel_parameters_var.is_owned); jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - (*env)->CallVoidMethod(env, obj, j_calls->ready_channel_meth, channel_parameters_ref); + (*env)->CallVoidMethod(env, obj, j_calls->provide_channel_parameters_meth, channel_parameters_ref); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to ready_channel in LDKBaseSign from rust threw an exception."); + (*env)->FatalError(env, "A call to provide_channel_parameters in LDKBaseSign from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -5665,8 +5790,8 @@ static inline LDKBaseSign LDKBaseSign_init (JNIEnv *env, jclass clz, jobject o, CHECK(calls->sign_holder_anchor_input_meth != NULL); calls->sign_channel_announcement_meth = (*env)->GetMethodID(env, c, "sign_channel_announcement", "(J)J"); CHECK(calls->sign_channel_announcement_meth != NULL); - calls->ready_channel_meth = (*env)->GetMethodID(env, c, "ready_channel", "(J)V"); - CHECK(calls->ready_channel_meth != NULL); + calls->provide_channel_parameters_meth = (*env)->GetMethodID(env, c, "provide_channel_parameters", "(J)V"); + CHECK(calls->provide_channel_parameters_meth != NULL); LDKChannelPublicKeys pubkeys_conv; pubkeys_conv.inner = untag_ptr(pubkeys); @@ -5688,7 +5813,7 @@ static inline LDKBaseSign LDKBaseSign_init (JNIEnv *env, jclass clz, jobject o, .sign_closing_transaction = sign_closing_transaction_LDKBaseSign_jcall, .sign_holder_anchor_input = sign_holder_anchor_input_LDKBaseSign_jcall, .sign_channel_announcement = sign_channel_announcement_LDKBaseSign_jcall, - .ready_channel = ready_channel_LDKBaseSign_jcall, + .provide_channel_parameters = provide_channel_parameters_LDKBaseSign_jcall, .free = LDKBaseSign_JCalls_free, .pubkeys = pubkeys_conv, .set_pubkeys = NULL, @@ -5913,7 +6038,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1channel_1an return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BaseSign_1ready_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_parameters) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BaseSign_1provide_1channel_1parameters(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_parameters) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr; @@ -5922,7 +6047,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BaseSign_1ready_1channel(JNIEn channel_parameters_conv.is_owned = ptr_is_owned(channel_parameters); CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv); channel_parameters_conv.is_owned = false; - (this_arg_conv->ready_channel)(this_arg_conv->this_arg, &channel_parameters_conv); + (this_arg_conv->provide_channel_parameters)(this_arg_conv->this_arg, &channel_parameters_conv); } LDKChannelPublicKeys LDKBaseSign_set_get_pubkeys(LDKBaseSign* this_arg) { @@ -6269,8 +6394,8 @@ static jclass LDKAPIError_APIMisuseError_class = NULL; static jmethodID LDKAPIError_APIMisuseError_meth = NULL; static jclass LDKAPIError_FeeRateTooHigh_class = NULL; static jmethodID LDKAPIError_FeeRateTooHigh_meth = NULL; -static jclass LDKAPIError_RouteError_class = NULL; -static jmethodID LDKAPIError_RouteError_meth = NULL; +static jclass LDKAPIError_InvalidRoute_class = NULL; +static jmethodID LDKAPIError_InvalidRoute_meth = NULL; static jclass LDKAPIError_ChannelUnavailable_class = NULL; static jmethodID LDKAPIError_ChannelUnavailable_meth = NULL; static jclass LDKAPIError_MonitorUpdateInProgress_class = NULL; @@ -6288,11 +6413,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAPIError_init (JNIEnv CHECK(LDKAPIError_FeeRateTooHigh_class != NULL); LDKAPIError_FeeRateTooHigh_meth = (*env)->GetMethodID(env, LDKAPIError_FeeRateTooHigh_class, "", "(Ljava/lang/String;I)V"); CHECK(LDKAPIError_FeeRateTooHigh_meth != NULL); - LDKAPIError_RouteError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$RouteError")); - CHECK(LDKAPIError_RouteError_class != NULL); - LDKAPIError_RouteError_meth = (*env)->GetMethodID(env, LDKAPIError_RouteError_class, "", "(Ljava/lang/String;)V"); - CHECK(LDKAPIError_RouteError_meth != NULL); + LDKAPIError_InvalidRoute_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$InvalidRoute")); + CHECK(LDKAPIError_InvalidRoute_class != NULL); + LDKAPIError_InvalidRoute_meth = (*env)->GetMethodID(env, LDKAPIError_InvalidRoute_class, "", "(Ljava/lang/String;)V"); + CHECK(LDKAPIError_InvalidRoute_meth != NULL); LDKAPIError_ChannelUnavailable_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$ChannelUnavailable")); CHECK(LDKAPIError_ChannelUnavailable_class != NULL); @@ -6323,10 +6448,10 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAPIError_1ref_1from_1ptr int32_t feerate_conv = obj->fee_rate_too_high.feerate; return (*env)->NewObject(env, LDKAPIError_FeeRateTooHigh_class, LDKAPIError_FeeRateTooHigh_meth, err_conv, feerate_conv); } - case LDKAPIError_RouteError: { - LDKStr err_str = obj->route_error.err; + case LDKAPIError_InvalidRoute: { + LDKStr err_str = obj->invalid_route.err; jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len); - return (*env)->NewObject(env, LDKAPIError_RouteError_class, LDKAPIError_RouteError_meth, err_conv); + return (*env)->NewObject(env, LDKAPIError_InvalidRoute_class, LDKAPIError_InvalidRoute_meth, err_conv); } case LDKAPIError_ChannelUnavailable: { LDKStr err_str = obj->channel_unavailable.err; @@ -6408,8 +6533,10 @@ static jclass LDKPaymentSendFailure_ParameterError_class = NULL; static jmethodID LDKPaymentSendFailure_ParameterError_meth = NULL; static jclass LDKPaymentSendFailure_PathParameterError_class = NULL; static jmethodID LDKPaymentSendFailure_PathParameterError_meth = NULL; -static jclass LDKPaymentSendFailure_AllFailedRetrySafe_class = NULL; -static jmethodID LDKPaymentSendFailure_AllFailedRetrySafe_meth = NULL; +static jclass LDKPaymentSendFailure_AllFailedResendSafe_class = NULL; +static jmethodID LDKPaymentSendFailure_AllFailedResendSafe_meth = NULL; +static jclass LDKPaymentSendFailure_DuplicatePayment_class = NULL; +static jmethodID LDKPaymentSendFailure_DuplicatePayment_meth = NULL; static jclass LDKPaymentSendFailure_PartialFailure_class = NULL; static jmethodID LDKPaymentSendFailure_PartialFailure_meth = NULL; JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentSendFailure_init (JNIEnv *env, jclass clz) { @@ -6423,11 +6550,16 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentSendFailure_ini CHECK(LDKPaymentSendFailure_PathParameterError_class != NULL); LDKPaymentSendFailure_PathParameterError_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_PathParameterError_class, "", "([J)V"); CHECK(LDKPaymentSendFailure_PathParameterError_meth != NULL); - LDKPaymentSendFailure_AllFailedRetrySafe_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$AllFailedRetrySafe")); - CHECK(LDKPaymentSendFailure_AllFailedRetrySafe_class != NULL); - LDKPaymentSendFailure_AllFailedRetrySafe_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_AllFailedRetrySafe_class, "", "([J)V"); - CHECK(LDKPaymentSendFailure_AllFailedRetrySafe_meth != NULL); + LDKPaymentSendFailure_AllFailedResendSafe_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$AllFailedResendSafe")); + CHECK(LDKPaymentSendFailure_AllFailedResendSafe_class != NULL); + LDKPaymentSendFailure_AllFailedResendSafe_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_AllFailedResendSafe_class, "", "([J)V"); + CHECK(LDKPaymentSendFailure_AllFailedResendSafe_meth != NULL); + LDKPaymentSendFailure_DuplicatePayment_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$DuplicatePayment")); + CHECK(LDKPaymentSendFailure_DuplicatePayment_class != NULL); + LDKPaymentSendFailure_DuplicatePayment_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_DuplicatePayment_class, "", "()V"); + CHECK(LDKPaymentSendFailure_DuplicatePayment_meth != NULL); LDKPaymentSendFailure_PartialFailure_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$PartialFailure")); CHECK(LDKPaymentSendFailure_PartialFailure_class != NULL); @@ -6455,17 +6587,20 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentSendFailure_1ref_ (*env)->ReleasePrimitiveArrayCritical(env, path_parameter_error_arr, path_parameter_error_arr_ptr, 0); return (*env)->NewObject(env, LDKPaymentSendFailure_PathParameterError_class, LDKPaymentSendFailure_PathParameterError_meth, path_parameter_error_arr); } - case LDKPaymentSendFailure_AllFailedRetrySafe: { - LDKCVec_APIErrorZ all_failed_retry_safe_var = obj->all_failed_retry_safe; - int64_tArray all_failed_retry_safe_arr = NULL; - all_failed_retry_safe_arr = (*env)->NewLongArray(env, all_failed_retry_safe_var.datalen); - int64_t *all_failed_retry_safe_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, all_failed_retry_safe_arr, NULL); - for (size_t k = 0; k < all_failed_retry_safe_var.datalen; k++) { - int64_t all_failed_retry_safe_conv_10_ref = tag_ptr(&all_failed_retry_safe_var.data[k], false); - all_failed_retry_safe_arr_ptr[k] = all_failed_retry_safe_conv_10_ref; + case LDKPaymentSendFailure_AllFailedResendSafe: { + LDKCVec_APIErrorZ all_failed_resend_safe_var = obj->all_failed_resend_safe; + int64_tArray all_failed_resend_safe_arr = NULL; + all_failed_resend_safe_arr = (*env)->NewLongArray(env, all_failed_resend_safe_var.datalen); + int64_t *all_failed_resend_safe_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, all_failed_resend_safe_arr, NULL); + for (size_t k = 0; k < all_failed_resend_safe_var.datalen; k++) { + int64_t all_failed_resend_safe_conv_10_ref = tag_ptr(&all_failed_resend_safe_var.data[k], false); + all_failed_resend_safe_arr_ptr[k] = all_failed_resend_safe_conv_10_ref; } - (*env)->ReleasePrimitiveArrayCritical(env, all_failed_retry_safe_arr, all_failed_retry_safe_arr_ptr, 0); - return (*env)->NewObject(env, LDKPaymentSendFailure_AllFailedRetrySafe_class, LDKPaymentSendFailure_AllFailedRetrySafe_meth, all_failed_retry_safe_arr); + (*env)->ReleasePrimitiveArrayCritical(env, all_failed_resend_safe_arr, all_failed_resend_safe_arr_ptr, 0); + return (*env)->NewObject(env, LDKPaymentSendFailure_AllFailedResendSafe_class, LDKPaymentSendFailure_AllFailedResendSafe_meth, all_failed_resend_safe_arr); + } + case LDKPaymentSendFailure_DuplicatePayment: { + return (*env)->NewObject(env, LDKPaymentSendFailure_DuplicatePayment_class, LDKPaymentSendFailure_DuplicatePayment_meth); } case LDKPaymentSendFailure_PartialFailure: { LDKCVec_CResult_NoneAPIErrorZZ results_var = obj->partial_failure.results; @@ -6490,46 +6625,46 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentSendFailure_1ref_ default: abort(); } } -static inline struct LDKThirtyTwoBytes CResult_PaymentIdPaymentSendFailureZ_get_ok(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR owner){ +static inline void CResult_NonePaymentSendFailureZ_get_ok(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return ThirtyTwoBytes_clone(&*owner->contents.result); + return *owner->contents.result; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_PaymentIdPaymentSendFailureZ* owner_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(owner); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_PaymentIdPaymentSendFailureZ_get_ok(owner_conv).data); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(owner); + CResult_NonePaymentSendFailureZ_get_ok(owner_conv); } -static inline struct LDKPaymentSendFailure CResult_PaymentIdPaymentSendFailureZ_get_err(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR owner){ +static inline struct LDKPaymentSendFailure CResult_NonePaymentSendFailureZ_get_err(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return PaymentSendFailure_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_PaymentIdPaymentSendFailureZ* owner_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(owner); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(owner); LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = CResult_PaymentIdPaymentSendFailureZ_get_err(owner_conv); + *ret_copy = CResult_NonePaymentSendFailureZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline void CResult_NonePaymentSendFailureZ_get_ok(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner){ +static inline struct LDKThirtyTwoBytes CResult_PaymentHashPaymentSendFailureZ_get_ok(LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return *owner->contents.result; + return ThirtyTwoBytes_clone(&*owner->contents.result); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(owner); - CResult_NonePaymentSendFailureZ_get_ok(owner_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_PaymentHashPaymentSendFailureZ* owner_conv = (LDKCResult_PaymentHashPaymentSendFailureZ*)untag_ptr(owner); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_PaymentHashPaymentSendFailureZ_get_ok(owner_conv).data); + return ret_arr; } -static inline struct LDKPaymentSendFailure CResult_NonePaymentSendFailureZ_get_err(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner){ +static inline struct LDKPaymentSendFailure CResult_PaymentHashPaymentSendFailureZ_get_err(LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return PaymentSendFailure_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(owner); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_PaymentHashPaymentSendFailureZ* owner_conv = (LDKCResult_PaymentHashPaymentSendFailureZ*)untag_ptr(owner); LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = CResult_NonePaymentSendFailureZ_get_err(owner_conv); + *ret_copy = CResult_PaymentHashPaymentSendFailureZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -7126,7 +7261,8 @@ typedef struct LDKKeysInterface_JCalls { jmethodID ecdh_meth; jmethodID get_destination_script_meth; jmethodID get_shutdown_scriptpubkey_meth; - jmethodID get_channel_signer_meth; + jmethodID generate_channel_keys_id_meth; + jmethodID derive_channel_signer_meth; jmethodID get_secure_random_bytes_meth; jmethodID read_chan_signer_meth; jmethodID sign_invoice_meth; @@ -7282,7 +7418,7 @@ LDKShutdownScript get_shutdown_scriptpubkey_LDKKeysInterface_jcall(const void* t } return ret_conv; } -LDKSign get_channel_signer_LDKKeysInterface_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) { +LDKThirtyTwoBytes generate_channel_keys_id_LDKKeysInterface_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis, LDKU128 user_channel_id) { LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -7293,12 +7429,41 @@ LDKSign get_channel_signer_LDKKeysInterface_jcall(const void* this_arg, bool inb } jboolean inbound_conv = inbound; int64_t channel_value_satoshis_conv = channel_value_satoshis; + int8_tArray user_channel_id_arr = (*env)->NewByteArray(env, 16); + (*env)->SetByteArrayRegion(env, user_channel_id_arr, 0, 16, user_channel_id.le_bytes); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->generate_channel_keys_id_meth, inbound_conv, channel_value_satoshis_conv, user_channel_id_arr); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to generate_channel_keys_id in LDKKeysInterface 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; +} +LDKSign derive_channel_signer_LDKKeysInterface_jcall(const void* this_arg, uint64_t channel_value_satoshis, LDKThirtyTwoBytes channel_keys_id) { + LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_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 channel_value_satoshis_conv = channel_value_satoshis; + int8_tArray channel_keys_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, channel_keys_id_arr, 0, 32, channel_keys_id.data); jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_channel_signer_meth, inbound_conv, channel_value_satoshis_conv); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->derive_channel_signer_meth, channel_value_satoshis_conv, channel_keys_id_arr); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to get_channel_signer in LDKKeysInterface from rust threw an exception."); + (*env)->FatalError(env, "A call to derive_channel_signer in LDKKeysInterface from rust threw an exception."); } void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); @@ -7361,7 +7526,7 @@ LDKCResult_SignDecodeErrorZ read_chan_signer_LDKKeysInterface_jcall(const void* } return ret_conv; } -LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKKeysInterface_jcall(const void* this_arg, LDKu8slice hrp_bytes, LDKCVec_u5Z invoice_data, LDKRecipient receipient) { +LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKKeysInterface_jcall(const void* this_arg, LDKu8slice hrp_bytes, LDKCVec_U5Z invoice_data, LDKRecipient receipient) { LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -7373,7 +7538,7 @@ LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKKeysInterface_jcall(const v LDKu8slice hrp_bytes_var = hrp_bytes; int8_tArray hrp_bytes_arr = (*env)->NewByteArray(env, hrp_bytes_var.datalen); (*env)->SetByteArrayRegion(env, hrp_bytes_arr, 0, hrp_bytes_var.datalen, hrp_bytes_var.data); - LDKCVec_u5Z invoice_data_var = invoice_data; + LDKCVec_U5Z invoice_data_var = invoice_data; jobjectArray invoice_data_arr = NULL; invoice_data_arr = (*env)->NewByteArray(env, invoice_data_var.datalen); int8_t *invoice_data_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, invoice_data_arr, NULL); @@ -7445,8 +7610,10 @@ static inline LDKKeysInterface LDKKeysInterface_init (JNIEnv *env, jclass clz, j CHECK(calls->get_destination_script_meth != NULL); calls->get_shutdown_scriptpubkey_meth = (*env)->GetMethodID(env, c, "get_shutdown_scriptpubkey", "()J"); CHECK(calls->get_shutdown_scriptpubkey_meth != NULL); - calls->get_channel_signer_meth = (*env)->GetMethodID(env, c, "get_channel_signer", "(ZJ)J"); - CHECK(calls->get_channel_signer_meth != NULL); + calls->generate_channel_keys_id_meth = (*env)->GetMethodID(env, c, "generate_channel_keys_id", "(ZJ[B)[B"); + CHECK(calls->generate_channel_keys_id_meth != NULL); + calls->derive_channel_signer_meth = (*env)->GetMethodID(env, c, "derive_channel_signer", "(J[B)J"); + CHECK(calls->derive_channel_signer_meth != NULL); calls->get_secure_random_bytes_meth = (*env)->GetMethodID(env, c, "get_secure_random_bytes", "()[B"); CHECK(calls->get_secure_random_bytes_meth != NULL); calls->read_chan_signer_meth = (*env)->GetMethodID(env, c, "read_chan_signer", "([B)J"); @@ -7463,7 +7630,8 @@ static inline LDKKeysInterface LDKKeysInterface_init (JNIEnv *env, jclass clz, j .ecdh = ecdh_LDKKeysInterface_jcall, .get_destination_script = get_destination_script_LDKKeysInterface_jcall, .get_shutdown_scriptpubkey = get_shutdown_scriptpubkey_LDKKeysInterface_jcall, - .get_channel_signer = get_channel_signer_LDKKeysInterface_jcall, + .generate_channel_keys_id = generate_channel_keys_id_LDKKeysInterface_jcall, + .derive_channel_signer = derive_channel_signer_LDKKeysInterface_jcall, .get_secure_random_bytes = get_secure_random_bytes_LDKKeysInterface_jcall, .read_chan_signer = read_chan_signer_LDKKeysInterface_jcall, .sign_invoice = sign_invoice_LDKKeysInterface_jcall, @@ -7536,12 +7704,27 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1shutdow return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1channel_1signer(JNIEnv *env, jclass clz, int64_t this_arg, jboolean inbound, int64_t channel_value_satoshis) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1generate_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_arg, jboolean inbound, int64_t channel_value_satoshis, int8_tArray user_channel_id) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr; + LDKU128 user_channel_id_ref; + CHECK((*env)->GetArrayLength(env, user_channel_id) == 16); + (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->generate_channel_keys_id)(this_arg_conv->this_arg, inbound, channel_value_satoshis, user_channel_id_ref).data); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1derive_1channel_1signer(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_value_satoshis, int8_tArray channel_keys_id) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr; + 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); LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign"); - *ret_ret = (this_arg_conv->get_channel_signer)(this_arg_conv->this_arg, inbound, channel_value_satoshis); + *ret_ret = (this_arg_conv->derive_channel_signer)(this_arg_conv->this_arg, channel_value_satoshis, channel_keys_id_ref); return tag_ptr(ret_ret, true); } @@ -7574,17 +7757,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1sign_1invoic LDKu8slice hrp_bytes_ref; hrp_bytes_ref.datalen = (*env)->GetArrayLength(env, hrp_bytes); hrp_bytes_ref.data = (*env)->GetByteArrayElements (env, hrp_bytes, NULL); - LDKCVec_u5Z invoice_data_constr; + LDKCVec_U5Z invoice_data_constr; invoice_data_constr.datalen = (*env)->GetArrayLength(env, invoice_data); if (invoice_data_constr.datalen > 0) - invoice_data_constr.data = MALLOC(invoice_data_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements"); + invoice_data_constr.data = MALLOC(invoice_data_constr.datalen * sizeof(LDKU5), "LDKCVec_U5Z Elements"); else invoice_data_constr.data = NULL; int8_t* invoice_data_vals = (*env)->GetByteArrayElements (env, invoice_data, NULL); for (size_t h = 0; h < invoice_data_constr.datalen; h++) { int8_t invoice_data_conv_7 = invoice_data_vals[h]; - invoice_data_constr.data[h] = (LDKu5){ ._0 = invoice_data_conv_7 }; + invoice_data_constr.data[h] = (LDKU5){ ._0 = invoice_data_conv_7 }; } (*env)->ReleaseByteArrayElements(env, invoice_data, invoice_data_vals, 0); LDKRecipient receipient_conv = LDKRecipient_from_java(env, receipient); @@ -8058,739 +8241,273 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentEr return ret_ref; } -static inline struct LDKInFlightHtlcs CResult_InFlightHtlcsDecodeErrorZ_get_ok(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner){ - LDKInFlightHtlcs ret = *owner->contents.result; - ret.is_owned = false; - return ret; +static inline void CResult_NonePaymentErrorZ_get_ok(LDKCResult_NonePaymentErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_InFlightHtlcsDecodeErrorZ* owner_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(owner); - LDKInFlightHtlcs ret_var = CResult_InFlightHtlcsDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NonePaymentErrorZ* owner_conv = (LDKCResult_NonePaymentErrorZ*)untag_ptr(owner); + CResult_NonePaymentErrorZ_get_ok(owner_conv); } -static inline struct LDKDecodeError CResult_InFlightHtlcsDecodeErrorZ_get_err(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKPaymentError CResult_NonePaymentErrorZ_get_err(LDKCResult_NonePaymentErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); + return PaymentError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_InFlightHtlcsDecodeErrorZ* owner_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_InFlightHtlcsDecodeErrorZ_get_err(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NonePaymentErrorZ* owner_conv = (LDKCResult_NonePaymentErrorZ*)untag_ptr(owner); + LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError"); + *ret_copy = CResult_NonePaymentErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static jclass LDKParseError_Bech32Error_class = NULL; -static jmethodID LDKParseError_Bech32Error_meth = NULL; -static jclass LDKParseError_ParseAmountError_class = NULL; -static jmethodID LDKParseError_ParseAmountError_meth = NULL; -static jclass LDKParseError_MalformedSignature_class = NULL; -static jmethodID LDKParseError_MalformedSignature_meth = NULL; -static jclass LDKParseError_BadPrefix_class = NULL; -static jmethodID LDKParseError_BadPrefix_meth = NULL; -static jclass LDKParseError_UnknownCurrency_class = NULL; -static jmethodID LDKParseError_UnknownCurrency_meth = NULL; -static jclass LDKParseError_UnknownSiPrefix_class = NULL; -static jmethodID LDKParseError_UnknownSiPrefix_meth = NULL; -static jclass LDKParseError_MalformedHRP_class = NULL; -static jmethodID LDKParseError_MalformedHRP_meth = NULL; -static jclass LDKParseError_TooShortDataPart_class = NULL; -static jmethodID LDKParseError_TooShortDataPart_meth = NULL; -static jclass LDKParseError_UnexpectedEndOfTaggedFields_class = NULL; -static jmethodID LDKParseError_UnexpectedEndOfTaggedFields_meth = NULL; -static jclass LDKParseError_DescriptionDecodeError_class = NULL; -static jmethodID LDKParseError_DescriptionDecodeError_meth = NULL; -static jclass LDKParseError_PaddingError_class = NULL; -static jmethodID LDKParseError_PaddingError_meth = NULL; -static jclass LDKParseError_IntegerOverflowError_class = NULL; -static jmethodID LDKParseError_IntegerOverflowError_meth = NULL; -static jclass LDKParseError_InvalidSegWitProgramLength_class = NULL; -static jmethodID LDKParseError_InvalidSegWitProgramLength_meth = NULL; -static jclass LDKParseError_InvalidPubKeyHashLength_class = NULL; -static jmethodID LDKParseError_InvalidPubKeyHashLength_meth = NULL; -static jclass LDKParseError_InvalidScriptHashLength_class = NULL; -static jmethodID LDKParseError_InvalidScriptHashLength_meth = NULL; -static jclass LDKParseError_InvalidRecoveryId_class = NULL; -static jmethodID LDKParseError_InvalidRecoveryId_meth = NULL; -static jclass LDKParseError_InvalidSliceLength_class = NULL; -static jmethodID LDKParseError_InvalidSliceLength_meth = NULL; -static jclass LDKParseError_Skip_class = NULL; -static jmethodID LDKParseError_Skip_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKParseError_init (JNIEnv *env, jclass clz) { - LDKParseError_Bech32Error_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$Bech32Error")); - CHECK(LDKParseError_Bech32Error_class != NULL); - LDKParseError_Bech32Error_meth = (*env)->GetMethodID(env, LDKParseError_Bech32Error_class, "", "(J)V"); - CHECK(LDKParseError_Bech32Error_meth != NULL); - LDKParseError_ParseAmountError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$ParseAmountError")); - CHECK(LDKParseError_ParseAmountError_class != NULL); - LDKParseError_ParseAmountError_meth = (*env)->GetMethodID(env, LDKParseError_ParseAmountError_class, "", "(I)V"); - CHECK(LDKParseError_ParseAmountError_meth != NULL); - LDKParseError_MalformedSignature_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$MalformedSignature")); - CHECK(LDKParseError_MalformedSignature_class != NULL); - LDKParseError_MalformedSignature_meth = (*env)->GetMethodID(env, LDKParseError_MalformedSignature_class, "", "(Lorg/ldk/enums/Secp256k1Error;)V"); - CHECK(LDKParseError_MalformedSignature_meth != NULL); - LDKParseError_BadPrefix_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$BadPrefix")); - CHECK(LDKParseError_BadPrefix_class != NULL); - LDKParseError_BadPrefix_meth = (*env)->GetMethodID(env, LDKParseError_BadPrefix_class, "", "()V"); - CHECK(LDKParseError_BadPrefix_meth != NULL); - LDKParseError_UnknownCurrency_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$UnknownCurrency")); - CHECK(LDKParseError_UnknownCurrency_class != NULL); - LDKParseError_UnknownCurrency_meth = (*env)->GetMethodID(env, LDKParseError_UnknownCurrency_class, "", "()V"); - CHECK(LDKParseError_UnknownCurrency_meth != NULL); - LDKParseError_UnknownSiPrefix_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$UnknownSiPrefix")); - CHECK(LDKParseError_UnknownSiPrefix_class != NULL); - LDKParseError_UnknownSiPrefix_meth = (*env)->GetMethodID(env, LDKParseError_UnknownSiPrefix_class, "", "()V"); - CHECK(LDKParseError_UnknownSiPrefix_meth != NULL); - LDKParseError_MalformedHRP_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$MalformedHRP")); - CHECK(LDKParseError_MalformedHRP_class != NULL); - LDKParseError_MalformedHRP_meth = (*env)->GetMethodID(env, LDKParseError_MalformedHRP_class, "", "()V"); - CHECK(LDKParseError_MalformedHRP_meth != NULL); - LDKParseError_TooShortDataPart_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$TooShortDataPart")); - CHECK(LDKParseError_TooShortDataPart_class != NULL); - LDKParseError_TooShortDataPart_meth = (*env)->GetMethodID(env, LDKParseError_TooShortDataPart_class, "", "()V"); - CHECK(LDKParseError_TooShortDataPart_meth != NULL); - LDKParseError_UnexpectedEndOfTaggedFields_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$UnexpectedEndOfTaggedFields")); - CHECK(LDKParseError_UnexpectedEndOfTaggedFields_class != NULL); - LDKParseError_UnexpectedEndOfTaggedFields_meth = (*env)->GetMethodID(env, LDKParseError_UnexpectedEndOfTaggedFields_class, "", "()V"); - CHECK(LDKParseError_UnexpectedEndOfTaggedFields_meth != NULL); - LDKParseError_DescriptionDecodeError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$DescriptionDecodeError")); - CHECK(LDKParseError_DescriptionDecodeError_class != NULL); - LDKParseError_DescriptionDecodeError_meth = (*env)->GetMethodID(env, LDKParseError_DescriptionDecodeError_class, "", "(I)V"); - CHECK(LDKParseError_DescriptionDecodeError_meth != NULL); - LDKParseError_PaddingError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$PaddingError")); - CHECK(LDKParseError_PaddingError_class != NULL); - LDKParseError_PaddingError_meth = (*env)->GetMethodID(env, LDKParseError_PaddingError_class, "", "()V"); - CHECK(LDKParseError_PaddingError_meth != NULL); - LDKParseError_IntegerOverflowError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$IntegerOverflowError")); - CHECK(LDKParseError_IntegerOverflowError_class != NULL); - LDKParseError_IntegerOverflowError_meth = (*env)->GetMethodID(env, LDKParseError_IntegerOverflowError_class, "", "()V"); - CHECK(LDKParseError_IntegerOverflowError_meth != NULL); - LDKParseError_InvalidSegWitProgramLength_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidSegWitProgramLength")); - CHECK(LDKParseError_InvalidSegWitProgramLength_class != NULL); - LDKParseError_InvalidSegWitProgramLength_meth = (*env)->GetMethodID(env, LDKParseError_InvalidSegWitProgramLength_class, "", "()V"); - CHECK(LDKParseError_InvalidSegWitProgramLength_meth != NULL); - LDKParseError_InvalidPubKeyHashLength_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidPubKeyHashLength")); - CHECK(LDKParseError_InvalidPubKeyHashLength_class != NULL); - LDKParseError_InvalidPubKeyHashLength_meth = (*env)->GetMethodID(env, LDKParseError_InvalidPubKeyHashLength_class, "", "()V"); - CHECK(LDKParseError_InvalidPubKeyHashLength_meth != NULL); - LDKParseError_InvalidScriptHashLength_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidScriptHashLength")); - CHECK(LDKParseError_InvalidScriptHashLength_class != NULL); - LDKParseError_InvalidScriptHashLength_meth = (*env)->GetMethodID(env, LDKParseError_InvalidScriptHashLength_class, "", "()V"); - CHECK(LDKParseError_InvalidScriptHashLength_meth != NULL); - LDKParseError_InvalidRecoveryId_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidRecoveryId")); - CHECK(LDKParseError_InvalidRecoveryId_class != NULL); - LDKParseError_InvalidRecoveryId_meth = (*env)->GetMethodID(env, LDKParseError_InvalidRecoveryId_class, "", "()V"); - CHECK(LDKParseError_InvalidRecoveryId_meth != NULL); - LDKParseError_InvalidSliceLength_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidSliceLength")); - CHECK(LDKParseError_InvalidSliceLength_class != NULL); - LDKParseError_InvalidSliceLength_meth = (*env)->GetMethodID(env, LDKParseError_InvalidSliceLength_class, "", "(Ljava/lang/String;)V"); - CHECK(LDKParseError_InvalidSliceLength_meth != NULL); - LDKParseError_Skip_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$Skip")); - CHECK(LDKParseError_Skip_class != NULL); - LDKParseError_Skip_meth = (*env)->GetMethodID(env, LDKParseError_Skip_class, "", "()V"); - CHECK(LDKParseError_Skip_meth != NULL); +static inline struct LDKStr CResult_StringErrorZ_get_ok(LDKCResult_StringErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKParseError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKParseError *obj = (LDKParseError*)untag_ptr(ptr); - switch(obj->tag) { - case LDKParseError_Bech32Error: { - int64_t bech32_error_ref = tag_ptr(&obj->bech32_error, false); - return (*env)->NewObject(env, LDKParseError_Bech32Error_class, LDKParseError_Bech32Error_meth, bech32_error_ref); - } - case LDKParseError_ParseAmountError: { - /*obj->parse_amount_error*/ - return (*env)->NewObject(env, LDKParseError_ParseAmountError_class, LDKParseError_ParseAmountError_meth, 0); - } - case LDKParseError_MalformedSignature: { - jclass malformed_signature_conv = LDKSecp256k1Error_to_java(env, obj->malformed_signature); - return (*env)->NewObject(env, LDKParseError_MalformedSignature_class, LDKParseError_MalformedSignature_meth, malformed_signature_conv); - } - case LDKParseError_BadPrefix: { - return (*env)->NewObject(env, LDKParseError_BadPrefix_class, LDKParseError_BadPrefix_meth); - } - case LDKParseError_UnknownCurrency: { - return (*env)->NewObject(env, LDKParseError_UnknownCurrency_class, LDKParseError_UnknownCurrency_meth); - } - case LDKParseError_UnknownSiPrefix: { - return (*env)->NewObject(env, LDKParseError_UnknownSiPrefix_class, LDKParseError_UnknownSiPrefix_meth); - } - case LDKParseError_MalformedHRP: { - return (*env)->NewObject(env, LDKParseError_MalformedHRP_class, LDKParseError_MalformedHRP_meth); - } - case LDKParseError_TooShortDataPart: { - return (*env)->NewObject(env, LDKParseError_TooShortDataPart_class, LDKParseError_TooShortDataPart_meth); - } - case LDKParseError_UnexpectedEndOfTaggedFields: { - return (*env)->NewObject(env, LDKParseError_UnexpectedEndOfTaggedFields_class, LDKParseError_UnexpectedEndOfTaggedFields_meth); - } - case LDKParseError_DescriptionDecodeError: { - /*obj->description_decode_error*/ - return (*env)->NewObject(env, LDKParseError_DescriptionDecodeError_class, LDKParseError_DescriptionDecodeError_meth, 0); - } - case LDKParseError_PaddingError: { - return (*env)->NewObject(env, LDKParseError_PaddingError_class, LDKParseError_PaddingError_meth); - } - case LDKParseError_IntegerOverflowError: { - return (*env)->NewObject(env, LDKParseError_IntegerOverflowError_class, LDKParseError_IntegerOverflowError_meth); - } - case LDKParseError_InvalidSegWitProgramLength: { - return (*env)->NewObject(env, LDKParseError_InvalidSegWitProgramLength_class, LDKParseError_InvalidSegWitProgramLength_meth); - } - case LDKParseError_InvalidPubKeyHashLength: { - return (*env)->NewObject(env, LDKParseError_InvalidPubKeyHashLength_class, LDKParseError_InvalidPubKeyHashLength_meth); - } - case LDKParseError_InvalidScriptHashLength: { - return (*env)->NewObject(env, LDKParseError_InvalidScriptHashLength_class, LDKParseError_InvalidScriptHashLength_meth); - } - case LDKParseError_InvalidRecoveryId: { - return (*env)->NewObject(env, LDKParseError_InvalidRecoveryId_class, LDKParseError_InvalidRecoveryId_meth); - } - case LDKParseError_InvalidSliceLength: { - LDKStr invalid_slice_length_str = obj->invalid_slice_length; - jstring invalid_slice_length_conv = str_ref_to_java(env, invalid_slice_length_str.chars, invalid_slice_length_str.len); - return (*env)->NewObject(env, LDKParseError_InvalidSliceLength_class, LDKParseError_InvalidSliceLength_meth, invalid_slice_length_conv); - } - case LDKParseError_Skip: { - return (*env)->NewObject(env, LDKParseError_Skip_class, LDKParseError_Skip_meth); - } - default: abort(); - } +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_StringErrorZ* owner_conv = (LDKCResult_StringErrorZ*)untag_ptr(owner); + LDKStr ret_str = CResult_StringErrorZ_get_ok(owner_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + return ret_conv; } -static inline enum LDKSiPrefix CResult_SiPrefixParseErrorZ_get_ok(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner){ + +static inline enum LDKSecp256k1Error CResult_StringErrorZ_get_err(LDKCResult_StringErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_StringErrorZ* owner_conv = (LDKCResult_StringErrorZ*)untag_ptr(owner); + jclass ret_conv = LDKSecp256k1Error_to_java(env, CResult_StringErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline struct LDKPublicKey CResult_PublicKeyErrorZ_get_ok(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return SiPrefix_clone(&*owner->contents.result); + return *owner->contents.result; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_SiPrefixParseErrorZ* owner_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKSiPrefix_to_java(env, CResult_SiPrefixParseErrorZ_get_ok(owner_conv)); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_PublicKeyErrorZ* owner_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(owner); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, CResult_PublicKeyErrorZ_get_ok(owner_conv).compressed_form); + return ret_arr; +} + +static inline enum LDKSecp256k1Error CResult_PublicKeyErrorZ_get_err(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_PublicKeyErrorZ* owner_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(owner); + jclass ret_conv = LDKSecp256k1Error_to_java(env, CResult_PublicKeyErrorZ_get_err(owner_conv)); return ret_conv; } -static inline struct LDKParseError CResult_SiPrefixParseErrorZ_get_err(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner){ +static inline struct LDKChannelMonitorUpdate CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner){ + LDKChannelMonitorUpdate ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(owner); + LDKChannelMonitorUpdate ret_var = CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return ParseError_clone(&*owner->contents.err); + return DecodeError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_SiPrefixParseErrorZ* owner_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(owner); - LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError"); - *ret_copy = CResult_SiPrefixParseErrorZ_get_err(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static jclass LDKParseOrSemanticError_ParseError_class = NULL; -static jmethodID LDKParseOrSemanticError_ParseError_meth = NULL; -static jclass LDKParseOrSemanticError_SemanticError_class = NULL; -static jmethodID LDKParseOrSemanticError_SemanticError_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKParseOrSemanticError_init (JNIEnv *env, jclass clz) { - LDKParseOrSemanticError_ParseError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseOrSemanticError$ParseError")); - CHECK(LDKParseOrSemanticError_ParseError_class != NULL); - LDKParseOrSemanticError_ParseError_meth = (*env)->GetMethodID(env, LDKParseOrSemanticError_ParseError_class, "", "(J)V"); - CHECK(LDKParseOrSemanticError_ParseError_meth != NULL); - LDKParseOrSemanticError_SemanticError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseOrSemanticError$SemanticError")); - CHECK(LDKParseOrSemanticError_SemanticError_class != NULL); - LDKParseOrSemanticError_SemanticError_meth = (*env)->GetMethodID(env, LDKParseOrSemanticError_SemanticError_class, "", "(Lorg/ldk/enums/SemanticError;)V"); - CHECK(LDKParseOrSemanticError_SemanticError_meth != NULL); +static jclass LDKCOption_MonitorEventZ_Some_class = NULL; +static jmethodID LDKCOption_MonitorEventZ_Some_meth = NULL; +static jclass LDKCOption_MonitorEventZ_None_class = NULL; +static jmethodID LDKCOption_MonitorEventZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1MonitorEventZ_init (JNIEnv *env, jclass clz) { + LDKCOption_MonitorEventZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_MonitorEventZ$Some")); + CHECK(LDKCOption_MonitorEventZ_Some_class != NULL); + LDKCOption_MonitorEventZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_MonitorEventZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_MonitorEventZ_Some_meth != NULL); + LDKCOption_MonitorEventZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_MonitorEventZ$None")); + CHECK(LDKCOption_MonitorEventZ_None_class != NULL); + LDKCOption_MonitorEventZ_None_meth = (*env)->GetMethodID(env, LDKCOption_MonitorEventZ_None_class, "", "()V"); + CHECK(LDKCOption_MonitorEventZ_None_meth != NULL); } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKParseOrSemanticError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKParseOrSemanticError *obj = (LDKParseOrSemanticError*)untag_ptr(ptr); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1MonitorEventZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_MonitorEventZ *obj = (LDKCOption_MonitorEventZ*)untag_ptr(ptr); switch(obj->tag) { - case LDKParseOrSemanticError_ParseError: { - int64_t parse_error_ref = tag_ptr(&obj->parse_error, false); - return (*env)->NewObject(env, LDKParseOrSemanticError_ParseError_class, LDKParseOrSemanticError_ParseError_meth, parse_error_ref); + case LDKCOption_MonitorEventZ_Some: { + int64_t some_ref = tag_ptr(&obj->some, false); + return (*env)->NewObject(env, LDKCOption_MonitorEventZ_Some_class, LDKCOption_MonitorEventZ_Some_meth, some_ref); } - case LDKParseOrSemanticError_SemanticError: { - jclass semantic_error_conv = LDKSemanticError_to_java(env, obj->semantic_error); - return (*env)->NewObject(env, LDKParseOrSemanticError_SemanticError_class, LDKParseOrSemanticError_SemanticError_meth, semantic_error_conv); + case LDKCOption_MonitorEventZ_None: { + return (*env)->NewObject(env, LDKCOption_MonitorEventZ_None_class, LDKCOption_MonitorEventZ_None_meth); } default: abort(); } } -static inline struct LDKInvoice CResult_InvoiceParseOrSemanticErrorZ_get_ok(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner){ - LDKInvoice ret = *owner->contents.result; - ret.is_owned = false; - return ret; +static inline struct LDKCOption_MonitorEventZ CResult_COption_MonitorEventZDecodeErrorZ_get_ok(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return COption_MonitorEventZ_clone(&*owner->contents.result); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_InvoiceParseOrSemanticErrorZ* owner_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(owner); - LDKInvoice ret_var = CResult_InvoiceParseOrSemanticErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(owner); + LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); + *ret_copy = CResult_COption_MonitorEventZDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline struct LDKParseOrSemanticError CResult_InvoiceParseOrSemanticErrorZ_get_err(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_COption_MonitorEventZDecodeErrorZ_get_err(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return ParseOrSemanticError_clone(&*owner->contents.err); + return DecodeError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_InvoiceParseOrSemanticErrorZ* owner_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(owner); - LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError"); - *ret_copy = CResult_InvoiceParseOrSemanticErrorZ_get_err(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_COption_MonitorEventZDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline struct LDKSignedRawInvoice CResult_SignedRawInvoiceParseErrorZ_get_ok(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner){ - LDKSignedRawInvoice ret = *owner->contents.result; +static inline struct LDKHTLCUpdate CResult_HTLCUpdateDecodeErrorZ_get_ok(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR owner){ + LDKHTLCUpdate ret = *owner->contents.result; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_SignedRawInvoiceParseErrorZ* owner_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(owner); - LDKSignedRawInvoice ret_var = CResult_SignedRawInvoiceParseErrorZ_get_ok(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(owner); + LDKHTLCUpdate ret_var = CResult_HTLCUpdateDecodeErrorZ_get_ok(owner_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline struct LDKParseError CResult_SignedRawInvoiceParseErrorZ_get_err(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_HTLCUpdateDecodeErrorZ_get_err(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return ParseError_clone(&*owner->contents.err); + return DecodeError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_SignedRawInvoiceParseErrorZ* owner_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(owner); - LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError"); - *ret_copy = CResult_SignedRawInvoiceParseErrorZ_get_err(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_HTLCUpdateDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline struct LDKRawInvoice C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){ - LDKRawInvoice ret = owner->a; +static inline struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR owner){ + LDKOutPoint ret = owner->a; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { - LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner); - LDKRawInvoice ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_OutPointScriptZ* owner_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(owner); + LDKOutPoint ret_var = C2Tuple_OutPointScriptZ_get_a(owner_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline struct LDKThirtyTwoBytes C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){ - return ThirtyTwoBytes_clone(&owner->b); +static inline struct LDKCVec_u8Z C2Tuple_OutPointScriptZ_get_b(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR owner){ + return CVec_u8Z_clone(&owner->b); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { - LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(owner_conv).data); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_OutPointScriptZ* owner_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(owner); + LDKCVec_u8Z ret_var = C2Tuple_OutPointScriptZ_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); + CVec_u8Z_free(ret_var); return ret_arr; } -static inline struct LDKInvoiceSignature C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){ - LDKInvoiceSignature ret = owner->c; - ret.is_owned = false; - return ret; +static inline uint32_t C2Tuple_u32ScriptZ_get_a(LDKC2Tuple_u32ScriptZ *NONNULL_PTR owner){ + return owner->a; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1get_1c(JNIEnv *env, jclass clz, int64_t owner) { - LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner); - LDKInvoiceSignature ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_u32ScriptZ* owner_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(owner); + int32_t ret_conv = C2Tuple_u32ScriptZ_get_a(owner_conv); + return ret_conv; } -static inline struct LDKPayeePubKey CResult_PayeePubKeyErrorZ_get_ok(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner){ - LDKPayeePubKey ret = *owner->contents.result; - ret.is_owned = false; +static inline struct LDKCVec_u8Z C2Tuple_u32ScriptZ_get_b(LDKC2Tuple_u32ScriptZ *NONNULL_PTR owner){ + return CVec_u8Z_clone(&owner->b); +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_u32ScriptZ* owner_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(owner); + LDKCVec_u8Z ret_var = C2Tuple_u32ScriptZ_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); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +static inline LDKCVec_C2Tuple_u32ScriptZZ CVec_C2Tuple_u32ScriptZZ_clone(const LDKCVec_C2Tuple_u32ScriptZZ *orig) { + LDKCVec_C2Tuple_u32ScriptZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ) * orig->datalen, "LDKCVec_C2Tuple_u32ScriptZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = C2Tuple_u32ScriptZ_clone(&orig->data[i]); + } return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_PayeePubKeyErrorZ* owner_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(owner); - LDKPayeePubKey ret_var = CResult_PayeePubKeyErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +static inline struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR owner){ + return ThirtyTwoBytes_clone(&owner->a); +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(owner); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(owner_conv).data); + return ret_arr; } -static inline enum LDKSecp256k1Error CResult_PayeePubKeyErrorZ_get_err(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; +static inline struct LDKCVec_C2Tuple_u32ScriptZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR owner){ + return CVec_C2Tuple_u32ScriptZZ_clone(&owner->b); } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_PayeePubKeyErrorZ* owner_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKSecp256k1Error_to_java(env, CResult_PayeePubKeyErrorZ_get_err(owner_conv)); - return ret_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(owner); + LDKCVec_C2Tuple_u32ScriptZZ ret_var = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_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 v = 0; v < ret_var.datalen; v++) { + LDKC2Tuple_u32ScriptZ* ret_conv_21_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ"); + *ret_conv_21_conv = ret_var.data[v]; + ret_arr_ptr[v] = tag_ptr(ret_conv_21_conv, true); + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -static inline LDKCVec_PrivateRouteZ CVec_PrivateRouteZ_clone(const LDKCVec_PrivateRouteZ *orig) { - LDKCVec_PrivateRouteZ ret = { .data = MALLOC(sizeof(LDKPrivateRoute) * orig->datalen, "LDKCVec_PrivateRouteZ clone bytes"), .datalen = orig->datalen }; +static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_clone(const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ *orig) { + LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ) * orig->datalen, "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = PrivateRoute_clone(&orig->data[i]); + ret.data[i] = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(&orig->data[i]); } return ret; } -static inline struct LDKPositiveTimestamp CResult_PositiveTimestampCreationErrorZ_get_ok(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner){ - LDKPositiveTimestamp ret = *owner->contents.result; - ret.is_owned = false; +static inline LDKCVec_EventZ CVec_EventZ_clone(const LDKCVec_EventZ *orig) { + LDKCVec_EventZ ret = { .data = MALLOC(sizeof(LDKEvent) * orig->datalen, "LDKCVec_EventZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = Event_clone(&orig->data[i]); + } return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_PositiveTimestampCreationErrorZ* owner_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(owner); - LDKPositiveTimestamp ret_var = CResult_PositiveTimestampCreationErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline enum LDKCreationError CResult_PositiveTimestampCreationErrorZ_get_err(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return CreationError_clone(&*owner->contents.err); -} -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_PositiveTimestampCreationErrorZ* owner_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKCreationError_to_java(env, CResult_PositiveTimestampCreationErrorZ_get_err(owner_conv)); - return ret_conv; -} - -static inline void CResult_NoneSemanticErrorZ_get_ok(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NoneSemanticErrorZ* owner_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(owner); - CResult_NoneSemanticErrorZ_get_ok(owner_conv); -} - -static inline enum LDKSemanticError CResult_NoneSemanticErrorZ_get_err(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return SemanticError_clone(&*owner->contents.err); -} -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NoneSemanticErrorZ* owner_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKSemanticError_to_java(env, CResult_NoneSemanticErrorZ_get_err(owner_conv)); - return ret_conv; -} - -static inline struct LDKInvoice CResult_InvoiceSemanticErrorZ_get_ok(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner){ - LDKInvoice ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_InvoiceSemanticErrorZ* owner_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(owner); - LDKInvoice ret_var = CResult_InvoiceSemanticErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline enum LDKSemanticError CResult_InvoiceSemanticErrorZ_get_err(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return SemanticError_clone(&*owner->contents.err); -} -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_InvoiceSemanticErrorZ* owner_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKSemanticError_to_java(env, CResult_InvoiceSemanticErrorZ_get_err(owner_conv)); - return ret_conv; -} - -static inline struct LDKDescription CResult_DescriptionCreationErrorZ_get_ok(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner){ - LDKDescription ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_DescriptionCreationErrorZ* owner_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(owner); - LDKDescription ret_var = CResult_DescriptionCreationErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline enum LDKCreationError CResult_DescriptionCreationErrorZ_get_err(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return CreationError_clone(&*owner->contents.err); -} -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_DescriptionCreationErrorZ* owner_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKCreationError_to_java(env, CResult_DescriptionCreationErrorZ_get_err(owner_conv)); - return ret_conv; -} - -static inline struct LDKPrivateRoute CResult_PrivateRouteCreationErrorZ_get_ok(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner){ - LDKPrivateRoute ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_PrivateRouteCreationErrorZ* owner_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(owner); - LDKPrivateRoute ret_var = CResult_PrivateRouteCreationErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline enum LDKCreationError CResult_PrivateRouteCreationErrorZ_get_err(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return CreationError_clone(&*owner->contents.err); -} -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_PrivateRouteCreationErrorZ* owner_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKCreationError_to_java(env, CResult_PrivateRouteCreationErrorZ_get_err(owner_conv)); - return ret_conv; -} - -static inline struct LDKStr CResult_StringErrorZ_get_ok(LDKCResult_StringErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_StringErrorZ* owner_conv = (LDKCResult_StringErrorZ*)untag_ptr(owner); - LDKStr ret_str = CResult_StringErrorZ_get_ok(owner_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - return ret_conv; -} - -static inline enum LDKSecp256k1Error CResult_StringErrorZ_get_err(LDKCResult_StringErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; -} -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_StringErrorZ* owner_conv = (LDKCResult_StringErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKSecp256k1Error_to_java(env, CResult_StringErrorZ_get_err(owner_conv)); - return ret_conv; -} - -static inline struct LDKChannelMonitorUpdate CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner){ - LDKChannelMonitorUpdate ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(owner); - LDKChannelMonitorUpdate ret_var = CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline struct LDKDecodeError CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static jclass LDKCOption_MonitorEventZ_Some_class = NULL; -static jmethodID LDKCOption_MonitorEventZ_Some_meth = NULL; -static jclass LDKCOption_MonitorEventZ_None_class = NULL; -static jmethodID LDKCOption_MonitorEventZ_None_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1MonitorEventZ_init (JNIEnv *env, jclass clz) { - LDKCOption_MonitorEventZ_Some_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_MonitorEventZ$Some")); - CHECK(LDKCOption_MonitorEventZ_Some_class != NULL); - LDKCOption_MonitorEventZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_MonitorEventZ_Some_class, "", "(J)V"); - CHECK(LDKCOption_MonitorEventZ_Some_meth != NULL); - LDKCOption_MonitorEventZ_None_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_MonitorEventZ$None")); - CHECK(LDKCOption_MonitorEventZ_None_class != NULL); - LDKCOption_MonitorEventZ_None_meth = (*env)->GetMethodID(env, LDKCOption_MonitorEventZ_None_class, "", "()V"); - CHECK(LDKCOption_MonitorEventZ_None_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1MonitorEventZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKCOption_MonitorEventZ *obj = (LDKCOption_MonitorEventZ*)untag_ptr(ptr); - switch(obj->tag) { - case LDKCOption_MonitorEventZ_Some: { - int64_t some_ref = tag_ptr(&obj->some, false); - return (*env)->NewObject(env, LDKCOption_MonitorEventZ_Some_class, LDKCOption_MonitorEventZ_Some_meth, some_ref); - } - case LDKCOption_MonitorEventZ_None: { - return (*env)->NewObject(env, LDKCOption_MonitorEventZ_None_class, LDKCOption_MonitorEventZ_None_meth); - } - default: abort(); - } -} -static inline struct LDKCOption_MonitorEventZ CResult_COption_MonitorEventZDecodeErrorZ_get_ok(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return COption_MonitorEventZ_clone(&*owner->contents.result); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(owner); - LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); - *ret_copy = CResult_COption_MonitorEventZDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline struct LDKDecodeError CResult_COption_MonitorEventZDecodeErrorZ_get_err(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_COption_MonitorEventZDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline struct LDKHTLCUpdate CResult_HTLCUpdateDecodeErrorZ_get_ok(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR owner){ - LDKHTLCUpdate ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(owner); - LDKHTLCUpdate ret_var = CResult_HTLCUpdateDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline struct LDKDecodeError CResult_HTLCUpdateDecodeErrorZ_get_err(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_HTLCUpdateDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR owner){ - LDKOutPoint ret = owner->a; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_OutPointScriptZ* owner_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(owner); - LDKOutPoint ret_var = C2Tuple_OutPointScriptZ_get_a(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline struct LDKCVec_u8Z C2Tuple_OutPointScriptZ_get_b(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR owner){ - return CVec_u8Z_clone(&owner->b); -} -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_OutPointScriptZ* owner_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(owner); - LDKCVec_u8Z ret_var = C2Tuple_OutPointScriptZ_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); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -static inline uint32_t C2Tuple_u32ScriptZ_get_a(LDKC2Tuple_u32ScriptZ *NONNULL_PTR owner){ - return owner->a; -} -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_u32ScriptZ* owner_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(owner); - int32_t ret_conv = C2Tuple_u32ScriptZ_get_a(owner_conv); - return ret_conv; -} - -static inline struct LDKCVec_u8Z C2Tuple_u32ScriptZ_get_b(LDKC2Tuple_u32ScriptZ *NONNULL_PTR owner){ - return CVec_u8Z_clone(&owner->b); -} -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_u32ScriptZ* owner_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(owner); - LDKCVec_u8Z ret_var = C2Tuple_u32ScriptZ_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); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -static inline LDKCVec_C2Tuple_u32ScriptZZ CVec_C2Tuple_u32ScriptZZ_clone(const LDKCVec_C2Tuple_u32ScriptZZ *orig) { - LDKCVec_C2Tuple_u32ScriptZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ) * orig->datalen, "LDKCVec_C2Tuple_u32ScriptZZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C2Tuple_u32ScriptZ_clone(&orig->data[i]); - } - return ret; -} -static inline struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR owner){ - return ThirtyTwoBytes_clone(&owner->a); -} -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(owner); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(owner_conv).data); - return ret_arr; -} - -static inline struct LDKCVec_C2Tuple_u32ScriptZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR owner){ - return CVec_C2Tuple_u32ScriptZZ_clone(&owner->b); -} -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(owner); - LDKCVec_C2Tuple_u32ScriptZZ ret_var = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_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 v = 0; v < ret_var.datalen; v++) { - LDKC2Tuple_u32ScriptZ* ret_conv_21_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ"); - *ret_conv_21_conv = ret_var.data[v]; - ret_arr_ptr[v] = tag_ptr(ret_conv_21_conv, true); - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; -} - -static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_clone(const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ *orig) { - LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ) * orig->datalen, "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(&orig->data[i]); - } - return ret; -} -static inline LDKCVec_EventZ CVec_EventZ_clone(const LDKCVec_EventZ *orig) { - LDKCVec_EventZ ret = { .data = MALLOC(sizeof(LDKEvent) * orig->datalen, "LDKCVec_EventZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = Event_clone(&orig->data[i]); - } - return ret; -} -static inline uint32_t C2Tuple_u32TxOutZ_get_a(LDKC2Tuple_u32TxOutZ *NONNULL_PTR owner){ - return owner->a; +static inline uint32_t C2Tuple_u32TxOutZ_get_a(LDKC2Tuple_u32TxOutZ *NONNULL_PTR owner){ + return owner->a; } JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { LDKC2Tuple_u32TxOutZ* owner_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(owner); @@ -9274,6 +8991,10 @@ static jclass LDKSendError_InvalidMessage_class = NULL; static jmethodID LDKSendError_InvalidMessage_meth = NULL; static jclass LDKSendError_BufferFull_class = NULL; static jmethodID LDKSendError_BufferFull_meth = NULL; +static jclass LDKSendError_GetNodeIdFailed_class = NULL; +static jmethodID LDKSendError_GetNodeIdFailed_meth = NULL; +static jclass LDKSendError_BlindedPathAdvanceFailed_class = NULL; +static jmethodID LDKSendError_BlindedPathAdvanceFailed_meth = NULL; JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSendError_init (JNIEnv *env, jclass clz) { LDKSendError_Secp256k1_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSendError$Secp256k1")); @@ -9305,6 +9026,16 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSendError_init (JNIEnv CHECK(LDKSendError_BufferFull_class != NULL); LDKSendError_BufferFull_meth = (*env)->GetMethodID(env, LDKSendError_BufferFull_class, "", "()V"); CHECK(LDKSendError_BufferFull_meth != NULL); + LDKSendError_GetNodeIdFailed_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSendError$GetNodeIdFailed")); + CHECK(LDKSendError_GetNodeIdFailed_class != NULL); + LDKSendError_GetNodeIdFailed_meth = (*env)->GetMethodID(env, LDKSendError_GetNodeIdFailed_class, "", "()V"); + CHECK(LDKSendError_GetNodeIdFailed_meth != NULL); + LDKSendError_BlindedPathAdvanceFailed_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSendError$BlindedPathAdvanceFailed")); + CHECK(LDKSendError_BlindedPathAdvanceFailed_class != NULL); + LDKSendError_BlindedPathAdvanceFailed_meth = (*env)->GetMethodID(env, LDKSendError_BlindedPathAdvanceFailed_class, "", "()V"); + CHECK(LDKSendError_BlindedPathAdvanceFailed_meth != NULL); } JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSendError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { LDKSendError *obj = (LDKSendError*)untag_ptr(ptr); @@ -9328,6 +9059,12 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSendError_1ref_1from_1pt case LDKSendError_BufferFull: { return (*env)->NewObject(env, LDKSendError_BufferFull_class, LDKSendError_BufferFull_meth); } + case LDKSendError_GetNodeIdFailed: { + return (*env)->NewObject(env, LDKSendError_GetNodeIdFailed_class, LDKSendError_GetNodeIdFailed_meth); + } + case LDKSendError_BlindedPathAdvanceFailed: { + return (*env)->NewObject(env, LDKSendError_BlindedPathAdvanceFailed_class, LDKSendError_BlindedPathAdvanceFailed_meth); + } default: abort(); } } @@ -9352,61 +9089,543 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1ge return ret_ref; } -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); +static jclass LDKParseError_Bech32Error_class = NULL; +static jmethodID LDKParseError_Bech32Error_meth = NULL; +static jclass LDKParseError_ParseAmountError_class = NULL; +static jmethodID LDKParseError_ParseAmountError_meth = NULL; +static jclass LDKParseError_MalformedSignature_class = NULL; +static jmethodID LDKParseError_MalformedSignature_meth = NULL; +static jclass LDKParseError_BadPrefix_class = NULL; +static jmethodID LDKParseError_BadPrefix_meth = NULL; +static jclass LDKParseError_UnknownCurrency_class = NULL; +static jmethodID LDKParseError_UnknownCurrency_meth = NULL; +static jclass LDKParseError_UnknownSiPrefix_class = NULL; +static jmethodID LDKParseError_UnknownSiPrefix_meth = NULL; +static jclass LDKParseError_MalformedHRP_class = NULL; +static jmethodID LDKParseError_MalformedHRP_meth = NULL; +static jclass LDKParseError_TooShortDataPart_class = NULL; +static jmethodID LDKParseError_TooShortDataPart_meth = NULL; +static jclass LDKParseError_UnexpectedEndOfTaggedFields_class = NULL; +static jmethodID LDKParseError_UnexpectedEndOfTaggedFields_meth = NULL; +static jclass LDKParseError_DescriptionDecodeError_class = NULL; +static jmethodID LDKParseError_DescriptionDecodeError_meth = NULL; +static jclass LDKParseError_PaddingError_class = NULL; +static jmethodID LDKParseError_PaddingError_meth = NULL; +static jclass LDKParseError_IntegerOverflowError_class = NULL; +static jmethodID LDKParseError_IntegerOverflowError_meth = NULL; +static jclass LDKParseError_InvalidSegWitProgramLength_class = NULL; +static jmethodID LDKParseError_InvalidSegWitProgramLength_meth = NULL; +static jclass LDKParseError_InvalidPubKeyHashLength_class = NULL; +static jmethodID LDKParseError_InvalidPubKeyHashLength_meth = NULL; +static jclass LDKParseError_InvalidScriptHashLength_class = NULL; +static jmethodID LDKParseError_InvalidScriptHashLength_meth = NULL; +static jclass LDKParseError_InvalidRecoveryId_class = NULL; +static jmethodID LDKParseError_InvalidRecoveryId_meth = NULL; +static jclass LDKParseError_InvalidSliceLength_class = NULL; +static jmethodID LDKParseError_InvalidSliceLength_meth = NULL; +static jclass LDKParseError_Skip_class = NULL; +static jmethodID LDKParseError_Skip_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKParseError_init (JNIEnv *env, jclass clz) { + LDKParseError_Bech32Error_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$Bech32Error")); + CHECK(LDKParseError_Bech32Error_class != NULL); + LDKParseError_Bech32Error_meth = (*env)->GetMethodID(env, LDKParseError_Bech32Error_class, "", "(J)V"); + CHECK(LDKParseError_Bech32Error_meth != NULL); + LDKParseError_ParseAmountError_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$ParseAmountError")); + CHECK(LDKParseError_ParseAmountError_class != NULL); + LDKParseError_ParseAmountError_meth = (*env)->GetMethodID(env, LDKParseError_ParseAmountError_class, "", "(I)V"); + CHECK(LDKParseError_ParseAmountError_meth != NULL); + LDKParseError_MalformedSignature_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$MalformedSignature")); + CHECK(LDKParseError_MalformedSignature_class != NULL); + LDKParseError_MalformedSignature_meth = (*env)->GetMethodID(env, LDKParseError_MalformedSignature_class, "", "(Lorg/ldk/enums/Secp256k1Error;)V"); + CHECK(LDKParseError_MalformedSignature_meth != NULL); + LDKParseError_BadPrefix_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$BadPrefix")); + CHECK(LDKParseError_BadPrefix_class != NULL); + LDKParseError_BadPrefix_meth = (*env)->GetMethodID(env, LDKParseError_BadPrefix_class, "", "()V"); + CHECK(LDKParseError_BadPrefix_meth != NULL); + LDKParseError_UnknownCurrency_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$UnknownCurrency")); + CHECK(LDKParseError_UnknownCurrency_class != NULL); + LDKParseError_UnknownCurrency_meth = (*env)->GetMethodID(env, LDKParseError_UnknownCurrency_class, "", "()V"); + CHECK(LDKParseError_UnknownCurrency_meth != NULL); + LDKParseError_UnknownSiPrefix_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$UnknownSiPrefix")); + CHECK(LDKParseError_UnknownSiPrefix_class != NULL); + LDKParseError_UnknownSiPrefix_meth = (*env)->GetMethodID(env, LDKParseError_UnknownSiPrefix_class, "", "()V"); + CHECK(LDKParseError_UnknownSiPrefix_meth != NULL); + LDKParseError_MalformedHRP_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$MalformedHRP")); + CHECK(LDKParseError_MalformedHRP_class != NULL); + LDKParseError_MalformedHRP_meth = (*env)->GetMethodID(env, LDKParseError_MalformedHRP_class, "", "()V"); + CHECK(LDKParseError_MalformedHRP_meth != NULL); + LDKParseError_TooShortDataPart_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$TooShortDataPart")); + CHECK(LDKParseError_TooShortDataPart_class != NULL); + LDKParseError_TooShortDataPart_meth = (*env)->GetMethodID(env, LDKParseError_TooShortDataPart_class, "", "()V"); + CHECK(LDKParseError_TooShortDataPart_meth != NULL); + LDKParseError_UnexpectedEndOfTaggedFields_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$UnexpectedEndOfTaggedFields")); + CHECK(LDKParseError_UnexpectedEndOfTaggedFields_class != NULL); + LDKParseError_UnexpectedEndOfTaggedFields_meth = (*env)->GetMethodID(env, LDKParseError_UnexpectedEndOfTaggedFields_class, "", "()V"); + CHECK(LDKParseError_UnexpectedEndOfTaggedFields_meth != NULL); + LDKParseError_DescriptionDecodeError_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$DescriptionDecodeError")); + CHECK(LDKParseError_DescriptionDecodeError_class != NULL); + LDKParseError_DescriptionDecodeError_meth = (*env)->GetMethodID(env, LDKParseError_DescriptionDecodeError_class, "", "(I)V"); + CHECK(LDKParseError_DescriptionDecodeError_meth != NULL); + LDKParseError_PaddingError_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$PaddingError")); + CHECK(LDKParseError_PaddingError_class != NULL); + LDKParseError_PaddingError_meth = (*env)->GetMethodID(env, LDKParseError_PaddingError_class, "", "()V"); + CHECK(LDKParseError_PaddingError_meth != NULL); + LDKParseError_IntegerOverflowError_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$IntegerOverflowError")); + CHECK(LDKParseError_IntegerOverflowError_class != NULL); + LDKParseError_IntegerOverflowError_meth = (*env)->GetMethodID(env, LDKParseError_IntegerOverflowError_class, "", "()V"); + CHECK(LDKParseError_IntegerOverflowError_meth != NULL); + LDKParseError_InvalidSegWitProgramLength_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidSegWitProgramLength")); + CHECK(LDKParseError_InvalidSegWitProgramLength_class != NULL); + LDKParseError_InvalidSegWitProgramLength_meth = (*env)->GetMethodID(env, LDKParseError_InvalidSegWitProgramLength_class, "", "()V"); + CHECK(LDKParseError_InvalidSegWitProgramLength_meth != NULL); + LDKParseError_InvalidPubKeyHashLength_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidPubKeyHashLength")); + CHECK(LDKParseError_InvalidPubKeyHashLength_class != NULL); + LDKParseError_InvalidPubKeyHashLength_meth = (*env)->GetMethodID(env, LDKParseError_InvalidPubKeyHashLength_class, "", "()V"); + CHECK(LDKParseError_InvalidPubKeyHashLength_meth != NULL); + LDKParseError_InvalidScriptHashLength_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidScriptHashLength")); + CHECK(LDKParseError_InvalidScriptHashLength_class != NULL); + LDKParseError_InvalidScriptHashLength_meth = (*env)->GetMethodID(env, LDKParseError_InvalidScriptHashLength_class, "", "()V"); + CHECK(LDKParseError_InvalidScriptHashLength_meth != NULL); + LDKParseError_InvalidRecoveryId_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidRecoveryId")); + CHECK(LDKParseError_InvalidRecoveryId_class != NULL); + LDKParseError_InvalidRecoveryId_meth = (*env)->GetMethodID(env, LDKParseError_InvalidRecoveryId_class, "", "()V"); + CHECK(LDKParseError_InvalidRecoveryId_meth != NULL); + LDKParseError_InvalidSliceLength_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidSliceLength")); + CHECK(LDKParseError_InvalidSliceLength_class != NULL); + LDKParseError_InvalidSliceLength_meth = (*env)->GetMethodID(env, LDKParseError_InvalidSliceLength_class, "", "(Ljava/lang/String;)V"); + CHECK(LDKParseError_InvalidSliceLength_meth != NULL); + LDKParseError_Skip_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$Skip")); + CHECK(LDKParseError_Skip_class != NULL); + LDKParseError_Skip_meth = (*env)->GetMethodID(env, LDKParseError_Skip_class, "", "()V"); + CHECK(LDKParseError_Skip_meth != NULL); } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKGraphSyncError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKGraphSyncError *obj = (LDKGraphSyncError*)untag_ptr(ptr); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKParseError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKParseError *obj = (LDKParseError*)untag_ptr(ptr); switch(obj->tag) { - case LDKGraphSyncError_DecodeError: { - int64_t decode_error_ref = tag_ptr(&obj->decode_error, false); - return (*env)->NewObject(env, LDKGraphSyncError_DecodeError_class, LDKGraphSyncError_DecodeError_meth, decode_error_ref); + case LDKParseError_Bech32Error: { + int64_t bech32_error_ref = tag_ptr(&obj->bech32_error, false); + return (*env)->NewObject(env, LDKParseError_Bech32Error_class, LDKParseError_Bech32Error_meth, bech32_error_ref); } - case LDKGraphSyncError_LightningError: { - LDKLightningError lightning_error_var = obj->lightning_error; - int64_t lightning_error_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(lightning_error_var); - lightning_error_ref = tag_ptr(lightning_error_var.inner, false); - return (*env)->NewObject(env, LDKGraphSyncError_LightningError_class, LDKGraphSyncError_LightningError_meth, lightning_error_ref); + case LDKParseError_ParseAmountError: { + /*obj->parse_amount_error*/ + return (*env)->NewObject(env, LDKParseError_ParseAmountError_class, LDKParseError_ParseAmountError_meth, 0); } - default: abort(); - } -} -static inline uint32_t CResult_u32GraphSyncErrorZ_get_ok(LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -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*)untag_ptr(owner); - int32_t ret_conv = CResult_u32GraphSyncErrorZ_get_ok(owner_conv); - return ret_conv; -} - -static inline struct LDKGraphSyncError CResult_u32GraphSyncErrorZ_get_err(LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return GraphSyncError_clone(&*owner->contents.err); -} -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*)untag_ptr(owner); - LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError"); - *ret_copy = CResult_u32GraphSyncErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - + case LDKParseError_MalformedSignature: { + jclass malformed_signature_conv = LDKSecp256k1Error_to_java(env, obj->malformed_signature); + return (*env)->NewObject(env, LDKParseError_MalformedSignature_class, LDKParseError_MalformedSignature_meth, malformed_signature_conv); + } + case LDKParseError_BadPrefix: { + return (*env)->NewObject(env, LDKParseError_BadPrefix_class, LDKParseError_BadPrefix_meth); + } + case LDKParseError_UnknownCurrency: { + return (*env)->NewObject(env, LDKParseError_UnknownCurrency_class, LDKParseError_UnknownCurrency_meth); + } + case LDKParseError_UnknownSiPrefix: { + return (*env)->NewObject(env, LDKParseError_UnknownSiPrefix_class, LDKParseError_UnknownSiPrefix_meth); + } + case LDKParseError_MalformedHRP: { + return (*env)->NewObject(env, LDKParseError_MalformedHRP_class, LDKParseError_MalformedHRP_meth); + } + case LDKParseError_TooShortDataPart: { + return (*env)->NewObject(env, LDKParseError_TooShortDataPart_class, LDKParseError_TooShortDataPart_meth); + } + case LDKParseError_UnexpectedEndOfTaggedFields: { + return (*env)->NewObject(env, LDKParseError_UnexpectedEndOfTaggedFields_class, LDKParseError_UnexpectedEndOfTaggedFields_meth); + } + case LDKParseError_DescriptionDecodeError: { + /*obj->description_decode_error*/ + return (*env)->NewObject(env, LDKParseError_DescriptionDecodeError_class, LDKParseError_DescriptionDecodeError_meth, 0); + } + case LDKParseError_PaddingError: { + return (*env)->NewObject(env, LDKParseError_PaddingError_class, LDKParseError_PaddingError_meth); + } + case LDKParseError_IntegerOverflowError: { + return (*env)->NewObject(env, LDKParseError_IntegerOverflowError_class, LDKParseError_IntegerOverflowError_meth); + } + case LDKParseError_InvalidSegWitProgramLength: { + return (*env)->NewObject(env, LDKParseError_InvalidSegWitProgramLength_class, LDKParseError_InvalidSegWitProgramLength_meth); + } + case LDKParseError_InvalidPubKeyHashLength: { + return (*env)->NewObject(env, LDKParseError_InvalidPubKeyHashLength_class, LDKParseError_InvalidPubKeyHashLength_meth); + } + case LDKParseError_InvalidScriptHashLength: { + return (*env)->NewObject(env, LDKParseError_InvalidScriptHashLength_class, LDKParseError_InvalidScriptHashLength_meth); + } + case LDKParseError_InvalidRecoveryId: { + return (*env)->NewObject(env, LDKParseError_InvalidRecoveryId_class, LDKParseError_InvalidRecoveryId_meth); + } + case LDKParseError_InvalidSliceLength: { + LDKStr invalid_slice_length_str = obj->invalid_slice_length; + jstring invalid_slice_length_conv = str_ref_to_java(env, invalid_slice_length_str.chars, invalid_slice_length_str.len); + return (*env)->NewObject(env, LDKParseError_InvalidSliceLength_class, LDKParseError_InvalidSliceLength_meth, invalid_slice_length_conv); + } + case LDKParseError_Skip: { + return (*env)->NewObject(env, LDKParseError_Skip_class, LDKParseError_Skip_meth); + } + default: abort(); + } +} +static inline enum LDKSiPrefix CResult_SiPrefixParseErrorZ_get_ok(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return SiPrefix_clone(&*owner->contents.result); +} +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_SiPrefixParseErrorZ* owner_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(owner); + jclass ret_conv = LDKSiPrefix_to_java(env, CResult_SiPrefixParseErrorZ_get_ok(owner_conv)); + return ret_conv; +} + +static inline struct LDKParseError CResult_SiPrefixParseErrorZ_get_err(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return ParseError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_SiPrefixParseErrorZ* owner_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(owner); + LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError"); + *ret_copy = CResult_SiPrefixParseErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static jclass LDKParseOrSemanticError_ParseError_class = NULL; +static jmethodID LDKParseOrSemanticError_ParseError_meth = NULL; +static jclass LDKParseOrSemanticError_SemanticError_class = NULL; +static jmethodID LDKParseOrSemanticError_SemanticError_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKParseOrSemanticError_init (JNIEnv *env, jclass clz) { + LDKParseOrSemanticError_ParseError_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseOrSemanticError$ParseError")); + CHECK(LDKParseOrSemanticError_ParseError_class != NULL); + LDKParseOrSemanticError_ParseError_meth = (*env)->GetMethodID(env, LDKParseOrSemanticError_ParseError_class, "", "(J)V"); + CHECK(LDKParseOrSemanticError_ParseError_meth != NULL); + LDKParseOrSemanticError_SemanticError_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseOrSemanticError$SemanticError")); + CHECK(LDKParseOrSemanticError_SemanticError_class != NULL); + LDKParseOrSemanticError_SemanticError_meth = (*env)->GetMethodID(env, LDKParseOrSemanticError_SemanticError_class, "", "(Lorg/ldk/enums/SemanticError;)V"); + CHECK(LDKParseOrSemanticError_SemanticError_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKParseOrSemanticError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKParseOrSemanticError *obj = (LDKParseOrSemanticError*)untag_ptr(ptr); + switch(obj->tag) { + case LDKParseOrSemanticError_ParseError: { + int64_t parse_error_ref = tag_ptr(&obj->parse_error, false); + return (*env)->NewObject(env, LDKParseOrSemanticError_ParseError_class, LDKParseOrSemanticError_ParseError_meth, parse_error_ref); + } + case LDKParseOrSemanticError_SemanticError: { + jclass semantic_error_conv = LDKSemanticError_to_java(env, obj->semantic_error); + return (*env)->NewObject(env, LDKParseOrSemanticError_SemanticError_class, LDKParseOrSemanticError_SemanticError_meth, semantic_error_conv); + } + default: abort(); + } +} +static inline struct LDKInvoice CResult_InvoiceParseOrSemanticErrorZ_get_ok(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner){ + LDKInvoice ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_InvoiceParseOrSemanticErrorZ* owner_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(owner); + LDKInvoice ret_var = CResult_InvoiceParseOrSemanticErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKParseOrSemanticError CResult_InvoiceParseOrSemanticErrorZ_get_err(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return ParseOrSemanticError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_InvoiceParseOrSemanticErrorZ* owner_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(owner); + LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError"); + *ret_copy = CResult_InvoiceParseOrSemanticErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKSignedRawInvoice CResult_SignedRawInvoiceParseErrorZ_get_ok(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner){ + LDKSignedRawInvoice ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_SignedRawInvoiceParseErrorZ* owner_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(owner); + LDKSignedRawInvoice ret_var = CResult_SignedRawInvoiceParseErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKParseError CResult_SignedRawInvoiceParseErrorZ_get_err(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return ParseError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_SignedRawInvoiceParseErrorZ* owner_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(owner); + LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError"); + *ret_copy = CResult_SignedRawInvoiceParseErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKRawInvoice C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){ + LDKRawInvoice ret = owner->a; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner); + LDKRawInvoice ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKThirtyTwoBytes C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){ + return ThirtyTwoBytes_clone(&owner->b); +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(owner_conv).data); + return ret_arr; +} + +static inline struct LDKInvoiceSignature C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){ + LDKInvoiceSignature ret = owner->c; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1get_1c(JNIEnv *env, jclass clz, int64_t owner) { + LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner); + LDKInvoiceSignature ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKPayeePubKey CResult_PayeePubKeyErrorZ_get_ok(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner){ + LDKPayeePubKey ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_PayeePubKeyErrorZ* owner_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(owner); + LDKPayeePubKey ret_var = CResult_PayeePubKeyErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline enum LDKSecp256k1Error CResult_PayeePubKeyErrorZ_get_err(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_PayeePubKeyErrorZ* owner_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(owner); + jclass ret_conv = LDKSecp256k1Error_to_java(env, CResult_PayeePubKeyErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline LDKCVec_PrivateRouteZ CVec_PrivateRouteZ_clone(const LDKCVec_PrivateRouteZ *orig) { + LDKCVec_PrivateRouteZ ret = { .data = MALLOC(sizeof(LDKPrivateRoute) * orig->datalen, "LDKCVec_PrivateRouteZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = PrivateRoute_clone(&orig->data[i]); + } + return ret; +} +static inline struct LDKPositiveTimestamp CResult_PositiveTimestampCreationErrorZ_get_ok(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner){ + LDKPositiveTimestamp ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_PositiveTimestampCreationErrorZ* owner_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(owner); + LDKPositiveTimestamp ret_var = CResult_PositiveTimestampCreationErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline enum LDKCreationError CResult_PositiveTimestampCreationErrorZ_get_err(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return CreationError_clone(&*owner->contents.err); +} +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_PositiveTimestampCreationErrorZ* owner_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(owner); + jclass ret_conv = LDKCreationError_to_java(env, CResult_PositiveTimestampCreationErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline void CResult_NoneSemanticErrorZ_get_ok(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneSemanticErrorZ* owner_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(owner); + CResult_NoneSemanticErrorZ_get_ok(owner_conv); +} + +static inline enum LDKSemanticError CResult_NoneSemanticErrorZ_get_err(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return SemanticError_clone(&*owner->contents.err); +} +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneSemanticErrorZ* owner_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(owner); + jclass ret_conv = LDKSemanticError_to_java(env, CResult_NoneSemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline struct LDKInvoice CResult_InvoiceSemanticErrorZ_get_ok(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner){ + LDKInvoice ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_InvoiceSemanticErrorZ* owner_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(owner); + LDKInvoice ret_var = CResult_InvoiceSemanticErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline enum LDKSemanticError CResult_InvoiceSemanticErrorZ_get_err(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return SemanticError_clone(&*owner->contents.err); +} +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_InvoiceSemanticErrorZ* owner_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(owner); + jclass ret_conv = LDKSemanticError_to_java(env, CResult_InvoiceSemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline struct LDKDescription CResult_DescriptionCreationErrorZ_get_ok(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner){ + LDKDescription ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_DescriptionCreationErrorZ* owner_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(owner); + LDKDescription ret_var = CResult_DescriptionCreationErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline enum LDKCreationError CResult_DescriptionCreationErrorZ_get_err(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return CreationError_clone(&*owner->contents.err); +} +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_DescriptionCreationErrorZ* owner_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(owner); + jclass ret_conv = LDKCreationError_to_java(env, CResult_DescriptionCreationErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline struct LDKPrivateRoute CResult_PrivateRouteCreationErrorZ_get_ok(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner){ + LDKPrivateRoute ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_PrivateRouteCreationErrorZ* owner_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(owner); + LDKPrivateRoute ret_var = CResult_PrivateRouteCreationErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline enum LDKCreationError CResult_PrivateRouteCreationErrorZ_get_err(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return CreationError_clone(&*owner->contents.err); +} +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_PrivateRouteCreationErrorZ* owner_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(owner); + jclass ret_conv = LDKCreationError_to_java(env, CResult_PrivateRouteCreationErrorZ_get_err(owner_conv)); + return ret_conv; +} + +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 jobject JNICALL Java_org_ldk_impl_bindings_LDKGraphSyncError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKGraphSyncError *obj = (LDKGraphSyncError*)untag_ptr(ptr); + switch(obj->tag) { + case LDKGraphSyncError_DecodeError: { + int64_t decode_error_ref = tag_ptr(&obj->decode_error, false); + return (*env)->NewObject(env, LDKGraphSyncError_DecodeError_class, LDKGraphSyncError_DecodeError_meth, decode_error_ref); + } + case LDKGraphSyncError_LightningError: { + LDKLightningError lightning_error_var = obj->lightning_error; + int64_t lightning_error_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(lightning_error_var); + lightning_error_ref = tag_ptr(lightning_error_var.inner, false); + return (*env)->NewObject(env, LDKGraphSyncError_LightningError_class, LDKGraphSyncError_LightningError_meth, lightning_error_ref); + } + default: abort(); + } +} +static inline uint32_t CResult_u32GraphSyncErrorZ_get_ok(LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; +} +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*)untag_ptr(owner); + int32_t ret_conv = CResult_u32GraphSyncErrorZ_get_ok(owner_conv); + return ret_conv; +} + +static inline struct LDKGraphSyncError CResult_u32GraphSyncErrorZ_get_err(LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return GraphSyncError_clone(&*owner->contents.err); +} +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*)untag_ptr(owner); + LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError"); + *ret_copy = CResult_u32GraphSyncErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline struct LDKNetAddress CResult_NetAddressDecodeErrorZ_get_ok(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return NetAddress_clone(&*owner->contents.result); @@ -10599,6 +10818,55 @@ static inline LDKCVec_OutPointZ CVec_OutPointZ_clone(const LDKCVec_OutPointZ *or } return ret; } +static inline LDKCVec_MonitorUpdateIdZ CVec_MonitorUpdateIdZ_clone(const LDKCVec_MonitorUpdateIdZ *orig) { + LDKCVec_MonitorUpdateIdZ ret = { .data = MALLOC(sizeof(LDKMonitorUpdateId) * orig->datalen, "LDKCVec_MonitorUpdateIdZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = MonitorUpdateId_clone(&orig->data[i]); + } + return ret; +} +static inline struct LDKOutPoint C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR owner){ + LDKOutPoint ret = owner->a; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* owner_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(owner); + LDKOutPoint ret_var = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKCVec_MonitorUpdateIdZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR owner){ + return CVec_MonitorUpdateIdZ_clone(&owner->b); +} +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* owner_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(owner); + LDKCVec_MonitorUpdateIdZ ret_var = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(owner_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t r = 0; r < ret_var.datalen; r++) { + LDKMonitorUpdateId ret_conv_17_var = ret_var.data[r]; + int64_t ret_conv_17_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_17_var); + ret_conv_17_ref = tag_ptr(ret_conv_17_var.inner, ret_conv_17_var.is_owned); + ret_arr_ptr[r] = ret_conv_17_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; +} + +static inline LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_clone(const LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ *orig) { + LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ) * orig->datalen, "LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(&orig->data[i]); + } + return ret; +} typedef struct LDKMessageSendEventsProvider_JCalls { atomic_size_t refcnt; JavaVM *vm; @@ -10817,7 +11085,7 @@ static void LDKEventHandler_JCalls_free(void* this_arg) { FREE(j_calls); } } -void handle_event_LDKEventHandler_jcall(const void* this_arg, const LDKEvent * event) { +void handle_event_LDKEventHandler_jcall(const void* this_arg, LDKEvent event) { LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -10826,12 +11094,12 @@ void handle_event_LDKEventHandler_jcall(const void* this_arg, const LDKEvent * e } else { DO_ASSERT(get_jenv_res == JNI_OK); } - LDKEvent *ret_event = MALLOC(sizeof(LDKEvent), "LDKEvent ret conversion"); - *ret_event = Event_clone(event); - int64_t ref_event = tag_ptr(ret_event, true); + LDKEvent *event_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *event_copy = event; + int64_t event_ref = tag_ptr(event_copy, true); jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - (*env)->CallVoidMethod(env, obj, j_calls->handle_event_meth, ref_event); + (*env)->CallVoidMethod(env, obj, j_calls->handle_event_meth, event_ref); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to handle_event in LDKEventHandler from rust threw an exception."); @@ -10870,7 +11138,10 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventHandler_1handle_1event(JN void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKEventHandler* this_arg_conv = (LDKEventHandler*)this_arg_ptr; - LDKEvent* event_conv = (LDKEvent*)untag_ptr(event); + void* event_ptr = untag_ptr(event); + CHECK_ACCESS(event_ptr); + LDKEvent event_conv = *(LDKEvent*)(event_ptr); + event_conv = Event_clone((LDKEvent*)untag_ptr(event)); (this_arg_conv->handle_event)(this_arg_conv->this_arg, event_conv); } @@ -11511,7 +11782,7 @@ void best_block_updated_LDKConfirm_jcall(const void* this_arg, const uint8_t (* DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } } -LDKCVec_TxidZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) { +LDKCVec_C2Tuple_TxidBlockHashZZ 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); @@ -11522,24 +11793,27 @@ LDKCVec_TxidZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) { } jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - jobjectArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_relevant_txids_meth); + int64_tArray 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; + LDKCVec_C2Tuple_TxidBlockHashZZ 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"); + ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_TxidBlockHashZ), "LDKCVec_C2Tuple_TxidBlockHashZZ 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; + int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL); + for (size_t z = 0; z < ret_constr.datalen; z++) { + int64_t ret_conv_25 = ret_vals[z]; + void* ret_conv_25_ptr = untag_ptr(ret_conv_25); + CHECK_ACCESS(ret_conv_25_ptr); + LDKC2Tuple_TxidBlockHashZ ret_conv_25_conv = *(LDKC2Tuple_TxidBlockHashZ*)(ret_conv_25_ptr); + FREE(untag_ptr(ret_conv_25)); + ret_constr.data[z] = ret_conv_25_conv; } + (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -11562,7 +11836,7 @@ static inline LDKConfirm LDKConfirm_init (JNIEnv *env, jclass clz, jobject o) { 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"); + calls->get_relevant_txids_meth = (*env)->GetMethodID(env, c, "get_relevant_txids", "()[J"); CHECK(calls->get_relevant_txids_meth != NULL); LDKConfirm ret = { @@ -11629,20 +11903,20 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1best_1block_1updated( (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) { +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Confirm_1get_1relevant_1txids(JNIEnv *env, jclass clz, int64_t this_arg) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } 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); + LDKCVec_C2Tuple_TxidBlockHashZZ ret_var = (this_arg_conv->get_relevant_txids)(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 z = 0; z < ret_var.datalen; z++) { + LDKC2Tuple_TxidBlockHashZ* ret_conv_25_conv = MALLOC(sizeof(LDKC2Tuple_TxidBlockHashZ), "LDKC2Tuple_TxidBlockHashZ"); + *ret_conv_25_conv = ret_var.data[z]; + ret_arr_ptr[z] = tag_ptr(ret_conv_25_conv, true); } - + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); FREE(ret_var.data); return ret_arr; } @@ -14426,8 +14700,8 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEffectiveCapacity_1ref_1 } case LDKEffectiveCapacity_Total: { int64_t capacity_msat_conv = obj->total.capacity_msat; - int64_t htlc_maximum_msat_ref = tag_ptr(&obj->total.htlc_maximum_msat, false); - return (*env)->NewObject(env, LDKEffectiveCapacity_Total_class, LDKEffectiveCapacity_Total_meth, capacity_msat_conv, htlc_maximum_msat_ref); + int64_t htlc_maximum_msat_conv = obj->total.htlc_maximum_msat; + return (*env)->NewObject(env, LDKEffectiveCapacity_Total_class, LDKEffectiveCapacity_Total_meth, capacity_msat_conv, htlc_maximum_msat_conv); } case LDKEffectiveCapacity_Infinite: { return (*env)->NewObject(env, LDKEffectiveCapacity_Infinite_class, LDKEffectiveCapacity_Infinite_meth); @@ -14438,480 +14712,12 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEffectiveCapacity_1ref_1 default: abort(); } } -static jclass LDKDestination_Node_class = NULL; -static jmethodID LDKDestination_Node_meth = NULL; -static jclass LDKDestination_BlindedRoute_class = NULL; -static jmethodID LDKDestination_BlindedRoute_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKDestination_init (JNIEnv *env, jclass clz) { - LDKDestination_Node_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDestination$Node")); - CHECK(LDKDestination_Node_class != NULL); - LDKDestination_Node_meth = (*env)->GetMethodID(env, LDKDestination_Node_class, "", "([B)V"); - CHECK(LDKDestination_Node_meth != NULL); - LDKDestination_BlindedRoute_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDestination$BlindedRoute")); - CHECK(LDKDestination_BlindedRoute_class != NULL); - LDKDestination_BlindedRoute_meth = (*env)->GetMethodID(env, LDKDestination_BlindedRoute_class, "", "(J)V"); - CHECK(LDKDestination_BlindedRoute_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDestination_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKDestination *obj = (LDKDestination*)untag_ptr(ptr); - switch(obj->tag) { - case LDKDestination_Node: { - int8_tArray node_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, node_arr, 0, 33, obj->node.compressed_form); - return (*env)->NewObject(env, LDKDestination_Node_class, LDKDestination_Node_meth, node_arr); - } - case LDKDestination_BlindedRoute: { - LDKBlindedRoute blinded_route_var = obj->blinded_route; - int64_t blinded_route_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_route_var); - blinded_route_ref = tag_ptr(blinded_route_var.inner, false); - return (*env)->NewObject(env, LDKDestination_BlindedRoute_class, LDKDestination_BlindedRoute_meth, blinded_route_ref); - } - default: abort(); - } -} -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*)untag_ptr(ptr); - switch(obj->tag) { - case LDKGossipSync_P2P: { - LDKP2PGossipSync p2p_var = obj->p2p; - int64_t p2p_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(p2p_var); - p2p_ref = tag_ptr(p2p_var.inner, false); - return (*env)->NewObject(env, LDKGossipSync_P2P_class, LDKGossipSync_P2P_meth, p2p_ref); - } - case LDKGossipSync_Rapid: { - LDKRapidGossipSync rapid_var = obj->rapid; - int64_t rapid_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(rapid_var); - rapid_ref = tag_ptr(rapid_var.inner, false); - return (*env)->NewObject(env, LDKGossipSync_Rapid_class, LDKGossipSync_Rapid_meth, rapid_ref); - } - case LDKGossipSync_None: { - return (*env)->NewObject(env, LDKGossipSync_None_class, LDKGossipSync_None_meth); - } - default: abort(); - } -} -static jclass LDKFallback_SegWitProgram_class = NULL; -static jmethodID LDKFallback_SegWitProgram_meth = NULL; -static jclass LDKFallback_PubKeyHash_class = NULL; -static jmethodID LDKFallback_PubKeyHash_meth = NULL; -static jclass LDKFallback_ScriptHash_class = NULL; -static jmethodID LDKFallback_ScriptHash_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKFallback_init (JNIEnv *env, jclass clz) { - LDKFallback_SegWitProgram_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKFallback$SegWitProgram")); - CHECK(LDKFallback_SegWitProgram_class != NULL); - LDKFallback_SegWitProgram_meth = (*env)->GetMethodID(env, LDKFallback_SegWitProgram_class, "", "(B[B)V"); - CHECK(LDKFallback_SegWitProgram_meth != NULL); - LDKFallback_PubKeyHash_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKFallback$PubKeyHash")); - CHECK(LDKFallback_PubKeyHash_class != NULL); - LDKFallback_PubKeyHash_meth = (*env)->GetMethodID(env, LDKFallback_PubKeyHash_class, "", "([B)V"); - CHECK(LDKFallback_PubKeyHash_meth != NULL); - LDKFallback_ScriptHash_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKFallback$ScriptHash")); - CHECK(LDKFallback_ScriptHash_class != NULL); - LDKFallback_ScriptHash_meth = (*env)->GetMethodID(env, LDKFallback_ScriptHash_class, "", "([B)V"); - CHECK(LDKFallback_ScriptHash_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFallback_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKFallback *obj = (LDKFallback*)untag_ptr(ptr); - switch(obj->tag) { - case LDKFallback_SegWitProgram: { - uint8_t version_val = obj->seg_wit_program.version._0; - LDKCVec_u8Z program_var = obj->seg_wit_program.program; - int8_tArray program_arr = (*env)->NewByteArray(env, program_var.datalen); - (*env)->SetByteArrayRegion(env, program_arr, 0, program_var.datalen, program_var.data); - return (*env)->NewObject(env, LDKFallback_SegWitProgram_class, LDKFallback_SegWitProgram_meth, version_val, program_arr); - } - case LDKFallback_PubKeyHash: { - int8_tArray pub_key_hash_arr = (*env)->NewByteArray(env, 20); - (*env)->SetByteArrayRegion(env, pub_key_hash_arr, 0, 20, obj->pub_key_hash.data); - return (*env)->NewObject(env, LDKFallback_PubKeyHash_class, LDKFallback_PubKeyHash_meth, pub_key_hash_arr); - } - case LDKFallback_ScriptHash: { - int8_tArray script_hash_arr = (*env)->NewByteArray(env, 20); - (*env)->SetByteArrayRegion(env, script_hash_arr, 0, 20, obj->script_hash.data); - return (*env)->NewObject(env, LDKFallback_ScriptHash_class, LDKFallback_ScriptHash_meth, script_hash_arr); - } - default: abort(); - } -} -typedef struct LDKPayer_JCalls { - atomic_size_t refcnt; - JavaVM *vm; - jweak o; - jmethodID node_id_meth; - jmethodID first_hops_meth; - jmethodID send_payment_meth; - jmethodID send_spontaneous_payment_meth; - jmethodID retry_payment_meth; - jmethodID abandon_payment_meth; -} LDKPayer_JCalls; -static void LDKPayer_JCalls_free(void* this_arg) { - LDKPayer_JCalls *j_calls = (LDKPayer_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 node_id_LDKPayer_jcall(const void* this_arg) { - LDKPayer_JCalls *j_calls = (LDKPayer_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->node_id_meth); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to node_id in LDKPayer 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; -} -LDKCVec_ChannelDetailsZ first_hops_LDKPayer_jcall(const void* this_arg) { - LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg; - JNIEnv *env; - jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); - } else { - DO_ASSERT(get_jenv_res == JNI_OK); - } - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->first_hops_meth); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to first_hops in LDKPayer from rust threw an exception."); - } - LDKCVec_ChannelDetailsZ ret_constr; - ret_constr.datalen = (*env)->GetArrayLength(env, ret); - if (ret_constr.datalen > 0) - ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); - else - ret_constr.data = NULL; - int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL); - for (size_t q = 0; q < ret_constr.datalen; q++) { - int64_t ret_conv_16 = ret_vals[q]; - LDKChannelDetails ret_conv_16_conv; - ret_conv_16_conv.inner = untag_ptr(ret_conv_16); - ret_conv_16_conv.is_owned = ptr_is_owned(ret_conv_16); - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_conv); - ret_constr.data[q] = ret_conv_16_conv; - } - (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); - } - return ret_constr; -} -LDKCResult_PaymentIdPaymentSendFailureZ send_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_hash, LDKThirtyTwoBytes payment_secret) { - LDKPayer_JCalls *j_calls = (LDKPayer_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); - } - LDKRoute route_var = *route; - int64_t route_ref = 0; - route_var = Route_clone(&route_var); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var); - route_ref = tag_ptr(route_var.inner, route_var.is_owned); - int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, payment_hash.data); - int8_tArray payment_secret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_secret_arr, 0, 32, payment_secret.data); - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->send_payment_meth, route_ref, payment_hash_arr, payment_secret_arr); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to send_payment in LDKPayer from rust threw an exception."); - } - void* ret_ptr = untag_ptr(ret); - CHECK_ACCESS(ret_ptr); - LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr); - FREE(untag_ptr(ret)); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); - } - return ret_conv; -} -LDKCResult_PaymentIdPaymentSendFailureZ send_spontaneous_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_preimage) { - LDKPayer_JCalls *j_calls = (LDKPayer_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); - } - LDKRoute route_var = *route; - int64_t route_ref = 0; - route_var = Route_clone(&route_var); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var); - route_ref = tag_ptr(route_var.inner, route_var.is_owned); - int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, payment_preimage.data); - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->send_spontaneous_payment_meth, route_ref, payment_preimage_arr); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to send_spontaneous_payment in LDKPayer from rust threw an exception."); - } - void* ret_ptr = untag_ptr(ret); - CHECK_ACCESS(ret_ptr); - LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr); - FREE(untag_ptr(ret)); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); - } - return ret_conv; -} -LDKCResult_NonePaymentSendFailureZ retry_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_id) { - LDKPayer_JCalls *j_calls = (LDKPayer_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); - } - LDKRoute route_var = *route; - int64_t route_ref = 0; - route_var = Route_clone(&route_var); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var); - route_ref = tag_ptr(route_var.inner, route_var.is_owned); - int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, payment_id.data); - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->retry_payment_meth, route_ref, payment_id_arr); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to retry_payment in LDKPayer from rust threw an exception."); - } - void* ret_ptr = untag_ptr(ret); - CHECK_ACCESS(ret_ptr); - LDKCResult_NonePaymentSendFailureZ ret_conv = *(LDKCResult_NonePaymentSendFailureZ*)(ret_ptr); - FREE(untag_ptr(ret)); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); - } - return ret_conv; -} -void abandon_payment_LDKPayer_jcall(const void* this_arg, LDKThirtyTwoBytes payment_id) { - LDKPayer_JCalls *j_calls = (LDKPayer_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 payment_id_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, payment_id.data); - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - (*env)->CallVoidMethod(env, obj, j_calls->abandon_payment_meth, payment_id_arr); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to abandon_payment in LDKPayer from rust threw an exception."); - } - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); - } -} -static void LDKPayer_JCalls_cloned(LDKPayer* new_obj) { - LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) new_obj->this_arg; - atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); -} -static inline LDKPayer LDKPayer_init (JNIEnv *env, jclass clz, jobject o) { - jclass c = (*env)->GetObjectClass(env, o); - CHECK(c != NULL); - LDKPayer_JCalls *calls = MALLOC(sizeof(LDKPayer_JCalls), "LDKPayer_JCalls"); - atomic_init(&calls->refcnt, 1); - DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); - calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->node_id_meth = (*env)->GetMethodID(env, c, "node_id", "()[B"); - CHECK(calls->node_id_meth != NULL); - calls->first_hops_meth = (*env)->GetMethodID(env, c, "first_hops", "()[J"); - CHECK(calls->first_hops_meth != NULL); - calls->send_payment_meth = (*env)->GetMethodID(env, c, "send_payment", "(J[B[B)J"); - CHECK(calls->send_payment_meth != NULL); - calls->send_spontaneous_payment_meth = (*env)->GetMethodID(env, c, "send_spontaneous_payment", "(J[B)J"); - CHECK(calls->send_spontaneous_payment_meth != NULL); - calls->retry_payment_meth = (*env)->GetMethodID(env, c, "retry_payment", "(J[B)J"); - CHECK(calls->retry_payment_meth != NULL); - calls->abandon_payment_meth = (*env)->GetMethodID(env, c, "abandon_payment", "([B)V"); - CHECK(calls->abandon_payment_meth != NULL); - - LDKPayer ret = { - .this_arg = (void*) calls, - .node_id = node_id_LDKPayer_jcall, - .first_hops = first_hops_LDKPayer_jcall, - .send_payment = send_payment_LDKPayer_jcall, - .send_spontaneous_payment = send_spontaneous_payment_LDKPayer_jcall, - .retry_payment = retry_payment_LDKPayer_jcall, - .abandon_payment = abandon_payment_LDKPayer_jcall, - .free = LDKPayer_JCalls_free, - }; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKPayer_1new(JNIEnv *env, jclass clz, jobject o) { - LDKPayer *res_ptr = MALLOC(sizeof(LDKPayer), "LDKPayer"); - *res_ptr = LDKPayer_init(env, clz, o); - return tag_ptr(res_ptr, true); -} -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Payer_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, (this_arg_conv->node_id)(this_arg_conv->this_arg).compressed_form); - return ret_arr; -} - -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Payer_1first_1hops(JNIEnv *env, jclass clz, int64_t this_arg) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr; - LDKCVec_ChannelDetailsZ ret_var = (this_arg_conv->first_hops)(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 q = 0; q < ret_var.datalen; q++) { - LDKChannelDetails ret_conv_16_var = ret_var.data[q]; - int64_t ret_conv_16_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); - ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned); - 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_Payer_1send_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_hash, int8_tArray payment_secret) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr; - LDKRoute route_conv; - route_conv.inner = untag_ptr(route); - route_conv.is_owned = ptr_is_owned(route); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); - route_conv.is_owned = false; - 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 = (this_arg_conv->send_payment)(this_arg_conv->this_arg, &route_conv, payment_hash_ref, payment_secret_ref); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payer_1send_1spontaneous_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_preimage) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr; - LDKRoute route_conv; - route_conv.inner = untag_ptr(route); - route_conv.is_owned = ptr_is_owned(route); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); - route_conv.is_owned = false; - LDKThirtyTwoBytes payment_preimage_ref; - CHECK((*env)->GetArrayLength(env, payment_preimage) == 32); - (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data); - LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); - *ret_conv = (this_arg_conv->send_spontaneous_payment)(this_arg_conv->this_arg, &route_conv, payment_preimage_ref); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payer_1retry_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_id) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr; - LDKRoute route_conv; - route_conv.inner = untag_ptr(route); - route_conv.is_owned = ptr_is_owned(route); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); - route_conv.is_owned = false; - 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 = (this_arg_conv->retry_payment)(this_arg_conv->this_arg, &route_conv, payment_id_ref); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payer_1abandon_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_id) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr; - LDKThirtyTwoBytes payment_id_ref; - CHECK((*env)->GetArrayLength(env, payment_id) == 32); - (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); - (this_arg_conv->abandon_payment)(this_arg_conv->this_arg, payment_id_ref); -} - typedef struct LDKRouter_JCalls { atomic_size_t refcnt; JavaVM *vm; jweak o; jmethodID find_route_meth; + jmethodID find_route_with_id_meth; jmethodID notify_payment_path_failed_meth; jmethodID notify_payment_path_successful_meth; jmethodID notify_payment_probe_successful_meth; @@ -14934,7 +14740,7 @@ static void LDKRouter_JCalls_free(void* this_arg) { FREE(j_calls); } } -LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, LDKPublicKey payer, const LDKRouteParameters * route_params, const uint8_t (* payment_hash)[32], LDKCVec_ChannelDetailsZ * first_hops, LDKInFlightHtlcs inflight_htlcs) { +LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, LDKPublicKey payer, const LDKRouteParameters * route_params, LDKCVec_ChannelDetailsZ * first_hops, LDKInFlightHtlcs inflight_htlcs) { LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -14950,8 +14756,6 @@ LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, route_params_var = RouteParameters_clone(&route_params_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_var); route_params_ref = tag_ptr(route_params_var.inner, route_params_var.is_owned); - int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, *payment_hash); LDKCVec_ChannelDetailsZ *first_hops_var_ptr = first_hops; int64_tArray first_hops_arr = NULL; if (first_hops != NULL) { @@ -14973,7 +14777,7 @@ LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, inflight_htlcs_ref = tag_ptr(inflight_htlcs_var.inner, inflight_htlcs_var.is_owned); jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->find_route_meth, payer_arr, route_params_ref, payment_hash_arr, first_hops_arr, inflight_htlcs_ref); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->find_route_meth, payer_arr, route_params_ref, first_hops_arr, inflight_htlcs_ref); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to find_route in LDKRouter from rust threw an exception."); @@ -14987,6 +14791,61 @@ LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, } return ret_conv; } +LDKCResult_RouteLightningErrorZ find_route_with_id_LDKRouter_jcall(const void* this_arg, LDKPublicKey payer, const LDKRouteParameters * route_params, LDKCVec_ChannelDetailsZ * first_hops, LDKInFlightHtlcs inflight_htlcs, LDKThirtyTwoBytes _payment_hash, LDKThirtyTwoBytes _payment_id) { + LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg; + JNIEnv *env; + jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); + } else { + DO_ASSERT(get_jenv_res == JNI_OK); + } + int8_tArray payer_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, payer_arr, 0, 33, payer.compressed_form); + LDKRouteParameters route_params_var = *route_params; + int64_t route_params_ref = 0; + route_params_var = RouteParameters_clone(&route_params_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_var); + route_params_ref = tag_ptr(route_params_var.inner, route_params_var.is_owned); + LDKCVec_ChannelDetailsZ *first_hops_var_ptr = first_hops; + int64_tArray first_hops_arr = NULL; + if (first_hops != NULL) { + LDKCVec_ChannelDetailsZ first_hops_var = *first_hops_var_ptr; + first_hops_arr = (*env)->NewLongArray(env, first_hops_var.datalen); + int64_t *first_hops_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, first_hops_arr, NULL); + for (size_t q = 0; q < first_hops_var.datalen; q++) { + LDKChannelDetails first_hops_conv_16_var = first_hops_var.data[q]; + int64_t first_hops_conv_16_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_var); + first_hops_conv_16_ref = tag_ptr(first_hops_conv_16_var.inner, first_hops_conv_16_var.is_owned); + first_hops_arr_ptr[q] = first_hops_conv_16_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, first_hops_arr, first_hops_arr_ptr, 0); + } + LDKInFlightHtlcs inflight_htlcs_var = inflight_htlcs; + int64_t inflight_htlcs_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_var); + inflight_htlcs_ref = tag_ptr(inflight_htlcs_var.inner, inflight_htlcs_var.is_owned); + int8_tArray _payment_hash_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, _payment_hash_arr, 0, 32, _payment_hash.data); + int8_tArray _payment_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, _payment_id_arr, 0, 32, _payment_id.data); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->find_route_with_id_meth, payer_arr, route_params_ref, first_hops_arr, inflight_htlcs_ref, _payment_hash_arr, _payment_id_arr); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to find_route_with_id in LDKRouter from rust threw an exception."); + } + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(ret_ptr); + FREE(untag_ptr(ret)); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } + return ret_conv; +} void notify_payment_path_failed_LDKRouter_jcall(const void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) { LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg; JNIEnv *env; @@ -15132,8 +14991,10 @@ static inline LDKRouter LDKRouter_init (JNIEnv *env, jclass clz, jobject o) { atomic_init(&calls->refcnt, 1); DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->find_route_meth = (*env)->GetMethodID(env, c, "find_route", "([BJ[B[JJ)J"); + calls->find_route_meth = (*env)->GetMethodID(env, c, "find_route", "([BJ[JJ)J"); CHECK(calls->find_route_meth != NULL); + calls->find_route_with_id_meth = (*env)->GetMethodID(env, c, "find_route_with_id", "([BJ[JJ[B[B)J"); + CHECK(calls->find_route_with_id_meth != NULL); calls->notify_payment_path_failed_meth = (*env)->GetMethodID(env, c, "notify_payment_path_failed", "([JJ)V"); CHECK(calls->notify_payment_path_failed_meth != NULL); calls->notify_payment_path_successful_meth = (*env)->GetMethodID(env, c, "notify_payment_path_successful", "([J)V"); @@ -15146,6 +15007,7 @@ static inline LDKRouter LDKRouter_init (JNIEnv *env, jclass clz, jobject o) { LDKRouter ret = { .this_arg = (void*) calls, .find_route = find_route_LDKRouter_jcall, + .find_route_with_id = find_route_with_id_LDKRouter_jcall, .notify_payment_path_failed = notify_payment_path_failed_LDKRouter_jcall, .notify_payment_path_successful = notify_payment_path_successful_LDKRouter_jcall, .notify_payment_probe_successful = notify_payment_probe_successful_LDKRouter_jcall, @@ -15159,7 +15021,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKRouter_1new(JNIEnv *env, *res_ptr = LDKRouter_init(env, clz, o); return tag_ptr(res_ptr, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1find_1route(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payer, int64_t route_params, int8_tArray payment_hash, int64_tArray first_hops, int64_t inflight_htlcs) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1find_1route(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payer, int64_t route_params, int64_tArray first_hops, int64_t inflight_htlcs) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr; @@ -15171,10 +15033,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1find_1route(JNIEnv route_params_conv.is_owned = ptr_is_owned(route_params); CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); route_params_conv.is_owned = false; - 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; LDKCVec_ChannelDetailsZ first_hops_constr; LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL; if (first_hops != NULL) { @@ -15200,10 +15058,59 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1find_1route(JNIEnv inflight_htlcs_conv.inner = untag_ptr(inflight_htlcs); inflight_htlcs_conv.is_owned = ptr_is_owned(inflight_htlcs); CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_conv); - // WARNING: we need a move here but no clone is available for LDKInFlightHtlcs - + inflight_htlcs_conv = InFlightHtlcs_clone(&inflight_htlcs_conv); + LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); + *ret_conv = (this_arg_conv->find_route)(this_arg_conv->this_arg, payer_ref, &route_params_conv, first_hops_ptr, inflight_htlcs_conv); + if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); } + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1find_1route_1with_1id(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payer, int64_t route_params, int64_tArray first_hops, int64_t inflight_htlcs, int8_tArray _payment_hash, int8_tArray _payment_id) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr; + LDKPublicKey payer_ref; + CHECK((*env)->GetArrayLength(env, payer) == 33); + (*env)->GetByteArrayRegion(env, payer, 0, 33, payer_ref.compressed_form); + LDKRouteParameters route_params_conv; + route_params_conv.inner = untag_ptr(route_params); + route_params_conv.is_owned = ptr_is_owned(route_params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); + route_params_conv.is_owned = false; + LDKCVec_ChannelDetailsZ first_hops_constr; + LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL; + if (first_hops != NULL) { + first_hops_constr.datalen = (*env)->GetArrayLength(env, first_hops); + if (first_hops_constr.datalen > 0) + first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); + else + first_hops_constr.data = NULL; + int64_t* first_hops_vals = (*env)->GetLongArrayElements (env, first_hops, NULL); + for (size_t q = 0; q < first_hops_constr.datalen; q++) { + int64_t first_hops_conv_16 = first_hops_vals[q]; + LDKChannelDetails first_hops_conv_16_conv; + first_hops_conv_16_conv.inner = untag_ptr(first_hops_conv_16); + first_hops_conv_16_conv.is_owned = ptr_is_owned(first_hops_conv_16); + CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv); + first_hops_conv_16_conv.is_owned = false; + first_hops_constr.data[q] = first_hops_conv_16_conv; + } + (*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0); + first_hops_ptr = &first_hops_constr; + } + LDKInFlightHtlcs inflight_htlcs_conv; + inflight_htlcs_conv.inner = untag_ptr(inflight_htlcs); + inflight_htlcs_conv.is_owned = ptr_is_owned(inflight_htlcs); + CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_conv); + inflight_htlcs_conv = InFlightHtlcs_clone(&inflight_htlcs_conv); + LDKThirtyTwoBytes _payment_hash_ref; + CHECK((*env)->GetArrayLength(env, _payment_hash) == 32); + (*env)->GetByteArrayRegion(env, _payment_hash, 0, 32, _payment_hash_ref.data); + LDKThirtyTwoBytes _payment_id_ref; + CHECK((*env)->GetArrayLength(env, _payment_id) == 32); + (*env)->GetByteArrayRegion(env, _payment_id, 0, 32, _payment_id_ref.data); LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); - *ret_conv = (this_arg_conv->find_route)(this_arg_conv->this_arg, payer_ref, &route_params_conv, payment_hash_ref, first_hops_ptr, inflight_htlcs_conv); + *ret_conv = (this_arg_conv->find_route_with_id)(this_arg_conv->this_arg, payer_ref, &route_params_conv, first_hops_ptr, inflight_htlcs_conv, _payment_hash_ref, _payment_id_ref); if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); } return tag_ptr(ret_conv, true); } @@ -15304,261 +15211,727 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_1notify_1payment_1probe (this_arg_conv->notify_payment_probe_failed)(this_arg_conv->this_arg, path_constr, short_channel_id); } -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); +static jclass LDKDestination_Node_class = NULL; +static jmethodID LDKDestination_Node_meth = NULL; +static jclass LDKDestination_BlindedPath_class = NULL; +static jmethodID LDKDestination_BlindedPath_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKDestination_init (JNIEnv *env, jclass clz) { + LDKDestination_Node_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDestination$Node")); + CHECK(LDKDestination_Node_class != NULL); + LDKDestination_Node_meth = (*env)->GetMethodID(env, LDKDestination_Node_class, "", "([B)V"); + CHECK(LDKDestination_Node_meth != NULL); + LDKDestination_BlindedPath_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDestination$BlindedPath")); + CHECK(LDKDestination_BlindedPath_class != NULL); + LDKDestination_BlindedPath_meth = (*env)->GetMethodID(env, LDKDestination_BlindedPath_class, "", "(J)V"); + CHECK(LDKDestination_BlindedPath_meth != NULL); } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKRetry_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKRetry *obj = (LDKRetry*)untag_ptr(ptr); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDestination_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKDestination *obj = (LDKDestination*)untag_ptr(ptr); switch(obj->tag) { - case LDKRetry_Attempts: { - int64_t attempts_conv = obj->attempts; - return (*env)->NewObject(env, LDKRetry_Attempts_class, LDKRetry_Attempts_meth, attempts_conv); + case LDKDestination_Node: { + int8_tArray node_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, node_arr, 0, 33, obj->node.compressed_form); + return (*env)->NewObject(env, LDKDestination_Node_class, LDKDestination_Node_meth, node_arr); } - case LDKRetry_Timeout: { - int64_t timeout_conv = obj->timeout; - return (*env)->NewObject(env, LDKRetry_Timeout_class, LDKRetry_Timeout_meth, timeout_conv); + case LDKDestination_BlindedPath: { + LDKBlindedPath blinded_path_var = obj->blinded_path; + int64_t blinded_path_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_path_var); + blinded_path_ref = tag_ptr(blinded_path_var.inner, false); + return (*env)->NewObject(env, LDKDestination_BlindedPath_class, LDKDestination_BlindedPath_meth, blinded_path_ref); } default: abort(); } } -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); - Str_free(ret_str); - return ret_conv; -} - -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings__1ldk_1c_1bindings_1get_1compiled_1version(JNIEnv *env, jclass clz) { - LDKStr ret_str = _ldk_c_bindings_get_compiled_version(); - 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_BigEndianScalar_1new(JNIEnv *env, jclass clz, int8_tArray big_endian_bytes) { - LDKThirtyTwoBytes big_endian_bytes_ref; - CHECK((*env)->GetArrayLength(env, big_endian_bytes) == 32); - (*env)->GetByteArrayRegion(env, big_endian_bytes, 0, 32, big_endian_bytes_ref.data); - LDKBigEndianScalar* ret_ref = MALLOC(sizeof(LDKBigEndianScalar), "LDKBigEndianScalar"); - *ret_ref = BigEndianScalar_new(big_endian_bytes_ref); - return tag_ptr(ret_ref, true); -} - -static inline uint64_t Bech32Error_clone_ptr(LDKBech32Error *NONNULL_PTR arg) { - LDKBech32Error *ret_copy = MALLOC(sizeof(LDKBech32Error), "LDKBech32Error"); - *ret_copy = Bech32Error_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bech32Error_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBech32Error* arg_conv = (LDKBech32Error*)untag_ptr(arg); - int64_t ret_conv = Bech32Error_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bech32Error_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBech32Error* orig_conv = (LDKBech32Error*)untag_ptr(orig); - LDKBech32Error *ret_copy = MALLOC(sizeof(LDKBech32Error), "LDKBech32Error"); - *ret_copy = Bech32Error_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bech32Error_1free(JNIEnv *env, jclass clz, int64_t o) { - if (!ptr_is_owned(o)) return; - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKBech32Error o_conv = *(LDKBech32Error*)(o_ptr); - FREE(untag_ptr(o)); - Bech32Error_free(o_conv); +static jclass LDKOnionMessageContents_Custom_class = NULL; +static jmethodID LDKOnionMessageContents_Custom_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKOnionMessageContents_init (JNIEnv *env, jclass clz) { + LDKOnionMessageContents_Custom_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKOnionMessageContents$Custom")); + CHECK(LDKOnionMessageContents_Custom_class != NULL); + LDKOnionMessageContents_Custom_meth = (*env)->GetMethodID(env, LDKOnionMessageContents_Custom_class, "", "(J)V"); + CHECK(LDKOnionMessageContents_Custom_meth != NULL); } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Transaction_1free(JNIEnv *env, jclass clz, int8_tArray _res) { - LDKTransaction _res_ref; - _res_ref.datalen = (*env)->GetArrayLength(env, _res); - _res_ref.data = MALLOC(_res_ref.datalen, "LDKTransaction Bytes"); - (*env)->GetByteArrayRegion(env, _res, 0, _res_ref.datalen, _res_ref.data); - _res_ref.data_is_owned = true; - Transaction_free(_res_ref); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKOnionMessageContents_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKOnionMessageContents *obj = (LDKOnionMessageContents*)untag_ptr(ptr); + switch(obj->tag) { + case LDKOnionMessageContents_Custom: { + LDKCustomOnionMessageContents* custom_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents"); + *custom_ret = CustomOnionMessageContents_clone(&obj->custom); + return (*env)->NewObject(env, LDKOnionMessageContents_Custom_class, LDKOnionMessageContents_Custom_meth, tag_ptr(custom_ret, true)); + } + default: abort(); + } } - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1new(JNIEnv *env, jclass clz, int8_tArray script_pubkey, int64_t value) { - LDKCVec_u8Z script_pubkey_ref; - script_pubkey_ref.datalen = (*env)->GetArrayLength(env, script_pubkey); - script_pubkey_ref.data = MALLOC(script_pubkey_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, script_pubkey, 0, script_pubkey_ref.datalen, script_pubkey_ref.data); - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = TxOut_new(script_pubkey_ref, value); - return tag_ptr(ret_ref, true); +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 void JNICALL Java_org_ldk_impl_bindings_TxOut_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKTxOut _res_conv = *(LDKTxOut*)(_res_ptr); - FREE(untag_ptr(_res)); - TxOut_free(_res_conv); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKGossipSync_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKGossipSync *obj = (LDKGossipSync*)untag_ptr(ptr); + switch(obj->tag) { + case LDKGossipSync_P2P: { + LDKP2PGossipSync p2p_var = obj->p2p; + int64_t p2p_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(p2p_var); + p2p_ref = tag_ptr(p2p_var.inner, false); + return (*env)->NewObject(env, LDKGossipSync_P2P_class, LDKGossipSync_P2P_meth, p2p_ref); + } + case LDKGossipSync_Rapid: { + LDKRapidGossipSync rapid_var = obj->rapid; + int64_t rapid_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(rapid_var); + rapid_ref = tag_ptr(rapid_var.inner, false); + return (*env)->NewObject(env, LDKGossipSync_Rapid_class, LDKGossipSync_Rapid_meth, rapid_ref); + } + case LDKGossipSync_None: { + return (*env)->NewObject(env, LDKGossipSync_None_class, LDKGossipSync_None_meth); + } + default: abort(); + } } - -static inline uint64_t TxOut_clone_ptr(LDKTxOut *NONNULL_PTR arg) { - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = TxOut_clone(arg); - return tag_ptr(ret_ref, true); +static jclass LDKFallback_SegWitProgram_class = NULL; +static jmethodID LDKFallback_SegWitProgram_meth = NULL; +static jclass LDKFallback_PubKeyHash_class = NULL; +static jmethodID LDKFallback_PubKeyHash_meth = NULL; +static jclass LDKFallback_ScriptHash_class = NULL; +static jmethodID LDKFallback_ScriptHash_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKFallback_init (JNIEnv *env, jclass clz) { + LDKFallback_SegWitProgram_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKFallback$SegWitProgram")); + CHECK(LDKFallback_SegWitProgram_class != NULL); + LDKFallback_SegWitProgram_meth = (*env)->GetMethodID(env, LDKFallback_SegWitProgram_class, "", "(B[B)V"); + CHECK(LDKFallback_SegWitProgram_meth != NULL); + LDKFallback_PubKeyHash_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKFallback$PubKeyHash")); + CHECK(LDKFallback_PubKeyHash_class != NULL); + LDKFallback_PubKeyHash_meth = (*env)->GetMethodID(env, LDKFallback_PubKeyHash_class, "", "([B)V"); + CHECK(LDKFallback_PubKeyHash_meth != NULL); + LDKFallback_ScriptHash_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKFallback$ScriptHash")); + CHECK(LDKFallback_ScriptHash_class != NULL); + LDKFallback_ScriptHash_meth = (*env)->GetMethodID(env, LDKFallback_ScriptHash_class, "", "([B)V"); + CHECK(LDKFallback_ScriptHash_meth != NULL); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKTxOut* arg_conv = (LDKTxOut*)untag_ptr(arg); - int64_t ret_conv = TxOut_clone_ptr(arg_conv); - return ret_conv; +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFallback_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKFallback *obj = (LDKFallback*)untag_ptr(ptr); + switch(obj->tag) { + case LDKFallback_SegWitProgram: { + uint8_t version_val = obj->seg_wit_program.version._0; + LDKCVec_u8Z program_var = obj->seg_wit_program.program; + int8_tArray program_arr = (*env)->NewByteArray(env, program_var.datalen); + (*env)->SetByteArrayRegion(env, program_arr, 0, program_var.datalen, program_var.data); + return (*env)->NewObject(env, LDKFallback_SegWitProgram_class, LDKFallback_SegWitProgram_meth, version_val, program_arr); + } + case LDKFallback_PubKeyHash: { + int8_tArray pub_key_hash_arr = (*env)->NewByteArray(env, 20); + (*env)->SetByteArrayRegion(env, pub_key_hash_arr, 0, 20, obj->pub_key_hash.data); + return (*env)->NewObject(env, LDKFallback_PubKeyHash_class, LDKFallback_PubKeyHash_meth, pub_key_hash_arr); + } + case LDKFallback_ScriptHash: { + int8_tArray script_hash_arr = (*env)->NewByteArray(env, 20); + (*env)->SetByteArrayRegion(env, script_hash_arr, 0, 20, obj->script_hash.data); + return (*env)->NewObject(env, LDKFallback_ScriptHash_class, LDKFallback_ScriptHash_meth, script_hash_arr); + } + default: abort(); + } } - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKTxOut* orig_conv = (LDKTxOut*)untag_ptr(orig); - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = TxOut_clone(orig_conv); - return tag_ptr(ret_ref, true); +typedef struct LDKPayer_JCalls { + atomic_size_t refcnt; + JavaVM *vm; + jweak o; + jmethodID node_id_meth; + jmethodID first_hops_meth; + jmethodID send_payment_meth; + jmethodID send_spontaneous_payment_meth; + jmethodID retry_payment_meth; + jmethodID abandon_payment_meth; + jmethodID inflight_htlcs_meth; +} LDKPayer_JCalls; +static void LDKPayer_JCalls_free(void* this_arg) { + LDKPayer_JCalls *j_calls = (LDKPayer_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 void JNICALL Java_org_ldk_impl_bindings_Str_1free(JNIEnv *env, jclass clz, jstring _res) { - LDKStr dummy = { .chars = NULL, .len = 0, .chars_is_owned = false }; - Str_free(dummy); +LDKPublicKey node_id_LDKPayer_jcall(const void* this_arg) { + LDKPayer_JCalls *j_calls = (LDKPayer_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->node_id_meth); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to node_id in LDKPayer 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; } - -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"); +LDKCVec_ChannelDetailsZ first_hops_LDKPayer_jcall(const void* this_arg) { + LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg; + JNIEnv *env; + jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); + } else { + DO_ASSERT(get_jenv_res == JNI_OK); + } + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->first_hops_meth); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to first_hops in LDKPayer from rust threw an exception."); + } + LDKCVec_ChannelDetailsZ ret_constr; + ret_constr.datalen = (*env)->GetArrayLength(env, ret); + if (ret_constr.datalen > 0) + ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ 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; + ret_constr.data = NULL; + int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL); + for (size_t q = 0; q < ret_constr.datalen; q++) { + int64_t ret_conv_16 = ret_vals[q]; + LDKChannelDetails ret_conv_16_conv; + ret_conv_16_conv.inner = untag_ptr(ret_conv_16); + ret_conv_16_conv.is_owned = ptr_is_owned(ret_conv_16); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_conv); + ret_constr.data[q] = ret_conv_16_conv; } - CVec_PublicKeyZ_free(_res_constr); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKBlindedRoute o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - // WARNING: we need a move here but no clone is available for LDKBlindedRoute - - LDKCResult_BlindedRouteNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedRouteNoneZ), "LDKCResult_BlindedRouteNoneZ"); - *ret_conv = CResult_BlindedRouteNoneZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_BlindedRouteNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedRouteNoneZ), "LDKCResult_BlindedRouteNoneZ"); - *ret_conv = CResult_BlindedRouteNoneZ_err(); - return tag_ptr(ret_conv, true); + (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } + return ret_constr; } - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_BlindedRouteNoneZ* o_conv = (LDKCResult_BlindedRouteNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_BlindedRouteNoneZ_is_ok(o_conv); +LDKCResult_NonePaymentSendFailureZ send_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_hash, LDKThirtyTwoBytes payment_secret, LDKThirtyTwoBytes payment_id) { + LDKPayer_JCalls *j_calls = (LDKPayer_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); + } + LDKRoute route_var = *route; + int64_t route_ref = 0; + route_var = Route_clone(&route_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var); + route_ref = tag_ptr(route_var.inner, route_var.is_owned); + int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, payment_hash.data); + int8_tArray payment_secret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_secret_arr, 0, 32, payment_secret.data); + int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, payment_id.data); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->send_payment_meth, route_ref, payment_hash_arr, payment_secret_arr, payment_id_arr); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to send_payment in LDKPayer from rust threw an exception."); + } + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_NonePaymentSendFailureZ ret_conv = *(LDKCResult_NonePaymentSendFailureZ*)(ret_ptr); + FREE(untag_ptr(ret)); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } return ret_conv; } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_BlindedRouteNoneZ _res_conv = *(LDKCResult_BlindedRouteNoneZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_BlindedRouteNoneZ_free(_res_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKBlindedRoute o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - // WARNING: we need a move here but no clone is available for LDKBlindedRoute - - LDKCResult_BlindedRouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedRouteDecodeErrorZ), "LDKCResult_BlindedRouteDecodeErrorZ"); - *ret_conv = CResult_BlindedRouteDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); - e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_BlindedRouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedRouteDecodeErrorZ), "LDKCResult_BlindedRouteDecodeErrorZ"); - *ret_conv = CResult_BlindedRouteDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_BlindedRouteDecodeErrorZ* o_conv = (LDKCResult_BlindedRouteDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_BlindedRouteDecodeErrorZ_is_ok(o_conv); +LDKCResult_NonePaymentSendFailureZ send_spontaneous_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_preimage, LDKThirtyTwoBytes payment_id) { + LDKPayer_JCalls *j_calls = (LDKPayer_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); + } + LDKRoute route_var = *route; + int64_t route_ref = 0; + route_var = Route_clone(&route_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var); + route_ref = tag_ptr(route_var.inner, route_var.is_owned); + int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, payment_preimage.data); + int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, payment_id.data); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->send_spontaneous_payment_meth, route_ref, payment_preimage_arr, payment_id_arr); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to send_spontaneous_payment in LDKPayer from rust threw an exception."); + } + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_NonePaymentSendFailureZ ret_conv = *(LDKCResult_NonePaymentSendFailureZ*)(ret_ptr); + FREE(untag_ptr(ret)); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } return ret_conv; } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_BlindedRouteDecodeErrorZ _res_conv = *(LDKCResult_BlindedRouteDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_BlindedRouteDecodeErrorZ_free(_res_conv); +LDKCResult_NonePaymentSendFailureZ retry_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_id) { + LDKPayer_JCalls *j_calls = (LDKPayer_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); + } + LDKRoute route_var = *route; + int64_t route_ref = 0; + route_var = Route_clone(&route_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var); + route_ref = tag_ptr(route_var.inner, route_var.is_owned); + int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, payment_id.data); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->retry_payment_meth, route_ref, payment_id_arr); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to retry_payment in LDKPayer from rust threw an exception."); + } + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_NonePaymentSendFailureZ ret_conv = *(LDKCResult_NonePaymentSendFailureZ*)(ret_ptr); + FREE(untag_ptr(ret)); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } + return ret_conv; +} +void abandon_payment_LDKPayer_jcall(const void* this_arg, LDKThirtyTwoBytes payment_id) { + LDKPayer_JCalls *j_calls = (LDKPayer_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 payment_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, payment_id.data); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + (*env)->CallVoidMethod(env, obj, j_calls->abandon_payment_meth, payment_id_arr); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to abandon_payment in LDKPayer from rust threw an exception."); + } + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } +} +LDKInFlightHtlcs inflight_htlcs_LDKPayer_jcall(const void* this_arg) { + LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg; + JNIEnv *env; + jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); + } else { + DO_ASSERT(get_jenv_res == JNI_OK); + } + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->inflight_htlcs_meth); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to inflight_htlcs in LDKPayer from rust threw an exception."); + } + LDKInFlightHtlcs ret_conv; + ret_conv.inner = untag_ptr(ret); + ret_conv.is_owned = ptr_is_owned(ret); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } + return ret_conv; } +static void LDKPayer_JCalls_cloned(LDKPayer* new_obj) { + LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKPayer LDKPayer_init (JNIEnv *env, jclass clz, jobject o) { + jclass c = (*env)->GetObjectClass(env, o); + CHECK(c != NULL); + LDKPayer_JCalls *calls = MALLOC(sizeof(LDKPayer_JCalls), "LDKPayer_JCalls"); + atomic_init(&calls->refcnt, 1); + DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); + calls->o = (*env)->NewWeakGlobalRef(env, o); + calls->node_id_meth = (*env)->GetMethodID(env, c, "node_id", "()[B"); + CHECK(calls->node_id_meth != NULL); + calls->first_hops_meth = (*env)->GetMethodID(env, c, "first_hops", "()[J"); + CHECK(calls->first_hops_meth != NULL); + calls->send_payment_meth = (*env)->GetMethodID(env, c, "send_payment", "(J[B[B[B)J"); + CHECK(calls->send_payment_meth != NULL); + calls->send_spontaneous_payment_meth = (*env)->GetMethodID(env, c, "send_spontaneous_payment", "(J[B[B)J"); + CHECK(calls->send_spontaneous_payment_meth != NULL); + calls->retry_payment_meth = (*env)->GetMethodID(env, c, "retry_payment", "(J[B)J"); + CHECK(calls->retry_payment_meth != NULL); + calls->abandon_payment_meth = (*env)->GetMethodID(env, c, "abandon_payment", "([B)V"); + CHECK(calls->abandon_payment_meth != NULL); + calls->inflight_htlcs_meth = (*env)->GetMethodID(env, c, "inflight_htlcs", "()J"); + CHECK(calls->inflight_htlcs_meth != NULL); -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKBlindedHop o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - // WARNING: we need a move here but no clone is available for LDKBlindedHop - - LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); - *ret_conv = CResult_BlindedHopDecodeErrorZ_ok(o_conv); + LDKPayer ret = { + .this_arg = (void*) calls, + .node_id = node_id_LDKPayer_jcall, + .first_hops = first_hops_LDKPayer_jcall, + .send_payment = send_payment_LDKPayer_jcall, + .send_spontaneous_payment = send_spontaneous_payment_LDKPayer_jcall, + .retry_payment = retry_payment_LDKPayer_jcall, + .abandon_payment = abandon_payment_LDKPayer_jcall, + .inflight_htlcs = inflight_htlcs_LDKPayer_jcall, + .free = LDKPayer_JCalls_free, + }; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKPayer_1new(JNIEnv *env, jclass clz, jobject o) { + LDKPayer *res_ptr = MALLOC(sizeof(LDKPayer), "LDKPayer"); + *res_ptr = LDKPayer_init(env, clz, o); + return tag_ptr(res_ptr, true); +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Payer_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, (this_arg_conv->node_id)(this_arg_conv->this_arg).compressed_form); + return ret_arr; +} + +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Payer_1first_1hops(JNIEnv *env, jclass clz, int64_t this_arg) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr; + LDKCVec_ChannelDetailsZ ret_var = (this_arg_conv->first_hops)(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 q = 0; q < ret_var.datalen; q++) { + LDKChannelDetails ret_conv_16_var = ret_var.data[q]; + int64_t ret_conv_16_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); + ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned); + 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_Payer_1send_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_hash, int8_tArray payment_secret, int8_tArray payment_id) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr; + LDKRoute route_conv; + route_conv.inner = untag_ptr(route); + route_conv.is_owned = ptr_is_owned(route); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); + route_conv.is_owned = false; + 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); + 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 = (this_arg_conv->send_payment)(this_arg_conv->this_arg, &route_conv, payment_hash_ref, payment_secret_ref, payment_id_ref); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); - e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); - *ret_conv = CResult_BlindedHopDecodeErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payer_1send_1spontaneous_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_preimage, int8_tArray payment_id) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr; + LDKRoute route_conv; + route_conv.inner = untag_ptr(route); + route_conv.is_owned = ptr_is_owned(route); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); + route_conv.is_owned = false; + LDKThirtyTwoBytes payment_preimage_ref; + CHECK((*env)->GetArrayLength(env, payment_preimage) == 32); + (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data); + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); + *ret_conv = (this_arg_conv->send_spontaneous_payment)(this_arg_conv->this_arg, &route_conv, payment_preimage_ref, payment_id_ref); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_BlindedHopDecodeErrorZ* o_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_BlindedHopDecodeErrorZ_is_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payer_1retry_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_id) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr; + LDKRoute route_conv; + route_conv.inner = untag_ptr(route); + route_conv.is_owned = ptr_is_owned(route); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); + route_conv.is_owned = false; + 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 = (this_arg_conv->retry_payment)(this_arg_conv->this_arg, &route_conv, payment_id_ref); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payer_1abandon_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_id) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr; + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + (this_arg_conv->abandon_payment)(this_arg_conv->this_arg, payment_id_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payer_1inflight_1htlcs(JNIEnv *env, jclass clz, int64_t this_arg) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr; + LDKInFlightHtlcs ret_var = (this_arg_conv->inflight_htlcs)(this_arg_conv->this_arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +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*)untag_ptr(ptr); + 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); + Str_free(ret_str); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings__1ldk_1c_1bindings_1get_1compiled_1version(JNIEnv *env, jclass clz) { + LDKStr ret_str = _ldk_c_bindings_get_compiled_version(); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_U128_1le_1bytes(JNIEnv *env, jclass clz, int8_tArray val) { + LDKU128 val_ref; + CHECK((*env)->GetArrayLength(env, val) == 16); + (*env)->GetByteArrayRegion(env, val, 0, 16, val_ref.le_bytes); + int8_tArray ret_arr = (*env)->NewByteArray(env, 16); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 16, U128_le_bytes(val_ref).data); + return ret_arr; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_U128_1new(JNIEnv *env, jclass clz, int8_tArray le_bytes) { + LDKSixteenBytes le_bytes_ref; + CHECK((*env)->GetArrayLength(env, le_bytes) == 16); + (*env)->GetByteArrayRegion(env, le_bytes, 0, 16, le_bytes_ref.data); + int8_tArray ret_arr = (*env)->NewByteArray(env, 16); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 16, U128_new(le_bytes_ref).le_bytes); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BigEndianScalar_1new(JNIEnv *env, jclass clz, int8_tArray big_endian_bytes) { + LDKThirtyTwoBytes big_endian_bytes_ref; + CHECK((*env)->GetArrayLength(env, big_endian_bytes) == 32); + (*env)->GetByteArrayRegion(env, big_endian_bytes, 0, 32, big_endian_bytes_ref.data); + LDKBigEndianScalar* ret_ref = MALLOC(sizeof(LDKBigEndianScalar), "LDKBigEndianScalar"); + *ret_ref = BigEndianScalar_new(big_endian_bytes_ref); + return tag_ptr(ret_ref, true); +} + +static inline uint64_t Bech32Error_clone_ptr(LDKBech32Error *NONNULL_PTR arg) { + LDKBech32Error *ret_copy = MALLOC(sizeof(LDKBech32Error), "LDKBech32Error"); + *ret_copy = Bech32Error_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bech32Error_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBech32Error* arg_conv = (LDKBech32Error*)untag_ptr(arg); + int64_t ret_conv = Bech32Error_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bech32Error_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBech32Error* orig_conv = (LDKBech32Error*)untag_ptr(orig); + LDKBech32Error *ret_copy = MALLOC(sizeof(LDKBech32Error), "LDKBech32Error"); + *ret_copy = Bech32Error_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bech32Error_1free(JNIEnv *env, jclass clz, int64_t o) { + if (!ptr_is_owned(o)) return; + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKBech32Error o_conv = *(LDKBech32Error*)(o_ptr); + FREE(untag_ptr(o)); + Bech32Error_free(o_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Transaction_1free(JNIEnv *env, jclass clz, int8_tArray _res) { + LDKTransaction _res_ref; + _res_ref.datalen = (*env)->GetArrayLength(env, _res); + _res_ref.data = MALLOC(_res_ref.datalen, "LDKTransaction Bytes"); + (*env)->GetByteArrayRegion(env, _res, 0, _res_ref.datalen, _res_ref.data); + _res_ref.data_is_owned = true; + Transaction_free(_res_ref); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Witness_1free(JNIEnv *env, jclass clz, int8_tArray _res) { + LDKWitness _res_ref; + _res_ref.datalen = (*env)->GetArrayLength(env, _res); + _res_ref.data = MALLOC(_res_ref.datalen, "LDKWitness Bytes"); + (*env)->GetByteArrayRegion(env, _res, 0, _res_ref.datalen, _res_ref.data); + _res_ref.data_is_owned = true; + Witness_free(_res_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1new(JNIEnv *env, jclass clz, int8_tArray script_pubkey, int64_t value) { + LDKCVec_u8Z script_pubkey_ref; + script_pubkey_ref.datalen = (*env)->GetArrayLength(env, script_pubkey); + script_pubkey_ref.data = MALLOC(script_pubkey_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, script_pubkey, 0, script_pubkey_ref.datalen, script_pubkey_ref.data); + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = TxOut_new(script_pubkey_ref, value); + return tag_ptr(ret_ref, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_BlindedHopDecodeErrorZ _res_conv = *(LDKCResult_BlindedHopDecodeErrorZ*)(_res_ptr); + LDKTxOut _res_conv = *(LDKTxOut*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_BlindedHopDecodeErrorZ_free(_res_conv); + TxOut_free(_res_conv); +} + +static inline uint64_t TxOut_clone_ptr(LDKTxOut *NONNULL_PTR arg) { + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = TxOut_clone(arg); + return tag_ptr(ret_ref, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKTxOut* arg_conv = (LDKTxOut*)untag_ptr(arg); + int64_t ret_conv = TxOut_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKTxOut* orig_conv = (LDKTxOut*)untag_ptr(orig); + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = TxOut_clone(orig_conv); + return tag_ptr(ret_ref, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Str_1free(JNIEnv *env, jclass clz, jstring _res) { + LDKStr dummy = { .chars = NULL, .len = 0, .chars_is_owned = false }; + Str_free(dummy); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1HTLCClaimZ_1some(JNIEnv *env, jclass clz, jclass o) { + LDKHTLCClaim o_conv = LDKHTLCClaim_from_java(env, o); + LDKCOption_HTLCClaimZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCClaimZ), "LDKCOption_HTLCClaimZ"); + *ret_copy = COption_HTLCClaimZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1HTLCClaimZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_HTLCClaimZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCClaimZ), "LDKCOption_HTLCClaimZ"); + *ret_copy = COption_HTLCClaimZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1HTLCClaimZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_HTLCClaimZ _res_conv = *(LDKCOption_HTLCClaimZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_HTLCClaimZ_free(_res_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1ok(JNIEnv *env, jclass clz) { @@ -15660,104 +16033,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommit return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_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_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ"); - *ret_conv = CResult_SecretKeyErrorZ_ok(o_ref); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { - LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e); - LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ"); - *ret_conv = CResult_SecretKeyErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_SecretKeyErrorZ* o_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_SecretKeyErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_SecretKeyErrorZ _res_conv = *(LDKCResult_SecretKeyErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_SecretKeyErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_SecretKeyErrorZ_clone_ptr(LDKCResult_SecretKeyErrorZ *NONNULL_PTR arg) { - LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ"); - *ret_conv = CResult_SecretKeyErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_SecretKeyErrorZ* arg_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_SecretKeyErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_SecretKeyErrorZ* orig_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(orig); - LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ"); - *ret_conv = CResult_SecretKeyErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) { - LDKPublicKey o_ref; - CHECK((*env)->GetArrayLength(env, o) == 33); - (*env)->GetByteArrayRegion(env, o, 0, 33, o_ref.compressed_form); - LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); - *ret_conv = CResult_PublicKeyErrorZ_ok(o_ref); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { - LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e); - LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); - *ret_conv = CResult_PublicKeyErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_PublicKeyErrorZ* o_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_PublicKeyErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_PublicKeyErrorZ _res_conv = *(LDKCResult_PublicKeyErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_PublicKeyErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_PublicKeyErrorZ_clone_ptr(LDKCResult_PublicKeyErrorZ *NONNULL_PTR arg) { - LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); - *ret_conv = CResult_PublicKeyErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_PublicKeyErrorZ* arg_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_PublicKeyErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_PublicKeyErrorZ* orig_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(orig); - LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); - *ret_conv = CResult_PublicKeyErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKTxCreationKeys o_conv; o_conv.inner = untag_ptr(o); @@ -15866,57 +16141,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysD return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKTxCreationKeys o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = TxCreationKeys_clone(&o_conv); - LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); - *ret_conv = CResult_TxCreationKeysErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { - LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e); - LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); - *ret_conv = CResult_TxCreationKeysErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_TxCreationKeysErrorZ* o_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_TxCreationKeysErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_TxCreationKeysErrorZ _res_conv = *(LDKCResult_TxCreationKeysErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_TxCreationKeysErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_TxCreationKeysErrorZ_clone_ptr(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR arg) { - LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); - *ret_conv = CResult_TxCreationKeysErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_TxCreationKeysErrorZ* arg_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_TxCreationKeysErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_TxCreationKeysErrorZ* orig_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(orig); - LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); - *ret_conv = CResult_TxCreationKeysErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1some(JNIEnv *env, jclass clz, int32_t o) { LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); *ret_copy = COption_u32Z_some(o); @@ -16549,6 +16773,181 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInva return tag_ptr(ret_conv, true); } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PublicKeyZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) { + LDKCVec_PublicKeyZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); + else + _res_constr.data = NULL; + for (size_t i = 0; i < _res_constr.datalen; i++) { + int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i); + LDKPublicKey _res_conv_8_ref; + CHECK((*env)->GetArrayLength(env, _res_conv_8) == 33); + (*env)->GetByteArrayRegion(env, _res_conv_8, 0, 33, _res_conv_8_ref.compressed_form); + _res_constr.data[i] = _res_conv_8_ref; + } + CVec_PublicKeyZ_free(_res_constr); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKBlindedPath o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = BlindedPath_clone(&o_conv); + LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); + *ret_conv = CResult_BlindedPathNoneZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); + *ret_conv = CResult_BlindedPathNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_BlindedPathNoneZ* o_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_BlindedPathNoneZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_BlindedPathNoneZ _res_conv = *(LDKCResult_BlindedPathNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_BlindedPathNoneZ_free(_res_conv); +} + +static inline uint64_t CResult_BlindedPathNoneZ_clone_ptr(LDKCResult_BlindedPathNoneZ *NONNULL_PTR arg) { + LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); + *ret_conv = CResult_BlindedPathNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_BlindedPathNoneZ* arg_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BlindedPathNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_BlindedPathNoneZ* orig_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(orig); + LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); + *ret_conv = CResult_BlindedPathNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKBlindedPath o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = BlindedPath_clone(&o_conv); + LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ"); + *ret_conv = CResult_BlindedPathDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ"); + *ret_conv = CResult_BlindedPathDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_BlindedPathDecodeErrorZ* o_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_BlindedPathDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_BlindedPathDecodeErrorZ _res_conv = *(LDKCResult_BlindedPathDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_BlindedPathDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_BlindedPathDecodeErrorZ_clone_ptr(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ"); + *ret_conv = CResult_BlindedPathDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_BlindedPathDecodeErrorZ* arg_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BlindedPathDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_BlindedPathDecodeErrorZ* orig_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(orig); + LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ"); + *ret_conv = CResult_BlindedPathDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKBlindedHop o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = BlindedHop_clone(&o_conv); + LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); + *ret_conv = CResult_BlindedHopDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); + *ret_conv = CResult_BlindedHopDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_BlindedHopDecodeErrorZ* o_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_BlindedHopDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_BlindedHopDecodeErrorZ _res_conv = *(LDKCResult_BlindedHopDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_BlindedHopDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_BlindedHopDecodeErrorZ_clone_ptr(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); + *ret_conv = CResult_BlindedHopDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_BlindedHopDecodeErrorZ* arg_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BlindedHopDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_BlindedHopDecodeErrorZ* orig_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(orig); + LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); + *ret_conv = CResult_BlindedHopDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1WriteableScoreZ_1some(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -16625,6 +17024,198 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1clone( return tag_ptr(ret_conv, true); } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_ChannelDetailsZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ 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]; + LDKChannelDetails _res_conv_16_conv; + _res_conv_16_conv.inner = untag_ptr(_res_conv_16); + _res_conv_16_conv.is_owned = ptr_is_owned(_res_conv_16); + 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_ChannelDetailsZ_free(_res_constr); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKRoute o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = Route_clone(&o_conv); + LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); + *ret_conv = CResult_RouteLightningErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKLightningError e_conv; + e_conv.inner = untag_ptr(e); + e_conv.is_owned = ptr_is_owned(e); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = LightningError_clone(&e_conv); + LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); + *ret_conv = CResult_RouteLightningErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RouteLightningErrorZ* o_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_RouteLightningErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_RouteLightningErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_RouteLightningErrorZ_clone_ptr(LDKCResult_RouteLightningErrorZ *NONNULL_PTR arg) { + LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); + *ret_conv = CResult_RouteLightningErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RouteLightningErrorZ* arg_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_RouteLightningErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_RouteLightningErrorZ* orig_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(orig); + LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); + *ret_conv = CResult_RouteLightningErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHopZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_RouteHopZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ 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]; + LDKRouteHop _res_conv_10_conv; + _res_conv_10_conv.inner = untag_ptr(_res_conv_10); + _res_conv_10_conv.is_owned = ptr_is_owned(_res_conv_10); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv); + _res_constr.data[k] = _res_conv_10_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_RouteHopZ_free(_res_constr); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1some(JNIEnv *env, jclass clz, int64_t o) { + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = COption_u64Z_some(o); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1none(JNIEnv *env, jclass clz) { + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = COption_u64Z_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_u64Z _res_conv = *(LDKCOption_u64Z*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_u64Z_free(_res_conv); +} + +static inline uint64_t COption_u64Z_clone_ptr(LDKCOption_u64Z *NONNULL_PTR arg) { + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = COption_u64Z_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_u64Z* arg_conv = (LDKCOption_u64Z*)untag_ptr(arg); + int64_t ret_conv = COption_u64Z_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_u64Z* orig_conv = (LDKCOption_u64Z*)untag_ptr(orig); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = COption_u64Z_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKInFlightHtlcs o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = InFlightHtlcs_clone(&o_conv); + LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ"); + *ret_conv = CResult_InFlightHtlcsDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ"); + *ret_conv = CResult_InFlightHtlcsDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InFlightHtlcsDecodeErrorZ* o_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InFlightHtlcsDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_InFlightHtlcsDecodeErrorZ _res_conv = *(LDKCResult_InFlightHtlcsDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_InFlightHtlcsDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_InFlightHtlcsDecodeErrorZ_clone_ptr(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ"); + *ret_conv = CResult_InFlightHtlcsDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_InFlightHtlcsDecodeErrorZ* arg_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_InFlightHtlcsDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_InFlightHtlcsDecodeErrorZ* orig_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(orig); + LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ"); + *ret_conv = CResult_InFlightHtlcsDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKRouteHop o_conv; o_conv.inner = untag_ptr(o); @@ -16679,26 +17270,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErro return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHopZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_RouteHopZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ 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]; - LDKRouteHop _res_conv_10_conv; - _res_conv_10_conv.inner = untag_ptr(_res_conv_10); - _res_conv_10_conv.is_owned = ptr_is_owned(_res_conv_10); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv); - _res_constr.data[k] = _res_conv_10_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_RouteHopZ_free(_res_constr); -} - JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1RouteHopZZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) { LDKCVec_CVec_RouteHopZZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); @@ -16857,49 +17428,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintZ_1free(JNIEnv CVec_RouteHintZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1some(JNIEnv *env, jclass clz, int64_t o) { - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = COption_u64Z_some(o); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1none(JNIEnv *env, jclass clz) { - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = COption_u64Z_none(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCOption_u64Z _res_conv = *(LDKCOption_u64Z*)(_res_ptr); - FREE(untag_ptr(_res)); - COption_u64Z_free(_res_conv); -} - -static inline uint64_t COption_u64Z_clone_ptr(LDKCOption_u64Z *NONNULL_PTR arg) { - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = COption_u64Z_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCOption_u64Z* arg_conv = (LDKCOption_u64Z*)untag_ptr(arg); - int64_t ret_conv = COption_u64Z_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCOption_u64Z* orig_conv = (LDKCOption_u64Z*)untag_ptr(orig); - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = COption_u64Z_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - 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); @@ -17098,81 +17626,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecode return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_ChannelDetailsZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ 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]; - LDKChannelDetails _res_conv_16_conv; - _res_conv_16_conv.inner = untag_ptr(_res_conv_16); - _res_conv_16_conv.is_owned = ptr_is_owned(_res_conv_16); - 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_ChannelDetailsZ_free(_res_constr); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKRoute o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = Route_clone(&o_conv); - LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); - *ret_conv = CResult_RouteLightningErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKLightningError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = LightningError_clone(&e_conv); - LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); - *ret_conv = CResult_RouteLightningErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_RouteLightningErrorZ* o_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_RouteLightningErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_RouteLightningErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_RouteLightningErrorZ_clone_ptr(LDKCResult_RouteLightningErrorZ *NONNULL_PTR arg) { - LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); - *ret_conv = CResult_RouteLightningErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_RouteLightningErrorZ* arg_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_RouteLightningErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_RouteLightningErrorZ* orig_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(orig); - LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); - *ret_conv = CResult_RouteLightningErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -17426,6 +17879,52 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDesti return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u128Z_1some(JNIEnv *env, jclass clz, int8_tArray o) { + LDKU128 o_ref; + CHECK((*env)->GetArrayLength(env, o) == 16); + (*env)->GetByteArrayRegion(env, o, 0, 16, o_ref.le_bytes); + LDKCOption_u128Z *ret_copy = MALLOC(sizeof(LDKCOption_u128Z), "LDKCOption_u128Z"); + *ret_copy = COption_u128Z_some(o_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u128Z_1none(JNIEnv *env, jclass clz) { + LDKCOption_u128Z *ret_copy = MALLOC(sizeof(LDKCOption_u128Z), "LDKCOption_u128Z"); + *ret_copy = COption_u128Z_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u128Z_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_u128Z _res_conv = *(LDKCOption_u128Z*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_u128Z_free(_res_conv); +} + +static inline uint64_t COption_u128Z_clone_ptr(LDKCOption_u128Z *NONNULL_PTR arg) { + LDKCOption_u128Z *ret_copy = MALLOC(sizeof(LDKCOption_u128Z), "LDKCOption_u128Z"); + *ret_copy = COption_u128Z_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u128Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_u128Z* arg_conv = (LDKCOption_u128Z*)untag_ptr(arg); + int64_t ret_conv = COption_u128Z_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u128Z_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_u128Z* orig_conv = (LDKCOption_u128Z*)untag_ptr(orig); + LDKCOption_u128Z *ret_copy = MALLOC(sizeof(LDKCOption_u128Z), "LDKCOption_u128Z"); + *ret_copy = COption_u128Z_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1some(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -17721,21 +18220,63 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1usizeTransactio 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; +static inline uint64_t C2Tuple_TxidBlockHashZ_clone_ptr(LDKC2Tuple_TxidBlockHashZ *NONNULL_PTR arg) { + LDKC2Tuple_TxidBlockHashZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidBlockHashZ), "LDKC2Tuple_TxidBlockHashZ"); + *ret_conv = C2Tuple_TxidBlockHashZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidBlockHashZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_TxidBlockHashZ* arg_conv = (LDKC2Tuple_TxidBlockHashZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_TxidBlockHashZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidBlockHashZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_TxidBlockHashZ* orig_conv = (LDKC2Tuple_TxidBlockHashZ*)untag_ptr(orig); + LDKC2Tuple_TxidBlockHashZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidBlockHashZ), "LDKC2Tuple_TxidBlockHashZ"); + *ret_conv = C2Tuple_TxidBlockHashZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidBlockHashZ_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_TxidBlockHashZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidBlockHashZ), "LDKC2Tuple_TxidBlockHashZ"); + *ret_conv = C2Tuple_TxidBlockHashZ_new(a_ref, b_ref); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidBlockHashZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKC2Tuple_TxidBlockHashZ _res_conv = *(LDKC2Tuple_TxidBlockHashZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_TxidBlockHashZ_free(_res_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidBlockHashZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_TxidBlockHashZZ _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(LDKC2Tuple_TxidBlockHashZ), "LDKCVec_C2Tuple_TxidBlockHashZZ 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; + 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 = untag_ptr(_res_conv_25); + CHECK_ACCESS(_res_conv_25_ptr); + LDKC2Tuple_TxidBlockHashZ _res_conv_25_conv = *(LDKC2Tuple_TxidBlockHashZ*)(_res_conv_25_ptr); + FREE(untag_ptr(_res_conv_25)); + _res_constr.data[z] = _res_conv_25_conv; } - CVec_TxidZ_free(_res_constr); + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_C2Tuple_TxidBlockHashZZ_free(_res_constr); } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorEventZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { @@ -18296,6 +18837,114 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeature return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OfferFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKOfferFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = OfferFeatures_clone(&o_conv); + LDKCResult_OfferFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferFeaturesDecodeErrorZ), "LDKCResult_OfferFeaturesDecodeErrorZ"); + *ret_conv = CResult_OfferFeaturesDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OfferFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_OfferFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferFeaturesDecodeErrorZ), "LDKCResult_OfferFeaturesDecodeErrorZ"); + *ret_conv = CResult_OfferFeaturesDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OfferFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_OfferFeaturesDecodeErrorZ* o_conv = (LDKCResult_OfferFeaturesDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OfferFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OfferFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_OfferFeaturesDecodeErrorZ _res_conv = *(LDKCResult_OfferFeaturesDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_OfferFeaturesDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_OfferFeaturesDecodeErrorZ_clone_ptr(LDKCResult_OfferFeaturesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OfferFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferFeaturesDecodeErrorZ), "LDKCResult_OfferFeaturesDecodeErrorZ"); + *ret_conv = CResult_OfferFeaturesDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OfferFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_OfferFeaturesDecodeErrorZ* arg_conv = (LDKCResult_OfferFeaturesDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OfferFeaturesDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OfferFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_OfferFeaturesDecodeErrorZ* orig_conv = (LDKCResult_OfferFeaturesDecodeErrorZ*)untag_ptr(orig); + LDKCResult_OfferFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferFeaturesDecodeErrorZ), "LDKCResult_OfferFeaturesDecodeErrorZ"); + *ret_conv = CResult_OfferFeaturesDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKInvoiceRequestFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = InvoiceRequestFeatures_clone(&o_conv); + LDKCResult_InvoiceRequestFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestFeaturesDecodeErrorZ), "LDKCResult_InvoiceRequestFeaturesDecodeErrorZ"); + *ret_conv = CResult_InvoiceRequestFeaturesDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_InvoiceRequestFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestFeaturesDecodeErrorZ), "LDKCResult_InvoiceRequestFeaturesDecodeErrorZ"); + *ret_conv = CResult_InvoiceRequestFeaturesDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InvoiceRequestFeaturesDecodeErrorZ* o_conv = (LDKCResult_InvoiceRequestFeaturesDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceRequestFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_InvoiceRequestFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InvoiceRequestFeaturesDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_InvoiceRequestFeaturesDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_InvoiceRequestFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InvoiceRequestFeaturesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_InvoiceRequestFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestFeaturesDecodeErrorZ), "LDKCResult_InvoiceRequestFeaturesDecodeErrorZ"); + *ret_conv = CResult_InvoiceRequestFeaturesDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_InvoiceRequestFeaturesDecodeErrorZ* arg_conv = (LDKCResult_InvoiceRequestFeaturesDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_InvoiceRequestFeaturesDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_InvoiceRequestFeaturesDecodeErrorZ* orig_conv = (LDKCResult_InvoiceRequestFeaturesDecodeErrorZ*)untag_ptr(orig); + LDKCResult_InvoiceRequestFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestFeaturesDecodeErrorZ), "LDKCResult_InvoiceRequestFeaturesDecodeErrorZ"); + *ret_conv = CResult_InvoiceRequestFeaturesDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + 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 = untag_ptr(o); @@ -19707,21 +20356,21 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1 return tag_ptr(ret_conv, true); } -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_1U5Z_1free(JNIEnv *env, jclass clz, jobjectArray _res) { + LDKCVec_U5Z _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKU5), "LDKCVec_U5Z Elements"); else _res_constr.data = NULL; int8_t* _res_vals = (*env)->GetByteArrayElements (env, _res, NULL); for (size_t h = 0; h < _res_constr.datalen; h++) { int8_t _res_conv_7 = _res_vals[h]; - _res_constr.data[h] = (LDKu5){ ._0 = _res_conv_7 }; + _res_constr.data[h] = (LDKU5){ ._0 = _res_conv_7 }; } (*env)->ReleaseByteArrayElements(env, _res, _res_vals, 0); - CVec_u5Z_free(_res_constr); + CVec_U5Z_free(_res_constr); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) { @@ -20288,104 +20937,104 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1c return tag_ptr(ret_conv, true); } -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); +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 tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr); e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e)); - LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); - *ret_conv = CResult_PaymentIdPaymentSendFailureZ_err(e_conv); + LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); + *ret_conv = CResult_NonePaymentSendFailureZ_err(e_conv); return tag_ptr(ret_conv, true); } -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*)untag_ptr(o); - jboolean ret_conv = CResult_PaymentIdPaymentSendFailureZ_is_ok(o_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*)untag_ptr(o); + jboolean ret_conv = CResult_NonePaymentSendFailureZ_is_ok(o_conv); return 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_CResult_1NonePaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_PaymentIdPaymentSendFailureZ _res_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(_res_ptr); + LDKCResult_NonePaymentSendFailureZ _res_conv = *(LDKCResult_NonePaymentSendFailureZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PaymentIdPaymentSendFailureZ_free(_res_conv); + CResult_NonePaymentSendFailureZ_free(_res_conv); } -static inline uint64_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); +static inline uint64_t CResult_NonePaymentSendFailureZ_clone_ptr(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR arg) { + LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); + *ret_conv = CResult_NonePaymentSendFailureZ_clone(arg); return tag_ptr(ret_conv, true); } -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*)untag_ptr(arg); - int64_t ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone_ptr(arg_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*)untag_ptr(arg); + int64_t ret_conv = CResult_NonePaymentSendFailureZ_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*)untag_ptr(orig); - LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); - *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_NonePaymentSendFailureZ* orig_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(orig); + LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); + *ret_conv = CResult_NonePaymentSendFailureZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -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_1PaymentHashPaymentSendFailureZ_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_PaymentHashPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashPaymentSendFailureZ), "LDKCResult_PaymentHashPaymentSendFailureZ"); + *ret_conv = CResult_PaymentHashPaymentSendFailureZ_ok(o_ref); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr); e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e)); - LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); - *ret_conv = CResult_NonePaymentSendFailureZ_err(e_conv); + LDKCResult_PaymentHashPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashPaymentSendFailureZ), "LDKCResult_PaymentHashPaymentSendFailureZ"); + *ret_conv = CResult_PaymentHashPaymentSendFailureZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_NonePaymentSendFailureZ* o_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(o); - jboolean ret_conv = CResult_NonePaymentSendFailureZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PaymentHashPaymentSendFailureZ* o_conv = (LDKCResult_PaymentHashPaymentSendFailureZ*)untag_ptr(o); + jboolean ret_conv = CResult_PaymentHashPaymentSendFailureZ_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_1PaymentHashPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_NonePaymentSendFailureZ _res_conv = *(LDKCResult_NonePaymentSendFailureZ*)(_res_ptr); + LDKCResult_PaymentHashPaymentSendFailureZ _res_conv = *(LDKCResult_PaymentHashPaymentSendFailureZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_NonePaymentSendFailureZ_free(_res_conv); + CResult_PaymentHashPaymentSendFailureZ_free(_res_conv); } -static inline uint64_t CResult_NonePaymentSendFailureZ_clone_ptr(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR arg) { - LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); - *ret_conv = CResult_NonePaymentSendFailureZ_clone(arg); +static inline uint64_t CResult_PaymentHashPaymentSendFailureZ_clone_ptr(LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR arg) { + LDKCResult_PaymentHashPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashPaymentSendFailureZ), "LDKCResult_PaymentHashPaymentSendFailureZ"); + *ret_conv = CResult_PaymentHashPaymentSendFailureZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_NonePaymentSendFailureZ* arg_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(arg); - int64_t ret_conv = CResult_NonePaymentSendFailureZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PaymentHashPaymentSendFailureZ* arg_conv = (LDKCResult_PaymentHashPaymentSendFailureZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PaymentHashPaymentSendFailureZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_NonePaymentSendFailureZ* orig_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(orig); - LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); - *ret_conv = CResult_NonePaymentSendFailureZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_PaymentHashPaymentSendFailureZ* orig_conv = (LDKCResult_PaymentHashPaymentSendFailureZ*)untag_ptr(orig); + LDKCResult_PaymentHashPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashPaymentSendFailureZ), "LDKCResult_PaymentHashPaymentSendFailureZ"); + *ret_conv = CResult_PaymentHashPaymentSendFailureZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -21349,612 +21998,148 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentEr return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKInFlightHtlcs o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - // WARNING: we need a move here but no clone is available for LDKInFlightHtlcs - - LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ"); - *ret_conv = CResult_InFlightHtlcsDecodeErrorZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1ok(JNIEnv *env, jclass clz) { + LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ"); + *ret_conv = CResult_NonePaymentErrorZ_ok(); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); - LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); - e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ"); - *ret_conv = CResult_InFlightHtlcsDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_InFlightHtlcsDecodeErrorZ* o_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_InFlightHtlcsDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_InFlightHtlcsDecodeErrorZ _res_conv = *(LDKCResult_InFlightHtlcsDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_InFlightHtlcsDecodeErrorZ_free(_res_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 tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKParseError e_conv = *(LDKParseError*)(e_ptr); - e_conv = ParseError_clone((LDKParseError*)untag_ptr(e)); - LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ"); - *ret_conv = CResult_SiPrefixParseErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -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*)untag_ptr(o); - jboolean ret_conv = CResult_SiPrefixParseErrorZ_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) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_SiPrefixParseErrorZ _res_conv = *(LDKCResult_SiPrefixParseErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_SiPrefixParseErrorZ_free(_res_conv); -} - -static inline uint64_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 tag_ptr(ret_conv, true); -} -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*)untag_ptr(arg); - int64_t ret_conv = CResult_SiPrefixParseErrorZ_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*)untag_ptr(orig); - LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ"); - *ret_conv = CResult_SiPrefixParseErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -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 = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - 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); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKParseOrSemanticError e_conv = *(LDKParseOrSemanticError*)(e_ptr); - e_conv = ParseOrSemanticError_clone((LDKParseOrSemanticError*)untag_ptr(e)); - LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ"); - *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -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*)untag_ptr(o); - jboolean ret_conv = CResult_InvoiceParseOrSemanticErrorZ_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) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_InvoiceParseOrSemanticErrorZ _res_conv = *(LDKCResult_InvoiceParseOrSemanticErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_InvoiceParseOrSemanticErrorZ_free(_res_conv); -} - -static inline uint64_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 tag_ptr(ret_conv, true); -} -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*)untag_ptr(arg); - int64_t ret_conv = CResult_InvoiceParseOrSemanticErrorZ_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*)untag_ptr(orig); - LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ"); - *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -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 = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - 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 tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKParseError e_conv = *(LDKParseError*)(e_ptr); - e_conv = ParseError_clone((LDKParseError*)untag_ptr(e)); - LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ"); - *ret_conv = CResult_SignedRawInvoiceParseErrorZ_err(e_conv); + LDKPaymentError e_conv = *(LDKPaymentError*)(e_ptr); + e_conv = PaymentError_clone((LDKPaymentError*)untag_ptr(e)); + LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ"); + *ret_conv = CResult_NonePaymentErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -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*)untag_ptr(o); - jboolean ret_conv = CResult_SignedRawInvoiceParseErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NonePaymentErrorZ* o_conv = (LDKCResult_NonePaymentErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_NonePaymentErrorZ_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_1NonePaymentErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_SignedRawInvoiceParseErrorZ _res_conv = *(LDKCResult_SignedRawInvoiceParseErrorZ*)(_res_ptr); + LDKCResult_NonePaymentErrorZ _res_conv = *(LDKCResult_NonePaymentErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_SignedRawInvoiceParseErrorZ_free(_res_conv); + CResult_NonePaymentErrorZ_free(_res_conv); } -static inline uint64_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 uint64_t CResult_NonePaymentErrorZ_clone_ptr(LDKCResult_NonePaymentErrorZ *NONNULL_PTR arg) { + LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ"); + *ret_conv = CResult_NonePaymentErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -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*)untag_ptr(arg); - int64_t ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NonePaymentErrorZ* arg_conv = (LDKCResult_NonePaymentErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_NonePaymentErrorZ_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*)untag_ptr(orig); - LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ"); - *ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -static inline uint64_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 tag_ptr(ret_conv, true); -} -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*)untag_ptr(arg); - 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*)untag_ptr(orig); - LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); - *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -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 = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - 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 = untag_ptr(c); - c_conv.is_owned = ptr_is_owned(c); - 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); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_NonePaymentErrorZ* orig_conv = (LDKCResult_NonePaymentErrorZ*)untag_ptr(orig); + LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ"); + *ret_conv = CResult_NonePaymentErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res_conv = *(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(_res_ptr); - FREE(untag_ptr(_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; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - 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); +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 tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { +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_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); - *ret_conv = CResult_PayeePubKeyErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -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*)untag_ptr(o); - jboolean ret_conv = CResult_PayeePubKeyErrorZ_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) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_PayeePubKeyErrorZ _res_conv = *(LDKCResult_PayeePubKeyErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_PayeePubKeyErrorZ_free(_res_conv); -} - -static inline uint64_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 tag_ptr(ret_conv, true); -} -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*)untag_ptr(arg); - 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*)untag_ptr(orig); - LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); - *ret_conv = CResult_PayeePubKeyErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -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 = untag_ptr(_res_conv_14); - _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv); - _res_constr.data[o] = _res_conv_14_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_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; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - 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 tag_ptr(ret_conv, true); -} - -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 tag_ptr(ret_conv, true); -} - -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*)untag_ptr(o); - jboolean ret_conv = CResult_PositiveTimestampCreationErrorZ_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) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_PositiveTimestampCreationErrorZ _res_conv = *(LDKCResult_PositiveTimestampCreationErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_PositiveTimestampCreationErrorZ_free(_res_conv); -} - -static inline uint64_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 tag_ptr(ret_conv, true); -} -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*)untag_ptr(arg); - int64_t ret_conv = CResult_PositiveTimestampCreationErrorZ_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*)untag_ptr(orig); - LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); - *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -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 tag_ptr(ret_conv, true); -} - -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 tag_ptr(ret_conv, true); -} - -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*)untag_ptr(o); - 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 (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_NoneSemanticErrorZ _res_conv = *(LDKCResult_NoneSemanticErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_NoneSemanticErrorZ_free(_res_conv); -} - -static inline uint64_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 tag_ptr(ret_conv, true); -} -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*)untag_ptr(arg); - int64_t ret_conv = CResult_NoneSemanticErrorZ_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*)untag_ptr(orig); - LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); - *ret_conv = CResult_NoneSemanticErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -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 = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - 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 tag_ptr(ret_conv, true); -} - -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 tag_ptr(ret_conv, true); -} - -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*)untag_ptr(o); - jboolean ret_conv = CResult_InvoiceSemanticErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_InvoiceSemanticErrorZ _res_conv = *(LDKCResult_InvoiceSemanticErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_InvoiceSemanticErrorZ_free(_res_conv); -} - -static inline uint64_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 tag_ptr(ret_conv, true); -} -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*)untag_ptr(arg); - int64_t ret_conv = CResult_InvoiceSemanticErrorZ_clone_ptr(arg_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*)untag_ptr(orig); - LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); - *ret_conv = CResult_InvoiceSemanticErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -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 = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - 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 tag_ptr(ret_conv, true); -} - -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 tag_ptr(ret_conv, true); -} - -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*)untag_ptr(o); - jboolean ret_conv = CResult_DescriptionCreationErrorZ_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) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_DescriptionCreationErrorZ _res_conv = *(LDKCResult_DescriptionCreationErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_DescriptionCreationErrorZ_free(_res_conv); -} - -static inline uint64_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 tag_ptr(ret_conv, true); -} -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*)untag_ptr(arg); - int64_t ret_conv = CResult_DescriptionCreationErrorZ_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*)untag_ptr(orig); - LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); - *ret_conv = CResult_DescriptionCreationErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -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 = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - 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 tag_ptr(ret_conv, true); -} - -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); + LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ"); + *ret_conv = CResult_StringErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -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*)untag_ptr(o); - jboolean ret_conv = CResult_PrivateRouteCreationErrorZ_is_ok(o_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*)untag_ptr(o); + jboolean ret_conv = CResult_StringErrorZ_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_1StringErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_PrivateRouteCreationErrorZ _res_conv = *(LDKCResult_PrivateRouteCreationErrorZ*)(_res_ptr); + LDKCResult_StringErrorZ _res_conv = *(LDKCResult_StringErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PrivateRouteCreationErrorZ_free(_res_conv); + CResult_StringErrorZ_free(_res_conv); } -static inline uint64_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 uint64_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 tag_ptr(ret_conv, true); } -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*)untag_ptr(arg); - int64_t ret_conv = CResult_PrivateRouteCreationErrorZ_clone_ptr(arg_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*)untag_ptr(arg); + int64_t ret_conv = CResult_StringErrorZ_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*)untag_ptr(orig); - 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_1StringErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_StringErrorZ* orig_conv = (LDKCResult_StringErrorZ*)untag_ptr(orig); + LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ"); + *ret_conv = CResult_StringErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -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); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) { + LDKPublicKey o_ref; + CHECK((*env)->GetArrayLength(env, o) == 33); + (*env)->GetByteArrayRegion(env, o, 0, 33, o_ref.compressed_form); + LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); + *ret_conv = CResult_PublicKeyErrorZ_ok(o_ref); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_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); + LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); + *ret_conv = CResult_PublicKeyErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -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*)untag_ptr(o); - jboolean ret_conv = CResult_StringErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PublicKeyErrorZ* o_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_PublicKeyErrorZ_is_ok(o_conv); return ret_conv; } -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_CResult_1PublicKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_StringErrorZ _res_conv = *(LDKCResult_StringErrorZ*)(_res_ptr); + LDKCResult_PublicKeyErrorZ _res_conv = *(LDKCResult_PublicKeyErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_StringErrorZ_free(_res_conv); + CResult_PublicKeyErrorZ_free(_res_conv); } -static inline uint64_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); +static inline uint64_t CResult_PublicKeyErrorZ_clone_ptr(LDKCResult_PublicKeyErrorZ *NONNULL_PTR arg) { + LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); + *ret_conv = CResult_PublicKeyErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -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*)untag_ptr(arg); - int64_t ret_conv = CResult_StringErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PublicKeyErrorZ* arg_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PublicKeyErrorZ_clone_ptr(arg_conv); return ret_conv; } -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*)untag_ptr(orig); - LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ"); - *ret_conv = CResult_StringErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_PublicKeyErrorZ* orig_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(orig); + LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); + *ret_conv = CResult_PublicKeyErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -22655,325 +22840,850 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessage return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1none(JNIEnv *env, jclass clz) { - LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ"); - *ret_copy = COption_CustomOnionMessageContentsZ_none(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ"); + *ret_copy = COption_CustomOnionMessageContentsZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_CustomOnionMessageContentsZ _res_conv = *(LDKCOption_CustomOnionMessageContentsZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_CustomOnionMessageContentsZ_free(_res_conv); +} + +static inline uint64_t COption_CustomOnionMessageContentsZ_clone_ptr(LDKCOption_CustomOnionMessageContentsZ *NONNULL_PTR arg) { + LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ"); + *ret_copy = COption_CustomOnionMessageContentsZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_CustomOnionMessageContentsZ* arg_conv = (LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(arg); + int64_t ret_conv = COption_CustomOnionMessageContentsZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_CustomOnionMessageContentsZ* orig_conv = (LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(orig); + LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ"); + *ret_copy = COption_CustomOnionMessageContentsZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKCOption_CustomOnionMessageContentsZ o_conv = *(LDKCOption_CustomOnionMessageContentsZ*)(o_ptr); + o_conv = COption_CustomOnionMessageContentsZ_clone((LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(o)); + LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ"); + *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ"); + *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* o_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ _res_conv = *(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ"); + *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* arg_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* orig_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(orig); + LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ"); + *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1some(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr); + o_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(o)); + LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ"); + *ret_copy = COption_NetAddressZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_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 = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_NetAddressZ _res_conv = *(LDKCOption_NetAddressZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_NetAddressZ_free(_res_conv); +} + +static inline uint64_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 = tag_ptr(ret_copy, true); + 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*)untag_ptr(arg); + int64_t ret_conv = COption_NetAddressZ_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*)untag_ptr(orig); + LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ"); + *ret_copy = COption_NetAddressZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_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 tag_ptr(ret_conv, true); +} + +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 = untag_ptr(e); + e_conv.is_owned = ptr_is_owned(e); + 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); + return tag_ptr(ret_conv, true); +} + +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*)untag_ptr(o); + jboolean ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_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) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_CVec_u8ZPeerHandleErrorZ _res_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_CVec_u8ZPeerHandleErrorZ_free(_res_conv); +} + +static inline uint64_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 tag_ptr(ret_conv, true); +} +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*)untag_ptr(arg); + int64_t ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_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*)untag_ptr(orig); + LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); + *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +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 tag_ptr(ret_conv, true); +} + +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 = untag_ptr(e); + e_conv.is_owned = ptr_is_owned(e); + 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); + return tag_ptr(ret_conv, true); +} + +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*)untag_ptr(o); + jboolean ret_conv = CResult_NonePeerHandleErrorZ_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) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_NonePeerHandleErrorZ _res_conv = *(LDKCResult_NonePeerHandleErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_NonePeerHandleErrorZ_free(_res_conv); +} + +static inline uint64_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 tag_ptr(ret_conv, true); +} +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*)untag_ptr(arg); + int64_t ret_conv = CResult_NonePeerHandleErrorZ_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*)untag_ptr(orig); + LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); + *ret_conv = CResult_NonePeerHandleErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +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 tag_ptr(ret_conv, true); +} + +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 = untag_ptr(e); + e_conv.is_owned = ptr_is_owned(e); + 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 tag_ptr(ret_conv, true); +} + +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*)untag_ptr(o); + 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 (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_boolPeerHandleErrorZ _res_conv = *(LDKCResult_boolPeerHandleErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_boolPeerHandleErrorZ_free(_res_conv); +} + +static inline uint64_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 tag_ptr(ret_conv, true); +} +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*)untag_ptr(arg); + int64_t ret_conv = CResult_boolPeerHandleErrorZ_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*)untag_ptr(orig); + LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); + *ret_conv = CResult_boolPeerHandleErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1ok(JNIEnv *env, jclass clz) { + LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ"); + *ret_conv = CResult_NoneSendErrorZ_ok(); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKSendError e_conv = *(LDKSendError*)(e_ptr); + e_conv = SendError_clone((LDKSendError*)untag_ptr(e)); + LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ"); + *ret_conv = CResult_NoneSendErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneSendErrorZ* o_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_NoneSendErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_NoneSendErrorZ _res_conv = *(LDKCResult_NoneSendErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_NoneSendErrorZ_free(_res_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 tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKParseError e_conv = *(LDKParseError*)(e_ptr); + e_conv = ParseError_clone((LDKParseError*)untag_ptr(e)); + LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ"); + *ret_conv = CResult_SiPrefixParseErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +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*)untag_ptr(o); + jboolean ret_conv = CResult_SiPrefixParseErrorZ_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) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_SiPrefixParseErrorZ _res_conv = *(LDKCResult_SiPrefixParseErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_SiPrefixParseErrorZ_free(_res_conv); +} + +static inline uint64_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 tag_ptr(ret_conv, true); +} +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*)untag_ptr(arg); + int64_t ret_conv = CResult_SiPrefixParseErrorZ_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*)untag_ptr(orig); + LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ"); + *ret_conv = CResult_SiPrefixParseErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +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 = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + 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); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKParseOrSemanticError e_conv = *(LDKParseOrSemanticError*)(e_ptr); + e_conv = ParseOrSemanticError_clone((LDKParseOrSemanticError*)untag_ptr(e)); + LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ"); + *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +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*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceParseOrSemanticErrorZ_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) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_InvoiceParseOrSemanticErrorZ _res_conv = *(LDKCResult_InvoiceParseOrSemanticErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_InvoiceParseOrSemanticErrorZ_free(_res_conv); +} + +static inline uint64_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 tag_ptr(ret_conv, true); +} +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*)untag_ptr(arg); + int64_t ret_conv = CResult_InvoiceParseOrSemanticErrorZ_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*)untag_ptr(orig); + LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ"); + *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +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 = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + 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 tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKParseError e_conv = *(LDKParseError*)(e_ptr); + e_conv = ParseError_clone((LDKParseError*)untag_ptr(e)); + LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ"); + *ret_conv = CResult_SignedRawInvoiceParseErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +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*)untag_ptr(o); + jboolean ret_conv = CResult_SignedRawInvoiceParseErrorZ_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) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_SignedRawInvoiceParseErrorZ _res_conv = *(LDKCResult_SignedRawInvoiceParseErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_SignedRawInvoiceParseErrorZ_free(_res_conv); +} + +static inline uint64_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 tag_ptr(ret_conv, true); +} +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*)untag_ptr(arg); + 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*)untag_ptr(orig); + LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ"); + *ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +static inline uint64_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 tag_ptr(ret_conv, true); +} +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*)untag_ptr(arg); + 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*)untag_ptr(orig); + LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); + *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +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 = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + 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 = untag_ptr(c); + c_conv.is_owned = ptr_is_owned(c); + 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 tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_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 (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCOption_CustomOnionMessageContentsZ _res_conv = *(LDKCOption_CustomOnionMessageContentsZ*)(_res_ptr); + LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res_conv = *(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_CustomOnionMessageContentsZ_free(_res_conv); -} - -static inline uint64_t COption_CustomOnionMessageContentsZ_clone_ptr(LDKCOption_CustomOnionMessageContentsZ *NONNULL_PTR arg) { - LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ"); - *ret_copy = COption_CustomOnionMessageContentsZ_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCOption_CustomOnionMessageContentsZ* arg_conv = (LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(arg); - int64_t ret_conv = COption_CustomOnionMessageContentsZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCOption_CustomOnionMessageContentsZ* orig_conv = (LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(orig); - LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ"); - *ret_copy = COption_CustomOnionMessageContentsZ_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(_res_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKCOption_CustomOnionMessageContentsZ o_conv = *(LDKCOption_CustomOnionMessageContentsZ*)(o_ptr); - o_conv = COption_CustomOnionMessageContentsZ_clone((LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(o)); - LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ"); - *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_ok(o_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 = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + 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 tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); - e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ"); - *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_err(e_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 tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* o_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_is_ok(o_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*)untag_ptr(o); + jboolean ret_conv = CResult_PayeePubKeyErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_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 (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ _res_conv = *(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)(_res_ptr); + LDKCResult_PayeePubKeyErrorZ _res_conv = *(LDKCResult_PayeePubKeyErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_free(_res_conv); + CResult_PayeePubKeyErrorZ_free(_res_conv); } -static inline uint64_t CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ"); - *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone(arg); +static inline uint64_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 tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* arg_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr(arg_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*)untag_ptr(arg); + int64_t ret_conv = CResult_PayeePubKeyErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* orig_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(orig); - LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ"); - *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone(orig_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*)untag_ptr(orig); + LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); + *ret_conv = CResult_PayeePubKeyErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1some(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr); - o_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(o)); - LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ"); - *ret_copy = COption_NetAddressZ_some(o_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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 = untag_ptr(_res_conv_14); + _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv); + _res_constr.data[o] = _res_conv_14_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_PrivateRouteZ_free(_res_constr); } -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 = tag_ptr(ret_copy, true); - return ret_ref; +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 = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + 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 tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +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 tag_ptr(ret_conv, true); +} + +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*)untag_ptr(o); + jboolean ret_conv = CResult_PositiveTimestampCreationErrorZ_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) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCOption_NetAddressZ _res_conv = *(LDKCOption_NetAddressZ*)(_res_ptr); + LDKCResult_PositiveTimestampCreationErrorZ _res_conv = *(LDKCResult_PositiveTimestampCreationErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_NetAddressZ_free(_res_conv); + CResult_PositiveTimestampCreationErrorZ_free(_res_conv); } -static inline uint64_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 = tag_ptr(ret_copy, true); - return ret_ref; +static inline uint64_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 tag_ptr(ret_conv, true); } -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*)untag_ptr(arg); - int64_t ret_conv = COption_NetAddressZ_clone_ptr(arg_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*)untag_ptr(arg); + int64_t ret_conv = CResult_PositiveTimestampCreationErrorZ_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*)untag_ptr(orig); - LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ"); - *ret_copy = COption_NetAddressZ_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_PositiveTimestampCreationErrorZ* orig_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(orig); + LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); + *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -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_1NoneSemanticErrorZ_1ok(JNIEnv *env, jclass clz) { + LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); + *ret_conv = CResult_NoneSemanticErrorZ_ok(); return tag_ptr(ret_conv, true); } -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 = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - 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); +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 tag_ptr(ret_conv, true); } -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*)untag_ptr(o); - jboolean ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_is_ok(o_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*)untag_ptr(o); + jboolean ret_conv = CResult_NoneSemanticErrorZ_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_1NoneSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_CVec_u8ZPeerHandleErrorZ _res_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)(_res_ptr); + LDKCResult_NoneSemanticErrorZ _res_conv = *(LDKCResult_NoneSemanticErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_CVec_u8ZPeerHandleErrorZ_free(_res_conv); + CResult_NoneSemanticErrorZ_free(_res_conv); } -static inline uint64_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 uint64_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 tag_ptr(ret_conv, true); } -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*)untag_ptr(arg); - int64_t ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(arg_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*)untag_ptr(arg); + int64_t ret_conv = CResult_NoneSemanticErrorZ_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*)untag_ptr(orig); - 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_1NoneSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_NoneSemanticErrorZ* orig_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(orig); + LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); + *ret_conv = CResult_NoneSemanticErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -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_1InvoiceSemanticErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKInvoice o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + 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 tag_ptr(ret_conv, true); } -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 = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - 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); +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 tag_ptr(ret_conv, true); } -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*)untag_ptr(o); - jboolean ret_conv = CResult_NonePeerHandleErrorZ_is_ok(o_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*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceSemanticErrorZ_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_1InvoiceSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_NonePeerHandleErrorZ _res_conv = *(LDKCResult_NonePeerHandleErrorZ*)(_res_ptr); + LDKCResult_InvoiceSemanticErrorZ _res_conv = *(LDKCResult_InvoiceSemanticErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_NonePeerHandleErrorZ_free(_res_conv); + CResult_InvoiceSemanticErrorZ_free(_res_conv); } -static inline uint64_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 uint64_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 tag_ptr(ret_conv, true); } -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*)untag_ptr(arg); - int64_t ret_conv = CResult_NonePeerHandleErrorZ_clone_ptr(arg_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*)untag_ptr(arg); + int64_t ret_conv = CResult_InvoiceSemanticErrorZ_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*)untag_ptr(orig); - 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_1InvoiceSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_InvoiceSemanticErrorZ* orig_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(orig); + LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); + *ret_conv = CResult_InvoiceSemanticErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -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); +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 = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + 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 tag_ptr(ret_conv, true); } -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 = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - 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); +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 tag_ptr(ret_conv, true); } -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*)untag_ptr(o); - jboolean ret_conv = CResult_boolPeerHandleErrorZ_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*)untag_ptr(o); + jboolean ret_conv = CResult_DescriptionCreationErrorZ_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) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_boolPeerHandleErrorZ _res_conv = *(LDKCResult_boolPeerHandleErrorZ*)(_res_ptr); + LDKCResult_DescriptionCreationErrorZ _res_conv = *(LDKCResult_DescriptionCreationErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_boolPeerHandleErrorZ_free(_res_conv); + CResult_DescriptionCreationErrorZ_free(_res_conv); } -static inline uint64_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); +static inline uint64_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 tag_ptr(ret_conv, true); } -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*)untag_ptr(arg); - int64_t ret_conv = CResult_boolPeerHandleErrorZ_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*)untag_ptr(arg); + int64_t ret_conv = CResult_DescriptionCreationErrorZ_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*)untag_ptr(orig); - LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); - *ret_conv = CResult_boolPeerHandleErrorZ_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*)untag_ptr(orig); + LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); + *ret_conv = CResult_DescriptionCreationErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1ok(JNIEnv *env, jclass clz) { - LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ"); - *ret_conv = CResult_NoneSendErrorZ_ok(); +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 = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + 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 tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKSendError e_conv = *(LDKSendError*)(e_ptr); - e_conv = SendError_clone((LDKSendError*)untag_ptr(e)); - LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ"); - *ret_conv = CResult_NoneSendErrorZ_err(e_conv); +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 tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_NoneSendErrorZ* o_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_NoneSendErrorZ_is_ok(o_conv); +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*)untag_ptr(o); + jboolean ret_conv = CResult_PrivateRouteCreationErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_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 (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_NoneSendErrorZ _res_conv = *(LDKCResult_NoneSendErrorZ*)(_res_ptr); + LDKCResult_PrivateRouteCreationErrorZ _res_conv = *(LDKCResult_PrivateRouteCreationErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_NoneSendErrorZ_free(_res_conv); + CResult_PrivateRouteCreationErrorZ_free(_res_conv); +} + +static inline uint64_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 tag_ptr(ret_conv, true); +} +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*)untag_ptr(arg); + int64_t ret_conv = CResult_PrivateRouteCreationErrorZ_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*)untag_ptr(orig); + LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); + *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1ok(JNIEnv *env, jclass clz, int32_t o) { @@ -25133,6 +25843,101 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1OutPointZ_1free(JNIEnv * CVec_OutPointZ_free(_res_constr); } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorUpdateIdZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_MonitorUpdateIdZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMonitorUpdateId), "LDKCVec_MonitorUpdateIdZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t r = 0; r < _res_constr.datalen; r++) { + int64_t _res_conv_17 = _res_vals[r]; + LDKMonitorUpdateId _res_conv_17_conv; + _res_conv_17_conv.inner = untag_ptr(_res_conv_17); + _res_conv_17_conv.is_owned = ptr_is_owned(_res_conv_17); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_17_conv); + _res_constr.data[r] = _res_conv_17_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_MonitorUpdateIdZ_free(_res_constr); +} + +static inline uint64_t C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR arg) { + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); + *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* arg_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* orig_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(orig); + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); + *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_tArray b) { + LDKOutPoint a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = OutPoint_clone(&a_conv); + LDKCVec_MonitorUpdateIdZ b_constr; + b_constr.datalen = (*env)->GetArrayLength(env, b); + if (b_constr.datalen > 0) + b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKMonitorUpdateId), "LDKCVec_MonitorUpdateIdZ Elements"); + else + b_constr.data = NULL; + int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL); + for (size_t r = 0; r < b_constr.datalen; r++) { + int64_t b_conv_17 = b_vals[r]; + LDKMonitorUpdateId b_conv_17_conv; + b_conv_17_conv.inner = untag_ptr(b_conv_17); + b_conv_17_conv.is_owned = ptr_is_owned(b_conv_17); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv_17_conv); + b_conv_17_conv = MonitorUpdateId_clone(&b_conv_17_conv); + b_constr.data[r] = b_conv_17_conv; + } + (*env)->ReleaseLongArrayElements(env, b, b_vals, 0); + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); + *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(a_conv, b_constr); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res_conv = *(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(_res_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1OutPointCVec_1MonitorUpdateIdZZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t p = 0; p < _res_constr.datalen; p++) { + int64_t _res_conv_41 = _res_vals[p]; + void* _res_conv_41_ptr = untag_ptr(_res_conv_41); + CHECK_ACCESS(_res_conv_41_ptr); + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res_conv_41_conv = *(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)(_res_conv_41_ptr); + FREE(untag_ptr(_res_conv_41)); + _res_constr.data[p] = _res_conv_41_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(_res_constr); +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -25366,6 +26171,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1unknown_1n return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1invalid_1forward(JNIEnv *env, jclass clz, int64_t requested_forward_scid) { + LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); + *ret_copy = HTLCDestination_invalid_forward(requested_forward_scid); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1failed_1payment(JNIEnv *env, jclass clz, int8_tArray payment_hash) { LDKThirtyTwoBytes payment_hash_ref; CHECK((*env)->GetArrayLength(env, payment_hash) == 32); @@ -25431,7 +26243,7 @@ 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, int8_tArray counterparty_node_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, int8_tArray 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); @@ -25442,13 +26254,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1funding_1generation_ output_script_ref.datalen = (*env)->GetArrayLength(env, output_script); output_script_ref.data = MALLOC(output_script_ref.datalen, "LDKCVec_u8Z Bytes"); (*env)->GetByteArrayRegion(env, output_script, 0, output_script_ref.datalen, output_script_ref.data); + LDKU128 user_channel_id_ref; + CHECK((*env)->GetArrayLength(env, user_channel_id) == 16); + (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_funding_generation_ready(temporary_channel_id_ref, counterparty_node_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_ref); int64_t ret_ref = tag_ptr(ret_copy, true); 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) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1claimable(JNIEnv *env, jclass clz, int8_tArray receiver_node_id, int8_tArray payment_hash, int64_t amount_msat, int64_t purpose, int8_tArray via_channel_id, int64_t via_user_channel_id) { + LDKPublicKey receiver_node_id_ref; + CHECK((*env)->GetArrayLength(env, receiver_node_id) == 33); + (*env)->GetByteArrayRegion(env, receiver_node_id, 0, 33, receiver_node_id_ref.compressed_form); LDKThirtyTwoBytes payment_hash_ref; CHECK((*env)->GetArrayLength(env, payment_hash) == 32); (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); @@ -25456,13 +26274,23 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1received(JN CHECK_ACCESS(purpose_ptr); LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr); purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose)); + LDKThirtyTwoBytes via_channel_id_ref; + CHECK((*env)->GetArrayLength(env, via_channel_id) == 32); + (*env)->GetByteArrayRegion(env, via_channel_id, 0, 32, via_channel_id_ref.data); + void* via_user_channel_id_ptr = untag_ptr(via_user_channel_id); + CHECK_ACCESS(via_user_channel_id_ptr); + LDKCOption_u128Z via_user_channel_id_conv = *(LDKCOption_u128Z*)(via_user_channel_id_ptr); + via_user_channel_id_conv = COption_u128Z_clone((LDKCOption_u128Z*)untag_ptr(via_user_channel_id)); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_received(payment_hash_ref, amount_msat, purpose_conv); + *ret_copy = Event_payment_claimable(receiver_node_id_ref, payment_hash_ref, amount_msat, purpose_conv, via_channel_id_ref, via_user_channel_id_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1claimed(JNIEnv *env, jclass clz, int8_tArray payment_hash, int64_t amount_msat, int64_t purpose) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1claimed(JNIEnv *env, jclass clz, int8_tArray receiver_node_id, int8_tArray payment_hash, int64_t amount_msat, int64_t purpose) { + LDKPublicKey receiver_node_id_ref; + CHECK((*env)->GetArrayLength(env, receiver_node_id) == 33); + (*env)->GetByteArrayRegion(env, receiver_node_id, 0, 33, receiver_node_id_ref.compressed_form); LDKThirtyTwoBytes payment_hash_ref; CHECK((*env)->GetArrayLength(env, payment_hash) == 32); (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); @@ -25471,7 +26299,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1claimed(JNI LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr); purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose)); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_claimed(payment_hash_ref, amount_msat, purpose_conv); + *ret_copy = Event_payment_claimed(receiver_node_id_ref, payment_hash_ref, amount_msat, purpose_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -25653,6 +26481,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1pending_1htlcs_1forw return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1htlcintercepted(JNIEnv *env, jclass clz, int8_tArray intercept_id, int64_t requested_next_hop_scid, int8_tArray payment_hash, int64_t inbound_amount_msat, int64_t expected_outbound_amount_msat) { + LDKThirtyTwoBytes intercept_id_ref; + CHECK((*env)->GetArrayLength(env, intercept_id) == 32); + (*env)->GetByteArrayRegion(env, intercept_id, 0, 32, intercept_id_ref.data); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_htlcintercepted(intercept_id_ref, requested_next_hop_scid, payment_hash_ref, inbound_amount_msat, expected_outbound_amount_msat); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1spendable_1outputs(JNIEnv *env, jclass clz, int64_tArray outputs) { LDKCVec_SpendableOutputDescriptorZ outputs_constr; outputs_constr.datalen = (*env)->GetArrayLength(env, outputs); @@ -25693,16 +26534,40 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1forwarded(J return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1channel_1closed(JNIEnv *env, jclass clz, int8_tArray channel_id, int64_t user_channel_id, int64_t reason) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1channel_1ready(JNIEnv *env, jclass clz, int8_tArray channel_id, int8_tArray user_channel_id, int8_tArray counterparty_node_id, int64_t channel_type) { + LDKThirtyTwoBytes channel_id_ref; + CHECK((*env)->GetArrayLength(env, channel_id) == 32); + (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_ref.data); + LDKU128 user_channel_id_ref; + CHECK((*env)->GetArrayLength(env, user_channel_id) == 16); + (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes); + LDKPublicKey counterparty_node_id_ref; + CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); + (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); + LDKChannelTypeFeatures channel_type_conv; + channel_type_conv.inner = untag_ptr(channel_type); + channel_type_conv.is_owned = ptr_is_owned(channel_type); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_conv); + channel_type_conv = ChannelTypeFeatures_clone(&channel_type_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_channel_ready(channel_id_ref, user_channel_id_ref, counterparty_node_id_ref, channel_type_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1channel_1closed(JNIEnv *env, jclass clz, int8_tArray channel_id, int8_tArray user_channel_id, int64_t reason) { LDKThirtyTwoBytes channel_id_ref; CHECK((*env)->GetArrayLength(env, channel_id) == 32); (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_ref.data); + LDKU128 user_channel_id_ref; + CHECK((*env)->GetArrayLength(env, user_channel_id) == 16); + (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes); void* reason_ptr = untag_ptr(reason); CHECK_ACCESS(reason_ptr); LDKClosureReason reason_conv = *(LDKClosureReason*)(reason_ptr); reason_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(reason)); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_channel_closed(channel_id_ref, user_channel_id, reason_conv); + *ret_copy = Event_channel_closed(channel_id_ref, user_channel_id_ref, reason_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -26186,10 +27051,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1fee_1rate_1too_1h return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1route_1error(JNIEnv *env, jclass clz, jstring err) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1invalid_1route(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); + *ret_copy = APIError_invalid_route(err_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -26368,17 +27233,17 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_construct_1invoice_1pre 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; + 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"); + 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 }; + 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); @@ -26398,6 +27263,45 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Persister_1free(JNIEnv *env, j Persister_free(this_ptr_conv); } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrintableString_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPrintableString this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + PrintableString_free(this_obj_conv); +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_PrintableString_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPrintableString this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKStr ret_str = PrintableString_get_a(&this_ptr_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrintableString_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { + LDKPrintableString this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKStr val_conv = java_to_owned_str(env, val); + PrintableString_set_a(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrintableString_1new(JNIEnv *env, jclass clz, jstring a_arg) { + LDKStr a_arg_conv = java_to_owned_str(env, a_arg); + LDKPrintableString ret_var = PrintableString_new(a_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FutureCallback_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -27420,7 +28324,26 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1manually_1acc 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 channel_handshake_config_arg, int64_t channel_handshake_limits_arg, int64_t channel_config_arg, jboolean accept_forwards_to_priv_channels_arg, jboolean accept_inbound_channels_arg, jboolean manually_accept_inbound_channels_arg) { +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1accept_1intercept_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + jboolean ret_conv = UserConfig_get_accept_intercept_htlcs(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1intercept_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + UserConfig_set_accept_intercept_htlcs(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1new(JNIEnv *env, jclass clz, int64_t channel_handshake_config_arg, int64_t channel_handshake_limits_arg, int64_t channel_config_arg, jboolean accept_forwards_to_priv_channels_arg, jboolean accept_inbound_channels_arg, jboolean manually_accept_inbound_channels_arg, jboolean accept_intercept_htlcs_arg) { LDKChannelHandshakeConfig channel_handshake_config_arg_conv; channel_handshake_config_arg_conv.inner = untag_ptr(channel_handshake_config_arg); channel_handshake_config_arg_conv.is_owned = ptr_is_owned(channel_handshake_config_arg); @@ -27436,7 +28359,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1new(JNIEnv *env channel_config_arg_conv.is_owned = ptr_is_owned(channel_config_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_config_arg_conv); channel_config_arg_conv = ChannelConfig_clone(&channel_config_arg_conv); - LDKUserConfig ret_var = UserConfig_new(channel_handshake_config_arg_conv, channel_handshake_limits_arg_conv, channel_config_arg_conv, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg, manually_accept_inbound_channels_arg); + LDKUserConfig ret_var = UserConfig_new(channel_handshake_config_arg_conv, channel_handshake_limits_arg_conv, channel_config_arg_conv, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg, manually_accept_inbound_channels_arg, accept_intercept_htlcs_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -27852,6 +28775,12 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1high_1pr return ret_conv; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKConfirmationTarget* o_conv = (LDKConfirmationTarget*)untag_ptr(o); + int64_t ret_conv = ConfirmationTarget_hash(o_conv); + 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*)untag_ptr(a); LDKConfirmationTarget* b_conv = (LDKConfirmationTarget*)untag_ptr(b); @@ -28079,6 +29008,26 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1list_1mo return ret_arr; } +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1list_1pending_1monitor_1updates(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChainMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ret_var = ChainMonitor_list_pending_monitor_updates(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t p = 0; p < ret_var.datalen; p++) { + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv_41_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); + *ret_conv_41_conv = ret_var.data[p]; + ret_arr_ptr[p] = tag_ptr(ret_conv_41_conv, true); + } + (*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 = untag_ptr(this_arg); @@ -28927,22 +29876,22 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1best_1 return ret_arr; } -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1relevant_1txids(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT int64_tArray 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 = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_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); + LDKCVec_C2Tuple_TxidBlockHashZZ ret_var = ChannelMonitor_get_relevant_txids(&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 z = 0; z < ret_var.datalen; z++) { + LDKC2Tuple_TxidBlockHashZ* ret_conv_25_conv = MALLOC(sizeof(LDKC2Tuple_TxidBlockHashZ), "LDKC2Tuple_TxidBlockHashZ"); + *ret_conv_25_conv = ret_var.data[z]; + ret_arr_ptr[z] = tag_ptr(ret_conv_25_conv, true); } - + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); FREE(ret_var.data); return ret_arr; } @@ -30978,23 +31927,27 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1unspendab 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) { +JNIEXPORT int8_tArray 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 = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelDetails_get_user_channel_id(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 16); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 16, ChannelDetails_get_user_channel_id(&this_ptr_conv).le_bytes); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1user_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1user_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelDetails_set_user_channel_id(&this_ptr_conv, val); + LDKU128 val_ref; + CHECK((*env)->GetArrayLength(env, val) == 16); + (*env)->GetByteArrayRegion(env, val, 0, 16, val_ref.le_bytes); + ChannelDetails_set_user_channel_id(&this_ptr_conv, val_ref); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1balance_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -31098,6 +32051,31 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1confirmat ChannelDetails_set_confirmations_required(&this_ptr_conv, val_conv); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1confirmations(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = ChannelDetails_get_confirmations(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1confirmations(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); + val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val)); + ChannelDetails_set_confirmations(&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 = untag_ptr(this_ptr); @@ -31276,7 +32254,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1config(JN ChannelDetails_set_config(&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 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, int64_t config_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, int8_tArray 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 confirmations_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, int64_t config_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); @@ -31310,10 +32288,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv void* unspendable_punishment_reserve_arg_ptr = untag_ptr(unspendable_punishment_reserve_arg); CHECK_ACCESS(unspendable_punishment_reserve_arg_ptr); LDKCOption_u64Z unspendable_punishment_reserve_arg_conv = *(LDKCOption_u64Z*)(unspendable_punishment_reserve_arg_ptr); + LDKU128 user_channel_id_arg_ref; + CHECK((*env)->GetArrayLength(env, user_channel_id_arg) == 16); + (*env)->GetByteArrayRegion(env, user_channel_id_arg, 0, 16, user_channel_id_arg_ref.le_bytes); void* confirmations_required_arg_ptr = untag_ptr(confirmations_required_arg); 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*)untag_ptr(confirmations_required_arg)); + void* confirmations_arg_ptr = untag_ptr(confirmations_arg); + CHECK_ACCESS(confirmations_arg_ptr); + LDKCOption_u32Z confirmations_arg_conv = *(LDKCOption_u32Z*)(confirmations_arg_ptr); + confirmations_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(confirmations_arg)); void* force_close_spend_delay_arg_ptr = untag_ptr(force_close_spend_delay_arg); CHECK_ACCESS(force_close_spend_delay_arg_ptr); LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(force_close_spend_delay_arg_ptr); @@ -31331,7 +32316,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv config_arg_conv.is_owned = ptr_is_owned(config_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(config_arg_conv); config_arg_conv = ChannelConfig_clone(&config_arg_conv); - 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, config_arg_conv); + 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_ref, balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, confirmations_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_channel_ready_arg, is_usable_arg, is_public_arg, inbound_htlc_minimum_msat_arg_conv, inbound_htlc_maximum_msat_arg_conv, config_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -31455,7 +32440,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1path_1p return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1all_1failed_1retry_1safe(JNIEnv *env, jclass clz, int64_tArray a) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1all_1failed_1resend_1safe(JNIEnv *env, jclass clz, int64_tArray a) { LDKCVec_APIErrorZ a_constr; a_constr.datalen = (*env)->GetArrayLength(env, a); if (a_constr.datalen > 0) @@ -31473,7 +32458,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1all_1fa } (*env)->ReleaseLongArrayElements(env, a, a_vals, 0); LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_all_failed_retry_safe(a_constr); + *ret_copy = PaymentSendFailure_all_failed_resend_safe(a_constr); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1duplicate_1payment(JNIEnv *env, jclass clz) { + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_duplicate_payment(); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -31730,7 +32722,7 @@ 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) { +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, int8_tArray user_channel_id, int64_t override_config) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -31739,13 +32731,16 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1cha 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); + LDKU128 user_channel_id_ref; + CHECK((*env)->GetArrayLength(env, user_channel_id) == 16); + (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes); LDKUserConfig override_config_conv; override_config_conv.inner = untag_ptr(override_config); override_config_conv.is_owned = ptr_is_owned(override_config); 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); + *ret_conv = ChannelManager_create_channel(&this_arg_conv, their_network_key_ref, channel_value_satoshis, push_msat, user_channel_id_ref, override_config_conv); return tag_ptr(ret_conv, true); } @@ -31883,7 +32878,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1 ChannelManager_force_close_all_channels_without_broadcasting_txn(&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) { +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, int8_tArray payment_id) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -31900,8 +32895,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payme 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); + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); + *ret_conv = ChannelManager_send_payment(&this_arg_conv, &route_conv, payment_hash_ref, payment_secret_ref, payment_id_ref); return tag_ptr(ret_conv, true); } @@ -31936,7 +32934,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1abandon_1payme ChannelManager_abandon_payment(&this_arg_conv, payment_id_ref); } -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) { +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, int8_tArray payment_id) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -31950,8 +32948,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1spont 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); + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKCResult_PaymentHashPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashPaymentSendFailureZ), "LDKCResult_PaymentHashPaymentSendFailureZ"); + *ret_conv = ChannelManager_send_spontaneous_payment(&this_arg_conv, &route_conv, payment_preimage_ref, payment_id_ref); return tag_ptr(ret_conv, true); } @@ -32038,6 +33039,41 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1update_1cha return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1forward_1intercepted_1htlc(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray intercept_id, int8_tArray next_hop_channel_id, int8_tArray _next_node_id, int64_t amt_to_forward_msat) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKThirtyTwoBytes intercept_id_ref; + CHECK((*env)->GetArrayLength(env, intercept_id) == 32); + (*env)->GetByteArrayRegion(env, intercept_id, 0, 32, intercept_id_ref.data); + unsigned char next_hop_channel_id_arr[32]; + CHECK((*env)->GetArrayLength(env, next_hop_channel_id) == 32); + (*env)->GetByteArrayRegion(env, next_hop_channel_id, 0, 32, next_hop_channel_id_arr); + unsigned char (*next_hop_channel_id_ref)[32] = &next_hop_channel_id_arr; + LDKPublicKey _next_node_id_ref; + CHECK((*env)->GetArrayLength(env, _next_node_id) == 33); + (*env)->GetByteArrayRegion(env, _next_node_id, 0, 33, _next_node_id_ref.compressed_form); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_forward_intercepted_htlc(&this_arg_conv, intercept_id_ref, next_hop_channel_id_ref, _next_node_id_ref, amt_to_forward_msat); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1fail_1intercepted_1htlc(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray intercept_id) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKThirtyTwoBytes intercept_id_ref; + CHECK((*env)->GetArrayLength(env, intercept_id) == 32); + (*env)->GetByteArrayRegion(env, intercept_id, 0, 32, intercept_id_ref.data); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_fail_intercepted_htlc(&this_arg_conv, intercept_id_ref); + return tag_ptr(ret_conv, true); +} + 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 = untag_ptr(this_arg); @@ -32092,7 +33128,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1ou 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) { +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, int8_tArray user_channel_id) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -32105,12 +33141,15 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1accept_1inb 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); + LDKU128 user_channel_id_ref; + CHECK((*env)->GetArrayLength(env, user_channel_id) == 16); + (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes); 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); + *ret_conv = ChannelManager_accept_inbound_channel(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, user_channel_id_ref); return tag_ptr(ret_conv, true); } -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) { +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, int8_tArray user_channel_id) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -32123,8 +33162,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1accept_1inb 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); + LDKU128 user_channel_id_ref; + CHECK((*env)->GetArrayLength(env, user_channel_id) == 16); + (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes); 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); + *ret_conv = ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, user_channel_id_ref); return tag_ptr(ret_conv, true); } @@ -32234,6 +33276,29 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1phanto return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1intercept_1scid(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int64_t ret_conv = ChannelManager_get_intercept_scid(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1compute_1inflight_1htlcs(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKInFlightHtlcs ret_var = ChannelManager_compute_inflight_htlcs(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -40272,6 +41337,56 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_htlc_1timeout_1tx_1weight(J return ret_conv; } +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKHTLCClaim* orig_conv = (LDKHTLCClaim*)untag_ptr(orig); + jclass ret_conv = LDKHTLCClaim_to_java(env, HTLCClaim_clone(orig_conv)); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1offered_1timeout(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKHTLCClaim_to_java(env, HTLCClaim_offered_timeout()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1offered_1preimage(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKHTLCClaim_to_java(env, HTLCClaim_offered_preimage()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1accepted_1timeout(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKHTLCClaim_to_java(env, HTLCClaim_accepted_timeout()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1accepted_1preimage(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKHTLCClaim_to_java(env, HTLCClaim_accepted_preimage()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1revocation(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKHTLCClaim_to_java(env, HTLCClaim_revocation()); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKHTLCClaim* a_conv = (LDKHTLCClaim*)untag_ptr(a); + LDKHTLCClaim* b_conv = (LDKHTLCClaim*)untag_ptr(b); + jboolean ret_conv = HTLCClaim_eq(a_conv, b_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1from_1witness(JNIEnv *env, jclass clz, int8_tArray witness) { + LDKWitness witness_ref; + witness_ref.datalen = (*env)->GetArrayLength(env, witness); + witness_ref.data = MALLOC(witness_ref.datalen, "LDKWitness Bytes"); + (*env)->GetByteArrayRegion(env, witness, 0, witness_ref.datalen, witness_ref.data); + witness_ref.data_is_owned = true; + LDKCOption_HTLCClaimZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCClaimZ), "LDKCOption_HTLCClaimZ"); + *ret_copy = HTLCClaim_from_witness(witness_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + 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); @@ -40407,7 +41522,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecre return tag_ptr(ret_conv, true); } -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) { +JNIEXPORT int8_tArray 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); @@ -40415,24 +41530,24 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_derive_1private_1key(JNIEnv 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 tag_ptr(ret_conv, true); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, derive_private_key(per_commitment_point_ref, base_secret_ref).bytes); + return ret_arr; } -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) { +JNIEXPORT int8_tArray 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 tag_ptr(ret_conv, true); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, derive_public_key(per_commitment_point_ref, base_point_ref).compressed_form); + 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) { +JNIEXPORT int8_tArray 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); @@ -40441,21 +41556,21 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_derive_1private_1revocation 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 tag_ptr(ret_conv, true); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, derive_private_revocation_key(per_commitment_secret_ref, countersignatory_revocation_base_secret_ref).bytes); + return ret_arr; } -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) { +JNIEXPORT int8_tArray 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 tag_ptr(ret_conv, true); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, derive_public_revocation_key(per_commitment_point_ref, countersignatory_revocation_base_point_ref).compressed_form); + return ret_arr; } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1free(JNIEnv *env, jclass clz, int64_t this_obj) { @@ -40902,9 +42017,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1derive_1new 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 tag_ptr(ret_conv, true); + LDKTxCreationKeys ret_var = TxCreationKeys_derive_new(per_commitment_point_ref, broadcaster_delayed_payment_base_ref, broadcaster_htlc_base_ref, countersignatory_revocation_base_ref, countersignatory_htlc_base_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1from_1channel_1static_1keys(JNIEnv *env, jclass clz, int8_tArray per_commitment_point, int64_t broadcaster_keys, int64_t countersignatory_keys) { @@ -40921,9 +42038,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1from_1chann countersignatory_keys_conv.is_owned = ptr_is_owned(countersignatory_keys); CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv); countersignatory_keys_conv.is_owned = false; - 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 tag_ptr(ret_conv, true); + LDKTxCreationKeys ret_var = TxCreationKeys_from_channel_static_keys(per_commitment_point_ref, &broadcaster_keys_conv, &countersignatory_keys_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1revokeable_1redeemscript(JNIEnv *env, jclass clz, int8_tArray revocation_key, int16_t contest_delay, int8_tArray broadcaster_delayed_payment_key) { @@ -41168,7 +42287,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_make_1funding_1redeemsc return ret_arr; } -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) { +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, jboolean use_non_zero_fee_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); @@ -41184,13 +42303,45 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1htlc_1transactio 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); + LDKTransaction ret_var = build_htlc_transaction(commitment_txid_ref, feerate_per_kw, contest_delay, &htlc_conv, opt_anchors, use_non_zero_fee_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 int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1htlc_1input_1witness(JNIEnv *env, jclass clz, int8_tArray local_sig, int8_tArray remote_sig, int8_tArray preimage, int8_tArray redeem_script, jboolean opt_anchors) { + LDKSignature local_sig_ref; + CHECK((*env)->GetArrayLength(env, local_sig) == 64); + (*env)->GetByteArrayRegion(env, local_sig, 0, 64, local_sig_ref.compact_form); + LDKSignature remote_sig_ref; + CHECK((*env)->GetArrayLength(env, remote_sig) == 64); + (*env)->GetByteArrayRegion(env, remote_sig, 0, 64, remote_sig_ref.compact_form); + LDKThirtyTwoBytes preimage_ref; + CHECK((*env)->GetArrayLength(env, preimage) == 32); + (*env)->GetByteArrayRegion(env, preimage, 0, 32, preimage_ref.data); + LDKu8slice redeem_script_ref; + redeem_script_ref.datalen = (*env)->GetArrayLength(env, redeem_script); + redeem_script_ref.data = (*env)->GetByteArrayElements (env, redeem_script, NULL); + LDKWitness ret_var = build_htlc_input_witness(local_sig_ref, remote_sig_ref, preimage_ref, redeem_script_ref, opt_anchors); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + Witness_free(ret_var); + (*env)->ReleaseByteArrayElements(env, redeem_script, (int8_t*)redeem_script_ref.data, 0); + return ret_arr; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1to_1countersignatory_1with_1anchors_1redeemscript(JNIEnv *env, jclass clz, int8_tArray payment_point) { + LDKPublicKey payment_point_ref; + CHECK((*env)->GetArrayLength(env, payment_point) == 33); + (*env)->GetByteArrayRegion(env, payment_point, 0, 33, payment_point_ref.compressed_form); + LDKCVec_u8Z ret_var = get_to_countersignatory_with_anchors_redeemscript(payment_point_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 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); @@ -41202,6 +42353,20 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1anchor_1redeemscri return ret_arr; } +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1anchor_1input_1witness(JNIEnv *env, jclass clz, int8_tArray funding_key, int8_tArray funding_sig) { + LDKPublicKey funding_key_ref; + CHECK((*env)->GetArrayLength(env, funding_key) == 33); + (*env)->GetByteArrayRegion(env, funding_key, 0, 33, funding_key_ref.compressed_form); + LDKSignature funding_sig_ref; + CHECK((*env)->GetArrayLength(env, funding_sig) == 64); + (*env)->GetByteArrayRegion(env, funding_sig, 0, 64, funding_sig_ref.compact_form); + LDKWitness ret_var = build_anchor_input_witness(funding_key_ref, funding_sig_ref); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + Witness_free(ret_var); + return ret_arr; +} + JNIEXPORT 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 = untag_ptr(this_obj); @@ -41349,7 +42514,27 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1 ChannelTransactionParameters_set_opt_anchors(&this_ptr_conv, val_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) { +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1opt_1non_1zero_1fee_1anchors(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelTransactionParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + jclass ret_conv = LDKCOption_NoneZ_to_java(env, ChannelTransactionParameters_get_opt_non_zero_fee_anchors(&this_ptr_conv)); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1opt_1non_1zero_1fee_1anchors(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) { + LDKChannelTransactionParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_java(env, val); + ChannelTransactionParameters_set_opt_non_zero_fee_anchors(&this_ptr_conv, val_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, jclass opt_non_zero_fee_anchors_arg) { LDKChannelPublicKeys holder_pubkeys_arg_conv; holder_pubkeys_arg_conv.inner = untag_ptr(holder_pubkeys_arg); holder_pubkeys_arg_conv.is_owned = ptr_is_owned(holder_pubkeys_arg); @@ -41366,7 +42551,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter 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); + LDKCOption_NoneZ opt_non_zero_fee_anchors_arg_conv = LDKCOption_NoneZ_from_java(env, opt_non_zero_fee_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, opt_non_zero_fee_anchors_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -42479,6 +43665,36 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1eq(JNIEnv return ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKOfferFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKOfferFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = OfferFeatures_eq(&a_conv, &b_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKInvoiceRequestFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKInvoiceRequestFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = InvoiceRequestFeatures_eq(&a_conv, &b_conv); + return ret_conv; +} + JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { LDKChannelTypeFeatures a_conv; a_conv.inner = untag_ptr(a); @@ -42614,6 +43830,66 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1clone(JNIE return ret_ref; } +static inline uint64_t OfferFeatures_clone_ptr(LDKOfferFeatures *NONNULL_PTR arg) { + LDKOfferFeatures ret_var = OfferFeatures_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKOfferFeatures arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = OfferFeatures_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKOfferFeatures orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKOfferFeatures ret_var = OfferFeatures_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t InvoiceRequestFeatures_clone_ptr(LDKInvoiceRequestFeatures *NONNULL_PTR arg) { + LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInvoiceRequestFeatures arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = InvoiceRequestFeatures_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKInvoiceRequestFeatures orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + static inline uint64_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg) { LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(arg); int64_t ret_ref = 0; @@ -42676,6 +43952,22 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1free(JNIEnv * InvoiceFeatures_free(this_obj_conv); } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKOfferFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OfferFeatures_free(this_obj_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInvoiceRequestFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InvoiceRequestFeatures_free(this_obj_conv); +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { LDKChannelTypeFeatures this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -42756,6 +44048,42 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_ return ret_conv; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1empty(JNIEnv *env, jclass clz) { + LDKOfferFeatures ret_var = OfferFeatures_empty(); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = OfferFeatures_requires_unknown_bits(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1empty(JNIEnv *env, jclass clz) { + LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_empty(); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InvoiceRequestFeatures_requires_unknown_bits(&this_arg_conv); + return ret_conv; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1empty(JNIEnv *env, jclass clz) { LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_empty(); int64_t ret_ref = 0; @@ -42889,6 +44217,52 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1read(J return tag_ptr(ret_conv, true); } +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKOfferFeatures obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = OfferFeatures_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_OfferFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferFeaturesDecodeErrorZ), "LDKCResult_OfferFeaturesDecodeErrorZ"); + *ret_conv = OfferFeatures_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKInvoiceRequestFeatures obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = InvoiceRequestFeatures_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_InvoiceRequestFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestFeaturesDecodeErrorZ), "LDKCResult_InvoiceRequestFeaturesDecodeErrorZ"); + *ret_conv = InvoiceRequestFeatures_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1data_1loss_1protect_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { LDKInitFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -44689,15 +46063,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1add_1chain_1acc P2PGossipSync_add_chain_access(&this_arg_conv, chain_access_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1as_1EventHandler(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1handle_1network_1update(JNIEnv *env, jclass clz, int64_t this_arg, int64_t network_update) { LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler"); - *ret_ret = NetworkGraph_as_EventHandler(&this_arg_conv); - return tag_ptr(ret_ret, true); + LDKNetworkUpdate* network_update_conv = (LDKNetworkUpdate*)untag_ptr(network_update); + NetworkGraph_handle_network_update(&this_arg_conv, network_update_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1as_1RoutingMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { @@ -45292,19 +46665,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1channe return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1direction(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKDirectedChannelInfo this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelUpdateInfo ret_var = DirectedChannelInfo_direction(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_arg) { LDKDirectedChannelInfo this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -45371,12 +46731,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1maximum_ } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1total(JNIEnv *env, jclass clz, int64_t capacity_msat, int64_t htlc_maximum_msat) { - void* htlc_maximum_msat_ptr = untag_ptr(htlc_maximum_msat); - CHECK_ACCESS(htlc_maximum_msat_ptr); - LDKCOption_u64Z htlc_maximum_msat_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_ptr); - htlc_maximum_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_maximum_msat)); LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_total(capacity_msat, htlc_maximum_msat_conv); + *ret_copy = EffectiveCapacity_total(capacity_msat, htlc_maximum_msat); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -46477,6 +47833,207 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1get_1 return ret_ref; } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKDefaultRouter this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + DefaultRouter_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1new(JNIEnv *env, jclass clz, int64_t network_graph, int64_t logger, int8_tArray random_seed_bytes, int64_t scorer) { + LDKNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKThirtyTwoBytes random_seed_bytes_ref; + CHECK((*env)->GetArrayLength(env, random_seed_bytes) == 32); + (*env)->GetByteArrayRegion(env, random_seed_bytes, 0, 32, random_seed_bytes_ref.data); + void* scorer_ptr = untag_ptr(scorer); + CHECK_ACCESS(scorer_ptr); + LDKLockableScore scorer_conv = *(LDKLockableScore*)(scorer_ptr); + if (scorer_conv.free == LDKLockableScore_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLockableScore_JCalls_cloned(&scorer_conv); + } + LDKDefaultRouter ret_var = DefaultRouter_new(&network_graph_conv, logger_conv, random_seed_bytes_ref, scorer_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1as_1Router(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKDefaultRouter this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKRouter* ret_ret = MALLOC(sizeof(LDKRouter), "LDKRouter"); + *ret_ret = DefaultRouter_as_Router(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKRouter this_ptr_conv = *(LDKRouter*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Router_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKScorerAccountingForInFlightHtlcs this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ScorerAccountingForInFlightHtlcs_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1new(JNIEnv *env, jclass clz, int64_t scorer, int64_t inflight_htlcs) { + void* scorer_ptr = untag_ptr(scorer); + CHECK_ACCESS(scorer_ptr); + LDKScore scorer_conv = *(LDKScore*)(scorer_ptr); + if (scorer_conv.free == LDKScore_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKScore_JCalls_cloned(&scorer_conv); + } + LDKInFlightHtlcs inflight_htlcs_conv; + inflight_htlcs_conv.inner = untag_ptr(inflight_htlcs); + inflight_htlcs_conv.is_owned = ptr_is_owned(inflight_htlcs); + CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_conv); + inflight_htlcs_conv = InFlightHtlcs_clone(&inflight_htlcs_conv); + LDKScorerAccountingForInFlightHtlcs ret_var = ScorerAccountingForInFlightHtlcs_new(scorer_conv, inflight_htlcs_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKScorerAccountingForInFlightHtlcs obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ScorerAccountingForInFlightHtlcs_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1as_1Score(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKScorerAccountingForInFlightHtlcs this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore"); + *ret_ret = ScorerAccountingForInFlightHtlcs_as_Score(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInFlightHtlcs this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InFlightHtlcs_free(this_obj_conv); +} + +static inline uint64_t InFlightHtlcs_clone_ptr(LDKInFlightHtlcs *NONNULL_PTR arg) { + LDKInFlightHtlcs ret_var = InFlightHtlcs_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInFlightHtlcs arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = InFlightHtlcs_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKInFlightHtlcs orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKInFlightHtlcs ret_var = InFlightHtlcs_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1new(JNIEnv *env, jclass clz) { + LDKInFlightHtlcs ret_var = InFlightHtlcs_new(); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1used_1liquidity_1msat(JNIEnv *env, jclass clz, int64_t this_arg, int64_t source, int64_t target, int64_t channel_scid) { + LDKInFlightHtlcs this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeId source_conv; + source_conv.inner = untag_ptr(source); + source_conv.is_owned = ptr_is_owned(source); + CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv); + source_conv.is_owned = false; + LDKNodeId target_conv; + target_conv.inner = untag_ptr(target); + target_conv.is_owned = ptr_is_owned(target); + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); + target_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = InFlightHtlcs_used_liquidity_msat(&this_arg_conv, &source_conv, &target_conv, channel_scid); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKInFlightHtlcs obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = InFlightHtlcs_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ"); + *ret_conv = InFlightHtlcs_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1free(JNIEnv *env, jclass clz, int64_t this_obj) { LDKRouteHop this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -48726,12 +50283,42 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1read(J return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedRoute_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKBlindedRoute this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPath_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBlindedPath this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BlindedRoute_free(this_obj_conv); + BlindedPath_free(this_obj_conv); +} + +static inline uint64_t BlindedPath_clone_ptr(LDKBlindedPath *NONNULL_PTR arg) { + LDKBlindedPath ret_var = BlindedPath_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBlindedPath arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = BlindedPath_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBlindedPath orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKBlindedPath ret_var = BlindedPath_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedHop_1free(JNIEnv *env, jclass clz, int64_t this_obj) { @@ -48742,7 +50329,37 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedHop_1free(JNIEnv *env, BlindedHop_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedRoute_1new(JNIEnv *env, jclass clz, jobjectArray node_pks, int64_t keys_manager) { +static inline uint64_t BlindedHop_clone_ptr(LDKBlindedHop *NONNULL_PTR arg) { + LDKBlindedHop ret_var = BlindedHop_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBlindedHop arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = BlindedHop_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHop_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBlindedHop orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKBlindedHop ret_var = BlindedHop_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1new(JNIEnv *env, jclass clz, jobjectArray node_pks, int64_t keys_manager) { LDKCVec_PublicKeyZ node_pks_constr; node_pks_constr.datalen = (*env)->GetArrayLength(env, node_pks); if (node_pks_constr.datalen > 0) @@ -48759,30 +50376,30 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedRoute_1new(JNIEnv *e void* keys_manager_ptr = untag_ptr(keys_manager); if (ptr_is_owned(keys_manager)) { CHECK_ACCESS(keys_manager_ptr); } LDKKeysInterface* keys_manager_conv = (LDKKeysInterface*)keys_manager_ptr; - LDKCResult_BlindedRouteNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedRouteNoneZ), "LDKCResult_BlindedRouteNoneZ"); - *ret_conv = BlindedRoute_new(node_pks_constr, keys_manager_conv); + LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); + *ret_conv = BlindedPath_new(node_pks_constr, keys_manager_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedRoute_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKBlindedRoute obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedPath_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKBlindedPath obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = BlindedRoute_write(&obj_conv); + LDKCVec_u8Z ret_var = BlindedPath_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedRoute_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_BlindedRouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedRouteDecodeErrorZ), "LDKCResult_BlindedRouteDecodeErrorZ"); - *ret_conv = BlindedRoute_read(ser_ref); + LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ"); + *ret_conv = BlindedPath_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } @@ -48827,6 +50444,26 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Destination_1free(JNIEnv *env, Destination_free(this_ptr_conv); } +static inline uint64_t Destination_clone_ptr(LDKDestination *NONNULL_PTR arg) { + LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); + *ret_copy = Destination_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDestination* arg_conv = (LDKDestination*)untag_ptr(arg); + int64_t ret_conv = Destination_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKDestination* orig_conv = (LDKDestination*)untag_ptr(orig); + LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); + *ret_copy = Destination_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1node(JNIEnv *env, jclass clz, int8_tArray a) { LDKPublicKey a_ref; CHECK((*env)->GetArrayLength(env, a) == 33); @@ -48837,15 +50474,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1node(JNIEnv *e return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1blinded_1route(JNIEnv *env, jclass clz, int64_t a) { - LDKBlindedRoute a_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1blinded_1path(JNIEnv *env, jclass clz, int64_t a) { + LDKBlindedPath a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - // WARNING: we need a move here but no clone is available for LDKBlindedRoute - + a_conv = BlindedPath_clone(&a_conv); LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); - *ret_copy = Destination_blinded_route(a_conv); + *ret_copy = Destination_blinded_path(a_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -48922,6 +50558,20 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1buffer_1full(JNI return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1get_1node_1id_1failed(JNIEnv *env, jclass clz) { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_get_node_id_failed(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1blinded_1path_1advance_1failed(JNIEnv *env, jclass clz) { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_blinded_path_advance_failed(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SendError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { LDKSendError* a_conv = (LDKSendError*)untag_ptr(a); LDKSendError* b_conv = (LDKSendError*)untag_ptr(b); @@ -48967,7 +50617,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1new(JNIEnv return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1send_1custom_1onion_1message(JNIEnv *env, jclass clz, int64_t this_arg, jobjectArray intermediate_nodes, int64_t destination, int64_t msg, int64_t reply_path) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1send_1onion_1message(JNIEnv *env, jclass clz, int64_t this_arg, jobjectArray intermediate_nodes, int64_t destination, int64_t message, int64_t reply_path) { LDKOnionMessenger this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -48989,21 +50639,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1send_1custo void* destination_ptr = untag_ptr(destination); CHECK_ACCESS(destination_ptr); LDKDestination destination_conv = *(LDKDestination*)(destination_ptr); - // WARNING: we may need a move here but no clone is available for LDKDestination - void* msg_ptr = untag_ptr(msg); - CHECK_ACCESS(msg_ptr); - LDKCustomOnionMessageContents msg_conv = *(LDKCustomOnionMessageContents*)(msg_ptr); - if (msg_conv.free == LDKCustomOnionMessageContents_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKCustomOnionMessageContents_JCalls_cloned(&msg_conv); - } - LDKBlindedRoute reply_path_conv; + destination_conv = Destination_clone((LDKDestination*)untag_ptr(destination)); + void* message_ptr = untag_ptr(message); + CHECK_ACCESS(message_ptr); + LDKOnionMessageContents message_conv = *(LDKOnionMessageContents*)(message_ptr); + message_conv = OnionMessageContents_clone((LDKOnionMessageContents*)untag_ptr(message)); + LDKBlindedPath reply_path_conv; reply_path_conv.inner = untag_ptr(reply_path); reply_path_conv.is_owned = ptr_is_owned(reply_path); CHECK_INNER_FIELD_ACCESS_OR_NULL(reply_path_conv); - reply_path_conv.is_owned = false; + reply_path_conv = BlindedPath_clone(&reply_path_conv); LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ"); - *ret_conv = OnionMessenger_send_custom_onion_message(&this_arg_conv, intermediate_nodes_constr, destination_conv, msg_conv, reply_path_conv); + *ret_conv = OnionMessenger_send_onion_message(&this_arg_conv, intermediate_nodes_constr, destination_conv, message_conv, reply_path_conv); return tag_ptr(ret_conv, true); } @@ -49029,6 +50676,49 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1as_1OnionMe return tag_ptr(ret_ret, true); } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKOnionMessageContents this_ptr_conv = *(LDKOnionMessageContents*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + OnionMessageContents_free(this_ptr_conv); +} + +static inline uint64_t OnionMessageContents_clone_ptr(LDKOnionMessageContents *NONNULL_PTR arg) { + LDKOnionMessageContents *ret_copy = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_copy = OnionMessageContents_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKOnionMessageContents* arg_conv = (LDKOnionMessageContents*)untag_ptr(arg); + int64_t ret_conv = OnionMessageContents_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKOnionMessageContents* orig_conv = (LDKOnionMessageContents*)untag_ptr(orig); + LDKOnionMessageContents *ret_copy = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_copy = OnionMessageContents_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1custom(JNIEnv *env, jclass clz, int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKCustomOnionMessageContents a_conv = *(LDKCustomOnionMessageContents*)(a_ptr); + if (a_conv.free == LDKCustomOnionMessageContents_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKCustomOnionMessageContents_JCalls_cloned(&a_conv); + } + LDKOnionMessageContents *ret_copy = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_copy = OnionMessageContents_custom(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline uint64_t CustomOnionMessageContents_clone_ptr(LDKCustomOnionMessageContents *NONNULL_PTR arg) { LDKCustomOnionMessageContents* ret_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents"); *ret_ret = CustomOnionMessageContents_clone(arg); @@ -50333,7 +52023,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1seg_1wit_1program program_ref.data = MALLOC(program_ref.datalen, "LDKCVec_u8Z Bytes"); (*env)->GetByteArrayRegion(env, program, 0, program_ref.datalen, program_ref.data); LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback"); - *ret_copy = Fallback_seg_wit_program((LDKu5){ ._0 = version }, program_ref); + *ret_copy = Fallback_seg_wit_program((LDKU5){ ._0 = version }, program_ref); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -51261,15 +52951,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payer_1free(JNIEnv *env, jclas Payer_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKRouter this_ptr_conv = *(LDKRouter*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Router_free(this_ptr_conv); -} - JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Retry_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -51442,6 +53123,25 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1invoice( return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1invoice_1with_1id(JNIEnv *env, jclass clz, int64_t this_arg, int64_t invoice, int8_tArray payment_id) { + LDKInvoicePayer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKInvoice invoice_conv; + invoice_conv.inner = untag_ptr(invoice); + invoice_conv.is_owned = ptr_is_owned(invoice); + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); + invoice_conv.is_owned = false; + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ"); + *ret_conv = InvoicePayer_pay_invoice_with_id(&this_arg_conv, &invoice_conv, payment_id_ref); + return tag_ptr(ret_conv, true); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1zero_1value_1invoice(JNIEnv *env, jclass clz, int64_t this_arg, int64_t invoice, int64_t amount_msats) { LDKInvoicePayer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -51458,6 +53158,25 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1zero_1va return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1zero_1value_1invoice_1with_1id(JNIEnv *env, jclass clz, int64_t this_arg, int64_t invoice, int64_t amount_msats, int8_tArray payment_id) { + LDKInvoicePayer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKInvoice invoice_conv; + invoice_conv.inner = untag_ptr(invoice); + invoice_conv.is_owned = ptr_is_owned(invoice); + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); + invoice_conv.is_owned = false; + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ"); + *ret_conv = InvoicePayer_pay_zero_value_invoice_with_id(&this_arg_conv, &invoice_conv, amount_msats, payment_id_ref); + return tag_ptr(ret_conv, true); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray pubkey, int8_tArray payment_preimage, int64_t amount_msats, int32_t final_cltv_expiry_delta) { LDKInvoicePayer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -51475,6 +53194,26 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1pubkey(J return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1pubkey_1with_1id(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray pubkey, int8_tArray payment_preimage, int8_tArray payment_id, int64_t amount_msats, int32_t final_cltv_expiry_delta) { + LDKInvoicePayer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKPublicKey pubkey_ref; + CHECK((*env)->GetArrayLength(env, pubkey) == 33); + (*env)->GetByteArrayRegion(env, pubkey, 0, 33, pubkey_ref.compressed_form); + LDKThirtyTwoBytes payment_preimage_ref; + CHECK((*env)->GetArrayLength(env, payment_preimage) == 32); + (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data); + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ"); + *ret_conv = InvoicePayer_pay_pubkey_with_id(&this_arg_conv, pubkey_ref, payment_preimage_ref, payment_id_ref, amount_msats, final_cltv_expiry_delta); + return tag_ptr(ret_conv, true); +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1remove_1cached_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash) { LDKInvoicePayer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -51499,59 +53238,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1as_1EventHand return tag_ptr(ret_ret, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInFlightHtlcs this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InFlightHtlcs_free(this_obj_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1used_1liquidity_1msat(JNIEnv *env, jclass clz, int64_t this_arg, int64_t source, int64_t target, int64_t channel_scid) { - LDKInFlightHtlcs this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId source_conv; - source_conv.inner = untag_ptr(source); - source_conv.is_owned = ptr_is_owned(source); - CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv); - source_conv.is_owned = false; - LDKNodeId target_conv; - target_conv.inner = untag_ptr(target); - target_conv.is_owned = ptr_is_owned(target); - CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); - target_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = InFlightHtlcs_used_liquidity_msat(&this_arg_conv, &source_conv, &target_conv, channel_scid); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKInFlightHtlcs obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = InFlightHtlcs_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ"); - *ret_conv = InFlightHtlcs_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); -} - JNIEXPORT 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, int64_t logger, jclass network) { void* amt_msat_ptr = untag_ptr(amt_msat); CHECK_ACCESS(amt_msat_ptr); @@ -51780,20 +53466,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1chan return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKDefaultRouter this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - DefaultRouter_free(this_obj_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1new(JNIEnv *env, jclass clz, int64_t network_graph, int64_t logger, int8_tArray random_seed_bytes, int64_t scorer) { - LDKNetworkGraph network_graph_conv; - network_graph_conv.inner = untag_ptr(network_graph); - network_graph_conv.is_owned = ptr_is_owned(network_graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - network_graph_conv.is_owned = false; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1and_1duration_1since_1epoch_1with_1payment_1hash(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t keys_manager, int64_t logger, jclass network, int64_t amt_msat, jstring description, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs, int8_tArray payment_hash) { + LDKChannelManager channelmanager_conv; + channelmanager_conv.inner = untag_ptr(channelmanager); + channelmanager_conv.is_owned = ptr_is_owned(channelmanager); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); + channelmanager_conv.is_owned = false; + void* keys_manager_ptr = untag_ptr(keys_manager); + 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* logger_ptr = untag_ptr(logger); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); @@ -51801,32 +53486,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1new(JNIEnv * // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKLogger_JCalls_cloned(&logger_conv); } - LDKThirtyTwoBytes random_seed_bytes_ref; - CHECK((*env)->GetArrayLength(env, random_seed_bytes) == 32); - (*env)->GetByteArrayRegion(env, random_seed_bytes, 0, 32, random_seed_bytes_ref.data); - void* scorer_ptr = untag_ptr(scorer); - CHECK_ACCESS(scorer_ptr); - LDKLockableScore scorer_conv = *(LDKLockableScore*)(scorer_ptr); - if (scorer_conv.free == LDKLockableScore_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLockableScore_JCalls_cloned(&scorer_conv); - } - LDKDefaultRouter ret_var = DefaultRouter_new(&network_graph_conv, logger_conv, random_seed_bytes_ref, scorer_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1as_1Router(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKDefaultRouter this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKRouter* ret_ret = MALLOC(sizeof(LDKRouter), "LDKRouter"); - *ret_ret = DefaultRouter_as_Router(&this_arg_conv); - return tag_ptr(ret_ret, true); + LDKCurrency network_conv = LDKCurrency_from_java(env, network); + void* amt_msat_ptr = untag_ptr(amt_msat); + CHECK_ACCESS(amt_msat_ptr); + LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); + amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); + LDKStr description_conv = java_to_owned_str(env, description); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); + *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(&channelmanager_conv, keys_manager_conv, logger_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch, invoice_expiry_delta_secs, payment_hash_ref); + return tag_ptr(ret_conv, true); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Payer(JNIEnv *env, jclass clz, int64_t this_arg) { diff --git a/src/main/jni/bindings.c.body b/src/main/jni/bindings.c.body index 2e829e6b..28018ee1 100644 --- a/src/main/jni/bindings.c.body +++ b/src/main/jni/bindings.c.body @@ -19,84 +19,9 @@ #define CHECK(a) static jmethodID ordinal_meth = NULL; -static jmethodID slicedef_meth = NULL; -static jclass slicedef_cls = NULL; -JNIEXPORT void Java_org_ldk_impl_bindings_init(JNIEnv * env, jclass _b, jclass enum_class, jclass slicedef_class) { +JNIEXPORT void Java_org_ldk_impl_bindings_init(JNIEnv * env, jclass _b, jclass enum_class) { ordinal_meth = (*env)->GetMethodID(env, enum_class, "ordinal", "()I"); CHECK(ordinal_meth != NULL); - slicedef_meth = (*env)->GetMethodID(env, slicedef_class, "", "(JJJ)V"); - CHECK(slicedef_meth != NULL); - slicedef_cls = (*env)->NewGlobalRef(env, slicedef_class); - CHECK(slicedef_cls != NULL); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_deref_1bool (JNIEnv * env, jclass _a, jlong ptr) { - return *((bool*)ptr); -} -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_deref_1long (JNIEnv * env, jclass _a, jlong ptr) { - return *((long*)ptr); -} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_free_1heap_1ptr (JNIEnv * env, jclass _a, jlong ptr) { - FREE((void*)ptr); -} -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_read_1bytes (JNIEnv * env, jclass _b, jlong ptr, jlong len) { - jbyteArray ret_arr = (*env)->NewByteArray(env, len); - (*env)->SetByteArrayRegion(env, ret_arr, 0, len, (unsigned char*)ptr); - return ret_arr; -} -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_get_1u8_1slice_1bytes (JNIEnv * env, jclass _b, jlong slice_ptr) { - LDKu8slice *slice = (LDKu8slice*)slice_ptr; - jbyteArray ret_arr = (*env)->NewByteArray(env, slice->datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, slice->datalen, slice->data); - return ret_arr; -} -JNIEXPORT int64_t impl_bindings_bytes_1to_1u8_1vec (JNIEnv * env, jclass _b, jbyteArray bytes) { - LDKCVec_u8Z *vec = (LDKCVec_u8Z*)MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8"); - vec->datalen = (*env)->GetArrayLength(env, bytes); - vec->data = (uint8_t*)MALLOC(vec->datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion (env, bytes, 0, vec->datalen, vec->data); - return (uint64_t)vec; -} -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_txpointer_1get_1buffer (JNIEnv * env, jclass _b, jlong ptr) { - LDKTransaction *txdata = (LDKTransaction*)ptr; - LDKu8slice slice; - slice.data = txdata->data; - slice.datalen = txdata->datalen; - return Java_org_ldk_impl_bindings_get_1u8_1slice_1bytes(env, _b, (uint64_t)&slice); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_new_1txpointer_1copy_1data (JNIEnv * env, jclass _b, jbyteArray bytes) { - LDKTransaction *txdata = (LDKTransaction*)MALLOC(sizeof(LDKTransaction), "LDKTransaction"); - txdata->datalen = (*env)->GetArrayLength(env, bytes); - txdata->data = (uint8_t*)MALLOC(txdata->datalen, "Tx Data Bytes"); - txdata->data_is_owned = false; - (*env)->GetByteArrayRegion (env, bytes, 0, txdata->datalen, txdata->data); - return (uint64_t)txdata; -} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_txpointer_1free (JNIEnv * env, jclass _b, jlong ptr) { - LDKTransaction *tx = (LDKTransaction*)ptr; - tx->data_is_owned = true; - Transaction_free(*tx); - FREE((void*)ptr); -} -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_vec_1slice_1len (JNIEnv * env, jclass _a, jlong ptr) { - // Check offsets of a few Vec types are all consistent as we're meant to be generic across types - _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKCVec_SignatureZ, datalen), "Vec<*> needs to be mapped identically"); - _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKCVec_MessageSendEventZ, datalen), "Vec<*> needs to be mapped identically"); - _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKCVec_EventZ, datalen), "Vec<*> needs to be mapped identically"); - _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKCVec_C2Tuple_usizeTransactionZZ, datalen), "Vec<*> needs to be mapped identically"); - LDKCVec_u8Z *vec = (LDKCVec_u8Z*)ptr; - return (uint64_t)vec->datalen; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_new_1empty_1slice_1vec (JNIEnv * env, jclass _b) { - // Check sizes of a few Vec types are all consistent as we're meant to be generic across types - _Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKCVec_SignatureZ), "Vec<*> needs to be mapped identically"); - _Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKCVec_MessageSendEventZ), "Vec<*> needs to be mapped identically"); - _Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKCVec_EventZ), "Vec<*> needs to be mapped identically"); - _Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKCVec_C2Tuple_usizeTransactionZZ), "Vec<*> needs to be mapped identically"); - LDKCVec_u8Z *vec = (LDKCVec_u8Z*)MALLOC(sizeof(LDKCVec_u8Z), "Empty LDKCVec"); - vec->data = NULL; - vec->datalen = 0; - return (uint64_t)vec; } // We assume that CVec_u8Z and u8slice are the same size and layout (and thus pointers to the two can be mixed) @@ -461,6 +386,58 @@ static inline jclass LDKCurrency_to_java(JNIEnv *env, LDKCurrency val) { } } +static inline LDKHTLCClaim LDKHTLCClaim_from_java(JNIEnv *env, jclass clz) { + jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to HTLCClaim.ordinal() from rust threw an exception."); + } + switch (ord) { + case 0: return LDKHTLCClaim_OfferedTimeout; + case 1: return LDKHTLCClaim_OfferedPreimage; + case 2: return LDKHTLCClaim_AcceptedTimeout; + case 3: return LDKHTLCClaim_AcceptedPreimage; + case 4: return LDKHTLCClaim_Revocation; + } + (*env)->FatalError(env, "A call to HTLCClaim.ordinal() from rust returned an invalid value."); + abort(); // Unreachable, but will let the compiler know we don't return here +} +static jclass HTLCClaim_class = NULL; +static jfieldID HTLCClaim_LDKHTLCClaim_OfferedTimeout = NULL; +static jfieldID HTLCClaim_LDKHTLCClaim_OfferedPreimage = NULL; +static jfieldID HTLCClaim_LDKHTLCClaim_AcceptedTimeout = NULL; +static jfieldID HTLCClaim_LDKHTLCClaim_AcceptedPreimage = NULL; +static jfieldID HTLCClaim_LDKHTLCClaim_Revocation = NULL; +JNIEXPORT void JNICALL Java_org_ldk_enums_HTLCClaim_init (JNIEnv *env, jclass clz) { + HTLCClaim_class = (*env)->NewGlobalRef(env, clz); + CHECK(HTLCClaim_class != NULL); + HTLCClaim_LDKHTLCClaim_OfferedTimeout = (*env)->GetStaticFieldID(env, HTLCClaim_class, "LDKHTLCClaim_OfferedTimeout", "Lorg/ldk/enums/HTLCClaim;"); + CHECK(HTLCClaim_LDKHTLCClaim_OfferedTimeout != NULL); + HTLCClaim_LDKHTLCClaim_OfferedPreimage = (*env)->GetStaticFieldID(env, HTLCClaim_class, "LDKHTLCClaim_OfferedPreimage", "Lorg/ldk/enums/HTLCClaim;"); + CHECK(HTLCClaim_LDKHTLCClaim_OfferedPreimage != NULL); + HTLCClaim_LDKHTLCClaim_AcceptedTimeout = (*env)->GetStaticFieldID(env, HTLCClaim_class, "LDKHTLCClaim_AcceptedTimeout", "Lorg/ldk/enums/HTLCClaim;"); + CHECK(HTLCClaim_LDKHTLCClaim_AcceptedTimeout != NULL); + HTLCClaim_LDKHTLCClaim_AcceptedPreimage = (*env)->GetStaticFieldID(env, HTLCClaim_class, "LDKHTLCClaim_AcceptedPreimage", "Lorg/ldk/enums/HTLCClaim;"); + CHECK(HTLCClaim_LDKHTLCClaim_AcceptedPreimage != NULL); + HTLCClaim_LDKHTLCClaim_Revocation = (*env)->GetStaticFieldID(env, HTLCClaim_class, "LDKHTLCClaim_Revocation", "Lorg/ldk/enums/HTLCClaim;"); + CHECK(HTLCClaim_LDKHTLCClaim_Revocation != NULL); +} +static inline jclass LDKHTLCClaim_to_java(JNIEnv *env, LDKHTLCClaim val) { + switch (val) { + case LDKHTLCClaim_OfferedTimeout: + return (*env)->GetStaticObjectField(env, HTLCClaim_class, HTLCClaim_LDKHTLCClaim_OfferedTimeout); + case LDKHTLCClaim_OfferedPreimage: + return (*env)->GetStaticObjectField(env, HTLCClaim_class, HTLCClaim_LDKHTLCClaim_OfferedPreimage); + case LDKHTLCClaim_AcceptedTimeout: + return (*env)->GetStaticObjectField(env, HTLCClaim_class, HTLCClaim_LDKHTLCClaim_AcceptedTimeout); + case LDKHTLCClaim_AcceptedPreimage: + return (*env)->GetStaticObjectField(env, HTLCClaim_class, HTLCClaim_LDKHTLCClaim_AcceptedPreimage); + case LDKHTLCClaim_Revocation: + return (*env)->GetStaticObjectField(env, HTLCClaim_class, HTLCClaim_LDKHTLCClaim_Revocation); + default: abort(); + } +} + static inline LDKIOError LDKIOError_from_java(JNIEnv *env, jclass clz) { jint ord = (*env)->CallIntMethod(env, clz, ordinal_meth); if (UNLIKELY((*env)->ExceptionCheck(env))) { @@ -1066,27 +1043,51 @@ uint64_t TxOut_get_value (struct LDKTxOut* thing) { return thing->value;}JNIEXPO return ret_conv; } -static inline struct LDKBlindedRoute CResult_BlindedRouteNoneZ_get_ok(LDKCResult_BlindedRouteNoneZ *NONNULL_PTR owner){ - LDKBlindedRoute ret = *owner->contents.result; - ret.is_owned = false; - return ret; +static jclass LDKCOption_HTLCClaimZ_Some_class = NULL; +static jmethodID LDKCOption_HTLCClaimZ_Some_meth = NULL; +static jclass LDKCOption_HTLCClaimZ_None_class = NULL; +static jmethodID LDKCOption_HTLCClaimZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1HTLCClaimZ_init (JNIEnv *env, jclass clz) { + LDKCOption_HTLCClaimZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_HTLCClaimZ$Some")); + CHECK(LDKCOption_HTLCClaimZ_Some_class != NULL); + LDKCOption_HTLCClaimZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_HTLCClaimZ_Some_class, "", "(Lorg/ldk/enums/HTLCClaim;)V"); + CHECK(LDKCOption_HTLCClaimZ_Some_meth != NULL); + LDKCOption_HTLCClaimZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_HTLCClaimZ$None")); + CHECK(LDKCOption_HTLCClaimZ_None_class != NULL); + LDKCOption_HTLCClaimZ_None_meth = (*env)->GetMethodID(env, LDKCOption_HTLCClaimZ_None_class, "", "()V"); + CHECK(LDKCOption_HTLCClaimZ_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1HTLCClaimZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_HTLCClaimZ *obj = (LDKCOption_HTLCClaimZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_HTLCClaimZ_Some: { + jclass some_conv = LDKHTLCClaim_to_java(env, obj->some); + return (*env)->NewObject(env, LDKCOption_HTLCClaimZ_Some_class, LDKCOption_HTLCClaimZ_Some_meth, some_conv); + } + case LDKCOption_HTLCClaimZ_None: { + return (*env)->NewObject(env, LDKCOption_HTLCClaimZ_None_class, LDKCOption_HTLCClaimZ_None_meth); + } + default: abort(); + } } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_BlindedRouteNoneZ* owner_conv = (LDKCResult_BlindedRouteNoneZ*)untag_ptr(owner); - LDKBlindedRoute ret_var = CResult_BlindedRouteNoneZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +static inline void CResult_NoneNoneZ_get_ok(LDKCResult_NoneNoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner); + CResult_NoneNoneZ_get_ok(owner_conv); } -static inline void CResult_BlindedRouteNoneZ_get_err(LDKCResult_BlindedRouteNoneZ *NONNULL_PTR owner){ +static inline void CResult_NoneNoneZ_get_err(LDKCResult_NoneNoneZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return *owner->contents.err; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_BlindedRouteNoneZ* owner_conv = (LDKCResult_BlindedRouteNoneZ*)untag_ptr(owner); - CResult_BlindedRouteNoneZ_get_err(owner_conv); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner); + CResult_NoneNoneZ_get_err(owner_conv); } static jclass LDKDecodeError_UnknownVersion_class = NULL; @@ -1168,76 +1169,6 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDecodeError_1ref_1from_1 default: abort(); } } -static inline struct LDKBlindedRoute CResult_BlindedRouteDecodeErrorZ_get_ok(LDKCResult_BlindedRouteDecodeErrorZ *NONNULL_PTR owner){ - LDKBlindedRoute ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_BlindedRouteDecodeErrorZ* owner_conv = (LDKCResult_BlindedRouteDecodeErrorZ*)untag_ptr(owner); - LDKBlindedRoute ret_var = CResult_BlindedRouteDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline struct LDKDecodeError CResult_BlindedRouteDecodeErrorZ_get_err(LDKCResult_BlindedRouteDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_BlindedRouteDecodeErrorZ* owner_conv = (LDKCResult_BlindedRouteDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_BlindedRouteDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline struct LDKBlindedHop CResult_BlindedHopDecodeErrorZ_get_ok(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){ - LDKBlindedHop ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner); - LDKBlindedHop ret_var = CResult_BlindedHopDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline struct LDKDecodeError CResult_BlindedHopDecodeErrorZ_get_err(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_BlindedHopDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline void CResult_NoneNoneZ_get_ok(LDKCResult_NoneNoneZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner); - CResult_NoneNoneZ_get_ok(owner_conv); -} - -static inline void CResult_NoneNoneZ_get_err(LDKCResult_NoneNoneZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; -} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner); - CResult_NoneNoneZ_get_err(owner_conv); -} - static inline struct LDKCounterpartyCommitmentSecrets CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR owner){ LDKCounterpartyCommitmentSecrets ret = *owner->contents.result; ret.is_owned = false; @@ -1264,48 +1195,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommit return ret_ref; } -static inline struct LDKSecretKey CResult_SecretKeyErrorZ_get_ok(LDKCResult_SecretKeyErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_SecretKeyErrorZ* owner_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(owner); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_SecretKeyErrorZ_get_ok(owner_conv).bytes); - return ret_arr; -} - -static inline enum LDKSecp256k1Error CResult_SecretKeyErrorZ_get_err(LDKCResult_SecretKeyErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; -} -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_SecretKeyErrorZ* owner_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKSecp256k1Error_to_java(env, CResult_SecretKeyErrorZ_get_err(owner_conv)); - return ret_conv; -} - -static inline struct LDKPublicKey CResult_PublicKeyErrorZ_get_ok(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_PublicKeyErrorZ* owner_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(owner); - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, CResult_PublicKeyErrorZ_get_ok(owner_conv).compressed_form); - return ret_arr; -} - -static inline enum LDKSecp256k1Error CResult_PublicKeyErrorZ_get_err(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; -} -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_PublicKeyErrorZ* owner_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKSecp256k1Error_to_java(env, CResult_PublicKeyErrorZ_get_err(owner_conv)); - return ret_conv; -} - static inline struct LDKTxCreationKeys CResult_TxCreationKeysDecodeErrorZ_get_ok(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR owner){ LDKTxCreationKeys ret = *owner->contents.result; ret.is_owned = false; @@ -1358,30 +1247,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysD return ret_ref; } -static inline struct LDKTxCreationKeys CResult_TxCreationKeysErrorZ_get_ok(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR owner){ - LDKTxCreationKeys ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_TxCreationKeysErrorZ* owner_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(owner); - LDKTxCreationKeys ret_var = CResult_TxCreationKeysErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline enum LDKSecp256k1Error CResult_TxCreationKeysErrorZ_get_err(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; -} -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_TxCreationKeysErrorZ* owner_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKSecp256k1Error_to_java(env, CResult_TxCreationKeysErrorZ_get_err(owner_conv)); - return ret_conv; -} - static jclass LDKCOption_u32Z_Some_class = NULL; static jmethodID LDKCOption_u32Z_Some_meth = NULL; static jclass LDKCOption_u32Z_None_class = NULL; @@ -1695,6 +1560,81 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInva return ret_ref; } +static inline struct LDKBlindedPath CResult_BlindedPathNoneZ_get_ok(LDKCResult_BlindedPathNoneZ *NONNULL_PTR owner){ + LDKBlindedPath ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedPathNoneZ* owner_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(owner); + LDKBlindedPath ret_var = CResult_BlindedPathNoneZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline void CResult_BlindedPathNoneZ_get_err(LDKCResult_BlindedPathNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedPathNoneZ* owner_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(owner); + CResult_BlindedPathNoneZ_get_err(owner_conv); +} + +static inline struct LDKBlindedPath CResult_BlindedPathDecodeErrorZ_get_ok(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR owner){ + LDKBlindedPath ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedPathDecodeErrorZ* owner_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(owner); + LDKBlindedPath ret_var = CResult_BlindedPathDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_BlindedPathDecodeErrorZ_get_err(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedPathDecodeErrorZ* owner_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_BlindedPathDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKBlindedHop CResult_BlindedHopDecodeErrorZ_get_ok(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){ + LDKBlindedHop ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner); + LDKBlindedHop ret_var = CResult_BlindedHopDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_BlindedHopDecodeErrorZ_get_err(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_BlindedHopDecodeErrorZ* owner_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_BlindedHopDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline LDKCVec_RouteHopZ CVec_RouteHopZ_clone(const LDKCVec_RouteHopZ *orig) { LDKCVec_RouteHopZ ret = { .data = MALLOC(sizeof(LDKRouteHop) * orig->datalen, "LDKCVec_RouteHopZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -2330,98 +2270,41 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1get_1er return ret_conv; } -static inline struct LDKRouteHop CResult_RouteHopDecodeErrorZ_get_ok(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner){ - LDKRouteHop ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(owner); - LDKRouteHop ret_var = CResult_RouteHopDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline struct LDKDecodeError CResult_RouteHopDecodeErrorZ_get_err(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_RouteHopDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline LDKCVec_CVec_RouteHopZZ CVec_CVec_RouteHopZZ_clone(const LDKCVec_CVec_RouteHopZZ *orig) { - LDKCVec_CVec_RouteHopZZ ret = { .data = MALLOC(sizeof(LDKCVec_RouteHopZ) * orig->datalen, "LDKCVec_CVec_RouteHopZZ clone bytes"), .datalen = orig->datalen }; +static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) { + LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = CVec_RouteHopZ_clone(&orig->data[i]); + ret.data[i] = ChannelDetails_clone(&orig->data[i]); } return ret; } -static inline struct LDKRoute CResult_RouteDecodeErrorZ_get_ok(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKRoute CResult_RouteLightningErrorZ_get_ok(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){ LDKRoute ret = *owner->contents.result; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_RouteDecodeErrorZ* owner_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(owner); - LDKRoute ret_var = CResult_RouteDecodeErrorZ_get_ok(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner); + LDKRoute ret_var = CResult_RouteLightningErrorZ_get_ok(owner_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline struct LDKDecodeError CResult_RouteDecodeErrorZ_get_err(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_RouteDecodeErrorZ* owner_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_RouteDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline struct LDKRouteParameters CResult_RouteParametersDecodeErrorZ_get_ok(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner){ - LDKRouteParameters ret = *owner->contents.result; +static inline struct LDKLightningError CResult_RouteLightningErrorZ_get_err(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){ + LDKLightningError ret = *owner->contents.err; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_RouteParametersDecodeErrorZ* owner_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(owner); - LDKRouteParameters ret_var = CResult_RouteParametersDecodeErrorZ_get_ok(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner); + LDKLightningError ret_var = CResult_RouteLightningErrorZ_get_err(owner_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline struct LDKDecodeError CResult_RouteParametersDecodeErrorZ_get_err(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_RouteParametersDecodeErrorZ* owner_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_RouteParametersDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline LDKCVec_RouteHintZ CVec_RouteHintZ_clone(const LDKCVec_RouteHintZ *orig) { - LDKCVec_RouteHintZ ret = { .data = MALLOC(sizeof(LDKRouteHint) * orig->datalen, "LDKCVec_RouteHintZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = RouteHint_clone(&orig->data[i]); - } - return ret; -} static jclass LDKCOption_u64Z_Some_class = NULL; static jmethodID LDKCOption_u64Z_Some_meth = NULL; static jclass LDKCOption_u64Z_None_class = NULL; @@ -2451,6 +2334,124 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u64Z_1ref_1from default: abort(); } } +static inline struct LDKInFlightHtlcs CResult_InFlightHtlcsDecodeErrorZ_get_ok(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner){ + LDKInFlightHtlcs ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_InFlightHtlcsDecodeErrorZ* owner_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(owner); + LDKInFlightHtlcs ret_var = CResult_InFlightHtlcsDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_InFlightHtlcsDecodeErrorZ_get_err(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_InFlightHtlcsDecodeErrorZ* owner_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_InFlightHtlcsDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKRouteHop CResult_RouteHopDecodeErrorZ_get_ok(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner){ + LDKRouteHop ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(owner); + LDKRouteHop ret_var = CResult_RouteHopDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_RouteHopDecodeErrorZ_get_err(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_RouteHopDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline LDKCVec_CVec_RouteHopZZ CVec_CVec_RouteHopZZ_clone(const LDKCVec_CVec_RouteHopZZ *orig) { + LDKCVec_CVec_RouteHopZZ ret = { .data = MALLOC(sizeof(LDKCVec_RouteHopZ) * orig->datalen, "LDKCVec_CVec_RouteHopZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = CVec_RouteHopZ_clone(&orig->data[i]); + } + return ret; +} +static inline struct LDKRoute CResult_RouteDecodeErrorZ_get_ok(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner){ + LDKRoute ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_RouteDecodeErrorZ* owner_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(owner); + LDKRoute ret_var = CResult_RouteDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_RouteDecodeErrorZ_get_err(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_RouteDecodeErrorZ* owner_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_RouteDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKRouteParameters CResult_RouteParametersDecodeErrorZ_get_ok(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner){ + LDKRouteParameters ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_RouteParametersDecodeErrorZ* owner_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(owner); + LDKRouteParameters ret_var = CResult_RouteParametersDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_RouteParametersDecodeErrorZ_get_err(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_RouteParametersDecodeErrorZ* owner_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_RouteParametersDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline LDKCVec_RouteHintZ CVec_RouteHintZ_clone(const LDKCVec_RouteHintZ *orig) { + LDKCVec_RouteHintZ ret = { .data = MALLOC(sizeof(LDKRouteHint) * orig->datalen, "LDKCVec_RouteHintZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = RouteHint_clone(&orig->data[i]); + } + return ret; +} 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); @@ -2541,41 +2542,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecode return ret_ref; } -static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) { - LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = ChannelDetails_clone(&orig->data[i]); - } - return ret; -} -static inline struct LDKRoute CResult_RouteLightningErrorZ_get_ok(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){ - LDKRoute ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner); - LDKRoute ret_var = CResult_RouteLightningErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline struct LDKLightningError CResult_RouteLightningErrorZ_get_err(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){ - LDKLightningError ret = *owner->contents.err; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner); - LDKLightningError ret_var = CResult_RouteLightningErrorZ_get_err(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - static jclass LDKPaymentPurpose_InvoicePayment_class = NULL; static jmethodID LDKPaymentPurpose_InvoicePayment_meth = NULL; static jclass LDKPaymentPurpose_SpontaneousPayment_class = NULL; @@ -2783,6 +2749,8 @@ static jclass LDKHTLCDestination_NextHopChannel_class = NULL; static jmethodID LDKHTLCDestination_NextHopChannel_meth = NULL; static jclass LDKHTLCDestination_UnknownNextHop_class = NULL; static jmethodID LDKHTLCDestination_UnknownNextHop_meth = NULL; +static jclass LDKHTLCDestination_InvalidForward_class = NULL; +static jmethodID LDKHTLCDestination_InvalidForward_meth = NULL; static jclass LDKHTLCDestination_FailedPayment_class = NULL; static jmethodID LDKHTLCDestination_FailedPayment_meth = NULL; JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKHTLCDestination_init (JNIEnv *env, jclass clz) { @@ -2796,6 +2764,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKHTLCDestination_init ( CHECK(LDKHTLCDestination_UnknownNextHop_class != NULL); LDKHTLCDestination_UnknownNextHop_meth = (*env)->GetMethodID(env, LDKHTLCDestination_UnknownNextHop_class, "", "(J)V"); CHECK(LDKHTLCDestination_UnknownNextHop_meth != NULL); + LDKHTLCDestination_InvalidForward_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKHTLCDestination$InvalidForward")); + CHECK(LDKHTLCDestination_InvalidForward_class != NULL); + LDKHTLCDestination_InvalidForward_meth = (*env)->GetMethodID(env, LDKHTLCDestination_InvalidForward_class, "", "(J)V"); + CHECK(LDKHTLCDestination_InvalidForward_meth != NULL); LDKHTLCDestination_FailedPayment_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKHTLCDestination$FailedPayment")); CHECK(LDKHTLCDestination_FailedPayment_class != NULL); @@ -2816,6 +2789,10 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKHTLCDestination_1ref_1fr int64_t requested_forward_scid_conv = obj->unknown_next_hop.requested_forward_scid; return (*env)->NewObject(env, LDKHTLCDestination_UnknownNextHop_class, LDKHTLCDestination_UnknownNextHop_meth, requested_forward_scid_conv); } + case LDKHTLCDestination_InvalidForward: { + int64_t requested_forward_scid_conv = obj->invalid_forward.requested_forward_scid; + return (*env)->NewObject(env, LDKHTLCDestination_InvalidForward_class, LDKHTLCDestination_InvalidForward_meth, requested_forward_scid_conv); + } case LDKHTLCDestination_FailedPayment: { int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->failed_payment.payment_hash.data); @@ -2877,6 +2854,36 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDesti return ret_ref; } +static jclass LDKCOption_u128Z_Some_class = NULL; +static jmethodID LDKCOption_u128Z_Some_meth = NULL; +static jclass LDKCOption_u128Z_None_class = NULL; +static jmethodID LDKCOption_u128Z_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1u128Z_init (JNIEnv *env, jclass clz) { + LDKCOption_u128Z_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u128Z$Some")); + CHECK(LDKCOption_u128Z_Some_class != NULL); + LDKCOption_u128Z_Some_meth = (*env)->GetMethodID(env, LDKCOption_u128Z_Some_class, "", "([B)V"); + CHECK(LDKCOption_u128Z_Some_meth != NULL); + LDKCOption_u128Z_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_u128Z$None")); + CHECK(LDKCOption_u128Z_None_class != NULL); + LDKCOption_u128Z_None_meth = (*env)->GetMethodID(env, LDKCOption_u128Z_None_class, "", "()V"); + CHECK(LDKCOption_u128Z_None_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u128Z_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_u128Z *obj = (LDKCOption_u128Z*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_u128Z_Some: { + int8_tArray some_arr = (*env)->NewByteArray(env, 16); + (*env)->SetByteArrayRegion(env, some_arr, 0, 16, obj->some.le_bytes); + return (*env)->NewObject(env, LDKCOption_u128Z_Some_class, LDKCOption_u128Z_Some_meth, some_arr); + } + case LDKCOption_u128Z_None: { + return (*env)->NewObject(env, LDKCOption_u128Z_None_class, LDKCOption_u128Z_None_meth); + } + default: abort(); + } +} static jclass LDKNetworkUpdate_ChannelUpdateMessage_class = NULL; static jmethodID LDKNetworkUpdate_ChannelUpdateMessage_meth = NULL; static jclass LDKNetworkUpdate_ChannelFailure_class = NULL; @@ -3013,8 +3020,8 @@ static inline LDKCVec_SpendableOutputDescriptorZ CVec_SpendableOutputDescriptorZ } 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_PaymentClaimable_class = NULL; +static jmethodID LDKEvent_PaymentClaimable_meth = NULL; static jclass LDKEvent_PaymentClaimed_class = NULL; static jmethodID LDKEvent_PaymentClaimed_meth = NULL; static jclass LDKEvent_PaymentSent_class = NULL; @@ -3031,10 +3038,14 @@ static jclass LDKEvent_ProbeFailed_class = NULL; static jmethodID LDKEvent_ProbeFailed_meth = NULL; static jclass LDKEvent_PendingHTLCsForwardable_class = NULL; static jmethodID LDKEvent_PendingHTLCsForwardable_meth = NULL; +static jclass LDKEvent_HTLCIntercepted_class = NULL; +static jmethodID LDKEvent_HTLCIntercepted_meth = NULL; static jclass LDKEvent_SpendableOutputs_class = NULL; static jmethodID LDKEvent_SpendableOutputs_meth = NULL; static jclass LDKEvent_PaymentForwarded_class = NULL; static jmethodID LDKEvent_PaymentForwarded_meth = NULL; +static jclass LDKEvent_ChannelReady_class = NULL; +static jmethodID LDKEvent_ChannelReady_meth = NULL; static jclass LDKEvent_ChannelClosed_class = NULL; static jmethodID LDKEvent_ChannelClosed_meth = NULL; static jclass LDKEvent_DiscardFunding_class = NULL; @@ -3047,17 +3058,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *en 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, "", "([B[BJ[BJ)V"); + LDKEvent_FundingGenerationReady_meth = (*env)->GetMethodID(env, LDKEvent_FundingGenerationReady_class, "", "([B[BJ[B[B)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_PaymentClaimable_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentClaimable")); + CHECK(LDKEvent_PaymentClaimable_class != NULL); + LDKEvent_PaymentClaimable_meth = (*env)->GetMethodID(env, LDKEvent_PaymentClaimable_class, "", "([B[BJJ[BJ)V"); + CHECK(LDKEvent_PaymentClaimable_meth != NULL); LDKEvent_PaymentClaimed_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentClaimed")); CHECK(LDKEvent_PaymentClaimed_class != NULL); - LDKEvent_PaymentClaimed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentClaimed_class, "", "([BJJ)V"); + LDKEvent_PaymentClaimed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentClaimed_class, "", "([B[BJJ)V"); CHECK(LDKEvent_PaymentClaimed_meth != NULL); LDKEvent_PaymentSent_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$PaymentSent")); @@ -3094,6 +3105,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *en CHECK(LDKEvent_PendingHTLCsForwardable_class != NULL); LDKEvent_PendingHTLCsForwardable_meth = (*env)->GetMethodID(env, LDKEvent_PendingHTLCsForwardable_class, "", "(J)V"); CHECK(LDKEvent_PendingHTLCsForwardable_meth != NULL); + LDKEvent_HTLCIntercepted_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$HTLCIntercepted")); + CHECK(LDKEvent_HTLCIntercepted_class != NULL); + LDKEvent_HTLCIntercepted_meth = (*env)->GetMethodID(env, LDKEvent_HTLCIntercepted_class, "", "([BJ[BJJ)V"); + CHECK(LDKEvent_HTLCIntercepted_meth != NULL); LDKEvent_SpendableOutputs_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$SpendableOutputs")); CHECK(LDKEvent_SpendableOutputs_class != NULL); @@ -3104,10 +3120,15 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *en CHECK(LDKEvent_PaymentForwarded_class != NULL); LDKEvent_PaymentForwarded_meth = (*env)->GetMethodID(env, LDKEvent_PaymentForwarded_class, "", "([B[BJZ)V"); CHECK(LDKEvent_PaymentForwarded_meth != NULL); + LDKEvent_ChannelReady_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$ChannelReady")); + CHECK(LDKEvent_ChannelReady_class != NULL); + LDKEvent_ChannelReady_meth = (*env)->GetMethodID(env, LDKEvent_ChannelReady_class, "", "([B[B[BJ)V"); + CHECK(LDKEvent_ChannelReady_meth != NULL); LDKEvent_ChannelClosed_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$ChannelClosed")); CHECK(LDKEvent_ChannelClosed_class != NULL); - LDKEvent_ChannelClosed_meth = (*env)->GetMethodID(env, LDKEvent_ChannelClosed_class, "", "([BJJ)V"); + LDKEvent_ChannelClosed_meth = (*env)->GetMethodID(env, LDKEvent_ChannelClosed_class, "", "([B[BJ)V"); CHECK(LDKEvent_ChannelClosed_meth != NULL); LDKEvent_DiscardFunding_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKEvent$DiscardFunding")); @@ -3137,22 +3158,30 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN 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, counterparty_node_id_arr, channel_value_satoshis_conv, output_script_arr, user_channel_id_conv); + int8_tArray user_channel_id_arr = (*env)->NewByteArray(env, 16); + (*env)->SetByteArrayRegion(env, user_channel_id_arr, 0, 16, obj->funding_generation_ready.user_channel_id.le_bytes); + return (*env)->NewObject(env, LDKEvent_FundingGenerationReady_class, LDKEvent_FundingGenerationReady_meth, temporary_channel_id_arr, counterparty_node_id_arr, channel_value_satoshis_conv, output_script_arr, user_channel_id_arr); } - case LDKEvent_PaymentReceived: { + case LDKEvent_PaymentClaimable: { + int8_tArray receiver_node_id_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, receiver_node_id_arr, 0, 33, obj->payment_claimable.receiver_node_id.compressed_form); 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 amount_msat_conv = obj->payment_received.amount_msat; - int64_t purpose_ref = tag_ptr(&obj->payment_received.purpose, false); - return (*env)->NewObject(env, LDKEvent_PaymentReceived_class, LDKEvent_PaymentReceived_meth, payment_hash_arr, amount_msat_conv, purpose_ref); + (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_claimable.payment_hash.data); + int64_t amount_msat_conv = obj->payment_claimable.amount_msat; + int64_t purpose_ref = tag_ptr(&obj->payment_claimable.purpose, false); + int8_tArray via_channel_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, via_channel_id_arr, 0, 32, obj->payment_claimable.via_channel_id.data); + int64_t via_user_channel_id_ref = tag_ptr(&obj->payment_claimable.via_user_channel_id, false); + return (*env)->NewObject(env, LDKEvent_PaymentClaimable_class, LDKEvent_PaymentClaimable_meth, receiver_node_id_arr, payment_hash_arr, amount_msat_conv, purpose_ref, via_channel_id_arr, via_user_channel_id_ref); } case LDKEvent_PaymentClaimed: { + int8_tArray receiver_node_id_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, receiver_node_id_arr, 0, 33, obj->payment_claimed.receiver_node_id.compressed_form); 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 = tag_ptr(&obj->payment_claimed.purpose, false); - return (*env)->NewObject(env, LDKEvent_PaymentClaimed_class, LDKEvent_PaymentClaimed_meth, payment_hash_arr, amount_msat_conv, purpose_ref); + return (*env)->NewObject(env, LDKEvent_PaymentClaimed_class, LDKEvent_PaymentClaimed_meth, receiver_node_id_arr, payment_hash_arr, amount_msat_conv, purpose_ref); } case LDKEvent_PaymentSent: { int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); @@ -3260,6 +3289,16 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN 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); } + case LDKEvent_HTLCIntercepted: { + int8_tArray intercept_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, intercept_id_arr, 0, 32, obj->htlc_intercepted.intercept_id.data); + int64_t requested_next_hop_scid_conv = obj->htlc_intercepted.requested_next_hop_scid; + int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->htlc_intercepted.payment_hash.data); + int64_t inbound_amount_msat_conv = obj->htlc_intercepted.inbound_amount_msat; + int64_t expected_outbound_amount_msat_conv = obj->htlc_intercepted.expected_outbound_amount_msat; + return (*env)->NewObject(env, LDKEvent_HTLCIntercepted_class, LDKEvent_HTLCIntercepted_meth, intercept_id_arr, requested_next_hop_scid_conv, payment_hash_arr, inbound_amount_msat_conv, expected_outbound_amount_msat_conv); + } case LDKEvent_SpendableOutputs: { LDKCVec_SpendableOutputDescriptorZ outputs_var = obj->spendable_outputs.outputs; int64_tArray outputs_arr = NULL; @@ -3281,12 +3320,26 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN jboolean claim_from_onchain_tx_conv = obj->payment_forwarded.claim_from_onchain_tx; 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_ChannelReady: { + int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, channel_id_arr, 0, 32, obj->channel_ready.channel_id.data); + int8_tArray user_channel_id_arr = (*env)->NewByteArray(env, 16); + (*env)->SetByteArrayRegion(env, user_channel_id_arr, 0, 16, obj->channel_ready.user_channel_id.le_bytes); + int8_tArray counterparty_node_id_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, counterparty_node_id_arr, 0, 33, obj->channel_ready.counterparty_node_id.compressed_form); + LDKChannelTypeFeatures channel_type_var = obj->channel_ready.channel_type; + int64_t channel_type_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_var); + channel_type_ref = tag_ptr(channel_type_var.inner, false); + return (*env)->NewObject(env, LDKEvent_ChannelReady_class, LDKEvent_ChannelReady_meth, channel_id_arr, user_channel_id_arr, counterparty_node_id_arr, channel_type_ref); + } case LDKEvent_ChannelClosed: { int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32); (*env)->SetByteArrayRegion(env, channel_id_arr, 0, 32, obj->channel_closed.channel_id.data); - int64_t user_channel_id_conv = obj->channel_closed.user_channel_id; + int8_tArray user_channel_id_arr = (*env)->NewByteArray(env, 16); + (*env)->SetByteArrayRegion(env, user_channel_id_arr, 0, 16, obj->channel_closed.user_channel_id.le_bytes); int64_t reason_ref = tag_ptr(&obj->channel_closed.reason, false); - return (*env)->NewObject(env, LDKEvent_ChannelClosed_class, LDKEvent_ChannelClosed_meth, channel_id_arr, user_channel_id_conv, reason_ref); + return (*env)->NewObject(env, LDKEvent_ChannelClosed_class, LDKEvent_ChannelClosed_meth, channel_id_arr, user_channel_id_arr, reason_ref); } case LDKEvent_DiscardFunding: { int8_tArray channel_id_arr = (*env)->NewByteArray(env, 32); @@ -3837,10 +3890,30 @@ static inline LDKCVec_C2Tuple_usizeTransactionZZ CVec_C2Tuple_usizeTransactionZZ } 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 }; +static inline struct LDKThirtyTwoBytes C2Tuple_TxidBlockHashZ_get_a(LDKC2Tuple_TxidBlockHashZ *NONNULL_PTR owner){ + return ThirtyTwoBytes_clone(&owner->a); +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidBlockHashZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_TxidBlockHashZ* owner_conv = (LDKC2Tuple_TxidBlockHashZ*)untag_ptr(owner); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_TxidBlockHashZ_get_a(owner_conv).data); + return ret_arr; +} + +static inline struct LDKThirtyTwoBytes C2Tuple_TxidBlockHashZ_get_b(LDKC2Tuple_TxidBlockHashZ *NONNULL_PTR owner){ + return ThirtyTwoBytes_clone(&owner->b); +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidBlockHashZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_TxidBlockHashZ* owner_conv = (LDKC2Tuple_TxidBlockHashZ*)untag_ptr(owner); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_TxidBlockHashZ_get_b(owner_conv).data); + return ret_arr; +} + +static inline LDKCVec_C2Tuple_TxidBlockHashZZ CVec_C2Tuple_TxidBlockHashZZ_clone(const LDKCVec_C2Tuple_TxidBlockHashZZ *orig) { + LDKCVec_C2Tuple_TxidBlockHashZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_TxidBlockHashZ) * orig->datalen, "LDKCVec_C2Tuple_TxidBlockHashZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]); + ret.data[i] = C2Tuple_TxidBlockHashZ_clone(&orig->data[i]); } return ret; } @@ -4279,6 +4352,58 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeature return ret_ref; } +static inline struct LDKOfferFeatures CResult_OfferFeaturesDecodeErrorZ_get_ok(LDKCResult_OfferFeaturesDecodeErrorZ *NONNULL_PTR owner){ + LDKOfferFeatures ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OfferFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_OfferFeaturesDecodeErrorZ* owner_conv = (LDKCResult_OfferFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKOfferFeatures ret_var = CResult_OfferFeaturesDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_OfferFeaturesDecodeErrorZ_get_err(LDKCResult_OfferFeaturesDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OfferFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_OfferFeaturesDecodeErrorZ* owner_conv = (LDKCResult_OfferFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_OfferFeaturesDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKInvoiceRequestFeatures CResult_InvoiceRequestFeaturesDecodeErrorZ_get_ok(LDKCResult_InvoiceRequestFeaturesDecodeErrorZ *NONNULL_PTR owner){ + LDKInvoiceRequestFeatures ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestFeaturesDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_InvoiceRequestFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InvoiceRequestFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKInvoiceRequestFeatures ret_var = CResult_InvoiceRequestFeaturesDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_InvoiceRequestFeaturesDecodeErrorZ_get_err(LDKCResult_InvoiceRequestFeaturesDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestFeaturesDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_InvoiceRequestFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InvoiceRequestFeaturesDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_InvoiceRequestFeaturesDecodeErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline struct LDKNodeId CResult_NodeIdDecodeErrorZ_get_ok(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){ LDKNodeId ret = *owner->contents.result; ret.is_owned = false; @@ -5173,7 +5298,7 @@ typedef struct LDKBaseSign_JCalls { jmethodID sign_closing_transaction_meth; jmethodID sign_holder_anchor_input_meth; jmethodID sign_channel_announcement_meth; - jmethodID ready_channel_meth; + jmethodID provide_channel_parameters_meth; } LDKBaseSign_JCalls; static void LDKBaseSign_JCalls_free(void* this_arg) { LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg; @@ -5605,7 +5730,7 @@ LDKCResult_C2Tuple_SignatureSignatureZNoneZ sign_channel_announcement_LDKBaseSig } return ret_conv; } -void ready_channel_LDKBaseSign_jcall(void* this_arg, const LDKChannelTransactionParameters * channel_parameters) { +void provide_channel_parameters_LDKBaseSign_jcall(void* this_arg, const LDKChannelTransactionParameters * channel_parameters) { 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); @@ -5621,10 +5746,10 @@ void ready_channel_LDKBaseSign_jcall(void* this_arg, const LDKChannelTransaction channel_parameters_ref = tag_ptr(channel_parameters_var.inner, channel_parameters_var.is_owned); jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - (*env)->CallVoidMethod(env, obj, j_calls->ready_channel_meth, channel_parameters_ref); + (*env)->CallVoidMethod(env, obj, j_calls->provide_channel_parameters_meth, channel_parameters_ref); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to ready_channel in LDKBaseSign from rust threw an exception."); + (*env)->FatalError(env, "A call to provide_channel_parameters in LDKBaseSign from rust threw an exception."); } if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); @@ -5663,8 +5788,8 @@ static inline LDKBaseSign LDKBaseSign_init (JNIEnv *env, jclass clz, jobject o, CHECK(calls->sign_holder_anchor_input_meth != NULL); calls->sign_channel_announcement_meth = (*env)->GetMethodID(env, c, "sign_channel_announcement", "(J)J"); CHECK(calls->sign_channel_announcement_meth != NULL); - calls->ready_channel_meth = (*env)->GetMethodID(env, c, "ready_channel", "(J)V"); - CHECK(calls->ready_channel_meth != NULL); + calls->provide_channel_parameters_meth = (*env)->GetMethodID(env, c, "provide_channel_parameters", "(J)V"); + CHECK(calls->provide_channel_parameters_meth != NULL); LDKChannelPublicKeys pubkeys_conv; pubkeys_conv.inner = untag_ptr(pubkeys); @@ -5686,7 +5811,7 @@ static inline LDKBaseSign LDKBaseSign_init (JNIEnv *env, jclass clz, jobject o, .sign_closing_transaction = sign_closing_transaction_LDKBaseSign_jcall, .sign_holder_anchor_input = sign_holder_anchor_input_LDKBaseSign_jcall, .sign_channel_announcement = sign_channel_announcement_LDKBaseSign_jcall, - .ready_channel = ready_channel_LDKBaseSign_jcall, + .provide_channel_parameters = provide_channel_parameters_LDKBaseSign_jcall, .free = LDKBaseSign_JCalls_free, .pubkeys = pubkeys_conv, .set_pubkeys = NULL, @@ -5911,7 +6036,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1channel_1an return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BaseSign_1ready_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_parameters) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BaseSign_1provide_1channel_1parameters(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_parameters) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr; @@ -5920,7 +6045,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BaseSign_1ready_1channel(JNIEn channel_parameters_conv.is_owned = ptr_is_owned(channel_parameters); CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv); channel_parameters_conv.is_owned = false; - (this_arg_conv->ready_channel)(this_arg_conv->this_arg, &channel_parameters_conv); + (this_arg_conv->provide_channel_parameters)(this_arg_conv->this_arg, &channel_parameters_conv); } LDKChannelPublicKeys LDKBaseSign_set_get_pubkeys(LDKBaseSign* this_arg) { @@ -6267,8 +6392,8 @@ static jclass LDKAPIError_APIMisuseError_class = NULL; static jmethodID LDKAPIError_APIMisuseError_meth = NULL; static jclass LDKAPIError_FeeRateTooHigh_class = NULL; static jmethodID LDKAPIError_FeeRateTooHigh_meth = NULL; -static jclass LDKAPIError_RouteError_class = NULL; -static jmethodID LDKAPIError_RouteError_meth = NULL; +static jclass LDKAPIError_InvalidRoute_class = NULL; +static jmethodID LDKAPIError_InvalidRoute_meth = NULL; static jclass LDKAPIError_ChannelUnavailable_class = NULL; static jmethodID LDKAPIError_ChannelUnavailable_meth = NULL; static jclass LDKAPIError_MonitorUpdateInProgress_class = NULL; @@ -6286,11 +6411,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAPIError_init (JNIEnv CHECK(LDKAPIError_FeeRateTooHigh_class != NULL); LDKAPIError_FeeRateTooHigh_meth = (*env)->GetMethodID(env, LDKAPIError_FeeRateTooHigh_class, "", "(Ljava/lang/String;I)V"); CHECK(LDKAPIError_FeeRateTooHigh_meth != NULL); - LDKAPIError_RouteError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$RouteError")); - CHECK(LDKAPIError_RouteError_class != NULL); - LDKAPIError_RouteError_meth = (*env)->GetMethodID(env, LDKAPIError_RouteError_class, "", "(Ljava/lang/String;)V"); - CHECK(LDKAPIError_RouteError_meth != NULL); + LDKAPIError_InvalidRoute_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$InvalidRoute")); + CHECK(LDKAPIError_InvalidRoute_class != NULL); + LDKAPIError_InvalidRoute_meth = (*env)->GetMethodID(env, LDKAPIError_InvalidRoute_class, "", "(Ljava/lang/String;)V"); + CHECK(LDKAPIError_InvalidRoute_meth != NULL); LDKAPIError_ChannelUnavailable_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKAPIError$ChannelUnavailable")); CHECK(LDKAPIError_ChannelUnavailable_class != NULL); @@ -6321,10 +6446,10 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAPIError_1ref_1from_1ptr int32_t feerate_conv = obj->fee_rate_too_high.feerate; return (*env)->NewObject(env, LDKAPIError_FeeRateTooHigh_class, LDKAPIError_FeeRateTooHigh_meth, err_conv, feerate_conv); } - case LDKAPIError_RouteError: { - LDKStr err_str = obj->route_error.err; + case LDKAPIError_InvalidRoute: { + LDKStr err_str = obj->invalid_route.err; jstring err_conv = str_ref_to_java(env, err_str.chars, err_str.len); - return (*env)->NewObject(env, LDKAPIError_RouteError_class, LDKAPIError_RouteError_meth, err_conv); + return (*env)->NewObject(env, LDKAPIError_InvalidRoute_class, LDKAPIError_InvalidRoute_meth, err_conv); } case LDKAPIError_ChannelUnavailable: { LDKStr err_str = obj->channel_unavailable.err; @@ -6406,8 +6531,10 @@ static jclass LDKPaymentSendFailure_ParameterError_class = NULL; static jmethodID LDKPaymentSendFailure_ParameterError_meth = NULL; static jclass LDKPaymentSendFailure_PathParameterError_class = NULL; static jmethodID LDKPaymentSendFailure_PathParameterError_meth = NULL; -static jclass LDKPaymentSendFailure_AllFailedRetrySafe_class = NULL; -static jmethodID LDKPaymentSendFailure_AllFailedRetrySafe_meth = NULL; +static jclass LDKPaymentSendFailure_AllFailedResendSafe_class = NULL; +static jmethodID LDKPaymentSendFailure_AllFailedResendSafe_meth = NULL; +static jclass LDKPaymentSendFailure_DuplicatePayment_class = NULL; +static jmethodID LDKPaymentSendFailure_DuplicatePayment_meth = NULL; static jclass LDKPaymentSendFailure_PartialFailure_class = NULL; static jmethodID LDKPaymentSendFailure_PartialFailure_meth = NULL; JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentSendFailure_init (JNIEnv *env, jclass clz) { @@ -6421,11 +6548,16 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentSendFailure_ini CHECK(LDKPaymentSendFailure_PathParameterError_class != NULL); LDKPaymentSendFailure_PathParameterError_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_PathParameterError_class, "", "([J)V"); CHECK(LDKPaymentSendFailure_PathParameterError_meth != NULL); - LDKPaymentSendFailure_AllFailedRetrySafe_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$AllFailedRetrySafe")); - CHECK(LDKPaymentSendFailure_AllFailedRetrySafe_class != NULL); - LDKPaymentSendFailure_AllFailedRetrySafe_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_AllFailedRetrySafe_class, "", "([J)V"); - CHECK(LDKPaymentSendFailure_AllFailedRetrySafe_meth != NULL); + LDKPaymentSendFailure_AllFailedResendSafe_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$AllFailedResendSafe")); + CHECK(LDKPaymentSendFailure_AllFailedResendSafe_class != NULL); + LDKPaymentSendFailure_AllFailedResendSafe_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_AllFailedResendSafe_class, "", "([J)V"); + CHECK(LDKPaymentSendFailure_AllFailedResendSafe_meth != NULL); + LDKPaymentSendFailure_DuplicatePayment_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$DuplicatePayment")); + CHECK(LDKPaymentSendFailure_DuplicatePayment_class != NULL); + LDKPaymentSendFailure_DuplicatePayment_meth = (*env)->GetMethodID(env, LDKPaymentSendFailure_DuplicatePayment_class, "", "()V"); + CHECK(LDKPaymentSendFailure_DuplicatePayment_meth != NULL); LDKPaymentSendFailure_PartialFailure_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKPaymentSendFailure$PartialFailure")); CHECK(LDKPaymentSendFailure_PartialFailure_class != NULL); @@ -6453,17 +6585,20 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentSendFailure_1ref_ (*env)->ReleasePrimitiveArrayCritical(env, path_parameter_error_arr, path_parameter_error_arr_ptr, 0); return (*env)->NewObject(env, LDKPaymentSendFailure_PathParameterError_class, LDKPaymentSendFailure_PathParameterError_meth, path_parameter_error_arr); } - case LDKPaymentSendFailure_AllFailedRetrySafe: { - LDKCVec_APIErrorZ all_failed_retry_safe_var = obj->all_failed_retry_safe; - int64_tArray all_failed_retry_safe_arr = NULL; - all_failed_retry_safe_arr = (*env)->NewLongArray(env, all_failed_retry_safe_var.datalen); - int64_t *all_failed_retry_safe_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, all_failed_retry_safe_arr, NULL); - for (size_t k = 0; k < all_failed_retry_safe_var.datalen; k++) { - int64_t all_failed_retry_safe_conv_10_ref = tag_ptr(&all_failed_retry_safe_var.data[k], false); - all_failed_retry_safe_arr_ptr[k] = all_failed_retry_safe_conv_10_ref; + case LDKPaymentSendFailure_AllFailedResendSafe: { + LDKCVec_APIErrorZ all_failed_resend_safe_var = obj->all_failed_resend_safe; + int64_tArray all_failed_resend_safe_arr = NULL; + all_failed_resend_safe_arr = (*env)->NewLongArray(env, all_failed_resend_safe_var.datalen); + int64_t *all_failed_resend_safe_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, all_failed_resend_safe_arr, NULL); + for (size_t k = 0; k < all_failed_resend_safe_var.datalen; k++) { + int64_t all_failed_resend_safe_conv_10_ref = tag_ptr(&all_failed_resend_safe_var.data[k], false); + all_failed_resend_safe_arr_ptr[k] = all_failed_resend_safe_conv_10_ref; } - (*env)->ReleasePrimitiveArrayCritical(env, all_failed_retry_safe_arr, all_failed_retry_safe_arr_ptr, 0); - return (*env)->NewObject(env, LDKPaymentSendFailure_AllFailedRetrySafe_class, LDKPaymentSendFailure_AllFailedRetrySafe_meth, all_failed_retry_safe_arr); + (*env)->ReleasePrimitiveArrayCritical(env, all_failed_resend_safe_arr, all_failed_resend_safe_arr_ptr, 0); + return (*env)->NewObject(env, LDKPaymentSendFailure_AllFailedResendSafe_class, LDKPaymentSendFailure_AllFailedResendSafe_meth, all_failed_resend_safe_arr); + } + case LDKPaymentSendFailure_DuplicatePayment: { + return (*env)->NewObject(env, LDKPaymentSendFailure_DuplicatePayment_class, LDKPaymentSendFailure_DuplicatePayment_meth); } case LDKPaymentSendFailure_PartialFailure: { LDKCVec_CResult_NoneAPIErrorZZ results_var = obj->partial_failure.results; @@ -6488,46 +6623,46 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentSendFailure_1ref_ default: abort(); } } -static inline struct LDKThirtyTwoBytes CResult_PaymentIdPaymentSendFailureZ_get_ok(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR owner){ +static inline void CResult_NonePaymentSendFailureZ_get_ok(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return ThirtyTwoBytes_clone(&*owner->contents.result); + return *owner->contents.result; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_PaymentIdPaymentSendFailureZ* owner_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(owner); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_PaymentIdPaymentSendFailureZ_get_ok(owner_conv).data); - return ret_arr; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(owner); + CResult_NonePaymentSendFailureZ_get_ok(owner_conv); } -static inline struct LDKPaymentSendFailure CResult_PaymentIdPaymentSendFailureZ_get_err(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR owner){ +static inline struct LDKPaymentSendFailure CResult_NonePaymentSendFailureZ_get_err(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return PaymentSendFailure_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_PaymentIdPaymentSendFailureZ* owner_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(owner); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(owner); LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = CResult_PaymentIdPaymentSendFailureZ_get_err(owner_conv); + *ret_copy = CResult_NonePaymentSendFailureZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline void CResult_NonePaymentSendFailureZ_get_ok(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner){ +static inline struct LDKThirtyTwoBytes CResult_PaymentHashPaymentSendFailureZ_get_ok(LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return *owner->contents.result; + return ThirtyTwoBytes_clone(&*owner->contents.result); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(owner); - CResult_NonePaymentSendFailureZ_get_ok(owner_conv); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_PaymentHashPaymentSendFailureZ* owner_conv = (LDKCResult_PaymentHashPaymentSendFailureZ*)untag_ptr(owner); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, CResult_PaymentHashPaymentSendFailureZ_get_ok(owner_conv).data); + return ret_arr; } -static inline struct LDKPaymentSendFailure CResult_NonePaymentSendFailureZ_get_err(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner){ +static inline struct LDKPaymentSendFailure CResult_PaymentHashPaymentSendFailureZ_get_err(LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return PaymentSendFailure_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(owner); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_PaymentHashPaymentSendFailureZ* owner_conv = (LDKCResult_PaymentHashPaymentSendFailureZ*)untag_ptr(owner); LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = CResult_NonePaymentSendFailureZ_get_err(owner_conv); + *ret_copy = CResult_PaymentHashPaymentSendFailureZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -7124,7 +7259,8 @@ typedef struct LDKKeysInterface_JCalls { jmethodID ecdh_meth; jmethodID get_destination_script_meth; jmethodID get_shutdown_scriptpubkey_meth; - jmethodID get_channel_signer_meth; + jmethodID generate_channel_keys_id_meth; + jmethodID derive_channel_signer_meth; jmethodID get_secure_random_bytes_meth; jmethodID read_chan_signer_meth; jmethodID sign_invoice_meth; @@ -7280,7 +7416,7 @@ LDKShutdownScript get_shutdown_scriptpubkey_LDKKeysInterface_jcall(const void* t } return ret_conv; } -LDKSign get_channel_signer_LDKKeysInterface_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) { +LDKThirtyTwoBytes generate_channel_keys_id_LDKKeysInterface_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis, LDKU128 user_channel_id) { LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -7291,12 +7427,41 @@ LDKSign get_channel_signer_LDKKeysInterface_jcall(const void* this_arg, bool inb } jboolean inbound_conv = inbound; int64_t channel_value_satoshis_conv = channel_value_satoshis; + int8_tArray user_channel_id_arr = (*env)->NewByteArray(env, 16); + (*env)->SetByteArrayRegion(env, user_channel_id_arr, 0, 16, user_channel_id.le_bytes); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + int8_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->generate_channel_keys_id_meth, inbound_conv, channel_value_satoshis_conv, user_channel_id_arr); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to generate_channel_keys_id in LDKKeysInterface 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; +} +LDKSign derive_channel_signer_LDKKeysInterface_jcall(const void* this_arg, uint64_t channel_value_satoshis, LDKThirtyTwoBytes channel_keys_id) { + LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_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 channel_value_satoshis_conv = channel_value_satoshis; + int8_tArray channel_keys_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, channel_keys_id_arr, 0, 32, channel_keys_id.data); jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->get_channel_signer_meth, inbound_conv, channel_value_satoshis_conv); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->derive_channel_signer_meth, channel_value_satoshis_conv, channel_keys_id_arr); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to get_channel_signer in LDKKeysInterface from rust threw an exception."); + (*env)->FatalError(env, "A call to derive_channel_signer in LDKKeysInterface from rust threw an exception."); } void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); @@ -7359,7 +7524,7 @@ LDKCResult_SignDecodeErrorZ read_chan_signer_LDKKeysInterface_jcall(const void* } return ret_conv; } -LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKKeysInterface_jcall(const void* this_arg, LDKu8slice hrp_bytes, LDKCVec_u5Z invoice_data, LDKRecipient receipient) { +LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKKeysInterface_jcall(const void* this_arg, LDKu8slice hrp_bytes, LDKCVec_U5Z invoice_data, LDKRecipient receipient) { LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -7371,7 +7536,7 @@ LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKKeysInterface_jcall(const v LDKu8slice hrp_bytes_var = hrp_bytes; int8_tArray hrp_bytes_arr = (*env)->NewByteArray(env, hrp_bytes_var.datalen); (*env)->SetByteArrayRegion(env, hrp_bytes_arr, 0, hrp_bytes_var.datalen, hrp_bytes_var.data); - LDKCVec_u5Z invoice_data_var = invoice_data; + LDKCVec_U5Z invoice_data_var = invoice_data; jobjectArray invoice_data_arr = NULL; invoice_data_arr = (*env)->NewByteArray(env, invoice_data_var.datalen); int8_t *invoice_data_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, invoice_data_arr, NULL); @@ -7443,8 +7608,10 @@ static inline LDKKeysInterface LDKKeysInterface_init (JNIEnv *env, jclass clz, j CHECK(calls->get_destination_script_meth != NULL); calls->get_shutdown_scriptpubkey_meth = (*env)->GetMethodID(env, c, "get_shutdown_scriptpubkey", "()J"); CHECK(calls->get_shutdown_scriptpubkey_meth != NULL); - calls->get_channel_signer_meth = (*env)->GetMethodID(env, c, "get_channel_signer", "(ZJ)J"); - CHECK(calls->get_channel_signer_meth != NULL); + calls->generate_channel_keys_id_meth = (*env)->GetMethodID(env, c, "generate_channel_keys_id", "(ZJ[B)[B"); + CHECK(calls->generate_channel_keys_id_meth != NULL); + calls->derive_channel_signer_meth = (*env)->GetMethodID(env, c, "derive_channel_signer", "(J[B)J"); + CHECK(calls->derive_channel_signer_meth != NULL); calls->get_secure_random_bytes_meth = (*env)->GetMethodID(env, c, "get_secure_random_bytes", "()[B"); CHECK(calls->get_secure_random_bytes_meth != NULL); calls->read_chan_signer_meth = (*env)->GetMethodID(env, c, "read_chan_signer", "([B)J"); @@ -7461,7 +7628,8 @@ static inline LDKKeysInterface LDKKeysInterface_init (JNIEnv *env, jclass clz, j .ecdh = ecdh_LDKKeysInterface_jcall, .get_destination_script = get_destination_script_LDKKeysInterface_jcall, .get_shutdown_scriptpubkey = get_shutdown_scriptpubkey_LDKKeysInterface_jcall, - .get_channel_signer = get_channel_signer_LDKKeysInterface_jcall, + .generate_channel_keys_id = generate_channel_keys_id_LDKKeysInterface_jcall, + .derive_channel_signer = derive_channel_signer_LDKKeysInterface_jcall, .get_secure_random_bytes = get_secure_random_bytes_LDKKeysInterface_jcall, .read_chan_signer = read_chan_signer_LDKKeysInterface_jcall, .sign_invoice = sign_invoice_LDKKeysInterface_jcall, @@ -7534,12 +7702,27 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1shutdow return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1channel_1signer(JNIEnv *env, jclass clz, int64_t this_arg, jboolean inbound, int64_t channel_value_satoshis) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1generate_1channel_1keys_1id(JNIEnv *env, jclass clz, int64_t this_arg, jboolean inbound, int64_t channel_value_satoshis, int8_tArray user_channel_id) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr; + LDKU128 user_channel_id_ref; + CHECK((*env)->GetArrayLength(env, user_channel_id) == 16); + (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, (this_arg_conv->generate_channel_keys_id)(this_arg_conv->this_arg, inbound, channel_value_satoshis, user_channel_id_ref).data); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1derive_1channel_1signer(JNIEnv *env, jclass clz, int64_t this_arg, int64_t channel_value_satoshis, int8_tArray channel_keys_id) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr; + 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); LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign"); - *ret_ret = (this_arg_conv->get_channel_signer)(this_arg_conv->this_arg, inbound, channel_value_satoshis); + *ret_ret = (this_arg_conv->derive_channel_signer)(this_arg_conv->this_arg, channel_value_satoshis, channel_keys_id_ref); return tag_ptr(ret_ret, true); } @@ -7572,17 +7755,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_KeysInterface_1sign_1invoic LDKu8slice hrp_bytes_ref; hrp_bytes_ref.datalen = (*env)->GetArrayLength(env, hrp_bytes); hrp_bytes_ref.data = (*env)->GetByteArrayElements (env, hrp_bytes, NULL); - LDKCVec_u5Z invoice_data_constr; + LDKCVec_U5Z invoice_data_constr; invoice_data_constr.datalen = (*env)->GetArrayLength(env, invoice_data); if (invoice_data_constr.datalen > 0) - invoice_data_constr.data = MALLOC(invoice_data_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements"); + invoice_data_constr.data = MALLOC(invoice_data_constr.datalen * sizeof(LDKU5), "LDKCVec_U5Z Elements"); else invoice_data_constr.data = NULL; int8_t* invoice_data_vals = (*env)->GetByteArrayElements (env, invoice_data, NULL); for (size_t h = 0; h < invoice_data_constr.datalen; h++) { int8_t invoice_data_conv_7 = invoice_data_vals[h]; - invoice_data_constr.data[h] = (LDKu5){ ._0 = invoice_data_conv_7 }; + invoice_data_constr.data[h] = (LDKU5){ ._0 = invoice_data_conv_7 }; } (*env)->ReleaseByteArrayElements(env, invoice_data, invoice_data_vals, 0); LDKRecipient receipient_conv = LDKRecipient_from_java(env, receipient); @@ -8056,739 +8239,273 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentEr return ret_ref; } -static inline struct LDKInFlightHtlcs CResult_InFlightHtlcsDecodeErrorZ_get_ok(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner){ - LDKInFlightHtlcs ret = *owner->contents.result; - ret.is_owned = false; - return ret; +static inline void CResult_NonePaymentErrorZ_get_ok(LDKCResult_NonePaymentErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_InFlightHtlcsDecodeErrorZ* owner_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(owner); - LDKInFlightHtlcs ret_var = CResult_InFlightHtlcsDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NonePaymentErrorZ* owner_conv = (LDKCResult_NonePaymentErrorZ*)untag_ptr(owner); + CResult_NonePaymentErrorZ_get_ok(owner_conv); } -static inline struct LDKDecodeError CResult_InFlightHtlcsDecodeErrorZ_get_err(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKPaymentError CResult_NonePaymentErrorZ_get_err(LDKCResult_NonePaymentErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); + return PaymentError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_InFlightHtlcsDecodeErrorZ* owner_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_InFlightHtlcsDecodeErrorZ_get_err(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NonePaymentErrorZ* owner_conv = (LDKCResult_NonePaymentErrorZ*)untag_ptr(owner); + LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError"); + *ret_copy = CResult_NonePaymentErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static jclass LDKParseError_Bech32Error_class = NULL; -static jmethodID LDKParseError_Bech32Error_meth = NULL; -static jclass LDKParseError_ParseAmountError_class = NULL; -static jmethodID LDKParseError_ParseAmountError_meth = NULL; -static jclass LDKParseError_MalformedSignature_class = NULL; -static jmethodID LDKParseError_MalformedSignature_meth = NULL; -static jclass LDKParseError_BadPrefix_class = NULL; -static jmethodID LDKParseError_BadPrefix_meth = NULL; -static jclass LDKParseError_UnknownCurrency_class = NULL; -static jmethodID LDKParseError_UnknownCurrency_meth = NULL; -static jclass LDKParseError_UnknownSiPrefix_class = NULL; -static jmethodID LDKParseError_UnknownSiPrefix_meth = NULL; -static jclass LDKParseError_MalformedHRP_class = NULL; -static jmethodID LDKParseError_MalformedHRP_meth = NULL; -static jclass LDKParseError_TooShortDataPart_class = NULL; -static jmethodID LDKParseError_TooShortDataPart_meth = NULL; -static jclass LDKParseError_UnexpectedEndOfTaggedFields_class = NULL; -static jmethodID LDKParseError_UnexpectedEndOfTaggedFields_meth = NULL; -static jclass LDKParseError_DescriptionDecodeError_class = NULL; -static jmethodID LDKParseError_DescriptionDecodeError_meth = NULL; -static jclass LDKParseError_PaddingError_class = NULL; -static jmethodID LDKParseError_PaddingError_meth = NULL; -static jclass LDKParseError_IntegerOverflowError_class = NULL; -static jmethodID LDKParseError_IntegerOverflowError_meth = NULL; -static jclass LDKParseError_InvalidSegWitProgramLength_class = NULL; -static jmethodID LDKParseError_InvalidSegWitProgramLength_meth = NULL; -static jclass LDKParseError_InvalidPubKeyHashLength_class = NULL; -static jmethodID LDKParseError_InvalidPubKeyHashLength_meth = NULL; -static jclass LDKParseError_InvalidScriptHashLength_class = NULL; -static jmethodID LDKParseError_InvalidScriptHashLength_meth = NULL; -static jclass LDKParseError_InvalidRecoveryId_class = NULL; -static jmethodID LDKParseError_InvalidRecoveryId_meth = NULL; -static jclass LDKParseError_InvalidSliceLength_class = NULL; -static jmethodID LDKParseError_InvalidSliceLength_meth = NULL; -static jclass LDKParseError_Skip_class = NULL; -static jmethodID LDKParseError_Skip_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKParseError_init (JNIEnv *env, jclass clz) { - LDKParseError_Bech32Error_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$Bech32Error")); - CHECK(LDKParseError_Bech32Error_class != NULL); - LDKParseError_Bech32Error_meth = (*env)->GetMethodID(env, LDKParseError_Bech32Error_class, "", "(J)V"); - CHECK(LDKParseError_Bech32Error_meth != NULL); - LDKParseError_ParseAmountError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$ParseAmountError")); - CHECK(LDKParseError_ParseAmountError_class != NULL); - LDKParseError_ParseAmountError_meth = (*env)->GetMethodID(env, LDKParseError_ParseAmountError_class, "", "(I)V"); - CHECK(LDKParseError_ParseAmountError_meth != NULL); - LDKParseError_MalformedSignature_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$MalformedSignature")); - CHECK(LDKParseError_MalformedSignature_class != NULL); - LDKParseError_MalformedSignature_meth = (*env)->GetMethodID(env, LDKParseError_MalformedSignature_class, "", "(Lorg/ldk/enums/Secp256k1Error;)V"); - CHECK(LDKParseError_MalformedSignature_meth != NULL); - LDKParseError_BadPrefix_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$BadPrefix")); - CHECK(LDKParseError_BadPrefix_class != NULL); - LDKParseError_BadPrefix_meth = (*env)->GetMethodID(env, LDKParseError_BadPrefix_class, "", "()V"); - CHECK(LDKParseError_BadPrefix_meth != NULL); - LDKParseError_UnknownCurrency_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$UnknownCurrency")); - CHECK(LDKParseError_UnknownCurrency_class != NULL); - LDKParseError_UnknownCurrency_meth = (*env)->GetMethodID(env, LDKParseError_UnknownCurrency_class, "", "()V"); - CHECK(LDKParseError_UnknownCurrency_meth != NULL); - LDKParseError_UnknownSiPrefix_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$UnknownSiPrefix")); - CHECK(LDKParseError_UnknownSiPrefix_class != NULL); - LDKParseError_UnknownSiPrefix_meth = (*env)->GetMethodID(env, LDKParseError_UnknownSiPrefix_class, "", "()V"); - CHECK(LDKParseError_UnknownSiPrefix_meth != NULL); - LDKParseError_MalformedHRP_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$MalformedHRP")); - CHECK(LDKParseError_MalformedHRP_class != NULL); - LDKParseError_MalformedHRP_meth = (*env)->GetMethodID(env, LDKParseError_MalformedHRP_class, "", "()V"); - CHECK(LDKParseError_MalformedHRP_meth != NULL); - LDKParseError_TooShortDataPart_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$TooShortDataPart")); - CHECK(LDKParseError_TooShortDataPart_class != NULL); - LDKParseError_TooShortDataPart_meth = (*env)->GetMethodID(env, LDKParseError_TooShortDataPart_class, "", "()V"); - CHECK(LDKParseError_TooShortDataPart_meth != NULL); - LDKParseError_UnexpectedEndOfTaggedFields_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$UnexpectedEndOfTaggedFields")); - CHECK(LDKParseError_UnexpectedEndOfTaggedFields_class != NULL); - LDKParseError_UnexpectedEndOfTaggedFields_meth = (*env)->GetMethodID(env, LDKParseError_UnexpectedEndOfTaggedFields_class, "", "()V"); - CHECK(LDKParseError_UnexpectedEndOfTaggedFields_meth != NULL); - LDKParseError_DescriptionDecodeError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$DescriptionDecodeError")); - CHECK(LDKParseError_DescriptionDecodeError_class != NULL); - LDKParseError_DescriptionDecodeError_meth = (*env)->GetMethodID(env, LDKParseError_DescriptionDecodeError_class, "", "(I)V"); - CHECK(LDKParseError_DescriptionDecodeError_meth != NULL); - LDKParseError_PaddingError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$PaddingError")); - CHECK(LDKParseError_PaddingError_class != NULL); - LDKParseError_PaddingError_meth = (*env)->GetMethodID(env, LDKParseError_PaddingError_class, "", "()V"); - CHECK(LDKParseError_PaddingError_meth != NULL); - LDKParseError_IntegerOverflowError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$IntegerOverflowError")); - CHECK(LDKParseError_IntegerOverflowError_class != NULL); - LDKParseError_IntegerOverflowError_meth = (*env)->GetMethodID(env, LDKParseError_IntegerOverflowError_class, "", "()V"); - CHECK(LDKParseError_IntegerOverflowError_meth != NULL); - LDKParseError_InvalidSegWitProgramLength_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidSegWitProgramLength")); - CHECK(LDKParseError_InvalidSegWitProgramLength_class != NULL); - LDKParseError_InvalidSegWitProgramLength_meth = (*env)->GetMethodID(env, LDKParseError_InvalidSegWitProgramLength_class, "", "()V"); - CHECK(LDKParseError_InvalidSegWitProgramLength_meth != NULL); - LDKParseError_InvalidPubKeyHashLength_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidPubKeyHashLength")); - CHECK(LDKParseError_InvalidPubKeyHashLength_class != NULL); - LDKParseError_InvalidPubKeyHashLength_meth = (*env)->GetMethodID(env, LDKParseError_InvalidPubKeyHashLength_class, "", "()V"); - CHECK(LDKParseError_InvalidPubKeyHashLength_meth != NULL); - LDKParseError_InvalidScriptHashLength_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidScriptHashLength")); - CHECK(LDKParseError_InvalidScriptHashLength_class != NULL); - LDKParseError_InvalidScriptHashLength_meth = (*env)->GetMethodID(env, LDKParseError_InvalidScriptHashLength_class, "", "()V"); - CHECK(LDKParseError_InvalidScriptHashLength_meth != NULL); - LDKParseError_InvalidRecoveryId_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidRecoveryId")); - CHECK(LDKParseError_InvalidRecoveryId_class != NULL); - LDKParseError_InvalidRecoveryId_meth = (*env)->GetMethodID(env, LDKParseError_InvalidRecoveryId_class, "", "()V"); - CHECK(LDKParseError_InvalidRecoveryId_meth != NULL); - LDKParseError_InvalidSliceLength_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidSliceLength")); - CHECK(LDKParseError_InvalidSliceLength_class != NULL); - LDKParseError_InvalidSliceLength_meth = (*env)->GetMethodID(env, LDKParseError_InvalidSliceLength_class, "", "(Ljava/lang/String;)V"); - CHECK(LDKParseError_InvalidSliceLength_meth != NULL); - LDKParseError_Skip_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$Skip")); - CHECK(LDKParseError_Skip_class != NULL); - LDKParseError_Skip_meth = (*env)->GetMethodID(env, LDKParseError_Skip_class, "", "()V"); - CHECK(LDKParseError_Skip_meth != NULL); +static inline struct LDKStr CResult_StringErrorZ_get_ok(LDKCResult_StringErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKParseError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKParseError *obj = (LDKParseError*)untag_ptr(ptr); - switch(obj->tag) { - case LDKParseError_Bech32Error: { - int64_t bech32_error_ref = tag_ptr(&obj->bech32_error, false); - return (*env)->NewObject(env, LDKParseError_Bech32Error_class, LDKParseError_Bech32Error_meth, bech32_error_ref); - } - case LDKParseError_ParseAmountError: { - /*obj->parse_amount_error*/ - return (*env)->NewObject(env, LDKParseError_ParseAmountError_class, LDKParseError_ParseAmountError_meth, 0); - } - case LDKParseError_MalformedSignature: { - jclass malformed_signature_conv = LDKSecp256k1Error_to_java(env, obj->malformed_signature); - return (*env)->NewObject(env, LDKParseError_MalformedSignature_class, LDKParseError_MalformedSignature_meth, malformed_signature_conv); - } - case LDKParseError_BadPrefix: { - return (*env)->NewObject(env, LDKParseError_BadPrefix_class, LDKParseError_BadPrefix_meth); - } - case LDKParseError_UnknownCurrency: { - return (*env)->NewObject(env, LDKParseError_UnknownCurrency_class, LDKParseError_UnknownCurrency_meth); - } - case LDKParseError_UnknownSiPrefix: { - return (*env)->NewObject(env, LDKParseError_UnknownSiPrefix_class, LDKParseError_UnknownSiPrefix_meth); - } - case LDKParseError_MalformedHRP: { - return (*env)->NewObject(env, LDKParseError_MalformedHRP_class, LDKParseError_MalformedHRP_meth); - } - case LDKParseError_TooShortDataPart: { - return (*env)->NewObject(env, LDKParseError_TooShortDataPart_class, LDKParseError_TooShortDataPart_meth); - } - case LDKParseError_UnexpectedEndOfTaggedFields: { - return (*env)->NewObject(env, LDKParseError_UnexpectedEndOfTaggedFields_class, LDKParseError_UnexpectedEndOfTaggedFields_meth); - } - case LDKParseError_DescriptionDecodeError: { - /*obj->description_decode_error*/ - return (*env)->NewObject(env, LDKParseError_DescriptionDecodeError_class, LDKParseError_DescriptionDecodeError_meth, 0); - } - case LDKParseError_PaddingError: { - return (*env)->NewObject(env, LDKParseError_PaddingError_class, LDKParseError_PaddingError_meth); - } - case LDKParseError_IntegerOverflowError: { - return (*env)->NewObject(env, LDKParseError_IntegerOverflowError_class, LDKParseError_IntegerOverflowError_meth); - } - case LDKParseError_InvalidSegWitProgramLength: { - return (*env)->NewObject(env, LDKParseError_InvalidSegWitProgramLength_class, LDKParseError_InvalidSegWitProgramLength_meth); - } - case LDKParseError_InvalidPubKeyHashLength: { - return (*env)->NewObject(env, LDKParseError_InvalidPubKeyHashLength_class, LDKParseError_InvalidPubKeyHashLength_meth); - } - case LDKParseError_InvalidScriptHashLength: { - return (*env)->NewObject(env, LDKParseError_InvalidScriptHashLength_class, LDKParseError_InvalidScriptHashLength_meth); - } - case LDKParseError_InvalidRecoveryId: { - return (*env)->NewObject(env, LDKParseError_InvalidRecoveryId_class, LDKParseError_InvalidRecoveryId_meth); - } - case LDKParseError_InvalidSliceLength: { - LDKStr invalid_slice_length_str = obj->invalid_slice_length; - jstring invalid_slice_length_conv = str_ref_to_java(env, invalid_slice_length_str.chars, invalid_slice_length_str.len); - return (*env)->NewObject(env, LDKParseError_InvalidSliceLength_class, LDKParseError_InvalidSliceLength_meth, invalid_slice_length_conv); - } - case LDKParseError_Skip: { - return (*env)->NewObject(env, LDKParseError_Skip_class, LDKParseError_Skip_meth); - } - default: abort(); - } +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_StringErrorZ* owner_conv = (LDKCResult_StringErrorZ*)untag_ptr(owner); + LDKStr ret_str = CResult_StringErrorZ_get_ok(owner_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + return ret_conv; } -static inline enum LDKSiPrefix CResult_SiPrefixParseErrorZ_get_ok(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner){ + +static inline enum LDKSecp256k1Error CResult_StringErrorZ_get_err(LDKCResult_StringErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_StringErrorZ* owner_conv = (LDKCResult_StringErrorZ*)untag_ptr(owner); + jclass ret_conv = LDKSecp256k1Error_to_java(env, CResult_StringErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline struct LDKPublicKey CResult_PublicKeyErrorZ_get_ok(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); - return SiPrefix_clone(&*owner->contents.result); + return *owner->contents.result; } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_SiPrefixParseErrorZ* owner_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKSiPrefix_to_java(env, CResult_SiPrefixParseErrorZ_get_ok(owner_conv)); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_PublicKeyErrorZ* owner_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(owner); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, CResult_PublicKeyErrorZ_get_ok(owner_conv).compressed_form); + return ret_arr; +} + +static inline enum LDKSecp256k1Error CResult_PublicKeyErrorZ_get_err(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_PublicKeyErrorZ* owner_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(owner); + jclass ret_conv = LDKSecp256k1Error_to_java(env, CResult_PublicKeyErrorZ_get_err(owner_conv)); return ret_conv; } -static inline struct LDKParseError CResult_SiPrefixParseErrorZ_get_err(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner){ +static inline struct LDKChannelMonitorUpdate CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner){ + LDKChannelMonitorUpdate ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(owner); + LDKChannelMonitorUpdate ret_var = CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return ParseError_clone(&*owner->contents.err); + return DecodeError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_SiPrefixParseErrorZ* owner_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(owner); - LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError"); - *ret_copy = CResult_SiPrefixParseErrorZ_get_err(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static jclass LDKParseOrSemanticError_ParseError_class = NULL; -static jmethodID LDKParseOrSemanticError_ParseError_meth = NULL; -static jclass LDKParseOrSemanticError_SemanticError_class = NULL; -static jmethodID LDKParseOrSemanticError_SemanticError_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKParseOrSemanticError_init (JNIEnv *env, jclass clz) { - LDKParseOrSemanticError_ParseError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseOrSemanticError$ParseError")); - CHECK(LDKParseOrSemanticError_ParseError_class != NULL); - LDKParseOrSemanticError_ParseError_meth = (*env)->GetMethodID(env, LDKParseOrSemanticError_ParseError_class, "", "(J)V"); - CHECK(LDKParseOrSemanticError_ParseError_meth != NULL); - LDKParseOrSemanticError_SemanticError_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseOrSemanticError$SemanticError")); - CHECK(LDKParseOrSemanticError_SemanticError_class != NULL); - LDKParseOrSemanticError_SemanticError_meth = (*env)->GetMethodID(env, LDKParseOrSemanticError_SemanticError_class, "", "(Lorg/ldk/enums/SemanticError;)V"); - CHECK(LDKParseOrSemanticError_SemanticError_meth != NULL); +static jclass LDKCOption_MonitorEventZ_Some_class = NULL; +static jmethodID LDKCOption_MonitorEventZ_Some_meth = NULL; +static jclass LDKCOption_MonitorEventZ_None_class = NULL; +static jmethodID LDKCOption_MonitorEventZ_None_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1MonitorEventZ_init (JNIEnv *env, jclass clz) { + LDKCOption_MonitorEventZ_Some_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_MonitorEventZ$Some")); + CHECK(LDKCOption_MonitorEventZ_Some_class != NULL); + LDKCOption_MonitorEventZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_MonitorEventZ_Some_class, "", "(J)V"); + CHECK(LDKCOption_MonitorEventZ_Some_meth != NULL); + LDKCOption_MonitorEventZ_None_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_MonitorEventZ$None")); + CHECK(LDKCOption_MonitorEventZ_None_class != NULL); + LDKCOption_MonitorEventZ_None_meth = (*env)->GetMethodID(env, LDKCOption_MonitorEventZ_None_class, "", "()V"); + CHECK(LDKCOption_MonitorEventZ_None_meth != NULL); } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKParseOrSemanticError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKParseOrSemanticError *obj = (LDKParseOrSemanticError*)untag_ptr(ptr); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1MonitorEventZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKCOption_MonitorEventZ *obj = (LDKCOption_MonitorEventZ*)untag_ptr(ptr); switch(obj->tag) { - case LDKParseOrSemanticError_ParseError: { - int64_t parse_error_ref = tag_ptr(&obj->parse_error, false); - return (*env)->NewObject(env, LDKParseOrSemanticError_ParseError_class, LDKParseOrSemanticError_ParseError_meth, parse_error_ref); + case LDKCOption_MonitorEventZ_Some: { + int64_t some_ref = tag_ptr(&obj->some, false); + return (*env)->NewObject(env, LDKCOption_MonitorEventZ_Some_class, LDKCOption_MonitorEventZ_Some_meth, some_ref); } - case LDKParseOrSemanticError_SemanticError: { - jclass semantic_error_conv = LDKSemanticError_to_java(env, obj->semantic_error); - return (*env)->NewObject(env, LDKParseOrSemanticError_SemanticError_class, LDKParseOrSemanticError_SemanticError_meth, semantic_error_conv); + case LDKCOption_MonitorEventZ_None: { + return (*env)->NewObject(env, LDKCOption_MonitorEventZ_None_class, LDKCOption_MonitorEventZ_None_meth); } default: abort(); } } -static inline struct LDKInvoice CResult_InvoiceParseOrSemanticErrorZ_get_ok(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner){ - LDKInvoice ret = *owner->contents.result; - ret.is_owned = false; - return ret; +static inline struct LDKCOption_MonitorEventZ CResult_COption_MonitorEventZDecodeErrorZ_get_ok(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return COption_MonitorEventZ_clone(&*owner->contents.result); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_InvoiceParseOrSemanticErrorZ* owner_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(owner); - LDKInvoice ret_var = CResult_InvoiceParseOrSemanticErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(owner); + LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); + *ret_copy = CResult_COption_MonitorEventZDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline struct LDKParseOrSemanticError CResult_InvoiceParseOrSemanticErrorZ_get_err(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_COption_MonitorEventZDecodeErrorZ_get_err(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return ParseOrSemanticError_clone(&*owner->contents.err); + return DecodeError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_InvoiceParseOrSemanticErrorZ* owner_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(owner); - LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError"); - *ret_copy = CResult_InvoiceParseOrSemanticErrorZ_get_err(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_COption_MonitorEventZDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline struct LDKSignedRawInvoice CResult_SignedRawInvoiceParseErrorZ_get_ok(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner){ - LDKSignedRawInvoice ret = *owner->contents.result; +static inline struct LDKHTLCUpdate CResult_HTLCUpdateDecodeErrorZ_get_ok(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR owner){ + LDKHTLCUpdate ret = *owner->contents.result; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_SignedRawInvoiceParseErrorZ* owner_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(owner); - LDKSignedRawInvoice ret_var = CResult_SignedRawInvoiceParseErrorZ_get_ok(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(owner); + LDKHTLCUpdate ret_var = CResult_HTLCUpdateDecodeErrorZ_get_ok(owner_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline struct LDKParseError CResult_SignedRawInvoiceParseErrorZ_get_err(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_HTLCUpdateDecodeErrorZ_get_err(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); - return ParseError_clone(&*owner->contents.err); + return DecodeError_clone(&*owner->contents.err); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_SignedRawInvoiceParseErrorZ* owner_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(owner); - LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError"); - *ret_copy = CResult_SignedRawInvoiceParseErrorZ_get_err(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_HTLCUpdateDecodeErrorZ_get_err(owner_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline struct LDKRawInvoice C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){ - LDKRawInvoice ret = owner->a; +static inline struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR owner){ + LDKOutPoint ret = owner->a; ret.is_owned = false; return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { - LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner); - LDKRawInvoice ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(owner_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_OutPointScriptZ* owner_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(owner); + LDKOutPoint ret_var = C2Tuple_OutPointScriptZ_get_a(owner_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline struct LDKThirtyTwoBytes C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){ - return ThirtyTwoBytes_clone(&owner->b); +static inline struct LDKCVec_u8Z C2Tuple_OutPointScriptZ_get_b(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR owner){ + return CVec_u8Z_clone(&owner->b); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { - LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(owner_conv).data); +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_OutPointScriptZ* owner_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(owner); + LDKCVec_u8Z ret_var = C2Tuple_OutPointScriptZ_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); + CVec_u8Z_free(ret_var); return ret_arr; } -static inline struct LDKInvoiceSignature C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){ - LDKInvoiceSignature ret = owner->c; - ret.is_owned = false; - return ret; +static inline uint32_t C2Tuple_u32ScriptZ_get_a(LDKC2Tuple_u32ScriptZ *NONNULL_PTR owner){ + return owner->a; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1get_1c(JNIEnv *env, jclass clz, int64_t owner) { - LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner); - LDKInvoiceSignature ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_u32ScriptZ* owner_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(owner); + int32_t ret_conv = C2Tuple_u32ScriptZ_get_a(owner_conv); + return ret_conv; } -static inline struct LDKPayeePubKey CResult_PayeePubKeyErrorZ_get_ok(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner){ - LDKPayeePubKey ret = *owner->contents.result; - ret.is_owned = false; +static inline struct LDKCVec_u8Z C2Tuple_u32ScriptZ_get_b(LDKC2Tuple_u32ScriptZ *NONNULL_PTR owner){ + return CVec_u8Z_clone(&owner->b); +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_u32ScriptZ* owner_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(owner); + LDKCVec_u8Z ret_var = C2Tuple_u32ScriptZ_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); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +static inline LDKCVec_C2Tuple_u32ScriptZZ CVec_C2Tuple_u32ScriptZZ_clone(const LDKCVec_C2Tuple_u32ScriptZZ *orig) { + LDKCVec_C2Tuple_u32ScriptZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ) * orig->datalen, "LDKCVec_C2Tuple_u32ScriptZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = C2Tuple_u32ScriptZ_clone(&orig->data[i]); + } return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_PayeePubKeyErrorZ* owner_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(owner); - LDKPayeePubKey ret_var = CResult_PayeePubKeyErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +static inline struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR owner){ + return ThirtyTwoBytes_clone(&owner->a); +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(owner); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(owner_conv).data); + return ret_arr; } -static inline enum LDKSecp256k1Error CResult_PayeePubKeyErrorZ_get_err(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; +static inline struct LDKCVec_C2Tuple_u32ScriptZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR owner){ + return CVec_C2Tuple_u32ScriptZZ_clone(&owner->b); } -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_PayeePubKeyErrorZ* owner_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKSecp256k1Error_to_java(env, CResult_PayeePubKeyErrorZ_get_err(owner_conv)); - return ret_conv; +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(owner); + LDKCVec_C2Tuple_u32ScriptZZ ret_var = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_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 v = 0; v < ret_var.datalen; v++) { + LDKC2Tuple_u32ScriptZ* ret_conv_21_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ"); + *ret_conv_21_conv = ret_var.data[v]; + ret_arr_ptr[v] = tag_ptr(ret_conv_21_conv, true); + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; } -static inline LDKCVec_PrivateRouteZ CVec_PrivateRouteZ_clone(const LDKCVec_PrivateRouteZ *orig) { - LDKCVec_PrivateRouteZ ret = { .data = MALLOC(sizeof(LDKPrivateRoute) * orig->datalen, "LDKCVec_PrivateRouteZ clone bytes"), .datalen = orig->datalen }; +static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_clone(const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ *orig) { + LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ) * orig->datalen, "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = PrivateRoute_clone(&orig->data[i]); + ret.data[i] = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(&orig->data[i]); } return ret; } -static inline struct LDKPositiveTimestamp CResult_PositiveTimestampCreationErrorZ_get_ok(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner){ - LDKPositiveTimestamp ret = *owner->contents.result; - ret.is_owned = false; +static inline LDKCVec_EventZ CVec_EventZ_clone(const LDKCVec_EventZ *orig) { + LDKCVec_EventZ ret = { .data = MALLOC(sizeof(LDKEvent) * orig->datalen, "LDKCVec_EventZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = Event_clone(&orig->data[i]); + } return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_PositiveTimestampCreationErrorZ* owner_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(owner); - LDKPositiveTimestamp ret_var = CResult_PositiveTimestampCreationErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline enum LDKCreationError CResult_PositiveTimestampCreationErrorZ_get_err(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return CreationError_clone(&*owner->contents.err); -} -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_PositiveTimestampCreationErrorZ* owner_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKCreationError_to_java(env, CResult_PositiveTimestampCreationErrorZ_get_err(owner_conv)); - return ret_conv; -} - -static inline void CResult_NoneSemanticErrorZ_get_ok(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NoneSemanticErrorZ* owner_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(owner); - CResult_NoneSemanticErrorZ_get_ok(owner_conv); -} - -static inline enum LDKSemanticError CResult_NoneSemanticErrorZ_get_err(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return SemanticError_clone(&*owner->contents.err); -} -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_NoneSemanticErrorZ* owner_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKSemanticError_to_java(env, CResult_NoneSemanticErrorZ_get_err(owner_conv)); - return ret_conv; -} - -static inline struct LDKInvoice CResult_InvoiceSemanticErrorZ_get_ok(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner){ - LDKInvoice ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_InvoiceSemanticErrorZ* owner_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(owner); - LDKInvoice ret_var = CResult_InvoiceSemanticErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline enum LDKSemanticError CResult_InvoiceSemanticErrorZ_get_err(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return SemanticError_clone(&*owner->contents.err); -} -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_InvoiceSemanticErrorZ* owner_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKSemanticError_to_java(env, CResult_InvoiceSemanticErrorZ_get_err(owner_conv)); - return ret_conv; -} - -static inline struct LDKDescription CResult_DescriptionCreationErrorZ_get_ok(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner){ - LDKDescription ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_DescriptionCreationErrorZ* owner_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(owner); - LDKDescription ret_var = CResult_DescriptionCreationErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline enum LDKCreationError CResult_DescriptionCreationErrorZ_get_err(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return CreationError_clone(&*owner->contents.err); -} -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_DescriptionCreationErrorZ* owner_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKCreationError_to_java(env, CResult_DescriptionCreationErrorZ_get_err(owner_conv)); - return ret_conv; -} - -static inline struct LDKPrivateRoute CResult_PrivateRouteCreationErrorZ_get_ok(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner){ - LDKPrivateRoute ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_PrivateRouteCreationErrorZ* owner_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(owner); - LDKPrivateRoute ret_var = CResult_PrivateRouteCreationErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline enum LDKCreationError CResult_PrivateRouteCreationErrorZ_get_err(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return CreationError_clone(&*owner->contents.err); -} -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_PrivateRouteCreationErrorZ* owner_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKCreationError_to_java(env, CResult_PrivateRouteCreationErrorZ_get_err(owner_conv)); - return ret_conv; -} - -static inline struct LDKStr CResult_StringErrorZ_get_ok(LDKCResult_StringErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_StringErrorZ* owner_conv = (LDKCResult_StringErrorZ*)untag_ptr(owner); - LDKStr ret_str = CResult_StringErrorZ_get_ok(owner_conv); - jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); - return ret_conv; -} - -static inline enum LDKSecp256k1Error CResult_StringErrorZ_get_err(LDKCResult_StringErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; -} -JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_StringErrorZ* owner_conv = (LDKCResult_StringErrorZ*)untag_ptr(owner); - jclass ret_conv = LDKSecp256k1Error_to_java(env, CResult_StringErrorZ_get_err(owner_conv)); - return ret_conv; -} - -static inline struct LDKChannelMonitorUpdate CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner){ - LDKChannelMonitorUpdate ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(owner); - LDKChannelMonitorUpdate ret_var = CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline struct LDKDecodeError CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static jclass LDKCOption_MonitorEventZ_Some_class = NULL; -static jmethodID LDKCOption_MonitorEventZ_Some_meth = NULL; -static jclass LDKCOption_MonitorEventZ_None_class = NULL; -static jmethodID LDKCOption_MonitorEventZ_None_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1MonitorEventZ_init (JNIEnv *env, jclass clz) { - LDKCOption_MonitorEventZ_Some_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_MonitorEventZ$Some")); - CHECK(LDKCOption_MonitorEventZ_Some_class != NULL); - LDKCOption_MonitorEventZ_Some_meth = (*env)->GetMethodID(env, LDKCOption_MonitorEventZ_Some_class, "", "(J)V"); - CHECK(LDKCOption_MonitorEventZ_Some_meth != NULL); - LDKCOption_MonitorEventZ_None_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKCOption_MonitorEventZ$None")); - CHECK(LDKCOption_MonitorEventZ_None_class != NULL); - LDKCOption_MonitorEventZ_None_meth = (*env)->GetMethodID(env, LDKCOption_MonitorEventZ_None_class, "", "()V"); - CHECK(LDKCOption_MonitorEventZ_None_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1MonitorEventZ_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKCOption_MonitorEventZ *obj = (LDKCOption_MonitorEventZ*)untag_ptr(ptr); - switch(obj->tag) { - case LDKCOption_MonitorEventZ_Some: { - int64_t some_ref = tag_ptr(&obj->some, false); - return (*env)->NewObject(env, LDKCOption_MonitorEventZ_Some_class, LDKCOption_MonitorEventZ_Some_meth, some_ref); - } - case LDKCOption_MonitorEventZ_None: { - return (*env)->NewObject(env, LDKCOption_MonitorEventZ_None_class, LDKCOption_MonitorEventZ_None_meth); - } - default: abort(); - } -} -static inline struct LDKCOption_MonitorEventZ CResult_COption_MonitorEventZDecodeErrorZ_get_ok(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return COption_MonitorEventZ_clone(&*owner->contents.result); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(owner); - LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ"); - *ret_copy = CResult_COption_MonitorEventZDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline struct LDKDecodeError CResult_COption_MonitorEventZDecodeErrorZ_get_err(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_COption_MonitorEventZDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline struct LDKHTLCUpdate CResult_HTLCUpdateDecodeErrorZ_get_ok(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR owner){ - LDKHTLCUpdate ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(owner); - LDKHTLCUpdate ret_var = CResult_HTLCUpdateDecodeErrorZ_get_ok(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline struct LDKDecodeError CResult_HTLCUpdateDecodeErrorZ_get_err(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { - LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_HTLCUpdateDecodeErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR owner){ - LDKOutPoint ret = owner->a; - ret.is_owned = false; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_OutPointScriptZ* owner_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(owner); - LDKOutPoint ret_var = C2Tuple_OutPointScriptZ_get_a(owner_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -static inline struct LDKCVec_u8Z C2Tuple_OutPointScriptZ_get_b(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR owner){ - return CVec_u8Z_clone(&owner->b); -} -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_OutPointScriptZ* owner_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(owner); - LDKCVec_u8Z ret_var = C2Tuple_OutPointScriptZ_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); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -static inline uint32_t C2Tuple_u32ScriptZ_get_a(LDKC2Tuple_u32ScriptZ *NONNULL_PTR owner){ - return owner->a; -} -JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_u32ScriptZ* owner_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(owner); - int32_t ret_conv = C2Tuple_u32ScriptZ_get_a(owner_conv); - return ret_conv; -} - -static inline struct LDKCVec_u8Z C2Tuple_u32ScriptZ_get_b(LDKC2Tuple_u32ScriptZ *NONNULL_PTR owner){ - return CVec_u8Z_clone(&owner->b); -} -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_u32ScriptZ* owner_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(owner); - LDKCVec_u8Z ret_var = C2Tuple_u32ScriptZ_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); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -static inline LDKCVec_C2Tuple_u32ScriptZZ CVec_C2Tuple_u32ScriptZZ_clone(const LDKCVec_C2Tuple_u32ScriptZZ *orig) { - LDKCVec_C2Tuple_u32ScriptZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ) * orig->datalen, "LDKCVec_C2Tuple_u32ScriptZZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C2Tuple_u32ScriptZ_clone(&orig->data[i]); - } - return ret; -} -static inline struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR owner){ - return ThirtyTwoBytes_clone(&owner->a); -} -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(owner); - int8_tArray ret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(owner_conv).data); - return ret_arr; -} - -static inline struct LDKCVec_C2Tuple_u32ScriptZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR owner){ - return CVec_C2Tuple_u32ScriptZZ_clone(&owner->b); -} -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { - LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(owner); - LDKCVec_C2Tuple_u32ScriptZZ ret_var = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_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 v = 0; v < ret_var.datalen; v++) { - LDKC2Tuple_u32ScriptZ* ret_conv_21_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ"); - *ret_conv_21_conv = ret_var.data[v]; - ret_arr_ptr[v] = tag_ptr(ret_conv_21_conv, true); - } - (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); - FREE(ret_var.data); - return ret_arr; -} - -static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_clone(const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ *orig) { - LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ) * orig->datalen, "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(&orig->data[i]); - } - return ret; -} -static inline LDKCVec_EventZ CVec_EventZ_clone(const LDKCVec_EventZ *orig) { - LDKCVec_EventZ ret = { .data = MALLOC(sizeof(LDKEvent) * orig->datalen, "LDKCVec_EventZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = Event_clone(&orig->data[i]); - } - return ret; -} -static inline uint32_t C2Tuple_u32TxOutZ_get_a(LDKC2Tuple_u32TxOutZ *NONNULL_PTR owner){ - return owner->a; +static inline uint32_t C2Tuple_u32TxOutZ_get_a(LDKC2Tuple_u32TxOutZ *NONNULL_PTR owner){ + return owner->a; } JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { LDKC2Tuple_u32TxOutZ* owner_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(owner); @@ -9272,6 +8989,10 @@ static jclass LDKSendError_InvalidMessage_class = NULL; static jmethodID LDKSendError_InvalidMessage_meth = NULL; static jclass LDKSendError_BufferFull_class = NULL; static jmethodID LDKSendError_BufferFull_meth = NULL; +static jclass LDKSendError_GetNodeIdFailed_class = NULL; +static jmethodID LDKSendError_GetNodeIdFailed_meth = NULL; +static jclass LDKSendError_BlindedPathAdvanceFailed_class = NULL; +static jmethodID LDKSendError_BlindedPathAdvanceFailed_meth = NULL; JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSendError_init (JNIEnv *env, jclass clz) { LDKSendError_Secp256k1_class = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSendError$Secp256k1")); @@ -9303,6 +9024,16 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSendError_init (JNIEnv CHECK(LDKSendError_BufferFull_class != NULL); LDKSendError_BufferFull_meth = (*env)->GetMethodID(env, LDKSendError_BufferFull_class, "", "()V"); CHECK(LDKSendError_BufferFull_meth != NULL); + LDKSendError_GetNodeIdFailed_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSendError$GetNodeIdFailed")); + CHECK(LDKSendError_GetNodeIdFailed_class != NULL); + LDKSendError_GetNodeIdFailed_meth = (*env)->GetMethodID(env, LDKSendError_GetNodeIdFailed_class, "", "()V"); + CHECK(LDKSendError_GetNodeIdFailed_meth != NULL); + LDKSendError_BlindedPathAdvanceFailed_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKSendError$BlindedPathAdvanceFailed")); + CHECK(LDKSendError_BlindedPathAdvanceFailed_class != NULL); + LDKSendError_BlindedPathAdvanceFailed_meth = (*env)->GetMethodID(env, LDKSendError_BlindedPathAdvanceFailed_class, "", "()V"); + CHECK(LDKSendError_BlindedPathAdvanceFailed_meth != NULL); } JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSendError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { LDKSendError *obj = (LDKSendError*)untag_ptr(ptr); @@ -9326,6 +9057,12 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSendError_1ref_1from_1pt case LDKSendError_BufferFull: { return (*env)->NewObject(env, LDKSendError_BufferFull_class, LDKSendError_BufferFull_meth); } + case LDKSendError_GetNodeIdFailed: { + return (*env)->NewObject(env, LDKSendError_GetNodeIdFailed_class, LDKSendError_GetNodeIdFailed_meth); + } + case LDKSendError_BlindedPathAdvanceFailed: { + return (*env)->NewObject(env, LDKSendError_BlindedPathAdvanceFailed_class, LDKSendError_BlindedPathAdvanceFailed_meth); + } default: abort(); } } @@ -9350,61 +9087,543 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1ge return ret_ref; } -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); +static jclass LDKParseError_Bech32Error_class = NULL; +static jmethodID LDKParseError_Bech32Error_meth = NULL; +static jclass LDKParseError_ParseAmountError_class = NULL; +static jmethodID LDKParseError_ParseAmountError_meth = NULL; +static jclass LDKParseError_MalformedSignature_class = NULL; +static jmethodID LDKParseError_MalformedSignature_meth = NULL; +static jclass LDKParseError_BadPrefix_class = NULL; +static jmethodID LDKParseError_BadPrefix_meth = NULL; +static jclass LDKParseError_UnknownCurrency_class = NULL; +static jmethodID LDKParseError_UnknownCurrency_meth = NULL; +static jclass LDKParseError_UnknownSiPrefix_class = NULL; +static jmethodID LDKParseError_UnknownSiPrefix_meth = NULL; +static jclass LDKParseError_MalformedHRP_class = NULL; +static jmethodID LDKParseError_MalformedHRP_meth = NULL; +static jclass LDKParseError_TooShortDataPart_class = NULL; +static jmethodID LDKParseError_TooShortDataPart_meth = NULL; +static jclass LDKParseError_UnexpectedEndOfTaggedFields_class = NULL; +static jmethodID LDKParseError_UnexpectedEndOfTaggedFields_meth = NULL; +static jclass LDKParseError_DescriptionDecodeError_class = NULL; +static jmethodID LDKParseError_DescriptionDecodeError_meth = NULL; +static jclass LDKParseError_PaddingError_class = NULL; +static jmethodID LDKParseError_PaddingError_meth = NULL; +static jclass LDKParseError_IntegerOverflowError_class = NULL; +static jmethodID LDKParseError_IntegerOverflowError_meth = NULL; +static jclass LDKParseError_InvalidSegWitProgramLength_class = NULL; +static jmethodID LDKParseError_InvalidSegWitProgramLength_meth = NULL; +static jclass LDKParseError_InvalidPubKeyHashLength_class = NULL; +static jmethodID LDKParseError_InvalidPubKeyHashLength_meth = NULL; +static jclass LDKParseError_InvalidScriptHashLength_class = NULL; +static jmethodID LDKParseError_InvalidScriptHashLength_meth = NULL; +static jclass LDKParseError_InvalidRecoveryId_class = NULL; +static jmethodID LDKParseError_InvalidRecoveryId_meth = NULL; +static jclass LDKParseError_InvalidSliceLength_class = NULL; +static jmethodID LDKParseError_InvalidSliceLength_meth = NULL; +static jclass LDKParseError_Skip_class = NULL; +static jmethodID LDKParseError_Skip_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKParseError_init (JNIEnv *env, jclass clz) { + LDKParseError_Bech32Error_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$Bech32Error")); + CHECK(LDKParseError_Bech32Error_class != NULL); + LDKParseError_Bech32Error_meth = (*env)->GetMethodID(env, LDKParseError_Bech32Error_class, "", "(J)V"); + CHECK(LDKParseError_Bech32Error_meth != NULL); + LDKParseError_ParseAmountError_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$ParseAmountError")); + CHECK(LDKParseError_ParseAmountError_class != NULL); + LDKParseError_ParseAmountError_meth = (*env)->GetMethodID(env, LDKParseError_ParseAmountError_class, "", "(I)V"); + CHECK(LDKParseError_ParseAmountError_meth != NULL); + LDKParseError_MalformedSignature_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$MalformedSignature")); + CHECK(LDKParseError_MalformedSignature_class != NULL); + LDKParseError_MalformedSignature_meth = (*env)->GetMethodID(env, LDKParseError_MalformedSignature_class, "", "(Lorg/ldk/enums/Secp256k1Error;)V"); + CHECK(LDKParseError_MalformedSignature_meth != NULL); + LDKParseError_BadPrefix_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$BadPrefix")); + CHECK(LDKParseError_BadPrefix_class != NULL); + LDKParseError_BadPrefix_meth = (*env)->GetMethodID(env, LDKParseError_BadPrefix_class, "", "()V"); + CHECK(LDKParseError_BadPrefix_meth != NULL); + LDKParseError_UnknownCurrency_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$UnknownCurrency")); + CHECK(LDKParseError_UnknownCurrency_class != NULL); + LDKParseError_UnknownCurrency_meth = (*env)->GetMethodID(env, LDKParseError_UnknownCurrency_class, "", "()V"); + CHECK(LDKParseError_UnknownCurrency_meth != NULL); + LDKParseError_UnknownSiPrefix_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$UnknownSiPrefix")); + CHECK(LDKParseError_UnknownSiPrefix_class != NULL); + LDKParseError_UnknownSiPrefix_meth = (*env)->GetMethodID(env, LDKParseError_UnknownSiPrefix_class, "", "()V"); + CHECK(LDKParseError_UnknownSiPrefix_meth != NULL); + LDKParseError_MalformedHRP_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$MalformedHRP")); + CHECK(LDKParseError_MalformedHRP_class != NULL); + LDKParseError_MalformedHRP_meth = (*env)->GetMethodID(env, LDKParseError_MalformedHRP_class, "", "()V"); + CHECK(LDKParseError_MalformedHRP_meth != NULL); + LDKParseError_TooShortDataPart_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$TooShortDataPart")); + CHECK(LDKParseError_TooShortDataPart_class != NULL); + LDKParseError_TooShortDataPart_meth = (*env)->GetMethodID(env, LDKParseError_TooShortDataPart_class, "", "()V"); + CHECK(LDKParseError_TooShortDataPart_meth != NULL); + LDKParseError_UnexpectedEndOfTaggedFields_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$UnexpectedEndOfTaggedFields")); + CHECK(LDKParseError_UnexpectedEndOfTaggedFields_class != NULL); + LDKParseError_UnexpectedEndOfTaggedFields_meth = (*env)->GetMethodID(env, LDKParseError_UnexpectedEndOfTaggedFields_class, "", "()V"); + CHECK(LDKParseError_UnexpectedEndOfTaggedFields_meth != NULL); + LDKParseError_DescriptionDecodeError_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$DescriptionDecodeError")); + CHECK(LDKParseError_DescriptionDecodeError_class != NULL); + LDKParseError_DescriptionDecodeError_meth = (*env)->GetMethodID(env, LDKParseError_DescriptionDecodeError_class, "", "(I)V"); + CHECK(LDKParseError_DescriptionDecodeError_meth != NULL); + LDKParseError_PaddingError_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$PaddingError")); + CHECK(LDKParseError_PaddingError_class != NULL); + LDKParseError_PaddingError_meth = (*env)->GetMethodID(env, LDKParseError_PaddingError_class, "", "()V"); + CHECK(LDKParseError_PaddingError_meth != NULL); + LDKParseError_IntegerOverflowError_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$IntegerOverflowError")); + CHECK(LDKParseError_IntegerOverflowError_class != NULL); + LDKParseError_IntegerOverflowError_meth = (*env)->GetMethodID(env, LDKParseError_IntegerOverflowError_class, "", "()V"); + CHECK(LDKParseError_IntegerOverflowError_meth != NULL); + LDKParseError_InvalidSegWitProgramLength_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidSegWitProgramLength")); + CHECK(LDKParseError_InvalidSegWitProgramLength_class != NULL); + LDKParseError_InvalidSegWitProgramLength_meth = (*env)->GetMethodID(env, LDKParseError_InvalidSegWitProgramLength_class, "", "()V"); + CHECK(LDKParseError_InvalidSegWitProgramLength_meth != NULL); + LDKParseError_InvalidPubKeyHashLength_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidPubKeyHashLength")); + CHECK(LDKParseError_InvalidPubKeyHashLength_class != NULL); + LDKParseError_InvalidPubKeyHashLength_meth = (*env)->GetMethodID(env, LDKParseError_InvalidPubKeyHashLength_class, "", "()V"); + CHECK(LDKParseError_InvalidPubKeyHashLength_meth != NULL); + LDKParseError_InvalidScriptHashLength_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidScriptHashLength")); + CHECK(LDKParseError_InvalidScriptHashLength_class != NULL); + LDKParseError_InvalidScriptHashLength_meth = (*env)->GetMethodID(env, LDKParseError_InvalidScriptHashLength_class, "", "()V"); + CHECK(LDKParseError_InvalidScriptHashLength_meth != NULL); + LDKParseError_InvalidRecoveryId_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidRecoveryId")); + CHECK(LDKParseError_InvalidRecoveryId_class != NULL); + LDKParseError_InvalidRecoveryId_meth = (*env)->GetMethodID(env, LDKParseError_InvalidRecoveryId_class, "", "()V"); + CHECK(LDKParseError_InvalidRecoveryId_meth != NULL); + LDKParseError_InvalidSliceLength_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$InvalidSliceLength")); + CHECK(LDKParseError_InvalidSliceLength_class != NULL); + LDKParseError_InvalidSliceLength_meth = (*env)->GetMethodID(env, LDKParseError_InvalidSliceLength_class, "", "(Ljava/lang/String;)V"); + CHECK(LDKParseError_InvalidSliceLength_meth != NULL); + LDKParseError_Skip_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseError$Skip")); + CHECK(LDKParseError_Skip_class != NULL); + LDKParseError_Skip_meth = (*env)->GetMethodID(env, LDKParseError_Skip_class, "", "()V"); + CHECK(LDKParseError_Skip_meth != NULL); } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKGraphSyncError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKGraphSyncError *obj = (LDKGraphSyncError*)untag_ptr(ptr); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKParseError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKParseError *obj = (LDKParseError*)untag_ptr(ptr); switch(obj->tag) { - case LDKGraphSyncError_DecodeError: { - int64_t decode_error_ref = tag_ptr(&obj->decode_error, false); - return (*env)->NewObject(env, LDKGraphSyncError_DecodeError_class, LDKGraphSyncError_DecodeError_meth, decode_error_ref); + case LDKParseError_Bech32Error: { + int64_t bech32_error_ref = tag_ptr(&obj->bech32_error, false); + return (*env)->NewObject(env, LDKParseError_Bech32Error_class, LDKParseError_Bech32Error_meth, bech32_error_ref); } - case LDKGraphSyncError_LightningError: { - LDKLightningError lightning_error_var = obj->lightning_error; - int64_t lightning_error_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(lightning_error_var); - lightning_error_ref = tag_ptr(lightning_error_var.inner, false); - return (*env)->NewObject(env, LDKGraphSyncError_LightningError_class, LDKGraphSyncError_LightningError_meth, lightning_error_ref); + case LDKParseError_ParseAmountError: { + /*obj->parse_amount_error*/ + return (*env)->NewObject(env, LDKParseError_ParseAmountError_class, LDKParseError_ParseAmountError_meth, 0); } - default: abort(); - } -} -static inline uint32_t CResult_u32GraphSyncErrorZ_get_ok(LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -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*)untag_ptr(owner); - int32_t ret_conv = CResult_u32GraphSyncErrorZ_get_ok(owner_conv); - return ret_conv; -} - -static inline struct LDKGraphSyncError CResult_u32GraphSyncErrorZ_get_err(LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return GraphSyncError_clone(&*owner->contents.err); -} -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*)untag_ptr(owner); - LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError"); - *ret_copy = CResult_u32GraphSyncErrorZ_get_err(owner_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - + case LDKParseError_MalformedSignature: { + jclass malformed_signature_conv = LDKSecp256k1Error_to_java(env, obj->malformed_signature); + return (*env)->NewObject(env, LDKParseError_MalformedSignature_class, LDKParseError_MalformedSignature_meth, malformed_signature_conv); + } + case LDKParseError_BadPrefix: { + return (*env)->NewObject(env, LDKParseError_BadPrefix_class, LDKParseError_BadPrefix_meth); + } + case LDKParseError_UnknownCurrency: { + return (*env)->NewObject(env, LDKParseError_UnknownCurrency_class, LDKParseError_UnknownCurrency_meth); + } + case LDKParseError_UnknownSiPrefix: { + return (*env)->NewObject(env, LDKParseError_UnknownSiPrefix_class, LDKParseError_UnknownSiPrefix_meth); + } + case LDKParseError_MalformedHRP: { + return (*env)->NewObject(env, LDKParseError_MalformedHRP_class, LDKParseError_MalformedHRP_meth); + } + case LDKParseError_TooShortDataPart: { + return (*env)->NewObject(env, LDKParseError_TooShortDataPart_class, LDKParseError_TooShortDataPart_meth); + } + case LDKParseError_UnexpectedEndOfTaggedFields: { + return (*env)->NewObject(env, LDKParseError_UnexpectedEndOfTaggedFields_class, LDKParseError_UnexpectedEndOfTaggedFields_meth); + } + case LDKParseError_DescriptionDecodeError: { + /*obj->description_decode_error*/ + return (*env)->NewObject(env, LDKParseError_DescriptionDecodeError_class, LDKParseError_DescriptionDecodeError_meth, 0); + } + case LDKParseError_PaddingError: { + return (*env)->NewObject(env, LDKParseError_PaddingError_class, LDKParseError_PaddingError_meth); + } + case LDKParseError_IntegerOverflowError: { + return (*env)->NewObject(env, LDKParseError_IntegerOverflowError_class, LDKParseError_IntegerOverflowError_meth); + } + case LDKParseError_InvalidSegWitProgramLength: { + return (*env)->NewObject(env, LDKParseError_InvalidSegWitProgramLength_class, LDKParseError_InvalidSegWitProgramLength_meth); + } + case LDKParseError_InvalidPubKeyHashLength: { + return (*env)->NewObject(env, LDKParseError_InvalidPubKeyHashLength_class, LDKParseError_InvalidPubKeyHashLength_meth); + } + case LDKParseError_InvalidScriptHashLength: { + return (*env)->NewObject(env, LDKParseError_InvalidScriptHashLength_class, LDKParseError_InvalidScriptHashLength_meth); + } + case LDKParseError_InvalidRecoveryId: { + return (*env)->NewObject(env, LDKParseError_InvalidRecoveryId_class, LDKParseError_InvalidRecoveryId_meth); + } + case LDKParseError_InvalidSliceLength: { + LDKStr invalid_slice_length_str = obj->invalid_slice_length; + jstring invalid_slice_length_conv = str_ref_to_java(env, invalid_slice_length_str.chars, invalid_slice_length_str.len); + return (*env)->NewObject(env, LDKParseError_InvalidSliceLength_class, LDKParseError_InvalidSliceLength_meth, invalid_slice_length_conv); + } + case LDKParseError_Skip: { + return (*env)->NewObject(env, LDKParseError_Skip_class, LDKParseError_Skip_meth); + } + default: abort(); + } +} +static inline enum LDKSiPrefix CResult_SiPrefixParseErrorZ_get_ok(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return SiPrefix_clone(&*owner->contents.result); +} +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_SiPrefixParseErrorZ* owner_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(owner); + jclass ret_conv = LDKSiPrefix_to_java(env, CResult_SiPrefixParseErrorZ_get_ok(owner_conv)); + return ret_conv; +} + +static inline struct LDKParseError CResult_SiPrefixParseErrorZ_get_err(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return ParseError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_SiPrefixParseErrorZ* owner_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(owner); + LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError"); + *ret_copy = CResult_SiPrefixParseErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static jclass LDKParseOrSemanticError_ParseError_class = NULL; +static jmethodID LDKParseOrSemanticError_ParseError_meth = NULL; +static jclass LDKParseOrSemanticError_SemanticError_class = NULL; +static jmethodID LDKParseOrSemanticError_SemanticError_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKParseOrSemanticError_init (JNIEnv *env, jclass clz) { + LDKParseOrSemanticError_ParseError_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseOrSemanticError$ParseError")); + CHECK(LDKParseOrSemanticError_ParseError_class != NULL); + LDKParseOrSemanticError_ParseError_meth = (*env)->GetMethodID(env, LDKParseOrSemanticError_ParseError_class, "", "(J)V"); + CHECK(LDKParseOrSemanticError_ParseError_meth != NULL); + LDKParseOrSemanticError_SemanticError_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKParseOrSemanticError$SemanticError")); + CHECK(LDKParseOrSemanticError_SemanticError_class != NULL); + LDKParseOrSemanticError_SemanticError_meth = (*env)->GetMethodID(env, LDKParseOrSemanticError_SemanticError_class, "", "(Lorg/ldk/enums/SemanticError;)V"); + CHECK(LDKParseOrSemanticError_SemanticError_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKParseOrSemanticError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKParseOrSemanticError *obj = (LDKParseOrSemanticError*)untag_ptr(ptr); + switch(obj->tag) { + case LDKParseOrSemanticError_ParseError: { + int64_t parse_error_ref = tag_ptr(&obj->parse_error, false); + return (*env)->NewObject(env, LDKParseOrSemanticError_ParseError_class, LDKParseOrSemanticError_ParseError_meth, parse_error_ref); + } + case LDKParseOrSemanticError_SemanticError: { + jclass semantic_error_conv = LDKSemanticError_to_java(env, obj->semantic_error); + return (*env)->NewObject(env, LDKParseOrSemanticError_SemanticError_class, LDKParseOrSemanticError_SemanticError_meth, semantic_error_conv); + } + default: abort(); + } +} +static inline struct LDKInvoice CResult_InvoiceParseOrSemanticErrorZ_get_ok(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner){ + LDKInvoice ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_InvoiceParseOrSemanticErrorZ* owner_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(owner); + LDKInvoice ret_var = CResult_InvoiceParseOrSemanticErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKParseOrSemanticError CResult_InvoiceParseOrSemanticErrorZ_get_err(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return ParseOrSemanticError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_InvoiceParseOrSemanticErrorZ* owner_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(owner); + LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError"); + *ret_copy = CResult_InvoiceParseOrSemanticErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKSignedRawInvoice CResult_SignedRawInvoiceParseErrorZ_get_ok(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner){ + LDKSignedRawInvoice ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_SignedRawInvoiceParseErrorZ* owner_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(owner); + LDKSignedRawInvoice ret_var = CResult_SignedRawInvoiceParseErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKParseError CResult_SignedRawInvoiceParseErrorZ_get_err(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return ParseError_clone(&*owner->contents.err); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_SignedRawInvoiceParseErrorZ* owner_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(owner); + LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError"); + *ret_copy = CResult_SignedRawInvoiceParseErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKRawInvoice C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){ + LDKRawInvoice ret = owner->a; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner); + LDKRawInvoice ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKThirtyTwoBytes C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){ + return ThirtyTwoBytes_clone(&owner->b); +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(owner_conv).data); + return ret_arr; +} + +static inline struct LDKInvoiceSignature C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){ + LDKInvoiceSignature ret = owner->c; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1get_1c(JNIEnv *env, jclass clz, int64_t owner) { + LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner); + LDKInvoiceSignature ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKPayeePubKey CResult_PayeePubKeyErrorZ_get_ok(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner){ + LDKPayeePubKey ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_PayeePubKeyErrorZ* owner_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(owner); + LDKPayeePubKey ret_var = CResult_PayeePubKeyErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline enum LDKSecp256k1Error CResult_PayeePubKeyErrorZ_get_err(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_PayeePubKeyErrorZ* owner_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(owner); + jclass ret_conv = LDKSecp256k1Error_to_java(env, CResult_PayeePubKeyErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline LDKCVec_PrivateRouteZ CVec_PrivateRouteZ_clone(const LDKCVec_PrivateRouteZ *orig) { + LDKCVec_PrivateRouteZ ret = { .data = MALLOC(sizeof(LDKPrivateRoute) * orig->datalen, "LDKCVec_PrivateRouteZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = PrivateRoute_clone(&orig->data[i]); + } + return ret; +} +static inline struct LDKPositiveTimestamp CResult_PositiveTimestampCreationErrorZ_get_ok(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner){ + LDKPositiveTimestamp ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_PositiveTimestampCreationErrorZ* owner_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(owner); + LDKPositiveTimestamp ret_var = CResult_PositiveTimestampCreationErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline enum LDKCreationError CResult_PositiveTimestampCreationErrorZ_get_err(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return CreationError_clone(&*owner->contents.err); +} +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_PositiveTimestampCreationErrorZ* owner_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(owner); + jclass ret_conv = LDKCreationError_to_java(env, CResult_PositiveTimestampCreationErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline void CResult_NoneSemanticErrorZ_get_ok(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; +} +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneSemanticErrorZ* owner_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(owner); + CResult_NoneSemanticErrorZ_get_ok(owner_conv); +} + +static inline enum LDKSemanticError CResult_NoneSemanticErrorZ_get_err(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return SemanticError_clone(&*owner->contents.err); +} +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_NoneSemanticErrorZ* owner_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(owner); + jclass ret_conv = LDKSemanticError_to_java(env, CResult_NoneSemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline struct LDKInvoice CResult_InvoiceSemanticErrorZ_get_ok(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner){ + LDKInvoice ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_InvoiceSemanticErrorZ* owner_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(owner); + LDKInvoice ret_var = CResult_InvoiceSemanticErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline enum LDKSemanticError CResult_InvoiceSemanticErrorZ_get_err(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return SemanticError_clone(&*owner->contents.err); +} +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_InvoiceSemanticErrorZ* owner_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(owner); + jclass ret_conv = LDKSemanticError_to_java(env, CResult_InvoiceSemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline struct LDKDescription CResult_DescriptionCreationErrorZ_get_ok(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner){ + LDKDescription ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_DescriptionCreationErrorZ* owner_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(owner); + LDKDescription ret_var = CResult_DescriptionCreationErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline enum LDKCreationError CResult_DescriptionCreationErrorZ_get_err(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return CreationError_clone(&*owner->contents.err); +} +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_DescriptionCreationErrorZ* owner_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(owner); + jclass ret_conv = LDKCreationError_to_java(env, CResult_DescriptionCreationErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline struct LDKPrivateRoute CResult_PrivateRouteCreationErrorZ_get_ok(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner){ + LDKPrivateRoute ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1get_1ok(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_PrivateRouteCreationErrorZ* owner_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(owner); + LDKPrivateRoute ret_var = CResult_PrivateRouteCreationErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline enum LDKCreationError CResult_PrivateRouteCreationErrorZ_get_err(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return CreationError_clone(&*owner->contents.err); +} +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1get_1err(JNIEnv *env, jclass clz, int64_t owner) { + LDKCResult_PrivateRouteCreationErrorZ* owner_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(owner); + jclass ret_conv = LDKCreationError_to_java(env, CResult_PrivateRouteCreationErrorZ_get_err(owner_conv)); + return ret_conv; +} + +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 jobject JNICALL Java_org_ldk_impl_bindings_LDKGraphSyncError_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKGraphSyncError *obj = (LDKGraphSyncError*)untag_ptr(ptr); + switch(obj->tag) { + case LDKGraphSyncError_DecodeError: { + int64_t decode_error_ref = tag_ptr(&obj->decode_error, false); + return (*env)->NewObject(env, LDKGraphSyncError_DecodeError_class, LDKGraphSyncError_DecodeError_meth, decode_error_ref); + } + case LDKGraphSyncError_LightningError: { + LDKLightningError lightning_error_var = obj->lightning_error; + int64_t lightning_error_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(lightning_error_var); + lightning_error_ref = tag_ptr(lightning_error_var.inner, false); + return (*env)->NewObject(env, LDKGraphSyncError_LightningError_class, LDKGraphSyncError_LightningError_meth, lightning_error_ref); + } + default: abort(); + } +} +static inline uint32_t CResult_u32GraphSyncErrorZ_get_ok(LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; +} +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*)untag_ptr(owner); + int32_t ret_conv = CResult_u32GraphSyncErrorZ_get_ok(owner_conv); + return ret_conv; +} + +static inline struct LDKGraphSyncError CResult_u32GraphSyncErrorZ_get_err(LDKCResult_u32GraphSyncErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return GraphSyncError_clone(&*owner->contents.err); +} +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*)untag_ptr(owner); + LDKGraphSyncError *ret_copy = MALLOC(sizeof(LDKGraphSyncError), "LDKGraphSyncError"); + *ret_copy = CResult_u32GraphSyncErrorZ_get_err(owner_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline struct LDKNetAddress CResult_NetAddressDecodeErrorZ_get_ok(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return NetAddress_clone(&*owner->contents.result); @@ -10597,6 +10816,55 @@ static inline LDKCVec_OutPointZ CVec_OutPointZ_clone(const LDKCVec_OutPointZ *or } return ret; } +static inline LDKCVec_MonitorUpdateIdZ CVec_MonitorUpdateIdZ_clone(const LDKCVec_MonitorUpdateIdZ *orig) { + LDKCVec_MonitorUpdateIdZ ret = { .data = MALLOC(sizeof(LDKMonitorUpdateId) * orig->datalen, "LDKCVec_MonitorUpdateIdZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = MonitorUpdateId_clone(&orig->data[i]); + } + return ret; +} +static inline struct LDKOutPoint C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR owner){ + LDKOutPoint ret = owner->a; + ret.is_owned = false; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1get_1a(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* owner_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(owner); + LDKOutPoint ret_var = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKCVec_MonitorUpdateIdZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR owner){ + return CVec_MonitorUpdateIdZ_clone(&owner->b); +} +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1get_1b(JNIEnv *env, jclass clz, int64_t owner) { + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* owner_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(owner); + LDKCVec_MonitorUpdateIdZ ret_var = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(owner_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t r = 0; r < ret_var.datalen; r++) { + LDKMonitorUpdateId ret_conv_17_var = ret_var.data[r]; + int64_t ret_conv_17_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_17_var); + ret_conv_17_ref = tag_ptr(ret_conv_17_var.inner, ret_conv_17_var.is_owned); + ret_arr_ptr[r] = ret_conv_17_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); + FREE(ret_var.data); + return ret_arr; +} + +static inline LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_clone(const LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ *orig) { + LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ) * orig->datalen, "LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(&orig->data[i]); + } + return ret; +} typedef struct LDKMessageSendEventsProvider_JCalls { atomic_size_t refcnt; JavaVM *vm; @@ -10815,7 +11083,7 @@ static void LDKEventHandler_JCalls_free(void* this_arg) { FREE(j_calls); } } -void handle_event_LDKEventHandler_jcall(const void* this_arg, const LDKEvent * event) { +void handle_event_LDKEventHandler_jcall(const void* this_arg, LDKEvent event) { LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -10824,12 +11092,12 @@ void handle_event_LDKEventHandler_jcall(const void* this_arg, const LDKEvent * e } else { DO_ASSERT(get_jenv_res == JNI_OK); } - LDKEvent *ret_event = MALLOC(sizeof(LDKEvent), "LDKEvent ret conversion"); - *ret_event = Event_clone(event); - int64_t ref_event = tag_ptr(ret_event, true); + LDKEvent *event_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *event_copy = event; + int64_t event_ref = tag_ptr(event_copy, true); jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - (*env)->CallVoidMethod(env, obj, j_calls->handle_event_meth, ref_event); + (*env)->CallVoidMethod(env, obj, j_calls->handle_event_meth, event_ref); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to handle_event in LDKEventHandler from rust threw an exception."); @@ -10868,7 +11136,10 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventHandler_1handle_1event(JN void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKEventHandler* this_arg_conv = (LDKEventHandler*)this_arg_ptr; - LDKEvent* event_conv = (LDKEvent*)untag_ptr(event); + void* event_ptr = untag_ptr(event); + CHECK_ACCESS(event_ptr); + LDKEvent event_conv = *(LDKEvent*)(event_ptr); + event_conv = Event_clone((LDKEvent*)untag_ptr(event)); (this_arg_conv->handle_event)(this_arg_conv->this_arg, event_conv); } @@ -11509,7 +11780,7 @@ void best_block_updated_LDKConfirm_jcall(const void* this_arg, const uint8_t (* DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } } -LDKCVec_TxidZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) { +LDKCVec_C2Tuple_TxidBlockHashZZ 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); @@ -11520,24 +11791,27 @@ LDKCVec_TxidZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) { } jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - jobjectArray ret = (*env)->CallObjectMethod(env, obj, j_calls->get_relevant_txids_meth); + int64_tArray 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; + LDKCVec_C2Tuple_TxidBlockHashZZ 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"); + ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_TxidBlockHashZ), "LDKCVec_C2Tuple_TxidBlockHashZZ 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; + int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL); + for (size_t z = 0; z < ret_constr.datalen; z++) { + int64_t ret_conv_25 = ret_vals[z]; + void* ret_conv_25_ptr = untag_ptr(ret_conv_25); + CHECK_ACCESS(ret_conv_25_ptr); + LDKC2Tuple_TxidBlockHashZ ret_conv_25_conv = *(LDKC2Tuple_TxidBlockHashZ*)(ret_conv_25_ptr); + FREE(untag_ptr(ret_conv_25)); + ret_constr.data[z] = ret_conv_25_conv; } + (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0); if (get_jenv_res == JNI_EDETACHED) { DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); } @@ -11560,7 +11834,7 @@ static inline LDKConfirm LDKConfirm_init (JNIEnv *env, jclass clz, jobject o) { 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"); + calls->get_relevant_txids_meth = (*env)->GetMethodID(env, c, "get_relevant_txids", "()[J"); CHECK(calls->get_relevant_txids_meth != NULL); LDKConfirm ret = { @@ -11627,20 +11901,20 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1best_1block_1updated( (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) { +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Confirm_1get_1relevant_1txids(JNIEnv *env, jclass clz, int64_t this_arg) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } 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); + LDKCVec_C2Tuple_TxidBlockHashZZ ret_var = (this_arg_conv->get_relevant_txids)(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 z = 0; z < ret_var.datalen; z++) { + LDKC2Tuple_TxidBlockHashZ* ret_conv_25_conv = MALLOC(sizeof(LDKC2Tuple_TxidBlockHashZ), "LDKC2Tuple_TxidBlockHashZ"); + *ret_conv_25_conv = ret_var.data[z]; + ret_arr_ptr[z] = tag_ptr(ret_conv_25_conv, true); } - + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); FREE(ret_var.data); return ret_arr; } @@ -14424,8 +14698,8 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEffectiveCapacity_1ref_1 } case LDKEffectiveCapacity_Total: { int64_t capacity_msat_conv = obj->total.capacity_msat; - int64_t htlc_maximum_msat_ref = tag_ptr(&obj->total.htlc_maximum_msat, false); - return (*env)->NewObject(env, LDKEffectiveCapacity_Total_class, LDKEffectiveCapacity_Total_meth, capacity_msat_conv, htlc_maximum_msat_ref); + int64_t htlc_maximum_msat_conv = obj->total.htlc_maximum_msat; + return (*env)->NewObject(env, LDKEffectiveCapacity_Total_class, LDKEffectiveCapacity_Total_meth, capacity_msat_conv, htlc_maximum_msat_conv); } case LDKEffectiveCapacity_Infinite: { return (*env)->NewObject(env, LDKEffectiveCapacity_Infinite_class, LDKEffectiveCapacity_Infinite_meth); @@ -14436,480 +14710,12 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEffectiveCapacity_1ref_1 default: abort(); } } -static jclass LDKDestination_Node_class = NULL; -static jmethodID LDKDestination_Node_meth = NULL; -static jclass LDKDestination_BlindedRoute_class = NULL; -static jmethodID LDKDestination_BlindedRoute_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKDestination_init (JNIEnv *env, jclass clz) { - LDKDestination_Node_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDestination$Node")); - CHECK(LDKDestination_Node_class != NULL); - LDKDestination_Node_meth = (*env)->GetMethodID(env, LDKDestination_Node_class, "", "([B)V"); - CHECK(LDKDestination_Node_meth != NULL); - LDKDestination_BlindedRoute_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDestination$BlindedRoute")); - CHECK(LDKDestination_BlindedRoute_class != NULL); - LDKDestination_BlindedRoute_meth = (*env)->GetMethodID(env, LDKDestination_BlindedRoute_class, "", "(J)V"); - CHECK(LDKDestination_BlindedRoute_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDestination_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKDestination *obj = (LDKDestination*)untag_ptr(ptr); - switch(obj->tag) { - case LDKDestination_Node: { - int8_tArray node_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, node_arr, 0, 33, obj->node.compressed_form); - return (*env)->NewObject(env, LDKDestination_Node_class, LDKDestination_Node_meth, node_arr); - } - case LDKDestination_BlindedRoute: { - LDKBlindedRoute blinded_route_var = obj->blinded_route; - int64_t blinded_route_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_route_var); - blinded_route_ref = tag_ptr(blinded_route_var.inner, false); - return (*env)->NewObject(env, LDKDestination_BlindedRoute_class, LDKDestination_BlindedRoute_meth, blinded_route_ref); - } - default: abort(); - } -} -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*)untag_ptr(ptr); - switch(obj->tag) { - case LDKGossipSync_P2P: { - LDKP2PGossipSync p2p_var = obj->p2p; - int64_t p2p_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(p2p_var); - p2p_ref = tag_ptr(p2p_var.inner, false); - return (*env)->NewObject(env, LDKGossipSync_P2P_class, LDKGossipSync_P2P_meth, p2p_ref); - } - case LDKGossipSync_Rapid: { - LDKRapidGossipSync rapid_var = obj->rapid; - int64_t rapid_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(rapid_var); - rapid_ref = tag_ptr(rapid_var.inner, false); - return (*env)->NewObject(env, LDKGossipSync_Rapid_class, LDKGossipSync_Rapid_meth, rapid_ref); - } - case LDKGossipSync_None: { - return (*env)->NewObject(env, LDKGossipSync_None_class, LDKGossipSync_None_meth); - } - default: abort(); - } -} -static jclass LDKFallback_SegWitProgram_class = NULL; -static jmethodID LDKFallback_SegWitProgram_meth = NULL; -static jclass LDKFallback_PubKeyHash_class = NULL; -static jmethodID LDKFallback_PubKeyHash_meth = NULL; -static jclass LDKFallback_ScriptHash_class = NULL; -static jmethodID LDKFallback_ScriptHash_meth = NULL; -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKFallback_init (JNIEnv *env, jclass clz) { - LDKFallback_SegWitProgram_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKFallback$SegWitProgram")); - CHECK(LDKFallback_SegWitProgram_class != NULL); - LDKFallback_SegWitProgram_meth = (*env)->GetMethodID(env, LDKFallback_SegWitProgram_class, "", "(B[B)V"); - CHECK(LDKFallback_SegWitProgram_meth != NULL); - LDKFallback_PubKeyHash_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKFallback$PubKeyHash")); - CHECK(LDKFallback_PubKeyHash_class != NULL); - LDKFallback_PubKeyHash_meth = (*env)->GetMethodID(env, LDKFallback_PubKeyHash_class, "", "([B)V"); - CHECK(LDKFallback_PubKeyHash_meth != NULL); - LDKFallback_ScriptHash_class = - (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKFallback$ScriptHash")); - CHECK(LDKFallback_ScriptHash_class != NULL); - LDKFallback_ScriptHash_meth = (*env)->GetMethodID(env, LDKFallback_ScriptHash_class, "", "([B)V"); - CHECK(LDKFallback_ScriptHash_meth != NULL); -} -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFallback_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKFallback *obj = (LDKFallback*)untag_ptr(ptr); - switch(obj->tag) { - case LDKFallback_SegWitProgram: { - uint8_t version_val = obj->seg_wit_program.version._0; - LDKCVec_u8Z program_var = obj->seg_wit_program.program; - int8_tArray program_arr = (*env)->NewByteArray(env, program_var.datalen); - (*env)->SetByteArrayRegion(env, program_arr, 0, program_var.datalen, program_var.data); - return (*env)->NewObject(env, LDKFallback_SegWitProgram_class, LDKFallback_SegWitProgram_meth, version_val, program_arr); - } - case LDKFallback_PubKeyHash: { - int8_tArray pub_key_hash_arr = (*env)->NewByteArray(env, 20); - (*env)->SetByteArrayRegion(env, pub_key_hash_arr, 0, 20, obj->pub_key_hash.data); - return (*env)->NewObject(env, LDKFallback_PubKeyHash_class, LDKFallback_PubKeyHash_meth, pub_key_hash_arr); - } - case LDKFallback_ScriptHash: { - int8_tArray script_hash_arr = (*env)->NewByteArray(env, 20); - (*env)->SetByteArrayRegion(env, script_hash_arr, 0, 20, obj->script_hash.data); - return (*env)->NewObject(env, LDKFallback_ScriptHash_class, LDKFallback_ScriptHash_meth, script_hash_arr); - } - default: abort(); - } -} -typedef struct LDKPayer_JCalls { - atomic_size_t refcnt; - JavaVM *vm; - jweak o; - jmethodID node_id_meth; - jmethodID first_hops_meth; - jmethodID send_payment_meth; - jmethodID send_spontaneous_payment_meth; - jmethodID retry_payment_meth; - jmethodID abandon_payment_meth; -} LDKPayer_JCalls; -static void LDKPayer_JCalls_free(void* this_arg) { - LDKPayer_JCalls *j_calls = (LDKPayer_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 node_id_LDKPayer_jcall(const void* this_arg) { - LDKPayer_JCalls *j_calls = (LDKPayer_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->node_id_meth); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to node_id in LDKPayer 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; -} -LDKCVec_ChannelDetailsZ first_hops_LDKPayer_jcall(const void* this_arg) { - LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg; - JNIEnv *env; - jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); - } else { - DO_ASSERT(get_jenv_res == JNI_OK); - } - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->first_hops_meth); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to first_hops in LDKPayer from rust threw an exception."); - } - LDKCVec_ChannelDetailsZ ret_constr; - ret_constr.datalen = (*env)->GetArrayLength(env, ret); - if (ret_constr.datalen > 0) - ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); - else - ret_constr.data = NULL; - int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL); - for (size_t q = 0; q < ret_constr.datalen; q++) { - int64_t ret_conv_16 = ret_vals[q]; - LDKChannelDetails ret_conv_16_conv; - ret_conv_16_conv.inner = untag_ptr(ret_conv_16); - ret_conv_16_conv.is_owned = ptr_is_owned(ret_conv_16); - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_conv); - ret_constr.data[q] = ret_conv_16_conv; - } - (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); - } - return ret_constr; -} -LDKCResult_PaymentIdPaymentSendFailureZ send_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_hash, LDKThirtyTwoBytes payment_secret) { - LDKPayer_JCalls *j_calls = (LDKPayer_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); - } - LDKRoute route_var = *route; - int64_t route_ref = 0; - route_var = Route_clone(&route_var); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var); - route_ref = tag_ptr(route_var.inner, route_var.is_owned); - int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, payment_hash.data); - int8_tArray payment_secret_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_secret_arr, 0, 32, payment_secret.data); - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->send_payment_meth, route_ref, payment_hash_arr, payment_secret_arr); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to send_payment in LDKPayer from rust threw an exception."); - } - void* ret_ptr = untag_ptr(ret); - CHECK_ACCESS(ret_ptr); - LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr); - FREE(untag_ptr(ret)); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); - } - return ret_conv; -} -LDKCResult_PaymentIdPaymentSendFailureZ send_spontaneous_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_preimage) { - LDKPayer_JCalls *j_calls = (LDKPayer_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); - } - LDKRoute route_var = *route; - int64_t route_ref = 0; - route_var = Route_clone(&route_var); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var); - route_ref = tag_ptr(route_var.inner, route_var.is_owned); - int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, payment_preimage.data); - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->send_spontaneous_payment_meth, route_ref, payment_preimage_arr); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to send_spontaneous_payment in LDKPayer from rust threw an exception."); - } - void* ret_ptr = untag_ptr(ret); - CHECK_ACCESS(ret_ptr); - LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr); - FREE(untag_ptr(ret)); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); - } - return ret_conv; -} -LDKCResult_NonePaymentSendFailureZ retry_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_id) { - LDKPayer_JCalls *j_calls = (LDKPayer_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); - } - LDKRoute route_var = *route; - int64_t route_ref = 0; - route_var = Route_clone(&route_var); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var); - route_ref = tag_ptr(route_var.inner, route_var.is_owned); - int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, payment_id.data); - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->retry_payment_meth, route_ref, payment_id_arr); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to retry_payment in LDKPayer from rust threw an exception."); - } - void* ret_ptr = untag_ptr(ret); - CHECK_ACCESS(ret_ptr); - LDKCResult_NonePaymentSendFailureZ ret_conv = *(LDKCResult_NonePaymentSendFailureZ*)(ret_ptr); - FREE(untag_ptr(ret)); - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); - } - return ret_conv; -} -void abandon_payment_LDKPayer_jcall(const void* this_arg, LDKThirtyTwoBytes payment_id) { - LDKPayer_JCalls *j_calls = (LDKPayer_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 payment_id_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, payment_id.data); - jobject obj = (*env)->NewLocalRef(env, j_calls->o); - CHECK(obj != NULL); - (*env)->CallVoidMethod(env, obj, j_calls->abandon_payment_meth, payment_id_arr); - if (UNLIKELY((*env)->ExceptionCheck(env))) { - (*env)->ExceptionDescribe(env); - (*env)->FatalError(env, "A call to abandon_payment in LDKPayer from rust threw an exception."); - } - if (get_jenv_res == JNI_EDETACHED) { - DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); - } -} -static void LDKPayer_JCalls_cloned(LDKPayer* new_obj) { - LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) new_obj->this_arg; - atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); -} -static inline LDKPayer LDKPayer_init (JNIEnv *env, jclass clz, jobject o) { - jclass c = (*env)->GetObjectClass(env, o); - CHECK(c != NULL); - LDKPayer_JCalls *calls = MALLOC(sizeof(LDKPayer_JCalls), "LDKPayer_JCalls"); - atomic_init(&calls->refcnt, 1); - DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); - calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->node_id_meth = (*env)->GetMethodID(env, c, "node_id", "()[B"); - CHECK(calls->node_id_meth != NULL); - calls->first_hops_meth = (*env)->GetMethodID(env, c, "first_hops", "()[J"); - CHECK(calls->first_hops_meth != NULL); - calls->send_payment_meth = (*env)->GetMethodID(env, c, "send_payment", "(J[B[B)J"); - CHECK(calls->send_payment_meth != NULL); - calls->send_spontaneous_payment_meth = (*env)->GetMethodID(env, c, "send_spontaneous_payment", "(J[B)J"); - CHECK(calls->send_spontaneous_payment_meth != NULL); - calls->retry_payment_meth = (*env)->GetMethodID(env, c, "retry_payment", "(J[B)J"); - CHECK(calls->retry_payment_meth != NULL); - calls->abandon_payment_meth = (*env)->GetMethodID(env, c, "abandon_payment", "([B)V"); - CHECK(calls->abandon_payment_meth != NULL); - - LDKPayer ret = { - .this_arg = (void*) calls, - .node_id = node_id_LDKPayer_jcall, - .first_hops = first_hops_LDKPayer_jcall, - .send_payment = send_payment_LDKPayer_jcall, - .send_spontaneous_payment = send_spontaneous_payment_LDKPayer_jcall, - .retry_payment = retry_payment_LDKPayer_jcall, - .abandon_payment = abandon_payment_LDKPayer_jcall, - .free = LDKPayer_JCalls_free, - }; - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKPayer_1new(JNIEnv *env, jclass clz, jobject o) { - LDKPayer *res_ptr = MALLOC(sizeof(LDKPayer), "LDKPayer"); - *res_ptr = LDKPayer_init(env, clz, o); - return tag_ptr(res_ptr, true); -} -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Payer_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr; - int8_tArray ret_arr = (*env)->NewByteArray(env, 33); - (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, (this_arg_conv->node_id)(this_arg_conv->this_arg).compressed_form); - return ret_arr; -} - -JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Payer_1first_1hops(JNIEnv *env, jclass clz, int64_t this_arg) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr; - LDKCVec_ChannelDetailsZ ret_var = (this_arg_conv->first_hops)(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 q = 0; q < ret_var.datalen; q++) { - LDKChannelDetails ret_conv_16_var = ret_var.data[q]; - int64_t ret_conv_16_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); - ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned); - 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_Payer_1send_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_hash, int8_tArray payment_secret) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr; - LDKRoute route_conv; - route_conv.inner = untag_ptr(route); - route_conv.is_owned = ptr_is_owned(route); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); - route_conv.is_owned = false; - 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 = (this_arg_conv->send_payment)(this_arg_conv->this_arg, &route_conv, payment_hash_ref, payment_secret_ref); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payer_1send_1spontaneous_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_preimage) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr; - LDKRoute route_conv; - route_conv.inner = untag_ptr(route); - route_conv.is_owned = ptr_is_owned(route); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); - route_conv.is_owned = false; - LDKThirtyTwoBytes payment_preimage_ref; - CHECK((*env)->GetArrayLength(env, payment_preimage) == 32); - (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data); - LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); - *ret_conv = (this_arg_conv->send_spontaneous_payment)(this_arg_conv->this_arg, &route_conv, payment_preimage_ref); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payer_1retry_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_id) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr; - LDKRoute route_conv; - route_conv.inner = untag_ptr(route); - route_conv.is_owned = ptr_is_owned(route); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); - route_conv.is_owned = false; - 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 = (this_arg_conv->retry_payment)(this_arg_conv->this_arg, &route_conv, payment_id_ref); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payer_1abandon_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_id) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr; - LDKThirtyTwoBytes payment_id_ref; - CHECK((*env)->GetArrayLength(env, payment_id) == 32); - (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); - (this_arg_conv->abandon_payment)(this_arg_conv->this_arg, payment_id_ref); -} - typedef struct LDKRouter_JCalls { atomic_size_t refcnt; JavaVM *vm; jweak o; jmethodID find_route_meth; + jmethodID find_route_with_id_meth; jmethodID notify_payment_path_failed_meth; jmethodID notify_payment_path_successful_meth; jmethodID notify_payment_probe_successful_meth; @@ -14932,7 +14738,7 @@ static void LDKRouter_JCalls_free(void* this_arg) { FREE(j_calls); } } -LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, LDKPublicKey payer, const LDKRouteParameters * route_params, const uint8_t (* payment_hash)[32], LDKCVec_ChannelDetailsZ * first_hops, LDKInFlightHtlcs inflight_htlcs) { +LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, LDKPublicKey payer, const LDKRouteParameters * route_params, LDKCVec_ChannelDetailsZ * first_hops, LDKInFlightHtlcs inflight_htlcs) { LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg; JNIEnv *env; jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); @@ -14948,8 +14754,6 @@ LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, route_params_var = RouteParameters_clone(&route_params_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_var); route_params_ref = tag_ptr(route_params_var.inner, route_params_var.is_owned); - int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); - (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, *payment_hash); LDKCVec_ChannelDetailsZ *first_hops_var_ptr = first_hops; int64_tArray first_hops_arr = NULL; if (first_hops != NULL) { @@ -14971,7 +14775,7 @@ LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, inflight_htlcs_ref = tag_ptr(inflight_htlcs_var.inner, inflight_htlcs_var.is_owned); jobject obj = (*env)->NewLocalRef(env, j_calls->o); CHECK(obj != NULL); - uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->find_route_meth, payer_arr, route_params_ref, payment_hash_arr, first_hops_arr, inflight_htlcs_ref); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->find_route_meth, payer_arr, route_params_ref, first_hops_arr, inflight_htlcs_ref); if (UNLIKELY((*env)->ExceptionCheck(env))) { (*env)->ExceptionDescribe(env); (*env)->FatalError(env, "A call to find_route in LDKRouter from rust threw an exception."); @@ -14985,6 +14789,61 @@ LDKCResult_RouteLightningErrorZ find_route_LDKRouter_jcall(const void* this_arg, } return ret_conv; } +LDKCResult_RouteLightningErrorZ find_route_with_id_LDKRouter_jcall(const void* this_arg, LDKPublicKey payer, const LDKRouteParameters * route_params, LDKCVec_ChannelDetailsZ * first_hops, LDKInFlightHtlcs inflight_htlcs, LDKThirtyTwoBytes _payment_hash, LDKThirtyTwoBytes _payment_id) { + LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg; + JNIEnv *env; + jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); + } else { + DO_ASSERT(get_jenv_res == JNI_OK); + } + int8_tArray payer_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, payer_arr, 0, 33, payer.compressed_form); + LDKRouteParameters route_params_var = *route_params; + int64_t route_params_ref = 0; + route_params_var = RouteParameters_clone(&route_params_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_var); + route_params_ref = tag_ptr(route_params_var.inner, route_params_var.is_owned); + LDKCVec_ChannelDetailsZ *first_hops_var_ptr = first_hops; + int64_tArray first_hops_arr = NULL; + if (first_hops != NULL) { + LDKCVec_ChannelDetailsZ first_hops_var = *first_hops_var_ptr; + first_hops_arr = (*env)->NewLongArray(env, first_hops_var.datalen); + int64_t *first_hops_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, first_hops_arr, NULL); + for (size_t q = 0; q < first_hops_var.datalen; q++) { + LDKChannelDetails first_hops_conv_16_var = first_hops_var.data[q]; + int64_t first_hops_conv_16_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_var); + first_hops_conv_16_ref = tag_ptr(first_hops_conv_16_var.inner, first_hops_conv_16_var.is_owned); + first_hops_arr_ptr[q] = first_hops_conv_16_ref; + } + (*env)->ReleasePrimitiveArrayCritical(env, first_hops_arr, first_hops_arr_ptr, 0); + } + LDKInFlightHtlcs inflight_htlcs_var = inflight_htlcs; + int64_t inflight_htlcs_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_var); + inflight_htlcs_ref = tag_ptr(inflight_htlcs_var.inner, inflight_htlcs_var.is_owned); + int8_tArray _payment_hash_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, _payment_hash_arr, 0, 32, _payment_hash.data); + int8_tArray _payment_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, _payment_id_arr, 0, 32, _payment_id.data); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->find_route_with_id_meth, payer_arr, route_params_ref, first_hops_arr, inflight_htlcs_ref, _payment_hash_arr, _payment_id_arr); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to find_route_with_id in LDKRouter from rust threw an exception."); + } + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(ret_ptr); + FREE(untag_ptr(ret)); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } + return ret_conv; +} void notify_payment_path_failed_LDKRouter_jcall(const void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) { LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg; JNIEnv *env; @@ -15130,8 +14989,10 @@ static inline LDKRouter LDKRouter_init (JNIEnv *env, jclass clz, jobject o) { atomic_init(&calls->refcnt, 1); DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); calls->o = (*env)->NewWeakGlobalRef(env, o); - calls->find_route_meth = (*env)->GetMethodID(env, c, "find_route", "([BJ[B[JJ)J"); + calls->find_route_meth = (*env)->GetMethodID(env, c, "find_route", "([BJ[JJ)J"); CHECK(calls->find_route_meth != NULL); + calls->find_route_with_id_meth = (*env)->GetMethodID(env, c, "find_route_with_id", "([BJ[JJ[B[B)J"); + CHECK(calls->find_route_with_id_meth != NULL); calls->notify_payment_path_failed_meth = (*env)->GetMethodID(env, c, "notify_payment_path_failed", "([JJ)V"); CHECK(calls->notify_payment_path_failed_meth != NULL); calls->notify_payment_path_successful_meth = (*env)->GetMethodID(env, c, "notify_payment_path_successful", "([J)V"); @@ -15144,6 +15005,7 @@ static inline LDKRouter LDKRouter_init (JNIEnv *env, jclass clz, jobject o) { LDKRouter ret = { .this_arg = (void*) calls, .find_route = find_route_LDKRouter_jcall, + .find_route_with_id = find_route_with_id_LDKRouter_jcall, .notify_payment_path_failed = notify_payment_path_failed_LDKRouter_jcall, .notify_payment_path_successful = notify_payment_path_successful_LDKRouter_jcall, .notify_payment_probe_successful = notify_payment_probe_successful_LDKRouter_jcall, @@ -15157,7 +15019,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKRouter_1new(JNIEnv *env, *res_ptr = LDKRouter_init(env, clz, o); return tag_ptr(res_ptr, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1find_1route(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payer, int64_t route_params, int8_tArray payment_hash, int64_tArray first_hops, int64_t inflight_htlcs) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1find_1route(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payer, int64_t route_params, int64_tArray first_hops, int64_t inflight_htlcs) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr; @@ -15169,10 +15031,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1find_1route(JNIEnv route_params_conv.is_owned = ptr_is_owned(route_params); CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); route_params_conv.is_owned = false; - 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; LDKCVec_ChannelDetailsZ first_hops_constr; LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL; if (first_hops != NULL) { @@ -15198,10 +15056,59 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1find_1route(JNIEnv inflight_htlcs_conv.inner = untag_ptr(inflight_htlcs); inflight_htlcs_conv.is_owned = ptr_is_owned(inflight_htlcs); CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_conv); - // WARNING: we need a move here but no clone is available for LDKInFlightHtlcs - + inflight_htlcs_conv = InFlightHtlcs_clone(&inflight_htlcs_conv); + LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); + *ret_conv = (this_arg_conv->find_route)(this_arg_conv->this_arg, payer_ref, &route_params_conv, first_hops_ptr, inflight_htlcs_conv); + if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); } + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Router_1find_1route_1with_1id(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payer, int64_t route_params, int64_tArray first_hops, int64_t inflight_htlcs, int8_tArray _payment_hash, int8_tArray _payment_id) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr; + LDKPublicKey payer_ref; + CHECK((*env)->GetArrayLength(env, payer) == 33); + (*env)->GetByteArrayRegion(env, payer, 0, 33, payer_ref.compressed_form); + LDKRouteParameters route_params_conv; + route_params_conv.inner = untag_ptr(route_params); + route_params_conv.is_owned = ptr_is_owned(route_params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); + route_params_conv.is_owned = false; + LDKCVec_ChannelDetailsZ first_hops_constr; + LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL; + if (first_hops != NULL) { + first_hops_constr.datalen = (*env)->GetArrayLength(env, first_hops); + if (first_hops_constr.datalen > 0) + first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); + else + first_hops_constr.data = NULL; + int64_t* first_hops_vals = (*env)->GetLongArrayElements (env, first_hops, NULL); + for (size_t q = 0; q < first_hops_constr.datalen; q++) { + int64_t first_hops_conv_16 = first_hops_vals[q]; + LDKChannelDetails first_hops_conv_16_conv; + first_hops_conv_16_conv.inner = untag_ptr(first_hops_conv_16); + first_hops_conv_16_conv.is_owned = ptr_is_owned(first_hops_conv_16); + CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv); + first_hops_conv_16_conv.is_owned = false; + first_hops_constr.data[q] = first_hops_conv_16_conv; + } + (*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0); + first_hops_ptr = &first_hops_constr; + } + LDKInFlightHtlcs inflight_htlcs_conv; + inflight_htlcs_conv.inner = untag_ptr(inflight_htlcs); + inflight_htlcs_conv.is_owned = ptr_is_owned(inflight_htlcs); + CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_conv); + inflight_htlcs_conv = InFlightHtlcs_clone(&inflight_htlcs_conv); + LDKThirtyTwoBytes _payment_hash_ref; + CHECK((*env)->GetArrayLength(env, _payment_hash) == 32); + (*env)->GetByteArrayRegion(env, _payment_hash, 0, 32, _payment_hash_ref.data); + LDKThirtyTwoBytes _payment_id_ref; + CHECK((*env)->GetArrayLength(env, _payment_id) == 32); + (*env)->GetByteArrayRegion(env, _payment_id, 0, 32, _payment_id_ref.data); LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); - *ret_conv = (this_arg_conv->find_route)(this_arg_conv->this_arg, payer_ref, &route_params_conv, payment_hash_ref, first_hops_ptr, inflight_htlcs_conv); + *ret_conv = (this_arg_conv->find_route_with_id)(this_arg_conv->this_arg, payer_ref, &route_params_conv, first_hops_ptr, inflight_htlcs_conv, _payment_hash_ref, _payment_id_ref); if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); } return tag_ptr(ret_conv, true); } @@ -15302,261 +15209,727 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_1notify_1payment_1probe (this_arg_conv->notify_payment_probe_failed)(this_arg_conv->this_arg, path_constr, short_channel_id); } -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); +static jclass LDKDestination_Node_class = NULL; +static jmethodID LDKDestination_Node_meth = NULL; +static jclass LDKDestination_BlindedPath_class = NULL; +static jmethodID LDKDestination_BlindedPath_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKDestination_init (JNIEnv *env, jclass clz) { + LDKDestination_Node_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDestination$Node")); + CHECK(LDKDestination_Node_class != NULL); + LDKDestination_Node_meth = (*env)->GetMethodID(env, LDKDestination_Node_class, "", "([B)V"); + CHECK(LDKDestination_Node_meth != NULL); + LDKDestination_BlindedPath_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKDestination$BlindedPath")); + CHECK(LDKDestination_BlindedPath_class != NULL); + LDKDestination_BlindedPath_meth = (*env)->GetMethodID(env, LDKDestination_BlindedPath_class, "", "(J)V"); + CHECK(LDKDestination_BlindedPath_meth != NULL); } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKRetry_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { - LDKRetry *obj = (LDKRetry*)untag_ptr(ptr); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDestination_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKDestination *obj = (LDKDestination*)untag_ptr(ptr); switch(obj->tag) { - case LDKRetry_Attempts: { - int64_t attempts_conv = obj->attempts; - return (*env)->NewObject(env, LDKRetry_Attempts_class, LDKRetry_Attempts_meth, attempts_conv); + case LDKDestination_Node: { + int8_tArray node_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, node_arr, 0, 33, obj->node.compressed_form); + return (*env)->NewObject(env, LDKDestination_Node_class, LDKDestination_Node_meth, node_arr); } - case LDKRetry_Timeout: { - int64_t timeout_conv = obj->timeout; - return (*env)->NewObject(env, LDKRetry_Timeout_class, LDKRetry_Timeout_meth, timeout_conv); + case LDKDestination_BlindedPath: { + LDKBlindedPath blinded_path_var = obj->blinded_path; + int64_t blinded_path_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_path_var); + blinded_path_ref = tag_ptr(blinded_path_var.inner, false); + return (*env)->NewObject(env, LDKDestination_BlindedPath_class, LDKDestination_BlindedPath_meth, blinded_path_ref); } default: abort(); } } -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); - Str_free(ret_str); - return ret_conv; -} - -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings__1ldk_1c_1bindings_1get_1compiled_1version(JNIEnv *env, jclass clz) { - LDKStr ret_str = _ldk_c_bindings_get_compiled_version(); - 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_BigEndianScalar_1new(JNIEnv *env, jclass clz, int8_tArray big_endian_bytes) { - LDKThirtyTwoBytes big_endian_bytes_ref; - CHECK((*env)->GetArrayLength(env, big_endian_bytes) == 32); - (*env)->GetByteArrayRegion(env, big_endian_bytes, 0, 32, big_endian_bytes_ref.data); - LDKBigEndianScalar* ret_ref = MALLOC(sizeof(LDKBigEndianScalar), "LDKBigEndianScalar"); - *ret_ref = BigEndianScalar_new(big_endian_bytes_ref); - return tag_ptr(ret_ref, true); -} - -static inline uint64_t Bech32Error_clone_ptr(LDKBech32Error *NONNULL_PTR arg) { - LDKBech32Error *ret_copy = MALLOC(sizeof(LDKBech32Error), "LDKBech32Error"); - *ret_copy = Bech32Error_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bech32Error_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKBech32Error* arg_conv = (LDKBech32Error*)untag_ptr(arg); - int64_t ret_conv = Bech32Error_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bech32Error_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKBech32Error* orig_conv = (LDKBech32Error*)untag_ptr(orig); - LDKBech32Error *ret_copy = MALLOC(sizeof(LDKBech32Error), "LDKBech32Error"); - *ret_copy = Bech32Error_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bech32Error_1free(JNIEnv *env, jclass clz, int64_t o) { - if (!ptr_is_owned(o)) return; - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKBech32Error o_conv = *(LDKBech32Error*)(o_ptr); - FREE(untag_ptr(o)); - Bech32Error_free(o_conv); +static jclass LDKOnionMessageContents_Custom_class = NULL; +static jmethodID LDKOnionMessageContents_Custom_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKOnionMessageContents_init (JNIEnv *env, jclass clz) { + LDKOnionMessageContents_Custom_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKOnionMessageContents$Custom")); + CHECK(LDKOnionMessageContents_Custom_class != NULL); + LDKOnionMessageContents_Custom_meth = (*env)->GetMethodID(env, LDKOnionMessageContents_Custom_class, "", "(J)V"); + CHECK(LDKOnionMessageContents_Custom_meth != NULL); } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Transaction_1free(JNIEnv *env, jclass clz, int8_tArray _res) { - LDKTransaction _res_ref; - _res_ref.datalen = (*env)->GetArrayLength(env, _res); - _res_ref.data = MALLOC(_res_ref.datalen, "LDKTransaction Bytes"); - (*env)->GetByteArrayRegion(env, _res, 0, _res_ref.datalen, _res_ref.data); - _res_ref.data_is_owned = true; - Transaction_free(_res_ref); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKOnionMessageContents_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKOnionMessageContents *obj = (LDKOnionMessageContents*)untag_ptr(ptr); + switch(obj->tag) { + case LDKOnionMessageContents_Custom: { + LDKCustomOnionMessageContents* custom_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents"); + *custom_ret = CustomOnionMessageContents_clone(&obj->custom); + return (*env)->NewObject(env, LDKOnionMessageContents_Custom_class, LDKOnionMessageContents_Custom_meth, tag_ptr(custom_ret, true)); + } + default: abort(); + } } - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1new(JNIEnv *env, jclass clz, int8_tArray script_pubkey, int64_t value) { - LDKCVec_u8Z script_pubkey_ref; - script_pubkey_ref.datalen = (*env)->GetArrayLength(env, script_pubkey); - script_pubkey_ref.data = MALLOC(script_pubkey_ref.datalen, "LDKCVec_u8Z Bytes"); - (*env)->GetByteArrayRegion(env, script_pubkey, 0, script_pubkey_ref.datalen, script_pubkey_ref.data); - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = TxOut_new(script_pubkey_ref, value); - return tag_ptr(ret_ref, true); +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 void JNICALL Java_org_ldk_impl_bindings_TxOut_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKTxOut _res_conv = *(LDKTxOut*)(_res_ptr); - FREE(untag_ptr(_res)); - TxOut_free(_res_conv); +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKGossipSync_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKGossipSync *obj = (LDKGossipSync*)untag_ptr(ptr); + switch(obj->tag) { + case LDKGossipSync_P2P: { + LDKP2PGossipSync p2p_var = obj->p2p; + int64_t p2p_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(p2p_var); + p2p_ref = tag_ptr(p2p_var.inner, false); + return (*env)->NewObject(env, LDKGossipSync_P2P_class, LDKGossipSync_P2P_meth, p2p_ref); + } + case LDKGossipSync_Rapid: { + LDKRapidGossipSync rapid_var = obj->rapid; + int64_t rapid_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(rapid_var); + rapid_ref = tag_ptr(rapid_var.inner, false); + return (*env)->NewObject(env, LDKGossipSync_Rapid_class, LDKGossipSync_Rapid_meth, rapid_ref); + } + case LDKGossipSync_None: { + return (*env)->NewObject(env, LDKGossipSync_None_class, LDKGossipSync_None_meth); + } + default: abort(); + } } - -static inline uint64_t TxOut_clone_ptr(LDKTxOut *NONNULL_PTR arg) { - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = TxOut_clone(arg); - return tag_ptr(ret_ref, true); +static jclass LDKFallback_SegWitProgram_class = NULL; +static jmethodID LDKFallback_SegWitProgram_meth = NULL; +static jclass LDKFallback_PubKeyHash_class = NULL; +static jmethodID LDKFallback_PubKeyHash_meth = NULL; +static jclass LDKFallback_ScriptHash_class = NULL; +static jmethodID LDKFallback_ScriptHash_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKFallback_init (JNIEnv *env, jclass clz) { + LDKFallback_SegWitProgram_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKFallback$SegWitProgram")); + CHECK(LDKFallback_SegWitProgram_class != NULL); + LDKFallback_SegWitProgram_meth = (*env)->GetMethodID(env, LDKFallback_SegWitProgram_class, "", "(B[B)V"); + CHECK(LDKFallback_SegWitProgram_meth != NULL); + LDKFallback_PubKeyHash_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKFallback$PubKeyHash")); + CHECK(LDKFallback_PubKeyHash_class != NULL); + LDKFallback_PubKeyHash_meth = (*env)->GetMethodID(env, LDKFallback_PubKeyHash_class, "", "([B)V"); + CHECK(LDKFallback_PubKeyHash_meth != NULL); + LDKFallback_ScriptHash_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "org/ldk/impl/bindings$LDKFallback$ScriptHash")); + CHECK(LDKFallback_ScriptHash_class != NULL); + LDKFallback_ScriptHash_meth = (*env)->GetMethodID(env, LDKFallback_ScriptHash_class, "", "([B)V"); + CHECK(LDKFallback_ScriptHash_meth != NULL); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKTxOut* arg_conv = (LDKTxOut*)untag_ptr(arg); - int64_t ret_conv = TxOut_clone_ptr(arg_conv); - return ret_conv; +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFallback_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) { + LDKFallback *obj = (LDKFallback*)untag_ptr(ptr); + switch(obj->tag) { + case LDKFallback_SegWitProgram: { + uint8_t version_val = obj->seg_wit_program.version._0; + LDKCVec_u8Z program_var = obj->seg_wit_program.program; + int8_tArray program_arr = (*env)->NewByteArray(env, program_var.datalen); + (*env)->SetByteArrayRegion(env, program_arr, 0, program_var.datalen, program_var.data); + return (*env)->NewObject(env, LDKFallback_SegWitProgram_class, LDKFallback_SegWitProgram_meth, version_val, program_arr); + } + case LDKFallback_PubKeyHash: { + int8_tArray pub_key_hash_arr = (*env)->NewByteArray(env, 20); + (*env)->SetByteArrayRegion(env, pub_key_hash_arr, 0, 20, obj->pub_key_hash.data); + return (*env)->NewObject(env, LDKFallback_PubKeyHash_class, LDKFallback_PubKeyHash_meth, pub_key_hash_arr); + } + case LDKFallback_ScriptHash: { + int8_tArray script_hash_arr = (*env)->NewByteArray(env, 20); + (*env)->SetByteArrayRegion(env, script_hash_arr, 0, 20, obj->script_hash.data); + return (*env)->NewObject(env, LDKFallback_ScriptHash_class, LDKFallback_ScriptHash_meth, script_hash_arr); + } + default: abort(); + } } - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKTxOut* orig_conv = (LDKTxOut*)untag_ptr(orig); - LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); - *ret_ref = TxOut_clone(orig_conv); - return tag_ptr(ret_ref, true); +typedef struct LDKPayer_JCalls { + atomic_size_t refcnt; + JavaVM *vm; + jweak o; + jmethodID node_id_meth; + jmethodID first_hops_meth; + jmethodID send_payment_meth; + jmethodID send_spontaneous_payment_meth; + jmethodID retry_payment_meth; + jmethodID abandon_payment_meth; + jmethodID inflight_htlcs_meth; +} LDKPayer_JCalls; +static void LDKPayer_JCalls_free(void* this_arg) { + LDKPayer_JCalls *j_calls = (LDKPayer_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 void JNICALL Java_org_ldk_impl_bindings_Str_1free(JNIEnv *env, jclass clz, jstring _res) { - LDKStr dummy = { .chars = NULL, .len = 0, .chars_is_owned = false }; - Str_free(dummy); +LDKPublicKey node_id_LDKPayer_jcall(const void* this_arg) { + LDKPayer_JCalls *j_calls = (LDKPayer_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->node_id_meth); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to node_id in LDKPayer 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; } - -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"); +LDKCVec_ChannelDetailsZ first_hops_LDKPayer_jcall(const void* this_arg) { + LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg; + JNIEnv *env; + jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); + } else { + DO_ASSERT(get_jenv_res == JNI_OK); + } + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + int64_tArray ret = (*env)->CallObjectMethod(env, obj, j_calls->first_hops_meth); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to first_hops in LDKPayer from rust threw an exception."); + } + LDKCVec_ChannelDetailsZ ret_constr; + ret_constr.datalen = (*env)->GetArrayLength(env, ret); + if (ret_constr.datalen > 0) + ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ 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; + ret_constr.data = NULL; + int64_t* ret_vals = (*env)->GetLongArrayElements (env, ret, NULL); + for (size_t q = 0; q < ret_constr.datalen; q++) { + int64_t ret_conv_16 = ret_vals[q]; + LDKChannelDetails ret_conv_16_conv; + ret_conv_16_conv.inner = untag_ptr(ret_conv_16); + ret_conv_16_conv.is_owned = ptr_is_owned(ret_conv_16); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_conv); + ret_constr.data[q] = ret_conv_16_conv; } - CVec_PublicKeyZ_free(_res_constr); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKBlindedRoute o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - // WARNING: we need a move here but no clone is available for LDKBlindedRoute - - LDKCResult_BlindedRouteNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedRouteNoneZ), "LDKCResult_BlindedRouteNoneZ"); - *ret_conv = CResult_BlindedRouteNoneZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteNoneZ_1err(JNIEnv *env, jclass clz) { - LDKCResult_BlindedRouteNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedRouteNoneZ), "LDKCResult_BlindedRouteNoneZ"); - *ret_conv = CResult_BlindedRouteNoneZ_err(); - return tag_ptr(ret_conv, true); + (*env)->ReleaseLongArrayElements(env, ret, ret_vals, 0); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } + return ret_constr; } - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_BlindedRouteNoneZ* o_conv = (LDKCResult_BlindedRouteNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_BlindedRouteNoneZ_is_ok(o_conv); +LDKCResult_NonePaymentSendFailureZ send_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_hash, LDKThirtyTwoBytes payment_secret, LDKThirtyTwoBytes payment_id) { + LDKPayer_JCalls *j_calls = (LDKPayer_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); + } + LDKRoute route_var = *route; + int64_t route_ref = 0; + route_var = Route_clone(&route_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var); + route_ref = tag_ptr(route_var.inner, route_var.is_owned); + int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, payment_hash.data); + int8_tArray payment_secret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_secret_arr, 0, 32, payment_secret.data); + int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, payment_id.data); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->send_payment_meth, route_ref, payment_hash_arr, payment_secret_arr, payment_id_arr); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to send_payment in LDKPayer from rust threw an exception."); + } + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_NonePaymentSendFailureZ ret_conv = *(LDKCResult_NonePaymentSendFailureZ*)(ret_ptr); + FREE(untag_ptr(ret)); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } return ret_conv; } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_BlindedRouteNoneZ _res_conv = *(LDKCResult_BlindedRouteNoneZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_BlindedRouteNoneZ_free(_res_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKBlindedRoute o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - // WARNING: we need a move here but no clone is available for LDKBlindedRoute - - LDKCResult_BlindedRouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedRouteDecodeErrorZ), "LDKCResult_BlindedRouteDecodeErrorZ"); - *ret_conv = CResult_BlindedRouteDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); - e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_BlindedRouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedRouteDecodeErrorZ), "LDKCResult_BlindedRouteDecodeErrorZ"); - *ret_conv = CResult_BlindedRouteDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_BlindedRouteDecodeErrorZ* o_conv = (LDKCResult_BlindedRouteDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_BlindedRouteDecodeErrorZ_is_ok(o_conv); +LDKCResult_NonePaymentSendFailureZ send_spontaneous_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_preimage, LDKThirtyTwoBytes payment_id) { + LDKPayer_JCalls *j_calls = (LDKPayer_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); + } + LDKRoute route_var = *route; + int64_t route_ref = 0; + route_var = Route_clone(&route_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var); + route_ref = tag_ptr(route_var.inner, route_var.is_owned); + int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, payment_preimage.data); + int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, payment_id.data); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->send_spontaneous_payment_meth, route_ref, payment_preimage_arr, payment_id_arr); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to send_spontaneous_payment in LDKPayer from rust threw an exception."); + } + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_NonePaymentSendFailureZ ret_conv = *(LDKCResult_NonePaymentSendFailureZ*)(ret_ptr); + FREE(untag_ptr(ret)); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } return ret_conv; } - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_BlindedRouteDecodeErrorZ _res_conv = *(LDKCResult_BlindedRouteDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_BlindedRouteDecodeErrorZ_free(_res_conv); +LDKCResult_NonePaymentSendFailureZ retry_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_id) { + LDKPayer_JCalls *j_calls = (LDKPayer_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); + } + LDKRoute route_var = *route; + int64_t route_ref = 0; + route_var = Route_clone(&route_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var); + route_ref = tag_ptr(route_var.inner, route_var.is_owned); + int8_tArray payment_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, payment_id.data); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->retry_payment_meth, route_ref, payment_id_arr); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to retry_payment in LDKPayer from rust threw an exception."); + } + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_NonePaymentSendFailureZ ret_conv = *(LDKCResult_NonePaymentSendFailureZ*)(ret_ptr); + FREE(untag_ptr(ret)); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } + return ret_conv; +} +void abandon_payment_LDKPayer_jcall(const void* this_arg, LDKThirtyTwoBytes payment_id) { + LDKPayer_JCalls *j_calls = (LDKPayer_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 payment_id_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, payment_id_arr, 0, 32, payment_id.data); + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + (*env)->CallVoidMethod(env, obj, j_calls->abandon_payment_meth, payment_id_arr); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to abandon_payment in LDKPayer from rust threw an exception."); + } + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } +} +LDKInFlightHtlcs inflight_htlcs_LDKPayer_jcall(const void* this_arg) { + LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg; + JNIEnv *env; + jint get_jenv_res = (*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_6); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->AttachCurrentThread(j_calls->vm, (void**)&env, NULL) == JNI_OK); + } else { + DO_ASSERT(get_jenv_res == JNI_OK); + } + jobject obj = (*env)->NewLocalRef(env, j_calls->o); + CHECK(obj != NULL); + uint64_t ret = (*env)->CallLongMethod(env, obj, j_calls->inflight_htlcs_meth); + if (UNLIKELY((*env)->ExceptionCheck(env))) { + (*env)->ExceptionDescribe(env); + (*env)->FatalError(env, "A call to inflight_htlcs in LDKPayer from rust threw an exception."); + } + LDKInFlightHtlcs ret_conv; + ret_conv.inner = untag_ptr(ret); + ret_conv.is_owned = ptr_is_owned(ret); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv); + if (get_jenv_res == JNI_EDETACHED) { + DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK); + } + return ret_conv; } +static void LDKPayer_JCalls_cloned(LDKPayer* new_obj) { + LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKPayer LDKPayer_init (JNIEnv *env, jclass clz, jobject o) { + jclass c = (*env)->GetObjectClass(env, o); + CHECK(c != NULL); + LDKPayer_JCalls *calls = MALLOC(sizeof(LDKPayer_JCalls), "LDKPayer_JCalls"); + atomic_init(&calls->refcnt, 1); + DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0); + calls->o = (*env)->NewWeakGlobalRef(env, o); + calls->node_id_meth = (*env)->GetMethodID(env, c, "node_id", "()[B"); + CHECK(calls->node_id_meth != NULL); + calls->first_hops_meth = (*env)->GetMethodID(env, c, "first_hops", "()[J"); + CHECK(calls->first_hops_meth != NULL); + calls->send_payment_meth = (*env)->GetMethodID(env, c, "send_payment", "(J[B[B[B)J"); + CHECK(calls->send_payment_meth != NULL); + calls->send_spontaneous_payment_meth = (*env)->GetMethodID(env, c, "send_spontaneous_payment", "(J[B[B)J"); + CHECK(calls->send_spontaneous_payment_meth != NULL); + calls->retry_payment_meth = (*env)->GetMethodID(env, c, "retry_payment", "(J[B)J"); + CHECK(calls->retry_payment_meth != NULL); + calls->abandon_payment_meth = (*env)->GetMethodID(env, c, "abandon_payment", "([B)V"); + CHECK(calls->abandon_payment_meth != NULL); + calls->inflight_htlcs_meth = (*env)->GetMethodID(env, c, "inflight_htlcs", "()J"); + CHECK(calls->inflight_htlcs_meth != NULL); -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKBlindedHop o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - // WARNING: we need a move here but no clone is available for LDKBlindedHop - - LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); - *ret_conv = CResult_BlindedHopDecodeErrorZ_ok(o_conv); + LDKPayer ret = { + .this_arg = (void*) calls, + .node_id = node_id_LDKPayer_jcall, + .first_hops = first_hops_LDKPayer_jcall, + .send_payment = send_payment_LDKPayer_jcall, + .send_spontaneous_payment = send_spontaneous_payment_LDKPayer_jcall, + .retry_payment = retry_payment_LDKPayer_jcall, + .abandon_payment = abandon_payment_LDKPayer_jcall, + .inflight_htlcs = inflight_htlcs_LDKPayer_jcall, + .free = LDKPayer_JCalls_free, + }; + return ret; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKPayer_1new(JNIEnv *env, jclass clz, jobject o) { + LDKPayer *res_ptr = MALLOC(sizeof(LDKPayer), "LDKPayer"); + *res_ptr = LDKPayer_init(env, clz, o); + return tag_ptr(res_ptr, true); +} +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Payer_1node_1id(JNIEnv *env, jclass clz, int64_t this_arg) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr; + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, (this_arg_conv->node_id)(this_arg_conv->this_arg).compressed_form); + return ret_arr; +} + +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_Payer_1first_1hops(JNIEnv *env, jclass clz, int64_t this_arg) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr; + LDKCVec_ChannelDetailsZ ret_var = (this_arg_conv->first_hops)(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 q = 0; q < ret_var.datalen; q++) { + LDKChannelDetails ret_conv_16_var = ret_var.data[q]; + int64_t ret_conv_16_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var); + ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned); + 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_Payer_1send_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_hash, int8_tArray payment_secret, int8_tArray payment_id) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr; + LDKRoute route_conv; + route_conv.inner = untag_ptr(route); + route_conv.is_owned = ptr_is_owned(route); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); + route_conv.is_owned = false; + 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); + 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 = (this_arg_conv->send_payment)(this_arg_conv->this_arg, &route_conv, payment_hash_ref, payment_secret_ref, payment_id_ref); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); - e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); - *ret_conv = CResult_BlindedHopDecodeErrorZ_err(e_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payer_1send_1spontaneous_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_preimage, int8_tArray payment_id) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr; + LDKRoute route_conv; + route_conv.inner = untag_ptr(route); + route_conv.is_owned = ptr_is_owned(route); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); + route_conv.is_owned = false; + LDKThirtyTwoBytes payment_preimage_ref; + CHECK((*env)->GetArrayLength(env, payment_preimage) == 32); + (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data); + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); + *ret_conv = (this_arg_conv->send_spontaneous_payment)(this_arg_conv->this_arg, &route_conv, payment_preimage_ref, payment_id_ref); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_BlindedHopDecodeErrorZ* o_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_BlindedHopDecodeErrorZ_is_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payer_1retry_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_id) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr; + LDKRoute route_conv; + route_conv.inner = untag_ptr(route); + route_conv.is_owned = ptr_is_owned(route); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); + route_conv.is_owned = false; + 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 = (this_arg_conv->retry_payment)(this_arg_conv->this_arg, &route_conv, payment_id_ref); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payer_1abandon_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_id) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr; + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + (this_arg_conv->abandon_payment)(this_arg_conv->this_arg, payment_id_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Payer_1inflight_1htlcs(JNIEnv *env, jclass clz, int64_t this_arg) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr; + LDKInFlightHtlcs ret_var = (this_arg_conv->inflight_htlcs)(this_arg_conv->this_arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +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*)untag_ptr(ptr); + 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); + Str_free(ret_str); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings__1ldk_1c_1bindings_1get_1compiled_1version(JNIEnv *env, jclass clz) { + LDKStr ret_str = _ldk_c_bindings_get_compiled_version(); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_U128_1le_1bytes(JNIEnv *env, jclass clz, int8_tArray val) { + LDKU128 val_ref; + CHECK((*env)->GetArrayLength(env, val) == 16); + (*env)->GetByteArrayRegion(env, val, 0, 16, val_ref.le_bytes); + int8_tArray ret_arr = (*env)->NewByteArray(env, 16); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 16, U128_le_bytes(val_ref).data); + return ret_arr; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_U128_1new(JNIEnv *env, jclass clz, int8_tArray le_bytes) { + LDKSixteenBytes le_bytes_ref; + CHECK((*env)->GetArrayLength(env, le_bytes) == 16); + (*env)->GetByteArrayRegion(env, le_bytes, 0, 16, le_bytes_ref.data); + int8_tArray ret_arr = (*env)->NewByteArray(env, 16); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 16, U128_new(le_bytes_ref).le_bytes); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BigEndianScalar_1new(JNIEnv *env, jclass clz, int8_tArray big_endian_bytes) { + LDKThirtyTwoBytes big_endian_bytes_ref; + CHECK((*env)->GetArrayLength(env, big_endian_bytes) == 32); + (*env)->GetByteArrayRegion(env, big_endian_bytes, 0, 32, big_endian_bytes_ref.data); + LDKBigEndianScalar* ret_ref = MALLOC(sizeof(LDKBigEndianScalar), "LDKBigEndianScalar"); + *ret_ref = BigEndianScalar_new(big_endian_bytes_ref); + return tag_ptr(ret_ref, true); +} + +static inline uint64_t Bech32Error_clone_ptr(LDKBech32Error *NONNULL_PTR arg) { + LDKBech32Error *ret_copy = MALLOC(sizeof(LDKBech32Error), "LDKBech32Error"); + *ret_copy = Bech32Error_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bech32Error_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBech32Error* arg_conv = (LDKBech32Error*)untag_ptr(arg); + int64_t ret_conv = Bech32Error_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Bech32Error_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBech32Error* orig_conv = (LDKBech32Error*)untag_ptr(orig); + LDKBech32Error *ret_copy = MALLOC(sizeof(LDKBech32Error), "LDKBech32Error"); + *ret_copy = Bech32Error_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bech32Error_1free(JNIEnv *env, jclass clz, int64_t o) { + if (!ptr_is_owned(o)) return; + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKBech32Error o_conv = *(LDKBech32Error*)(o_ptr); + FREE(untag_ptr(o)); + Bech32Error_free(o_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Transaction_1free(JNIEnv *env, jclass clz, int8_tArray _res) { + LDKTransaction _res_ref; + _res_ref.datalen = (*env)->GetArrayLength(env, _res); + _res_ref.data = MALLOC(_res_ref.datalen, "LDKTransaction Bytes"); + (*env)->GetByteArrayRegion(env, _res, 0, _res_ref.datalen, _res_ref.data); + _res_ref.data_is_owned = true; + Transaction_free(_res_ref); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Witness_1free(JNIEnv *env, jclass clz, int8_tArray _res) { + LDKWitness _res_ref; + _res_ref.datalen = (*env)->GetArrayLength(env, _res); + _res_ref.data = MALLOC(_res_ref.datalen, "LDKWitness Bytes"); + (*env)->GetByteArrayRegion(env, _res, 0, _res_ref.datalen, _res_ref.data); + _res_ref.data_is_owned = true; + Witness_free(_res_ref); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1new(JNIEnv *env, jclass clz, int8_tArray script_pubkey, int64_t value) { + LDKCVec_u8Z script_pubkey_ref; + script_pubkey_ref.datalen = (*env)->GetArrayLength(env, script_pubkey); + script_pubkey_ref.data = MALLOC(script_pubkey_ref.datalen, "LDKCVec_u8Z Bytes"); + (*env)->GetByteArrayRegion(env, script_pubkey, 0, script_pubkey_ref.datalen, script_pubkey_ref.data); + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = TxOut_new(script_pubkey_ref, value); + return tag_ptr(ret_ref, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_BlindedHopDecodeErrorZ _res_conv = *(LDKCResult_BlindedHopDecodeErrorZ*)(_res_ptr); + LDKTxOut _res_conv = *(LDKTxOut*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_BlindedHopDecodeErrorZ_free(_res_conv); + TxOut_free(_res_conv); +} + +static inline uint64_t TxOut_clone_ptr(LDKTxOut *NONNULL_PTR arg) { + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = TxOut_clone(arg); + return tag_ptr(ret_ref, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKTxOut* arg_conv = (LDKTxOut*)untag_ptr(arg); + int64_t ret_conv = TxOut_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKTxOut* orig_conv = (LDKTxOut*)untag_ptr(orig); + LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *ret_ref = TxOut_clone(orig_conv); + return tag_ptr(ret_ref, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Str_1free(JNIEnv *env, jclass clz, jstring _res) { + LDKStr dummy = { .chars = NULL, .len = 0, .chars_is_owned = false }; + Str_free(dummy); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1HTLCClaimZ_1some(JNIEnv *env, jclass clz, jclass o) { + LDKHTLCClaim o_conv = LDKHTLCClaim_from_java(env, o); + LDKCOption_HTLCClaimZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCClaimZ), "LDKCOption_HTLCClaimZ"); + *ret_copy = COption_HTLCClaimZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1HTLCClaimZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_HTLCClaimZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCClaimZ), "LDKCOption_HTLCClaimZ"); + *ret_copy = COption_HTLCClaimZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1HTLCClaimZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_HTLCClaimZ _res_conv = *(LDKCOption_HTLCClaimZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_HTLCClaimZ_free(_res_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1ok(JNIEnv *env, jclass clz) { @@ -15658,104 +16031,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommit return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_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_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ"); - *ret_conv = CResult_SecretKeyErrorZ_ok(o_ref); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { - LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e); - LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ"); - *ret_conv = CResult_SecretKeyErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_SecretKeyErrorZ* o_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_SecretKeyErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_SecretKeyErrorZ _res_conv = *(LDKCResult_SecretKeyErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_SecretKeyErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_SecretKeyErrorZ_clone_ptr(LDKCResult_SecretKeyErrorZ *NONNULL_PTR arg) { - LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ"); - *ret_conv = CResult_SecretKeyErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_SecretKeyErrorZ* arg_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_SecretKeyErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_SecretKeyErrorZ* orig_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(orig); - LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ"); - *ret_conv = CResult_SecretKeyErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) { - LDKPublicKey o_ref; - CHECK((*env)->GetArrayLength(env, o) == 33); - (*env)->GetByteArrayRegion(env, o, 0, 33, o_ref.compressed_form); - LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); - *ret_conv = CResult_PublicKeyErrorZ_ok(o_ref); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { - LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e); - LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); - *ret_conv = CResult_PublicKeyErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_PublicKeyErrorZ* o_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_PublicKeyErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_PublicKeyErrorZ _res_conv = *(LDKCResult_PublicKeyErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_PublicKeyErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_PublicKeyErrorZ_clone_ptr(LDKCResult_PublicKeyErrorZ *NONNULL_PTR arg) { - LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); - *ret_conv = CResult_PublicKeyErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_PublicKeyErrorZ* arg_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_PublicKeyErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_PublicKeyErrorZ* orig_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(orig); - LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); - *ret_conv = CResult_PublicKeyErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKTxCreationKeys o_conv; o_conv.inner = untag_ptr(o); @@ -15864,57 +16139,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysD return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKTxCreationKeys o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = TxCreationKeys_clone(&o_conv); - LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); - *ret_conv = CResult_TxCreationKeysErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { - LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_java(env, e); - LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); - *ret_conv = CResult_TxCreationKeysErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_TxCreationKeysErrorZ* o_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_TxCreationKeysErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_TxCreationKeysErrorZ _res_conv = *(LDKCResult_TxCreationKeysErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_TxCreationKeysErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_TxCreationKeysErrorZ_clone_ptr(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR arg) { - LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); - *ret_conv = CResult_TxCreationKeysErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_TxCreationKeysErrorZ* arg_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_TxCreationKeysErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_TxCreationKeysErrorZ* orig_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(orig); - LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ"); - *ret_conv = CResult_TxCreationKeysErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1some(JNIEnv *env, jclass clz, int32_t o) { LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); *ret_copy = COption_u32Z_some(o); @@ -16547,6 +16771,181 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInva return tag_ptr(ret_conv, true); } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PublicKeyZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) { + LDKCVec_PublicKeyZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements"); + else + _res_constr.data = NULL; + for (size_t i = 0; i < _res_constr.datalen; i++) { + int8_tArray _res_conv_8 = (*env)->GetObjectArrayElement(env, _res, i); + LDKPublicKey _res_conv_8_ref; + CHECK((*env)->GetArrayLength(env, _res_conv_8) == 33); + (*env)->GetByteArrayRegion(env, _res_conv_8, 0, 33, _res_conv_8_ref.compressed_form); + _res_constr.data[i] = _res_conv_8_ref; + } + CVec_PublicKeyZ_free(_res_constr); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKBlindedPath o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = BlindedPath_clone(&o_conv); + LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); + *ret_conv = CResult_BlindedPathNoneZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1err(JNIEnv *env, jclass clz) { + LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); + *ret_conv = CResult_BlindedPathNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_BlindedPathNoneZ* o_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_BlindedPathNoneZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_BlindedPathNoneZ _res_conv = *(LDKCResult_BlindedPathNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_BlindedPathNoneZ_free(_res_conv); +} + +static inline uint64_t CResult_BlindedPathNoneZ_clone_ptr(LDKCResult_BlindedPathNoneZ *NONNULL_PTR arg) { + LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); + *ret_conv = CResult_BlindedPathNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_BlindedPathNoneZ* arg_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BlindedPathNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_BlindedPathNoneZ* orig_conv = (LDKCResult_BlindedPathNoneZ*)untag_ptr(orig); + LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); + *ret_conv = CResult_BlindedPathNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKBlindedPath o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = BlindedPath_clone(&o_conv); + LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ"); + *ret_conv = CResult_BlindedPathDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ"); + *ret_conv = CResult_BlindedPathDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_BlindedPathDecodeErrorZ* o_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_BlindedPathDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_BlindedPathDecodeErrorZ _res_conv = *(LDKCResult_BlindedPathDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_BlindedPathDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_BlindedPathDecodeErrorZ_clone_ptr(LDKCResult_BlindedPathDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ"); + *ret_conv = CResult_BlindedPathDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_BlindedPathDecodeErrorZ* arg_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BlindedPathDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_BlindedPathDecodeErrorZ* orig_conv = (LDKCResult_BlindedPathDecodeErrorZ*)untag_ptr(orig); + LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ"); + *ret_conv = CResult_BlindedPathDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKBlindedHop o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = BlindedHop_clone(&o_conv); + LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); + *ret_conv = CResult_BlindedHopDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); + *ret_conv = CResult_BlindedHopDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_BlindedHopDecodeErrorZ* o_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_BlindedHopDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_BlindedHopDecodeErrorZ _res_conv = *(LDKCResult_BlindedHopDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_BlindedHopDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_BlindedHopDecodeErrorZ_clone_ptr(LDKCResult_BlindedHopDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); + *ret_conv = CResult_BlindedHopDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_BlindedHopDecodeErrorZ* arg_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BlindedHopDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_BlindedHopDecodeErrorZ* orig_conv = (LDKCResult_BlindedHopDecodeErrorZ*)untag_ptr(orig); + LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); + *ret_conv = CResult_BlindedHopDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1WriteableScoreZ_1some(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -16623,6 +17022,198 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1clone( return tag_ptr(ret_conv, true); } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_ChannelDetailsZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ 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]; + LDKChannelDetails _res_conv_16_conv; + _res_conv_16_conv.inner = untag_ptr(_res_conv_16); + _res_conv_16_conv.is_owned = ptr_is_owned(_res_conv_16); + 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_ChannelDetailsZ_free(_res_constr); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKRoute o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = Route_clone(&o_conv); + LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); + *ret_conv = CResult_RouteLightningErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + LDKLightningError e_conv; + e_conv.inner = untag_ptr(e); + e_conv.is_owned = ptr_is_owned(e); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = LightningError_clone(&e_conv); + LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); + *ret_conv = CResult_RouteLightningErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_RouteLightningErrorZ* o_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_RouteLightningErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_RouteLightningErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_RouteLightningErrorZ_clone_ptr(LDKCResult_RouteLightningErrorZ *NONNULL_PTR arg) { + LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); + *ret_conv = CResult_RouteLightningErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_RouteLightningErrorZ* arg_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_RouteLightningErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_RouteLightningErrorZ* orig_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(orig); + LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); + *ret_conv = CResult_RouteLightningErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHopZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_RouteHopZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ 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]; + LDKRouteHop _res_conv_10_conv; + _res_conv_10_conv.inner = untag_ptr(_res_conv_10); + _res_conv_10_conv.is_owned = ptr_is_owned(_res_conv_10); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv); + _res_constr.data[k] = _res_conv_10_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_RouteHopZ_free(_res_constr); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1some(JNIEnv *env, jclass clz, int64_t o) { + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = COption_u64Z_some(o); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1none(JNIEnv *env, jclass clz) { + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = COption_u64Z_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_u64Z _res_conv = *(LDKCOption_u64Z*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_u64Z_free(_res_conv); +} + +static inline uint64_t COption_u64Z_clone_ptr(LDKCOption_u64Z *NONNULL_PTR arg) { + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = COption_u64Z_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_u64Z* arg_conv = (LDKCOption_u64Z*)untag_ptr(arg); + int64_t ret_conv = COption_u64Z_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_u64Z* orig_conv = (LDKCOption_u64Z*)untag_ptr(orig); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = COption_u64Z_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKInFlightHtlcs o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = InFlightHtlcs_clone(&o_conv); + LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ"); + *ret_conv = CResult_InFlightHtlcsDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ"); + *ret_conv = CResult_InFlightHtlcsDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InFlightHtlcsDecodeErrorZ* o_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InFlightHtlcsDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_InFlightHtlcsDecodeErrorZ _res_conv = *(LDKCResult_InFlightHtlcsDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_InFlightHtlcsDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_InFlightHtlcsDecodeErrorZ_clone_ptr(LDKCResult_InFlightHtlcsDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ"); + *ret_conv = CResult_InFlightHtlcsDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_InFlightHtlcsDecodeErrorZ* arg_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_InFlightHtlcsDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_InFlightHtlcsDecodeErrorZ* orig_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(orig); + LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ"); + *ret_conv = CResult_InFlightHtlcsDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { LDKRouteHop o_conv; o_conv.inner = untag_ptr(o); @@ -16677,26 +17268,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErro return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHopZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_RouteHopZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ 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]; - LDKRouteHop _res_conv_10_conv; - _res_conv_10_conv.inner = untag_ptr(_res_conv_10); - _res_conv_10_conv.is_owned = ptr_is_owned(_res_conv_10); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv); - _res_constr.data[k] = _res_conv_10_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_RouteHopZ_free(_res_constr); -} - JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1RouteHopZZ_1free(JNIEnv *env, jclass clz, jobjectArray _res) { LDKCVec_CVec_RouteHopZZ _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); @@ -16855,49 +17426,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintZ_1free(JNIEnv CVec_RouteHintZ_free(_res_constr); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1some(JNIEnv *env, jclass clz, int64_t o) { - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = COption_u64Z_some(o); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1none(JNIEnv *env, jclass clz) { - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = COption_u64Z_none(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCOption_u64Z _res_conv = *(LDKCOption_u64Z*)(_res_ptr); - FREE(untag_ptr(_res)); - COption_u64Z_free(_res_conv); -} - -static inline uint64_t COption_u64Z_clone_ptr(LDKCOption_u64Z *NONNULL_PTR arg) { - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = COption_u64Z_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCOption_u64Z* arg_conv = (LDKCOption_u64Z*)untag_ptr(arg); - int64_t ret_conv = COption_u64Z_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCOption_u64Z* orig_conv = (LDKCOption_u64Z*)untag_ptr(orig); - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = COption_u64Z_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - 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); @@ -17096,81 +17624,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecode return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { - LDKCVec_ChannelDetailsZ _res_constr; - _res_constr.datalen = (*env)->GetArrayLength(env, _res); - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ 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]; - LDKChannelDetails _res_conv_16_conv; - _res_conv_16_conv.inner = untag_ptr(_res_conv_16); - _res_conv_16_conv.is_owned = ptr_is_owned(_res_conv_16); - 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_ChannelDetailsZ_free(_res_constr); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKRoute o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = Route_clone(&o_conv); - LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); - *ret_conv = CResult_RouteLightningErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - LDKLightningError e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = LightningError_clone(&e_conv); - LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); - *ret_conv = CResult_RouteLightningErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_RouteLightningErrorZ* o_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_RouteLightningErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_RouteLightningErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_RouteLightningErrorZ_clone_ptr(LDKCResult_RouteLightningErrorZ *NONNULL_PTR arg) { - LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); - *ret_conv = CResult_RouteLightningErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_RouteLightningErrorZ* arg_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_RouteLightningErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_RouteLightningErrorZ* orig_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(orig); - LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); - *ret_conv = CResult_RouteLightningErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -17424,6 +17877,52 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDesti return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u128Z_1some(JNIEnv *env, jclass clz, int8_tArray o) { + LDKU128 o_ref; + CHECK((*env)->GetArrayLength(env, o) == 16); + (*env)->GetByteArrayRegion(env, o, 0, 16, o_ref.le_bytes); + LDKCOption_u128Z *ret_copy = MALLOC(sizeof(LDKCOption_u128Z), "LDKCOption_u128Z"); + *ret_copy = COption_u128Z_some(o_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u128Z_1none(JNIEnv *env, jclass clz) { + LDKCOption_u128Z *ret_copy = MALLOC(sizeof(LDKCOption_u128Z), "LDKCOption_u128Z"); + *ret_copy = COption_u128Z_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u128Z_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_u128Z _res_conv = *(LDKCOption_u128Z*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_u128Z_free(_res_conv); +} + +static inline uint64_t COption_u128Z_clone_ptr(LDKCOption_u128Z *NONNULL_PTR arg) { + LDKCOption_u128Z *ret_copy = MALLOC(sizeof(LDKCOption_u128Z), "LDKCOption_u128Z"); + *ret_copy = COption_u128Z_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u128Z_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_u128Z* arg_conv = (LDKCOption_u128Z*)untag_ptr(arg); + int64_t ret_conv = COption_u128Z_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1u128Z_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_u128Z* orig_conv = (LDKCOption_u128Z*)untag_ptr(orig); + LDKCOption_u128Z *ret_copy = MALLOC(sizeof(LDKCOption_u128Z), "LDKCOption_u128Z"); + *ret_copy = COption_u128Z_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1some(JNIEnv *env, jclass clz, int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -17719,21 +18218,63 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1usizeTransactio 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; +static inline uint64_t C2Tuple_TxidBlockHashZ_clone_ptr(LDKC2Tuple_TxidBlockHashZ *NONNULL_PTR arg) { + LDKC2Tuple_TxidBlockHashZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidBlockHashZ), "LDKC2Tuple_TxidBlockHashZ"); + *ret_conv = C2Tuple_TxidBlockHashZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidBlockHashZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_TxidBlockHashZ* arg_conv = (LDKC2Tuple_TxidBlockHashZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_TxidBlockHashZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidBlockHashZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_TxidBlockHashZ* orig_conv = (LDKC2Tuple_TxidBlockHashZ*)untag_ptr(orig); + LDKC2Tuple_TxidBlockHashZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidBlockHashZ), "LDKC2Tuple_TxidBlockHashZ"); + *ret_conv = C2Tuple_TxidBlockHashZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidBlockHashZ_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_TxidBlockHashZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidBlockHashZ), "LDKC2Tuple_TxidBlockHashZ"); + *ret_conv = C2Tuple_TxidBlockHashZ_new(a_ref, b_ref); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidBlockHashZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKC2Tuple_TxidBlockHashZ _res_conv = *(LDKC2Tuple_TxidBlockHashZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_TxidBlockHashZ_free(_res_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidBlockHashZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_TxidBlockHashZZ _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(LDKC2Tuple_TxidBlockHashZ), "LDKCVec_C2Tuple_TxidBlockHashZZ 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; + 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 = untag_ptr(_res_conv_25); + CHECK_ACCESS(_res_conv_25_ptr); + LDKC2Tuple_TxidBlockHashZ _res_conv_25_conv = *(LDKC2Tuple_TxidBlockHashZ*)(_res_conv_25_ptr); + FREE(untag_ptr(_res_conv_25)); + _res_constr.data[z] = _res_conv_25_conv; } - CVec_TxidZ_free(_res_constr); + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_C2Tuple_TxidBlockHashZZ_free(_res_constr); } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorEventZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { @@ -18294,6 +18835,114 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeature return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OfferFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKOfferFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = OfferFeatures_clone(&o_conv); + LDKCResult_OfferFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferFeaturesDecodeErrorZ), "LDKCResult_OfferFeaturesDecodeErrorZ"); + *ret_conv = CResult_OfferFeaturesDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OfferFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_OfferFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferFeaturesDecodeErrorZ), "LDKCResult_OfferFeaturesDecodeErrorZ"); + *ret_conv = CResult_OfferFeaturesDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OfferFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_OfferFeaturesDecodeErrorZ* o_conv = (LDKCResult_OfferFeaturesDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OfferFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OfferFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_OfferFeaturesDecodeErrorZ _res_conv = *(LDKCResult_OfferFeaturesDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_OfferFeaturesDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_OfferFeaturesDecodeErrorZ_clone_ptr(LDKCResult_OfferFeaturesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OfferFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferFeaturesDecodeErrorZ), "LDKCResult_OfferFeaturesDecodeErrorZ"); + *ret_conv = CResult_OfferFeaturesDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OfferFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_OfferFeaturesDecodeErrorZ* arg_conv = (LDKCResult_OfferFeaturesDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OfferFeaturesDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1OfferFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_OfferFeaturesDecodeErrorZ* orig_conv = (LDKCResult_OfferFeaturesDecodeErrorZ*)untag_ptr(orig); + LDKCResult_OfferFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferFeaturesDecodeErrorZ), "LDKCResult_OfferFeaturesDecodeErrorZ"); + *ret_conv = CResult_OfferFeaturesDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestFeaturesDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKInvoiceRequestFeatures o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = InvoiceRequestFeatures_clone(&o_conv); + LDKCResult_InvoiceRequestFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestFeaturesDecodeErrorZ), "LDKCResult_InvoiceRequestFeaturesDecodeErrorZ"); + *ret_conv = CResult_InvoiceRequestFeaturesDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestFeaturesDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_InvoiceRequestFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestFeaturesDecodeErrorZ), "LDKCResult_InvoiceRequestFeaturesDecodeErrorZ"); + *ret_conv = CResult_InvoiceRequestFeaturesDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestFeaturesDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_InvoiceRequestFeaturesDecodeErrorZ* o_conv = (LDKCResult_InvoiceRequestFeaturesDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceRequestFeaturesDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestFeaturesDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_InvoiceRequestFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InvoiceRequestFeaturesDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_InvoiceRequestFeaturesDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_InvoiceRequestFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InvoiceRequestFeaturesDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_InvoiceRequestFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestFeaturesDecodeErrorZ), "LDKCResult_InvoiceRequestFeaturesDecodeErrorZ"); + *ret_conv = CResult_InvoiceRequestFeaturesDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestFeaturesDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_InvoiceRequestFeaturesDecodeErrorZ* arg_conv = (LDKCResult_InvoiceRequestFeaturesDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_InvoiceRequestFeaturesDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestFeaturesDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_InvoiceRequestFeaturesDecodeErrorZ* orig_conv = (LDKCResult_InvoiceRequestFeaturesDecodeErrorZ*)untag_ptr(orig); + LDKCResult_InvoiceRequestFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestFeaturesDecodeErrorZ), "LDKCResult_InvoiceRequestFeaturesDecodeErrorZ"); + *ret_conv = CResult_InvoiceRequestFeaturesDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + 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 = untag_ptr(o); @@ -19705,21 +20354,21 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1 return tag_ptr(ret_conv, true); } -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_1U5Z_1free(JNIEnv *env, jclass clz, jobjectArray _res) { + LDKCVec_U5Z _res_constr; _res_constr.datalen = (*env)->GetArrayLength(env, _res); if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKU5), "LDKCVec_U5Z Elements"); else _res_constr.data = NULL; int8_t* _res_vals = (*env)->GetByteArrayElements (env, _res, NULL); for (size_t h = 0; h < _res_constr.datalen; h++) { int8_t _res_conv_7 = _res_vals[h]; - _res_constr.data[h] = (LDKu5){ ._0 = _res_conv_7 }; + _res_constr.data[h] = (LDKU5){ ._0 = _res_conv_7 }; } (*env)->ReleaseByteArrayElements(env, _res, _res_vals, 0); - CVec_u5Z_free(_res_constr); + CVec_U5Z_free(_res_constr); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1RecoverableSignatureNoneZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) { @@ -20286,104 +20935,104 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1c return tag_ptr(ret_conv, true); } -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); +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 tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr); e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e)); - LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); - *ret_conv = CResult_PaymentIdPaymentSendFailureZ_err(e_conv); + LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); + *ret_conv = CResult_NonePaymentSendFailureZ_err(e_conv); return tag_ptr(ret_conv, true); } -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*)untag_ptr(o); - jboolean ret_conv = CResult_PaymentIdPaymentSendFailureZ_is_ok(o_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*)untag_ptr(o); + jboolean ret_conv = CResult_NonePaymentSendFailureZ_is_ok(o_conv); return 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_CResult_1NonePaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_PaymentIdPaymentSendFailureZ _res_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(_res_ptr); + LDKCResult_NonePaymentSendFailureZ _res_conv = *(LDKCResult_NonePaymentSendFailureZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PaymentIdPaymentSendFailureZ_free(_res_conv); + CResult_NonePaymentSendFailureZ_free(_res_conv); } -static inline uint64_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); +static inline uint64_t CResult_NonePaymentSendFailureZ_clone_ptr(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR arg) { + LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); + *ret_conv = CResult_NonePaymentSendFailureZ_clone(arg); return tag_ptr(ret_conv, true); } -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*)untag_ptr(arg); - int64_t ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone_ptr(arg_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*)untag_ptr(arg); + int64_t ret_conv = CResult_NonePaymentSendFailureZ_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*)untag_ptr(orig); - LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ"); - *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_NonePaymentSendFailureZ* orig_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(orig); + LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); + *ret_conv = CResult_NonePaymentSendFailureZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -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_1PaymentHashPaymentSendFailureZ_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_PaymentHashPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashPaymentSendFailureZ), "LDKCResult_PaymentHashPaymentSendFailureZ"); + *ret_conv = CResult_PaymentHashPaymentSendFailureZ_ok(o_ref); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr); e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e)); - LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); - *ret_conv = CResult_NonePaymentSendFailureZ_err(e_conv); + LDKCResult_PaymentHashPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashPaymentSendFailureZ), "LDKCResult_PaymentHashPaymentSendFailureZ"); + *ret_conv = CResult_PaymentHashPaymentSendFailureZ_err(e_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_NonePaymentSendFailureZ* o_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(o); - jboolean ret_conv = CResult_NonePaymentSendFailureZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PaymentHashPaymentSendFailureZ* o_conv = (LDKCResult_PaymentHashPaymentSendFailureZ*)untag_ptr(o); + jboolean ret_conv = CResult_PaymentHashPaymentSendFailureZ_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_1PaymentHashPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_NonePaymentSendFailureZ _res_conv = *(LDKCResult_NonePaymentSendFailureZ*)(_res_ptr); + LDKCResult_PaymentHashPaymentSendFailureZ _res_conv = *(LDKCResult_PaymentHashPaymentSendFailureZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_NonePaymentSendFailureZ_free(_res_conv); + CResult_PaymentHashPaymentSendFailureZ_free(_res_conv); } -static inline uint64_t CResult_NonePaymentSendFailureZ_clone_ptr(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR arg) { - LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); - *ret_conv = CResult_NonePaymentSendFailureZ_clone(arg); +static inline uint64_t CResult_PaymentHashPaymentSendFailureZ_clone_ptr(LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR arg) { + LDKCResult_PaymentHashPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashPaymentSendFailureZ), "LDKCResult_PaymentHashPaymentSendFailureZ"); + *ret_conv = CResult_PaymentHashPaymentSendFailureZ_clone(arg); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_NonePaymentSendFailureZ* arg_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(arg); - int64_t ret_conv = CResult_NonePaymentSendFailureZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PaymentHashPaymentSendFailureZ* arg_conv = (LDKCResult_PaymentHashPaymentSendFailureZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PaymentHashPaymentSendFailureZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_NonePaymentSendFailureZ* orig_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(orig); - LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); - *ret_conv = CResult_NonePaymentSendFailureZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_PaymentHashPaymentSendFailureZ* orig_conv = (LDKCResult_PaymentHashPaymentSendFailureZ*)untag_ptr(orig); + LDKCResult_PaymentHashPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashPaymentSendFailureZ), "LDKCResult_PaymentHashPaymentSendFailureZ"); + *ret_conv = CResult_PaymentHashPaymentSendFailureZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -21347,612 +21996,148 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentEr return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKInFlightHtlcs o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - // WARNING: we need a move here but no clone is available for LDKInFlightHtlcs - - LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ"); - *ret_conv = CResult_InFlightHtlcsDecodeErrorZ_ok(o_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1ok(JNIEnv *env, jclass clz) { + LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ"); + *ret_conv = CResult_NonePaymentErrorZ_ok(); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); - LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); - e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ"); - *ret_conv = CResult_InFlightHtlcsDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_InFlightHtlcsDecodeErrorZ* o_conv = (LDKCResult_InFlightHtlcsDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_InFlightHtlcsDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_InFlightHtlcsDecodeErrorZ _res_conv = *(LDKCResult_InFlightHtlcsDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_InFlightHtlcsDecodeErrorZ_free(_res_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 tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKParseError e_conv = *(LDKParseError*)(e_ptr); - e_conv = ParseError_clone((LDKParseError*)untag_ptr(e)); - LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ"); - *ret_conv = CResult_SiPrefixParseErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -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*)untag_ptr(o); - jboolean ret_conv = CResult_SiPrefixParseErrorZ_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) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_SiPrefixParseErrorZ _res_conv = *(LDKCResult_SiPrefixParseErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_SiPrefixParseErrorZ_free(_res_conv); -} - -static inline uint64_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 tag_ptr(ret_conv, true); -} -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*)untag_ptr(arg); - int64_t ret_conv = CResult_SiPrefixParseErrorZ_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*)untag_ptr(orig); - LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ"); - *ret_conv = CResult_SiPrefixParseErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -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 = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - 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); - return tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKParseOrSemanticError e_conv = *(LDKParseOrSemanticError*)(e_ptr); - e_conv = ParseOrSemanticError_clone((LDKParseOrSemanticError*)untag_ptr(e)); - LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ"); - *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -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*)untag_ptr(o); - jboolean ret_conv = CResult_InvoiceParseOrSemanticErrorZ_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) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_InvoiceParseOrSemanticErrorZ _res_conv = *(LDKCResult_InvoiceParseOrSemanticErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_InvoiceParseOrSemanticErrorZ_free(_res_conv); -} - -static inline uint64_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 tag_ptr(ret_conv, true); -} -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*)untag_ptr(arg); - int64_t ret_conv = CResult_InvoiceParseOrSemanticErrorZ_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*)untag_ptr(orig); - LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ"); - *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -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 = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - 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 tag_ptr(ret_conv, true); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKParseError e_conv = *(LDKParseError*)(e_ptr); - e_conv = ParseError_clone((LDKParseError*)untag_ptr(e)); - LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ"); - *ret_conv = CResult_SignedRawInvoiceParseErrorZ_err(e_conv); + LDKPaymentError e_conv = *(LDKPaymentError*)(e_ptr); + e_conv = PaymentError_clone((LDKPaymentError*)untag_ptr(e)); + LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ"); + *ret_conv = CResult_NonePaymentErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -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*)untag_ptr(o); - jboolean ret_conv = CResult_SignedRawInvoiceParseErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NonePaymentErrorZ* o_conv = (LDKCResult_NonePaymentErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_NonePaymentErrorZ_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_1NonePaymentErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_SignedRawInvoiceParseErrorZ _res_conv = *(LDKCResult_SignedRawInvoiceParseErrorZ*)(_res_ptr); + LDKCResult_NonePaymentErrorZ _res_conv = *(LDKCResult_NonePaymentErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_SignedRawInvoiceParseErrorZ_free(_res_conv); + CResult_NonePaymentErrorZ_free(_res_conv); } -static inline uint64_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 uint64_t CResult_NonePaymentErrorZ_clone_ptr(LDKCResult_NonePaymentErrorZ *NONNULL_PTR arg) { + LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ"); + *ret_conv = CResult_NonePaymentErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -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*)untag_ptr(arg); - int64_t ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_NonePaymentErrorZ* arg_conv = (LDKCResult_NonePaymentErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_NonePaymentErrorZ_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*)untag_ptr(orig); - LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ"); - *ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -static inline uint64_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 tag_ptr(ret_conv, true); -} -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*)untag_ptr(arg); - 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*)untag_ptr(orig); - LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); - *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -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 = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - 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 = untag_ptr(c); - c_conv.is_owned = ptr_is_owned(c); - 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); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_NonePaymentErrorZ* orig_conv = (LDKCResult_NonePaymentErrorZ*)untag_ptr(orig); + LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ"); + *ret_conv = CResult_NonePaymentErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res_conv = *(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(_res_ptr); - FREE(untag_ptr(_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; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - 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); +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 tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { +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_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); - *ret_conv = CResult_PayeePubKeyErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -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*)untag_ptr(o); - jboolean ret_conv = CResult_PayeePubKeyErrorZ_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) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_PayeePubKeyErrorZ _res_conv = *(LDKCResult_PayeePubKeyErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_PayeePubKeyErrorZ_free(_res_conv); -} - -static inline uint64_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 tag_ptr(ret_conv, true); -} -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*)untag_ptr(arg); - 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*)untag_ptr(orig); - LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); - *ret_conv = CResult_PayeePubKeyErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -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 = untag_ptr(_res_conv_14); - _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv); - _res_constr.data[o] = _res_conv_14_conv; - } - (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); - CVec_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; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - 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 tag_ptr(ret_conv, true); -} - -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 tag_ptr(ret_conv, true); -} - -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*)untag_ptr(o); - jboolean ret_conv = CResult_PositiveTimestampCreationErrorZ_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) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_PositiveTimestampCreationErrorZ _res_conv = *(LDKCResult_PositiveTimestampCreationErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_PositiveTimestampCreationErrorZ_free(_res_conv); -} - -static inline uint64_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 tag_ptr(ret_conv, true); -} -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*)untag_ptr(arg); - int64_t ret_conv = CResult_PositiveTimestampCreationErrorZ_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*)untag_ptr(orig); - LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); - *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -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 tag_ptr(ret_conv, true); -} - -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 tag_ptr(ret_conv, true); -} - -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*)untag_ptr(o); - 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 (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_NoneSemanticErrorZ _res_conv = *(LDKCResult_NoneSemanticErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_NoneSemanticErrorZ_free(_res_conv); -} - -static inline uint64_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 tag_ptr(ret_conv, true); -} -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*)untag_ptr(arg); - int64_t ret_conv = CResult_NoneSemanticErrorZ_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*)untag_ptr(orig); - LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); - *ret_conv = CResult_NoneSemanticErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -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 = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - 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 tag_ptr(ret_conv, true); -} - -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 tag_ptr(ret_conv, true); -} - -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*)untag_ptr(o); - jboolean ret_conv = CResult_InvoiceSemanticErrorZ_is_ok(o_conv); - return ret_conv; -} - -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_InvoiceSemanticErrorZ _res_conv = *(LDKCResult_InvoiceSemanticErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_InvoiceSemanticErrorZ_free(_res_conv); -} - -static inline uint64_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 tag_ptr(ret_conv, true); -} -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*)untag_ptr(arg); - int64_t ret_conv = CResult_InvoiceSemanticErrorZ_clone_ptr(arg_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*)untag_ptr(orig); - LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); - *ret_conv = CResult_InvoiceSemanticErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -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 = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - 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 tag_ptr(ret_conv, true); -} - -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 tag_ptr(ret_conv, true); -} - -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*)untag_ptr(o); - jboolean ret_conv = CResult_DescriptionCreationErrorZ_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) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_DescriptionCreationErrorZ _res_conv = *(LDKCResult_DescriptionCreationErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_DescriptionCreationErrorZ_free(_res_conv); -} - -static inline uint64_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 tag_ptr(ret_conv, true); -} -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*)untag_ptr(arg); - int64_t ret_conv = CResult_DescriptionCreationErrorZ_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*)untag_ptr(orig); - LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); - *ret_conv = CResult_DescriptionCreationErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -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 = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - 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 tag_ptr(ret_conv, true); -} - -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); + LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ"); + *ret_conv = CResult_StringErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -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*)untag_ptr(o); - jboolean ret_conv = CResult_PrivateRouteCreationErrorZ_is_ok(o_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*)untag_ptr(o); + jboolean ret_conv = CResult_StringErrorZ_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_1StringErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_PrivateRouteCreationErrorZ _res_conv = *(LDKCResult_PrivateRouteCreationErrorZ*)(_res_ptr); + LDKCResult_StringErrorZ _res_conv = *(LDKCResult_StringErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PrivateRouteCreationErrorZ_free(_res_conv); + CResult_StringErrorZ_free(_res_conv); } -static inline uint64_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 uint64_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 tag_ptr(ret_conv, true); } -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*)untag_ptr(arg); - int64_t ret_conv = CResult_PrivateRouteCreationErrorZ_clone_ptr(arg_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*)untag_ptr(arg); + int64_t ret_conv = CResult_StringErrorZ_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*)untag_ptr(orig); - 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_1StringErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_StringErrorZ* orig_conv = (LDKCResult_StringErrorZ*)untag_ptr(orig); + LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ"); + *ret_conv = CResult_StringErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -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); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1ok(JNIEnv *env, jclass clz, int8_tArray o) { + LDKPublicKey o_ref; + CHECK((*env)->GetArrayLength(env, o) == 33); + (*env)->GetByteArrayRegion(env, o, 0, 33, o_ref.compressed_form); + LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); + *ret_conv = CResult_PublicKeyErrorZ_ok(o_ref); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1err(JNIEnv *env, jclass clz, jclass e) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_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); + LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); + *ret_conv = CResult_PublicKeyErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -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*)untag_ptr(o); - jboolean ret_conv = CResult_StringErrorZ_is_ok(o_conv); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_PublicKeyErrorZ* o_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_PublicKeyErrorZ_is_ok(o_conv); return ret_conv; } -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_CResult_1PublicKeyErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_StringErrorZ _res_conv = *(LDKCResult_StringErrorZ*)(_res_ptr); + LDKCResult_PublicKeyErrorZ _res_conv = *(LDKCResult_PublicKeyErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_StringErrorZ_free(_res_conv); + CResult_PublicKeyErrorZ_free(_res_conv); } -static inline uint64_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); +static inline uint64_t CResult_PublicKeyErrorZ_clone_ptr(LDKCResult_PublicKeyErrorZ *NONNULL_PTR arg) { + LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); + *ret_conv = CResult_PublicKeyErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -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*)untag_ptr(arg); - int64_t ret_conv = CResult_StringErrorZ_clone_ptr(arg_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_PublicKeyErrorZ* arg_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PublicKeyErrorZ_clone_ptr(arg_conv); return ret_conv; } -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*)untag_ptr(orig); - LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ"); - *ret_conv = CResult_StringErrorZ_clone(orig_conv); +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_PublicKeyErrorZ* orig_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(orig); + LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ"); + *ret_conv = CResult_PublicKeyErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -22653,325 +22838,850 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessage return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1none(JNIEnv *env, jclass clz) { - LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ"); - *ret_copy = COption_CustomOnionMessageContentsZ_none(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1none(JNIEnv *env, jclass clz) { + LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ"); + *ret_copy = COption_CustomOnionMessageContentsZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_CustomOnionMessageContentsZ _res_conv = *(LDKCOption_CustomOnionMessageContentsZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_CustomOnionMessageContentsZ_free(_res_conv); +} + +static inline uint64_t COption_CustomOnionMessageContentsZ_clone_ptr(LDKCOption_CustomOnionMessageContentsZ *NONNULL_PTR arg) { + LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ"); + *ret_copy = COption_CustomOnionMessageContentsZ_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCOption_CustomOnionMessageContentsZ* arg_conv = (LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(arg); + int64_t ret_conv = COption_CustomOnionMessageContentsZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCOption_CustomOnionMessageContentsZ* orig_conv = (LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(orig); + LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ"); + *ret_copy = COption_CustomOnionMessageContentsZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKCOption_CustomOnionMessageContentsZ o_conv = *(LDKCOption_CustomOnionMessageContentsZ*)(o_ptr); + o_conv = COption_CustomOnionMessageContentsZ_clone((LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(o)); + LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ"); + *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ"); + *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* o_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ _res_conv = *(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ"); + *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* arg_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* orig_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(orig); + LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ"); + *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1some(JNIEnv *env, jclass clz, int64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr); + o_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(o)); + LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ"); + *ret_copy = COption_NetAddressZ_some(o_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_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 = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_NetAddressZ _res_conv = *(LDKCOption_NetAddressZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_NetAddressZ_free(_res_conv); +} + +static inline uint64_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 = tag_ptr(ret_copy, true); + 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*)untag_ptr(arg); + int64_t ret_conv = COption_NetAddressZ_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*)untag_ptr(orig); + LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ"); + *ret_copy = COption_NetAddressZ_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_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 tag_ptr(ret_conv, true); +} + +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 = untag_ptr(e); + e_conv.is_owned = ptr_is_owned(e); + 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); + return tag_ptr(ret_conv, true); +} + +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*)untag_ptr(o); + jboolean ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_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) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_CVec_u8ZPeerHandleErrorZ _res_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_CVec_u8ZPeerHandleErrorZ_free(_res_conv); +} + +static inline uint64_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 tag_ptr(ret_conv, true); +} +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*)untag_ptr(arg); + int64_t ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_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*)untag_ptr(orig); + LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ"); + *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +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 tag_ptr(ret_conv, true); +} + +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 = untag_ptr(e); + e_conv.is_owned = ptr_is_owned(e); + 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); + return tag_ptr(ret_conv, true); +} + +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*)untag_ptr(o); + jboolean ret_conv = CResult_NonePeerHandleErrorZ_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) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_NonePeerHandleErrorZ _res_conv = *(LDKCResult_NonePeerHandleErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_NonePeerHandleErrorZ_free(_res_conv); +} + +static inline uint64_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 tag_ptr(ret_conv, true); +} +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*)untag_ptr(arg); + int64_t ret_conv = CResult_NonePeerHandleErrorZ_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*)untag_ptr(orig); + LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); + *ret_conv = CResult_NonePeerHandleErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +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 tag_ptr(ret_conv, true); +} + +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 = untag_ptr(e); + e_conv.is_owned = ptr_is_owned(e); + 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 tag_ptr(ret_conv, true); +} + +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*)untag_ptr(o); + 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 (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_boolPeerHandleErrorZ _res_conv = *(LDKCResult_boolPeerHandleErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_boolPeerHandleErrorZ_free(_res_conv); +} + +static inline uint64_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 tag_ptr(ret_conv, true); +} +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*)untag_ptr(arg); + int64_t ret_conv = CResult_boolPeerHandleErrorZ_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*)untag_ptr(orig); + LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); + *ret_conv = CResult_boolPeerHandleErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1ok(JNIEnv *env, jclass clz) { + LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ"); + *ret_conv = CResult_NoneSendErrorZ_ok(); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKSendError e_conv = *(LDKSendError*)(e_ptr); + e_conv = SendError_clone((LDKSendError*)untag_ptr(e)); + LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ"); + *ret_conv = CResult_NoneSendErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKCResult_NoneSendErrorZ* o_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_NoneSendErrorZ_is_ok(o_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_NoneSendErrorZ _res_conv = *(LDKCResult_NoneSendErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_NoneSendErrorZ_free(_res_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 tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKParseError e_conv = *(LDKParseError*)(e_ptr); + e_conv = ParseError_clone((LDKParseError*)untag_ptr(e)); + LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ"); + *ret_conv = CResult_SiPrefixParseErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +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*)untag_ptr(o); + jboolean ret_conv = CResult_SiPrefixParseErrorZ_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) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_SiPrefixParseErrorZ _res_conv = *(LDKCResult_SiPrefixParseErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_SiPrefixParseErrorZ_free(_res_conv); +} + +static inline uint64_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 tag_ptr(ret_conv, true); +} +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*)untag_ptr(arg); + int64_t ret_conv = CResult_SiPrefixParseErrorZ_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*)untag_ptr(orig); + LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ"); + *ret_conv = CResult_SiPrefixParseErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +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 = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + 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); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKParseOrSemanticError e_conv = *(LDKParseOrSemanticError*)(e_ptr); + e_conv = ParseOrSemanticError_clone((LDKParseOrSemanticError*)untag_ptr(e)); + LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ"); + *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +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*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceParseOrSemanticErrorZ_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) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_InvoiceParseOrSemanticErrorZ _res_conv = *(LDKCResult_InvoiceParseOrSemanticErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_InvoiceParseOrSemanticErrorZ_free(_res_conv); +} + +static inline uint64_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 tag_ptr(ret_conv, true); +} +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*)untag_ptr(arg); + int64_t ret_conv = CResult_InvoiceParseOrSemanticErrorZ_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*)untag_ptr(orig); + LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ"); + *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +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 = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + 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 tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKParseError e_conv = *(LDKParseError*)(e_ptr); + e_conv = ParseError_clone((LDKParseError*)untag_ptr(e)); + LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ"); + *ret_conv = CResult_SignedRawInvoiceParseErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +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*)untag_ptr(o); + jboolean ret_conv = CResult_SignedRawInvoiceParseErrorZ_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) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_SignedRawInvoiceParseErrorZ _res_conv = *(LDKCResult_SignedRawInvoiceParseErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_SignedRawInvoiceParseErrorZ_free(_res_conv); +} + +static inline uint64_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 tag_ptr(ret_conv, true); +} +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*)untag_ptr(arg); + 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*)untag_ptr(orig); + LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ"); + *ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +static inline uint64_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 tag_ptr(ret_conv, true); +} +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*)untag_ptr(arg); + 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*)untag_ptr(orig); + LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ"); + *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +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 = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + 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 = untag_ptr(c); + c_conv.is_owned = ptr_is_owned(c); + 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 tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_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 (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCOption_CustomOnionMessageContentsZ _res_conv = *(LDKCOption_CustomOnionMessageContentsZ*)(_res_ptr); + LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res_conv = *(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_CustomOnionMessageContentsZ_free(_res_conv); -} - -static inline uint64_t COption_CustomOnionMessageContentsZ_clone_ptr(LDKCOption_CustomOnionMessageContentsZ *NONNULL_PTR arg) { - LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ"); - *ret_copy = COption_CustomOnionMessageContentsZ_clone(arg); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCOption_CustomOnionMessageContentsZ* arg_conv = (LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(arg); - int64_t ret_conv = COption_CustomOnionMessageContentsZ_clone_ptr(arg_conv); - return ret_conv; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCOption_CustomOnionMessageContentsZ* orig_conv = (LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(orig); - LDKCOption_CustomOnionMessageContentsZ *ret_copy = MALLOC(sizeof(LDKCOption_CustomOnionMessageContentsZ), "LDKCOption_CustomOnionMessageContentsZ"); - *ret_copy = COption_CustomOnionMessageContentsZ_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(_res_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKCOption_CustomOnionMessageContentsZ o_conv = *(LDKCOption_CustomOnionMessageContentsZ*)(o_ptr); - o_conv = COption_CustomOnionMessageContentsZ_clone((LDKCOption_CustomOnionMessageContentsZ*)untag_ptr(o)); - LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ"); - *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_ok(o_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 = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + 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 tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); - e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ"); - *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_err(e_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 tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* o_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_is_ok(o_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*)untag_ptr(o); + jboolean ret_conv = CResult_PayeePubKeyErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_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 (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ _res_conv = *(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)(_res_ptr); + LDKCResult_PayeePubKeyErrorZ _res_conv = *(LDKCResult_PayeePubKeyErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_free(_res_conv); + CResult_PayeePubKeyErrorZ_free(_res_conv); } -static inline uint64_t CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ"); - *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone(arg); +static inline uint64_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 tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { - LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* arg_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr(arg_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*)untag_ptr(arg); + int64_t ret_conv = CResult_PayeePubKeyErrorZ_clone_ptr(arg_conv); return ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { - LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* orig_conv = (LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ*)untag_ptr(orig); - LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ), "LDKCResult_COption_CustomOnionMessageContentsZDecodeErrorZ"); - *ret_conv = CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone(orig_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*)untag_ptr(orig); + LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ"); + *ret_conv = CResult_PayeePubKeyErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1some(JNIEnv *env, jclass clz, int64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr); - o_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(o)); - LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ"); - *ret_copy = COption_NetAddressZ_some(o_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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 = untag_ptr(_res_conv_14); + _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv); + _res_constr.data[o] = _res_conv_14_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_PrivateRouteZ_free(_res_constr); } -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 = tag_ptr(ret_copy, true); - return ret_ref; +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 = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + 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 tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1free(JNIEnv *env, jclass clz, int64_t _res) { +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 tag_ptr(ret_conv, true); +} + +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*)untag_ptr(o); + jboolean ret_conv = CResult_PositiveTimestampCreationErrorZ_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) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCOption_NetAddressZ _res_conv = *(LDKCOption_NetAddressZ*)(_res_ptr); + LDKCResult_PositiveTimestampCreationErrorZ _res_conv = *(LDKCResult_PositiveTimestampCreationErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_NetAddressZ_free(_res_conv); + CResult_PositiveTimestampCreationErrorZ_free(_res_conv); } -static inline uint64_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 = tag_ptr(ret_copy, true); - return ret_ref; +static inline uint64_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 tag_ptr(ret_conv, true); } -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*)untag_ptr(arg); - int64_t ret_conv = COption_NetAddressZ_clone_ptr(arg_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*)untag_ptr(arg); + int64_t ret_conv = CResult_PositiveTimestampCreationErrorZ_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*)untag_ptr(orig); - LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ"); - *ret_copy = COption_NetAddressZ_clone(orig_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_PositiveTimestampCreationErrorZ* orig_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(orig); + LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); + *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -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_1NoneSemanticErrorZ_1ok(JNIEnv *env, jclass clz) { + LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); + *ret_conv = CResult_NoneSemanticErrorZ_ok(); return tag_ptr(ret_conv, true); } -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 = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - 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); +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 tag_ptr(ret_conv, true); } -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*)untag_ptr(o); - jboolean ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_is_ok(o_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*)untag_ptr(o); + jboolean ret_conv = CResult_NoneSemanticErrorZ_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_1NoneSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_CVec_u8ZPeerHandleErrorZ _res_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)(_res_ptr); + LDKCResult_NoneSemanticErrorZ _res_conv = *(LDKCResult_NoneSemanticErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_CVec_u8ZPeerHandleErrorZ_free(_res_conv); + CResult_NoneSemanticErrorZ_free(_res_conv); } -static inline uint64_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 uint64_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 tag_ptr(ret_conv, true); } -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*)untag_ptr(arg); - int64_t ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(arg_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*)untag_ptr(arg); + int64_t ret_conv = CResult_NoneSemanticErrorZ_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*)untag_ptr(orig); - 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_1NoneSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_NoneSemanticErrorZ* orig_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(orig); + LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ"); + *ret_conv = CResult_NoneSemanticErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -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_1InvoiceSemanticErrorZ_1ok(JNIEnv *env, jclass clz, int64_t o) { + LDKInvoice o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + 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 tag_ptr(ret_conv, true); } -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 = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - 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); +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 tag_ptr(ret_conv, true); } -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*)untag_ptr(o); - jboolean ret_conv = CResult_NonePeerHandleErrorZ_is_ok(o_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*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceSemanticErrorZ_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_1InvoiceSemanticErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_NonePeerHandleErrorZ _res_conv = *(LDKCResult_NonePeerHandleErrorZ*)(_res_ptr); + LDKCResult_InvoiceSemanticErrorZ _res_conv = *(LDKCResult_InvoiceSemanticErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_NonePeerHandleErrorZ_free(_res_conv); + CResult_InvoiceSemanticErrorZ_free(_res_conv); } -static inline uint64_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 uint64_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 tag_ptr(ret_conv, true); } -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*)untag_ptr(arg); - int64_t ret_conv = CResult_NonePeerHandleErrorZ_clone_ptr(arg_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*)untag_ptr(arg); + int64_t ret_conv = CResult_InvoiceSemanticErrorZ_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*)untag_ptr(orig); - 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_1InvoiceSemanticErrorZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKCResult_InvoiceSemanticErrorZ* orig_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(orig); + LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ"); + *ret_conv = CResult_InvoiceSemanticErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -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); +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 = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + 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 tag_ptr(ret_conv, true); } -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 = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - 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); +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 tag_ptr(ret_conv, true); } -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*)untag_ptr(o); - jboolean ret_conv = CResult_boolPeerHandleErrorZ_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*)untag_ptr(o); + jboolean ret_conv = CResult_DescriptionCreationErrorZ_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) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1free(JNIEnv *env, jclass clz, int64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_boolPeerHandleErrorZ _res_conv = *(LDKCResult_boolPeerHandleErrorZ*)(_res_ptr); + LDKCResult_DescriptionCreationErrorZ _res_conv = *(LDKCResult_DescriptionCreationErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_boolPeerHandleErrorZ_free(_res_conv); + CResult_DescriptionCreationErrorZ_free(_res_conv); } -static inline uint64_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); +static inline uint64_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 tag_ptr(ret_conv, true); } -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*)untag_ptr(arg); - int64_t ret_conv = CResult_boolPeerHandleErrorZ_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*)untag_ptr(arg); + int64_t ret_conv = CResult_DescriptionCreationErrorZ_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*)untag_ptr(orig); - LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ"); - *ret_conv = CResult_boolPeerHandleErrorZ_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*)untag_ptr(orig); + LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); + *ret_conv = CResult_DescriptionCreationErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1ok(JNIEnv *env, jclass clz) { - LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ"); - *ret_conv = CResult_NoneSendErrorZ_ok(); +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 = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + 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 tag_ptr(ret_conv, true); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1err(JNIEnv *env, jclass clz, int64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKSendError e_conv = *(LDKSendError*)(e_ptr); - e_conv = SendError_clone((LDKSendError*)untag_ptr(e)); - LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ"); - *ret_conv = CResult_NoneSendErrorZ_err(e_conv); +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 tag_ptr(ret_conv, true); } -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1is_1ok(JNIEnv *env, jclass clz, int64_t o) { - LDKCResult_NoneSendErrorZ* o_conv = (LDKCResult_NoneSendErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_NoneSendErrorZ_is_ok(o_conv); +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*)untag_ptr(o); + jboolean ret_conv = CResult_PrivateRouteCreationErrorZ_is_ok(o_conv); return ret_conv; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_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 (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_NoneSendErrorZ _res_conv = *(LDKCResult_NoneSendErrorZ*)(_res_ptr); + LDKCResult_PrivateRouteCreationErrorZ _res_conv = *(LDKCResult_PrivateRouteCreationErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_NoneSendErrorZ_free(_res_conv); + CResult_PrivateRouteCreationErrorZ_free(_res_conv); +} + +static inline uint64_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 tag_ptr(ret_conv, true); +} +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*)untag_ptr(arg); + int64_t ret_conv = CResult_PrivateRouteCreationErrorZ_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*)untag_ptr(orig); + LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); + *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1u32GraphSyncErrorZ_1ok(JNIEnv *env, jclass clz, int32_t o) { @@ -25131,6 +25841,101 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1OutPointZ_1free(JNIEnv * CVec_OutPointZ_free(_res_constr); } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorUpdateIdZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_MonitorUpdateIdZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMonitorUpdateId), "LDKCVec_MonitorUpdateIdZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t r = 0; r < _res_constr.datalen; r++) { + int64_t _res_conv_17 = _res_vals[r]; + LDKMonitorUpdateId _res_conv_17_conv; + _res_conv_17_conv.inner = untag_ptr(_res_conv_17); + _res_conv_17_conv.is_owned = ptr_is_owned(_res_conv_17); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_17_conv); + _res_constr.data[r] = _res_conv_17_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_MonitorUpdateIdZ_free(_res_constr); +} + +static inline uint64_t C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR arg) { + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); + *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(arg); + return tag_ptr(ret_conv, true); +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* arg_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* orig_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(orig); + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); + *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1new(JNIEnv *env, jclass clz, int64_t a, int64_tArray b) { + LDKOutPoint a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = OutPoint_clone(&a_conv); + LDKCVec_MonitorUpdateIdZ b_constr; + b_constr.datalen = (*env)->GetArrayLength(env, b); + if (b_constr.datalen > 0) + b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKMonitorUpdateId), "LDKCVec_MonitorUpdateIdZ Elements"); + else + b_constr.data = NULL; + int64_t* b_vals = (*env)->GetLongArrayElements (env, b, NULL); + for (size_t r = 0; r < b_constr.datalen; r++) { + int64_t b_conv_17 = b_vals[r]; + LDKMonitorUpdateId b_conv_17_conv; + b_conv_17_conv.inner = untag_ptr(b_conv_17); + b_conv_17_conv.is_owned = ptr_is_owned(b_conv_17); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv_17_conv); + b_conv_17_conv = MonitorUpdateId_clone(&b_conv_17_conv); + b_constr.data[r] = b_conv_17_conv; + } + (*env)->ReleaseLongArrayElements(env, b, b_vals, 0); + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); + *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(a_conv, b_constr); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1free(JNIEnv *env, jclass clz, int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res_conv = *(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(_res_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1OutPointCVec_1MonitorUpdateIdZZZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) { + LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res_constr; + _res_constr.datalen = (*env)->GetArrayLength(env, _res); + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ Elements"); + else + _res_constr.data = NULL; + int64_t* _res_vals = (*env)->GetLongArrayElements (env, _res, NULL); + for (size_t p = 0; p < _res_constr.datalen; p++) { + int64_t _res_conv_41 = _res_vals[p]; + void* _res_conv_41_ptr = untag_ptr(_res_conv_41); + CHECK_ACCESS(_res_conv_41_ptr); + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res_conv_41_conv = *(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)(_res_conv_41_ptr); + FREE(untag_ptr(_res_conv_41)); + _res_constr.data[p] = _res_conv_41_conv; + } + (*env)->ReleaseLongArrayElements(env, _res, _res_vals, 0); + CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(_res_constr); +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -25364,6 +26169,13 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1unknown_1n return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1invalid_1forward(JNIEnv *env, jclass clz, int64_t requested_forward_scid) { + LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); + *ret_copy = HTLCDestination_invalid_forward(requested_forward_scid); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1failed_1payment(JNIEnv *env, jclass clz, int8_tArray payment_hash) { LDKThirtyTwoBytes payment_hash_ref; CHECK((*env)->GetArrayLength(env, payment_hash) == 32); @@ -25429,7 +26241,7 @@ 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, int8_tArray counterparty_node_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, int8_tArray 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); @@ -25440,13 +26252,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1funding_1generation_ output_script_ref.datalen = (*env)->GetArrayLength(env, output_script); output_script_ref.data = MALLOC(output_script_ref.datalen, "LDKCVec_u8Z Bytes"); (*env)->GetByteArrayRegion(env, output_script, 0, output_script_ref.datalen, output_script_ref.data); + LDKU128 user_channel_id_ref; + CHECK((*env)->GetArrayLength(env, user_channel_id) == 16); + (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_funding_generation_ready(temporary_channel_id_ref, counterparty_node_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_ref); int64_t ret_ref = tag_ptr(ret_copy, true); 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) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1claimable(JNIEnv *env, jclass clz, int8_tArray receiver_node_id, int8_tArray payment_hash, int64_t amount_msat, int64_t purpose, int8_tArray via_channel_id, int64_t via_user_channel_id) { + LDKPublicKey receiver_node_id_ref; + CHECK((*env)->GetArrayLength(env, receiver_node_id) == 33); + (*env)->GetByteArrayRegion(env, receiver_node_id, 0, 33, receiver_node_id_ref.compressed_form); LDKThirtyTwoBytes payment_hash_ref; CHECK((*env)->GetArrayLength(env, payment_hash) == 32); (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); @@ -25454,13 +26272,23 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1received(JN CHECK_ACCESS(purpose_ptr); LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr); purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose)); + LDKThirtyTwoBytes via_channel_id_ref; + CHECK((*env)->GetArrayLength(env, via_channel_id) == 32); + (*env)->GetByteArrayRegion(env, via_channel_id, 0, 32, via_channel_id_ref.data); + void* via_user_channel_id_ptr = untag_ptr(via_user_channel_id); + CHECK_ACCESS(via_user_channel_id_ptr); + LDKCOption_u128Z via_user_channel_id_conv = *(LDKCOption_u128Z*)(via_user_channel_id_ptr); + via_user_channel_id_conv = COption_u128Z_clone((LDKCOption_u128Z*)untag_ptr(via_user_channel_id)); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_received(payment_hash_ref, amount_msat, purpose_conv); + *ret_copy = Event_payment_claimable(receiver_node_id_ref, payment_hash_ref, amount_msat, purpose_conv, via_channel_id_ref, via_user_channel_id_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1claimed(JNIEnv *env, jclass clz, int8_tArray payment_hash, int64_t amount_msat, int64_t purpose) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1claimed(JNIEnv *env, jclass clz, int8_tArray receiver_node_id, int8_tArray payment_hash, int64_t amount_msat, int64_t purpose) { + LDKPublicKey receiver_node_id_ref; + CHECK((*env)->GetArrayLength(env, receiver_node_id) == 33); + (*env)->GetByteArrayRegion(env, receiver_node_id, 0, 33, receiver_node_id_ref.compressed_form); LDKThirtyTwoBytes payment_hash_ref; CHECK((*env)->GetArrayLength(env, payment_hash) == 32); (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); @@ -25469,7 +26297,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1claimed(JNI LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr); purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose)); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_payment_claimed(payment_hash_ref, amount_msat, purpose_conv); + *ret_copy = Event_payment_claimed(receiver_node_id_ref, payment_hash_ref, amount_msat, purpose_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -25651,6 +26479,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1pending_1htlcs_1forw return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1htlcintercepted(JNIEnv *env, jclass clz, int8_tArray intercept_id, int64_t requested_next_hop_scid, int8_tArray payment_hash, int64_t inbound_amount_msat, int64_t expected_outbound_amount_msat) { + LDKThirtyTwoBytes intercept_id_ref; + CHECK((*env)->GetArrayLength(env, intercept_id) == 32); + (*env)->GetByteArrayRegion(env, intercept_id, 0, 32, intercept_id_ref.data); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_htlcintercepted(intercept_id_ref, requested_next_hop_scid, payment_hash_ref, inbound_amount_msat, expected_outbound_amount_msat); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1spendable_1outputs(JNIEnv *env, jclass clz, int64_tArray outputs) { LDKCVec_SpendableOutputDescriptorZ outputs_constr; outputs_constr.datalen = (*env)->GetArrayLength(env, outputs); @@ -25691,16 +26532,40 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1forwarded(J return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1channel_1closed(JNIEnv *env, jclass clz, int8_tArray channel_id, int64_t user_channel_id, int64_t reason) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1channel_1ready(JNIEnv *env, jclass clz, int8_tArray channel_id, int8_tArray user_channel_id, int8_tArray counterparty_node_id, int64_t channel_type) { + LDKThirtyTwoBytes channel_id_ref; + CHECK((*env)->GetArrayLength(env, channel_id) == 32); + (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_ref.data); + LDKU128 user_channel_id_ref; + CHECK((*env)->GetArrayLength(env, user_channel_id) == 16); + (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes); + LDKPublicKey counterparty_node_id_ref; + CHECK((*env)->GetArrayLength(env, counterparty_node_id) == 33); + (*env)->GetByteArrayRegion(env, counterparty_node_id, 0, 33, counterparty_node_id_ref.compressed_form); + LDKChannelTypeFeatures channel_type_conv; + channel_type_conv.inner = untag_ptr(channel_type); + channel_type_conv.is_owned = ptr_is_owned(channel_type); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_conv); + channel_type_conv = ChannelTypeFeatures_clone(&channel_type_conv); + LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); + *ret_copy = Event_channel_ready(channel_id_ref, user_channel_id_ref, counterparty_node_id_ref, channel_type_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1channel_1closed(JNIEnv *env, jclass clz, int8_tArray channel_id, int8_tArray user_channel_id, int64_t reason) { LDKThirtyTwoBytes channel_id_ref; CHECK((*env)->GetArrayLength(env, channel_id) == 32); (*env)->GetByteArrayRegion(env, channel_id, 0, 32, channel_id_ref.data); + LDKU128 user_channel_id_ref; + CHECK((*env)->GetArrayLength(env, user_channel_id) == 16); + (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes); void* reason_ptr = untag_ptr(reason); CHECK_ACCESS(reason_ptr); LDKClosureReason reason_conv = *(LDKClosureReason*)(reason_ptr); reason_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(reason)); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_channel_closed(channel_id_ref, user_channel_id, reason_conv); + *ret_copy = Event_channel_closed(channel_id_ref, user_channel_id_ref, reason_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -26184,10 +27049,10 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1fee_1rate_1too_1h return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1route_1error(JNIEnv *env, jclass clz, jstring err) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1invalid_1route(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); + *ret_copy = APIError_invalid_route(err_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -26366,17 +27231,17 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_construct_1invoice_1pre 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; + 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"); + 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 }; + 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); @@ -26396,6 +27261,45 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Persister_1free(JNIEnv *env, j Persister_free(this_ptr_conv); } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrintableString_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKPrintableString this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + PrintableString_free(this_obj_conv); +} + +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_PrintableString_1get_1a(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKPrintableString this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKStr ret_str = PrintableString_get_a(&this_ptr_conv); + jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrintableString_1set_1a(JNIEnv *env, jclass clz, int64_t this_ptr, jstring val) { + LDKPrintableString this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKStr val_conv = java_to_owned_str(env, val); + PrintableString_set_a(&this_ptr_conv, val_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PrintableString_1new(JNIEnv *env, jclass clz, jstring a_arg) { + LDKStr a_arg_conv = java_to_owned_str(env, a_arg); + LDKPrintableString ret_var = PrintableString_new(a_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FutureCallback_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -27418,7 +28322,26 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1manually_1acc 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 channel_handshake_config_arg, int64_t channel_handshake_limits_arg, int64_t channel_config_arg, jboolean accept_forwards_to_priv_channels_arg, jboolean accept_inbound_channels_arg, jboolean manually_accept_inbound_channels_arg) { +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1accept_1intercept_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + jboolean ret_conv = UserConfig_get_accept_intercept_htlcs(&this_ptr_conv); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1intercept_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, jboolean val) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + UserConfig_set_accept_intercept_htlcs(&this_ptr_conv, val); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1new(JNIEnv *env, jclass clz, int64_t channel_handshake_config_arg, int64_t channel_handshake_limits_arg, int64_t channel_config_arg, jboolean accept_forwards_to_priv_channels_arg, jboolean accept_inbound_channels_arg, jboolean manually_accept_inbound_channels_arg, jboolean accept_intercept_htlcs_arg) { LDKChannelHandshakeConfig channel_handshake_config_arg_conv; channel_handshake_config_arg_conv.inner = untag_ptr(channel_handshake_config_arg); channel_handshake_config_arg_conv.is_owned = ptr_is_owned(channel_handshake_config_arg); @@ -27434,7 +28357,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_UserConfig_1new(JNIEnv *env channel_config_arg_conv.is_owned = ptr_is_owned(channel_config_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_config_arg_conv); channel_config_arg_conv = ChannelConfig_clone(&channel_config_arg_conv); - LDKUserConfig ret_var = UserConfig_new(channel_handshake_config_arg_conv, channel_handshake_limits_arg_conv, channel_config_arg_conv, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg, manually_accept_inbound_channels_arg); + LDKUserConfig ret_var = UserConfig_new(channel_handshake_config_arg_conv, channel_handshake_limits_arg_conv, channel_config_arg_conv, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg, manually_accept_inbound_channels_arg, accept_intercept_htlcs_arg); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -27850,6 +28773,12 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1high_1pr return ret_conv; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1hash(JNIEnv *env, jclass clz, int64_t o) { + LDKConfirmationTarget* o_conv = (LDKConfirmationTarget*)untag_ptr(o); + int64_t ret_conv = ConfirmationTarget_hash(o_conv); + 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*)untag_ptr(a); LDKConfirmationTarget* b_conv = (LDKConfirmationTarget*)untag_ptr(b); @@ -28077,6 +29006,26 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1list_1mo return ret_arr; } +JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1list_1pending_1monitor_1updates(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChainMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ret_var = ChainMonitor_list_pending_monitor_updates(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = (*env)->NewLongArray(env, ret_var.datalen); + int64_t *ret_arr_ptr = (*env)->GetPrimitiveArrayCritical(env, ret_arr, NULL); + for (size_t p = 0; p < ret_var.datalen; p++) { + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv_41_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); + *ret_conv_41_conv = ret_var.data[p]; + ret_arr_ptr[p] = tag_ptr(ret_conv_41_conv, true); + } + (*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 = untag_ptr(this_arg); @@ -28925,22 +29874,22 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1best_1 return ret_arr; } -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1relevant_1txids(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT int64_tArray 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 = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_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); + LDKCVec_C2Tuple_TxidBlockHashZZ ret_var = ChannelMonitor_get_relevant_txids(&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 z = 0; z < ret_var.datalen; z++) { + LDKC2Tuple_TxidBlockHashZ* ret_conv_25_conv = MALLOC(sizeof(LDKC2Tuple_TxidBlockHashZ), "LDKC2Tuple_TxidBlockHashZ"); + *ret_conv_25_conv = ret_var.data[z]; + ret_arr_ptr[z] = tag_ptr(ret_conv_25_conv, true); } - + (*env)->ReleasePrimitiveArrayCritical(env, ret_arr, ret_arr_ptr, 0); FREE(ret_var.data); return ret_arr; } @@ -30976,23 +31925,27 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1unspendab 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) { +JNIEXPORT int8_tArray 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 = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelDetails_get_user_channel_id(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = (*env)->NewByteArray(env, 16); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 16, ChannelDetails_get_user_channel_id(&this_ptr_conv).le_bytes); + return ret_arr; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1user_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1user_1channel_1id(JNIEnv *env, jclass clz, int64_t this_ptr, int8_tArray val) { LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelDetails_set_user_channel_id(&this_ptr_conv, val); + LDKU128 val_ref; + CHECK((*env)->GetArrayLength(env, val) == 16); + (*env)->GetByteArrayRegion(env, val, 0, 16, val_ref.le_bytes); + ChannelDetails_set_user_channel_id(&this_ptr_conv, val_ref); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1balance_1msat(JNIEnv *env, jclass clz, int64_t this_ptr) { @@ -31096,6 +32049,31 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1confirmat ChannelDetails_set_confirmations_required(&this_ptr_conv, val_conv); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1confirmations(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = ChannelDetails_get_confirmations(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1confirmations(JNIEnv *env, jclass clz, int64_t this_ptr, int64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); + val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val)); + ChannelDetails_set_confirmations(&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 = untag_ptr(this_ptr); @@ -31274,7 +32252,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1config(JN ChannelDetails_set_config(&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 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, int64_t config_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, int8_tArray 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 confirmations_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, int64_t config_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); @@ -31308,10 +32286,17 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv void* unspendable_punishment_reserve_arg_ptr = untag_ptr(unspendable_punishment_reserve_arg); CHECK_ACCESS(unspendable_punishment_reserve_arg_ptr); LDKCOption_u64Z unspendable_punishment_reserve_arg_conv = *(LDKCOption_u64Z*)(unspendable_punishment_reserve_arg_ptr); + LDKU128 user_channel_id_arg_ref; + CHECK((*env)->GetArrayLength(env, user_channel_id_arg) == 16); + (*env)->GetByteArrayRegion(env, user_channel_id_arg, 0, 16, user_channel_id_arg_ref.le_bytes); void* confirmations_required_arg_ptr = untag_ptr(confirmations_required_arg); 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*)untag_ptr(confirmations_required_arg)); + void* confirmations_arg_ptr = untag_ptr(confirmations_arg); + CHECK_ACCESS(confirmations_arg_ptr); + LDKCOption_u32Z confirmations_arg_conv = *(LDKCOption_u32Z*)(confirmations_arg_ptr); + confirmations_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(confirmations_arg)); void* force_close_spend_delay_arg_ptr = untag_ptr(force_close_spend_delay_arg); CHECK_ACCESS(force_close_spend_delay_arg_ptr); LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(force_close_spend_delay_arg_ptr); @@ -31329,7 +32314,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1new(JNIEnv config_arg_conv.is_owned = ptr_is_owned(config_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(config_arg_conv); config_arg_conv = ChannelConfig_clone(&config_arg_conv); - 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, config_arg_conv); + 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_ref, balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg_conv, confirmations_arg_conv, force_close_spend_delay_arg_conv, is_outbound_arg, is_channel_ready_arg, is_usable_arg, is_public_arg, inbound_htlc_minimum_msat_arg_conv, inbound_htlc_maximum_msat_arg_conv, config_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -31453,7 +32438,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1path_1p return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1all_1failed_1retry_1safe(JNIEnv *env, jclass clz, int64_tArray a) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1all_1failed_1resend_1safe(JNIEnv *env, jclass clz, int64_tArray a) { LDKCVec_APIErrorZ a_constr; a_constr.datalen = (*env)->GetArrayLength(env, a); if (a_constr.datalen > 0) @@ -31471,7 +32456,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1all_1fa } (*env)->ReleaseLongArrayElements(env, a, a_vals, 0); LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); - *ret_copy = PaymentSendFailure_all_failed_retry_safe(a_constr); + *ret_copy = PaymentSendFailure_all_failed_resend_safe(a_constr); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1duplicate_1payment(JNIEnv *env, jclass clz) { + LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure"); + *ret_copy = PaymentSendFailure_duplicate_payment(); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -31728,7 +32720,7 @@ 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) { +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, int8_tArray user_channel_id, int64_t override_config) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -31737,13 +32729,16 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1cha 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); + LDKU128 user_channel_id_ref; + CHECK((*env)->GetArrayLength(env, user_channel_id) == 16); + (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes); LDKUserConfig override_config_conv; override_config_conv.inner = untag_ptr(override_config); override_config_conv.is_owned = ptr_is_owned(override_config); 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); + *ret_conv = ChannelManager_create_channel(&this_arg_conv, their_network_key_ref, channel_value_satoshis, push_msat, user_channel_id_ref, override_config_conv); return tag_ptr(ret_conv, true); } @@ -31881,7 +32876,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1 ChannelManager_force_close_all_channels_without_broadcasting_txn(&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) { +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, int8_tArray payment_id) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -31898,8 +32893,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payme 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); + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ"); + *ret_conv = ChannelManager_send_payment(&this_arg_conv, &route_conv, payment_hash_ref, payment_secret_ref, payment_id_ref); return tag_ptr(ret_conv, true); } @@ -31934,7 +32932,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1abandon_1payme ChannelManager_abandon_payment(&this_arg_conv, payment_id_ref); } -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) { +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, int8_tArray payment_id) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -31948,8 +32946,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1spont 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); + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKCResult_PaymentHashPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashPaymentSendFailureZ), "LDKCResult_PaymentHashPaymentSendFailureZ"); + *ret_conv = ChannelManager_send_spontaneous_payment(&this_arg_conv, &route_conv, payment_preimage_ref, payment_id_ref); return tag_ptr(ret_conv, true); } @@ -32036,6 +33037,41 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1update_1cha return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1forward_1intercepted_1htlc(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray intercept_id, int8_tArray next_hop_channel_id, int8_tArray _next_node_id, int64_t amt_to_forward_msat) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKThirtyTwoBytes intercept_id_ref; + CHECK((*env)->GetArrayLength(env, intercept_id) == 32); + (*env)->GetByteArrayRegion(env, intercept_id, 0, 32, intercept_id_ref.data); + unsigned char next_hop_channel_id_arr[32]; + CHECK((*env)->GetArrayLength(env, next_hop_channel_id) == 32); + (*env)->GetByteArrayRegion(env, next_hop_channel_id, 0, 32, next_hop_channel_id_arr); + unsigned char (*next_hop_channel_id_ref)[32] = &next_hop_channel_id_arr; + LDKPublicKey _next_node_id_ref; + CHECK((*env)->GetArrayLength(env, _next_node_id) == 33); + (*env)->GetByteArrayRegion(env, _next_node_id, 0, 33, _next_node_id_ref.compressed_form); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_forward_intercepted_htlc(&this_arg_conv, intercept_id_ref, next_hop_channel_id_ref, _next_node_id_ref, amt_to_forward_msat); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1fail_1intercepted_1htlc(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray intercept_id) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKThirtyTwoBytes intercept_id_ref; + CHECK((*env)->GetArrayLength(env, intercept_id) == 32); + (*env)->GetByteArrayRegion(env, intercept_id, 0, 32, intercept_id_ref.data); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_fail_intercepted_htlc(&this_arg_conv, intercept_id_ref); + return tag_ptr(ret_conv, true); +} + 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 = untag_ptr(this_arg); @@ -32090,7 +33126,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1ou 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) { +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, int8_tArray user_channel_id) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -32103,12 +33139,15 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1accept_1inb 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); + LDKU128 user_channel_id_ref; + CHECK((*env)->GetArrayLength(env, user_channel_id) == 16); + (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes); 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); + *ret_conv = ChannelManager_accept_inbound_channel(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, user_channel_id_ref); return tag_ptr(ret_conv, true); } -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) { +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, int8_tArray user_channel_id) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -32121,8 +33160,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1accept_1inb 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); + LDKU128 user_channel_id_ref; + CHECK((*env)->GetArrayLength(env, user_channel_id) == 16); + (*env)->GetByteArrayRegion(env, user_channel_id, 0, 16, user_channel_id_ref.le_bytes); 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); + *ret_conv = ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, user_channel_id_ref); return tag_ptr(ret_conv, true); } @@ -32232,6 +33274,29 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1phanto return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1intercept_1scid(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int64_t ret_conv = ChannelManager_get_intercept_scid(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1compute_1inflight_1htlcs(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKInFlightHtlcs ret_var = ChannelManager_compute_inflight_htlcs(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t this_arg) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -40270,6 +41335,56 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_htlc_1timeout_1tx_1weight(J return ret_conv; } +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKHTLCClaim* orig_conv = (LDKHTLCClaim*)untag_ptr(orig); + jclass ret_conv = LDKHTLCClaim_to_java(env, HTLCClaim_clone(orig_conv)); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1offered_1timeout(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKHTLCClaim_to_java(env, HTLCClaim_offered_timeout()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1offered_1preimage(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKHTLCClaim_to_java(env, HTLCClaim_offered_preimage()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1accepted_1timeout(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKHTLCClaim_to_java(env, HTLCClaim_accepted_timeout()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1accepted_1preimage(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKHTLCClaim_to_java(env, HTLCClaim_accepted_preimage()); + return ret_conv; +} + +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1revocation(JNIEnv *env, jclass clz) { + jclass ret_conv = LDKHTLCClaim_to_java(env, HTLCClaim_revocation()); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKHTLCClaim* a_conv = (LDKHTLCClaim*)untag_ptr(a); + LDKHTLCClaim* b_conv = (LDKHTLCClaim*)untag_ptr(b); + jboolean ret_conv = HTLCClaim_eq(a_conv, b_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1from_1witness(JNIEnv *env, jclass clz, int8_tArray witness) { + LDKWitness witness_ref; + witness_ref.datalen = (*env)->GetArrayLength(env, witness); + witness_ref.data = MALLOC(witness_ref.datalen, "LDKWitness Bytes"); + (*env)->GetByteArrayRegion(env, witness, 0, witness_ref.datalen, witness_ref.data); + witness_ref.data_is_owned = true; + LDKCOption_HTLCClaimZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCClaimZ), "LDKCOption_HTLCClaimZ"); + *ret_copy = HTLCClaim_from_witness(witness_ref); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + 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); @@ -40405,7 +41520,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecre return tag_ptr(ret_conv, true); } -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) { +JNIEXPORT int8_tArray 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); @@ -40413,24 +41528,24 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_derive_1private_1key(JNIEnv 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 tag_ptr(ret_conv, true); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, derive_private_key(per_commitment_point_ref, base_secret_ref).bytes); + return ret_arr; } -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) { +JNIEXPORT int8_tArray 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 tag_ptr(ret_conv, true); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, derive_public_key(per_commitment_point_ref, base_point_ref).compressed_form); + 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) { +JNIEXPORT int8_tArray 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); @@ -40439,21 +41554,21 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_derive_1private_1revocation 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 tag_ptr(ret_conv, true); + int8_tArray ret_arr = (*env)->NewByteArray(env, 32); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 32, derive_private_revocation_key(per_commitment_secret_ref, countersignatory_revocation_base_secret_ref).bytes); + return ret_arr; } -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) { +JNIEXPORT int8_tArray 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 tag_ptr(ret_conv, true); + int8_tArray ret_arr = (*env)->NewByteArray(env, 33); + (*env)->SetByteArrayRegion(env, ret_arr, 0, 33, derive_public_revocation_key(per_commitment_point_ref, countersignatory_revocation_base_point_ref).compressed_form); + return ret_arr; } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1free(JNIEnv *env, jclass clz, int64_t this_obj) { @@ -40900,9 +42015,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1derive_1new 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 tag_ptr(ret_conv, true); + LDKTxCreationKeys ret_var = TxCreationKeys_derive_new(per_commitment_point_ref, broadcaster_delayed_payment_base_ref, broadcaster_htlc_base_ref, countersignatory_revocation_base_ref, countersignatory_htlc_base_ref); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1from_1channel_1static_1keys(JNIEnv *env, jclass clz, int8_tArray per_commitment_point, int64_t broadcaster_keys, int64_t countersignatory_keys) { @@ -40919,9 +42036,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1from_1chann countersignatory_keys_conv.is_owned = ptr_is_owned(countersignatory_keys); CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv); countersignatory_keys_conv.is_owned = false; - 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 tag_ptr(ret_conv, true); + LDKTxCreationKeys ret_var = TxCreationKeys_from_channel_static_keys(per_commitment_point_ref, &broadcaster_keys_conv, &countersignatory_keys_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1revokeable_1redeemscript(JNIEnv *env, jclass clz, int8_tArray revocation_key, int16_t contest_delay, int8_tArray broadcaster_delayed_payment_key) { @@ -41166,7 +42285,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_make_1funding_1redeemsc return ret_arr; } -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) { +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, jboolean use_non_zero_fee_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); @@ -41182,13 +42301,45 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1htlc_1transactio 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); + LDKTransaction ret_var = build_htlc_transaction(commitment_txid_ref, feerate_per_kw, contest_delay, &htlc_conv, opt_anchors, use_non_zero_fee_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 int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1htlc_1input_1witness(JNIEnv *env, jclass clz, int8_tArray local_sig, int8_tArray remote_sig, int8_tArray preimage, int8_tArray redeem_script, jboolean opt_anchors) { + LDKSignature local_sig_ref; + CHECK((*env)->GetArrayLength(env, local_sig) == 64); + (*env)->GetByteArrayRegion(env, local_sig, 0, 64, local_sig_ref.compact_form); + LDKSignature remote_sig_ref; + CHECK((*env)->GetArrayLength(env, remote_sig) == 64); + (*env)->GetByteArrayRegion(env, remote_sig, 0, 64, remote_sig_ref.compact_form); + LDKThirtyTwoBytes preimage_ref; + CHECK((*env)->GetArrayLength(env, preimage) == 32); + (*env)->GetByteArrayRegion(env, preimage, 0, 32, preimage_ref.data); + LDKu8slice redeem_script_ref; + redeem_script_ref.datalen = (*env)->GetArrayLength(env, redeem_script); + redeem_script_ref.data = (*env)->GetByteArrayElements (env, redeem_script, NULL); + LDKWitness ret_var = build_htlc_input_witness(local_sig_ref, remote_sig_ref, preimage_ref, redeem_script_ref, opt_anchors); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + Witness_free(ret_var); + (*env)->ReleaseByteArrayElements(env, redeem_script, (int8_t*)redeem_script_ref.data, 0); + return ret_arr; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1to_1countersignatory_1with_1anchors_1redeemscript(JNIEnv *env, jclass clz, int8_tArray payment_point) { + LDKPublicKey payment_point_ref; + CHECK((*env)->GetArrayLength(env, payment_point) == 33); + (*env)->GetByteArrayRegion(env, payment_point, 0, 33, payment_point_ref.compressed_form); + LDKCVec_u8Z ret_var = get_to_countersignatory_with_anchors_redeemscript(payment_point_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 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); @@ -41200,6 +42351,20 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1anchor_1redeemscri return ret_arr; } +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1anchor_1input_1witness(JNIEnv *env, jclass clz, int8_tArray funding_key, int8_tArray funding_sig) { + LDKPublicKey funding_key_ref; + CHECK((*env)->GetArrayLength(env, funding_key) == 33); + (*env)->GetByteArrayRegion(env, funding_key, 0, 33, funding_key_ref.compressed_form); + LDKSignature funding_sig_ref; + CHECK((*env)->GetArrayLength(env, funding_sig) == 64); + (*env)->GetByteArrayRegion(env, funding_sig, 0, 64, funding_sig_ref.compact_form); + LDKWitness ret_var = build_anchor_input_witness(funding_key_ref, funding_sig_ref); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + Witness_free(ret_var); + return ret_arr; +} + JNIEXPORT 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 = untag_ptr(this_obj); @@ -41347,7 +42512,27 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1 ChannelTransactionParameters_set_opt_anchors(&this_ptr_conv, val_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) { +JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1opt_1non_1zero_1fee_1anchors(JNIEnv *env, jclass clz, int64_t this_ptr) { + LDKChannelTransactionParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + jclass ret_conv = LDKCOption_NoneZ_to_java(env, ChannelTransactionParameters_get_opt_non_zero_fee_anchors(&this_ptr_conv)); + return ret_conv; +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1opt_1non_1zero_1fee_1anchors(JNIEnv *env, jclass clz, int64_t this_ptr, jclass val) { + LDKChannelTransactionParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_java(env, val); + ChannelTransactionParameters_set_opt_non_zero_fee_anchors(&this_ptr_conv, val_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, jclass opt_non_zero_fee_anchors_arg) { LDKChannelPublicKeys holder_pubkeys_arg_conv; holder_pubkeys_arg_conv.inner = untag_ptr(holder_pubkeys_arg); holder_pubkeys_arg_conv.is_owned = ptr_is_owned(holder_pubkeys_arg); @@ -41364,7 +42549,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter 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); + LDKCOption_NoneZ opt_non_zero_fee_anchors_arg_conv = LDKCOption_NoneZ_from_java(env, opt_non_zero_fee_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, opt_non_zero_fee_anchors_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -42477,6 +43663,36 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1eq(JNIEnv return ret_conv; } +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKOfferFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKOfferFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = OfferFeatures_eq(&a_conv, &b_conv); + return ret_conv; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { + LDKInvoiceRequestFeatures a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKInvoiceRequestFeatures b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = InvoiceRequestFeatures_eq(&a_conv, &b_conv); + return ret_conv; +} + JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { LDKChannelTypeFeatures a_conv; a_conv.inner = untag_ptr(a); @@ -42612,6 +43828,66 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1clone(JNIE return ret_ref; } +static inline uint64_t OfferFeatures_clone_ptr(LDKOfferFeatures *NONNULL_PTR arg) { + LDKOfferFeatures ret_var = OfferFeatures_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKOfferFeatures arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = OfferFeatures_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKOfferFeatures orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKOfferFeatures ret_var = OfferFeatures_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline uint64_t InvoiceRequestFeatures_clone_ptr(LDKInvoiceRequestFeatures *NONNULL_PTR arg) { + LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInvoiceRequestFeatures arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = InvoiceRequestFeatures_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKInvoiceRequestFeatures orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + static inline uint64_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg) { LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(arg); int64_t ret_ref = 0; @@ -42674,6 +43950,22 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1free(JNIEnv * InvoiceFeatures_free(this_obj_conv); } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKOfferFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OfferFeatures_free(this_obj_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInvoiceRequestFeatures this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InvoiceRequestFeatures_free(this_obj_conv); +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1free(JNIEnv *env, jclass clz, int64_t this_obj) { LDKChannelTypeFeatures this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -42754,6 +44046,42 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_ return ret_conv; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1empty(JNIEnv *env, jclass clz) { + LDKOfferFeatures ret_var = OfferFeatures_empty(); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKOfferFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = OfferFeatures_requires_unknown_bits(&this_arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1empty(JNIEnv *env, jclass clz) { + LDKInvoiceRequestFeatures ret_var = InvoiceRequestFeatures_empty(); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1requires_1unknown_1bits(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKInvoiceRequestFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + jboolean ret_conv = InvoiceRequestFeatures_requires_unknown_bits(&this_arg_conv); + return ret_conv; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1empty(JNIEnv *env, jclass clz) { LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_empty(); int64_t ret_ref = 0; @@ -42887,6 +44215,52 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1read(J return tag_ptr(ret_conv, true); } +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKOfferFeatures obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = OfferFeatures_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_OfferFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferFeaturesDecodeErrorZ), "LDKCResult_OfferFeaturesDecodeErrorZ"); + *ret_conv = OfferFeatures_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKInvoiceRequestFeatures obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = InvoiceRequestFeatures_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_InvoiceRequestFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestFeaturesDecodeErrorZ), "LDKCResult_InvoiceRequestFeaturesDecodeErrorZ"); + *ret_conv = InvoiceRequestFeatures_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1set_1data_1loss_1protect_1optional(JNIEnv *env, jclass clz, int64_t this_arg) { LDKInitFeatures this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -44687,15 +46061,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1add_1chain_1acc P2PGossipSync_add_chain_access(&this_arg_conv, chain_access_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1as_1EventHandler(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1handle_1network_1update(JNIEnv *env, jclass clz, int64_t this_arg, int64_t network_update) { LDKNetworkGraph this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler"); - *ret_ret = NetworkGraph_as_EventHandler(&this_arg_conv); - return tag_ptr(ret_ret, true); + LDKNetworkUpdate* network_update_conv = (LDKNetworkUpdate*)untag_ptr(network_update); + NetworkGraph_handle_network_update(&this_arg_conv, network_update_conv); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1as_1RoutingMessageHandler(JNIEnv *env, jclass clz, int64_t this_arg) { @@ -45290,19 +46663,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1channe return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1direction(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKDirectedChannelInfo this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelUpdateInfo ret_var = DirectedChannelInfo_direction(&this_arg_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1htlc_1maximum_1msat(JNIEnv *env, jclass clz, int64_t this_arg) { LDKDirectedChannelInfo this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -45369,12 +46729,8 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1maximum_ } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_EffectiveCapacity_1total(JNIEnv *env, jclass clz, int64_t capacity_msat, int64_t htlc_maximum_msat) { - void* htlc_maximum_msat_ptr = untag_ptr(htlc_maximum_msat); - CHECK_ACCESS(htlc_maximum_msat_ptr); - LDKCOption_u64Z htlc_maximum_msat_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_ptr); - htlc_maximum_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_maximum_msat)); LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity"); - *ret_copy = EffectiveCapacity_total(capacity_msat, htlc_maximum_msat_conv); + *ret_copy = EffectiveCapacity_total(capacity_msat, htlc_maximum_msat); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -46475,6 +47831,207 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1get_1 return ret_ref; } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKDefaultRouter this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + DefaultRouter_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1new(JNIEnv *env, jclass clz, int64_t network_graph, int64_t logger, int8_tArray random_seed_bytes, int64_t scorer) { + LDKNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (logger_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&logger_conv); + } + LDKThirtyTwoBytes random_seed_bytes_ref; + CHECK((*env)->GetArrayLength(env, random_seed_bytes) == 32); + (*env)->GetByteArrayRegion(env, random_seed_bytes, 0, 32, random_seed_bytes_ref.data); + void* scorer_ptr = untag_ptr(scorer); + CHECK_ACCESS(scorer_ptr); + LDKLockableScore scorer_conv = *(LDKLockableScore*)(scorer_ptr); + if (scorer_conv.free == LDKLockableScore_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLockableScore_JCalls_cloned(&scorer_conv); + } + LDKDefaultRouter ret_var = DefaultRouter_new(&network_graph_conv, logger_conv, random_seed_bytes_ref, scorer_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1as_1Router(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKDefaultRouter this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKRouter* ret_ret = MALLOC(sizeof(LDKRouter), "LDKRouter"); + *ret_ret = DefaultRouter_as_Router(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKRouter this_ptr_conv = *(LDKRouter*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Router_free(this_ptr_conv); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKScorerAccountingForInFlightHtlcs this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ScorerAccountingForInFlightHtlcs_free(this_obj_conv); +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1new(JNIEnv *env, jclass clz, int64_t scorer, int64_t inflight_htlcs) { + void* scorer_ptr = untag_ptr(scorer); + CHECK_ACCESS(scorer_ptr); + LDKScore scorer_conv = *(LDKScore*)(scorer_ptr); + if (scorer_conv.free == LDKScore_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKScore_JCalls_cloned(&scorer_conv); + } + LDKInFlightHtlcs inflight_htlcs_conv; + inflight_htlcs_conv.inner = untag_ptr(inflight_htlcs); + inflight_htlcs_conv.is_owned = ptr_is_owned(inflight_htlcs); + CHECK_INNER_FIELD_ACCESS_OR_NULL(inflight_htlcs_conv); + inflight_htlcs_conv = InFlightHtlcs_clone(&inflight_htlcs_conv); + LDKScorerAccountingForInFlightHtlcs ret_var = ScorerAccountingForInFlightHtlcs_new(scorer_conv, inflight_htlcs_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKScorerAccountingForInFlightHtlcs obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = ScorerAccountingForInFlightHtlcs_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1as_1Score(JNIEnv *env, jclass clz, int64_t this_arg) { + LDKScorerAccountingForInFlightHtlcs this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore"); + *ret_ret = ScorerAccountingForInFlightHtlcs_as_Score(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKInFlightHtlcs this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + InFlightHtlcs_free(this_obj_conv); +} + +static inline uint64_t InFlightHtlcs_clone_ptr(LDKInFlightHtlcs *NONNULL_PTR arg) { + LDKInFlightHtlcs ret_var = InFlightHtlcs_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKInFlightHtlcs arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = InFlightHtlcs_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKInFlightHtlcs orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKInFlightHtlcs ret_var = InFlightHtlcs_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1new(JNIEnv *env, jclass clz) { + LDKInFlightHtlcs ret_var = InFlightHtlcs_new(); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1used_1liquidity_1msat(JNIEnv *env, jclass clz, int64_t this_arg, int64_t source, int64_t target, int64_t channel_scid) { + LDKInFlightHtlcs this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeId source_conv; + source_conv.inner = untag_ptr(source); + source_conv.is_owned = ptr_is_owned(source); + CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv); + source_conv.is_owned = false; + LDKNodeId target_conv; + target_conv.inner = untag_ptr(target); + target_conv.is_owned = ptr_is_owned(target); + CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); + target_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = InFlightHtlcs_used_liquidity_msat(&this_arg_conv, &source_conv, &target_conv, channel_scid); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKInFlightHtlcs obj_conv; + obj_conv.inner = untag_ptr(obj); + obj_conv.is_owned = ptr_is_owned(obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); + obj_conv.is_owned = false; + LDKCVec_u8Z ret_var = InFlightHtlcs_write(&obj_conv); + int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); + (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); + CVec_u8Z_free(ret_var); + return ret_arr; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1read(JNIEnv *env, jclass clz, int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = (*env)->GetArrayLength(env, ser); + ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); + LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ"); + *ret_conv = InFlightHtlcs_read(ser_ref); + (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); + return tag_ptr(ret_conv, true); +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1free(JNIEnv *env, jclass clz, int64_t this_obj) { LDKRouteHop this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -48724,12 +50281,42 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1read(J return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedRoute_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKBlindedRoute this_obj_conv; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPath_1free(JNIEnv *env, jclass clz, int64_t this_obj) { + LDKBlindedPath this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BlindedRoute_free(this_obj_conv); + BlindedPath_free(this_obj_conv); +} + +static inline uint64_t BlindedPath_clone_ptr(LDKBlindedPath *NONNULL_PTR arg) { + LDKBlindedPath ret_var = BlindedPath_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBlindedPath arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = BlindedPath_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBlindedPath orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKBlindedPath ret_var = BlindedPath_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedHop_1free(JNIEnv *env, jclass clz, int64_t this_obj) { @@ -48740,7 +50327,37 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedHop_1free(JNIEnv *env, BlindedHop_free(this_obj_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedRoute_1new(JNIEnv *env, jclass clz, jobjectArray node_pks, int64_t keys_manager) { +static inline uint64_t BlindedHop_clone_ptr(LDKBlindedHop *NONNULL_PTR arg) { + LDKBlindedHop ret_var = BlindedHop_clone(arg); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHop_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKBlindedHop arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + arg_conv.is_owned = false; + int64_t ret_conv = BlindedHop_clone_ptr(&arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedHop_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKBlindedHop orig_conv; + orig_conv.inner = untag_ptr(orig); + orig_conv.is_owned = ptr_is_owned(orig); + CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv); + orig_conv.is_owned = false; + LDKBlindedHop ret_var = BlindedHop_clone(&orig_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1new(JNIEnv *env, jclass clz, jobjectArray node_pks, int64_t keys_manager) { LDKCVec_PublicKeyZ node_pks_constr; node_pks_constr.datalen = (*env)->GetArrayLength(env, node_pks); if (node_pks_constr.datalen > 0) @@ -48757,30 +50374,30 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedRoute_1new(JNIEnv *e void* keys_manager_ptr = untag_ptr(keys_manager); if (ptr_is_owned(keys_manager)) { CHECK_ACCESS(keys_manager_ptr); } LDKKeysInterface* keys_manager_conv = (LDKKeysInterface*)keys_manager_ptr; - LDKCResult_BlindedRouteNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedRouteNoneZ), "LDKCResult_BlindedRouteNoneZ"); - *ret_conv = BlindedRoute_new(node_pks_constr, keys_manager_conv); + LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); + *ret_conv = BlindedPath_new(node_pks_constr, keys_manager_conv); return tag_ptr(ret_conv, true); } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedRoute_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKBlindedRoute obj_conv; +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_BlindedPath_1write(JNIEnv *env, jclass clz, int64_t obj) { + LDKBlindedPath obj_conv; obj_conv.inner = untag_ptr(obj); obj_conv.is_owned = ptr_is_owned(obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = BlindedRoute_write(&obj_conv); + LDKCVec_u8Z ret_var = BlindedPath_write(&obj_conv); int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); CVec_u8Z_free(ret_var); return ret_arr; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedRoute_1read(JNIEnv *env, jclass clz, int8_tArray ser) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BlindedPath_1read(JNIEnv *env, jclass clz, int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = (*env)->GetArrayLength(env, ser); ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_BlindedRouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedRouteDecodeErrorZ), "LDKCResult_BlindedRouteDecodeErrorZ"); - *ret_conv = BlindedRoute_read(ser_ref); + LDKCResult_BlindedPathDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathDecodeErrorZ), "LDKCResult_BlindedPathDecodeErrorZ"); + *ret_conv = BlindedPath_read(ser_ref); (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); return tag_ptr(ret_conv, true); } @@ -48825,6 +50442,26 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Destination_1free(JNIEnv *env, Destination_free(this_ptr_conv); } +static inline uint64_t Destination_clone_ptr(LDKDestination *NONNULL_PTR arg) { + LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); + *ret_copy = Destination_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKDestination* arg_conv = (LDKDestination*)untag_ptr(arg); + int64_t ret_conv = Destination_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKDestination* orig_conv = (LDKDestination*)untag_ptr(orig); + LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); + *ret_copy = Destination_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1node(JNIEnv *env, jclass clz, int8_tArray a) { LDKPublicKey a_ref; CHECK((*env)->GetArrayLength(env, a) == 33); @@ -48835,15 +50472,14 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1node(JNIEnv *e return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1blinded_1route(JNIEnv *env, jclass clz, int64_t a) { - LDKBlindedRoute a_conv; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Destination_1blinded_1path(JNIEnv *env, jclass clz, int64_t a) { + LDKBlindedPath a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - // WARNING: we need a move here but no clone is available for LDKBlindedRoute - + a_conv = BlindedPath_clone(&a_conv); LDKDestination *ret_copy = MALLOC(sizeof(LDKDestination), "LDKDestination"); - *ret_copy = Destination_blinded_route(a_conv); + *ret_copy = Destination_blinded_path(a_conv); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -48920,6 +50556,20 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1buffer_1full(JNI return ret_ref; } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1get_1node_1id_1failed(JNIEnv *env, jclass clz) { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_get_node_id_failed(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SendError_1blinded_1path_1advance_1failed(JNIEnv *env, jclass clz) { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_blinded_path_advance_failed(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SendError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) { LDKSendError* a_conv = (LDKSendError*)untag_ptr(a); LDKSendError* b_conv = (LDKSendError*)untag_ptr(b); @@ -48965,7 +50615,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1new(JNIEnv return ret_ref; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1send_1custom_1onion_1message(JNIEnv *env, jclass clz, int64_t this_arg, jobjectArray intermediate_nodes, int64_t destination, int64_t msg, int64_t reply_path) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1send_1onion_1message(JNIEnv *env, jclass clz, int64_t this_arg, jobjectArray intermediate_nodes, int64_t destination, int64_t message, int64_t reply_path) { LDKOnionMessenger this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -48987,21 +50637,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1send_1custo void* destination_ptr = untag_ptr(destination); CHECK_ACCESS(destination_ptr); LDKDestination destination_conv = *(LDKDestination*)(destination_ptr); - // WARNING: we may need a move here but no clone is available for LDKDestination - void* msg_ptr = untag_ptr(msg); - CHECK_ACCESS(msg_ptr); - LDKCustomOnionMessageContents msg_conv = *(LDKCustomOnionMessageContents*)(msg_ptr); - if (msg_conv.free == LDKCustomOnionMessageContents_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKCustomOnionMessageContents_JCalls_cloned(&msg_conv); - } - LDKBlindedRoute reply_path_conv; + destination_conv = Destination_clone((LDKDestination*)untag_ptr(destination)); + void* message_ptr = untag_ptr(message); + CHECK_ACCESS(message_ptr); + LDKOnionMessageContents message_conv = *(LDKOnionMessageContents*)(message_ptr); + message_conv = OnionMessageContents_clone((LDKOnionMessageContents*)untag_ptr(message)); + LDKBlindedPath reply_path_conv; reply_path_conv.inner = untag_ptr(reply_path); reply_path_conv.is_owned = ptr_is_owned(reply_path); CHECK_INNER_FIELD_ACCESS_OR_NULL(reply_path_conv); - reply_path_conv.is_owned = false; + reply_path_conv = BlindedPath_clone(&reply_path_conv); LDKCResult_NoneSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSendErrorZ), "LDKCResult_NoneSendErrorZ"); - *ret_conv = OnionMessenger_send_custom_onion_message(&this_arg_conv, intermediate_nodes_constr, destination_conv, msg_conv, reply_path_conv); + *ret_conv = OnionMessenger_send_onion_message(&this_arg_conv, intermediate_nodes_constr, destination_conv, message_conv, reply_path_conv); return tag_ptr(ret_conv, true); } @@ -49027,6 +50674,49 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1as_1OnionMe return tag_ptr(ret_ret, true); } +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKOnionMessageContents this_ptr_conv = *(LDKOnionMessageContents*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + OnionMessageContents_free(this_ptr_conv); +} + +static inline uint64_t OnionMessageContents_clone_ptr(LDKOnionMessageContents *NONNULL_PTR arg) { + LDKOnionMessageContents *ret_copy = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_copy = OnionMessageContents_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1clone_1ptr(JNIEnv *env, jclass clz, int64_t arg) { + LDKOnionMessageContents* arg_conv = (LDKOnionMessageContents*)untag_ptr(arg); + int64_t ret_conv = OnionMessageContents_clone_ptr(arg_conv); + return ret_conv; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1clone(JNIEnv *env, jclass clz, int64_t orig) { + LDKOnionMessageContents* orig_conv = (LDKOnionMessageContents*)untag_ptr(orig); + LDKOnionMessageContents *ret_copy = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_copy = OnionMessageContents_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1custom(JNIEnv *env, jclass clz, int64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKCustomOnionMessageContents a_conv = *(LDKCustomOnionMessageContents*)(a_ptr); + if (a_conv.free == LDKCustomOnionMessageContents_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKCustomOnionMessageContents_JCalls_cloned(&a_conv); + } + LDKOnionMessageContents *ret_copy = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); + *ret_copy = OnionMessageContents_custom(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline uint64_t CustomOnionMessageContents_clone_ptr(LDKCustomOnionMessageContents *NONNULL_PTR arg) { LDKCustomOnionMessageContents* ret_ret = MALLOC(sizeof(LDKCustomOnionMessageContents), "LDKCustomOnionMessageContents"); *ret_ret = CustomOnionMessageContents_clone(arg); @@ -50331,7 +52021,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1seg_1wit_1program program_ref.data = MALLOC(program_ref.datalen, "LDKCVec_u8Z Bytes"); (*env)->GetByteArrayRegion(env, program, 0, program_ref.datalen, program_ref.data); LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback"); - *ret_copy = Fallback_seg_wit_program((LDKu5){ ._0 = version }, program_ref); + *ret_copy = Fallback_seg_wit_program((LDKU5){ ._0 = version }, program_ref); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -51259,15 +52949,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payer_1free(JNIEnv *env, jclas Payer_free(this_ptr_conv); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKRouter this_ptr_conv = *(LDKRouter*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Router_free(this_ptr_conv); -} - JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Retry_1free(JNIEnv *env, jclass clz, int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -51440,6 +53121,25 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1invoice( return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1invoice_1with_1id(JNIEnv *env, jclass clz, int64_t this_arg, int64_t invoice, int8_tArray payment_id) { + LDKInvoicePayer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKInvoice invoice_conv; + invoice_conv.inner = untag_ptr(invoice); + invoice_conv.is_owned = ptr_is_owned(invoice); + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); + invoice_conv.is_owned = false; + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ"); + *ret_conv = InvoicePayer_pay_invoice_with_id(&this_arg_conv, &invoice_conv, payment_id_ref); + return tag_ptr(ret_conv, true); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1zero_1value_1invoice(JNIEnv *env, jclass clz, int64_t this_arg, int64_t invoice, int64_t amount_msats) { LDKInvoicePayer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -51456,6 +53156,25 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1zero_1va return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1zero_1value_1invoice_1with_1id(JNIEnv *env, jclass clz, int64_t this_arg, int64_t invoice, int64_t amount_msats, int8_tArray payment_id) { + LDKInvoicePayer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKInvoice invoice_conv; + invoice_conv.inner = untag_ptr(invoice); + invoice_conv.is_owned = ptr_is_owned(invoice); + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv); + invoice_conv.is_owned = false; + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ"); + *ret_conv = InvoicePayer_pay_zero_value_invoice_with_id(&this_arg_conv, &invoice_conv, amount_msats, payment_id_ref); + return tag_ptr(ret_conv, true); +} + JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1pubkey(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray pubkey, int8_tArray payment_preimage, int64_t amount_msats, int32_t final_cltv_expiry_delta) { LDKInvoicePayer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -51473,6 +53192,26 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1pubkey(J return tag_ptr(ret_conv, true); } +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1pubkey_1with_1id(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray pubkey, int8_tArray payment_preimage, int8_tArray payment_id, int64_t amount_msats, int32_t final_cltv_expiry_delta) { + LDKInvoicePayer this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKPublicKey pubkey_ref; + CHECK((*env)->GetArrayLength(env, pubkey) == 33); + (*env)->GetByteArrayRegion(env, pubkey, 0, 33, pubkey_ref.compressed_form); + LDKThirtyTwoBytes payment_preimage_ref; + CHECK((*env)->GetArrayLength(env, payment_preimage) == 32); + (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data); + LDKThirtyTwoBytes payment_id_ref; + CHECK((*env)->GetArrayLength(env, payment_id) == 32); + (*env)->GetByteArrayRegion(env, payment_id, 0, 32, payment_id_ref.data); + LDKCResult_NonePaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentErrorZ), "LDKCResult_NonePaymentErrorZ"); + *ret_conv = InvoicePayer_pay_pubkey_with_id(&this_arg_conv, pubkey_ref, payment_preimage_ref, payment_id_ref, amount_msats, final_cltv_expiry_delta); + return tag_ptr(ret_conv, true); +} + JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1remove_1cached_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray payment_hash) { LDKInvoicePayer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -51497,59 +53236,6 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1as_1EventHand return tag_ptr(ret_ret, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKInFlightHtlcs this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - InFlightHtlcs_free(this_obj_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1used_1liquidity_1msat(JNIEnv *env, jclass clz, int64_t this_arg, int64_t source, int64_t target, int64_t channel_scid) { - LDKInFlightHtlcs this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeId source_conv; - source_conv.inner = untag_ptr(source); - source_conv.is_owned = ptr_is_owned(source); - CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv); - source_conv.is_owned = false; - LDKNodeId target_conv; - target_conv.inner = untag_ptr(target); - target_conv.is_owned = ptr_is_owned(target); - CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv); - target_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = InFlightHtlcs_used_liquidity_msat(&this_arg_conv, &source_conv, &target_conv, channel_scid); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1write(JNIEnv *env, jclass clz, int64_t obj) { - LDKInFlightHtlcs obj_conv; - obj_conv.inner = untag_ptr(obj); - obj_conv.is_owned = ptr_is_owned(obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv); - obj_conv.is_owned = false; - LDKCVec_u8Z ret_var = InFlightHtlcs_write(&obj_conv); - int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen); - (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data); - CVec_u8Z_free(ret_var); - return ret_arr; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1read(JNIEnv *env, jclass clz, int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = (*env)->GetArrayLength(env, ser); - ser_ref.data = (*env)->GetByteArrayElements (env, ser, NULL); - LDKCResult_InFlightHtlcsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InFlightHtlcsDecodeErrorZ), "LDKCResult_InFlightHtlcsDecodeErrorZ"); - *ret_conv = InFlightHtlcs_read(ser_ref); - (*env)->ReleaseByteArrayElements(env, ser, (int8_t*)ser_ref.data, 0); - return tag_ptr(ret_conv, true); -} - JNIEXPORT 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, int64_t logger, jclass network) { void* amt_msat_ptr = untag_ptr(amt_msat); CHECK_ACCESS(amt_msat_ptr); @@ -51778,20 +53464,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1chan return tag_ptr(ret_conv, true); } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1free(JNIEnv *env, jclass clz, int64_t this_obj) { - LDKDefaultRouter this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - DefaultRouter_free(this_obj_conv); -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1new(JNIEnv *env, jclass clz, int64_t network_graph, int64_t logger, int8_tArray random_seed_bytes, int64_t scorer) { - LDKNetworkGraph network_graph_conv; - network_graph_conv.inner = untag_ptr(network_graph); - network_graph_conv.is_owned = ptr_is_owned(network_graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - network_graph_conv.is_owned = false; +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1and_1duration_1since_1epoch_1with_1payment_1hash(JNIEnv *env, jclass clz, int64_t channelmanager, int64_t keys_manager, int64_t logger, jclass network, int64_t amt_msat, jstring description, int64_t duration_since_epoch, int32_t invoice_expiry_delta_secs, int8_tArray payment_hash) { + LDKChannelManager channelmanager_conv; + channelmanager_conv.inner = untag_ptr(channelmanager); + channelmanager_conv.is_owned = ptr_is_owned(channelmanager); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv); + channelmanager_conv.is_owned = false; + void* keys_manager_ptr = untag_ptr(keys_manager); + 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* logger_ptr = untag_ptr(logger); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); @@ -51799,32 +53484,18 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1new(JNIEnv * // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKLogger_JCalls_cloned(&logger_conv); } - LDKThirtyTwoBytes random_seed_bytes_ref; - CHECK((*env)->GetArrayLength(env, random_seed_bytes) == 32); - (*env)->GetByteArrayRegion(env, random_seed_bytes, 0, 32, random_seed_bytes_ref.data); - void* scorer_ptr = untag_ptr(scorer); - CHECK_ACCESS(scorer_ptr); - LDKLockableScore scorer_conv = *(LDKLockableScore*)(scorer_ptr); - if (scorer_conv.free == LDKLockableScore_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLockableScore_JCalls_cloned(&scorer_conv); - } - LDKDefaultRouter ret_var = DefaultRouter_new(&network_graph_conv, logger_conv, random_seed_bytes_ref, scorer_conv); - int64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1as_1Router(JNIEnv *env, jclass clz, int64_t this_arg) { - LDKDefaultRouter this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKRouter* ret_ret = MALLOC(sizeof(LDKRouter), "LDKRouter"); - *ret_ret = DefaultRouter_as_Router(&this_arg_conv); - return tag_ptr(ret_ret, true); + LDKCurrency network_conv = LDKCurrency_from_java(env, network); + void* amt_msat_ptr = untag_ptr(amt_msat); + CHECK_ACCESS(amt_msat_ptr); + LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr); + amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat)); + LDKStr description_conv = java_to_owned_str(env, description); + LDKThirtyTwoBytes payment_hash_ref; + CHECK((*env)->GetArrayLength(env, payment_hash) == 32); + (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data); + LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ"); + *ret_conv = create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(&channelmanager_conv, keys_manager_conv, logger_conv, network_conv, amt_msat_conv, description_conv, duration_since_epoch, invoice_expiry_delta_secs, payment_hash_ref); + return tag_ptr(ret_conv, true); } JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1Payer(JNIEnv *env, jclass clz, int64_t this_arg) { diff --git a/src/main/jni/org_ldk_enums_HTLCClaim.h b/src/main/jni/org_ldk_enums_HTLCClaim.h new file mode 100644 index 00000000..8034a4f7 --- /dev/null +++ b/src/main/jni/org_ldk_enums_HTLCClaim.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_enums_HTLCClaim */ + +#ifndef _Included_org_ldk_enums_HTLCClaim +#define _Included_org_ldk_enums_HTLCClaim +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_enums_HTLCClaim + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_enums_HTLCClaim_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings.h b/src/main/jni/org_ldk_impl_bindings.h index 77e8cb0b..2a330111 100644 --- a/src/main/jni/org_ldk_impl_bindings.h +++ b/src/main/jni/org_ldk_impl_bindings.h @@ -10,10 +10,10 @@ extern "C" { /* * Class: org_ldk_impl_bindings * Method: init - * Signature: (Ljava/lang/Class;Ljava/lang/Class;)V + * Signature: (Ljava/lang/Class;)V */ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_init - (JNIEnv *, jclass, jclass, jclass); + (JNIEnv *, jclass, jclass); /* * Class: org_ldk_impl_bindings @@ -47,94 +47,6 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_get_1ldk_1c_1bindings_1vers JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_get_1ldk_1version (JNIEnv *, jclass); -/* - * Class: org_ldk_impl_bindings - * Method: deref_bool - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_deref_1bool - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: deref_long - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_deref_1long - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: free_heap_ptr - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_free_1heap_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: read_bytes - * Signature: (JJ)[B - */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_read_1bytes - (JNIEnv *, jclass, jlong, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: get_u8_slice_bytes - * Signature: (J)[B - */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_get_1u8_1slice_1bytes - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: bytes_to_u8_vec - * Signature: ([B)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_bytes_1to_1u8_1vec - (JNIEnv *, jclass, jbyteArray); - -/* - * Class: org_ldk_impl_bindings - * Method: new_txpointer_copy_data - * Signature: ([B)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_new_1txpointer_1copy_1data - (JNIEnv *, jclass, jbyteArray); - -/* - * Class: org_ldk_impl_bindings - * Method: txpointer_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_txpointer_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: txpointer_get_buffer - * Signature: (J)[B - */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_txpointer_1get_1buffer - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: vec_slice_len - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_vec_1slice_1len - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: new_empty_slice_vec - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_new_1empty_1slice_1vec - (JNIEnv *, jclass); - /* * Class: org_ldk_impl_bindings * Method: BigEndianScalar_get_bytes @@ -177,74 +89,34 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxOut_1get_1value /* * Class: org_ldk_impl_bindings - * Method: CResult_BlindedRouteNoneZ_get_ok - * Signature: (J)J + * Method: LDKCOption_HTLCClaimZ_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_HTLCClaimZ; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteNoneZ_1get_1ok +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1HTLCClaimZ_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_BlindedRouteNoneZ_get_err + * Method: CResult_NoneNoneZ_get_ok * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteNoneZ_1get_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: LDKDecodeError_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKDecodeError; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDecodeError_1ref_1from_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_BlindedRouteDecodeErrorZ_get_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteDecodeErrorZ_1get_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_BlindedRouteDecodeErrorZ_get_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteDecodeErrorZ_1get_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_BlindedHopDecodeErrorZ_get_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1get_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_BlindedHopDecodeErrorZ_get_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1get_1err +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneNoneZ_get_ok + * Method: CResult_NoneNoneZ_get_err * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1get_1ok +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneNoneZ_get_err - * Signature: (J)V + * Method: LDKDecodeError_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKDecodeError; */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneNoneZ_1get_1err +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDecodeError_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* @@ -263,38 +135,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitme JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: CResult_SecretKeyErrorZ_get_ok - * Signature: (J)[B - */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1get_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_SecretKeyErrorZ_get_err - * Signature: (J)Lorg/ldk/enums/Secp256k1Error; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1get_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_PublicKeyErrorZ_get_ok - * Signature: (J)[B - */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1get_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_PublicKeyErrorZ_get_err - * Signature: (J)Lorg/ldk/enums/Secp256k1Error; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1get_1err - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: CResult_TxCreationKeysDecodeErrorZ_get_ok @@ -327,22 +167,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDec JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: CResult_TxCreationKeysErrorZ_get_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1get_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_TxCreationKeysErrorZ_get_err - * Signature: (J)Lorg/ldk/enums/Secp256k1Error; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1get_1err - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKCOption_u32Z_ref_from_ptr @@ -527,6 +351,54 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvali JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvalidShutdownScriptZ_1get_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedPathNoneZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedPathNoneZ_get_err + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedPathDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedPathDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedHopDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedHopDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: LDKScore_new @@ -647,6 +519,46 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1get_1ok JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1get_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RouteLightningErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RouteLightningErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKCOption_u64Z_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_u64Z; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u64Z_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InFlightHtlcsDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InFlightHtlcsDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_RouteHopDecodeErrorZ_get_ok @@ -695,14 +607,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecod JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKCOption_u64Z_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_u64Z; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u64Z_1ref_1from_1ptr - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: CResult_PaymentParametersDecodeErrorZ_get_ok @@ -753,34 +657,18 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeEr /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteLightningErrorZ_get_ok - * Signature: (J)J + * Method: LDKPaymentPurpose_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKPaymentPurpose; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1get_1ok +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentPurpose_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteLightningErrorZ_get_err + * Method: CResult_PaymentPurposeDecodeErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1get_1err - (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: CResult_PaymentPurposeDecodeErrorZ_get_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentPurposeDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* @@ -855,6 +743,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestina JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestinationZDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKCOption_u128Z_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_u128Z; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1u128Z_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: LDKNetworkUpdate_ref_from_ptr @@ -959,6 +855,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1g JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1get_1b (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_TxidBlockHashZ_get_a + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidBlockHashZ_1get_1a + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_TxidBlockHashZ_get_b + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidBlockHashZ_1get_1b + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: LDKMonitorEvent_ref_from_ptr @@ -1135,6 +1047,38 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesD JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_OfferFeaturesDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OfferFeaturesDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_OfferFeaturesDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OfferFeaturesDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InvoiceRequestFeaturesDecodeErrorZ_get_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestFeaturesDecodeErrorZ_1get_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InvoiceRequestFeaturesDecodeErrorZ_get_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestFeaturesDecodeErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NodeIdDecodeErrorZ_get_ok @@ -1681,10 +1625,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BaseSign_1sign_1channel_1anno /* * Class: org_ldk_impl_bindings - * Method: BaseSign_ready_channel + * Method: BaseSign_provide_channel_parameters * Signature: (JJ)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BaseSign_1ready_1channel +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BaseSign_1provide_1channel_1parameters (JNIEnv *, jclass, jlong, jlong); /* @@ -1889,34 +1833,34 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentSendFailure_1ref_ /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentIdPaymentSendFailureZ_get_ok - * Signature: (J)[B + * Method: CResult_NonePaymentSendFailureZ_get_ok + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1get_1ok +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentIdPaymentSendFailureZ_get_err + * Method: CResult_NonePaymentSendFailureZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePaymentSendFailureZ_get_ok - * Signature: (J)V + * Method: CResult_PaymentHashPaymentSendFailureZ_get_ok + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1get_1ok +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePaymentSendFailureZ_get_err + * Method: CResult_PaymentHashPaymentSendFailureZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1get_1err (JNIEnv *, jclass, jlong); /* @@ -2209,11 +2153,19 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1shutdown_ /* * Class: org_ldk_impl_bindings - * Method: KeysInterface_get_channel_signer - * Signature: (JZJ)J + * Method: KeysInterface_generate_channel_keys_id + * Signature: (JZJ[B)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1channel_1signer - (JNIEnv *, jclass, jlong, jboolean, jlong); +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1generate_1channel_1keys_1id + (JNIEnv *, jclass, jlong, jboolean, jlong, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: KeysInterface_derive_channel_signer + * Signature: (JJ[B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysInterface_1derive_1channel_1signer + (JNIEnv *, jclass, jlong, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings @@ -2409,522 +2361,538 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErro /* * Class: org_ldk_impl_bindings - * Method: CResult_InFlightHtlcsDecodeErrorZ_get_ok - * Signature: (J)J + * Method: CResult_NonePaymentErrorZ_get_ok + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1get_1ok +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_InFlightHtlcsDecodeErrorZ_get_err + * Method: CResult_NonePaymentErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKParseError_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKParseError; + * Method: CResult_StringErrorZ_get_ok + * Signature: (J)Ljava/lang/String; */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKParseError_1ref_1from_1ptr +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SiPrefixParseErrorZ_get_ok - * Signature: (J)Lorg/ldk/enums/SiPrefix; + * Method: CResult_StringErrorZ_get_err + * Signature: (J)Lorg/ldk/enums/Secp256k1Error; */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1get_1ok +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SiPrefixParseErrorZ_get_err - * Signature: (J)J + * Method: CResult_PublicKeyErrorZ_get_ok + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1get_1err +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKParseOrSemanticError_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKParseOrSemanticError; + * Method: CResult_PublicKeyErrorZ_get_err + * Signature: (J)Lorg/ldk/enums/Secp256k1Error; */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKParseOrSemanticError_1ref_1from_1ptr +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceParseOrSemanticErrorZ_get_ok + * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceParseOrSemanticErrorZ_get_err + * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SignedRawInvoiceParseErrorZ_get_ok - * Signature: (J)J + * Method: LDKCOption_MonitorEventZ_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_MonitorEventZ; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1get_1ok +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1MonitorEventZ_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SignedRawInvoiceParseErrorZ_get_err + * Method: CResult_COption_MonitorEventZDecodeErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a + * Method: CResult_COption_MonitorEventZDecodeErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1get_1a +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b - * Signature: (J)[B + * Method: CResult_HTLCUpdateDecodeErrorZ_get_ok + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1get_1b +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c + * Method: CResult_HTLCUpdateDecodeErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1get_1c +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PayeePubKeyErrorZ_get_ok + * Method: C2Tuple_OutPointScriptZ_get_a * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1get_1a (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PayeePubKeyErrorZ_get_err - * Signature: (J)Lorg/ldk/enums/Secp256k1Error; + * Method: C2Tuple_OutPointScriptZ_get_b + * Signature: (J)[B */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1get_1err +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1get_1b (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PositiveTimestampCreationErrorZ_get_ok - * Signature: (J)J + * Method: C2Tuple_u32ScriptZ_get_a + * Signature: (J)I */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1get_1ok +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1get_1a (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PositiveTimestampCreationErrorZ_get_err - * Signature: (J)Lorg/ldk/enums/CreationError; + * Method: C2Tuple_u32ScriptZ_get_b + * Signature: (J)[B */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1get_1err +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1get_1b (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneSemanticErrorZ_get_ok - * Signature: (J)V + * Method: C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a + * Signature: (J)[B */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1get_1ok +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1get_1a (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneSemanticErrorZ_get_err - * Signature: (J)Lorg/ldk/enums/SemanticError; + * Method: C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b + * Signature: (J)[J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1get_1err +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1get_1b (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceSemanticErrorZ_get_ok - * Signature: (J)J + * Method: C2Tuple_u32TxOutZ_get_a + * Signature: (J)I */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1get_1ok +JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1get_1a (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceSemanticErrorZ_get_err - * Signature: (J)Lorg/ldk/enums/SemanticError; + * Method: C2Tuple_u32TxOutZ_get_b + * Signature: (J)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1get_1b (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_DescriptionCreationErrorZ_get_ok - * Signature: (J)J + * Method: C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1get_1ok +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1get_1a (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_DescriptionCreationErrorZ_get_err - * Signature: (J)Lorg/ldk/enums/CreationError; + * Method: C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b + * Signature: (J)[J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1get_1err +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1get_1b (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PrivateRouteCreationErrorZ_get_ok - * Signature: (J)J + * Method: LDKBalance_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKBalance; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1get_1ok +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBalance_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PrivateRouteCreationErrorZ_get_err - * Signature: (J)Lorg/ldk/enums/CreationError; + * Method: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok + * Signature: (J)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_StringErrorZ_get_ok - * Signature: (J)Ljava/lang/String; + * Method: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_StringErrorZ_get_err - * Signature: (J)Lorg/ldk/enums/Secp256k1Error; + * Method: C2Tuple_PublicKeyTypeZ_get_a + * Signature: (J)[B */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1get_1err +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1get_1a (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok + * Method: C2Tuple_PublicKeyTypeZ_get_b * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1get_1b (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_get_err - * Signature: (J)J + * Method: LDKCustomOnionMessageContents_new + * Signature: (Lorg/ldk/impl/bindings/LDKCustomOnionMessageContents;)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1get_1err - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCustomOnionMessageContents_1new + (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: LDKCOption_MonitorEventZ_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_MonitorEventZ; + * Method: CustomOnionMessageContents_tlv_type + * Signature: (J)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1MonitorEventZ_1ref_1from_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageContents_1tlv_1type (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_MonitorEventZDecodeErrorZ_get_ok - * Signature: (J)J + * Method: CustomOnionMessageContents_write + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1get_1ok +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageContents_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_MonitorEventZDecodeErrorZ_get_err - * Signature: (J)J + * Method: LDKCOption_CustomOnionMessageContentsZ_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_CustomOnionMessageContentsZ; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1get_1err +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1CustomOnionMessageContentsZ_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_HTLCUpdateDecodeErrorZ_get_ok + * Method: CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_HTLCUpdateDecodeErrorZ_get_err + * Method: CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_OutPointScriptZ_get_a - * Signature: (J)J + * Method: LDKCOption_NetAddressZ_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_NetAddressZ; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1get_1a +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1NetAddressZ_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_OutPointScriptZ_get_b + * Method: CResult_CVec_u8ZPeerHandleErrorZ_get_ok * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1get_1b +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_u32ScriptZ_get_a - * Signature: (J)I + * Method: CResult_CVec_u8ZPeerHandleErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1get_1a +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_u32ScriptZ_get_b - * Signature: (J)[B + * Method: CResult_NonePeerHandleErrorZ_get_ok + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1get_1b +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a - * Signature: (J)[B + * Method: CResult_NonePeerHandleErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1get_1a +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b - * Signature: (J)[J + * Method: CResult_boolPeerHandleErrorZ_get_ok + * Signature: (J)Z */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1get_1b +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_u32TxOutZ_get_a - * Signature: (J)I + * Method: CResult_boolPeerHandleErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1get_1a +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_u32TxOutZ_get_b - * Signature: (J)J + * Method: LDKSendError_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKSendError; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1get_1b +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSendError_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a - * Signature: (J)[B + * Method: CResult_NoneSendErrorZ_get_ok + * Signature: (J)V */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1get_1a +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b - * Signature: (J)[J + * Method: CResult_NoneSendErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1get_1b +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKBalance_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKBalance; + * Method: LDKParseError_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKParseError; */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBalance_1ref_1from_1ptr +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKParseError_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok - * Signature: (J)J + * Method: CResult_SiPrefixParseErrorZ_get_ok + * Signature: (J)Lorg/ldk/enums/SiPrefix; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1get_1ok +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err + * Method: CResult_SiPrefixParseErrorZ_get_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_PublicKeyTypeZ_get_a - * Signature: (J)[B + * Method: LDKParseOrSemanticError_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKParseOrSemanticError; */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1get_1a +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKParseOrSemanticError_1ref_1from_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_PublicKeyTypeZ_get_b + * Method: CResult_InvoiceParseOrSemanticErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1get_1b +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCustomOnionMessageContents_new - * Signature: (Lorg/ldk/impl/bindings/LDKCustomOnionMessageContents;)J + * Method: CResult_InvoiceParseOrSemanticErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCustomOnionMessageContents_1new - (JNIEnv *, jclass, jobject); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1get_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CustomOnionMessageContents_tlv_type + * Method: CResult_SignedRawInvoiceParseErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageContents_1tlv_1type +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CustomOnionMessageContents_write - * Signature: (J)[B + * Method: CResult_SignedRawInvoiceParseErrorZ_get_err + * Signature: (J)J */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CustomOnionMessageContents_1write +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKCOption_CustomOnionMessageContentsZ_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKCOption_CustomOnionMessageContentsZ; + * Method: C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a + * Signature: (J)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1CustomOnionMessageContentsZ_1ref_1from_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1get_1a (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_ok - * Signature: (J)J + * Method: C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1get_1ok +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1get_1b (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_get_err + * Method: C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_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: CResult_PayeePubKeyErrorZ_get_ok + * Signature: (J)J */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCOption_1NetAddressZ_1ref_1from_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_u8ZPeerHandleErrorZ_get_ok - * Signature: (J)[B + * Method: CResult_PayeePubKeyErrorZ_get_err + * Signature: (J)Lorg/ldk/enums/Secp256k1Error; */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1get_1ok +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_u8ZPeerHandleErrorZ_get_err + * Method: CResult_PositiveTimestampCreationErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePeerHandleErrorZ_get_ok + * Method: CResult_PositiveTimestampCreationErrorZ_get_err + * Signature: (J)Lorg/ldk/enums/CreationError; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneSemanticErrorZ_get_ok * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1get_1ok +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePeerHandleErrorZ_get_err + * Method: CResult_NoneSemanticErrorZ_get_err + * Signature: (J)Lorg/ldk/enums/SemanticError; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1get_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InvoiceSemanticErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_boolPeerHandleErrorZ_get_ok - * Signature: (J)Z + * Method: CResult_InvoiceSemanticErrorZ_get_err + * Signature: (J)Lorg/ldk/enums/SemanticError; */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1get_1ok +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_boolPeerHandleErrorZ_get_err + * Method: CResult_DescriptionCreationErrorZ_get_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1get_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: LDKSendError_ref_from_ptr - * Signature: (J)Lorg/ldk/impl/bindings/LDKSendError; + * Method: CResult_DescriptionCreationErrorZ_get_err + * Signature: (J)Lorg/ldk/enums/CreationError; */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSendError_1ref_1from_1ptr +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneSendErrorZ_get_ok - * Signature: (J)V + * Method: CResult_PrivateRouteCreationErrorZ_get_ok + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1get_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1get_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneSendErrorZ_get_err - * Signature: (J)J + * Method: CResult_PrivateRouteCreationErrorZ_get_err + * Signature: (J)Lorg/ldk/enums/CreationError; */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1get_1err +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1get_1err (JNIEnv *, jclass, jlong); /* @@ -3583,6 +3551,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitor JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorNoneZ_1get_1err (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1get_1a + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b + * Signature: (J)[J + */ +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1get_1b + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: LDKMessageSendEventsProvider_new @@ -3762,9 +3746,9 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Confirm_1best_1block_1updated /* * Class: org_ldk_impl_bindings * Method: Confirm_get_relevant_txids - * Signature: (J)[[B + * Signature: (J)[J */ -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_Confirm_1get_1relevant_1txids +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_Confirm_1get_1relevant_1txids (JNIEnv *, jclass, jlong); /* @@ -4263,6 +4247,62 @@ 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: LDKRouter_new + * Signature: (Lorg/ldk/impl/bindings/LDKRouter;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRouter_1new + (JNIEnv *, jclass, jobject); + +/* + * Class: org_ldk_impl_bindings + * Method: Router_find_route + * Signature: (J[BJ[JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Router_1find_1route + (JNIEnv *, jclass, jlong, jbyteArray, jlong, jlongArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Router_find_route_with_id + * Signature: (J[BJ[JJ[B[B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Router_1find_1route_1with_1id + (JNIEnv *, jclass, jlong, jbyteArray, jlong, jlongArray, jlong, jbyteArray, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: Router_notify_payment_path_failed + * Signature: (J[JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_1notify_1payment_1path_1failed + (JNIEnv *, jclass, jlong, jlongArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Router_notify_payment_path_successful + * Signature: (J[J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_1notify_1payment_1path_1successful + (JNIEnv *, jclass, jlong, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: Router_notify_payment_probe_successful + * Signature: (J[J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_1notify_1payment_1probe_1successful + (JNIEnv *, jclass, jlong, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: Router_notify_payment_probe_failed + * Signature: (J[JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_1notify_1payment_1probe_1failed + (JNIEnv *, jclass, jlong, jlongArray, jlong); + /* * Class: org_ldk_impl_bindings * Method: LDKDestination_ref_from_ptr @@ -4271,6 +4311,14 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEffectiveCapacity_1ref_1 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKDestination_1ref_1from_1ptr (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKOnionMessageContents_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKOnionMessageContents; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKOnionMessageContents_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: LDKGossipSync_ref_from_ptr @@ -4314,18 +4362,18 @@ JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_Payer_1first_1hops /* * Class: org_ldk_impl_bindings * Method: Payer_send_payment - * Signature: (JJ[B[B)J + * Signature: (JJ[B[B[B)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Payer_1send_1payment - (JNIEnv *, jclass, jlong, jlong, jbyteArray, jbyteArray); + (JNIEnv *, jclass, jlong, jlong, jbyteArray, jbyteArray, jbyteArray); /* * Class: org_ldk_impl_bindings * Method: Payer_send_spontaneous_payment - * Signature: (JJ[B)J + * Signature: (JJ[B[B)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Payer_1send_1spontaneous_1payment - (JNIEnv *, jclass, jlong, jlong, jbyteArray); + (JNIEnv *, jclass, jlong, jlong, jbyteArray, jbyteArray); /* * Class: org_ldk_impl_bindings @@ -4345,51 +4393,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payer_1abandon_1payment /* * Class: org_ldk_impl_bindings - * Method: LDKRouter_new - * Signature: (Lorg/ldk/impl/bindings/LDKRouter;)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRouter_1new - (JNIEnv *, jclass, jobject); - -/* - * Class: org_ldk_impl_bindings - * Method: Router_find_route - * Signature: (J[BJ[B[JJ)J - */ -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: Router_notify_payment_path_failed - * Signature: (J[JJ)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_1notify_1payment_1path_1failed - (JNIEnv *, jclass, jlong, jlongArray, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: Router_notify_payment_path_successful - * Signature: (J[J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_1notify_1payment_1path_1successful - (JNIEnv *, jclass, jlong, jlongArray); - -/* - * Class: org_ldk_impl_bindings - * Method: Router_notify_payment_probe_successful - * Signature: (J[J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_1notify_1payment_1probe_1successful - (JNIEnv *, jclass, jlong, jlongArray); - -/* - * Class: org_ldk_impl_bindings - * Method: Router_notify_payment_probe_failed - * Signature: (J[JJ)V + * Method: Payer_inflight_htlcs + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_1notify_1payment_1probe_1failed - (JNIEnv *, jclass, jlong, jlongArray, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Payer_1inflight_1htlcs + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings @@ -4415,6 +4423,22 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings__1ldk_1get_1compiled_1versi JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings__1ldk_1c_1bindings_1get_1compiled_1version (JNIEnv *, jclass); +/* + * Class: org_ldk_impl_bindings + * Method: U128_le_bytes + * Signature: ([B)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_U128_1le_1bytes + (JNIEnv *, jclass, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: U128_new + * Signature: ([B)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_U128_1new + (JNIEnv *, jclass, jbyteArray); + /* * Class: org_ldk_impl_bindings * Method: BigEndianScalar_new @@ -4455,6 +4479,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Bech32Error_1free JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Transaction_1free (JNIEnv *, jclass, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: Witness_free + * Signature: ([B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Witness_1free + (JNIEnv *, jclass, jbyteArray); + /* * Class: org_ldk_impl_bindings * Method: TxOut_new @@ -4497,106 +4529,26 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Str_1free /* * Class: org_ldk_impl_bindings - * Method: CVec_PublicKeyZ_free - * Signature: ([[B)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PublicKeyZ_1free - (JNIEnv *, jclass, jobjectArray); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_BlindedRouteNoneZ_ok - * Signature: (J)J + * Method: COption_HTLCClaimZ_some + * Signature: (Lorg/ldk/enums/HTLCClaim;)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteNoneZ_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1HTLCClaimZ_1some + (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: CResult_BlindedRouteNoneZ_err + * Method: COption_HTLCClaimZ_none * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteNoneZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1HTLCClaimZ_1none (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: CResult_BlindedRouteNoneZ_is_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteNoneZ_1is_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_BlindedRouteNoneZ_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteNoneZ_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_BlindedRouteDecodeErrorZ_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteDecodeErrorZ_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_BlindedRouteDecodeErrorZ_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteDecodeErrorZ_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_BlindedRouteDecodeErrorZ_is_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteDecodeErrorZ_1is_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_BlindedRouteDecodeErrorZ_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedRouteDecodeErrorZ_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_BlindedHopDecodeErrorZ_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_BlindedHopDecodeErrorZ_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1err - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_BlindedHopDecodeErrorZ_is_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1is_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_BlindedHopDecodeErrorZ_free + * Method: COption_HTLCClaimZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1HTLCClaimZ_1free (JNIEnv *, jclass, jlong); /* @@ -4695,102 +4647,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitme JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CounterpartyCommitmentSecretsDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: CResult_SecretKeyErrorZ_ok - * Signature: ([B)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1ok - (JNIEnv *, jclass, jbyteArray); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_SecretKeyErrorZ_err - * Signature: (Lorg/ldk/enums/Secp256k1Error;)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1err - (JNIEnv *, jclass, jobject); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_SecretKeyErrorZ_is_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1is_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_SecretKeyErrorZ_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_SecretKeyErrorZ_clone_ptr - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1clone_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_SecretKeyErrorZ_clone - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeyErrorZ_1clone - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_PublicKeyErrorZ_ok - * Signature: ([B)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1ok - (JNIEnv *, jclass, jbyteArray); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_PublicKeyErrorZ_err - * Signature: (Lorg/ldk/enums/Secp256k1Error;)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1err - (JNIEnv *, jclass, jobject); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_PublicKeyErrorZ_is_ok - * Signature: (J)Z - */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1is_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_PublicKeyErrorZ_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_PublicKeyErrorZ_clone_ptr - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1clone_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_PublicKeyErrorZ_clone - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1clone - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: CResult_TxCreationKeysDecodeErrorZ_ok @@ -4889,107 +4745,59 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelPublicKeysDec /* * Class: org_ldk_impl_bindings - * Method: CResult_TxCreationKeysErrorZ_ok - * Signature: (J)J + * Method: COption_u32Z_some + * Signature: (I)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1some + (JNIEnv *, jclass, jint); /* * Class: org_ldk_impl_bindings - * Method: CResult_TxCreationKeysErrorZ_err - * Signature: (Lorg/ldk/enums/Secp256k1Error;)J + * Method: COption_u32Z_none + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1err - (JNIEnv *, jclass, jobject); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1none + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: CResult_TxCreationKeysErrorZ_is_ok - * Signature: (J)Z + * Method: COption_u32Z_free + * Signature: (J)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1is_1ok +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_TxCreationKeysErrorZ_free - * Signature: (J)V + * Method: COption_u32Z_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_TxCreationKeysErrorZ_clone_ptr + * Method: COption_u32Z_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_TxCreationKeysErrorZ_clone + * Method: CResult_HTLCOutputInCommitmentDecodeErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_u32Z_some - * Signature: (I)J + * Method: CResult_HTLCOutputInCommitmentDecodeErrorZ_err + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1some - (JNIEnv *, jclass, jint); - -/* - * Class: org_ldk_impl_bindings - * Method: COption_u32Z_none - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1none - (JNIEnv *, jclass); - -/* - * Class: org_ldk_impl_bindings - * Method: COption_u32Z_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: COption_u32Z_clone_ptr - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1clone_1ptr - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: COption_u32Z_clone - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1u32Z_1clone - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_HTLCOutputInCommitmentDecodeErrorZ_ok - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1ok - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_HTLCOutputInCommitmentDecodeErrorZ_err - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1err - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCOutputInCommitmentDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings @@ -5505,242 +5313,290 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ShutdownScriptInvali /* * Class: org_ldk_impl_bindings - * Method: COption_WriteableScoreZ_some + * Method: CVec_PublicKeyZ_free + * Signature: ([[B)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PublicKeyZ_1free + (JNIEnv *, jclass, jobjectArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedPathNoneZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1WriteableScoreZ_1some +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_WriteableScoreZ_none + * Method: CResult_BlindedPathNoneZ_err * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1WriteableScoreZ_1none +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1err (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: COption_WriteableScoreZ_free + * Method: CResult_BlindedPathNoneZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedPathNoneZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1WriteableScoreZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneErrorZ_ok - * Signature: ()J + * Method: CResult_BlindedPathNoneZ_clone_ptr + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1ok - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneErrorZ_err - * Signature: (Lorg/ldk/enums/IOError;)J + * Method: CResult_BlindedPathNoneZ_clone + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1err - (JNIEnv *, jclass, jobject); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathNoneZ_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneErrorZ_is_ok + * Method: CResult_BlindedPathDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedPathDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_BlindedPathDecodeErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneErrorZ_free + * Method: CResult_BlindedPathDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneErrorZ_clone_ptr + * Method: CResult_BlindedPathDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneErrorZ_clone + * Method: CResult_BlindedPathDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedPathDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteHopDecodeErrorZ_ok + * Method: CResult_BlindedHopDecodeErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteHopDecodeErrorZ_err + * Method: CResult_BlindedHopDecodeErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteHopDecodeErrorZ_is_ok + * Method: CResult_BlindedHopDecodeErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteHopDecodeErrorZ_free + * Method: CResult_BlindedHopDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteHopDecodeErrorZ_clone_ptr + * Method: CResult_BlindedHopDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteHopDecodeErrorZ_clone + * Method: CResult_BlindedHopDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1BlindedHopDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_RouteHopZ_free - * Signature: ([J)V + * Method: COption_WriteableScoreZ_some + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHopZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1WriteableScoreZ_1some + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_CVec_RouteHopZZ_free - * Signature: ([[J)V + * Method: COption_WriteableScoreZ_none + * Signature: ()J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1RouteHopZZ_1free - (JNIEnv *, jclass, jobjectArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1WriteableScoreZ_1none + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteDecodeErrorZ_ok - * Signature: (J)J + * Method: COption_WriteableScoreZ_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1ok +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1WriteableScoreZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteDecodeErrorZ_err - * Signature: (J)J + * Method: CResult_NoneErrorZ_ok + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1err - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1ok + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteDecodeErrorZ_is_ok + * Method: CResult_NoneErrorZ_err + * Signature: (Lorg/ldk/enums/IOError;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1err + (JNIEnv *, jclass, jobject); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_NoneErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteDecodeErrorZ_free + * Method: CResult_NoneErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteDecodeErrorZ_clone_ptr + * Method: CResult_NoneErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteDecodeErrorZ_clone + * Method: CResult_NoneErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteParametersDecodeErrorZ_ok + * Method: CVec_ChannelDetailsZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RouteLightningErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteParametersDecodeErrorZ_err + * Method: CResult_RouteLightningErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteParametersDecodeErrorZ_is_ok + * Method: CResult_RouteLightningErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteParametersDecodeErrorZ_free + * Method: CResult_RouteLightningErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteParametersDecodeErrorZ_clone_ptr + * Method: CResult_RouteLightningErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteParametersDecodeErrorZ_clone + * Method: CResult_RouteLightningErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_RouteHintZ_free + * Method: CVec_RouteHopZ_free * Signature: ([J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHopZ_1free (JNIEnv *, jclass, jlongArray); /* @@ -5785,218 +5641,370 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1u64Z_1clone /* * Class: org_ldk_impl_bindings - * 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_PaymentParametersDecodeErrorZ_ok + * Method: CResult_InFlightHtlcsDecodeErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentParametersDecodeErrorZ_err + * Method: CResult_InFlightHtlcsDecodeErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentParametersDecodeErrorZ_is_ok + * Method: CResult_InFlightHtlcsDecodeErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentParametersDecodeErrorZ_free + * Method: CResult_InFlightHtlcsDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentParametersDecodeErrorZ_clone_ptr + * Method: CResult_InFlightHtlcsDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentParametersDecodeErrorZ_clone + * Method: CResult_InFlightHtlcsDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_RouteHintHopZ_free - * Signature: ([J)V + * Method: CResult_RouteHopDecodeErrorZ_ok + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintHopZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteHintDecodeErrorZ_ok + * Method: CResult_RouteHopDecodeErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteHintDecodeErrorZ_err - * Signature: (J)J + * Method: CResult_RouteHopDecodeErrorZ_is_ok + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1err +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteHintDecodeErrorZ_is_ok + * Method: CResult_RouteHopDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RouteHopDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RouteHopDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHopDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CVec_CVec_RouteHopZZ_free + * Signature: ([[J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1RouteHopZZ_1free + (JNIEnv *, jclass, jobjectArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RouteDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RouteDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RouteDecodeErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteHintDecodeErrorZ_free + * Method: CResult_RouteDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteHintDecodeErrorZ_clone_ptr + * Method: CResult_RouteDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteHintDecodeErrorZ_clone + * Method: CResult_RouteDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteHintHopDecodeErrorZ_ok + * Method: CResult_RouteParametersDecodeErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteHintHopDecodeErrorZ_err + * Method: CResult_RouteParametersDecodeErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteHintHopDecodeErrorZ_is_ok + * Method: CResult_RouteParametersDecodeErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteHintHopDecodeErrorZ_free + * Method: CResult_RouteParametersDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteHintHopDecodeErrorZ_clone_ptr + * Method: CResult_RouteParametersDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteHintHopDecodeErrorZ_clone + * Method: CResult_RouteParametersDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteParametersDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_ChannelDetailsZ_free + * Method: CVec_RouteHintZ_free * Signature: ([J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintZ_1free (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteLightningErrorZ_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_PaymentParametersDecodeErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteLightningErrorZ_err + * Method: CResult_PaymentParametersDecodeErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteLightningErrorZ_is_ok + * Method: CResult_PaymentParametersDecodeErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteLightningErrorZ_free + * Method: CResult_PaymentParametersDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteLightningErrorZ_clone_ptr + * Method: CResult_PaymentParametersDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_RouteLightningErrorZ_clone + * Method: CResult_PaymentParametersDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentParametersDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CVec_RouteHintHopZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintHopZ_1free + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RouteHintDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RouteHintDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RouteHintDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RouteHintDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RouteHintDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RouteHintDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RouteHintHopDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RouteHintHopDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RouteHintHopDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RouteHintHopDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RouteHintHopDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_RouteHintHopDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteHintHopDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* @@ -6225,66 +6233,106 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1HTLCDestina /* * Class: org_ldk_impl_bindings - * Method: COption_NetworkUpdateZ_some - * Signature: (J)J + * Method: COption_u128Z_some + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1some - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1u128Z_1some + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: COption_NetworkUpdateZ_none + * Method: COption_u128Z_none * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1none +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1u128Z_1none (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: COption_NetworkUpdateZ_free + * Method: COption_u128Z_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1u128Z_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_NetworkUpdateZ_clone_ptr + * Method: COption_u128Z_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_COption_1u128Z_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_NetworkUpdateZ_clone + * Method: COption_u128Z_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1u128Z_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * 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 + * Method: COption_NetworkUpdateZ_some * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1some +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1some (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_EventZ_none + * Method: COption_NetworkUpdateZ_none * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1none +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1none + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_NetworkUpdateZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_NetworkUpdateZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_NetworkUpdateZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1NetworkUpdateZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * 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_1EventZ_1some + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_EventZ_none + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1EventZ_1none (JNIEnv *, jclass); /* @@ -6457,11 +6505,43 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1usizeTransactio /* * Class: org_ldk_impl_bindings - * Method: CVec_TxidZ_free - * Signature: ([[B)V + * Method: C2Tuple_TxidBlockHashZ_clone_ptr + * 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_C2Tuple_1TxidBlockHashZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_TxidBlockHashZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidBlockHashZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_TxidBlockHashZ_new + * Signature: ([B[B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidBlockHashZ_1new + (JNIEnv *, jclass, jbyteArray, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_TxidBlockHashZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidBlockHashZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CVec_C2Tuple_TxidBlockHashZZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidBlockHashZZ_1free + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings @@ -6911,6 +6991,102 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesD JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelTypeFeaturesDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: CResult_OfferFeaturesDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OfferFeaturesDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_OfferFeaturesDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OfferFeaturesDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_OfferFeaturesDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1OfferFeaturesDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_OfferFeaturesDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1OfferFeaturesDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_OfferFeaturesDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OfferFeaturesDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_OfferFeaturesDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1OfferFeaturesDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InvoiceRequestFeaturesDecodeErrorZ_ok + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestFeaturesDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InvoiceRequestFeaturesDecodeErrorZ_err + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestFeaturesDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InvoiceRequestFeaturesDecodeErrorZ_is_ok + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestFeaturesDecodeErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InvoiceRequestFeaturesDecodeErrorZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestFeaturesDecodeErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InvoiceRequestFeaturesDecodeErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestFeaturesDecodeErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_InvoiceRequestFeaturesDecodeErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceRequestFeaturesDecodeErrorZ_1clone + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CResult_NodeIdDecodeErrorZ_ok @@ -8145,10 +8321,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1cl /* * Class: org_ldk_impl_bindings - * Method: CVec_u5Z_free + * Method: CVec_U5Z_free * Signature: ([B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u5Z_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1U5Z_1free (JNIEnv *, jclass, jbyteArray); /* @@ -8609,98 +8785,98 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1_1u832APIErrorZ_1clo /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentIdPaymentSendFailureZ_ok - * Signature: ([B)J + * Method: CResult_NonePaymentSendFailureZ_ok + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1ok - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1ok + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentIdPaymentSendFailureZ_err + * Method: CResult_NonePaymentSendFailureZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentIdPaymentSendFailureZ_is_ok + * Method: CResult_NonePaymentSendFailureZ_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_1NonePaymentSendFailureZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentIdPaymentSendFailureZ_free + * Method: CResult_NonePaymentSendFailureZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentIdPaymentSendFailureZ_clone_ptr + * Method: CResult_NonePaymentSendFailureZ_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_1NonePaymentSendFailureZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PaymentIdPaymentSendFailureZ_clone + * Method: CResult_NonePaymentSendFailureZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentSendFailureZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePaymentSendFailureZ_ok - * Signature: ()J + * Method: CResult_PaymentHashPaymentSendFailureZ_ok + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1ok - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1ok + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePaymentSendFailureZ_err + * Method: CResult_PaymentHashPaymentSendFailureZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePaymentSendFailureZ_is_ok + * Method: CResult_PaymentHashPaymentSendFailureZ_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_1PaymentHashPaymentSendFailureZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePaymentSendFailureZ_free + * Method: CResult_PaymentHashPaymentSendFailureZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePaymentSendFailureZ_clone_ptr + * Method: CResult_PaymentHashPaymentSendFailureZ_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_1PaymentHashPaymentSendFailureZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePaymentSendFailureZ_clone + * Method: CResult_PaymentHashPaymentSendFailureZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1clone (JNIEnv *, jclass, jlong); /* @@ -9545,1346 +9721,1410 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentIdPaymentErro /* * Class: org_ldk_impl_bindings - * Method: CResult_InFlightHtlcsDecodeErrorZ_ok - * Signature: (J)J + * Method: CResult_NonePaymentErrorZ_ok + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1ok + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: CResult_InFlightHtlcsDecodeErrorZ_err + * Method: CResult_NonePaymentErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_InFlightHtlcsDecodeErrorZ_is_ok + * Method: CResult_NonePaymentErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_InFlightHtlcsDecodeErrorZ_free + * Method: CResult_NonePaymentErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InFlightHtlcsDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SiPrefixParseErrorZ_ok - * Signature: (Lorg/ldk/enums/SiPrefix;)J + * Method: CResult_NonePaymentErrorZ_clone_ptr + * 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_1NonePaymentErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SiPrefixParseErrorZ_err + * Method: CResult_NonePaymentErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SiPrefixParseErrorZ_is_ok + * Method: CResult_StringErrorZ_ok + * Signature: (Ljava/lang/String;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1ok + (JNIEnv *, jclass, jstring); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_StringErrorZ_err + * Signature: (Lorg/ldk/enums/Secp256k1Error;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1err + (JNIEnv *, jclass, jobject); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_StringErrorZ_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_1StringErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SiPrefixParseErrorZ_free + * Method: CResult_StringErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SiPrefixParseErrorZ_clone_ptr + * Method: CResult_StringErrorZ_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_1StringErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SiPrefixParseErrorZ_clone + * Method: CResult_StringErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceParseOrSemanticErrorZ_ok - * Signature: (J)J + * Method: CResult_PublicKeyErrorZ_ok + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1ok + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceParseOrSemanticErrorZ_err - * Signature: (J)J + * Method: CResult_PublicKeyErrorZ_err + * Signature: (Lorg/ldk/enums/Secp256k1Error;)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1err - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1err + (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceParseOrSemanticErrorZ_is_ok + * Method: CResult_PublicKeyErrorZ_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_1PublicKeyErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceParseOrSemanticErrorZ_free + * Method: CResult_PublicKeyErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceParseOrSemanticErrorZ_clone_ptr + * Method: CResult_PublicKeyErrorZ_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_1PublicKeyErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceParseOrSemanticErrorZ_clone + * Method: CResult_PublicKeyErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeyErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SignedRawInvoiceParseErrorZ_ok + * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SignedRawInvoiceParseErrorZ_err + * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SignedRawInvoiceParseErrorZ_is_ok + * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_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_1ChannelMonitorUpdateDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SignedRawInvoiceParseErrorZ_free + * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SignedRawInvoiceParseErrorZ_clone_ptr + * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_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_1ChannelMonitorUpdateDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_SignedRawInvoiceParseErrorZ_clone + * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr + * Method: COption_MonitorEventZ_some * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1some (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone - * Signature: (J)J + * Method: COption_MonitorEventZ_none + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1none + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: C3Tuple_RawInvoice_u832InvoiceSignatureZ_new - * Signature: (J[BJ)J + * Method: COption_MonitorEventZ_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1new - (JNIEnv *, jclass, jlong, jbyteArray, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C3Tuple_RawInvoice_u832InvoiceSignatureZ_free - * Signature: (J)V + * Method: COption_MonitorEventZ_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PayeePubKeyErrorZ_ok + * Method: COption_MonitorEventZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PayeePubKeyErrorZ_err - * Signature: (Lorg/ldk/enums/Secp256k1Error;)J + * Method: CResult_COption_MonitorEventZDecodeErrorZ_ok + * 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_1COption_1MonitorEventZDecodeErrorZ_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PayeePubKeyErrorZ_is_ok - * Signature: (J)Z + * Method: CResult_COption_MonitorEventZDecodeErrorZ_err + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1is_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PayeePubKeyErrorZ_free - * Signature: (J)V + * Method: CResult_COption_MonitorEventZDecodeErrorZ_is_ok + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1free +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PayeePubKeyErrorZ_clone_ptr - * Signature: (J)J + * Method: CResult_COption_MonitorEventZDecodeErrorZ_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1clone_1ptr +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PayeePubKeyErrorZ_clone + * Method: CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_PrivateRouteZ_free - * Signature: ([J)V + * Method: CResult_COption_MonitorEventZDecodeErrorZ_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PrivateRouteZ_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: CResult_PositiveTimestampCreationErrorZ_ok + * Method: CResult_HTLCUpdateDecodeErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PositiveTimestampCreationErrorZ_err - * Signature: (Lorg/ldk/enums/CreationError;)J + * Method: CResult_HTLCUpdateDecodeErrorZ_err + * 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_1HTLCUpdateDecodeErrorZ_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PositiveTimestampCreationErrorZ_is_ok + * Method: CResult_HTLCUpdateDecodeErrorZ_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_1HTLCUpdateDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PositiveTimestampCreationErrorZ_free + * Method: CResult_HTLCUpdateDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PositiveTimestampCreationErrorZ_clone_ptr + * Method: CResult_HTLCUpdateDecodeErrorZ_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_1HTLCUpdateDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PositiveTimestampCreationErrorZ_clone + * Method: CResult_HTLCUpdateDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneSemanticErrorZ_ok - * Signature: ()J + * Method: C2Tuple_OutPointScriptZ_clone_ptr + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1ok - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneSemanticErrorZ_err - * Signature: (Lorg/ldk/enums/SemanticError;)J + * Method: C2Tuple_OutPointScriptZ_clone + * 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_C2Tuple_1OutPointScriptZ_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneSemanticErrorZ_is_ok - * Signature: (J)Z + * Method: C2Tuple_OutPointScriptZ_new + * Signature: (J[B)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_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_NoneSemanticErrorZ_free + * Method: C2Tuple_OutPointScriptZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneSemanticErrorZ_clone_ptr + * Method: C2Tuple_u32ScriptZ_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_C2Tuple_1u32ScriptZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneSemanticErrorZ_clone + * Method: C2Tuple_u32ScriptZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceSemanticErrorZ_ok - * Signature: (J)J + * Method: C2Tuple_u32ScriptZ_new + * Signature: (I[B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1new + (JNIEnv *, jclass, jint, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceSemanticErrorZ_err - * Signature: (Lorg/ldk/enums/SemanticError;)J + * Method: C2Tuple_u32ScriptZ_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1err - (JNIEnv *, jclass, jobject); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_InvoiceSemanticErrorZ_is_ok - * Signature: (J)Z + * Method: CVec_C2Tuple_u32ScriptZZ_free + * Signature: ([J)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_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_InvoiceSemanticErrorZ_free - * Signature: (J)V + * Method: C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_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_InvoiceSemanticErrorZ_clone_ptr + * Method: C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_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_InvoiceSemanticErrorZ_clone - * Signature: (J)J + * Method: C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new + * Signature: ([B[J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_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_DescriptionCreationErrorZ_ok - * Signature: (J)J + * Method: C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1ok +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_DescriptionCreationErrorZ_err - * Signature: (Lorg/ldk/enums/CreationError;)J + * Method: CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free + * Signature: ([J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1err - (JNIEnv *, jclass, jobject); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZZ_1free + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_DescriptionCreationErrorZ_is_ok - * Signature: (J)Z + * Method: CVec_EventZ_free + * Signature: ([J)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_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_DescriptionCreationErrorZ_free - * Signature: (J)V + * Method: CVec_TransactionZ_free + * Signature: ([[B)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_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_DescriptionCreationErrorZ_clone_ptr + * Method: C2Tuple_u32TxOutZ_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_C2Tuple_1u32TxOutZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_DescriptionCreationErrorZ_clone + * Method: C2Tuple_u32TxOutZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PrivateRouteCreationErrorZ_ok - * Signature: (J)J + * Method: C2Tuple_u32TxOutZ_new + * Signature: (IJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1new + (JNIEnv *, jclass, jint, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PrivateRouteCreationErrorZ_err - * Signature: (Lorg/ldk/enums/CreationError;)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1err - (JNIEnv *, jclass, jobject); + * 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_PrivateRouteCreationErrorZ_is_ok - * Signature: (J)Z + * Method: CVec_C2Tuple_u32TxOutZZ_free + * Signature: ([J)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1is_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32TxOutZZ_1free + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_PrivateRouteCreationErrorZ_free - * Signature: (J)V + * Method: C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PrivateRouteCreationErrorZ_clone_ptr + * Method: C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_PrivateRouteCreationErrorZ_clone - * Signature: (J)J + * Method: C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new + * Signature: ([B[J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1clone - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1new + (JNIEnv *, jclass, jbyteArray, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_StringErrorZ_ok - * Signature: (Ljava/lang/String;)J + * Method: C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1ok - (JNIEnv *, jclass, jstring); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_StringErrorZ_err - * Signature: (Lorg/ldk/enums/Secp256k1Error;)J + * Method: CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free + * Signature: ([J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1err - (JNIEnv *, jclass, jobject); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZZ_1free + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_StringErrorZ_is_ok - * Signature: (J)Z + * Method: CVec_BalanceZ_free + * Signature: ([J)V */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1is_1ok - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1BalanceZ_1free + (JNIEnv *, jclass, jlongArray); /* * Class: org_ldk_impl_bindings - * Method: CResult_StringErrorZ_free - * Signature: (J)V + * Method: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_StringErrorZ_clone_ptr + * Method: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_StringErrorZ_clone - * Signature: (J)J + * Method: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1StringErrorZ_1clone +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_ok - * Signature: (J)J + * Method: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1ok +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_err + * Method: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok - * Signature: (J)Z + * Method: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone + * Signature: (J)J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1is_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_free - * Signature: (J)V + * Method: C2Tuple_PublicKeyTypeZ_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr + * Method: C2Tuple_PublicKeyTypeZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_ChannelMonitorUpdateDecodeErrorZ_clone - * Signature: (J)J + * Method: C2Tuple_PublicKeyTypeZ_new + * Signature: ([BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1ChannelMonitorUpdateDecodeErrorZ_1clone +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_C2Tuple_1PublicKeyTypeZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_MonitorEventZ_some + * Method: CVec_C2Tuple_PublicKeyTypeZZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1PublicKeyTypeZZ_1free + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: COption_CustomOnionMessageContentsZ_some * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1some +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1some (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_MonitorEventZ_none + * Method: COption_CustomOnionMessageContentsZ_none * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1none +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1none (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: COption_MonitorEventZ_free + * Method: COption_CustomOnionMessageContentsZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_MonitorEventZ_clone_ptr + * Method: COption_CustomOnionMessageContentsZ_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_COption_1CustomOnionMessageContentsZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_MonitorEventZ_clone + * Method: COption_CustomOnionMessageContentsZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1MonitorEventZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_MonitorEventZDecodeErrorZ_ok + * Method: CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_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_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_MonitorEventZDecodeErrorZ_err + * Method: CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_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_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_MonitorEventZDecodeErrorZ_is_ok + * Method: CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_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_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_MonitorEventZDecodeErrorZ_free + * Method: CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1clone_1ptr +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_MonitorEventZDecodeErrorZ_clone + * Method: CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1MonitorEventZDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_HTLCUpdateDecodeErrorZ_ok + * Method: CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_HTLCUpdateDecodeErrorZ_err + * Method: COption_NetAddressZ_some * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1some (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_HTLCUpdateDecodeErrorZ_is_ok - * Signature: (J)Z + * Method: COption_NetAddressZ_none + * Signature: ()J */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_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_HTLCUpdateDecodeErrorZ_free + * Method: COption_NetAddressZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_HTLCUpdateDecodeErrorZ_clone_ptr + * Method: COption_NetAddressZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_HTLCUpdateDecodeErrorZ_clone + * Method: COption_NetAddressZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1HTLCUpdateDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_OutPointScriptZ_clone_ptr - * Signature: (J)J + * Method: CResult_CVec_u8ZPeerHandleErrorZ_ok + * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1clone_1ptr - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1ok + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_OutPointScriptZ_clone + * Method: CResult_CVec_u8ZPeerHandleErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_OutPointScriptZ_new - * Signature: (J[B)J + * Method: CResult_CVec_u8ZPeerHandleErrorZ_is_ok + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1new - (JNIEnv *, jclass, jlong, jbyteArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_OutPointScriptZ_free + * Method: CResult_CVec_u8ZPeerHandleErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_u32ScriptZ_clone_ptr + * Method: CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_u32ScriptZ_clone + * Method: CResult_CVec_u8ZPeerHandleErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_u32ScriptZ_new - * Signature: (I[B)J + * Method: CResult_NonePeerHandleErrorZ_ok + * Signature: ()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_1NonePeerHandleErrorZ_1ok + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_u32ScriptZ_free - * Signature: (J)V + * Method: CResult_NonePeerHandleErrorZ_err + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32ScriptZ_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_C2Tuple_u32ScriptZZ_free - * Signature: ([J)V + * Method: CResult_NonePeerHandleErrorZ_is_ok + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32ScriptZZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr - * Signature: (J)J + * Method: CResult_NonePeerHandleErrorZ_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZ_1clone_1ptr +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone + * Method: CResult_NonePeerHandleErrorZ_clone_ptr * 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_1NonePeerHandleErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new - * Signature: ([B[J)J + * Method: CResult_NonePeerHandleErrorZ_clone + * Signature: (J)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_1NonePeerHandleErrorZ_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free - * Signature: (J)V + * Method: CResult_boolPeerHandleErrorZ_ok + * Signature: (Z)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_1boolPeerHandleErrorZ_1ok + (JNIEnv *, jclass, jboolean); /* * Class: org_ldk_impl_bindings - * Method: CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free - * Signature: ([J)V + * Method: CResult_boolPeerHandleErrorZ_err + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1err + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_EventZ_free - * Signature: ([J)V + * Method: CResult_boolPeerHandleErrorZ_is_ok + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1EventZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_TransactionZ_free - * Signature: ([[B)V + * Method: CResult_boolPeerHandleErrorZ_free + * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free - (JNIEnv *, jclass, jobjectArray); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1free + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_u32TxOutZ_clone_ptr + * Method: CResult_boolPeerHandleErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_u32TxOutZ_clone + * Method: CResult_boolPeerHandleErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_u32TxOutZ_new - * Signature: (IJ)J + * Method: CResult_NoneSendErrorZ_ok + * Signature: ()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_1NoneSendErrorZ_1ok + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_u32TxOutZ_free - * Signature: (J)V + * Method: CResult_NoneSendErrorZ_err + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u32TxOutZ_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_C2Tuple_u32TxOutZZ_free - * Signature: ([J)V + * Method: CResult_NoneSendErrorZ_is_ok + * Signature: (J)Z */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1u32TxOutZZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr - * Signature: (J)J + * Method: CResult_NoneSendErrorZ_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1clone_1ptr +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone + * Method: CResult_SiPrefixParseErrorZ_ok + * Signature: (Lorg/ldk/enums/SiPrefix;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1ok + (JNIEnv *, jclass, jobject); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_SiPrefixParseErrorZ_err * 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_1SiPrefixParseErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new - * Signature: ([B[J)J + * Method: CResult_SiPrefixParseErrorZ_is_ok + * Signature: (J)Z */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1new - (JNIEnv *, jclass, jbyteArray, jlongArray); +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free + * Method: CResult_SiPrefixParseErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free - * Signature: ([J)V + * Method: CResult_SiPrefixParseErrorZ_clone_ptr + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZZ_1free - (JNIEnv *, jclass, jlongArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SiPrefixParseErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_BalanceZ_free - * Signature: ([J)V + * Method: CResult_SiPrefixParseErrorZ_clone + * 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_1SiPrefixParseErrorZ_1clone + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok + * Method: CResult_InvoiceParseOrSemanticErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err + * Method: CResult_InvoiceParseOrSemanticErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1BlockHashChannelMonitorZDecodeErrorZ_1err +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceParseOrSemanticErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok + * Method: CResult_InvoiceParseOrSemanticErrorZ_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_1InvoiceParseOrSemanticErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free + * Method: CResult_InvoiceParseOrSemanticErrorZ_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_1InvoiceParseOrSemanticErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr + * Method: CResult_InvoiceParseOrSemanticErrorZ_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_1InvoiceParseOrSemanticErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone + * Method: CResult_InvoiceParseOrSemanticErrorZ_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_1InvoiceParseOrSemanticErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_PublicKeyTypeZ_clone_ptr + * Method: CResult_SignedRawInvoiceParseErrorZ_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_1SignedRawInvoiceParseErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_PublicKeyTypeZ_clone + * Method: CResult_SignedRawInvoiceParseErrorZ_err * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1err (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_PublicKeyTypeZ_new - * Signature: ([BJ)J + * Method: CResult_SignedRawInvoiceParseErrorZ_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_1SignedRawInvoiceParseErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: C2Tuple_PublicKeyTypeZ_free + * Method: CResult_SignedRawInvoiceParseErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1PublicKeyTypeZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CVec_C2Tuple_PublicKeyTypeZZ_free - * Signature: ([J)V + * Method: CResult_SignedRawInvoiceParseErrorZ_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_1SignedRawInvoiceParseErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_CustomOnionMessageContentsZ_some + * Method: CResult_SignedRawInvoiceParseErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1some +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignedRawInvoiceParseErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_CustomOnionMessageContentsZ_none - * Signature: ()J + * Method: C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1none - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1clone_1ptr + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_CustomOnionMessageContentsZ_free - * Signature: (J)V + * Method: C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone + * Signature: (J)J */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1free +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_CustomOnionMessageContentsZ_clone_ptr - * Signature: (J)J + * Method: C3Tuple_RawInvoice_u832InvoiceSignatureZ_new + * Signature: (J[BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1clone_1ptr - (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: COption_CustomOnionMessageContentsZ_clone - * Signature: (J)J + * Method: C3Tuple_RawInvoice_u832InvoiceSignatureZ_free + * Signature: (J)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1CustomOnionMessageContentsZ_1clone +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1RawInvoice_1u832InvoiceSignatureZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_ok + * Method: CResult_PayeePubKeyErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1ok +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_err - * Signature: (J)J + * Method: CResult_PayeePubKeyErrorZ_err + * Signature: (Lorg/ldk/enums/Secp256k1Error;)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1err - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1err + (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_is_ok + * Method: CResult_PayeePubKeyErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_free + * Method: CResult_PayeePubKeyErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone_ptr + * Method: CResult_PayeePubKeyErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_COption_CustomOnionMessageContentsZDecodeErrorZ_clone + * Method: CResult_PayeePubKeyErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1COption_1CustomOnionMessageContentsZDecodeErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PayeePubKeyErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_NetAddressZ_some + * Method: CVec_PrivateRouteZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PrivateRouteZ_1free + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PositiveTimestampCreationErrorZ_ok * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1some +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_NetAddressZ_none - * Signature: ()J + * Method: CResult_PositiveTimestampCreationErrorZ_err + * Signature: (Lorg/ldk/enums/CreationError;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1err + (JNIEnv *, jclass, jobject); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PositiveTimestampCreationErrorZ_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_1PositiveTimestampCreationErrorZ_1is_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_NetAddressZ_free + * Method: CResult_PositiveTimestampCreationErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_NetAddressZ_clone_ptr + * Method: CResult_PositiveTimestampCreationErrorZ_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_1PositiveTimestampCreationErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: COption_NetAddressZ_clone + * Method: CResult_PositiveTimestampCreationErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_COption_1NetAddressZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PositiveTimestampCreationErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_u8ZPeerHandleErrorZ_ok - * Signature: ([B)J + * Method: CResult_NoneSemanticErrorZ_ok + * Signature: ()J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1ok - (JNIEnv *, jclass, jbyteArray); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1ok + (JNIEnv *, jclass); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_u8ZPeerHandleErrorZ_err - * Signature: (J)J + * Method: CResult_NoneSemanticErrorZ_err + * Signature: (Lorg/ldk/enums/SemanticError;)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1err - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1err + (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_u8ZPeerHandleErrorZ_is_ok + * Method: CResult_NoneSemanticErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_u8ZPeerHandleErrorZ_free + * Method: CResult_NoneSemanticErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr + * Method: CResult_NoneSemanticErrorZ_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_CResult_1NoneSemanticErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_CVec_u8ZPeerHandleErrorZ_clone + * Method: CResult_NoneSemanticErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSemanticErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePeerHandleErrorZ_ok - * Signature: ()J + * Method: CResult_InvoiceSemanticErrorZ_ok + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1ok - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePeerHandleErrorZ_err - * Signature: (J)J + * Method: CResult_InvoiceSemanticErrorZ_err + * Signature: (Lorg/ldk/enums/SemanticError;)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1err - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1err + (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePeerHandleErrorZ_is_ok + * Method: CResult_InvoiceSemanticErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePeerHandleErrorZ_free + * Method: CResult_InvoiceSemanticErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePeerHandleErrorZ_clone_ptr + * Method: CResult_InvoiceSemanticErrorZ_clone_ptr * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1clone_1ptr +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NonePeerHandleErrorZ_clone + * Method: CResult_InvoiceSemanticErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSemanticErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_boolPeerHandleErrorZ_ok - * Signature: (Z)J + * Method: CResult_DescriptionCreationErrorZ_ok + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1ok - (JNIEnv *, jclass, jboolean); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_boolPeerHandleErrorZ_err - * Signature: (J)J + * Method: CResult_DescriptionCreationErrorZ_err + * Signature: (Lorg/ldk/enums/CreationError;)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1err - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1err + (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: CResult_boolPeerHandleErrorZ_is_ok + * Method: CResult_DescriptionCreationErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_boolPeerHandleErrorZ_free + * Method: CResult_DescriptionCreationErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1free (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_boolPeerHandleErrorZ_clone_ptr + * Method: CResult_DescriptionCreationErrorZ_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_CResult_1DescriptionCreationErrorZ_1clone_1ptr (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_boolPeerHandleErrorZ_clone + * Method: CResult_DescriptionCreationErrorZ_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1clone +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1DescriptionCreationErrorZ_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneSendErrorZ_ok - * Signature: ()J + * Method: CResult_PrivateRouteCreationErrorZ_ok + * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1ok - (JNIEnv *, jclass); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1ok + (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneSendErrorZ_err - * Signature: (J)J + * Method: CResult_PrivateRouteCreationErrorZ_err + * Signature: (Lorg/ldk/enums/CreationError;)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1err - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1err + (JNIEnv *, jclass, jobject); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneSendErrorZ_is_ok + * Method: CResult_PrivateRouteCreationErrorZ_is_ok * Signature: (J)Z */ -JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1is_1ok +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1is_1ok (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: CResult_NoneSendErrorZ_free + * Method: CResult_PrivateRouteCreationErrorZ_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneSendErrorZ_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PrivateRouteCreationErrorZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CResult_PrivateRouteCreationErrorZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PrivateRouteCreationErrorZ_1clone (JNIEnv *, jclass, jlong); /* @@ -12751,6 +12991,54 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1LockedChannelMonitorN JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1OutPointZ_1free (JNIEnv *, jclass, jlongArray); +/* + * Class: org_ldk_impl_bindings + * Method: CVec_MonitorUpdateIdZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorUpdateIdZ_1free + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new + * Signature: (J[J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1new + (JNIEnv *, jclass, jlong, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointCVec_1MonitorUpdateIdZZ_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free + * Signature: ([J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1OutPointCVec_1MonitorUpdateIdZZZ_1free + (JNIEnv *, jclass, jlongArray); + /* * Class: org_ldk_impl_bindings * Method: PaymentPurpose_free @@ -12959,6 +13247,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1next_1hop_1c JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1unknown_1next_1hop (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: HTLCDestination_invalid_forward + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCDestination_1invalid_1forward + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: HTLCDestination_failed_payment @@ -13018,26 +13314,26 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1clone /* * Class: org_ldk_impl_bindings * Method: Event_funding_generation_ready - * Signature: ([B[BJ[BJ)J + * Signature: ([B[BJ[B[B)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1funding_1generation_1ready - (JNIEnv *, jclass, jbyteArray, jbyteArray, jlong, jbyteArray, jlong); + (JNIEnv *, jclass, jbyteArray, jbyteArray, jlong, jbyteArray, jbyteArray); /* * Class: org_ldk_impl_bindings - * Method: Event_payment_received - * Signature: ([BJJ)J + * Method: Event_payment_claimable + * Signature: ([B[BJJ[BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1received - (JNIEnv *, jclass, jbyteArray, jlong, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1claimable + (JNIEnv *, jclass, jbyteArray, jbyteArray, jlong, jlong, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings * Method: Event_payment_claimed - * Signature: ([BJJ)J + * Signature: ([B[BJJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1claimed - (JNIEnv *, jclass, jbyteArray, jlong, jlong); + (JNIEnv *, jclass, jbyteArray, jbyteArray, jlong, jlong); /* * Class: org_ldk_impl_bindings @@ -13095,6 +13391,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1probe_1failed JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1pending_1htlcs_1forwardable (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: Event_htlcintercepted + * Signature: ([BJ[BJJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1htlcintercepted + (JNIEnv *, jclass, jbyteArray, jlong, jbyteArray, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: Event_spendable_outputs @@ -13111,13 +13415,21 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1spendable_1outputs JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1forwarded (JNIEnv *, jclass, jbyteArray, jbyteArray, jlong, jboolean); +/* + * Class: org_ldk_impl_bindings + * Method: Event_channel_ready + * Signature: ([B[B[BJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1channel_1ready + (JNIEnv *, jclass, jbyteArray, jbyteArray, jbyteArray, jlong); + /* * Class: org_ldk_impl_bindings * Method: Event_channel_closed - * Signature: ([BJJ)J + * Signature: ([B[BJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1channel_1closed - (JNIEnv *, jclass, jbyteArray, jlong, jlong); + (JNIEnv *, jclass, jbyteArray, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings @@ -13417,10 +13729,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_APIError_1fee_1rate_1too_1hig /* * Class: org_ldk_impl_bindings - * Method: APIError_route_error + * Method: APIError_invalid_route * Signature: (Ljava/lang/String;)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_APIError_1route_1error +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_APIError_1invalid_1route (JNIEnv *, jclass, jstring); /* @@ -13567,6 +13879,38 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_construct_1invoice_1prei JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Persister_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: PrintableString_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrintableString_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: PrintableString_get_a + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_PrintableString_1get_1a + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: PrintableString_set_a + * Signature: (JLjava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PrintableString_1set_1a + (JNIEnv *, jclass, jlong, jstring); + +/* + * Class: org_ldk_impl_bindings + * Method: PrintableString_new + * Signature: (Ljava/lang/String;)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PrintableString_1new + (JNIEnv *, jclass, jstring); + /* * Class: org_ldk_impl_bindings * Method: FutureCallback_free @@ -14399,13 +14743,29 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1manually_ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1manually_1accept_1inbound_1channels (JNIEnv *, jclass, jlong, jboolean); +/* + * Class: org_ldk_impl_bindings + * Method: UserConfig_get_accept_intercept_htlcs + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1accept_1intercept_1htlcs + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: UserConfig_set_accept_intercept_htlcs + * Signature: (JZ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1accept_1intercept_1htlcs + (JNIEnv *, jclass, jlong, jboolean); + /* * Class: org_ldk_impl_bindings * Method: UserConfig_new - * Signature: (JJJZZZ)J + * Signature: (JJJZZZZ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1new - (JNIEnv *, jclass, jlong, jlong, jlong, jboolean, jboolean, jboolean); + (JNIEnv *, jclass, jlong, jlong, jlong, jboolean, jboolean, jboolean, jboolean); /* * Class: org_ldk_impl_bindings @@ -14735,6 +15095,14 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1normal JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1high_1priority (JNIEnv *, jclass); +/* + * Class: org_ldk_impl_bindings + * Method: ConfirmationTarget_hash + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1hash + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: ConfirmationTarget_eq @@ -14847,6 +15215,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1get_1monitor JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1list_1monitors (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ChainMonitor_list_pending_monitor_updates + * Signature: (J)[J + */ +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1list_1pending_1monitor_1updates + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChainMonitor_channel_monitor_updated @@ -15298,9 +15674,9 @@ JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1best_1bl /* * Class: org_ldk_impl_bindings * Method: ChannelMonitor_get_relevant_txids - * Signature: (J)[[B + * Signature: (J)[J */ -JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1relevant_1txids +JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1relevant_1txids (JNIEnv *, jclass, jlong); /* @@ -16602,18 +16978,18 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1unspendab /* * Class: org_ldk_impl_bindings * Method: ChannelDetails_get_user_channel_id - * Signature: (J)J + * Signature: (J)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1user_1channel_1id +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1user_1channel_1id (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings * Method: ChannelDetails_set_user_channel_id - * Signature: (JJ)V + * Signature: (J[B)V */ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1user_1channel_1id - (JNIEnv *, jclass, jlong, jlong); + (JNIEnv *, jclass, jlong, jbyteArray); /* * Class: org_ldk_impl_bindings @@ -16695,6 +17071,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1confirma JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1confirmations_1required (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelDetails_get_confirmations + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1confirmations + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelDetails_set_confirmations + * Signature: (JJ)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1confirmations + (JNIEnv *, jclass, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelDetails_get_force_close_spend_delay @@ -16826,10 +17218,10 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1config /* * Class: org_ldk_impl_bindings * Method: ChannelDetails_new - * Signature: ([BJJJJJJJJJJJJJJJZZZZJJJ)J + * Signature: ([BJJJJJJJJ[BJJJJJJJZZZZJJJ)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, jlong, jlong, jboolean, jboolean, jboolean, jboolean, jlong, jlong, jlong); + (JNIEnv *, jclass, jbyteArray, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jbyteArray, jlong, jlong, jlong, jlong, jlong, jlong, jlong, jboolean, jboolean, jboolean, jboolean, jlong, jlong, jlong); /* * Class: org_ldk_impl_bindings @@ -16905,12 +17297,20 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1path_1par /* * Class: org_ldk_impl_bindings - * Method: PaymentSendFailure_all_failed_retry_safe + * Method: PaymentSendFailure_all_failed_resend_safe * Signature: ([J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1all_1failed_1retry_1safe +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1all_1failed_1resend_1safe (JNIEnv *, jclass, jlongArray); +/* + * Class: org_ldk_impl_bindings + * Method: PaymentSendFailure_duplicate_payment + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1duplicate_1payment + (JNIEnv *, jclass); + /* * Class: org_ldk_impl_bindings * Method: PaymentSendFailure_partial_failure @@ -17018,10 +17418,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1current_ /* * Class: org_ldk_impl_bindings * Method: ChannelManager_create_channel - * Signature: (J[BJJJJ)J + * Signature: (J[BJJ[BJ)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1channel - (JNIEnv *, jclass, jlong, jbyteArray, jlong, jlong, jlong, jlong); + (JNIEnv *, jclass, jlong, jbyteArray, jlong, jlong, jbyteArray, jlong); /* * Class: org_ldk_impl_bindings @@ -17090,10 +17490,10 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1 /* * Class: org_ldk_impl_bindings * Method: ChannelManager_send_payment - * Signature: (JJ[B[B)J + * Signature: (JJ[B[B[B)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payment - (JNIEnv *, jclass, jlong, jlong, jbyteArray, jbyteArray); + (JNIEnv *, jclass, jlong, jlong, jbyteArray, jbyteArray, jbyteArray); /* * Class: org_ldk_impl_bindings @@ -17114,10 +17514,10 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1abandon_1payme /* * Class: org_ldk_impl_bindings * Method: ChannelManager_send_spontaneous_payment - * Signature: (JJ[B)J + * Signature: (JJ[B[B)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1spontaneous_1payment - (JNIEnv *, jclass, jlong, jlong, jbyteArray); + (JNIEnv *, jclass, jlong, jlong, jbyteArray, jbyteArray); /* * Class: org_ldk_impl_bindings @@ -17143,6 +17543,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1funding_1tran JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1update_1channel_1config (JNIEnv *, jclass, jlong, jbyteArray, jobjectArray, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelManager_forward_intercepted_htlc + * Signature: (J[B[B[BJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1forward_1intercepted_1htlc + (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelManager_fail_intercepted_htlc + * Signature: (J[B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1fail_1intercepted_1htlc + (JNIEnv *, jclass, jlong, jbyteArray); + /* * Class: org_ldk_impl_bindings * Method: ChannelManager_process_pending_htlc_forwards @@ -17186,18 +17602,18 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1our /* * Class: org_ldk_impl_bindings * Method: ChannelManager_accept_inbound_channel - * Signature: (J[B[BJ)J + * Signature: (J[B[B[B)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1accept_1inbound_1channel - (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray, jlong); + (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray, jbyteArray); /* * Class: org_ldk_impl_bindings * Method: ChannelManager_accept_inbound_channel_from_trusted_peer_0conf - * Signature: (J[B[BJ)J + * Signature: (J[B[B[B)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1accept_1inbound_1channel_1from_1trusted_1peer_10conf - (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray, jlong); + (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray, jbyteArray); /* * Class: org_ldk_impl_bindings @@ -17255,6 +17671,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1phantom_ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1phantom_1route_1hints (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelManager_get_intercept_scid + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1intercept_1scid + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelManager_compute_inflight_htlcs + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1compute_1inflight_1htlcs + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelManager_as_MessageSendEventsProvider @@ -22503,6 +22935,70 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_htlc_1success_1tx_1weight JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_htlc_1timeout_1tx_1weight (JNIEnv *, jclass, jboolean); +/* + * Class: org_ldk_impl_bindings + * Method: HTLCClaim_clone + * Signature: (J)Lorg/ldk/enums/HTLCClaim; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: HTLCClaim_offered_timeout + * Signature: ()Lorg/ldk/enums/HTLCClaim; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1offered_1timeout + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: HTLCClaim_offered_preimage + * Signature: ()Lorg/ldk/enums/HTLCClaim; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1offered_1preimage + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: HTLCClaim_accepted_timeout + * Signature: ()Lorg/ldk/enums/HTLCClaim; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1accepted_1timeout + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: HTLCClaim_accepted_preimage + * Signature: ()Lorg/ldk/enums/HTLCClaim; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1accepted_1preimage + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: HTLCClaim_revocation + * Signature: ()Lorg/ldk/enums/HTLCClaim; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1revocation + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: HTLCClaim_eq + * Signature: (JJ)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1eq + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: HTLCClaim_from_witness + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCClaim_1from_1witness + (JNIEnv *, jclass, jbyteArray); + /* * Class: org_ldk_impl_bindings * Method: build_commitment_secret @@ -22594,33 +23090,33 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CounterpartyCommitmentSecrets /* * Class: org_ldk_impl_bindings * Method: derive_private_key - * Signature: ([B[B)J + * Signature: ([B[B)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1private_1key +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_derive_1private_1key (JNIEnv *, jclass, jbyteArray, jbyteArray); /* * Class: org_ldk_impl_bindings * Method: derive_public_key - * Signature: ([B[B)J + * Signature: ([B[B)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1public_1key +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_derive_1public_1key (JNIEnv *, jclass, jbyteArray, jbyteArray); /* * Class: org_ldk_impl_bindings * Method: derive_private_revocation_key - * Signature: ([B[B)J + * Signature: ([B[B)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1private_1revocation_1key +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_derive_1private_1revocation_1key (JNIEnv *, jclass, jbyteArray, jbyteArray); /* * Class: org_ldk_impl_bindings * Method: derive_public_revocation_key - * Signature: ([B[B)J + * Signature: ([B[B)[B */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1public_1revocation_1key +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_derive_1public_1revocation_1key (JNIEnv *, jclass, jbyteArray, jbyteArray); /* @@ -23074,10 +23570,26 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_make_1funding_1redeemscr /* * Class: org_ldk_impl_bindings * Method: build_htlc_transaction - * Signature: ([BISJZ[B[B)[B + * Signature: ([BISJZZ[B[B)[B */ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_build_1htlc_1transaction - (JNIEnv *, jclass, jbyteArray, jint, jshort, jlong, jboolean, jbyteArray, jbyteArray); + (JNIEnv *, jclass, jbyteArray, jint, jshort, jlong, jboolean, jboolean, jbyteArray, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: build_htlc_input_witness + * Signature: ([B[B[B[BZ)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_build_1htlc_1input_1witness + (JNIEnv *, jclass, jbyteArray, jbyteArray, jbyteArray, jbyteArray, jboolean); + +/* + * Class: org_ldk_impl_bindings + * Method: get_to_countersignatory_with_anchors_redeemscript + * Signature: ([B)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_get_1to_1countersignatory_1with_1anchors_1redeemscript + (JNIEnv *, jclass, jbyteArray); /* * Class: org_ldk_impl_bindings @@ -23087,6 +23599,14 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_build_1htlc_1transaction JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_get_1anchor_1redeemscript (JNIEnv *, jclass, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: build_anchor_input_witness + * Signature: ([B[B)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_build_1anchor_1input_1witness + (JNIEnv *, jclass, jbyteArray, jbyteArray); + /* * Class: org_ldk_impl_bindings * Method: ChannelTransactionParameters_free @@ -23191,13 +23711,29 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameter JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1opt_1anchors (JNIEnv *, jclass, jlong, jobject); +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTransactionParameters_get_opt_non_zero_fee_anchors + * Signature: (J)Lorg/ldk/enums/COption_NoneZ; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1opt_1non_1zero_1fee_1anchors + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ChannelTransactionParameters_set_opt_non_zero_fee_anchors + * Signature: (JLorg/ldk/enums/COption_NoneZ;)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1opt_1non_1zero_1fee_1anchors + (JNIEnv *, jclass, jlong, jobject); + /* * Class: org_ldk_impl_bindings * Method: ChannelTransactionParameters_new - * Signature: (JSZJJLorg/ldk/enums/COption_NoneZ;)J + * Signature: (JSZJJLorg/ldk/enums/COption_NoneZ;Lorg/ldk/enums/COption_NoneZ;)J */ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1new - (JNIEnv *, jclass, jlong, jshort, jboolean, jlong, jlong, jobject); + (JNIEnv *, jclass, jlong, jshort, jboolean, jlong, jlong, jobject, jobject); /* * Class: org_ldk_impl_bindings @@ -23871,6 +24407,22 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1eq JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1eq (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: OfferFeatures_eq + * Signature: (JJ)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1eq + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InvoiceRequestFeatures_eq + * Signature: (JJ)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1eq + (JNIEnv *, jclass, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelTypeFeatures_eq @@ -23943,6 +24495,38 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1clone_1ptr JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1clone (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: OfferFeatures_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: OfferFeatures_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InvoiceRequestFeatures_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InvoiceRequestFeatures_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1clone + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelTypeFeatures_clone_ptr @@ -23991,6 +24575,22 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1free JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: OfferFeatures_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InvoiceRequestFeatures_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1free + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelTypeFeatures_free @@ -24063,6 +24663,38 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1empty JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceFeatures_1requires_1unknown_1bits (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: OfferFeatures_empty + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1empty + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: OfferFeatures_requires_unknown_bits + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1requires_1unknown_1bits + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InvoiceRequestFeatures_empty + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1empty + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: InvoiceRequestFeatures_requires_unknown_bits + * Signature: (J)Z + */ +JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1requires_1unknown_1bits + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: ChannelTypeFeatures_empty @@ -24159,6 +24791,38 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1wri JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelTypeFeatures_1read (JNIEnv *, jclass, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: OfferFeatures_write + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1write + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: OfferFeatures_read + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OfferFeatures_1read + (JNIEnv *, jclass, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: InvoiceRequestFeatures_write + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1write + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InvoiceRequestFeatures_read + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoiceRequestFeatures_1read + (JNIEnv *, jclass, jbyteArray); + /* * Class: org_ldk_impl_bindings * Method: InitFeatures_set_data_loss_protect_optional @@ -25593,11 +26257,11 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_P2PGossipSync_1add_1chain_1acc /* * Class: org_ldk_impl_bindings - * Method: NetworkGraph_as_EventHandler - * Signature: (J)J + * Method: NetworkGraph_handle_network_update + * Signature: (JJ)V */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1as_1EventHandler - (JNIEnv *, jclass, jlong); +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1handle_1network_1update + (JNIEnv *, jclass, jlong, jlong); /* * Class: org_ldk_impl_bindings @@ -25972,23 +26636,15 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1clone_1p * Method: DirectedChannelInfo_clone * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1clone - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: DirectedChannelInfo_channel - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1channel +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1clone (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: DirectedChannelInfo_direction + * Method: DirectedChannelInfo_channel * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1direction +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectedChannelInfo_1channel (JNIEnv *, jclass, jlong); /* @@ -26679,6 +27335,126 @@ JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1li JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReadOnlyNetworkGraph_1get_1addresses (JNIEnv *, jclass, jlong, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: DefaultRouter_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DefaultRouter_new + * Signature: (JJ[BJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1new + (JNIEnv *, jclass, jlong, jlong, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: DefaultRouter_as_Router + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1as_1Router + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Router_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ScorerAccountingForInFlightHtlcs_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ScorerAccountingForInFlightHtlcs_new + * Signature: (JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1new + (JNIEnv *, jclass, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ScorerAccountingForInFlightHtlcs_write + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1write + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: ScorerAccountingForInFlightHtlcs_as_Score + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ScorerAccountingForInFlightHtlcs_1as_1Score + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InFlightHtlcs_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InFlightHtlcs_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InFlightHtlcs_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InFlightHtlcs_new + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1new + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: InFlightHtlcs_used_liquidity_msat + * Signature: (JJJJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1used_1liquidity_1msat + (JNIEnv *, jclass, jlong, jlong, jlong, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InFlightHtlcs_write + * Signature: (J)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1write + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: InFlightHtlcs_read + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1read + (JNIEnv *, jclass, jbyteArray); + /* * Class: org_ldk_impl_bindings * Method: RouteHop_free @@ -28033,10 +28809,26 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ProbabilisticScorer_1read /* * Class: org_ldk_impl_bindings - * Method: BlindedRoute_free + * Method: BlindedPath_free * Signature: (J)V */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedRoute_1free +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedPath_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: BlindedPath_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPath_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: BlindedPath_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPath_1clone (JNIEnv *, jclass, jlong); /* @@ -28049,26 +28841,42 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlindedHop_1free /* * Class: org_ldk_impl_bindings - * Method: BlindedRoute_new + * Method: BlindedHop_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedHop_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: BlindedHop_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedHop_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: BlindedPath_new * Signature: ([[BJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedRoute_1new +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPath_1new (JNIEnv *, jclass, jobjectArray, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedRoute_write + * Method: BlindedPath_write * Signature: (J)[B */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BlindedRoute_1write +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_BlindedPath_1write (JNIEnv *, jclass, jlong); /* * Class: org_ldk_impl_bindings - * Method: BlindedRoute_read + * Method: BlindedPath_read * Signature: ([B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedRoute_1read +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlindedPath_1read (JNIEnv *, jclass, jbyteArray); /* @@ -28103,6 +28911,22 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1free JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Destination_1free (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: Destination_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Destination_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: Destination_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Destination_1clone + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: Destination_node @@ -28113,10 +28937,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Destination_1node /* * Class: org_ldk_impl_bindings - * Method: Destination_blinded_route + * Method: Destination_blinded_path * Signature: (J)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Destination_1blinded_1route +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Destination_1blinded_1path (JNIEnv *, jclass, jlong); /* @@ -28191,6 +29015,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendError_1invalid_1message JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendError_1buffer_1full (JNIEnv *, jclass); +/* + * Class: org_ldk_impl_bindings + * Method: SendError_get_node_id_failed + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendError_1get_1node_1id_1failed + (JNIEnv *, jclass); + +/* + * Class: org_ldk_impl_bindings + * Method: SendError_blinded_path_advance_failed + * Signature: ()J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SendError_1blinded_1path_1advance_1failed + (JNIEnv *, jclass); + /* * Class: org_ldk_impl_bindings * Method: SendError_eq @@ -28217,10 +29057,10 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1new /* * Class: org_ldk_impl_bindings - * Method: OnionMessenger_send_custom_onion_message + * Method: OnionMessenger_send_onion_message * Signature: (J[[BJJJ)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1send_1custom_1onion_1message +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1send_1onion_1message (JNIEnv *, jclass, jlong, jobjectArray, jlong, jlong, jlong); /* @@ -28239,6 +29079,38 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1as_1OnionMess JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessenger_1as_1OnionMessageProvider (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: OnionMessageContents_free + * Signature: (J)V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1free + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: OnionMessageContents_clone_ptr + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1clone_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: OnionMessageContents_clone + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1clone + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: OnionMessageContents_custom + * Signature: (J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OnionMessageContents_1custom + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: CustomOnionMessageContents_clone_ptr @@ -29975,14 +30847,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1free JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Payer_1free (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: Router_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Router_1free - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: Retry_free @@ -30103,6 +30967,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1new JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1invoice (JNIEnv *, jclass, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: InvoicePayer_pay_invoice_with_id + * Signature: (JJ[B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1invoice_1with_1id + (JNIEnv *, jclass, jlong, jlong, jbyteArray); + /* * Class: org_ldk_impl_bindings * Method: InvoicePayer_pay_zero_value_invoice @@ -30111,6 +30983,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1invoice JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1zero_1value_1invoice (JNIEnv *, jclass, jlong, jlong, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: InvoicePayer_pay_zero_value_invoice_with_id + * Signature: (JJJ[B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1zero_1value_1invoice_1with_1id + (JNIEnv *, jclass, jlong, jlong, jlong, jbyteArray); + /* * Class: org_ldk_impl_bindings * Method: InvoicePayer_pay_pubkey @@ -30119,6 +30999,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1zero_1valu JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1pubkey (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray, jlong, jint); +/* + * Class: org_ldk_impl_bindings + * Method: InvoicePayer_pay_pubkey_with_id + * Signature: (J[B[B[BJI)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1pay_1pubkey_1with_1id + (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray, jbyteArray, jlong, jint); + /* * Class: org_ldk_impl_bindings * Method: InvoicePayer_remove_cached_payment @@ -30135,38 +31023,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1remove_1cached_1 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InvoicePayer_1as_1EventHandler (JNIEnv *, jclass, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: InFlightHtlcs_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: InFlightHtlcs_used_liquidity_msat - * Signature: (JJJJ)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1used_1liquidity_1msat - (JNIEnv *, jclass, jlong, jlong, jlong, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: InFlightHtlcs_write - * Signature: (J)[B - */ -JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1write - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: InFlightHtlcs_read - * Signature: ([B)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InFlightHtlcs_1read - (JNIEnv *, jclass, jbyteArray); - /* * Class: org_ldk_impl_bindings * Method: create_phantom_invoice @@ -30217,27 +31073,11 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channe /* * Class: org_ldk_impl_bindings - * Method: DefaultRouter_free - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1free - (JNIEnv *, jclass, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: DefaultRouter_new - * Signature: (JJ[BJ)J - */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1new - (JNIEnv *, jclass, jlong, jlong, jbyteArray, jlong); - -/* - * Class: org_ldk_impl_bindings - * Method: DefaultRouter_as_Router - * Signature: (J)J + * Method: create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash + * Signature: (JJJLorg/ldk/enums/Currency;JLjava/lang/String;JI[B)J */ -JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DefaultRouter_1as_1Router - (JNIEnv *, jclass, jlong); +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1channelmanager_1and_1duration_1since_1epoch_1with_1payment_1hash + (JNIEnv *, jclass, jlong, jlong, jlong, jobject, jlong, jstring, jlong, jint, jbyteArray); /* * Class: org_ldk_impl_bindings diff --git a/src/main/jni/org_ldk_impl_bindings_LDKCOption_HTLCClaimZ.h b/src/main/jni/org_ldk_impl_bindings_LDKCOption_HTLCClaimZ.h new file mode 100644 index 00000000..146ac365 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKCOption_HTLCClaimZ.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKCOption_HTLCClaimZ */ + +#ifndef _Included_org_ldk_impl_bindings_LDKCOption_HTLCClaimZ +#define _Included_org_ldk_impl_bindings_LDKCOption_HTLCClaimZ +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKCOption_HTLCClaimZ + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1HTLCClaimZ_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKCOption_u128Z.h b/src/main/jni/org_ldk_impl_bindings_LDKCOption_u128Z.h new file mode 100644 index 00000000..afbe923c --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKCOption_u128Z.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKCOption_u128Z */ + +#ifndef _Included_org_ldk_impl_bindings_LDKCOption_u128Z +#define _Included_org_ldk_impl_bindings_LDKCOption_u128Z +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKCOption_u128Z + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKCOption_1u128Z_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKOnionMessageContents.h b/src/main/jni/org_ldk_impl_bindings_LDKOnionMessageContents.h new file mode 100644 index 00000000..15f0fd5f --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKOnionMessageContents.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKOnionMessageContents */ + +#ifndef _Included_org_ldk_impl_bindings_LDKOnionMessageContents +#define _Included_org_ldk_impl_bindings_LDKOnionMessageContents +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKOnionMessageContents + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKOnionMessageContents_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif -- 2.30.2