]> git.bitcoin.ninja Git - ldk-java/commitdiff
Update auto-generated bindings
authorMatt Corallo <git@bluematt.me>
Thu, 5 Aug 2021 03:19:16 +0000 (03:19 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 5 Aug 2021 03:19:16 +0000 (03:19 +0000)
237 files changed:
src/main/java/org/ldk/impl/bindings.java
src/main/java/org/ldk/structs/APIError.java
src/main/java/org/ldk/structs/AcceptChannel.java
src/main/java/org/ldk/structs/Access.java
src/main/java/org/ldk/structs/AnnouncementSignatures.java
src/main/java/org/ldk/structs/BackgroundProcessor.java
src/main/java/org/ldk/structs/BaseSign.java
src/main/java/org/ldk/structs/BestBlock.java
src/main/java/org/ldk/structs/BuiltCommitmentTransaction.java
src/main/java/org/ldk/structs/ChainMonitor.java
src/main/java/org/ldk/structs/ChainParameters.java
src/main/java/org/ldk/structs/ChannelAnnouncement.java
src/main/java/org/ldk/structs/ChannelConfig.java
src/main/java/org/ldk/structs/ChannelCounterparty.java
src/main/java/org/ldk/structs/ChannelDetails.java
src/main/java/org/ldk/structs/ChannelFeatures.java
src/main/java/org/ldk/structs/ChannelHandshakeConfig.java
src/main/java/org/ldk/structs/ChannelHandshakeLimits.java
src/main/java/org/ldk/structs/ChannelInfo.java
src/main/java/org/ldk/structs/ChannelManager.java
src/main/java/org/ldk/structs/ChannelManagerPersister.java
src/main/java/org/ldk/structs/ChannelManagerReadArgs.java
src/main/java/org/ldk/structs/ChannelMessageHandler.java
src/main/java/org/ldk/structs/ChannelMonitor.java
src/main/java/org/ldk/structs/ChannelMonitorUpdate.java
src/main/java/org/ldk/structs/ChannelPublicKeys.java
src/main/java/org/ldk/structs/ChannelReestablish.java
src/main/java/org/ldk/structs/ChannelTransactionParameters.java
src/main/java/org/ldk/structs/ChannelUpdate.java
src/main/java/org/ldk/structs/ClosingSigned.java
src/main/java/org/ldk/structs/CommitmentSigned.java
src/main/java/org/ldk/structs/CommitmentTransaction.java
src/main/java/org/ldk/structs/CommitmentUpdate.java
src/main/java/org/ldk/structs/CommonBase.java
src/main/java/org/ldk/structs/CounterpartyChannelTransactionParameters.java
src/main/java/org/ldk/structs/DataLossProtect.java
src/main/java/org/ldk/structs/DecodeError.java
src/main/java/org/ldk/structs/DelayedPaymentOutputDescriptor.java
src/main/java/org/ldk/structs/Description.java
src/main/java/org/ldk/structs/DirectedChannelTransactionParameters.java
src/main/java/org/ldk/structs/DirectionalChannelInfo.java
src/main/java/org/ldk/structs/ErrorAction.java
src/main/java/org/ldk/structs/ErrorMessage.java
src/main/java/org/ldk/structs/ErroringMessageHandler.java
src/main/java/org/ldk/structs/Event.java
src/main/java/org/ldk/structs/ExpiryTime.java
src/main/java/org/ldk/structs/Fallback.java
src/main/java/org/ldk/structs/FilesystemPersister.java
src/main/java/org/ldk/structs/Filter.java
src/main/java/org/ldk/structs/FundingCreated.java
src/main/java/org/ldk/structs/FundingLocked.java
src/main/java/org/ldk/structs/FundingSigned.java
src/main/java/org/ldk/structs/GossipTimestampFilter.java
src/main/java/org/ldk/structs/HTLCFailChannelUpdate.java
src/main/java/org/ldk/structs/HTLCOutputInCommitment.java
src/main/java/org/ldk/structs/HTLCUpdate.java
src/main/java/org/ldk/structs/HolderCommitmentTransaction.java
src/main/java/org/ldk/structs/IgnoringMessageHandler.java
src/main/java/org/ldk/structs/InMemorySigner.java
src/main/java/org/ldk/structs/Init.java
src/main/java/org/ldk/structs/InitFeatures.java
src/main/java/org/ldk/structs/Invoice.java
src/main/java/org/ldk/structs/InvoiceFeatures.java
src/main/java/org/ldk/structs/InvoiceSignature.java
src/main/java/org/ldk/structs/KeysInterface.java
src/main/java/org/ldk/structs/KeysManager.java
src/main/java/org/ldk/structs/LightningError.java
src/main/java/org/ldk/structs/LockedNetworkGraph.java
src/main/java/org/ldk/structs/MessageHandler.java
src/main/java/org/ldk/structs/MessageSendEvent.java
src/main/java/org/ldk/structs/MinFinalCltvExpiry.java
src/main/java/org/ldk/structs/MonitorEvent.java
src/main/java/org/ldk/structs/MonitorUpdateError.java
src/main/java/org/ldk/structs/NetAddress.java
src/main/java/org/ldk/structs/NetGraphMsgHandler.java
src/main/java/org/ldk/structs/NetworkGraph.java
src/main/java/org/ldk/structs/NodeAnnouncement.java
src/main/java/org/ldk/structs/NodeAnnouncementInfo.java
src/main/java/org/ldk/structs/NodeFeatures.java
src/main/java/org/ldk/structs/NodeInfo.java
src/main/java/org/ldk/structs/OpenChannel.java
src/main/java/org/ldk/structs/Option_C2Tuple_usizeTransactionZZ.java
src/main/java/org/ldk/structs/Option_u16Z.java
src/main/java/org/ldk/structs/Option_u32Z.java
src/main/java/org/ldk/structs/Option_u64Z.java
src/main/java/org/ldk/structs/OutPoint.java
src/main/java/org/ldk/structs/PayeePubKey.java
src/main/java/org/ldk/structs/PaymentPurpose.java [new file with mode: 0644]
src/main/java/org/ldk/structs/PaymentSendFailure.java
src/main/java/org/ldk/structs/PeerHandleError.java
src/main/java/org/ldk/structs/PeerManager.java
src/main/java/org/ldk/structs/Persist.java
src/main/java/org/ldk/structs/Ping.java
src/main/java/org/ldk/structs/Pong.java
src/main/java/org/ldk/structs/PositiveTimestamp.java
src/main/java/org/ldk/structs/PrivateRoute.java
src/main/java/org/ldk/structs/QueryChannelRange.java
src/main/java/org/ldk/structs/QueryShortChannelIds.java
src/main/java/org/ldk/structs/RawDataPart.java
src/main/java/org/ldk/structs/RawInvoice.java
src/main/java/org/ldk/structs/ReplyChannelRange.java
src/main/java/org/ldk/structs/ReplyShortChannelIdsEnd.java
src/main/java/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.java
src/main/java/org/ldk/structs/Result_CResult_NetAddressu8ZDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.java
src/main/java/org/ldk/structs/Result_CVec_CVec_u8ZZNoneZ.java
src/main/java/org/ldk/structs/Result_CVec_SignatureZNoneZ.java
src/main/java/org/ldk/structs/Result_CVec_u8ZPeerHandleErrorZ.java
src/main/java/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_DescriptionCreationErrorZ.java
src/main/java/org/ldk/structs/Result_DirectionalChannelInfoDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_ExpiryTimeCreationErrorZ.java
src/main/java/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_FundingLockedDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_FundingSignedDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_InitDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_InvoiceFeaturesDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_InvoiceNoneZ.java
src/main/java/org/ldk/structs/Result_InvoiceSemanticErrorZ.java
src/main/java/org/ldk/structs/Result_InvoiceSignOrCreationErrorZ.java
src/main/java/org/ldk/structs/Result_NetAddressDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_NetAddressu8Z.java
src/main/java/org/ldk/structs/Result_NetworkGraphDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_NodeInfoDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_NoneAPIErrorZ.java
src/main/java/org/ldk/structs/Result_NoneChannelMonitorUpdateErrZ.java
src/main/java/org/ldk/structs/Result_NoneErrorZ.java
src/main/java/org/ldk/structs/Result_NoneLightningErrorZ.java
src/main/java/org/ldk/structs/Result_NoneMonitorUpdateErrorZ.java
src/main/java/org/ldk/structs/Result_NonePaymentSendFailureZ.java
src/main/java/org/ldk/structs/Result_NonePeerHandleErrorZ.java
src/main/java/org/ldk/structs/Result_NoneSemanticErrorZ.java
src/main/java/org/ldk/structs/Result_OpenChannelDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_OutPointDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_PayeePubKeyErrorZ.java
src/main/java/org/ldk/structs/Result_PaymentHashPaymentSendFailureZ.java [new file with mode: 0644]
src/main/java/org/ldk/structs/Result_PaymentSecretAPIErrorZ.java
src/main/java/org/ldk/structs/Result_PingDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_PongDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_PositiveTimestampCreationErrorZ.java
src/main/java/org/ldk/structs/Result_PrivateRouteCreationErrorZ.java
src/main/java/org/ldk/structs/Result_PublicKeyErrorZ.java
src/main/java/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_RecoverableSignatureNoneZ.java
src/main/java/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_RouteDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_RouteHopDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_RouteLightningErrorZ.java
src/main/java/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_SecretKeyErrorZ.java
src/main/java/org/ldk/structs/Result_ShutdownDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_SiPrefixNoneZ.java
src/main/java/org/ldk/structs/Result_SignDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_SignatureNoneZ.java
src/main/java/org/ldk/structs/Result_SignedRawInvoiceNoneZ.java
src/main/java/org/ldk/structs/Result_SpendableOutputDescriptorDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_StringErrorZ.java
src/main/java/org/ldk/structs/Result_TransactionNoneZ.java
src/main/java/org/ldk/structs/Result_TrustedCommitmentTransactionNoneZ.java
src/main/java/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_TxCreationKeysErrorZ.java
src/main/java/org/ldk/structs/Result_TxOutAccessErrorZ.java
src/main/java/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.java
src/main/java/org/ldk/structs/Result_boolLightningErrorZ.java
src/main/java/org/ldk/structs/Result_boolPeerHandleErrorZ.java
src/main/java/org/ldk/structs/RevokeAndACK.java
src/main/java/org/ldk/structs/Route.java
src/main/java/org/ldk/structs/RouteHint.java
src/main/java/org/ldk/structs/RouteHintHop.java
src/main/java/org/ldk/structs/RouteHop.java
src/main/java/org/ldk/structs/RoutingFees.java
src/main/java/org/ldk/structs/RoutingMessageHandler.java
src/main/java/org/ldk/structs/Sha256.java
src/main/java/org/ldk/structs/Shutdown.java
src/main/java/org/ldk/structs/Sign.java
src/main/java/org/ldk/structs/SignOrCreationError.java
src/main/java/org/ldk/structs/SignedRawInvoice.java
src/main/java/org/ldk/structs/SocketDescriptor.java
src/main/java/org/ldk/structs/SpendableOutputDescriptor.java
src/main/java/org/ldk/structs/StaticPaymentOutputDescriptor.java
src/main/java/org/ldk/structs/TrustedCommitmentTransaction.java
src/main/java/org/ldk/structs/TxCreationKeys.java
src/main/java/org/ldk/structs/UnsignedChannelAnnouncement.java
src/main/java/org/ldk/structs/UnsignedChannelUpdate.java
src/main/java/org/ldk/structs/UnsignedNodeAnnouncement.java
src/main/java/org/ldk/structs/UpdateAddHTLC.java
src/main/java/org/ldk/structs/UpdateFailHTLC.java
src/main/java/org/ldk/structs/UpdateFailMalformedHTLC.java
src/main/java/org/ldk/structs/UpdateFee.java
src/main/java/org/ldk/structs/UpdateFulfillHTLC.java
src/main/java/org/ldk/structs/UserConfig.java
src/main/java/org/ldk/structs/UtilMethods.java
src/main/java/org/ldk/structs/Watch.java
src/main/java/org/ldk/structs/WatchedOutput.java
src/main/jni/bindings.c
src/main/jni/bindings.c.body
src/main/jni/org_ldk_impl_bindings.h
src/main/jni/org_ldk_impl_bindings_LDKPaymentPurpose.h [new file with mode: 0644]

index 9a5c9f2d4f9781d177698e6089959dea11d736a4..8257d1363ea27f3906ad738916746f14eb0377fa 100644 (file)
@@ -48,7 +48,7 @@ public class bindings {
        static native String get_lib_version_string();
 
        public static String get_ldk_java_bindings_version() {
-               return "v0.0.99.1";
+               return "v0.0.99.1-7-gf7a4eb8-dirty";
        }
        public static native String get_ldk_c_bindings_version();
        public static native String get_ldk_version();
@@ -432,6 +432,7 @@ public class bindings {
                 byte[] write();
        }
        public static native long LDKSign_new(LDKSign impl, LDKBaseSign BaseSign, long pubkeys);
+       public static native long LDKSign_get_BaseSign(long arg);
        // LDKCVec_u8Z Sign_write LDKSign *NONNULL_PTR this_arg
        public static native byte[] Sign_write(long this_arg);
        public static native boolean LDKCResult_SignDecodeErrorZ_result_ok(long arg);
@@ -526,6 +527,9 @@ public class bindings {
        public static native boolean LDKCResult_NonePaymentSendFailureZ_result_ok(long arg);
        public static native void LDKCResult_NonePaymentSendFailureZ_get_ok(long arg);
        public static native long LDKCResult_NonePaymentSendFailureZ_get_err(long arg);
+       public static native boolean LDKCResult_PaymentHashPaymentSendFailureZ_result_ok(long arg);
+       public static native byte[] LDKCResult_PaymentHashPaymentSendFailureZ_get_ok(long arg);
+       public static native long LDKCResult_PaymentHashPaymentSendFailureZ_get_err(long arg);
        public static class LDKNetAddress {
                private LDKNetAddress() {}
                public final static class IPv4 extends LDKNetAddress {
@@ -684,6 +688,22 @@ public class bindings {
        public static native byte[] LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(long ptr);
        public static native long[] LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(long ptr);
        public static native long LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_new(long[] elems);
+       public static class LDKPaymentPurpose {
+               private LDKPaymentPurpose() {}
+               public final static class InvoicePayment extends LDKPaymentPurpose {
+                       public byte[] payment_preimage;
+                       public byte[] payment_secret;
+                       public long user_payment_id;
+                       InvoicePayment(byte[] payment_preimage, byte[] payment_secret, long user_payment_id) { this.payment_preimage = payment_preimage; this.payment_secret = payment_secret; this.user_payment_id = user_payment_id; }
+               }
+               public final static class SpontaneousPayment extends LDKPaymentPurpose {
+                       public byte[] spontaneous_payment;
+                       SpontaneousPayment(byte[] spontaneous_payment) { this.spontaneous_payment = spontaneous_payment; }
+               }
+               static native void init();
+       }
+       static { LDKPaymentPurpose.init(); }
+       public static native LDKPaymentPurpose LDKPaymentPurpose_ref_from_ptr(long ptr);
        public static class LDKEvent {
                private LDKEvent() {}
                public final static class FundingGenerationReady extends LDKEvent {
@@ -695,11 +715,9 @@ public class bindings {
                }
                public final static class PaymentReceived extends LDKEvent {
                        public byte[] payment_hash;
-                       public byte[] payment_preimage;
-                       public byte[] payment_secret;
                        public long amt;
-                       public long user_payment_id;
-                       PaymentReceived(byte[] payment_hash, byte[] payment_preimage, byte[] payment_secret, long amt, long user_payment_id) { this.payment_hash = payment_hash; this.payment_preimage = payment_preimage; this.payment_secret = payment_secret; this.amt = amt; this.user_payment_id = user_payment_id; }
+                       public long purpose;
+                       PaymentReceived(byte[] payment_hash, long amt, long purpose) { this.payment_hash = payment_hash; this.amt = amt; this.purpose = purpose; }
                }
                public final static class PaymentSent extends LDKEvent {
                        public byte[] payment_preimage;
@@ -985,6 +1003,7 @@ public class bindings {
                 void handle_error(byte[] their_node_id, long msg);
        }
        public static native long LDKChannelMessageHandler_new(LDKChannelMessageHandler impl, LDKMessageSendEventsProvider MessageSendEventsProvider);
+       public static native long LDKChannelMessageHandler_get_MessageSendEventsProvider(long arg);
        // void ChannelMessageHandler_handle_open_channel LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKOpenChannel *NONNULL_PTR msg
        public static native void ChannelMessageHandler_handle_open_channel(long this_arg, byte[] their_node_id, long their_features, long msg);
        // void ChannelMessageHandler_handle_accept_channel LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg
@@ -1039,6 +1058,7 @@ public class bindings {
                 long handle_query_short_channel_ids(byte[] their_node_id, long msg);
        }
        public static native long LDKRoutingMessageHandler_new(LDKRoutingMessageHandler impl, LDKMessageSendEventsProvider MessageSendEventsProvider);
+       public static native long LDKRoutingMessageHandler_get_MessageSendEventsProvider(long arg);
        // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_node_announcement LDKRoutingMessageHandler *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg
        public static native long RoutingMessageHandler_handle_node_announcement(long this_arg, long msg);
        // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_channel_announcement LDKRoutingMessageHandler *NONNULL_PTR this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg
@@ -1465,6 +1485,14 @@ public class bindings {
        public static native void CResult_NonePaymentSendFailureZ_free(long _res);
        // 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);
+       // void CResult_PaymentHashPaymentSendFailureZ_free(struct LDKCResult_PaymentHashPaymentSendFailureZ _res);
+       public static native void CResult_PaymentHashPaymentSendFailureZ_free(long _res);
+       // struct LDKCResult_PaymentHashPaymentSendFailureZ CResult_PaymentHashPaymentSendFailureZ_clone(const struct LDKCResult_PaymentHashPaymentSendFailureZ *NONNULL_PTR orig);
+       public static native long CResult_PaymentHashPaymentSendFailureZ_clone(long orig);
        // void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res);
        public static native void CVec_NetAddressZ_free(long[] _res);
        // struct LDKC2Tuple_PaymentHashPaymentSecretZ C2Tuple_PaymentHashPaymentSecretZ_clone(const struct LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR orig);
@@ -2065,6 +2093,10 @@ public class bindings {
        public static native void CResult_InvoiceSignOrCreationErrorZ_free(long _res);
        // struct LDKCResult_InvoiceSignOrCreationErrorZ CResult_InvoiceSignOrCreationErrorZ_clone(const struct LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR orig);
        public static native long CResult_InvoiceSignOrCreationErrorZ_clone(long orig);
+       // void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr);
+       public static native void PaymentPurpose_free(long this_ptr);
+       // struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig);
+       public static native long PaymentPurpose_clone(long orig);
        // void Event_free(struct LDKEvent this_ptr);
        public static native void Event_free(long this_ptr);
        // struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
@@ -2633,6 +2665,8 @@ public class bindings {
        public static native void ChannelManager_force_close_all_channels(long this_arg);
        // 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);
        public static native long ChannelManager_send_payment(long this_arg, long route, byte[] payment_hash, byte[] payment_secret);
+       // 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);
+       public static native long ChannelManager_send_spontaneous_payment(long this_arg, long route, byte[] payment_preimage);
        // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], struct LDKTransaction funding_transaction);
        public static native long ChannelManager_funding_transaction_generated(long this_arg, byte[] temporary_channel_id, byte[] funding_transaction);
        // void ChannelManager_broadcast_node_announcement(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses);
@@ -4017,6 +4051,8 @@ public class bindings {
        public static native boolean RouteHintHop_eq(long a, long b);
        // struct LDKRouteHintHop RouteHintHop_clone(const struct LDKRouteHintHop *NONNULL_PTR orig);
        public static native long RouteHintHop_clone(long orig);
+       // struct LDKCResult_RouteLightningErrorZ get_keysend_route(struct LDKPublicKey our_node_id, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKPublicKey payee, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKCVec_RouteHintZ last_hops, uint64_t final_value_msat, uint32_t final_cltv, struct LDKLogger logger);
+       public static native long get_keysend_route(byte[] our_node_id, long network, byte[] payee, long[] first_hops, long[] last_hops, long final_value_msat, int final_cltv, long logger);
        // struct LDKCResult_RouteLightningErrorZ get_route(struct LDKPublicKey our_node_id, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKPublicKey payee, struct LDKInvoiceFeatures payee_features, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKCVec_RouteHintZ last_hops, uint64_t final_value_msat, uint32_t final_cltv, struct LDKLogger logger);
        public static native long get_route(byte[] our_node_id, long network, byte[] payee, long payee_features, long[] first_hops, long[] last_hops, long final_value_msat, int final_cltv, long logger);
        // void NetworkGraph_free(struct LDKNetworkGraph this_obj);
index 19fdbcf1f659f07d88bc59cac021f73f18d48105..d9a4d3c523ce8e8f21a5c813580e4f7c85dc59a9 100644 (file)
@@ -78,6 +78,7 @@ public class APIError extends CommonBase {
         */
        public APIError clone() {
                long ret = bindings.APIError_clone(this.ptr);
+               if (ret < 1024) { return null; }
                APIError ret_hu_conv = APIError.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index cc61466ef5f0100f68a14870956413a6b9f6b5ad..631f0854a635fcafcee039518b9d01339d007982 100644 (file)
@@ -233,6 +233,7 @@ public class AcceptChannel extends CommonBase {
         */
        public AcceptChannel clone() {
                long ret = bindings.AcceptChannel_clone(this.ptr);
+               if (ret < 1024) { return null; }
                AcceptChannel ret_hu_conv = new AcceptChannel(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -251,6 +252,7 @@ public class AcceptChannel extends CommonBase {
         */
        public static Result_AcceptChannelDecodeErrorZ read(byte[] ser) {
                long ret = bindings.AcceptChannel_read(ser);
+               if (ret < 1024) { return null; }
                Result_AcceptChannelDecodeErrorZ ret_hu_conv = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index afb25ad3337b003a668a7d3174b4068f096ab897..a91243599fd314895c2196934ac1038a30f730f2 100644 (file)
@@ -54,6 +54,7 @@ public class Access extends CommonBase {
         */
        public Result_TxOutAccessErrorZ get_utxo(byte[] genesis_hash, long short_channel_id) {
                long ret = bindings.Access_get_utxo(this.ptr, genesis_hash, short_channel_id);
+               if (ret < 1024) { return null; }
                Result_TxOutAccessErrorZ ret_hu_conv = Result_TxOutAccessErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index ae09b22220b31192db19e0f3f3c70f5b9db70d8c..06250b7597d1b27fc83eb3d010acddb4337b68fd 100644 (file)
@@ -83,6 +83,7 @@ public class AnnouncementSignatures extends CommonBase {
         */
        public static AnnouncementSignatures of(byte[] channel_id_arg, long short_channel_id_arg, byte[] node_signature_arg, byte[] bitcoin_signature_arg) {
                long ret = bindings.AnnouncementSignatures_new(channel_id_arg, short_channel_id_arg, node_signature_arg, bitcoin_signature_arg);
+               if (ret < 1024) { return null; }
                AnnouncementSignatures ret_hu_conv = new AnnouncementSignatures(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -93,6 +94,7 @@ public class AnnouncementSignatures extends CommonBase {
         */
        public AnnouncementSignatures clone() {
                long ret = bindings.AnnouncementSignatures_clone(this.ptr);
+               if (ret < 1024) { return null; }
                AnnouncementSignatures ret_hu_conv = new AnnouncementSignatures(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -111,6 +113,7 @@ public class AnnouncementSignatures extends CommonBase {
         */
        public static Result_AnnouncementSignaturesDecodeErrorZ read(byte[] ser) {
                long ret = bindings.AnnouncementSignatures_read(ser);
+               if (ret < 1024) { return null; }
                Result_AnnouncementSignaturesDecodeErrorZ ret_hu_conv = Result_AnnouncementSignaturesDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 467cb33567e57d7eadce1541f513a5ecb78845cf..baee6d642c5e475bf000351f03e0d180af7df6b5 100644 (file)
@@ -53,6 +53,7 @@ public class BackgroundProcessor extends CommonBase {
         */
        public static BackgroundProcessor start(ChannelManagerPersister persister, EventHandler event_handler, ChainMonitor chain_monitor, ChannelManager channel_manager, PeerManager peer_manager, Logger logger) {
                long ret = bindings.BackgroundProcessor_start(persister == null ? 0 : persister.ptr, event_handler == null ? 0 : event_handler.ptr, chain_monitor == null ? 0 : chain_monitor.ptr & ~1, channel_manager == null ? 0 : channel_manager.ptr & ~1, peer_manager == null ? 0 : peer_manager.ptr & ~1, logger == null ? 0 : logger.ptr);
+               if (ret < 1024) { return null; }
                BackgroundProcessor ret_hu_conv = new BackgroundProcessor(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                ret_hu_conv.ptrs_to.add(persister);
@@ -69,6 +70,7 @@ public class BackgroundProcessor extends CommonBase {
         */
        public Result_NoneErrorZ stop() {
                long ret = bindings.BackgroundProcessor_stop(this.ptr);
+               if (ret < 1024) { return null; }
                Result_NoneErrorZ ret_hu_conv = Result_NoneErrorZ.constr_from_ptr(ret);
                this.ptrs_to.add(this);
                // Due to rust's strict-ownership memory model, in some cases we need to "move"
index b94a5c1bdee0aa6c270b89a55c22c3bcbedf0c25..d7bc8041301e2171ccf5355d70cc285412448d49 100644 (file)
@@ -275,6 +275,7 @@ public class BaseSign extends CommonBase {
         */
        public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment(CommitmentTransaction commitment_tx) {
                long ret = bindings.BaseSign_sign_counterparty_commitment(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_hu_conv = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret);
                this.ptrs_to.add(commitment_tx);
                return ret_hu_conv;
@@ -295,6 +296,7 @@ public class BaseSign extends CommonBase {
         */
        public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs(HolderCommitmentTransaction commitment_tx) {
                long ret = bindings.BaseSign_sign_holder_commitment_and_htlcs(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_hu_conv = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret);
                this.ptrs_to.add(commitment_tx);
                return ret_hu_conv;
@@ -318,6 +320,7 @@ public class BaseSign extends CommonBase {
         */
        public Result_SignatureNoneZ sign_justice_revoked_output(byte[] justice_tx, long input, long amount, byte[] per_commitment_key) {
                long ret = bindings.BaseSign_sign_justice_revoked_output(this.ptr, justice_tx, input, amount, per_commitment_key);
+               if (ret < 1024) { return null; }
                Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -343,6 +346,7 @@ public class BaseSign extends CommonBase {
         */
        public Result_SignatureNoneZ sign_justice_revoked_htlc(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, HTLCOutputInCommitment htlc) {
                long ret = bindings.BaseSign_sign_justice_revoked_htlc(this.ptr, justice_tx, input, amount, per_commitment_key, htlc == null ? 0 : htlc.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
                this.ptrs_to.add(htlc);
                return ret_hu_conv;
@@ -369,6 +373,7 @@ public class BaseSign extends CommonBase {
         */
        public Result_SignatureNoneZ sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, HTLCOutputInCommitment htlc) {
                long ret = bindings.BaseSign_sign_counterparty_htlc_transaction(this.ptr, htlc_tx, input, amount, per_commitment_point, htlc == null ? 0 : htlc.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
                this.ptrs_to.add(htlc);
                return ret_hu_conv;
@@ -382,6 +387,7 @@ public class BaseSign extends CommonBase {
         */
        public Result_SignatureNoneZ sign_closing_transaction(byte[] closing_tx) {
                long ret = bindings.BaseSign_sign_closing_transaction(this.ptr, closing_tx);
+               if (ret < 1024) { return null; }
                Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -396,6 +402,7 @@ public class BaseSign extends CommonBase {
         */
        public Result_SignatureNoneZ sign_channel_announcement(UnsignedChannelAnnouncement msg) {
                long ret = bindings.BaseSign_sign_channel_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
                this.ptrs_to.add(msg);
                return ret_hu_conv;
@@ -424,6 +431,7 @@ public class BaseSign extends CommonBase {
         */
        public ChannelPublicKeys get_pubkeys() {
                long ret = bindings.BaseSign_get_pubkeys(this.ptr);
+               if (ret < 1024) { return null; }
                ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index cda09d30f09453df56f4cb2f34cb1c59471aeee9..c0cb941c4d3edc721997050cf1ddcff691f1763e 100644 (file)
@@ -23,6 +23,7 @@ public class BestBlock extends CommonBase {
         */
        public BestBlock clone() {
                long ret = bindings.BestBlock_clone(this.ptr);
+               if (ret < 1024) { return null; }
                BestBlock ret_hu_conv = new BestBlock(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -34,6 +35,7 @@ public class BestBlock extends CommonBase {
         */
        public static BestBlock from_genesis(Network network) {
                long ret = bindings.BestBlock_from_genesis(network);
+               if (ret < 1024) { return null; }
                BestBlock ret_hu_conv = new BestBlock(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -44,6 +46,7 @@ public class BestBlock extends CommonBase {
         */
        public static BestBlock of(byte[] block_hash, int height) {
                long ret = bindings.BestBlock_new(block_hash, height);
+               if (ret < 1024) { return null; }
                BestBlock ret_hu_conv = new BestBlock(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
index 3ac8da0e95c1febf7a2e93d50ce6426fd28162fb..4b80533987c33e73362318b3bd1071f1b8d8ca3a 100644 (file)
@@ -59,6 +59,7 @@ public class BuiltCommitmentTransaction extends CommonBase {
         */
        public static BuiltCommitmentTransaction of(byte[] transaction_arg, byte[] txid_arg) {
                long ret = bindings.BuiltCommitmentTransaction_new(transaction_arg, txid_arg);
+               if (ret < 1024) { return null; }
                BuiltCommitmentTransaction ret_hu_conv = new BuiltCommitmentTransaction(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -69,6 +70,7 @@ public class BuiltCommitmentTransaction extends CommonBase {
         */
        public BuiltCommitmentTransaction clone() {
                long ret = bindings.BuiltCommitmentTransaction_clone(this.ptr);
+               if (ret < 1024) { return null; }
                BuiltCommitmentTransaction ret_hu_conv = new BuiltCommitmentTransaction(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -87,6 +89,7 @@ public class BuiltCommitmentTransaction extends CommonBase {
         */
        public static Result_BuiltCommitmentTransactionDecodeErrorZ read(byte[] ser) {
                long ret = bindings.BuiltCommitmentTransaction_read(ser);
+               if (ret < 1024) { return null; }
                Result_BuiltCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_BuiltCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index a1406a35639aa5fc2dce5f057a9f9de8451b5b54..cd69b37b114a789594325466b8d4609008f9d446 100644 (file)
@@ -34,9 +34,12 @@ public class ChainMonitor extends CommonBase {
         * pre-filter blocks or only fetch blocks matching a compact filter. Otherwise, clients may
         * always need to fetch full blocks absent another means for determining which blocks contain
         * transactions relevant to the watched channels.
+        * 
+        * Note that chain_source (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
-       public static ChainMonitor of(Filter chain_source, BroadcasterInterface broadcaster, Logger logger, FeeEstimator feeest, Persist persister) {
+       public static ChainMonitor of(@Nullable Filter chain_source, BroadcasterInterface broadcaster, Logger logger, FeeEstimator feeest, Persist persister) {
                long ret = bindings.ChainMonitor_new(chain_source == null ? 0 : chain_source.ptr, broadcaster == null ? 0 : broadcaster.ptr, logger == null ? 0 : logger.ptr, feeest == null ? 0 : feeest.ptr, persister == null ? 0 : persister.ptr);
+               if (ret < 1024) { return null; }
                ChainMonitor ret_hu_conv = new ChainMonitor(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                ret_hu_conv.ptrs_to.add(chain_source);
@@ -53,6 +56,7 @@ public class ChainMonitor extends CommonBase {
         */
        public Listen as_Listen() {
                long ret = bindings.ChainMonitor_as_Listen(this.ptr);
+               if (ret < 1024) { return null; }
                Listen ret_hu_conv = new Listen(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -64,6 +68,7 @@ public class ChainMonitor extends CommonBase {
         */
        public Confirm as_Confirm() {
                long ret = bindings.ChainMonitor_as_Confirm(this.ptr);
+               if (ret < 1024) { return null; }
                Confirm ret_hu_conv = new Confirm(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -75,6 +80,7 @@ public class ChainMonitor extends CommonBase {
         */
        public Watch as_Watch() {
                long ret = bindings.ChainMonitor_as_Watch(this.ptr);
+               if (ret < 1024) { return null; }
                Watch ret_hu_conv = new Watch(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -86,6 +92,7 @@ public class ChainMonitor extends CommonBase {
         */
        public EventsProvider as_EventsProvider() {
                long ret = bindings.ChainMonitor_as_EventsProvider(this.ptr);
+               if (ret < 1024) { return null; }
                EventsProvider ret_hu_conv = new EventsProvider(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index f61036d5dadb5df5f235789ffd13e9ba6556a5d7..85643ee1aee28ce0a9d8031e3d4a9263a1411ae2 100644 (file)
@@ -44,6 +44,7 @@ public class ChainParameters extends CommonBase {
         */
        public BestBlock get_best_block() {
                long ret = bindings.ChainParameters_get_best_block(this.ptr);
+               if (ret < 1024) { return null; }
                BestBlock ret_hu_conv = new BestBlock(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -64,6 +65,7 @@ public class ChainParameters extends CommonBase {
         */
        public static ChainParameters of(Network network_arg, BestBlock best_block_arg) {
                long ret = bindings.ChainParameters_new(network_arg, best_block_arg == null ? 0 : best_block_arg.ptr & ~1);
+               if (ret < 1024) { return null; }
                ChainParameters ret_hu_conv = new ChainParameters(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                ret_hu_conv.ptrs_to.add(best_block_arg);
@@ -75,6 +77,7 @@ public class ChainParameters extends CommonBase {
         */
        public ChainParameters clone() {
                long ret = bindings.ChainParameters_clone(this.ptr);
+               if (ret < 1024) { return null; }
                ChainParameters ret_hu_conv = new ChainParameters(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index 0b0443fd0c563da510559e71592e5430ededbf6f..4c2db6411451349f08706627651bd82288a59c35 100644 (file)
@@ -83,6 +83,7 @@ public class ChannelAnnouncement extends CommonBase {
         */
        public UnsignedChannelAnnouncement get_contents() {
                long ret = bindings.ChannelAnnouncement_get_contents(this.ptr);
+               if (ret < 1024) { return null; }
                UnsignedChannelAnnouncement ret_hu_conv = new UnsignedChannelAnnouncement(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -101,6 +102,7 @@ public class ChannelAnnouncement extends CommonBase {
         */
        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) {
                long ret = bindings.ChannelAnnouncement_new(node_signature_1_arg, node_signature_2_arg, bitcoin_signature_1_arg, bitcoin_signature_2_arg, contents_arg == null ? 0 : contents_arg.ptr & ~1);
+               if (ret < 1024) { return null; }
                ChannelAnnouncement ret_hu_conv = new ChannelAnnouncement(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                ret_hu_conv.ptrs_to.add(contents_arg);
@@ -112,6 +114,7 @@ public class ChannelAnnouncement extends CommonBase {
         */
        public ChannelAnnouncement clone() {
                long ret = bindings.ChannelAnnouncement_clone(this.ptr);
+               if (ret < 1024) { return null; }
                ChannelAnnouncement ret_hu_conv = new ChannelAnnouncement(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -130,6 +133,7 @@ public class ChannelAnnouncement extends CommonBase {
         */
        public static Result_ChannelAnnouncementDecodeErrorZ read(byte[] ser) {
                long ret = bindings.ChannelAnnouncement_read(ser);
+               if (ret < 1024) { return null; }
                Result_ChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_ChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index eaef6ab81e5c804ead7c6bcdc8f09d0be1a38118..01bac65886fd8dd22be7f14e61ee95851f3e366e 100644 (file)
@@ -207,6 +207,7 @@ public class ChannelConfig extends CommonBase {
         */
        public static ChannelConfig of(int forwarding_fee_proportional_millionths_arg, int forwarding_fee_base_msat_arg, short cltv_expiry_delta_arg, boolean announced_channel_arg, boolean commit_upfront_shutdown_pubkey_arg) {
                long ret = bindings.ChannelConfig_new(forwarding_fee_proportional_millionths_arg, forwarding_fee_base_msat_arg, cltv_expiry_delta_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg);
+               if (ret < 1024) { return null; }
                ChannelConfig ret_hu_conv = new ChannelConfig(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -217,6 +218,7 @@ public class ChannelConfig extends CommonBase {
         */
        public ChannelConfig clone() {
                long ret = bindings.ChannelConfig_clone(this.ptr);
+               if (ret < 1024) { return null; }
                ChannelConfig ret_hu_conv = new ChannelConfig(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -227,6 +229,7 @@ public class ChannelConfig extends CommonBase {
         */
        public static ChannelConfig with_default() {
                long ret = bindings.ChannelConfig_default();
+               if (ret < 1024) { return null; }
                ChannelConfig ret_hu_conv = new ChannelConfig(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -245,6 +248,7 @@ public class ChannelConfig extends CommonBase {
         */
        public static Result_ChannelConfigDecodeErrorZ read(byte[] ser) {
                long ret = bindings.ChannelConfig_read(ser);
+               if (ret < 1024) { return null; }
                Result_ChannelConfigDecodeErrorZ ret_hu_conv = Result_ChannelConfigDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index c0bf5dd26261669030cf20108141a2981550499e..2253c564085e0c7a48347cc56e9c59d151157c63 100644 (file)
@@ -41,6 +41,7 @@ public class ChannelCounterparty extends CommonBase {
         */
        public InitFeatures get_features() {
                long ret = bindings.ChannelCounterparty_get_features(this.ptr);
+               if (ret < 1024) { return null; }
                InitFeatures ret_hu_conv = new InitFeatures(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -88,6 +89,7 @@ public class ChannelCounterparty extends CommonBase {
         */
        public ChannelCounterparty clone() {
                long ret = bindings.ChannelCounterparty_clone(this.ptr);
+               if (ret < 1024) { return null; }
                ChannelCounterparty ret_hu_conv = new ChannelCounterparty(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index 92f526b6db41cdd1ba5a5d9cbc421a2da37a2cbf..1af695292a93eabf70e808c6c60d0d84afb289a3 100644 (file)
@@ -3,6 +3,8 @@ package org.ldk.structs;
 import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
+
+import javax.annotation.Nullable;
 import java.util.Arrays;
 
 
@@ -44,6 +46,7 @@ public class ChannelDetails extends CommonBase {
         */
        public ChannelCounterparty get_counterparty() {
                long ret = bindings.ChannelDetails_get_counterparty(this.ptr);
+               if (ret < 1024) { return null; }
                ChannelCounterparty ret_hu_conv = new ChannelCounterparty(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -63,9 +66,13 @@ public class ChannelDetails extends CommonBase {
         * 
         * Note that, if this has been set, `channel_id` will be equivalent to
         * `funding_txo.unwrap().to_channel_id()`.
+        * 
+        * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
+       @Nullable
        public OutPoint get_funding_txo() {
                long ret = bindings.ChannelDetails_get_funding_txo(this.ptr);
+               if (ret < 1024) { return null; }
                OutPoint ret_hu_conv = new OutPoint(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -77,8 +84,10 @@ public class ChannelDetails extends CommonBase {
         * 
         * Note that, if this has been set, `channel_id` will be equivalent to
         * `funding_txo.unwrap().to_channel_id()`.
+        * 
+        * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
-       public void set_funding_txo(OutPoint val) {
+       public void set_funding_txo(@Nullable OutPoint val) {
                bindings.ChannelDetails_set_funding_txo(this.ptr, val == null ? 0 : val.ptr & ~1);
                this.ptrs_to.add(val);
        }
@@ -89,6 +98,7 @@ public class ChannelDetails extends CommonBase {
         */
        public Option_u64Z get_short_channel_id() {
                long ret = bindings.ChannelDetails_get_short_channel_id(this.ptr);
+               if (ret < 1024) { return null; }
                Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -130,6 +140,7 @@ public class ChannelDetails extends CommonBase {
         */
        public Option_u64Z get_unspendable_punishment_reserve() {
                long ret = bindings.ChannelDetails_get_unspendable_punishment_reserve(this.ptr);
+               if (ret < 1024) { return null; }
                Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -240,6 +251,7 @@ public class ChannelDetails extends CommonBase {
         */
        public Option_u32Z get_confirmations_required() {
                long ret = bindings.ChannelDetails_get_confirmations_required(this.ptr);
+               if (ret < 1024) { return null; }
                Option_u32Z ret_hu_conv = Option_u32Z.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -273,6 +285,7 @@ public class ChannelDetails extends CommonBase {
         */
        public Option_u16Z get_force_close_spend_delay() {
                long ret = bindings.ChannelDetails_get_force_close_spend_delay(this.ptr);
+               if (ret < 1024) { return null; }
                Option_u16Z ret_hu_conv = Option_u16Z.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -374,6 +387,7 @@ public class ChannelDetails extends CommonBase {
         */
        public static ChannelDetails of(byte[] channel_id_arg, ChannelCounterparty counterparty_arg, OutPoint funding_txo_arg, Option_u64Z short_channel_id_arg, long channel_value_satoshis_arg, Option_u64Z unspendable_punishment_reserve_arg, long user_id_arg, long outbound_capacity_msat_arg, long inbound_capacity_msat_arg, Option_u32Z confirmations_required_arg, Option_u16Z force_close_spend_delay_arg, boolean is_outbound_arg, boolean is_funding_locked_arg, boolean is_usable_arg, boolean is_public_arg) {
                long ret = bindings.ChannelDetails_new(channel_id_arg, counterparty_arg == null ? 0 : counterparty_arg.ptr & ~1, funding_txo_arg == null ? 0 : funding_txo_arg.ptr & ~1, short_channel_id_arg.ptr, channel_value_satoshis_arg, unspendable_punishment_reserve_arg.ptr, user_id_arg, outbound_capacity_msat_arg, inbound_capacity_msat_arg, confirmations_required_arg.ptr, force_close_spend_delay_arg.ptr, is_outbound_arg, is_funding_locked_arg, is_usable_arg, is_public_arg);
+               if (ret < 1024) { return null; }
                ChannelDetails ret_hu_conv = new ChannelDetails(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                ret_hu_conv.ptrs_to.add(counterparty_arg);
@@ -386,6 +400,7 @@ public class ChannelDetails extends CommonBase {
         */
        public ChannelDetails clone() {
                long ret = bindings.ChannelDetails_clone(this.ptr);
+               if (ret < 1024) { return null; }
                ChannelDetails ret_hu_conv = new ChannelDetails(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index 04395a4e394705fc38661366e9c1c0463287da43..dcaba5a45c36c1b40ab62587315031273aef928e 100644 (file)
@@ -34,6 +34,7 @@ public class ChannelFeatures extends CommonBase {
         */
        public ChannelFeatures clone() {
                long ret = bindings.ChannelFeatures_clone(this.ptr);
+               if (ret < 1024) { return null; }
                ChannelFeatures ret_hu_conv = new ChannelFeatures(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -44,6 +45,7 @@ public class ChannelFeatures extends CommonBase {
         */
        public static ChannelFeatures empty() {
                long ret = bindings.ChannelFeatures_empty();
+               if (ret < 1024) { return null; }
                ChannelFeatures ret_hu_conv = new ChannelFeatures(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -54,6 +56,7 @@ public class ChannelFeatures extends CommonBase {
         */
        public static ChannelFeatures known() {
                long ret = bindings.ChannelFeatures_known();
+               if (ret < 1024) { return null; }
                ChannelFeatures ret_hu_conv = new ChannelFeatures(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -72,6 +75,7 @@ public class ChannelFeatures extends CommonBase {
         */
        public static Result_ChannelFeaturesDecodeErrorZ read(byte[] ser) {
                long ret = bindings.ChannelFeatures_read(ser);
+               if (ret < 1024) { return null; }
                Result_ChannelFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelFeaturesDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 414c760689508b073b9f82eba123efede7d95818..f89b9a05654d7bbb1213e2e295a0c245e2d1cc1d 100644 (file)
@@ -118,6 +118,7 @@ public class ChannelHandshakeConfig extends CommonBase {
         */
        public static ChannelHandshakeConfig of(int minimum_depth_arg, short our_to_self_delay_arg, long our_htlc_minimum_msat_arg) {
                long ret = bindings.ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg);
+               if (ret < 1024) { return null; }
                ChannelHandshakeConfig ret_hu_conv = new ChannelHandshakeConfig(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -128,6 +129,7 @@ public class ChannelHandshakeConfig extends CommonBase {
         */
        public ChannelHandshakeConfig clone() {
                long ret = bindings.ChannelHandshakeConfig_clone(this.ptr);
+               if (ret < 1024) { return null; }
                ChannelHandshakeConfig ret_hu_conv = new ChannelHandshakeConfig(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -138,6 +140,7 @@ public class ChannelHandshakeConfig extends CommonBase {
         */
        public static ChannelHandshakeConfig with_default() {
                long ret = bindings.ChannelHandshakeConfig_default();
+               if (ret < 1024) { return null; }
                ChannelHandshakeConfig ret_hu_conv = new ChannelHandshakeConfig(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
index c94c6ef31077e75fd1f991c32b961bc5da2a87bf..442900cb54cc6c6f671d263403d37c1f22532013 100644 (file)
@@ -221,6 +221,7 @@ public class ChannelHandshakeLimits extends CommonBase {
         */
        public static ChannelHandshakeLimits of(long min_funding_satoshis_arg, long max_htlc_minimum_msat_arg, long min_max_htlc_value_in_flight_msat_arg, long max_channel_reserve_satoshis_arg, short min_max_accepted_htlcs_arg, int max_minimum_depth_arg, boolean force_announced_channel_preference_arg, short their_to_self_delay_arg) {
                long ret = bindings.ChannelHandshakeLimits_new(min_funding_satoshis_arg, max_htlc_minimum_msat_arg, min_max_htlc_value_in_flight_msat_arg, max_channel_reserve_satoshis_arg, min_max_accepted_htlcs_arg, max_minimum_depth_arg, force_announced_channel_preference_arg, their_to_self_delay_arg);
+               if (ret < 1024) { return null; }
                ChannelHandshakeLimits ret_hu_conv = new ChannelHandshakeLimits(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -231,6 +232,7 @@ public class ChannelHandshakeLimits extends CommonBase {
         */
        public ChannelHandshakeLimits clone() {
                long ret = bindings.ChannelHandshakeLimits_clone(this.ptr);
+               if (ret < 1024) { return null; }
                ChannelHandshakeLimits ret_hu_conv = new ChannelHandshakeLimits(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -241,6 +243,7 @@ public class ChannelHandshakeLimits extends CommonBase {
         */
        public static ChannelHandshakeLimits with_default() {
                long ret = bindings.ChannelHandshakeLimits_default();
+               if (ret < 1024) { return null; }
                ChannelHandshakeLimits ret_hu_conv = new ChannelHandshakeLimits(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
index bc2e57193c274aa70abac59aaf8f5fba0c229b9c..360360bb5f43f8bd3ef5cc0f7e36002c3a803bb0 100644 (file)
@@ -24,6 +24,7 @@ public class ChannelInfo extends CommonBase {
         */
        public ChannelFeatures get_features() {
                long ret = bindings.ChannelInfo_get_features(this.ptr);
+               if (ret < 1024) { return null; }
                ChannelFeatures ret_hu_conv = new ChannelFeatures(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -54,9 +55,13 @@ public class ChannelInfo extends CommonBase {
 
        /**
         * Details about the first direction of a channel
+        * 
+        * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
+       @Nullable
        public DirectionalChannelInfo get_one_to_two() {
                long ret = bindings.ChannelInfo_get_one_to_two(this.ptr);
+               if (ret < 1024) { return null; }
                DirectionalChannelInfo ret_hu_conv = new DirectionalChannelInfo(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -64,8 +69,10 @@ public class ChannelInfo extends CommonBase {
 
        /**
         * Details about the first direction of a channel
+        * 
+        * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
-       public void set_one_to_two(DirectionalChannelInfo val) {
+       public void set_one_to_two(@Nullable DirectionalChannelInfo val) {
                bindings.ChannelInfo_set_one_to_two(this.ptr, val == null ? 0 : val.ptr & ~1);
                this.ptrs_to.add(val);
        }
@@ -87,9 +94,13 @@ public class ChannelInfo extends CommonBase {
 
        /**
         * Details about the second direction of a channel
+        * 
+        * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
+       @Nullable
        public DirectionalChannelInfo get_two_to_one() {
                long ret = bindings.ChannelInfo_get_two_to_one(this.ptr);
+               if (ret < 1024) { return null; }
                DirectionalChannelInfo ret_hu_conv = new DirectionalChannelInfo(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -97,8 +108,10 @@ public class ChannelInfo extends CommonBase {
 
        /**
         * Details about the second direction of a channel
+        * 
+        * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
-       public void set_two_to_one(DirectionalChannelInfo val) {
+       public void set_two_to_one(@Nullable DirectionalChannelInfo val) {
                bindings.ChannelInfo_set_two_to_one(this.ptr, val == null ? 0 : val.ptr & ~1);
                this.ptrs_to.add(val);
        }
@@ -108,6 +121,7 @@ public class ChannelInfo extends CommonBase {
         */
        public Option_u64Z get_capacity_sats() {
                long ret = bindings.ChannelInfo_get_capacity_sats(this.ptr);
+               if (ret < 1024) { return null; }
                Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -125,9 +139,13 @@ public class ChannelInfo extends CommonBase {
         * Mostly redundant with the data we store in fields explicitly.
         * Everything else is useful only for sending out for initial routing sync.
         * Not stored if contains excess data to prevent DoS.
+        * 
+        * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
+       @Nullable
        public ChannelAnnouncement get_announcement_message() {
                long ret = bindings.ChannelInfo_get_announcement_message(this.ptr);
+               if (ret < 1024) { return null; }
                ChannelAnnouncement ret_hu_conv = new ChannelAnnouncement(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -138,8 +156,10 @@ public class ChannelInfo extends CommonBase {
         * Mostly redundant with the data we store in fields explicitly.
         * Everything else is useful only for sending out for initial routing sync.
         * Not stored if contains excess data to prevent DoS.
+        * 
+        * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
-       public void set_announcement_message(ChannelAnnouncement val) {
+       public void set_announcement_message(@Nullable ChannelAnnouncement val) {
                bindings.ChannelInfo_set_announcement_message(this.ptr, val == null ? 0 : val.ptr & ~1);
                this.ptrs_to.add(val);
        }
@@ -149,6 +169,7 @@ public class ChannelInfo extends CommonBase {
         */
        public static ChannelInfo of(ChannelFeatures features_arg, byte[] node_one_arg, DirectionalChannelInfo one_to_two_arg, byte[] node_two_arg, DirectionalChannelInfo two_to_one_arg, Option_u64Z capacity_sats_arg, ChannelAnnouncement announcement_message_arg) {
                long ret = bindings.ChannelInfo_new(features_arg == null ? 0 : features_arg.ptr & ~1, node_one_arg, one_to_two_arg == null ? 0 : one_to_two_arg.ptr & ~1, node_two_arg, two_to_one_arg == null ? 0 : two_to_one_arg.ptr & ~1, capacity_sats_arg.ptr, announcement_message_arg == null ? 0 : announcement_message_arg.ptr & ~1);
+               if (ret < 1024) { return null; }
                ChannelInfo ret_hu_conv = new ChannelInfo(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                ret_hu_conv.ptrs_to.add(features_arg);
@@ -163,6 +184,7 @@ public class ChannelInfo extends CommonBase {
         */
        public ChannelInfo clone() {
                long ret = bindings.ChannelInfo_clone(this.ptr);
+               if (ret < 1024) { return null; }
                ChannelInfo ret_hu_conv = new ChannelInfo(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -181,6 +203,7 @@ public class ChannelInfo extends CommonBase {
         */
        public static Result_ChannelInfoDecodeErrorZ read(byte[] ser) {
                long ret = bindings.ChannelInfo_read(ser);
+               if (ret < 1024) { return null; }
                Result_ChannelInfoDecodeErrorZ ret_hu_conv = Result_ChannelInfoDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 60176ba1f320b241869319cfff06bafd8e3a9de4..850daf712112dbbb279dccfd85d4b65714be6018 100644 (file)
@@ -69,6 +69,7 @@ public class ChannelManager extends CommonBase {
         */
        public static ChannelManager of(FeeEstimator fee_est, Watch chain_monitor, BroadcasterInterface tx_broadcaster, Logger logger, KeysInterface keys_manager, UserConfig config, 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 & ~1, params == null ? 0 : params.ptr & ~1);
+               if (ret < 1024) { return null; }
                ChannelManager ret_hu_conv = new ChannelManager(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                ret_hu_conv.ptrs_to.add(fee_est);
@@ -86,6 +87,7 @@ public class ChannelManager extends CommonBase {
         */
        public UserConfig get_current_default_configuration() {
                long ret = bindings.ChannelManager_get_current_default_configuration(this.ptr);
+               if (ret < 1024) { return null; }
                UserConfig ret_hu_conv = new UserConfig(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -109,9 +111,12 @@ public class ChannelManager extends CommonBase {
         * Note that we do not check if you are currently connected to the given peer. If no
         * connection is available, the outbound `open_channel` message may fail to send, resulting in
         * the channel eventually being silently forgotten.
+        * 
+        * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
        public Result_NoneAPIErrorZ create_channel(byte[] their_network_key, long channel_value_satoshis, long push_msat, long user_id, UserConfig override_config) {
                long ret = bindings.ChannelManager_create_channel(this.ptr, their_network_key, channel_value_satoshis, push_msat, user_id, override_config == null ? 0 : override_config.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret);
                this.ptrs_to.add(override_config);
                return ret_hu_conv;
@@ -162,6 +167,7 @@ public class ChannelManager extends CommonBase {
         */
        public Result_NoneAPIErrorZ close_channel(byte[] channel_id) {
                long ret = bindings.ChannelManager_close_channel(this.ptr, channel_id);
+               if (ret < 1024) { return null; }
                Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -172,6 +178,7 @@ public class ChannelManager extends CommonBase {
         */
        public Result_NoneAPIErrorZ force_close_channel(byte[] channel_id) {
                long ret = bindings.ChannelManager_force_close_channel(this.ptr, channel_id);
+               if (ret < 1024) { return null; }
                Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -224,14 +231,39 @@ public class ChannelManager extends CommonBase {
         * 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.
+        * 
+        * Note that payment_secret (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
        public Result_NonePaymentSendFailureZ send_payment(Route route, byte[] payment_hash, byte[] payment_secret) {
                long ret = bindings.ChannelManager_send_payment(this.ptr, route == null ? 0 : route.ptr & ~1, payment_hash, payment_secret);
+               if (ret < 1024) { return null; }
                Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret);
                this.ptrs_to.add(route);
                return ret_hu_conv;
        }
 
+       /**
+        * Send a spontaneous payment, which is a payment that does not require the recipient to have
+        * generated an invoice. Optionally, you may specify the preimage. If you do choose to specify
+        * the preimage, it must be a cryptographically secure random value that no intermediate node
+        * would be able to guess -- otherwise, an intermediate node may claim the payment and it will
+        * never reach the recipient.
+        * 
+        * Similar to regular payments, you MUST NOT reuse a `payment_preimage` value. See
+        * [`send_payment`] for more information about the risks of duplicate preimage usage.
+        * 
+        * [`send_payment`]: Self::send_payment
+        * 
+        * Note that payment_preimage (or a relevant inner pointer) may be NULL or all-0s to represent None
+        */
+       public Result_PaymentHashPaymentSendFailureZ send_spontaneous_payment(Route route, @Nullable byte[] payment_preimage) {
+               long ret = bindings.ChannelManager_send_spontaneous_payment(this.ptr, route == null ? 0 : route.ptr & ~1, payment_preimage);
+               if (ret < 1024) { return null; }
+               Result_PaymentHashPaymentSendFailureZ ret_hu_conv = Result_PaymentHashPaymentSendFailureZ.constr_from_ptr(ret);
+               this.ptrs_to.add(route);
+               return ret_hu_conv;
+       }
+
        /**
         * Call this upon creation of a funding transaction for the given channel.
         * 
@@ -256,6 +288,7 @@ public class ChannelManager extends CommonBase {
         */
        public Result_NoneAPIErrorZ funding_transaction_generated(byte[] temporary_channel_id, byte[] funding_transaction) {
                long ret = bindings.ChannelManager_funding_transaction_generated(this.ptr, temporary_channel_id, funding_transaction);
+               if (ret < 1024) { return null; }
                Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -395,6 +428,7 @@ public class ChannelManager extends CommonBase {
         */
        public TwoTuple<byte[], byte[]> create_inbound_payment(Option_u64Z min_value_msat, int invoice_expiry_delta_secs, long user_payment_id) {
                long ret = bindings.ChannelManager_create_inbound_payment(this.ptr, min_value_msat.ptr, invoice_expiry_delta_secs, user_payment_id);
+               if (ret < 1024) { return null; }
                byte[] ret_a = bindings.LDKC2Tuple_PaymentHashPaymentSecretZ_get_a(ret);
                byte[] ret_b = bindings.LDKC2Tuple_PaymentHashPaymentSecretZ_get_b(ret);
                TwoTuple<byte[], byte[]> ret_conv = new TwoTuple<byte[], byte[]>(ret_a, ret_b, () -> {
@@ -414,7 +448,7 @@ public class ChannelManager extends CommonBase {
         * The [`PaymentHash`] (and corresponding [`PaymentPreimage`]) must be globally unique. This
         * method may return an Err if another payment with the same payment_hash is still pending.
         * 
-        * `user_payment_id` will be provided back in [`PaymentReceived::user_payment_id`] events to
+        * `user_payment_id` will be provided back in [`PaymentPurpose::InvoicePayment::user_payment_id`] events to
         * allow tracking of which events correspond with which calls to this and
         * [`create_inbound_payment`]. `user_payment_id` has no meaning inside of LDK, it is simply
         * copied to events and otherwise ignored. It may be used to correlate PaymentReceived events
@@ -448,10 +482,11 @@ public class ChannelManager extends CommonBase {
         * 
         * [`create_inbound_payment`]: Self::create_inbound_payment
         * [`PaymentReceived`]: events::Event::PaymentReceived
-        * [`PaymentReceived::user_payment_id`]: events::Event::PaymentReceived::user_payment_id
+        * [`PaymentPurpose::InvoicePayment::user_payment_id`]: events::PaymentPurpose::InvoicePayment::user_payment_id
         */
        public Result_PaymentSecretAPIErrorZ create_inbound_payment_for_hash(byte[] payment_hash, Option_u64Z min_value_msat, int invoice_expiry_delta_secs, long user_payment_id) {
                long ret = bindings.ChannelManager_create_inbound_payment_for_hash(this.ptr, payment_hash, min_value_msat.ptr, invoice_expiry_delta_secs, user_payment_id);
+               if (ret < 1024) { return null; }
                Result_PaymentSecretAPIErrorZ ret_hu_conv = Result_PaymentSecretAPIErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -462,6 +497,7 @@ public class ChannelManager extends CommonBase {
         */
        public MessageSendEventsProvider as_MessageSendEventsProvider() {
                long ret = bindings.ChannelManager_as_MessageSendEventsProvider(this.ptr);
+               if (ret < 1024) { return null; }
                MessageSendEventsProvider ret_hu_conv = new MessageSendEventsProvider(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -473,6 +509,7 @@ public class ChannelManager extends CommonBase {
         */
        public EventsProvider as_EventsProvider() {
                long ret = bindings.ChannelManager_as_EventsProvider(this.ptr);
+               if (ret < 1024) { return null; }
                EventsProvider ret_hu_conv = new EventsProvider(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -484,6 +521,7 @@ public class ChannelManager extends CommonBase {
         */
        public Listen as_Listen() {
                long ret = bindings.ChannelManager_as_Listen(this.ptr);
+               if (ret < 1024) { return null; }
                Listen ret_hu_conv = new Listen(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -495,6 +533,7 @@ public class ChannelManager extends CommonBase {
         */
        public Confirm as_Confirm() {
                long ret = bindings.ChannelManager_as_Confirm(this.ptr);
+               if (ret < 1024) { return null; }
                Confirm ret_hu_conv = new Confirm(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -527,6 +566,7 @@ public class ChannelManager extends CommonBase {
         */
        public BestBlock current_best_block() {
                long ret = bindings.ChannelManager_current_best_block(this.ptr);
+               if (ret < 1024) { return null; }
                BestBlock ret_hu_conv = new BestBlock(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -538,6 +578,7 @@ public class ChannelManager extends CommonBase {
         */
        public ChannelMessageHandler as_ChannelMessageHandler() {
                long ret = bindings.ChannelManager_as_ChannelMessageHandler(this.ptr);
+               if (ret < 1024) { return null; }
                ChannelMessageHandler ret_hu_conv = new ChannelMessageHandler(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index 1bbc3e30dbe507549d78109000d6298c1dc1fc70..d159450f3f30a09abe1a0ff4e0b19eecf200923b 100644 (file)
@@ -54,6 +54,7 @@ public class ChannelManagerPersister extends CommonBase {
         */
        public Result_NoneErrorZ persist_manager(ChannelManager channel_manager) {
                long ret = bindings.ChannelManagerPersister_persist_manager(this.ptr, channel_manager == null ? 0 : channel_manager.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_NoneErrorZ ret_hu_conv = Result_NoneErrorZ.constr_from_ptr(ret);
                this.ptrs_to.add(channel_manager);
                return ret_hu_conv;
index 8f49dd3f2d6a71403f643246a5d7576928ca38cd..e49adabcc0fac7a8d5cd3ad152eb254502cf017c 100644 (file)
@@ -49,6 +49,7 @@ public class ChannelManagerReadArgs extends CommonBase {
         */
        public KeysInterface get_keys_manager() {
                long ret = bindings.ChannelManagerReadArgs_get_keys_manager(this.ptr);
+               if (ret < 1024) { return null; }
                KeysInterface ret_hu_conv = new KeysInterface(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -71,6 +72,7 @@ public class ChannelManagerReadArgs extends CommonBase {
         */
        public FeeEstimator get_fee_estimator() {
                long ret = bindings.ChannelManagerReadArgs_get_fee_estimator(this.ptr);
+               if (ret < 1024) { return null; }
                FeeEstimator ret_hu_conv = new FeeEstimator(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -95,6 +97,7 @@ public class ChannelManagerReadArgs extends CommonBase {
         */
        public Watch get_chain_monitor() {
                long ret = bindings.ChannelManagerReadArgs_get_chain_monitor(this.ptr);
+               if (ret < 1024) { return null; }
                Watch ret_hu_conv = new Watch(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -119,6 +122,7 @@ public class ChannelManagerReadArgs extends CommonBase {
         */
        public BroadcasterInterface get_tx_broadcaster() {
                long ret = bindings.ChannelManagerReadArgs_get_tx_broadcaster(this.ptr);
+               if (ret < 1024) { return null; }
                BroadcasterInterface ret_hu_conv = new BroadcasterInterface(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -140,6 +144,7 @@ public class ChannelManagerReadArgs extends CommonBase {
         */
        public Logger get_logger() {
                long ret = bindings.ChannelManagerReadArgs_get_logger(this.ptr);
+               if (ret < 1024) { return null; }
                Logger ret_hu_conv = new Logger(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -160,6 +165,7 @@ public class ChannelManagerReadArgs extends CommonBase {
         */
        public UserConfig get_default_config() {
                long ret = bindings.ChannelManagerReadArgs_get_default_config(this.ptr);
+               if (ret < 1024) { return null; }
                UserConfig ret_hu_conv = new UserConfig(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -181,6 +187,7 @@ public class ChannelManagerReadArgs extends CommonBase {
         */
        public static ChannelManagerReadArgs of(KeysInterface keys_manager, FeeEstimator fee_estimator, Watch chain_monitor, BroadcasterInterface tx_broadcaster, Logger logger, 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 & ~1, Arrays.stream(channel_monitors).mapToLong(channel_monitors_conv_16 -> channel_monitors_conv_16 == null ? 0 : channel_monitors_conv_16.ptr & ~1).toArray());
+               if (ret < 1024) { return null; }
                ChannelManagerReadArgs ret_hu_conv = new ChannelManagerReadArgs(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                ret_hu_conv.ptrs_to.add(keys_manager);
index c5bb627289593e065d271538cb4d413451edf62d..32ea53ac3f9ac6cfb5b5946905108ddfba853546 100644 (file)
@@ -202,6 +202,16 @@ public class ChannelMessageHandler extends CommonBase {
                }, MessageSendEventsProvider.new_impl(MessageSendEventsProvider_impl).bindings_instance);
                return impl_holder.held;
        }
+
+       /**
+        * Gets the underlying MessageSendEventsProvider.
+        */
+       public MessageSendEventsProvider get_message_send_events_provider() {
+               MessageSendEventsProvider res = new MessageSendEventsProvider(null, bindings.LDKChannelMessageHandler_get_MessageSendEventsProvider(this.ptr));
+               this.ptrs_to.add(res);
+               return res;
+       }
+
        /**
         * Handle an incoming open_channel message from the given peer.
         */
index 68b04ace676866fbdce499a43934ea2a48a72c61..d0c0448d06c022b0eb2a3b2eec4c4f6c54fe8942 100644 (file)
@@ -38,6 +38,7 @@ public class ChannelMonitor extends CommonBase {
         */
        public ChannelMonitor clone() {
                long ret = bindings.ChannelMonitor_clone(this.ptr);
+               if (ret < 1024) { return null; }
                ChannelMonitor ret_hu_conv = new ChannelMonitor(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -59,6 +60,7 @@ public class ChannelMonitor extends CommonBase {
         */
        public Result_NoneMonitorUpdateErrorZ update_monitor(ChannelMonitorUpdate updates, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) {
                long ret = bindings.ChannelMonitor_update_monitor(this.ptr, updates == null ? 0 : updates.ptr & ~1, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
+               if (ret < 1024) { return null; }
                Result_NoneMonitorUpdateErrorZ ret_hu_conv = Result_NoneMonitorUpdateErrorZ.constr_from_ptr(ret);
                this.ptrs_to.add(updates);
                this.ptrs_to.add(broadcaster);
@@ -81,6 +83,7 @@ public class ChannelMonitor extends CommonBase {
         */
        public TwoTuple<OutPoint, byte[]> get_funding_txo() {
                long ret = bindings.ChannelMonitor_get_funding_txo(this.ptr);
+               if (ret < 1024) { return null; }
                long ret_a = bindings.LDKC2Tuple_OutPointScriptZ_get_a(ret);
                OutPoint ret_a_hu_conv = new OutPoint(null, ret_a);
                ret_a_hu_conv.ptrs_to.add(this);;
@@ -343,6 +346,7 @@ public class ChannelMonitor extends CommonBase {
         */
        public BestBlock current_best_block() {
                long ret = bindings.ChannelMonitor_current_best_block(this.ptr);
+               if (ret < 1024) { return null; }
                BestBlock ret_hu_conv = new BestBlock(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index fec769a5ee731b6158b326cf56f3116b1ea89655..06c462ecfec3fb59a10ed133004ca2ade0707221 100644 (file)
@@ -59,6 +59,7 @@ public class ChannelMonitorUpdate extends CommonBase {
         */
        public ChannelMonitorUpdate clone() {
                long ret = bindings.ChannelMonitorUpdate_clone(this.ptr);
+               if (ret < 1024) { return null; }
                ChannelMonitorUpdate ret_hu_conv = new ChannelMonitorUpdate(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -77,6 +78,7 @@ public class ChannelMonitorUpdate extends CommonBase {
         */
        public static Result_ChannelMonitorUpdateDecodeErrorZ read(byte[] ser) {
                long ret = bindings.ChannelMonitorUpdate_read(ser);
+               if (ret < 1024) { return null; }
                Result_ChannelMonitorUpdateDecodeErrorZ ret_hu_conv = Result_ChannelMonitorUpdateDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 1d595299050a9eb75c80d6d62fd3c50438d1bb1f..a0f36a8384378fc3a2c295bfd1b08aa6b1a05a46 100644 (file)
@@ -116,6 +116,7 @@ public class ChannelPublicKeys extends CommonBase {
         */
        public static ChannelPublicKeys of(byte[] funding_pubkey_arg, byte[] revocation_basepoint_arg, byte[] payment_point_arg, byte[] delayed_payment_basepoint_arg, byte[] htlc_basepoint_arg) {
                long ret = bindings.ChannelPublicKeys_new(funding_pubkey_arg, revocation_basepoint_arg, payment_point_arg, delayed_payment_basepoint_arg, htlc_basepoint_arg);
+               if (ret < 1024) { return null; }
                ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -126,6 +127,7 @@ public class ChannelPublicKeys extends CommonBase {
         */
        public ChannelPublicKeys clone() {
                long ret = bindings.ChannelPublicKeys_clone(this.ptr);
+               if (ret < 1024) { return null; }
                ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -144,6 +146,7 @@ public class ChannelPublicKeys extends CommonBase {
         */
        public static Result_ChannelPublicKeysDecodeErrorZ read(byte[] ser) {
                long ret = bindings.ChannelPublicKeys_read(ser);
+               if (ret < 1024) { return null; }
                Result_ChannelPublicKeysDecodeErrorZ ret_hu_conv = Result_ChannelPublicKeysDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 120a4c04de9c84f229a74d5a41ebf0dfe424bc34..2736915bc9c40881665b471647c567f17ce48b6e 100644 (file)
@@ -68,6 +68,7 @@ public class ChannelReestablish extends CommonBase {
         */
        public ChannelReestablish clone() {
                long ret = bindings.ChannelReestablish_clone(this.ptr);
+               if (ret < 1024) { return null; }
                ChannelReestablish ret_hu_conv = new ChannelReestablish(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -86,6 +87,7 @@ public class ChannelReestablish extends CommonBase {
         */
        public static Result_ChannelReestablishDecodeErrorZ read(byte[] ser) {
                long ret = bindings.ChannelReestablish_read(ser);
+               if (ret < 1024) { return null; }
                Result_ChannelReestablishDecodeErrorZ ret_hu_conv = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 747064b281742c8ebd91cf67c233c98eafb2532f..363f4bb3430dbbcda3ae52266dac321c3b468cb6 100644 (file)
@@ -27,6 +27,7 @@ public class ChannelTransactionParameters extends CommonBase {
         */
        public ChannelPublicKeys get_holder_pubkeys() {
                long ret = bindings.ChannelTransactionParameters_get_holder_pubkeys(this.ptr);
+               if (ret < 1024) { return null; }
                ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -75,9 +76,13 @@ public class ChannelTransactionParameters extends CommonBase {
        /**
         * The late-bound counterparty channel transaction parameters.
         * These parameters are populated at the point in the protocol where the counterparty provides them.
+        * 
+        * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
+       @Nullable
        public CounterpartyChannelTransactionParameters get_counterparty_parameters() {
                long ret = bindings.ChannelTransactionParameters_get_counterparty_parameters(this.ptr);
+               if (ret < 1024) { return null; }
                CounterpartyChannelTransactionParameters ret_hu_conv = new CounterpartyChannelTransactionParameters(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -86,17 +91,23 @@ public class ChannelTransactionParameters extends CommonBase {
        /**
         * The late-bound counterparty channel transaction parameters.
         * These parameters are populated at the point in the protocol where the counterparty provides them.
+        * 
+        * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
-       public void set_counterparty_parameters(CounterpartyChannelTransactionParameters val) {
+       public void set_counterparty_parameters(@Nullable CounterpartyChannelTransactionParameters val) {
                bindings.ChannelTransactionParameters_set_counterparty_parameters(this.ptr, val == null ? 0 : val.ptr & ~1);
                this.ptrs_to.add(val);
        }
 
        /**
         * The late-bound funding outpoint
+        * 
+        * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
+       @Nullable
        public OutPoint get_funding_outpoint() {
                long ret = bindings.ChannelTransactionParameters_get_funding_outpoint(this.ptr);
+               if (ret < 1024) { return null; }
                OutPoint ret_hu_conv = new OutPoint(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -104,8 +115,10 @@ public class ChannelTransactionParameters extends CommonBase {
 
        /**
         * The late-bound funding outpoint
+        * 
+        * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
-       public void set_funding_outpoint(OutPoint val) {
+       public void set_funding_outpoint(@Nullable OutPoint val) {
                bindings.ChannelTransactionParameters_set_funding_outpoint(this.ptr, val == null ? 0 : val.ptr & ~1);
                this.ptrs_to.add(val);
        }
@@ -115,6 +128,7 @@ public class ChannelTransactionParameters extends CommonBase {
         */
        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) {
                long ret = bindings.ChannelTransactionParameters_new(holder_pubkeys_arg == null ? 0 : holder_pubkeys_arg.ptr & ~1, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg == null ? 0 : counterparty_parameters_arg.ptr & ~1, funding_outpoint_arg == null ? 0 : funding_outpoint_arg.ptr & ~1);
+               if (ret < 1024) { return null; }
                ChannelTransactionParameters ret_hu_conv = new ChannelTransactionParameters(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                ret_hu_conv.ptrs_to.add(holder_pubkeys_arg);
@@ -128,6 +142,7 @@ public class ChannelTransactionParameters extends CommonBase {
         */
        public ChannelTransactionParameters clone() {
                long ret = bindings.ChannelTransactionParameters_clone(this.ptr);
+               if (ret < 1024) { return null; }
                ChannelTransactionParameters ret_hu_conv = new ChannelTransactionParameters(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -149,6 +164,7 @@ public class ChannelTransactionParameters extends CommonBase {
         */
        public DirectedChannelTransactionParameters as_holder_broadcastable() {
                long ret = bindings.ChannelTransactionParameters_as_holder_broadcastable(this.ptr);
+               if (ret < 1024) { return null; }
                DirectedChannelTransactionParameters ret_hu_conv = new DirectedChannelTransactionParameters(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -162,6 +178,7 @@ public class ChannelTransactionParameters extends CommonBase {
         */
        public DirectedChannelTransactionParameters as_counterparty_broadcastable() {
                long ret = bindings.ChannelTransactionParameters_as_counterparty_broadcastable(this.ptr);
+               if (ret < 1024) { return null; }
                DirectedChannelTransactionParameters ret_hu_conv = new DirectedChannelTransactionParameters(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -180,6 +197,7 @@ public class ChannelTransactionParameters extends CommonBase {
         */
        public static Result_ChannelTransactionParametersDecodeErrorZ read(byte[] ser) {
                long ret = bindings.ChannelTransactionParameters_read(ser);
+               if (ret < 1024) { return null; }
                Result_ChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_ChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index d121b6283ea7e0ec3832d32e65694cdf491c46fc..b4103271610d176f398eca7ff1720005a4346a6a 100644 (file)
@@ -38,6 +38,7 @@ public class ChannelUpdate extends CommonBase {
         */
        public UnsignedChannelUpdate get_contents() {
                long ret = bindings.ChannelUpdate_get_contents(this.ptr);
+               if (ret < 1024) { return null; }
                UnsignedChannelUpdate ret_hu_conv = new UnsignedChannelUpdate(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -56,6 +57,7 @@ public class ChannelUpdate extends CommonBase {
         */
        public static ChannelUpdate of(byte[] signature_arg, UnsignedChannelUpdate contents_arg) {
                long ret = bindings.ChannelUpdate_new(signature_arg, contents_arg == null ? 0 : contents_arg.ptr & ~1);
+               if (ret < 1024) { return null; }
                ChannelUpdate ret_hu_conv = new ChannelUpdate(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                ret_hu_conv.ptrs_to.add(contents_arg);
@@ -67,6 +69,7 @@ public class ChannelUpdate extends CommonBase {
         */
        public ChannelUpdate clone() {
                long ret = bindings.ChannelUpdate_clone(this.ptr);
+               if (ret < 1024) { return null; }
                ChannelUpdate ret_hu_conv = new ChannelUpdate(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -85,6 +88,7 @@ public class ChannelUpdate extends CommonBase {
         */
        public static Result_ChannelUpdateDecodeErrorZ read(byte[] ser) {
                long ret = bindings.ChannelUpdate_read(ser);
+               if (ret < 1024) { return null; }
                Result_ChannelUpdateDecodeErrorZ ret_hu_conv = Result_ChannelUpdateDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index cd5070e7502b5676d8de538cc680ed6a78dabc20..3cb1936021fb102b841a7f999fde758f45b2085e 100644 (file)
@@ -68,6 +68,7 @@ public class ClosingSigned extends CommonBase {
         */
        public static ClosingSigned of(byte[] channel_id_arg, long fee_satoshis_arg, byte[] signature_arg) {
                long ret = bindings.ClosingSigned_new(channel_id_arg, fee_satoshis_arg, signature_arg);
+               if (ret < 1024) { return null; }
                ClosingSigned ret_hu_conv = new ClosingSigned(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -78,6 +79,7 @@ public class ClosingSigned extends CommonBase {
         */
        public ClosingSigned clone() {
                long ret = bindings.ClosingSigned_clone(this.ptr);
+               if (ret < 1024) { return null; }
                ClosingSigned ret_hu_conv = new ClosingSigned(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -96,6 +98,7 @@ public class ClosingSigned extends CommonBase {
         */
        public static Result_ClosingSignedDecodeErrorZ read(byte[] ser) {
                long ret = bindings.ClosingSigned_read(ser);
+               if (ret < 1024) { return null; }
                Result_ClosingSignedDecodeErrorZ ret_hu_conv = Result_ClosingSignedDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 33893520e36665172281d0f025384cc844d37562..41ac7d1a209a6d2b9cb26fe81f447eac434b4f94 100644 (file)
@@ -60,6 +60,7 @@ public class CommitmentSigned extends CommonBase {
         */
        public static CommitmentSigned of(byte[] channel_id_arg, byte[] signature_arg, byte[][] htlc_signatures_arg) {
                long ret = bindings.CommitmentSigned_new(channel_id_arg, signature_arg, htlc_signatures_arg);
+               if (ret < 1024) { return null; }
                CommitmentSigned ret_hu_conv = new CommitmentSigned(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -70,6 +71,7 @@ public class CommitmentSigned extends CommonBase {
         */
        public CommitmentSigned clone() {
                long ret = bindings.CommitmentSigned_clone(this.ptr);
+               if (ret < 1024) { return null; }
                CommitmentSigned ret_hu_conv = new CommitmentSigned(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -88,6 +90,7 @@ public class CommitmentSigned extends CommonBase {
         */
        public static Result_CommitmentSignedDecodeErrorZ read(byte[] ser) {
                long ret = bindings.CommitmentSigned_read(ser);
+               if (ret < 1024) { return null; }
                Result_CommitmentSignedDecodeErrorZ ret_hu_conv = Result_CommitmentSignedDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 42f044ac5ccdf1b9a0ba825412b5a692d05986ea..41d1cb3773b046d30adc62f32a7866b288294270 100644 (file)
@@ -28,6 +28,7 @@ public class CommitmentTransaction extends CommonBase {
         */
        public CommitmentTransaction clone() {
                long ret = bindings.CommitmentTransaction_clone(this.ptr);
+               if (ret < 1024) { return null; }
                CommitmentTransaction ret_hu_conv = new CommitmentTransaction(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -46,6 +47,7 @@ public class CommitmentTransaction extends CommonBase {
         */
        public static Result_CommitmentTransactionDecodeErrorZ read(byte[] ser) {
                long ret = bindings.CommitmentTransaction_read(ser);
+               if (ret < 1024) { return null; }
                Result_CommitmentTransactionDecodeErrorZ ret_hu_conv = Result_CommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -92,6 +94,7 @@ public class CommitmentTransaction extends CommonBase {
         */
        public TrustedCommitmentTransaction trust() {
                long ret = bindings.CommitmentTransaction_trust(this.ptr);
+               if (ret < 1024) { return null; }
                TrustedCommitmentTransaction ret_hu_conv = new TrustedCommitmentTransaction(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -107,6 +110,7 @@ public class CommitmentTransaction extends CommonBase {
         */
        public Result_TrustedCommitmentTransactionNoneZ verify(DirectedChannelTransactionParameters channel_parameters, ChannelPublicKeys broadcaster_keys, ChannelPublicKeys countersignatory_keys) {
                long ret = bindings.CommitmentTransaction_verify(this.ptr, channel_parameters == null ? 0 : channel_parameters.ptr & ~1, broadcaster_keys == null ? 0 : broadcaster_keys.ptr & ~1, countersignatory_keys == null ? 0 : countersignatory_keys.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_TrustedCommitmentTransactionNoneZ ret_hu_conv = Result_TrustedCommitmentTransactionNoneZ.constr_from_ptr(ret);
                this.ptrs_to.add(channel_parameters);
                this.ptrs_to.add(broadcaster_keys);
index dbd15bc6b45046202c7e90c72dddcc631d975cc8..e9e4b971bb716cb57e3c5680de69deacad8f9b97 100644 (file)
@@ -53,9 +53,13 @@ public class CommitmentUpdate extends CommonBase {
 
        /**
         * An update_fee message which should be sent
+        * 
+        * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
+       @Nullable
        public UpdateFee get_update_fee() {
                long ret = bindings.CommitmentUpdate_get_update_fee(this.ptr);
+               if (ret < 1024) { return null; }
                UpdateFee ret_hu_conv = new UpdateFee(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -63,8 +67,10 @@ public class CommitmentUpdate extends CommonBase {
 
        /**
         * An update_fee message which should be sent
+        * 
+        * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
-       public void set_update_fee(UpdateFee val) {
+       public void set_update_fee(@Nullable UpdateFee val) {
                bindings.CommitmentUpdate_set_update_fee(this.ptr, val == null ? 0 : val.ptr & ~1);
                this.ptrs_to.add(val);
        }
@@ -74,6 +80,7 @@ public class CommitmentUpdate extends CommonBase {
         */
        public CommitmentSigned get_commitment_signed() {
                long ret = bindings.CommitmentUpdate_get_commitment_signed(this.ptr);
+               if (ret < 1024) { return null; }
                CommitmentSigned ret_hu_conv = new CommitmentSigned(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -92,6 +99,7 @@ public class CommitmentUpdate extends CommonBase {
         */
        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) {
                long ret = bindings.CommitmentUpdate_new(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 & ~1).toArray(), 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 & ~1).toArray(), 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 & ~1).toArray(), 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 & ~1).toArray(), update_fee_arg == null ? 0 : update_fee_arg.ptr & ~1, commitment_signed_arg == null ? 0 : commitment_signed_arg.ptr & ~1);
+               if (ret < 1024) { return null; }
                CommitmentUpdate ret_hu_conv = new CommitmentUpdate(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                /* TODO 2 UpdateAddHTLC  */;
@@ -108,6 +116,7 @@ public class CommitmentUpdate extends CommonBase {
         */
        public CommitmentUpdate clone() {
                long ret = bindings.CommitmentUpdate_clone(this.ptr);
+               if (ret < 1024) { return null; }
                CommitmentUpdate ret_hu_conv = new CommitmentUpdate(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index 1794158b79f8e19164e3c2a838a0926c7fd13d62..623988627c8d604c99804a696f8197a31f7f1fa7 100644 (file)
@@ -3,5 +3,5 @@ import java.util.LinkedList;
 class CommonBase {
        long ptr;
        LinkedList<Object> ptrs_to = new LinkedList();
-       protected CommonBase(long ptr) { this.ptr = ptr; }
+       protected CommonBase(long ptr) { assert ptr > 1024; this.ptr = ptr; }
 }
index 887b60ae9c88b232dc68aa91b6a9980083260712..2a631f4a2c6b1af7ed04cd343848bca1781d36c6 100644 (file)
@@ -23,6 +23,7 @@ public class CounterpartyChannelTransactionParameters extends CommonBase {
         */
        public ChannelPublicKeys get_pubkeys() {
                long ret = bindings.CounterpartyChannelTransactionParameters_get_pubkeys(this.ptr);
+               if (ret < 1024) { return null; }
                ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -56,6 +57,7 @@ public class CounterpartyChannelTransactionParameters extends CommonBase {
         */
        public static CounterpartyChannelTransactionParameters of(ChannelPublicKeys pubkeys_arg, short selected_contest_delay_arg) {
                long ret = bindings.CounterpartyChannelTransactionParameters_new(pubkeys_arg == null ? 0 : pubkeys_arg.ptr & ~1, selected_contest_delay_arg);
+               if (ret < 1024) { return null; }
                CounterpartyChannelTransactionParameters ret_hu_conv = new CounterpartyChannelTransactionParameters(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                ret_hu_conv.ptrs_to.add(pubkeys_arg);
@@ -67,6 +69,7 @@ public class CounterpartyChannelTransactionParameters extends CommonBase {
         */
        public CounterpartyChannelTransactionParameters clone() {
                long ret = bindings.CounterpartyChannelTransactionParameters_clone(this.ptr);
+               if (ret < 1024) { return null; }
                CounterpartyChannelTransactionParameters ret_hu_conv = new CounterpartyChannelTransactionParameters(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -85,6 +88,7 @@ public class CounterpartyChannelTransactionParameters extends CommonBase {
         */
        public static Result_CounterpartyChannelTransactionParametersDecodeErrorZ read(byte[] ser) {
                long ret = bindings.CounterpartyChannelTransactionParameters_read(ser);
+               if (ret < 1024) { return null; }
                Result_CounterpartyChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_CounterpartyChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 66a6af4413918b9b93ec83425bc6c5ef62f4895b..627f11bbfaf0654f3d1baa173199b89ef0599c8a 100644 (file)
@@ -58,6 +58,7 @@ public class DataLossProtect extends CommonBase {
         */
        public static DataLossProtect of(byte[] your_last_per_commitment_secret_arg, byte[] my_current_per_commitment_point_arg) {
                long ret = bindings.DataLossProtect_new(your_last_per_commitment_secret_arg, my_current_per_commitment_point_arg);
+               if (ret < 1024) { return null; }
                DataLossProtect ret_hu_conv = new DataLossProtect(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -68,6 +69,7 @@ public class DataLossProtect extends CommonBase {
         */
        public DataLossProtect clone() {
                long ret = bindings.DataLossProtect_clone(this.ptr);
+               if (ret < 1024) { return null; }
                DataLossProtect ret_hu_conv = new DataLossProtect(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index 5a7703fcc97e0f77ab5a346067dab6c1c457edd4..ec49efbdc6530d1b1f05f3dd77c6fa23f40340bc 100644 (file)
@@ -23,6 +23,7 @@ public class DecodeError extends CommonBase {
         */
        public DecodeError clone() {
                long ret = bindings.DecodeError_clone(this.ptr);
+               if (ret < 1024) { return null; }
                DecodeError ret_hu_conv = new DecodeError(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index 855b03acc053206b4f2192c11f673b25ebd30864..b64dc7204265c45186f003de4f7e5be2a56fee2a 100644 (file)
@@ -24,6 +24,7 @@ public class DelayedPaymentOutputDescriptor extends CommonBase {
         */
        public OutPoint get_outpoint() {
                long ret = bindings.DelayedPaymentOutputDescriptor_get_outpoint(this.ptr);
+               if (ret < 1024) { return null; }
                OutPoint ret_hu_conv = new OutPoint(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -132,6 +133,7 @@ public class DelayedPaymentOutputDescriptor extends CommonBase {
         */
        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) {
                long ret = bindings.DelayedPaymentOutputDescriptor_new(outpoint_arg == null ? 0 : outpoint_arg.ptr & ~1, per_commitment_point_arg, to_self_delay_arg, output_arg.ptr, revocation_pubkey_arg, channel_keys_id_arg, channel_value_satoshis_arg);
+               if (ret < 1024) { return null; }
                DelayedPaymentOutputDescriptor ret_hu_conv = new DelayedPaymentOutputDescriptor(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                ret_hu_conv.ptrs_to.add(outpoint_arg);
@@ -143,6 +145,7 @@ public class DelayedPaymentOutputDescriptor extends CommonBase {
         */
        public DelayedPaymentOutputDescriptor clone() {
                long ret = bindings.DelayedPaymentOutputDescriptor_clone(this.ptr);
+               if (ret < 1024) { return null; }
                DelayedPaymentOutputDescriptor ret_hu_conv = new DelayedPaymentOutputDescriptor(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -161,6 +164,7 @@ public class DelayedPaymentOutputDescriptor extends CommonBase {
         */
        public static Result_DelayedPaymentOutputDescriptorDecodeErrorZ read(byte[] ser) {
                long ret = bindings.DelayedPaymentOutputDescriptor_read(ser);
+               if (ret < 1024) { return null; }
                Result_DelayedPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_DelayedPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index b9b165c17239dd9758177e38884fa60fba642f2a..055e3a037a7a649095dbbec8615992eec52d58c1 100644 (file)
@@ -37,6 +37,7 @@ public class Description extends CommonBase {
         */
        public Description clone() {
                long ret = bindings.Description_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Description ret_hu_conv = new Description(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -50,6 +51,7 @@ public class Description extends CommonBase {
         */
        public static Result_DescriptionCreationErrorZ of(String description) {
                long ret = bindings.Description_new(description);
+               if (ret < 1024) { return null; }
                Result_DescriptionCreationErrorZ ret_hu_conv = Result_DescriptionCreationErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 17b9ab0b5def05bb7319060eda65f9a33db4db3f..0543b7972736e18fa9ec26654701af579c925a9c 100644 (file)
@@ -27,6 +27,7 @@ public class DirectedChannelTransactionParameters extends CommonBase {
         */
        public ChannelPublicKeys broadcaster_pubkeys() {
                long ret = bindings.DirectedChannelTransactionParameters_broadcaster_pubkeys(this.ptr);
+               if (ret < 1024) { return null; }
                ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -37,6 +38,7 @@ public class DirectedChannelTransactionParameters extends CommonBase {
         */
        public ChannelPublicKeys countersignatory_pubkeys() {
                long ret = bindings.DirectedChannelTransactionParameters_countersignatory_pubkeys(this.ptr);
+               if (ret < 1024) { return null; }
                ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -67,6 +69,7 @@ public class DirectedChannelTransactionParameters extends CommonBase {
         */
        public OutPoint funding_outpoint() {
                long ret = bindings.DirectedChannelTransactionParameters_funding_outpoint(this.ptr);
+               if (ret < 1024) { return null; }
                OutPoint ret_hu_conv = new OutPoint(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index e2f59c107189c1a416d0b4600dca48f36834ee4e..1736de654b6cc0d6f34bf53fcc322615f3b4d2bc 100644 (file)
@@ -86,6 +86,7 @@ public class DirectionalChannelInfo extends CommonBase {
         */
        public Option_u64Z get_htlc_maximum_msat() {
                long ret = bindings.DirectionalChannelInfo_get_htlc_maximum_msat(this.ptr);
+               if (ret < 1024) { return null; }
                Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -103,6 +104,7 @@ public class DirectionalChannelInfo extends CommonBase {
         */
        public RoutingFees get_fees() {
                long ret = bindings.DirectionalChannelInfo_get_fees(this.ptr);
+               if (ret < 1024) { return null; }
                RoutingFees ret_hu_conv = new RoutingFees(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -121,9 +123,13 @@ public class DirectionalChannelInfo extends CommonBase {
         * Mostly redundant with the data we store in fields explicitly.
         * Everything else is useful only for sending out for initial routing sync.
         * Not stored if contains excess data to prevent DoS.
+        * 
+        * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
+       @Nullable
        public ChannelUpdate get_last_update_message() {
                long ret = bindings.DirectionalChannelInfo_get_last_update_message(this.ptr);
+               if (ret < 1024) { return null; }
                ChannelUpdate ret_hu_conv = new ChannelUpdate(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -134,8 +140,10 @@ public class DirectionalChannelInfo extends CommonBase {
         * Mostly redundant with the data we store in fields explicitly.
         * Everything else is useful only for sending out for initial routing sync.
         * Not stored if contains excess data to prevent DoS.
+        * 
+        * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
-       public void set_last_update_message(ChannelUpdate val) {
+       public void set_last_update_message(@Nullable ChannelUpdate val) {
                bindings.DirectionalChannelInfo_set_last_update_message(this.ptr, val == null ? 0 : val.ptr & ~1);
                this.ptrs_to.add(val);
        }
@@ -145,6 +153,7 @@ public class DirectionalChannelInfo extends CommonBase {
         */
        public static DirectionalChannelInfo of(int last_update_arg, boolean enabled_arg, short cltv_expiry_delta_arg, long htlc_minimum_msat_arg, Option_u64Z htlc_maximum_msat_arg, RoutingFees fees_arg, ChannelUpdate last_update_message_arg) {
                long ret = bindings.DirectionalChannelInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg.ptr, fees_arg == null ? 0 : fees_arg.ptr & ~1, last_update_message_arg == null ? 0 : last_update_message_arg.ptr & ~1);
+               if (ret < 1024) { return null; }
                DirectionalChannelInfo ret_hu_conv = new DirectionalChannelInfo(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                ret_hu_conv.ptrs_to.add(fees_arg);
@@ -157,6 +166,7 @@ public class DirectionalChannelInfo extends CommonBase {
         */
        public DirectionalChannelInfo clone() {
                long ret = bindings.DirectionalChannelInfo_clone(this.ptr);
+               if (ret < 1024) { return null; }
                DirectionalChannelInfo ret_hu_conv = new DirectionalChannelInfo(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -175,6 +185,7 @@ public class DirectionalChannelInfo extends CommonBase {
         */
        public static Result_DirectionalChannelInfoDecodeErrorZ read(byte[] ser) {
                long ret = bindings.DirectionalChannelInfo_read(ser);
+               if (ret < 1024) { return null; }
                Result_DirectionalChannelInfoDecodeErrorZ ret_hu_conv = Result_DirectionalChannelInfoDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 3eb5e9c3f740b94fa66171901c93f25220a62244..3c1fe74be2bd6ab940f104c2bcd9678692d8ff0e 100644 (file)
@@ -71,6 +71,7 @@ public class ErrorAction extends CommonBase {
         */
        public ErrorAction clone() {
                long ret = bindings.ErrorAction_clone(this.ptr);
+               if (ret < 1024) { return null; }
                ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index c68a56d95341263c55f928e73e17be9eb15004dd..63bd37dea426f5b395c3d097496385264a3a497d 100644 (file)
@@ -59,6 +59,7 @@ public class ErrorMessage extends CommonBase {
         */
        public static ErrorMessage of(byte[] channel_id_arg, String data_arg) {
                long ret = bindings.ErrorMessage_new(channel_id_arg, data_arg);
+               if (ret < 1024) { return null; }
                ErrorMessage ret_hu_conv = new ErrorMessage(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -69,6 +70,7 @@ public class ErrorMessage extends CommonBase {
         */
        public ErrorMessage clone() {
                long ret = bindings.ErrorMessage_clone(this.ptr);
+               if (ret < 1024) { return null; }
                ErrorMessage ret_hu_conv = new ErrorMessage(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -87,6 +89,7 @@ public class ErrorMessage extends CommonBase {
         */
        public static Result_ErrorMessageDecodeErrorZ read(byte[] ser) {
                long ret = bindings.ErrorMessage_read(ser);
+               if (ret < 1024) { return null; }
                Result_ErrorMessageDecodeErrorZ ret_hu_conv = Result_ErrorMessageDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index ee377ed46c6639c02bc9172b982376baf1f64cff..779333bf57337d58376244b52a22c9e172ce5fc2 100644 (file)
@@ -24,6 +24,7 @@ public class ErroringMessageHandler extends CommonBase {
         */
        public static ErroringMessageHandler of() {
                long ret = bindings.ErroringMessageHandler_new();
+               if (ret < 1024) { return null; }
                ErroringMessageHandler ret_hu_conv = new ErroringMessageHandler(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -35,6 +36,7 @@ public class ErroringMessageHandler extends CommonBase {
         */
        public MessageSendEventsProvider as_MessageSendEventsProvider() {
                long ret = bindings.ErroringMessageHandler_as_MessageSendEventsProvider(this.ptr);
+               if (ret < 1024) { return null; }
                MessageSendEventsProvider ret_hu_conv = new MessageSendEventsProvider(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -46,6 +48,7 @@ public class ErroringMessageHandler extends CommonBase {
         */
        public ChannelMessageHandler as_ChannelMessageHandler() {
                long ret = bindings.ErroringMessageHandler_as_ChannelMessageHandler(this.ptr);
+               if (ret < 1024) { return null; }
                ChannelMessageHandler ret_hu_conv = new ChannelMessageHandler(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index b519a856c60ff092d818774107a56d11604c846c..a91a81b484c2b48c891fbee7ef94461cbe002142 100644 (file)
@@ -59,17 +59,16 @@ public class Event extends CommonBase {
        }
        public final static class PaymentReceived extends Event {
                public final byte[] payment_hash;
-               public final byte[] payment_preimage;
-               public final byte[] payment_secret;
                public final long amt;
-               public final long user_payment_id;
+               public final PaymentPurpose purpose;
                private PaymentReceived(long ptr, bindings.LDKEvent.PaymentReceived obj) {
                        super(null, ptr);
                        this.payment_hash = obj.payment_hash;
-                       this.payment_preimage = obj.payment_preimage;
-                       this.payment_secret = obj.payment_secret;
                        this.amt = obj.amt;
-                       this.user_payment_id = obj.user_payment_id;
+                       long purpose = obj.purpose;
+                       PaymentPurpose purpose_hu_conv = PaymentPurpose.constr_from_ptr(purpose);
+                       purpose_hu_conv.ptrs_to.add(this);
+                       this.purpose = purpose_hu_conv;
                }
        }
        public final static class PaymentSent extends Event {
@@ -115,6 +114,7 @@ public class Event extends CommonBase {
         */
        public Event clone() {
                long ret = bindings.Event_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Event ret_hu_conv = Event.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index 061b549d023a25e426eb8f265bc6dc0daad680f0..6b652123e70fc3b87edfbc1ef6f0cde74a43390c 100644 (file)
@@ -40,6 +40,7 @@ public class ExpiryTime extends CommonBase {
         */
        public ExpiryTime clone() {
                long ret = bindings.ExpiryTime_clone(this.ptr);
+               if (ret < 1024) { return null; }
                ExpiryTime ret_hu_conv = new ExpiryTime(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -52,6 +53,7 @@ public class ExpiryTime extends CommonBase {
         */
        public static Result_ExpiryTimeCreationErrorZ from_seconds(long seconds) {
                long ret = bindings.ExpiryTime_from_seconds(seconds);
+               if (ret < 1024) { return null; }
                Result_ExpiryTimeCreationErrorZ ret_hu_conv = Result_ExpiryTimeCreationErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -63,6 +65,7 @@ public class ExpiryTime extends CommonBase {
         */
        public static Result_ExpiryTimeCreationErrorZ from_duration(long duration) {
                long ret = bindings.ExpiryTime_from_duration(duration);
+               if (ret < 1024) { return null; }
                Result_ExpiryTimeCreationErrorZ ret_hu_conv = Result_ExpiryTimeCreationErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index de5495fe8ac77cef74b544a84b642acec820f04f..a45851620390f04da2a724b030c746992a83c775 100644 (file)
@@ -61,6 +61,7 @@ public class Fallback extends CommonBase {
         */
        public Fallback clone() {
                long ret = bindings.Fallback_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Fallback ret_hu_conv = Fallback.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index 4df4cb285e082b1342b9875307ddc094fc296fb6..0de2d31774c95f3c4855c4e833991abd14c1f0c7 100644 (file)
@@ -35,6 +35,7 @@ public class FilesystemPersister extends CommonBase {
         */
        public static FilesystemPersister of(String path_to_channel_data) {
                long ret = bindings.FilesystemPersister_new(path_to_channel_data);
+               if (ret < 1024) { return null; }
                FilesystemPersister ret_hu_conv = new FilesystemPersister(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -53,6 +54,7 @@ public class FilesystemPersister extends CommonBase {
         */
        public Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ read_channelmonitors(KeysInterface keys_manager) {
                long ret = bindings.FilesystemPersister_read_channelmonitors(this.ptr, keys_manager == null ? 0 : keys_manager.ptr);
+               if (ret < 1024) { return null; }
                Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ ret_hu_conv = Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.constr_from_ptr(ret);
                this.ptrs_to.add(keys_manager);
                return ret_hu_conv;
@@ -64,6 +66,7 @@ public class FilesystemPersister extends CommonBase {
         */
        public Persist as_Persist() {
                long ret = bindings.FilesystemPersister_as_Persist(this.ptr);
+               if (ret < 1024) { return null; }
                Persist ret_hu_conv = new Persist(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index e1dc712cca1aebca459a927599300c127aaeb3ab..ac15b01a3dee8345bd62e4e3e6ca2b9c500522fc 100644 (file)
@@ -98,6 +98,7 @@ public class Filter extends CommonBase {
         */
        public Option_C2Tuple_usizeTransactionZZ register_output(WatchedOutput output) {
                long ret = bindings.Filter_register_output(this.ptr, output == null ? 0 : output.ptr & ~1);
+               if (ret < 1024) { return null; }
                Option_C2Tuple_usizeTransactionZZ ret_hu_conv = Option_C2Tuple_usizeTransactionZZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                this.ptrs_to.add(output);
index a49682c50ed19a99c2c8f496d4afc8e0093ffff9..c270d9c92ab882ceb40cc7aedd97d1040a84456b 100644 (file)
@@ -83,6 +83,7 @@ public class FundingCreated extends CommonBase {
         */
        public static FundingCreated of(byte[] temporary_channel_id_arg, byte[] funding_txid_arg, short funding_output_index_arg, byte[] signature_arg) {
                long ret = bindings.FundingCreated_new(temporary_channel_id_arg, funding_txid_arg, funding_output_index_arg, signature_arg);
+               if (ret < 1024) { return null; }
                FundingCreated ret_hu_conv = new FundingCreated(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -93,6 +94,7 @@ public class FundingCreated extends CommonBase {
         */
        public FundingCreated clone() {
                long ret = bindings.FundingCreated_clone(this.ptr);
+               if (ret < 1024) { return null; }
                FundingCreated ret_hu_conv = new FundingCreated(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -111,6 +113,7 @@ public class FundingCreated extends CommonBase {
         */
        public static Result_FundingCreatedDecodeErrorZ read(byte[] ser) {
                long ret = bindings.FundingCreated_read(ser);
+               if (ret < 1024) { return null; }
                Result_FundingCreatedDecodeErrorZ ret_hu_conv = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 4f5daef277d626f51abb11f2a16fee487408496e..9d7adabc20eee1ccd4a6ed6dbe16139ae25db224 100644 (file)
@@ -53,6 +53,7 @@ public class FundingLocked extends CommonBase {
         */
        public static FundingLocked of(byte[] channel_id_arg, byte[] next_per_commitment_point_arg) {
                long ret = bindings.FundingLocked_new(channel_id_arg, next_per_commitment_point_arg);
+               if (ret < 1024) { return null; }
                FundingLocked ret_hu_conv = new FundingLocked(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -63,6 +64,7 @@ public class FundingLocked extends CommonBase {
         */
        public FundingLocked clone() {
                long ret = bindings.FundingLocked_clone(this.ptr);
+               if (ret < 1024) { return null; }
                FundingLocked ret_hu_conv = new FundingLocked(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -81,6 +83,7 @@ public class FundingLocked extends CommonBase {
         */
        public static Result_FundingLockedDecodeErrorZ read(byte[] ser) {
                long ret = bindings.FundingLocked_read(ser);
+               if (ret < 1024) { return null; }
                Result_FundingLockedDecodeErrorZ ret_hu_conv = Result_FundingLockedDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 5755a5b569bbd0bfab9d1c0e0c2d697cfb9c4a57..51e6f4ce38cd993310743582c07c08aeab9ffb3d 100644 (file)
@@ -53,6 +53,7 @@ public class FundingSigned extends CommonBase {
         */
        public static FundingSigned of(byte[] channel_id_arg, byte[] signature_arg) {
                long ret = bindings.FundingSigned_new(channel_id_arg, signature_arg);
+               if (ret < 1024) { return null; }
                FundingSigned ret_hu_conv = new FundingSigned(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -63,6 +64,7 @@ public class FundingSigned extends CommonBase {
         */
        public FundingSigned clone() {
                long ret = bindings.FundingSigned_clone(this.ptr);
+               if (ret < 1024) { return null; }
                FundingSigned ret_hu_conv = new FundingSigned(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -81,6 +83,7 @@ public class FundingSigned extends CommonBase {
         */
        public static Result_FundingSignedDecodeErrorZ read(byte[] ser) {
                long ret = bindings.FundingSigned_read(ser);
+               if (ret < 1024) { return null; }
                Result_FundingSignedDecodeErrorZ ret_hu_conv = Result_FundingSignedDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index b9602b4370f076a6ea3c97b59dd25de3e1b3e147..f4bdfd4f88a3989e10fe88fe1278eab595f87755 100644 (file)
@@ -70,6 +70,7 @@ public class GossipTimestampFilter extends CommonBase {
         */
        public static GossipTimestampFilter of(byte[] chain_hash_arg, int first_timestamp_arg, int timestamp_range_arg) {
                long ret = bindings.GossipTimestampFilter_new(chain_hash_arg, first_timestamp_arg, timestamp_range_arg);
+               if (ret < 1024) { return null; }
                GossipTimestampFilter ret_hu_conv = new GossipTimestampFilter(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -80,6 +81,7 @@ public class GossipTimestampFilter extends CommonBase {
         */
        public GossipTimestampFilter clone() {
                long ret = bindings.GossipTimestampFilter_clone(this.ptr);
+               if (ret < 1024) { return null; }
                GossipTimestampFilter ret_hu_conv = new GossipTimestampFilter(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -90,6 +92,7 @@ public class GossipTimestampFilter extends CommonBase {
         */
        public static Result_GossipTimestampFilterDecodeErrorZ read(byte[] ser) {
                long ret = bindings.GossipTimestampFilter_read(ser);
+               if (ret < 1024) { return null; }
                Result_GossipTimestampFilterDecodeErrorZ ret_hu_conv = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 7ce939f9613ca9a5663ae75cc84c0b314e668eed..0f8c3c5e87a0d529bdbd64d71c547cf83e18dcd2 100644 (file)
@@ -66,6 +66,7 @@ public class HTLCFailChannelUpdate extends CommonBase {
         */
        public HTLCFailChannelUpdate clone() {
                long ret = bindings.HTLCFailChannelUpdate_clone(this.ptr);
+               if (ret < 1024) { return null; }
                HTLCFailChannelUpdate ret_hu_conv = HTLCFailChannelUpdate.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index 97a054bf3f58162809460ff18b19ecd9bf20224f..f12e9f00e690b1898474adb5cfdcd6d38289103b 100644 (file)
@@ -93,6 +93,7 @@ public class HTLCOutputInCommitment extends CommonBase {
         */
        public Option_u32Z get_transaction_output_index() {
                long ret = bindings.HTLCOutputInCommitment_get_transaction_output_index(this.ptr);
+               if (ret < 1024) { return null; }
                Option_u32Z ret_hu_conv = Option_u32Z.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -112,6 +113,7 @@ public class HTLCOutputInCommitment extends CommonBase {
         */
        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) {
                long ret = bindings.HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg, transaction_output_index_arg.ptr);
+               if (ret < 1024) { return null; }
                HTLCOutputInCommitment ret_hu_conv = new HTLCOutputInCommitment(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -122,6 +124,7 @@ public class HTLCOutputInCommitment extends CommonBase {
         */
        public HTLCOutputInCommitment clone() {
                long ret = bindings.HTLCOutputInCommitment_clone(this.ptr);
+               if (ret < 1024) { return null; }
                HTLCOutputInCommitment ret_hu_conv = new HTLCOutputInCommitment(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -140,6 +143,7 @@ public class HTLCOutputInCommitment extends CommonBase {
         */
        public static Result_HTLCOutputInCommitmentDecodeErrorZ read(byte[] ser) {
                long ret = bindings.HTLCOutputInCommitment_read(ser);
+               if (ret < 1024) { return null; }
                Result_HTLCOutputInCommitmentDecodeErrorZ ret_hu_conv = Result_HTLCOutputInCommitmentDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 6f6a08f7a903647f5c829671af79cca44a22094e..994c13587a7ac95531198e393d3f69f66de17d16 100644 (file)
@@ -25,6 +25,7 @@ public class HTLCUpdate extends CommonBase {
         */
        public HTLCUpdate clone() {
                long ret = bindings.HTLCUpdate_clone(this.ptr);
+               if (ret < 1024) { return null; }
                HTLCUpdate ret_hu_conv = new HTLCUpdate(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -43,6 +44,7 @@ public class HTLCUpdate extends CommonBase {
         */
        public static Result_HTLCUpdateDecodeErrorZ read(byte[] ser) {
                long ret = bindings.HTLCUpdate_read(ser);
+               if (ret < 1024) { return null; }
                Result_HTLCUpdateDecodeErrorZ ret_hu_conv = Result_HTLCUpdateDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 11310a2145421a592adc1480a1545118dc865de8..4b09169c97bb5e804d42c01ce68379b8cb2e1017 100644 (file)
@@ -47,6 +47,7 @@ public class HolderCommitmentTransaction extends CommonBase {
         */
        public HolderCommitmentTransaction clone() {
                long ret = bindings.HolderCommitmentTransaction_clone(this.ptr);
+               if (ret < 1024) { return null; }
                HolderCommitmentTransaction ret_hu_conv = new HolderCommitmentTransaction(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -65,6 +66,7 @@ public class HolderCommitmentTransaction extends CommonBase {
         */
        public static Result_HolderCommitmentTransactionDecodeErrorZ read(byte[] ser) {
                long ret = bindings.HolderCommitmentTransaction_read(ser);
+               if (ret < 1024) { return null; }
                Result_HolderCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_HolderCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -75,6 +77,7 @@ public class HolderCommitmentTransaction extends CommonBase {
         */
        public static HolderCommitmentTransaction of(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 & ~1, counterparty_sig, counterparty_htlc_sigs, holder_funding_key, counterparty_funding_key);
+               if (ret < 1024) { return null; }
                HolderCommitmentTransaction ret_hu_conv = new HolderCommitmentTransaction(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                ret_hu_conv.ptrs_to.add(commitment_tx);
index eb7a7fdc7b43edbbc224b34022acd0ceb89f4439..2c5888f4442f089c181c1839a886a80f81301d26 100644 (file)
@@ -24,6 +24,7 @@ public class IgnoringMessageHandler extends CommonBase {
         */
        public static IgnoringMessageHandler of() {
                long ret = bindings.IgnoringMessageHandler_new();
+               if (ret < 1024) { return null; }
                IgnoringMessageHandler ret_hu_conv = new IgnoringMessageHandler(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -35,6 +36,7 @@ public class IgnoringMessageHandler extends CommonBase {
         */
        public MessageSendEventsProvider as_MessageSendEventsProvider() {
                long ret = bindings.IgnoringMessageHandler_as_MessageSendEventsProvider(this.ptr);
+               if (ret < 1024) { return null; }
                MessageSendEventsProvider ret_hu_conv = new MessageSendEventsProvider(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -46,6 +48,7 @@ public class IgnoringMessageHandler extends CommonBase {
         */
        public RoutingMessageHandler as_RoutingMessageHandler() {
                long ret = bindings.IgnoringMessageHandler_as_RoutingMessageHandler(this.ptr);
+               if (ret < 1024) { return null; }
                RoutingMessageHandler ret_hu_conv = new RoutingMessageHandler(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index 94b5af185dfddd856376d6e59c29992a9b849fd8..be5e2887b61c31dba541ed3d49b86d101a4a117d 100644 (file)
@@ -116,6 +116,7 @@ public class InMemorySigner extends CommonBase {
         */
        public InMemorySigner clone() {
                long ret = bindings.InMemorySigner_clone(this.ptr);
+               if (ret < 1024) { return null; }
                InMemorySigner ret_hu_conv = new InMemorySigner(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -126,6 +127,7 @@ public class InMemorySigner extends CommonBase {
         */
        public static InMemorySigner of(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(funding_key, revocation_base_key, payment_key, delayed_payment_base_key, htlc_base_key, commitment_seed, channel_value_satoshis, channel_keys_id);
+               if (ret < 1024) { return null; }
                InMemorySigner ret_hu_conv = new InMemorySigner(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -137,6 +139,7 @@ public class InMemorySigner extends CommonBase {
         */
        public ChannelPublicKeys counterparty_pubkeys() {
                long ret = bindings.InMemorySigner_counterparty_pubkeys(this.ptr);
+               if (ret < 1024) { return null; }
                ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -179,6 +182,7 @@ public class InMemorySigner extends CommonBase {
         */
        public OutPoint funding_outpoint() {
                long ret = bindings.InMemorySigner_funding_outpoint(this.ptr);
+               if (ret < 1024) { return null; }
                OutPoint ret_hu_conv = new OutPoint(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -192,6 +196,7 @@ public class InMemorySigner extends CommonBase {
         */
        public ChannelTransactionParameters get_channel_parameters() {
                long ret = bindings.InMemorySigner_get_channel_parameters(this.ptr);
+               if (ret < 1024) { return null; }
                ChannelTransactionParameters ret_hu_conv = new ChannelTransactionParameters(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -206,6 +211,7 @@ public class InMemorySigner extends CommonBase {
         */
        public Result_CVec_CVec_u8ZZNoneZ sign_counterparty_payment_input(byte[] spend_tx, long input_idx, StaticPaymentOutputDescriptor descriptor) {
                long ret = bindings.InMemorySigner_sign_counterparty_payment_input(this.ptr, spend_tx, input_idx, descriptor == null ? 0 : descriptor.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_CVec_CVec_u8ZZNoneZ ret_hu_conv = Result_CVec_CVec_u8ZZNoneZ.constr_from_ptr(ret);
                this.ptrs_to.add(descriptor);
                return ret_hu_conv;
@@ -221,6 +227,7 @@ public class InMemorySigner extends CommonBase {
         */
        public Result_CVec_CVec_u8ZZNoneZ sign_dynamic_p2wsh_input(byte[] spend_tx, long input_idx, DelayedPaymentOutputDescriptor descriptor) {
                long ret = bindings.InMemorySigner_sign_dynamic_p2wsh_input(this.ptr, spend_tx, input_idx, descriptor == null ? 0 : descriptor.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_CVec_CVec_u8ZZNoneZ ret_hu_conv = Result_CVec_CVec_u8ZZNoneZ.constr_from_ptr(ret);
                this.ptrs_to.add(descriptor);
                return ret_hu_conv;
@@ -232,6 +239,7 @@ public class InMemorySigner extends CommonBase {
         */
        public BaseSign as_BaseSign() {
                long ret = bindings.InMemorySigner_as_BaseSign(this.ptr);
+               if (ret < 1024) { return null; }
                BaseSign ret_hu_conv = new BaseSign(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -243,6 +251,7 @@ public class InMemorySigner extends CommonBase {
         */
        public Sign as_Sign() {
                long ret = bindings.InMemorySigner_as_Sign(this.ptr);
+               if (ret < 1024) { return null; }
                Sign ret_hu_conv = new Sign(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -261,6 +270,7 @@ public class InMemorySigner extends CommonBase {
         */
        public static Result_InMemorySignerDecodeErrorZ read(byte[] ser) {
                long ret = bindings.InMemorySigner_read(ser);
+               if (ret < 1024) { return null; }
                Result_InMemorySignerDecodeErrorZ ret_hu_conv = Result_InMemorySignerDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index dd30adbae226724931c95ea7a7b3b22b685495ed..7e8bcd817bd40c36581a501602bdb44b0d64b663 100644 (file)
@@ -23,6 +23,7 @@ public class Init extends CommonBase {
         */
        public InitFeatures get_features() {
                long ret = bindings.Init_get_features(this.ptr);
+               if (ret < 1024) { return null; }
                InitFeatures ret_hu_conv = new InitFeatures(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -41,6 +42,7 @@ public class Init extends CommonBase {
         */
        public static Init of(InitFeatures features_arg) {
                long ret = bindings.Init_new(features_arg == null ? 0 : features_arg.ptr & ~1);
+               if (ret < 1024) { return null; }
                Init ret_hu_conv = new Init(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                ret_hu_conv.ptrs_to.add(features_arg);
@@ -52,6 +54,7 @@ public class Init extends CommonBase {
         */
        public Init clone() {
                long ret = bindings.Init_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Init ret_hu_conv = new Init(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -70,6 +73,7 @@ public class Init extends CommonBase {
         */
        public static Result_InitDecodeErrorZ read(byte[] ser) {
                long ret = bindings.Init_read(ser);
+               if (ret < 1024) { return null; }
                Result_InitDecodeErrorZ ret_hu_conv = Result_InitDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 1844618d57e0c2e7f149f47845961cb9b45054cb..60fe3d136cf71bab09c0d554630963bea62866e6 100644 (file)
@@ -34,6 +34,7 @@ public class InitFeatures extends CommonBase {
         */
        public InitFeatures clone() {
                long ret = bindings.InitFeatures_clone(this.ptr);
+               if (ret < 1024) { return null; }
                InitFeatures ret_hu_conv = new InitFeatures(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -44,6 +45,7 @@ public class InitFeatures extends CommonBase {
         */
        public static InitFeatures empty() {
                long ret = bindings.InitFeatures_empty();
+               if (ret < 1024) { return null; }
                InitFeatures ret_hu_conv = new InitFeatures(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -54,6 +56,7 @@ public class InitFeatures extends CommonBase {
         */
        public static InitFeatures known() {
                long ret = bindings.InitFeatures_known();
+               if (ret < 1024) { return null; }
                InitFeatures ret_hu_conv = new InitFeatures(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -80,6 +83,7 @@ public class InitFeatures extends CommonBase {
         */
        public static Result_InitFeaturesDecodeErrorZ read(byte[] ser) {
                long ret = bindings.InitFeatures_read(ser);
+               if (ret < 1024) { return null; }
                Result_InitFeaturesDecodeErrorZ ret_hu_conv = Result_InitFeaturesDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 695f35decfced543f1bb30630408d6fd80eb7016..6243231dcd0bcf1108cec1867adf57cbc147345c 100644 (file)
@@ -39,6 +39,7 @@ public class Invoice extends CommonBase {
         */
        public Invoice clone() {
                long ret = bindings.Invoice_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Invoice ret_hu_conv = new Invoice(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -49,6 +50,7 @@ public class Invoice extends CommonBase {
         */
        public SignedRawInvoice into_signed_raw() {
                long ret = bindings.Invoice_into_signed_raw(this.ptr);
+               if (ret < 1024) { return null; }
                SignedRawInvoice ret_hu_conv = new SignedRawInvoice(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                this.ptrs_to.add(this);
@@ -60,6 +62,7 @@ public class Invoice extends CommonBase {
         */
        public Result_NoneSemanticErrorZ check_signature() {
                long ret = bindings.Invoice_check_signature(this.ptr);
+               if (ret < 1024) { return null; }
                Result_NoneSemanticErrorZ ret_hu_conv = Result_NoneSemanticErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -81,6 +84,7 @@ public class Invoice extends CommonBase {
         */
        public static Result_InvoiceSemanticErrorZ from_signed(SignedRawInvoice signed_invoice) {
                long ret = bindings.Invoice_from_signed(signed_invoice == null ? 0 : signed_invoice.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_InvoiceSemanticErrorZ ret_hu_conv = Result_InvoiceSemanticErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(signed_invoice);
                return ret_hu_conv;
@@ -104,7 +108,10 @@ public class Invoice extends CommonBase {
 
        /**
         * Get the payee's public key if one was included in the invoice
+        * 
+        * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
+       @Nullable
        public byte[] payee_pub_key() {
                byte[] ret = bindings.Invoice_payee_pub_key(this.ptr);
                return ret;
@@ -112,7 +119,10 @@ public class Invoice extends CommonBase {
 
        /**
         * Get the payment secret if one was included in the invoice
+        * 
+        * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
+       @Nullable
        public byte[] payment_secret() {
                byte[] ret = bindings.Invoice_payment_secret(this.ptr);
                return ret;
@@ -120,9 +130,13 @@ public class Invoice extends CommonBase {
 
        /**
         * Get the invoice features if they were included in the invoice
+        * 
+        * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
+       @Nullable
        public InvoiceFeatures features() {
                long ret = bindings.Invoice_features(this.ptr);
+               if (ret < 1024) { return null; }
                InvoiceFeatures ret_hu_conv = new InvoiceFeatures(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -196,6 +210,7 @@ public class Invoice extends CommonBase {
         */
        public Option_u64Z amount_pico_btc() {
                long ret = bindings.Invoice_amount_pico_btc(this.ptr);
+               if (ret < 1024) { return null; }
                Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -206,6 +221,7 @@ public class Invoice extends CommonBase {
         */
        public static Result_InvoiceNoneZ from_str(String s) {
                long ret = bindings.Invoice_from_str(s);
+               if (ret < 1024) { return null; }
                Result_InvoiceNoneZ ret_hu_conv = Result_InvoiceNoneZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index fd3bc29a780c3491f6ae4d0a582efa1f66e862bb..33bfc660e551811e9271b2f1fe0fca53a306883c 100644 (file)
@@ -34,6 +34,7 @@ public class InvoiceFeatures extends CommonBase {
         */
        public InvoiceFeatures clone() {
                long ret = bindings.InvoiceFeatures_clone(this.ptr);
+               if (ret < 1024) { return null; }
                InvoiceFeatures ret_hu_conv = new InvoiceFeatures(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -44,6 +45,7 @@ public class InvoiceFeatures extends CommonBase {
         */
        public static InvoiceFeatures empty() {
                long ret = bindings.InvoiceFeatures_empty();
+               if (ret < 1024) { return null; }
                InvoiceFeatures ret_hu_conv = new InvoiceFeatures(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -54,6 +56,7 @@ public class InvoiceFeatures extends CommonBase {
         */
        public static InvoiceFeatures known() {
                long ret = bindings.InvoiceFeatures_known();
+               if (ret < 1024) { return null; }
                InvoiceFeatures ret_hu_conv = new InvoiceFeatures(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -80,6 +83,7 @@ public class InvoiceFeatures extends CommonBase {
         */
        public static Result_InvoiceFeaturesDecodeErrorZ read(byte[] ser) {
                long ret = bindings.InvoiceFeatures_read(ser);
+               if (ret < 1024) { return null; }
                Result_InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 417ac79ae719557d5819972df7f4c7d87520cc96..1e6c736d1c5bbf2ed86d88f18dc1c386122aca14 100644 (file)
@@ -34,6 +34,7 @@ public class InvoiceSignature extends CommonBase {
         */
        public InvoiceSignature clone() {
                long ret = bindings.InvoiceSignature_clone(this.ptr);
+               if (ret < 1024) { return null; }
                InvoiceSignature ret_hu_conv = new InvoiceSignature(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index 743c7544fdfa1728789be6c82e75bcaab6d38c6b..16482e2a8308ccf4d579ac67f953946d75d115a5 100644 (file)
@@ -156,6 +156,7 @@ public class KeysInterface extends CommonBase {
         */
        public Sign get_channel_signer(boolean inbound, long channel_value_satoshis) {
                long ret = bindings.KeysInterface_get_channel_signer(this.ptr, inbound, channel_value_satoshis);
+               if (ret < 1024) { return null; }
                Sign ret_hu_conv = new Sign(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -183,6 +184,7 @@ public class KeysInterface extends CommonBase {
         */
        public Result_SignDecodeErrorZ read_chan_signer(byte[] reader) {
                long ret = bindings.KeysInterface_read_chan_signer(this.ptr, reader);
+               if (ret < 1024) { return null; }
                Result_SignDecodeErrorZ ret_hu_conv = Result_SignDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -195,6 +197,7 @@ public class KeysInterface extends CommonBase {
         */
        public Result_RecoverableSignatureNoneZ sign_invoice(byte[] invoice_preimage) {
                long ret = bindings.KeysInterface_sign_invoice(this.ptr, invoice_preimage);
+               if (ret < 1024) { return null; }
                Result_RecoverableSignatureNoneZ ret_hu_conv = Result_RecoverableSignatureNoneZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 047ef055167644be5b4595610ade39b7a93a4756..9a6de12ed5fba97e97ca3ef44725af22a3cb5a5b 100644 (file)
@@ -47,6 +47,7 @@ public class KeysManager extends CommonBase {
         */
        public static KeysManager of(byte[] seed, long starting_time_secs, int starting_time_nanos) {
                long ret = bindings.KeysManager_new(seed, starting_time_secs, starting_time_nanos);
+               if (ret < 1024) { return null; }
                KeysManager ret_hu_conv = new KeysManager(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -61,6 +62,7 @@ public class KeysManager extends CommonBase {
         */
        public InMemorySigner derive_channel_keys(long channel_value_satoshis, byte[] params) {
                long ret = bindings.KeysManager_derive_channel_keys(this.ptr, channel_value_satoshis, params);
+               if (ret < 1024) { return null; }
                InMemorySigner ret_hu_conv = new InMemorySigner(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -81,6 +83,7 @@ public class KeysManager extends CommonBase {
         */
        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, Arrays.stream(descriptors).mapToLong(descriptors_conv_27 -> descriptors_conv_27.ptr).toArray(), Arrays.stream(outputs).mapToLong(outputs_conv_7 -> outputs_conv_7.ptr).toArray(), change_destination_script, feerate_sat_per_1000_weight);
+               if (ret < 1024) { return null; }
                Result_TransactionNoneZ ret_hu_conv = Result_TransactionNoneZ.constr_from_ptr(ret);
                /* TODO 2 SpendableOutputDescriptor  */;
                /* TODO 2 TxOut  */;
@@ -93,6 +96,7 @@ public class KeysManager extends CommonBase {
         */
        public KeysInterface as_KeysInterface() {
                long ret = bindings.KeysManager_as_KeysInterface(this.ptr);
+               if (ret < 1024) { return null; }
                KeysInterface ret_hu_conv = new KeysInterface(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index fa2b562d5578954aa7e1ebc96a98d8683a386371..1ba368eda281a1731a90e65117de04824d93f3fc 100644 (file)
@@ -38,6 +38,7 @@ public class LightningError extends CommonBase {
         */
        public ErrorAction get_action() {
                long ret = bindings.LightningError_get_action(this.ptr);
+               if (ret < 1024) { return null; }
                ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class LightningError extends CommonBase {
         */
        public static LightningError of(String err_arg, ErrorAction action_arg) {
                long ret = bindings.LightningError_new(err_arg, action_arg.ptr);
+               if (ret < 1024) { return null; }
                LightningError ret_hu_conv = new LightningError(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -65,6 +67,7 @@ public class LightningError extends CommonBase {
         */
        public LightningError clone() {
                long ret = bindings.LightningError_clone(this.ptr);
+               if (ret < 1024) { return null; }
                LightningError ret_hu_conv = new LightningError(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index c77af3793905dffe5b5ecfcff3aa717a595fe36d..2f5f61c813b08fca7f4a110e4448ef4e7d5f2645 100644 (file)
@@ -23,6 +23,7 @@ public class LockedNetworkGraph extends CommonBase implements AutoCloseable {
         */
        public NetworkGraph graph() {
                long ret = bindings.LockedNetworkGraph_graph(this.ptr);
+               if (ret < 1024) { return null; }
                NetworkGraph ret_hu_conv = new NetworkGraph(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index 7077b4a2460e59432ce0cb59aa7f97bd0c5b6a34..06a55cd4b2a53ab845708983c3ddcdee46d6da58 100644 (file)
@@ -26,6 +26,7 @@ public class MessageHandler extends CommonBase {
         */
        public ChannelMessageHandler get_chan_handler() {
                long ret = bindings.MessageHandler_get_chan_handler(this.ptr);
+               if (ret < 1024) { return null; }
                ChannelMessageHandler ret_hu_conv = new ChannelMessageHandler(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -51,6 +52,7 @@ public class MessageHandler extends CommonBase {
         */
        public RoutingMessageHandler get_route_handler() {
                long ret = bindings.MessageHandler_get_route_handler(this.ptr);
+               if (ret < 1024) { return null; }
                RoutingMessageHandler ret_hu_conv = new RoutingMessageHandler(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -73,6 +75,7 @@ public class MessageHandler extends CommonBase {
         */
        public static MessageHandler of(ChannelMessageHandler chan_handler_arg, RoutingMessageHandler route_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);
+               if (ret < 1024) { return null; }
                MessageHandler ret_hu_conv = new MessageHandler(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                ret_hu_conv.ptrs_to.add(chan_handler_arg);
index 2885e0ca74d53c78aac5e87294c8b22d20529faa..fd57d563d203e6b9c255b8728e187d110f8f17f8 100644 (file)
@@ -326,6 +326,7 @@ public class MessageSendEvent extends CommonBase {
         */
        public MessageSendEvent clone() {
                long ret = bindings.MessageSendEvent_clone(this.ptr);
+               if (ret < 1024) { return null; }
                MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index ec25b9722e7ce0ce803276ae26dabf8bc552a701..2bbbefbcdd69037471318088b97a5f16ce1d954c 100644 (file)
@@ -34,6 +34,7 @@ public class MinFinalCltvExpiry extends CommonBase {
         */
        public MinFinalCltvExpiry clone() {
                long ret = bindings.MinFinalCltvExpiry_clone(this.ptr);
+               if (ret < 1024) { return null; }
                MinFinalCltvExpiry ret_hu_conv = new MinFinalCltvExpiry(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index 68421e71b46e7c1b82bdb7ac26004156aa5f008d..eb6a203b6ed4b22313d948a09c1cbc7bcb04dcc5 100644 (file)
@@ -53,6 +53,7 @@ public class MonitorEvent extends CommonBase {
         */
        public MonitorEvent clone() {
                long ret = bindings.MonitorEvent_clone(this.ptr);
+               if (ret < 1024) { return null; }
                MonitorEvent ret_hu_conv = MonitorEvent.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index 6c6c278318f78275a1e7bb572bfa274296d976e3..aa6ed4a0b4704729b976094803633712f84a967b 100644 (file)
@@ -27,6 +27,7 @@ public class MonitorUpdateError extends CommonBase {
         */
        public MonitorUpdateError clone() {
                long ret = bindings.MonitorUpdateError_clone(this.ptr);
+               if (ret < 1024) { return null; }
                MonitorUpdateError ret_hu_conv = new MonitorUpdateError(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index 83b2c27efc659aef206f5f357d330c3d1648207e..3e7d2affb059d6c7cce56df4727c5e28e029248d 100644 (file)
@@ -79,6 +79,7 @@ public class NetAddress extends CommonBase {
         */
        public NetAddress clone() {
                long ret = bindings.NetAddress_clone(this.ptr);
+               if (ret < 1024) { return null; }
                NetAddress ret_hu_conv = NetAddress.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -97,6 +98,7 @@ public class NetAddress extends CommonBase {
         */
        public static Result_NetAddressDecodeErrorZ read(byte[] ser) {
                long ret = bindings.NetAddress_read(ser);
+               if (ret < 1024) { return null; }
                Result_NetAddressDecodeErrorZ ret_hu_conv = Result_NetAddressDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 977e197a0e56dc545043f297288355cb5917825d..41d54233cf6f46c6cb08ca97cf38f526d7dc4b64 100644 (file)
@@ -28,9 +28,12 @@ public class NetGraphMsgHandler extends CommonBase {
         * Chain monitor is used to make sure announced channels exist on-chain,
         * channel data is correct, and that the announcement is signed with
         * channel owners' keys.
+        * 
+        * Note that chain_access (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
-       public static NetGraphMsgHandler of(byte[] genesis_hash, Access chain_access, Logger logger) {
+       public static NetGraphMsgHandler of(byte[] genesis_hash, @Nullable Access chain_access, Logger logger) {
                long ret = bindings.NetGraphMsgHandler_new(genesis_hash, chain_access == null ? 0 : chain_access.ptr, logger == null ? 0 : logger.ptr);
+               if (ret < 1024) { return null; }
                NetGraphMsgHandler ret_hu_conv = new NetGraphMsgHandler(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                ret_hu_conv.ptrs_to.add(chain_access);
@@ -41,9 +44,12 @@ public class NetGraphMsgHandler extends CommonBase {
        /**
         * Creates a new tracker of the actual state of the network of channels and nodes,
         * assuming an existing Network Graph.
+        * 
+        * Note that chain_access (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
-       public static NetGraphMsgHandler from_net_graph(Access chain_access, Logger logger, NetworkGraph network_graph) {
+       public static NetGraphMsgHandler from_net_graph(@Nullable Access chain_access, Logger logger, NetworkGraph network_graph) {
                long ret = bindings.NetGraphMsgHandler_from_net_graph(chain_access == null ? 0 : chain_access.ptr, logger == null ? 0 : logger.ptr, network_graph == null ? 0 : network_graph.ptr & ~1);
+               if (ret < 1024) { return null; }
                NetGraphMsgHandler ret_hu_conv = new NetGraphMsgHandler(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                ret_hu_conv.ptrs_to.add(chain_access);
@@ -56,8 +62,10 @@ public class NetGraphMsgHandler extends CommonBase {
         * Adds a provider used to check new announcements. Does not affect
         * existing announcements unless they are updated.
         * Add, update or remove the provider would replace the current one.
+        * 
+        * Note that chain_access (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
-       public void add_chain_access(Access chain_access) {
+       public void add_chain_access(@Nullable Access chain_access) {
                bindings.NetGraphMsgHandler_add_chain_access(this.ptr, chain_access == null ? 0 : chain_access.ptr);
                this.ptrs_to.add(chain_access);
        }
@@ -70,6 +78,7 @@ public class NetGraphMsgHandler extends CommonBase {
         */
        public LockedNetworkGraph read_locked_graph() {
                long ret = bindings.NetGraphMsgHandler_read_locked_graph(this.ptr);
+               if (ret < 1024) { return null; }
                LockedNetworkGraph ret_hu_conv = new LockedNetworkGraph(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -81,6 +90,7 @@ public class NetGraphMsgHandler extends CommonBase {
         */
        public RoutingMessageHandler as_RoutingMessageHandler() {
                long ret = bindings.NetGraphMsgHandler_as_RoutingMessageHandler(this.ptr);
+               if (ret < 1024) { return null; }
                RoutingMessageHandler ret_hu_conv = new RoutingMessageHandler(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -92,6 +102,7 @@ public class NetGraphMsgHandler extends CommonBase {
         */
        public MessageSendEventsProvider as_MessageSendEventsProvider() {
                long ret = bindings.NetGraphMsgHandler_as_MessageSendEventsProvider(this.ptr);
+               if (ret < 1024) { return null; }
                MessageSendEventsProvider ret_hu_conv = new MessageSendEventsProvider(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index 69d615eddae0afd08b200a5f0b08942a47962e06..1f191d71d75d24c9b23ac8cc6f2ea5db1b808a86 100644 (file)
@@ -23,6 +23,7 @@ public class NetworkGraph extends CommonBase {
         */
        public NetworkGraph clone() {
                long ret = bindings.NetworkGraph_clone(this.ptr);
+               if (ret < 1024) { return null; }
                NetworkGraph ret_hu_conv = new NetworkGraph(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -41,6 +42,7 @@ public class NetworkGraph extends CommonBase {
         */
        public static Result_NetworkGraphDecodeErrorZ read(byte[] ser) {
                long ret = bindings.NetworkGraph_read(ser);
+               if (ret < 1024) { return null; }
                Result_NetworkGraphDecodeErrorZ ret_hu_conv = Result_NetworkGraphDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -50,6 +52,7 @@ public class NetworkGraph extends CommonBase {
         */
        public static NetworkGraph of(byte[] genesis_hash) {
                long ret = bindings.NetworkGraph_new(genesis_hash);
+               if (ret < 1024) { return null; }
                NetworkGraph ret_hu_conv = new NetworkGraph(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -65,6 +68,7 @@ public class NetworkGraph extends CommonBase {
         */
        public Result_NoneLightningErrorZ update_node_from_announcement(NodeAnnouncement msg) {
                long ret = bindings.NetworkGraph_update_node_from_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
                this.ptrs_to.add(msg);
                return ret_hu_conv;
@@ -78,6 +82,7 @@ public class NetworkGraph extends CommonBase {
         */
        public Result_NoneLightningErrorZ update_node_from_unsigned_announcement(UnsignedNodeAnnouncement msg) {
                long ret = bindings.NetworkGraph_update_node_from_unsigned_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
                this.ptrs_to.add(msg);
                return ret_hu_conv;
@@ -92,9 +97,12 @@ 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.
+        * 
+        * Note that chain_access (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
-       public Result_NoneLightningErrorZ update_channel_from_announcement(ChannelAnnouncement msg, Access chain_access) {
+       public Result_NoneLightningErrorZ update_channel_from_announcement(ChannelAnnouncement msg, @Nullable Access chain_access) {
                long ret = bindings.NetworkGraph_update_channel_from_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1, chain_access == null ? 0 : chain_access.ptr);
+               if (ret < 1024) { return null; }
                Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
                this.ptrs_to.add(msg);
                this.ptrs_to.add(chain_access);
@@ -108,9 +116,12 @@ 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.
+        * 
+        * Note that chain_access (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
-       public Result_NoneLightningErrorZ update_channel_from_unsigned_announcement(UnsignedChannelAnnouncement msg, Access chain_access) {
+       public Result_NoneLightningErrorZ update_channel_from_unsigned_announcement(UnsignedChannelAnnouncement msg, @Nullable Access chain_access) {
                long ret = bindings.NetworkGraph_update_channel_from_unsigned_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1, chain_access == null ? 0 : chain_access.ptr);
+               if (ret < 1024) { return null; }
                Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
                this.ptrs_to.add(msg);
                this.ptrs_to.add(chain_access);
@@ -137,6 +148,7 @@ public class NetworkGraph extends CommonBase {
         */
        public Result_NoneLightningErrorZ update_channel(ChannelUpdate msg) {
                long ret = bindings.NetworkGraph_update_channel(this.ptr, msg == null ? 0 : msg.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
                this.ptrs_to.add(msg);
                return ret_hu_conv;
@@ -149,6 +161,7 @@ public class NetworkGraph extends CommonBase {
         */
        public Result_NoneLightningErrorZ update_channel_unsigned(UnsignedChannelUpdate msg) {
                long ret = bindings.NetworkGraph_update_channel_unsigned(this.ptr, msg == null ? 0 : msg.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
                this.ptrs_to.add(msg);
                return ret_hu_conv;
index 57c76501095de4487f305b718c162277bea92903..569696c14c5803f7931faa9e0e63ac9a1a0cb2ed 100644 (file)
@@ -38,6 +38,7 @@ public class NodeAnnouncement extends CommonBase {
         */
        public UnsignedNodeAnnouncement get_contents() {
                long ret = bindings.NodeAnnouncement_get_contents(this.ptr);
+               if (ret < 1024) { return null; }
                UnsignedNodeAnnouncement ret_hu_conv = new UnsignedNodeAnnouncement(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -56,6 +57,7 @@ public class NodeAnnouncement extends CommonBase {
         */
        public static NodeAnnouncement of(byte[] signature_arg, UnsignedNodeAnnouncement contents_arg) {
                long ret = bindings.NodeAnnouncement_new(signature_arg, contents_arg == null ? 0 : contents_arg.ptr & ~1);
+               if (ret < 1024) { return null; }
                NodeAnnouncement ret_hu_conv = new NodeAnnouncement(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                ret_hu_conv.ptrs_to.add(contents_arg);
@@ -67,6 +69,7 @@ public class NodeAnnouncement extends CommonBase {
         */
        public NodeAnnouncement clone() {
                long ret = bindings.NodeAnnouncement_clone(this.ptr);
+               if (ret < 1024) { return null; }
                NodeAnnouncement ret_hu_conv = new NodeAnnouncement(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -85,6 +88,7 @@ public class NodeAnnouncement extends CommonBase {
         */
        public static Result_NodeAnnouncementDecodeErrorZ read(byte[] ser) {
                long ret = bindings.NodeAnnouncement_read(ser);
+               if (ret < 1024) { return null; }
                Result_NodeAnnouncementDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index a44826ab9db858928e0238f22bf0bd838ca5d615..e66841856011c1d41e6d5e849d70bc1eddf835d4 100644 (file)
@@ -23,6 +23,7 @@ public class NodeAnnouncementInfo extends CommonBase {
         */
        public NodeFeatures get_features() {
                long ret = bindings.NodeAnnouncementInfo_get_features(this.ptr);
+               if (ret < 1024) { return null; }
                NodeFeatures ret_hu_conv = new NodeFeatures(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -100,9 +101,13 @@ public class NodeAnnouncementInfo extends CommonBase {
         * Mostly redundant with the data we store in fields explicitly.
         * Everything else is useful only for sending out for initial routing sync.
         * Not stored if contains excess data to prevent DoS.
+        * 
+        * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
+       @Nullable
        public NodeAnnouncement get_announcement_message() {
                long ret = bindings.NodeAnnouncementInfo_get_announcement_message(this.ptr);
+               if (ret < 1024) { return null; }
                NodeAnnouncement ret_hu_conv = new NodeAnnouncement(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -113,8 +118,10 @@ public class NodeAnnouncementInfo extends CommonBase {
         * Mostly redundant with the data we store in fields explicitly.
         * Everything else is useful only for sending out for initial routing sync.
         * Not stored if contains excess data to prevent DoS.
+        * 
+        * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
-       public void set_announcement_message(NodeAnnouncement val) {
+       public void set_announcement_message(@Nullable NodeAnnouncement val) {
                bindings.NodeAnnouncementInfo_set_announcement_message(this.ptr, val == null ? 0 : val.ptr & ~1);
                this.ptrs_to.add(val);
        }
@@ -124,6 +131,7 @@ public class NodeAnnouncementInfo extends CommonBase {
         */
        public static NodeAnnouncementInfo of(NodeFeatures features_arg, int last_update_arg, byte[] rgb_arg, byte[] alias_arg, NetAddress[] addresses_arg, NodeAnnouncement announcement_message_arg) {
                long ret = bindings.NodeAnnouncementInfo_new(features_arg == null ? 0 : features_arg.ptr & ~1, last_update_arg, rgb_arg, alias_arg, Arrays.stream(addresses_arg).mapToLong(addresses_arg_conv_12 -> addresses_arg_conv_12.ptr).toArray(), announcement_message_arg == null ? 0 : announcement_message_arg.ptr & ~1);
+               if (ret < 1024) { return null; }
                NodeAnnouncementInfo ret_hu_conv = new NodeAnnouncementInfo(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                ret_hu_conv.ptrs_to.add(features_arg);
@@ -137,6 +145,7 @@ public class NodeAnnouncementInfo extends CommonBase {
         */
        public NodeAnnouncementInfo clone() {
                long ret = bindings.NodeAnnouncementInfo_clone(this.ptr);
+               if (ret < 1024) { return null; }
                NodeAnnouncementInfo ret_hu_conv = new NodeAnnouncementInfo(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -155,6 +164,7 @@ public class NodeAnnouncementInfo extends CommonBase {
         */
        public static Result_NodeAnnouncementInfoDecodeErrorZ read(byte[] ser) {
                long ret = bindings.NodeAnnouncementInfo_read(ser);
+               if (ret < 1024) { return null; }
                Result_NodeAnnouncementInfoDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 04f3c55c9d05f0096ba724477257659db041cf2e..bc2fb979e0c7e7b346659a714ac333a10feddb7e 100644 (file)
@@ -34,6 +34,7 @@ public class NodeFeatures extends CommonBase {
         */
        public NodeFeatures clone() {
                long ret = bindings.NodeFeatures_clone(this.ptr);
+               if (ret < 1024) { return null; }
                NodeFeatures ret_hu_conv = new NodeFeatures(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -44,6 +45,7 @@ public class NodeFeatures extends CommonBase {
         */
        public static NodeFeatures empty() {
                long ret = bindings.NodeFeatures_empty();
+               if (ret < 1024) { return null; }
                NodeFeatures ret_hu_conv = new NodeFeatures(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -54,6 +56,7 @@ public class NodeFeatures extends CommonBase {
         */
        public static NodeFeatures known() {
                long ret = bindings.NodeFeatures_known();
+               if (ret < 1024) { return null; }
                NodeFeatures ret_hu_conv = new NodeFeatures(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -80,6 +83,7 @@ public class NodeFeatures extends CommonBase {
         */
        public static Result_NodeFeaturesDecodeErrorZ read(byte[] ser) {
                long ret = bindings.NodeFeatures_read(ser);
+               if (ret < 1024) { return null; }
                Result_NodeFeaturesDecodeErrorZ ret_hu_conv = Result_NodeFeaturesDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 68a027a458eb0cb9122374d2b32cc9f6dbb1f5a2..de29e3d5819ffde643712326cbcd4c43b3e8a08c 100644 (file)
@@ -29,9 +29,13 @@ public class NodeInfo extends CommonBase {
         * Lowest fees enabling routing via any of the enabled, known channels to a node.
         * The two fields (flat and proportional fee) are independent,
         * meaning they don't have to refer to the same channel.
+        * 
+        * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
+       @Nullable
        public RoutingFees get_lowest_inbound_channel_fees() {
                long ret = bindings.NodeInfo_get_lowest_inbound_channel_fees(this.ptr);
+               if (ret < 1024) { return null; }
                RoutingFees ret_hu_conv = new RoutingFees(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -41,8 +45,10 @@ public class NodeInfo extends CommonBase {
         * Lowest fees enabling routing via any of the enabled, known channels to a node.
         * The two fields (flat and proportional fee) are independent,
         * meaning they don't have to refer to the same channel.
+        * 
+        * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
-       public void set_lowest_inbound_channel_fees(RoutingFees val) {
+       public void set_lowest_inbound_channel_fees(@Nullable RoutingFees val) {
                bindings.NodeInfo_set_lowest_inbound_channel_fees(this.ptr, val == null ? 0 : val.ptr & ~1);
                this.ptrs_to.add(val);
        }
@@ -51,9 +57,13 @@ public class NodeInfo extends CommonBase {
         * More information about a node from node_announcement.
         * Optional because we store a Node entry after learning about it from
         * a channel announcement, but before receiving a node announcement.
+        * 
+        * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
+       @Nullable
        public NodeAnnouncementInfo get_announcement_info() {
                long ret = bindings.NodeInfo_get_announcement_info(this.ptr);
+               if (ret < 1024) { return null; }
                NodeAnnouncementInfo ret_hu_conv = new NodeAnnouncementInfo(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -63,8 +73,10 @@ public class NodeInfo extends CommonBase {
         * More information about a node from node_announcement.
         * Optional because we store a Node entry after learning about it from
         * a channel announcement, but before receiving a node announcement.
+        * 
+        * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
-       public void set_announcement_info(NodeAnnouncementInfo val) {
+       public void set_announcement_info(@Nullable NodeAnnouncementInfo val) {
                bindings.NodeInfo_set_announcement_info(this.ptr, val == null ? 0 : val.ptr & ~1);
                this.ptrs_to.add(val);
        }
@@ -74,6 +86,7 @@ public class NodeInfo extends CommonBase {
         */
        public static NodeInfo of(long[] channels_arg, RoutingFees lowest_inbound_channel_fees_arg, NodeAnnouncementInfo announcement_info_arg) {
                long ret = bindings.NodeInfo_new(channels_arg, lowest_inbound_channel_fees_arg == null ? 0 : lowest_inbound_channel_fees_arg.ptr & ~1, announcement_info_arg == null ? 0 : announcement_info_arg.ptr & ~1);
+               if (ret < 1024) { return null; }
                NodeInfo ret_hu_conv = new NodeInfo(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                ret_hu_conv.ptrs_to.add(lowest_inbound_channel_fees_arg);
@@ -86,6 +99,7 @@ public class NodeInfo extends CommonBase {
         */
        public NodeInfo clone() {
                long ret = bindings.NodeInfo_clone(this.ptr);
+               if (ret < 1024) { return null; }
                NodeInfo ret_hu_conv = new NodeInfo(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -104,6 +118,7 @@ public class NodeInfo extends CommonBase {
         */
        public static Result_NodeInfoDecodeErrorZ read(byte[] ser) {
                long ret = bindings.NodeInfo_read(ser);
+               if (ret < 1024) { return null; }
                Result_NodeInfoDecodeErrorZ ret_hu_conv = Result_NodeInfoDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index f0e80ebade5afa8d156c24dd50ec4acdac798f7b..15aecc85c0834bd74cc33323e35d3e97cf8188f0 100644 (file)
@@ -293,6 +293,7 @@ public class OpenChannel extends CommonBase {
         */
        public OpenChannel clone() {
                long ret = bindings.OpenChannel_clone(this.ptr);
+               if (ret < 1024) { return null; }
                OpenChannel ret_hu_conv = new OpenChannel(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -311,6 +312,7 @@ public class OpenChannel extends CommonBase {
         */
        public static Result_OpenChannelDecodeErrorZ read(byte[] ser) {
                long ret = bindings.OpenChannel_read(ser);
+               if (ret < 1024) { return null; }
                Result_OpenChannelDecodeErrorZ ret_hu_conv = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index dc441bbc9acc22f5d4a246a14163555142428b62..2afb299c478498b5c386fc910d3f2d20a8ab109f 100644 (file)
@@ -51,6 +51,7 @@ public class Option_C2Tuple_usizeTransactionZZ extends CommonBase {
         */
        public static Option_C2Tuple_usizeTransactionZZ some(TwoTuple<Long, byte[]> o) {
                long ret = bindings.COption_C2Tuple_usizeTransactionZZ_some(bindings.C2Tuple_usizeTransactionZ_new(o.a, o.b));
+               if (ret < 1024) { return null; }
                Option_C2Tuple_usizeTransactionZZ ret_hu_conv = Option_C2Tuple_usizeTransactionZZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -61,6 +62,7 @@ public class Option_C2Tuple_usizeTransactionZZ extends CommonBase {
         */
        public static Option_C2Tuple_usizeTransactionZZ none() {
                long ret = bindings.COption_C2Tuple_usizeTransactionZZ_none();
+               if (ret < 1024) { return null; }
                Option_C2Tuple_usizeTransactionZZ ret_hu_conv = Option_C2Tuple_usizeTransactionZZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -72,6 +74,7 @@ public class Option_C2Tuple_usizeTransactionZZ extends CommonBase {
         */
        public Option_C2Tuple_usizeTransactionZZ clone() {
                long ret = bindings.COption_C2Tuple_usizeTransactionZZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Option_C2Tuple_usizeTransactionZZ ret_hu_conv = Option_C2Tuple_usizeTransactionZZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index 57a4c74290c11ad0748077d3f51f03379006f4cf..c79e4448c63ebfaabb53a0f31d8c0ff5c627fde9 100644 (file)
@@ -45,6 +45,7 @@ public class Option_u16Z extends CommonBase {
         */
        public static Option_u16Z some(short o) {
                long ret = bindings.COption_u16Z_some(o);
+               if (ret < 1024) { return null; }
                Option_u16Z ret_hu_conv = Option_u16Z.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Option_u16Z extends CommonBase {
         */
        public static Option_u16Z none() {
                long ret = bindings.COption_u16Z_none();
+               if (ret < 1024) { return null; }
                Option_u16Z ret_hu_conv = Option_u16Z.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Option_u16Z extends CommonBase {
         */
        public Option_u16Z clone() {
                long ret = bindings.COption_u16Z_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Option_u16Z ret_hu_conv = Option_u16Z.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index 1b88a59336023e4dc2f6561243c167a69d2fcc6f..0556c6de1e9f2620db636a6ae0a3faea3a9766f9 100644 (file)
@@ -45,6 +45,7 @@ public class Option_u32Z extends CommonBase {
         */
        public static Option_u32Z some(int o) {
                long ret = bindings.COption_u32Z_some(o);
+               if (ret < 1024) { return null; }
                Option_u32Z ret_hu_conv = Option_u32Z.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Option_u32Z extends CommonBase {
         */
        public static Option_u32Z none() {
                long ret = bindings.COption_u32Z_none();
+               if (ret < 1024) { return null; }
                Option_u32Z ret_hu_conv = Option_u32Z.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Option_u32Z extends CommonBase {
         */
        public Option_u32Z clone() {
                long ret = bindings.COption_u32Z_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Option_u32Z ret_hu_conv = Option_u32Z.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index 59e8b5956ab4bc40ffb58430fa84a49e326cb924..6015ce37a3a53eecd0a9c7f91064bfa4bf1d4010 100644 (file)
@@ -45,6 +45,7 @@ public class Option_u64Z extends CommonBase {
         */
        public static Option_u64Z some(long o) {
                long ret = bindings.COption_u64Z_some(o);
+               if (ret < 1024) { return null; }
                Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Option_u64Z extends CommonBase {
         */
        public static Option_u64Z none() {
                long ret = bindings.COption_u64Z_none();
+               if (ret < 1024) { return null; }
                Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Option_u64Z extends CommonBase {
         */
        public Option_u64Z clone() {
                long ret = bindings.COption_u64Z_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index a44b61e280f63b7b1049cc1247df7096a241c1e7..5e68cc6c22e14c225c4e08d5b7dc95b6cb91fc94 100644 (file)
@@ -56,6 +56,7 @@ public class OutPoint extends CommonBase {
         */
        public static OutPoint of(byte[] txid_arg, short index_arg) {
                long ret = bindings.OutPoint_new(txid_arg, index_arg);
+               if (ret < 1024) { return null; }
                OutPoint ret_hu_conv = new OutPoint(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -66,6 +67,7 @@ public class OutPoint extends CommonBase {
         */
        public OutPoint clone() {
                long ret = bindings.OutPoint_clone(this.ptr);
+               if (ret < 1024) { return null; }
                OutPoint ret_hu_conv = new OutPoint(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -111,6 +113,7 @@ public class OutPoint extends CommonBase {
         */
        public static Result_OutPointDecodeErrorZ read(byte[] ser) {
                long ret = bindings.OutPoint_read(ser);
+               if (ret < 1024) { return null; }
                Result_OutPointDecodeErrorZ ret_hu_conv = Result_OutPointDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 9437f0f7d67fcf80ef5e3218e89672681db5d592..5f50af0d3991e7d7fb4e23bb74489397cc9ce623 100644 (file)
@@ -34,6 +34,7 @@ public class PayeePubKey extends CommonBase {
         */
        public PayeePubKey clone() {
                long ret = bindings.PayeePubKey_clone(this.ptr);
+               if (ret < 1024) { return null; }
                PayeePubKey ret_hu_conv = new PayeePubKey(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
diff --git a/src/main/java/org/ldk/structs/PaymentPurpose.java b/src/main/java/org/ldk/structs/PaymentPurpose.java
new file mode 100644 (file)
index 0000000..4a3e1a6
--- /dev/null
@@ -0,0 +1,61 @@
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+
+/**
+ * Some information provided on receipt of payment depends on whether the payment received is a
+ * spontaneous payment or a \"conventional\" lightning payment that's paying an invoice.
+ */
+@SuppressWarnings("unchecked") // We correctly assign various generic arrays
+public class PaymentPurpose extends CommonBase {
+       private PaymentPurpose(Object _dummy, long ptr) { super(ptr); }
+       @Override @SuppressWarnings("deprecation")
+       protected void finalize() throws Throwable {
+               super.finalize();
+               if (ptr != 0) { bindings.PaymentPurpose_free(ptr); }
+       }
+       static PaymentPurpose constr_from_ptr(long ptr) {
+               bindings.LDKPaymentPurpose raw_val = bindings.LDKPaymentPurpose_ref_from_ptr(ptr);
+               if (raw_val.getClass() == bindings.LDKPaymentPurpose.InvoicePayment.class) {
+                       return new InvoicePayment(ptr, (bindings.LDKPaymentPurpose.InvoicePayment)raw_val);
+               }
+               if (raw_val.getClass() == bindings.LDKPaymentPurpose.SpontaneousPayment.class) {
+                       return new SpontaneousPayment(ptr, (bindings.LDKPaymentPurpose.SpontaneousPayment)raw_val);
+               }
+               assert false; return null; // Unreachable without extending the (internal) bindings interface
+       }
+
+       public final static class InvoicePayment extends PaymentPurpose {
+               public final byte[] payment_preimage;
+               public final byte[] payment_secret;
+               public final long user_payment_id;
+               private InvoicePayment(long ptr, bindings.LDKPaymentPurpose.InvoicePayment obj) {
+                       super(null, ptr);
+                       this.payment_preimage = obj.payment_preimage;
+                       this.payment_secret = obj.payment_secret;
+                       this.user_payment_id = obj.user_payment_id;
+               }
+       }
+       public final static class SpontaneousPayment extends PaymentPurpose {
+               public final byte[] spontaneous_payment;
+               private SpontaneousPayment(long ptr, bindings.LDKPaymentPurpose.SpontaneousPayment obj) {
+                       super(null, ptr);
+                       this.spontaneous_payment = obj.spontaneous_payment;
+               }
+       }
+       /**
+        * Creates a copy of the PaymentPurpose
+        */
+       public PaymentPurpose clone() {
+               long ret = bindings.PaymentPurpose_clone(this.ptr);
+               if (ret < 1024) { return null; }
+               PaymentPurpose ret_hu_conv = PaymentPurpose.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(this);
+               return ret_hu_conv;
+       }
+
+}
index 4e9bb14976d3f4eb311dd718187d21dfa27a734f..5320ed255fb21fdccaeec669497c91d26362466e 100644 (file)
@@ -94,6 +94,7 @@ public class PaymentSendFailure extends CommonBase {
         */
        public PaymentSendFailure clone() {
                long ret = bindings.PaymentSendFailure_clone(this.ptr);
+               if (ret < 1024) { return null; }
                PaymentSendFailure ret_hu_conv = PaymentSendFailure.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index 37e984ad0a065374b85ec58db185c3a8b6688c18..bcbcee01be7f6dec3be2e56c20885baec7d2610b 100644 (file)
@@ -42,6 +42,7 @@ public class PeerHandleError extends CommonBase {
         */
        public static PeerHandleError of(boolean no_connection_possible_arg) {
                long ret = bindings.PeerHandleError_new(no_connection_possible_arg);
+               if (ret < 1024) { return null; }
                PeerHandleError ret_hu_conv = new PeerHandleError(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -52,6 +53,7 @@ public class PeerHandleError extends CommonBase {
         */
        public PeerHandleError clone() {
                long ret = bindings.PeerHandleError_clone(this.ptr);
+               if (ret < 1024) { return null; }
                PeerHandleError ret_hu_conv = new PeerHandleError(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index 3903b56b0ddb52a97f530e4c8c6438f5cb4cee25..7ee7c0abbbf297904bfb69d94136cc60244132fa 100644 (file)
@@ -43,6 +43,7 @@ public class PeerManager extends CommonBase {
         */
        public static PeerManager of(ChannelMessageHandler message_handler_chan_handler_arg, RoutingMessageHandler message_handler_route_handler_arg, byte[] our_node_secret, byte[] ephemeral_random_data, Logger logger) {
                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), our_node_secret, ephemeral_random_data, logger == null ? 0 : logger.ptr);
+               if (ret < 1024) { return null; }
                PeerManager ret_hu_conv = new PeerManager(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                ret_hu_conv.ptrs_to.add(message_handler_chan_handler_arg);
@@ -77,6 +78,7 @@ public class PeerManager extends CommonBase {
         */
        public Result_CVec_u8ZPeerHandleErrorZ new_outbound_connection(byte[] their_node_id, SocketDescriptor descriptor) {
                long ret = bindings.PeerManager_new_outbound_connection(this.ptr, their_node_id, descriptor == null ? 0 : descriptor.ptr);
+               if (ret < 1024) { return null; }
                Result_CVec_u8ZPeerHandleErrorZ ret_hu_conv = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret);
                this.ptrs_to.add(descriptor);
                return ret_hu_conv;
@@ -97,6 +99,7 @@ public class PeerManager extends CommonBase {
         */
        public Result_NonePeerHandleErrorZ new_inbound_connection(SocketDescriptor descriptor) {
                long ret = bindings.PeerManager_new_inbound_connection(this.ptr, descriptor == null ? 0 : descriptor.ptr);
+               if (ret < 1024) { return null; }
                Result_NonePeerHandleErrorZ ret_hu_conv = Result_NonePeerHandleErrorZ.constr_from_ptr(ret);
                this.ptrs_to.add(descriptor);
                return ret_hu_conv;
@@ -118,6 +121,7 @@ public class PeerManager extends CommonBase {
         */
        public Result_NonePeerHandleErrorZ write_buffer_space_avail(SocketDescriptor descriptor) {
                long ret = bindings.PeerManager_write_buffer_space_avail(this.ptr, descriptor == null ? 0 : descriptor.ptr);
+               if (ret < 1024) { return null; }
                Result_NonePeerHandleErrorZ ret_hu_conv = Result_NonePeerHandleErrorZ.constr_from_ptr(ret);
                this.ptrs_to.add(descriptor);
                return ret_hu_conv;
@@ -141,6 +145,7 @@ public class PeerManager extends CommonBase {
         */
        public Result_boolPeerHandleErrorZ read_event(SocketDescriptor peer_descriptor, byte[] data) {
                long ret = bindings.PeerManager_read_event(this.ptr, peer_descriptor == null ? 0 : peer_descriptor.ptr, data);
+               if (ret < 1024) { return null; }
                Result_boolPeerHandleErrorZ ret_hu_conv = Result_boolPeerHandleErrorZ.constr_from_ptr(ret);
                this.ptrs_to.add(peer_descriptor);
                return ret_hu_conv;
index ef36c4259811cfa2d9e0f1ed8dd67fc5e9373950..496cf8c957956bd6cb79c9706710d0e177c912af 100644 (file)
@@ -106,6 +106,7 @@ public class Persist extends CommonBase {
         */
        public Result_NoneChannelMonitorUpdateErrZ persist_new_channel(OutPoint id, ChannelMonitor data) {
                long ret = bindings.Persist_persist_new_channel(this.ptr, id == null ? 0 : id.ptr & ~1, data == null ? 0 : data.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret);
                this.ptrs_to.add(id);
                this.ptrs_to.add(data);
@@ -138,6 +139,7 @@ public class Persist extends CommonBase {
         */
        public Result_NoneChannelMonitorUpdateErrZ update_persisted_channel(OutPoint id, ChannelMonitorUpdate update, ChannelMonitor data) {
                long ret = bindings.Persist_update_persisted_channel(this.ptr, id == null ? 0 : id.ptr & ~1, update == null ? 0 : update.ptr & ~1, data == null ? 0 : data.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret);
                this.ptrs_to.add(id);
                this.ptrs_to.add(update);
index d893cf3a88ed5217bc4c4ce98e29c5cd98c232c6..ecd53a4cbfdc4021a9ec662d9e1f8d39d1c6e393 100644 (file)
@@ -55,6 +55,7 @@ public class Ping extends CommonBase {
         */
        public static Ping of(short ponglen_arg, short byteslen_arg) {
                long ret = bindings.Ping_new(ponglen_arg, byteslen_arg);
+               if (ret < 1024) { return null; }
                Ping ret_hu_conv = new Ping(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -65,6 +66,7 @@ public class Ping extends CommonBase {
         */
        public Ping clone() {
                long ret = bindings.Ping_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Ping ret_hu_conv = new Ping(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -83,6 +85,7 @@ public class Ping extends CommonBase {
         */
        public static Result_PingDecodeErrorZ read(byte[] ser) {
                long ret = bindings.Ping_read(ser);
+               if (ret < 1024) { return null; }
                Result_PingDecodeErrorZ ret_hu_conv = Result_PingDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index f95040f8e0dfaf8ca808291ea596bcdf1aff6a95..a0c47de5fc87f3fd3cec81472c50edb323597bd9 100644 (file)
@@ -40,6 +40,7 @@ public class Pong extends CommonBase {
         */
        public static Pong of(short byteslen_arg) {
                long ret = bindings.Pong_new(byteslen_arg);
+               if (ret < 1024) { return null; }
                Pong ret_hu_conv = new Pong(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -50,6 +51,7 @@ public class Pong extends CommonBase {
         */
        public Pong clone() {
                long ret = bindings.Pong_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Pong ret_hu_conv = new Pong(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -68,6 +70,7 @@ public class Pong extends CommonBase {
         */
        public static Result_PongDecodeErrorZ read(byte[] ser) {
                long ret = bindings.Pong_read(ser);
+               if (ret < 1024) { return null; }
                Result_PongDecodeErrorZ ret_hu_conv = Result_PongDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 2a5af0914ed7b26972027ff48981b615fbff908b..c874c81aa6396e406eb8a6d1f72149144f4add99 100644 (file)
@@ -39,6 +39,7 @@ public class PositiveTimestamp extends CommonBase {
         */
        public PositiveTimestamp clone() {
                long ret = bindings.PositiveTimestamp_clone(this.ptr);
+               if (ret < 1024) { return null; }
                PositiveTimestamp ret_hu_conv = new PositiveTimestamp(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -51,6 +52,7 @@ public class PositiveTimestamp extends CommonBase {
         */
        public static Result_PositiveTimestampCreationErrorZ from_unix_timestamp(long unix_seconds) {
                long ret = bindings.PositiveTimestamp_from_unix_timestamp(unix_seconds);
+               if (ret < 1024) { return null; }
                Result_PositiveTimestampCreationErrorZ ret_hu_conv = Result_PositiveTimestampCreationErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -62,6 +64,7 @@ public class PositiveTimestamp extends CommonBase {
         */
        public static Result_PositiveTimestampCreationErrorZ from_system_time(long time) {
                long ret = bindings.PositiveTimestamp_from_system_time(time);
+               if (ret < 1024) { return null; }
                Result_PositiveTimestampCreationErrorZ ret_hu_conv = Result_PositiveTimestampCreationErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 74c1bbb983d2922693c6dd463c0b5eaf3aee2963..5c195ed3072f2f83b3b32e08ce5261ed89ef301f 100644 (file)
@@ -37,6 +37,7 @@ public class PrivateRoute extends CommonBase {
         */
        public PrivateRoute clone() {
                long ret = bindings.PrivateRoute_clone(this.ptr);
+               if (ret < 1024) { return null; }
                PrivateRoute ret_hu_conv = new PrivateRoute(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -47,6 +48,7 @@ public class PrivateRoute extends CommonBase {
         */
        public static Result_PrivateRouteCreationErrorZ of(RouteHint hops) {
                long ret = bindings.PrivateRoute_new(hops == null ? 0 : hops.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_PrivateRouteCreationErrorZ ret_hu_conv = Result_PrivateRouteCreationErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(hops);
                return ret_hu_conv;
@@ -57,6 +59,7 @@ public class PrivateRoute extends CommonBase {
         */
        public RouteHint into_inner() {
                long ret = bindings.PrivateRoute_into_inner(this.ptr);
+               if (ret < 1024) { return null; }
                RouteHint ret_hu_conv = new RouteHint(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                this.ptrs_to.add(this);
index 0392ad3bd1b6f7c1b17195cc6b127ba63df81bd7..02769338697ab82905253b23eceafb7543afe46a 100644 (file)
@@ -71,6 +71,7 @@ public class QueryChannelRange extends CommonBase {
         */
        public static QueryChannelRange of(byte[] chain_hash_arg, int first_blocknum_arg, int number_of_blocks_arg) {
                long ret = bindings.QueryChannelRange_new(chain_hash_arg, first_blocknum_arg, number_of_blocks_arg);
+               if (ret < 1024) { return null; }
                QueryChannelRange ret_hu_conv = new QueryChannelRange(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -81,6 +82,7 @@ public class QueryChannelRange extends CommonBase {
         */
        public QueryChannelRange clone() {
                long ret = bindings.QueryChannelRange_clone(this.ptr);
+               if (ret < 1024) { return null; }
                QueryChannelRange ret_hu_conv = new QueryChannelRange(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -99,6 +101,7 @@ public class QueryChannelRange extends CommonBase {
         */
        public static Result_QueryChannelRangeDecodeErrorZ read(byte[] ser) {
                long ret = bindings.QueryChannelRange_read(ser);
+               if (ret < 1024) { return null; }
                Result_QueryChannelRangeDecodeErrorZ ret_hu_conv = Result_QueryChannelRangeDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index e5123b64c0164456b8f710b83c3a4478f487a92c..bda762487e144dc85e7d1ed93c4e3366af6dbc58 100644 (file)
@@ -52,6 +52,7 @@ public class QueryShortChannelIds extends CommonBase {
         */
        public static QueryShortChannelIds of(byte[] chain_hash_arg, long[] short_channel_ids_arg) {
                long ret = bindings.QueryShortChannelIds_new(chain_hash_arg, short_channel_ids_arg);
+               if (ret < 1024) { return null; }
                QueryShortChannelIds ret_hu_conv = new QueryShortChannelIds(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -62,6 +63,7 @@ public class QueryShortChannelIds extends CommonBase {
         */
        public QueryShortChannelIds clone() {
                long ret = bindings.QueryShortChannelIds_clone(this.ptr);
+               if (ret < 1024) { return null; }
                QueryShortChannelIds ret_hu_conv = new QueryShortChannelIds(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -72,6 +74,7 @@ public class QueryShortChannelIds extends CommonBase {
         */
        public static Result_QueryShortChannelIdsDecodeErrorZ read(byte[] ser) {
                long ret = bindings.QueryShortChannelIds_read(ser);
+               if (ret < 1024) { return null; }
                Result_QueryShortChannelIdsDecodeErrorZ ret_hu_conv = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index c76d4dc93ab1449d41b34a67506d092a10eae7d4..253ba7a06c01184f1187cfff090148814b87641c 100644 (file)
@@ -23,6 +23,7 @@ public class RawDataPart extends CommonBase {
         */
        public PositiveTimestamp get_timestamp() {
                long ret = bindings.RawDataPart_get_timestamp(this.ptr);
+               if (ret < 1024) { return null; }
                PositiveTimestamp ret_hu_conv = new PositiveTimestamp(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -52,6 +53,7 @@ public class RawDataPart extends CommonBase {
         */
        public RawDataPart clone() {
                long ret = bindings.RawDataPart_clone(this.ptr);
+               if (ret < 1024) { return null; }
                RawDataPart ret_hu_conv = new RawDataPart(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index a63dc0b349a4a9ec608f7423c512cea5b39ab32a..82bc5172ee4fa0be8aefc5fa324d1ff8532c0772 100644 (file)
@@ -27,6 +27,7 @@ public class RawInvoice extends CommonBase {
         */
        public RawDataPart get_data() {
                long ret = bindings.RawInvoice_get_data(this.ptr);
+               if (ret < 1024) { return null; }
                RawDataPart ret_hu_conv = new RawDataPart(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -56,6 +57,7 @@ public class RawInvoice extends CommonBase {
         */
        public RawInvoice clone() {
                long ret = bindings.RawInvoice_clone(this.ptr);
+               if (ret < 1024) { return null; }
                RawInvoice ret_hu_conv = new RawInvoice(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -69,60 +71,102 @@ public class RawInvoice extends CommonBase {
                return ret;
        }
 
+       /**
+        * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+        */
+       @Nullable
        public Sha256 payment_hash() {
                long ret = bindings.RawInvoice_payment_hash(this.ptr);
+               if (ret < 1024) { return null; }
                Sha256 ret_hu_conv = new Sha256(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
        }
 
+       /**
+        * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+        */
+       @Nullable
        public Description description() {
                long ret = bindings.RawInvoice_description(this.ptr);
+               if (ret < 1024) { return null; }
                Description ret_hu_conv = new Description(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
        }
 
+       /**
+        * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+        */
+       @Nullable
        public PayeePubKey payee_pub_key() {
                long ret = bindings.RawInvoice_payee_pub_key(this.ptr);
+               if (ret < 1024) { return null; }
                PayeePubKey ret_hu_conv = new PayeePubKey(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
        }
 
+       /**
+        * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+        */
+       @Nullable
        public Sha256 description_hash() {
                long ret = bindings.RawInvoice_description_hash(this.ptr);
+               if (ret < 1024) { return null; }
                Sha256 ret_hu_conv = new Sha256(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
        }
 
+       /**
+        * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+        */
+       @Nullable
        public ExpiryTime expiry_time() {
                long ret = bindings.RawInvoice_expiry_time(this.ptr);
+               if (ret < 1024) { return null; }
                ExpiryTime ret_hu_conv = new ExpiryTime(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
        }
 
+       /**
+        * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+        */
+       @Nullable
        public MinFinalCltvExpiry min_final_cltv_expiry() {
                long ret = bindings.RawInvoice_min_final_cltv_expiry(this.ptr);
+               if (ret < 1024) { return null; }
                MinFinalCltvExpiry ret_hu_conv = new MinFinalCltvExpiry(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
        }
 
+       /**
+        * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+        */
+       @Nullable
        public byte[] payment_secret() {
                byte[] ret = bindings.RawInvoice_payment_secret(this.ptr);
                return ret;
        }
 
+       /**
+        * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
+        */
+       @Nullable
        public InvoiceFeatures features() {
                long ret = bindings.RawInvoice_features(this.ptr);
+               if (ret < 1024) { return null; }
                InvoiceFeatures ret_hu_conv = new InvoiceFeatures(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
        }
 
+       /**
+        * 
+        */
        public PrivateRoute[] private_routes() {
                long[] ret = bindings.RawInvoice_private_routes(this.ptr);
                PrivateRoute[] ret_conv_14_arr = new PrivateRoute[ret.length];
@@ -135,13 +179,20 @@ public class RawInvoice extends CommonBase {
                return ret_conv_14_arr;
        }
 
+       /**
+        * 
+        */
        public Option_u64Z amount_pico_btc() {
                long ret = bindings.RawInvoice_amount_pico_btc(this.ptr);
+               if (ret < 1024) { return null; }
                Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
        }
 
+       /**
+        * 
+        */
        public Currency currency() {
                Currency ret = bindings.RawInvoice_currency(this.ptr);
                return ret;
index b02a85876d852692f832988a636ba31ed0aab049..876781e87494e6cb28ad5bdd894cbbab462f7c6f 100644 (file)
@@ -96,6 +96,7 @@ public class ReplyChannelRange extends CommonBase {
         */
        public static ReplyChannelRange of(byte[] chain_hash_arg, int first_blocknum_arg, int number_of_blocks_arg, boolean sync_complete_arg, long[] short_channel_ids_arg) {
                long ret = bindings.ReplyChannelRange_new(chain_hash_arg, first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg);
+               if (ret < 1024) { return null; }
                ReplyChannelRange ret_hu_conv = new ReplyChannelRange(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -106,6 +107,7 @@ public class ReplyChannelRange extends CommonBase {
         */
        public ReplyChannelRange clone() {
                long ret = bindings.ReplyChannelRange_clone(this.ptr);
+               if (ret < 1024) { return null; }
                ReplyChannelRange ret_hu_conv = new ReplyChannelRange(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -116,6 +118,7 @@ public class ReplyChannelRange extends CommonBase {
         */
        public static Result_ReplyChannelRangeDecodeErrorZ read(byte[] ser) {
                long ret = bindings.ReplyChannelRange_read(ser);
+               if (ret < 1024) { return null; }
                Result_ReplyChannelRangeDecodeErrorZ ret_hu_conv = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index eb34da2aed6b21ce632877b1e50d98e3723bdbf6..8ddcf7d940adb8803400356e6ff0b47f3773cd3f 100644 (file)
@@ -58,6 +58,7 @@ public class ReplyShortChannelIdsEnd extends CommonBase {
         */
        public static ReplyShortChannelIdsEnd of(byte[] chain_hash_arg, boolean full_information_arg) {
                long ret = bindings.ReplyShortChannelIdsEnd_new(chain_hash_arg, full_information_arg);
+               if (ret < 1024) { return null; }
                ReplyShortChannelIdsEnd ret_hu_conv = new ReplyShortChannelIdsEnd(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -68,6 +69,7 @@ public class ReplyShortChannelIdsEnd extends CommonBase {
         */
        public ReplyShortChannelIdsEnd clone() {
                long ret = bindings.ReplyShortChannelIdsEnd_clone(this.ptr);
+               if (ret < 1024) { return null; }
                ReplyShortChannelIdsEnd ret_hu_conv = new ReplyShortChannelIdsEnd(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -78,6 +80,7 @@ public class ReplyShortChannelIdsEnd extends CommonBase {
         */
        public static Result_ReplyShortChannelIdsEndDecodeErrorZ read(byte[] ser) {
                long ret = bindings.ReplyShortChannelIdsEnd_read(ser);
+               if (ret < 1024) { return null; }
                Result_ReplyShortChannelIdsEndDecodeErrorZ ret_hu_conv = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 0606b503e1d3672821b8bc2b7fd8221d153473f0..eb08446667da181423cbf3401b08fb14491267a7 100644 (file)
@@ -45,6 +45,7 @@ public class Result_AcceptChannelDecodeErrorZ extends CommonBase {
         */
        public static Result_AcceptChannelDecodeErrorZ ok(AcceptChannel o) {
                long ret = bindings.CResult_AcceptChannelDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_AcceptChannelDecodeErrorZ ret_hu_conv = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_AcceptChannelDecodeErrorZ extends CommonBase {
         */
        public static Result_AcceptChannelDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_AcceptChannelDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_AcceptChannelDecodeErrorZ ret_hu_conv = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_AcceptChannelDecodeErrorZ extends CommonBase {
         */
        public Result_AcceptChannelDecodeErrorZ clone() {
                long ret = bindings.CResult_AcceptChannelDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_AcceptChannelDecodeErrorZ ret_hu_conv = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 1b747988d82f1664eb6eba1b96fb5e088914cf57..d98fcc3e37cdcbb0ba49bb502b1bd29f726aed9f 100644 (file)
@@ -45,6 +45,7 @@ public class Result_AnnouncementSignaturesDecodeErrorZ extends CommonBase {
         */
        public static Result_AnnouncementSignaturesDecodeErrorZ ok(AnnouncementSignatures o) {
                long ret = bindings.CResult_AnnouncementSignaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_AnnouncementSignaturesDecodeErrorZ ret_hu_conv = Result_AnnouncementSignaturesDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_AnnouncementSignaturesDecodeErrorZ extends CommonBase {
         */
        public static Result_AnnouncementSignaturesDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_AnnouncementSignaturesDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_AnnouncementSignaturesDecodeErrorZ ret_hu_conv = Result_AnnouncementSignaturesDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_AnnouncementSignaturesDecodeErrorZ extends CommonBase {
         */
        public Result_AnnouncementSignaturesDecodeErrorZ clone() {
                long ret = bindings.CResult_AnnouncementSignaturesDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_AnnouncementSignaturesDecodeErrorZ ret_hu_conv = Result_AnnouncementSignaturesDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 3fed27fac9b1006bfa3de7fa1c4fe6dbe81eac4e..11a6352f8526b4d50888d78393635f9ed730be75 100644 (file)
@@ -45,6 +45,7 @@ public class Result_BuiltCommitmentTransactionDecodeErrorZ extends CommonBase {
         */
        public static Result_BuiltCommitmentTransactionDecodeErrorZ ok(BuiltCommitmentTransaction o) {
                long ret = bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_BuiltCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_BuiltCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_BuiltCommitmentTransactionDecodeErrorZ extends CommonBase {
         */
        public static Result_BuiltCommitmentTransactionDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_BuiltCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_BuiltCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_BuiltCommitmentTransactionDecodeErrorZ extends CommonBase {
         */
        public Result_BuiltCommitmentTransactionDecodeErrorZ clone() {
                long ret = bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_BuiltCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_BuiltCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 2ee985a5a72c441846c1a58f57ed945d234e4077..f49d766029db48750b11114d68c0120504ed5372 100644 (file)
@@ -51,6 +51,7 @@ public class Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ extends CommonB
         */
        public static Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ ok(TwoTuple<byte[], ChannelManager> o) {
                long ret = bindings.CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(bindings.C2Tuple_BlockHashChannelManagerZ_new(o.a, o.b == null ? 0 : o.b.ptr & ~1));
+               if (ret < 1024) { return null; }
                Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o.b);
                // Due to rust's strict-ownership memory model, in some cases we need to "move"
@@ -69,6 +70,7 @@ public class Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ extends CommonB
         */
        public static Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
index c46d45be25c2d8cd2d24694563d4810100e5646c..6a21fb3c93660a586ceb597bbeeae5a05fcc5569 100644 (file)
@@ -51,6 +51,7 @@ public class Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ extends CommonB
         */
        public static Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ ok(TwoTuple<byte[], ChannelMonitor> o) {
                long ret = bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(bindings.C2Tuple_BlockHashChannelMonitorZ_new(o.a, o.b == null ? 0 : o.b.ptr & ~1));
+               if (ret < 1024) { return null; }
                Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o.b);
                return ret_hu_conv;
@@ -61,6 +62,7 @@ public class Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ extends CommonB
         */
        public static Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
index 1840e40babbf499b7fca2b81bc98f0b81dc699e0..b9a92dabb96441fcd42605c4db3962e0a18d0eee 100644 (file)
@@ -43,6 +43,7 @@ public class Result_C2Tuple_SignatureCVec_SignatureZZNoneZ extends CommonBase {
         */
        public static Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ok(TwoTuple<byte[], byte[][]> o) {
                long ret = bindings.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(bindings.C2Tuple_SignatureCVec_SignatureZZ_new(o.a, o.b));
+               if (ret < 1024) { return null; }
                Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_hu_conv = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -52,6 +53,7 @@ public class Result_C2Tuple_SignatureCVec_SignatureZZNoneZ extends CommonBase {
         */
        public static Result_C2Tuple_SignatureCVec_SignatureZZNoneZ err() {
                long ret = bindings.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err();
+               if (ret < 1024) { return null; }
                Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_hu_conv = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -62,6 +64,7 @@ public class Result_C2Tuple_SignatureCVec_SignatureZZNoneZ extends CommonBase {
         */
        public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ clone() {
                long ret = bindings.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_hu_conv = Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index ff4cd3590f019e23067a82fa058c72ec316b499e..24a9e58b0f104ca423b139bd82d5f27f472420f3 100644 (file)
@@ -44,6 +44,7 @@ public class Result_CResult_NetAddressu8ZDecodeErrorZ extends CommonBase {
         */
        public static Result_CResult_NetAddressu8ZDecodeErrorZ ok(Result_NetAddressu8Z o) {
                long ret = bindings.CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(o != null ? o.ptr : 0);
+               if (ret < 1024) { return null; }
                Result_CResult_NetAddressu8ZDecodeErrorZ ret_hu_conv = Result_CResult_NetAddressu8ZDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -53,6 +54,7 @@ public class Result_CResult_NetAddressu8ZDecodeErrorZ extends CommonBase {
         */
        public static Result_CResult_NetAddressu8ZDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_CResult_NetAddressu8ZDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_CResult_NetAddressu8ZDecodeErrorZ ret_hu_conv = Result_CResult_NetAddressu8ZDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -64,6 +66,7 @@ public class Result_CResult_NetAddressu8ZDecodeErrorZ extends CommonBase {
         */
        public Result_CResult_NetAddressu8ZDecodeErrorZ clone() {
                long ret = bindings.CResult_CResult_NetAddressu8ZDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_CResult_NetAddressu8ZDecodeErrorZ ret_hu_conv = Result_CResult_NetAddressu8ZDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index a1a74e7c177bd5b15eabc3906959074a4b2f252f..0fd55196ab178488c4b16e24f211875fda5e4d65 100644 (file)
@@ -53,6 +53,7 @@ public class Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ extends CommonB
         */
        public static Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ ok(TwoTuple<byte[], ChannelMonitor>[] o) {
                long ret = bindings.CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(Arrays.stream(o).mapToLong(o_conv_34 -> bindings.C2Tuple_BlockHashChannelMonitorZ_new(o_conv_34.a, o_conv_34.b == null ? 0 : o_conv_34.b.ptr & ~1)).toArray());
+               if (ret < 1024) { return null; }
                Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ ret_hu_conv = Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.constr_from_ptr(ret);
                /* TODO 2 TwoTuple<byte[], ChannelMonitor>  */;
                return ret_hu_conv;
@@ -63,6 +64,7 @@ public class Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ extends CommonB
         */
        public static Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ err(IOError e) {
                long ret = bindings.CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_err(e);
+               if (ret < 1024) { return null; }
                Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ ret_hu_conv = Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 21c109e9e61a6294d4258a154420e0980a4d0484..23c4609d5d40cbd87b06c5b30e3435c3e58e6a96 100644 (file)
@@ -37,6 +37,7 @@ public class Result_CVec_CVec_u8ZZNoneZ extends CommonBase {
         */
        public static Result_CVec_CVec_u8ZZNoneZ ok(byte[][] o) {
                long ret = bindings.CResult_CVec_CVec_u8ZZNoneZ_ok(o);
+               if (ret < 1024) { return null; }
                Result_CVec_CVec_u8ZZNoneZ ret_hu_conv = Result_CVec_CVec_u8ZZNoneZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -46,6 +47,7 @@ public class Result_CVec_CVec_u8ZZNoneZ extends CommonBase {
         */
        public static Result_CVec_CVec_u8ZZNoneZ err() {
                long ret = bindings.CResult_CVec_CVec_u8ZZNoneZ_err();
+               if (ret < 1024) { return null; }
                Result_CVec_CVec_u8ZZNoneZ ret_hu_conv = Result_CVec_CVec_u8ZZNoneZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -56,6 +58,7 @@ public class Result_CVec_CVec_u8ZZNoneZ extends CommonBase {
         */
        public Result_CVec_CVec_u8ZZNoneZ clone() {
                long ret = bindings.CResult_CVec_CVec_u8ZZNoneZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_CVec_CVec_u8ZZNoneZ ret_hu_conv = Result_CVec_CVec_u8ZZNoneZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 8cdf986dd5f0d059a6a0cde8bf16f38b4367ddb1..8688f73d0625a25d4e4a9c7c3c895346bed4ba55 100644 (file)
@@ -37,6 +37,7 @@ public class Result_CVec_SignatureZNoneZ extends CommonBase {
         */
        public static Result_CVec_SignatureZNoneZ ok(byte[][] o) {
                long ret = bindings.CResult_CVec_SignatureZNoneZ_ok(o);
+               if (ret < 1024) { return null; }
                Result_CVec_SignatureZNoneZ ret_hu_conv = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -46,6 +47,7 @@ public class Result_CVec_SignatureZNoneZ extends CommonBase {
         */
        public static Result_CVec_SignatureZNoneZ err() {
                long ret = bindings.CResult_CVec_SignatureZNoneZ_err();
+               if (ret < 1024) { return null; }
                Result_CVec_SignatureZNoneZ ret_hu_conv = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -56,6 +58,7 @@ public class Result_CVec_SignatureZNoneZ extends CommonBase {
         */
        public Result_CVec_SignatureZNoneZ clone() {
                long ret = bindings.CResult_CVec_SignatureZNoneZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_CVec_SignatureZNoneZ ret_hu_conv = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 7a39399246642e0fe22f1d423893f44e1ff2c4b9..179d102403a4971f34689429ab5a2d658b41a458 100644 (file)
@@ -42,6 +42,7 @@ public class Result_CVec_u8ZPeerHandleErrorZ extends CommonBase {
         */
        public static Result_CVec_u8ZPeerHandleErrorZ ok(byte[] o) {
                long ret = bindings.CResult_CVec_u8ZPeerHandleErrorZ_ok(o);
+               if (ret < 1024) { return null; }
                Result_CVec_u8ZPeerHandleErrorZ ret_hu_conv = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -51,6 +52,7 @@ public class Result_CVec_u8ZPeerHandleErrorZ extends CommonBase {
         */
        public static Result_CVec_u8ZPeerHandleErrorZ err(PeerHandleError e) {
                long ret = bindings.CResult_CVec_u8ZPeerHandleErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_CVec_u8ZPeerHandleErrorZ ret_hu_conv = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -62,6 +64,7 @@ public class Result_CVec_u8ZPeerHandleErrorZ extends CommonBase {
         */
        public Result_CVec_u8ZPeerHandleErrorZ clone() {
                long ret = bindings.CResult_CVec_u8ZPeerHandleErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_CVec_u8ZPeerHandleErrorZ ret_hu_conv = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 5121b6dbbe26b3b2812ae7404c6b966e717755ab..d6a8086e0e5dfa4db36b40dc1690b9fe1befa170 100644 (file)
@@ -45,6 +45,7 @@ public class Result_ChannelAnnouncementDecodeErrorZ extends CommonBase {
         */
        public static Result_ChannelAnnouncementDecodeErrorZ ok(ChannelAnnouncement o) {
                long ret = bindings.CResult_ChannelAnnouncementDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_ChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_ChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_ChannelAnnouncementDecodeErrorZ extends CommonBase {
         */
        public static Result_ChannelAnnouncementDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_ChannelAnnouncementDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_ChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_ChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_ChannelAnnouncementDecodeErrorZ extends CommonBase {
         */
        public Result_ChannelAnnouncementDecodeErrorZ clone() {
                long ret = bindings.CResult_ChannelAnnouncementDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_ChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_ChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index b5f2ee1fae7f7156b44608f5373b1aad3dc6fd95..6d3673c3be24c2fa937862278ad960c6c33f1b97 100644 (file)
@@ -45,6 +45,7 @@ public class Result_ChannelConfigDecodeErrorZ extends CommonBase {
         */
        public static Result_ChannelConfigDecodeErrorZ ok(ChannelConfig o) {
                long ret = bindings.CResult_ChannelConfigDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_ChannelConfigDecodeErrorZ ret_hu_conv = Result_ChannelConfigDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_ChannelConfigDecodeErrorZ extends CommonBase {
         */
        public static Result_ChannelConfigDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_ChannelConfigDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_ChannelConfigDecodeErrorZ ret_hu_conv = Result_ChannelConfigDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_ChannelConfigDecodeErrorZ extends CommonBase {
         */
        public Result_ChannelConfigDecodeErrorZ clone() {
                long ret = bindings.CResult_ChannelConfigDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_ChannelConfigDecodeErrorZ ret_hu_conv = Result_ChannelConfigDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index e78155d8f590cede0f4b095dc2a06f10522a1e6d..24048d5052888bdd621923fed10baa916f0d5b82 100644 (file)
@@ -45,6 +45,7 @@ public class Result_ChannelFeaturesDecodeErrorZ extends CommonBase {
         */
        public static Result_ChannelFeaturesDecodeErrorZ ok(ChannelFeatures o) {
                long ret = bindings.CResult_ChannelFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_ChannelFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelFeaturesDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_ChannelFeaturesDecodeErrorZ extends CommonBase {
         */
        public static Result_ChannelFeaturesDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_ChannelFeaturesDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_ChannelFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelFeaturesDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
index f92708a2f1a2918f684d7e98a1e39a08fc40bdf5..f56e92282d7aa419493a4e9fff10aaafde2b275c 100644 (file)
@@ -45,6 +45,7 @@ public class Result_ChannelInfoDecodeErrorZ extends CommonBase {
         */
        public static Result_ChannelInfoDecodeErrorZ ok(ChannelInfo o) {
                long ret = bindings.CResult_ChannelInfoDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_ChannelInfoDecodeErrorZ ret_hu_conv = Result_ChannelInfoDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_ChannelInfoDecodeErrorZ extends CommonBase {
         */
        public static Result_ChannelInfoDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_ChannelInfoDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_ChannelInfoDecodeErrorZ ret_hu_conv = Result_ChannelInfoDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_ChannelInfoDecodeErrorZ extends CommonBase {
         */
        public Result_ChannelInfoDecodeErrorZ clone() {
                long ret = bindings.CResult_ChannelInfoDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_ChannelInfoDecodeErrorZ ret_hu_conv = Result_ChannelInfoDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index b38139f9a70d5f300a1f451bfac93a93c31fe2ab..3721af3cfa778dee5a2045f26885a5f46f562896 100644 (file)
@@ -45,6 +45,7 @@ public class Result_ChannelMonitorUpdateDecodeErrorZ extends CommonBase {
         */
        public static Result_ChannelMonitorUpdateDecodeErrorZ ok(ChannelMonitorUpdate o) {
                long ret = bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_ChannelMonitorUpdateDecodeErrorZ ret_hu_conv = Result_ChannelMonitorUpdateDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_ChannelMonitorUpdateDecodeErrorZ extends CommonBase {
         */
        public static Result_ChannelMonitorUpdateDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_ChannelMonitorUpdateDecodeErrorZ ret_hu_conv = Result_ChannelMonitorUpdateDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_ChannelMonitorUpdateDecodeErrorZ extends CommonBase {
         */
        public Result_ChannelMonitorUpdateDecodeErrorZ clone() {
                long ret = bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_ChannelMonitorUpdateDecodeErrorZ ret_hu_conv = Result_ChannelMonitorUpdateDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 1cc298517ac1b78dab5edad093969dbf43784191..ee26de69e26d27022b99263ca6ff1540952f9b8c 100644 (file)
@@ -45,6 +45,7 @@ public class Result_ChannelPublicKeysDecodeErrorZ extends CommonBase {
         */
        public static Result_ChannelPublicKeysDecodeErrorZ ok(ChannelPublicKeys o) {
                long ret = bindings.CResult_ChannelPublicKeysDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_ChannelPublicKeysDecodeErrorZ ret_hu_conv = Result_ChannelPublicKeysDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_ChannelPublicKeysDecodeErrorZ extends CommonBase {
         */
        public static Result_ChannelPublicKeysDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_ChannelPublicKeysDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_ChannelPublicKeysDecodeErrorZ ret_hu_conv = Result_ChannelPublicKeysDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_ChannelPublicKeysDecodeErrorZ extends CommonBase {
         */
        public Result_ChannelPublicKeysDecodeErrorZ clone() {
                long ret = bindings.CResult_ChannelPublicKeysDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_ChannelPublicKeysDecodeErrorZ ret_hu_conv = Result_ChannelPublicKeysDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 5ebd6f14edbfe33db7eb9c033b7ae536df4ebea1..1d139d93f51d6844150ecacb8a6b81376d5aa492 100644 (file)
@@ -45,6 +45,7 @@ public class Result_ChannelReestablishDecodeErrorZ extends CommonBase {
         */
        public static Result_ChannelReestablishDecodeErrorZ ok(ChannelReestablish o) {
                long ret = bindings.CResult_ChannelReestablishDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_ChannelReestablishDecodeErrorZ ret_hu_conv = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_ChannelReestablishDecodeErrorZ extends CommonBase {
         */
        public static Result_ChannelReestablishDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_ChannelReestablishDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_ChannelReestablishDecodeErrorZ ret_hu_conv = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_ChannelReestablishDecodeErrorZ extends CommonBase {
         */
        public Result_ChannelReestablishDecodeErrorZ clone() {
                long ret = bindings.CResult_ChannelReestablishDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_ChannelReestablishDecodeErrorZ ret_hu_conv = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index fabf67b49650c223112e68eab7c8f0742141ae86..d51f669b16405f41eac3344801f4c098a21db79b 100644 (file)
@@ -45,6 +45,7 @@ public class Result_ChannelTransactionParametersDecodeErrorZ extends CommonBase
         */
        public static Result_ChannelTransactionParametersDecodeErrorZ ok(ChannelTransactionParameters o) {
                long ret = bindings.CResult_ChannelTransactionParametersDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_ChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_ChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_ChannelTransactionParametersDecodeErrorZ extends CommonBase
         */
        public static Result_ChannelTransactionParametersDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_ChannelTransactionParametersDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_ChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_ChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_ChannelTransactionParametersDecodeErrorZ extends CommonBase
         */
        public Result_ChannelTransactionParametersDecodeErrorZ clone() {
                long ret = bindings.CResult_ChannelTransactionParametersDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_ChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_ChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 532d6c6d2d1edf6a680125e92c0d92bd87a70476..9f3f4a69fbbf3165686b92fd36c30a41cfc8f752 100644 (file)
@@ -45,6 +45,7 @@ public class Result_ChannelUpdateDecodeErrorZ extends CommonBase {
         */
        public static Result_ChannelUpdateDecodeErrorZ ok(ChannelUpdate o) {
                long ret = bindings.CResult_ChannelUpdateDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_ChannelUpdateDecodeErrorZ ret_hu_conv = Result_ChannelUpdateDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_ChannelUpdateDecodeErrorZ extends CommonBase {
         */
        public static Result_ChannelUpdateDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_ChannelUpdateDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_ChannelUpdateDecodeErrorZ ret_hu_conv = Result_ChannelUpdateDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_ChannelUpdateDecodeErrorZ extends CommonBase {
         */
        public Result_ChannelUpdateDecodeErrorZ clone() {
                long ret = bindings.CResult_ChannelUpdateDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_ChannelUpdateDecodeErrorZ ret_hu_conv = Result_ChannelUpdateDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 7a4262d9be58a43860f909c5db50e0e54cb48383..543711be08cad7654fc4feaac9037ad6c5bc9537 100644 (file)
@@ -45,6 +45,7 @@ public class Result_ClosingSignedDecodeErrorZ extends CommonBase {
         */
        public static Result_ClosingSignedDecodeErrorZ ok(ClosingSigned o) {
                long ret = bindings.CResult_ClosingSignedDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_ClosingSignedDecodeErrorZ ret_hu_conv = Result_ClosingSignedDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_ClosingSignedDecodeErrorZ extends CommonBase {
         */
        public static Result_ClosingSignedDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_ClosingSignedDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_ClosingSignedDecodeErrorZ ret_hu_conv = Result_ClosingSignedDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_ClosingSignedDecodeErrorZ extends CommonBase {
         */
        public Result_ClosingSignedDecodeErrorZ clone() {
                long ret = bindings.CResult_ClosingSignedDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_ClosingSignedDecodeErrorZ ret_hu_conv = Result_ClosingSignedDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 32452b31cca7424fb481861c694896ef23fb9d3a..b9aee52d100ed6a77f2218587ab63a114f857e3c 100644 (file)
@@ -45,6 +45,7 @@ public class Result_CommitmentSignedDecodeErrorZ extends CommonBase {
         */
        public static Result_CommitmentSignedDecodeErrorZ ok(CommitmentSigned o) {
                long ret = bindings.CResult_CommitmentSignedDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_CommitmentSignedDecodeErrorZ ret_hu_conv = Result_CommitmentSignedDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_CommitmentSignedDecodeErrorZ extends CommonBase {
         */
        public static Result_CommitmentSignedDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_CommitmentSignedDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_CommitmentSignedDecodeErrorZ ret_hu_conv = Result_CommitmentSignedDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_CommitmentSignedDecodeErrorZ extends CommonBase {
         */
        public Result_CommitmentSignedDecodeErrorZ clone() {
                long ret = bindings.CResult_CommitmentSignedDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_CommitmentSignedDecodeErrorZ ret_hu_conv = Result_CommitmentSignedDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 19118833de0d9f29d2ad65766aa4f23d69082e0b..ec250602d67805fd114d312f54e66be5925533f9 100644 (file)
@@ -45,6 +45,7 @@ public class Result_CommitmentTransactionDecodeErrorZ extends CommonBase {
         */
        public static Result_CommitmentTransactionDecodeErrorZ ok(CommitmentTransaction o) {
                long ret = bindings.CResult_CommitmentTransactionDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_CommitmentTransactionDecodeErrorZ ret_hu_conv = Result_CommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_CommitmentTransactionDecodeErrorZ extends CommonBase {
         */
        public static Result_CommitmentTransactionDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_CommitmentTransactionDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_CommitmentTransactionDecodeErrorZ ret_hu_conv = Result_CommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_CommitmentTransactionDecodeErrorZ extends CommonBase {
         */
        public Result_CommitmentTransactionDecodeErrorZ clone() {
                long ret = bindings.CResult_CommitmentTransactionDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_CommitmentTransactionDecodeErrorZ ret_hu_conv = Result_CommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index fdb5d93f57bfb503c48744d8c6852cf755fc3f9c..435afdfa06c3915994b44587d51160fafcce3e5b 100644 (file)
@@ -45,6 +45,7 @@ public class Result_CounterpartyChannelTransactionParametersDecodeErrorZ extends
         */
        public static Result_CounterpartyChannelTransactionParametersDecodeErrorZ ok(CounterpartyChannelTransactionParameters o) {
                long ret = bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_CounterpartyChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_CounterpartyChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_CounterpartyChannelTransactionParametersDecodeErrorZ extends
         */
        public static Result_CounterpartyChannelTransactionParametersDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_CounterpartyChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_CounterpartyChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_CounterpartyChannelTransactionParametersDecodeErrorZ extends
         */
        public Result_CounterpartyChannelTransactionParametersDecodeErrorZ clone() {
                long ret = bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_CounterpartyChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_CounterpartyChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 7cc68cb6618729351954dcc5b70bbaadc84fc4f4..5495b55e1ee28ece6a644f59bd3c9550ea38fec7 100644 (file)
@@ -45,6 +45,7 @@ public class Result_DelayedPaymentOutputDescriptorDecodeErrorZ extends CommonBas
         */
        public static Result_DelayedPaymentOutputDescriptorDecodeErrorZ ok(DelayedPaymentOutputDescriptor o) {
                long ret = bindings.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_DelayedPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_DelayedPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_DelayedPaymentOutputDescriptorDecodeErrorZ extends CommonBas
         */
        public static Result_DelayedPaymentOutputDescriptorDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_DelayedPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_DelayedPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_DelayedPaymentOutputDescriptorDecodeErrorZ extends CommonBas
         */
        public Result_DelayedPaymentOutputDescriptorDecodeErrorZ clone() {
                long ret = bindings.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_DelayedPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_DelayedPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 476b8d7a11f9ed73ceffddefdf517a9a98ba450a..d5f3a64b05c034f914f95cf25afc0b4c7b6b23ef 100644 (file)
@@ -42,6 +42,7 @@ public class Result_DescriptionCreationErrorZ extends CommonBase {
         */
        public static Result_DescriptionCreationErrorZ ok(Description o) {
                long ret = bindings.CResult_DescriptionCreationErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_DescriptionCreationErrorZ ret_hu_conv = Result_DescriptionCreationErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -52,6 +53,7 @@ public class Result_DescriptionCreationErrorZ extends CommonBase {
         */
        public static Result_DescriptionCreationErrorZ err(CreationError e) {
                long ret = bindings.CResult_DescriptionCreationErrorZ_err(e);
+               if (ret < 1024) { return null; }
                Result_DescriptionCreationErrorZ ret_hu_conv = Result_DescriptionCreationErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -62,6 +64,7 @@ public class Result_DescriptionCreationErrorZ extends CommonBase {
         */
        public Result_DescriptionCreationErrorZ clone() {
                long ret = bindings.CResult_DescriptionCreationErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_DescriptionCreationErrorZ ret_hu_conv = Result_DescriptionCreationErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 49972e5ec82d87e09c674ccce2586ee398c3d7f9..a84c08a716266a950d35144bd5066960d5685100 100644 (file)
@@ -45,6 +45,7 @@ public class Result_DirectionalChannelInfoDecodeErrorZ extends CommonBase {
         */
        public static Result_DirectionalChannelInfoDecodeErrorZ ok(DirectionalChannelInfo o) {
                long ret = bindings.CResult_DirectionalChannelInfoDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_DirectionalChannelInfoDecodeErrorZ ret_hu_conv = Result_DirectionalChannelInfoDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_DirectionalChannelInfoDecodeErrorZ extends CommonBase {
         */
        public static Result_DirectionalChannelInfoDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_DirectionalChannelInfoDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_DirectionalChannelInfoDecodeErrorZ ret_hu_conv = Result_DirectionalChannelInfoDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_DirectionalChannelInfoDecodeErrorZ extends CommonBase {
         */
        public Result_DirectionalChannelInfoDecodeErrorZ clone() {
                long ret = bindings.CResult_DirectionalChannelInfoDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_DirectionalChannelInfoDecodeErrorZ ret_hu_conv = Result_DirectionalChannelInfoDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 0faea6e7f959922198a09a00f359c4e5cc817d99..60b92bec9c6ab4a9912c4c6429522e77ff05288b 100644 (file)
@@ -45,6 +45,7 @@ public class Result_ErrorMessageDecodeErrorZ extends CommonBase {
         */
        public static Result_ErrorMessageDecodeErrorZ ok(ErrorMessage o) {
                long ret = bindings.CResult_ErrorMessageDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_ErrorMessageDecodeErrorZ ret_hu_conv = Result_ErrorMessageDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_ErrorMessageDecodeErrorZ extends CommonBase {
         */
        public static Result_ErrorMessageDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_ErrorMessageDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_ErrorMessageDecodeErrorZ ret_hu_conv = Result_ErrorMessageDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_ErrorMessageDecodeErrorZ extends CommonBase {
         */
        public Result_ErrorMessageDecodeErrorZ clone() {
                long ret = bindings.CResult_ErrorMessageDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_ErrorMessageDecodeErrorZ ret_hu_conv = Result_ErrorMessageDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 03540b9141d5be8c554f89309874c8052333e87b..2389d8a11bcc5105ffd23cb082d3cc00e9a2fea1 100644 (file)
@@ -42,6 +42,7 @@ public class Result_ExpiryTimeCreationErrorZ extends CommonBase {
         */
        public static Result_ExpiryTimeCreationErrorZ ok(ExpiryTime o) {
                long ret = bindings.CResult_ExpiryTimeCreationErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_ExpiryTimeCreationErrorZ ret_hu_conv = Result_ExpiryTimeCreationErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -52,6 +53,7 @@ public class Result_ExpiryTimeCreationErrorZ extends CommonBase {
         */
        public static Result_ExpiryTimeCreationErrorZ err(CreationError e) {
                long ret = bindings.CResult_ExpiryTimeCreationErrorZ_err(e);
+               if (ret < 1024) { return null; }
                Result_ExpiryTimeCreationErrorZ ret_hu_conv = Result_ExpiryTimeCreationErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -62,6 +64,7 @@ public class Result_ExpiryTimeCreationErrorZ extends CommonBase {
         */
        public Result_ExpiryTimeCreationErrorZ clone() {
                long ret = bindings.CResult_ExpiryTimeCreationErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_ExpiryTimeCreationErrorZ ret_hu_conv = Result_ExpiryTimeCreationErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index f2b34220deefa792f1c4131faac56173066d024f..04304b1d03ab584ffbb408bcc13c4f1b8edbc173 100644 (file)
@@ -45,6 +45,7 @@ public class Result_FundingCreatedDecodeErrorZ extends CommonBase {
         */
        public static Result_FundingCreatedDecodeErrorZ ok(FundingCreated o) {
                long ret = bindings.CResult_FundingCreatedDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_FundingCreatedDecodeErrorZ ret_hu_conv = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_FundingCreatedDecodeErrorZ extends CommonBase {
         */
        public static Result_FundingCreatedDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_FundingCreatedDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_FundingCreatedDecodeErrorZ ret_hu_conv = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_FundingCreatedDecodeErrorZ extends CommonBase {
         */
        public Result_FundingCreatedDecodeErrorZ clone() {
                long ret = bindings.CResult_FundingCreatedDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_FundingCreatedDecodeErrorZ ret_hu_conv = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 390fad32ea4ae5d64b9aa172627a27ddd88ce69d..55336577170005340fecb23f935954fbd09b1713 100644 (file)
@@ -45,6 +45,7 @@ public class Result_FundingLockedDecodeErrorZ extends CommonBase {
         */
        public static Result_FundingLockedDecodeErrorZ ok(FundingLocked o) {
                long ret = bindings.CResult_FundingLockedDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_FundingLockedDecodeErrorZ ret_hu_conv = Result_FundingLockedDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_FundingLockedDecodeErrorZ extends CommonBase {
         */
        public static Result_FundingLockedDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_FundingLockedDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_FundingLockedDecodeErrorZ ret_hu_conv = Result_FundingLockedDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_FundingLockedDecodeErrorZ extends CommonBase {
         */
        public Result_FundingLockedDecodeErrorZ clone() {
                long ret = bindings.CResult_FundingLockedDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_FundingLockedDecodeErrorZ ret_hu_conv = Result_FundingLockedDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index fa305347818e89134a8a63cf5f9be2c98aa0b604..165e7be635344db856233532a38a5a77d65d4d93 100644 (file)
@@ -45,6 +45,7 @@ public class Result_FundingSignedDecodeErrorZ extends CommonBase {
         */
        public static Result_FundingSignedDecodeErrorZ ok(FundingSigned o) {
                long ret = bindings.CResult_FundingSignedDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_FundingSignedDecodeErrorZ ret_hu_conv = Result_FundingSignedDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_FundingSignedDecodeErrorZ extends CommonBase {
         */
        public static Result_FundingSignedDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_FundingSignedDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_FundingSignedDecodeErrorZ ret_hu_conv = Result_FundingSignedDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_FundingSignedDecodeErrorZ extends CommonBase {
         */
        public Result_FundingSignedDecodeErrorZ clone() {
                long ret = bindings.CResult_FundingSignedDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_FundingSignedDecodeErrorZ ret_hu_conv = Result_FundingSignedDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 7ea14db7c10c7810b5031646b6cc25af123fbabd..cf7d29fa004a8a8c8ff83c2c91b1e03e1a57caca 100644 (file)
@@ -45,6 +45,7 @@ public class Result_GossipTimestampFilterDecodeErrorZ extends CommonBase {
         */
        public static Result_GossipTimestampFilterDecodeErrorZ ok(GossipTimestampFilter o) {
                long ret = bindings.CResult_GossipTimestampFilterDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_GossipTimestampFilterDecodeErrorZ ret_hu_conv = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_GossipTimestampFilterDecodeErrorZ extends CommonBase {
         */
        public static Result_GossipTimestampFilterDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_GossipTimestampFilterDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_GossipTimestampFilterDecodeErrorZ ret_hu_conv = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_GossipTimestampFilterDecodeErrorZ extends CommonBase {
         */
        public Result_GossipTimestampFilterDecodeErrorZ clone() {
                long ret = bindings.CResult_GossipTimestampFilterDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_GossipTimestampFilterDecodeErrorZ ret_hu_conv = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 46c008a21dbe9e9f4a849285c591ccc295a344e8..5882ea82c7210445e8111826afc521e4f98cdc70 100644 (file)
@@ -45,6 +45,7 @@ public class Result_HTLCOutputInCommitmentDecodeErrorZ extends CommonBase {
         */
        public static Result_HTLCOutputInCommitmentDecodeErrorZ ok(HTLCOutputInCommitment o) {
                long ret = bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_HTLCOutputInCommitmentDecodeErrorZ ret_hu_conv = Result_HTLCOutputInCommitmentDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_HTLCOutputInCommitmentDecodeErrorZ extends CommonBase {
         */
        public static Result_HTLCOutputInCommitmentDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_HTLCOutputInCommitmentDecodeErrorZ ret_hu_conv = Result_HTLCOutputInCommitmentDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_HTLCOutputInCommitmentDecodeErrorZ extends CommonBase {
         */
        public Result_HTLCOutputInCommitmentDecodeErrorZ clone() {
                long ret = bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_HTLCOutputInCommitmentDecodeErrorZ ret_hu_conv = Result_HTLCOutputInCommitmentDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 1dfa8b79d045cd909a81bffce7a49a8461a9f71f..882a9f64f372f8ddbe29dd63ccfa14893a4647fd 100644 (file)
@@ -45,6 +45,7 @@ public class Result_HTLCUpdateDecodeErrorZ extends CommonBase {
         */
        public static Result_HTLCUpdateDecodeErrorZ ok(HTLCUpdate o) {
                long ret = bindings.CResult_HTLCUpdateDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_HTLCUpdateDecodeErrorZ ret_hu_conv = Result_HTLCUpdateDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_HTLCUpdateDecodeErrorZ extends CommonBase {
         */
        public static Result_HTLCUpdateDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_HTLCUpdateDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_HTLCUpdateDecodeErrorZ ret_hu_conv = Result_HTLCUpdateDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_HTLCUpdateDecodeErrorZ extends CommonBase {
         */
        public Result_HTLCUpdateDecodeErrorZ clone() {
                long ret = bindings.CResult_HTLCUpdateDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_HTLCUpdateDecodeErrorZ ret_hu_conv = Result_HTLCUpdateDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index c02782e2bbdea518e385297a3780c63ff17ddfe3..62a87677cb83463309117ebb192b0f04ce20f5f4 100644 (file)
@@ -45,6 +45,7 @@ public class Result_HolderCommitmentTransactionDecodeErrorZ extends CommonBase {
         */
        public static Result_HolderCommitmentTransactionDecodeErrorZ ok(HolderCommitmentTransaction o) {
                long ret = bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_HolderCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_HolderCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_HolderCommitmentTransactionDecodeErrorZ extends CommonBase {
         */
        public static Result_HolderCommitmentTransactionDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_HolderCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_HolderCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_HolderCommitmentTransactionDecodeErrorZ extends CommonBase {
         */
        public Result_HolderCommitmentTransactionDecodeErrorZ clone() {
                long ret = bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_HolderCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_HolderCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 730a92d4b2b23f145d525dd7a79919cccaa83c2f..8db24f9e9ea3a68992bfaa61478311ab4d696863 100644 (file)
@@ -45,6 +45,7 @@ public class Result_InMemorySignerDecodeErrorZ extends CommonBase {
         */
        public static Result_InMemorySignerDecodeErrorZ ok(InMemorySigner o) {
                long ret = bindings.CResult_InMemorySignerDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_InMemorySignerDecodeErrorZ ret_hu_conv = Result_InMemorySignerDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_InMemorySignerDecodeErrorZ extends CommonBase {
         */
        public static Result_InMemorySignerDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_InMemorySignerDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_InMemorySignerDecodeErrorZ ret_hu_conv = Result_InMemorySignerDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_InMemorySignerDecodeErrorZ extends CommonBase {
         */
        public Result_InMemorySignerDecodeErrorZ clone() {
                long ret = bindings.CResult_InMemorySignerDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_InMemorySignerDecodeErrorZ ret_hu_conv = Result_InMemorySignerDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 22e8cfef97845ccacbd0b728b95000f30bc9567c..45fd8ce3a5cb3f9977a4ef20eb81c1a24e215eed 100644 (file)
@@ -45,6 +45,7 @@ public class Result_InitDecodeErrorZ extends CommonBase {
         */
        public static Result_InitDecodeErrorZ ok(Init o) {
                long ret = bindings.CResult_InitDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_InitDecodeErrorZ ret_hu_conv = Result_InitDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_InitDecodeErrorZ extends CommonBase {
         */
        public static Result_InitDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_InitDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_InitDecodeErrorZ ret_hu_conv = Result_InitDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_InitDecodeErrorZ extends CommonBase {
         */
        public Result_InitDecodeErrorZ clone() {
                long ret = bindings.CResult_InitDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_InitDecodeErrorZ ret_hu_conv = Result_InitDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 49e16ec704bca19da5bf37e108710eb65d7146d0..cdee7ef3699d58f32eff5a7b491f446e711ed49b 100644 (file)
@@ -45,6 +45,7 @@ public class Result_InitFeaturesDecodeErrorZ extends CommonBase {
         */
        public static Result_InitFeaturesDecodeErrorZ ok(InitFeatures o) {
                long ret = bindings.CResult_InitFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_InitFeaturesDecodeErrorZ ret_hu_conv = Result_InitFeaturesDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_InitFeaturesDecodeErrorZ extends CommonBase {
         */
        public static Result_InitFeaturesDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_InitFeaturesDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_InitFeaturesDecodeErrorZ ret_hu_conv = Result_InitFeaturesDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
index 01af7fb3a3c6d919d3288e60072a913bab6c7357..e944749f01363a8758f18cb339e6370aff8ab38b 100644 (file)
@@ -45,6 +45,7 @@ public class Result_InvoiceFeaturesDecodeErrorZ extends CommonBase {
         */
        public static Result_InvoiceFeaturesDecodeErrorZ ok(InvoiceFeatures o) {
                long ret = bindings.CResult_InvoiceFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_InvoiceFeaturesDecodeErrorZ extends CommonBase {
         */
        public static Result_InvoiceFeaturesDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_InvoiceFeaturesDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
index 0d4057e359952ca2bf9a0ed5bede3226f29a91d4..20e49cc5bb0b764dfdaa4cad8f6bb69061aed242 100644 (file)
@@ -40,6 +40,7 @@ public class Result_InvoiceNoneZ extends CommonBase {
         */
        public static Result_InvoiceNoneZ ok(Invoice o) {
                long ret = bindings.CResult_InvoiceNoneZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_InvoiceNoneZ ret_hu_conv = Result_InvoiceNoneZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -50,6 +51,7 @@ public class Result_InvoiceNoneZ extends CommonBase {
         */
        public static Result_InvoiceNoneZ err() {
                long ret = bindings.CResult_InvoiceNoneZ_err();
+               if (ret < 1024) { return null; }
                Result_InvoiceNoneZ ret_hu_conv = Result_InvoiceNoneZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -60,6 +62,7 @@ public class Result_InvoiceNoneZ extends CommonBase {
         */
        public Result_InvoiceNoneZ clone() {
                long ret = bindings.CResult_InvoiceNoneZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_InvoiceNoneZ ret_hu_conv = Result_InvoiceNoneZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index fb15d5a833a389f6adf37b2e4bc8ccf6a5872278..8a466f361d859a2d5b87889d0f1c9b4c3e62a6c2 100644 (file)
@@ -42,6 +42,7 @@ public class Result_InvoiceSemanticErrorZ extends CommonBase {
         */
        public static Result_InvoiceSemanticErrorZ ok(Invoice o) {
                long ret = bindings.CResult_InvoiceSemanticErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_InvoiceSemanticErrorZ ret_hu_conv = Result_InvoiceSemanticErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -52,6 +53,7 @@ public class Result_InvoiceSemanticErrorZ extends CommonBase {
         */
        public static Result_InvoiceSemanticErrorZ err(SemanticError e) {
                long ret = bindings.CResult_InvoiceSemanticErrorZ_err(e);
+               if (ret < 1024) { return null; }
                Result_InvoiceSemanticErrorZ ret_hu_conv = Result_InvoiceSemanticErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -62,6 +64,7 @@ public class Result_InvoiceSemanticErrorZ extends CommonBase {
         */
        public Result_InvoiceSemanticErrorZ clone() {
                long ret = bindings.CResult_InvoiceSemanticErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_InvoiceSemanticErrorZ ret_hu_conv = Result_InvoiceSemanticErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index bcd3dd20da2cf85aeeb3b0ca302efd8a7fe2277d..4e0fcb48903911cf7d7f7c4cbd4b7c58c13c07dc 100644 (file)
@@ -45,6 +45,7 @@ public class Result_InvoiceSignOrCreationErrorZ extends CommonBase {
         */
        public static Result_InvoiceSignOrCreationErrorZ ok(Invoice o) {
                long ret = bindings.CResult_InvoiceSignOrCreationErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_InvoiceSignOrCreationErrorZ ret_hu_conv = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_InvoiceSignOrCreationErrorZ extends CommonBase {
         */
        public static Result_InvoiceSignOrCreationErrorZ err(SignOrCreationError e) {
                long ret = bindings.CResult_InvoiceSignOrCreationErrorZ_err(e.ptr);
+               if (ret < 1024) { return null; }
                Result_InvoiceSignOrCreationErrorZ ret_hu_conv = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -65,6 +67,7 @@ public class Result_InvoiceSignOrCreationErrorZ extends CommonBase {
         */
        public Result_InvoiceSignOrCreationErrorZ clone() {
                long ret = bindings.CResult_InvoiceSignOrCreationErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_InvoiceSignOrCreationErrorZ ret_hu_conv = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 92093a1d73dc425864076023cc1f5726834c62a4..a1e180f1b577f78ffca760325475002290928d23 100644 (file)
@@ -45,6 +45,7 @@ public class Result_NetAddressDecodeErrorZ extends CommonBase {
         */
        public static Result_NetAddressDecodeErrorZ ok(NetAddress o) {
                long ret = bindings.CResult_NetAddressDecodeErrorZ_ok(o.ptr);
+               if (ret < 1024) { return null; }
                Result_NetAddressDecodeErrorZ ret_hu_conv = Result_NetAddressDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -54,6 +55,7 @@ public class Result_NetAddressDecodeErrorZ extends CommonBase {
         */
        public static Result_NetAddressDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_NetAddressDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_NetAddressDecodeErrorZ ret_hu_conv = Result_NetAddressDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -65,6 +67,7 @@ public class Result_NetAddressDecodeErrorZ extends CommonBase {
         */
        public Result_NetAddressDecodeErrorZ clone() {
                long ret = bindings.CResult_NetAddressDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_NetAddressDecodeErrorZ ret_hu_conv = Result_NetAddressDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index d8f987ce09196d7c40a591cbe0ae95cd900aa0bf..3b5eee91efda2f089fe336b7ce9d362765a899d9 100644 (file)
@@ -42,6 +42,7 @@ public class Result_NetAddressu8Z extends CommonBase {
         */
        public static Result_NetAddressu8Z ok(NetAddress o) {
                long ret = bindings.CResult_NetAddressu8Z_ok(o.ptr);
+               if (ret < 1024) { return null; }
                Result_NetAddressu8Z ret_hu_conv = Result_NetAddressu8Z.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -51,6 +52,7 @@ public class Result_NetAddressu8Z extends CommonBase {
         */
        public static Result_NetAddressu8Z err(byte e) {
                long ret = bindings.CResult_NetAddressu8Z_err(e);
+               if (ret < 1024) { return null; }
                Result_NetAddressu8Z ret_hu_conv = Result_NetAddressu8Z.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -61,6 +63,7 @@ public class Result_NetAddressu8Z extends CommonBase {
         */
        public Result_NetAddressu8Z clone() {
                long ret = bindings.CResult_NetAddressu8Z_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_NetAddressu8Z ret_hu_conv = Result_NetAddressu8Z.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 3f4bcf95576772392d9a2dac22a3a2e973c349d2..375eceb90bb09b6266ee3a09865196ac30aa81a2 100644 (file)
@@ -45,6 +45,7 @@ public class Result_NetworkGraphDecodeErrorZ extends CommonBase {
         */
        public static Result_NetworkGraphDecodeErrorZ ok(NetworkGraph o) {
                long ret = bindings.CResult_NetworkGraphDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_NetworkGraphDecodeErrorZ ret_hu_conv = Result_NetworkGraphDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_NetworkGraphDecodeErrorZ extends CommonBase {
         */
        public static Result_NetworkGraphDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_NetworkGraphDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_NetworkGraphDecodeErrorZ ret_hu_conv = Result_NetworkGraphDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_NetworkGraphDecodeErrorZ extends CommonBase {
         */
        public Result_NetworkGraphDecodeErrorZ clone() {
                long ret = bindings.CResult_NetworkGraphDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_NetworkGraphDecodeErrorZ ret_hu_conv = Result_NetworkGraphDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index f15357b08aa338470c189cebd8d282f15a9c280f..4527c8e0316b499ee2223b93d8fff730d97f939e 100644 (file)
@@ -45,6 +45,7 @@ public class Result_NodeAnnouncementDecodeErrorZ extends CommonBase {
         */
        public static Result_NodeAnnouncementDecodeErrorZ ok(NodeAnnouncement o) {
                long ret = bindings.CResult_NodeAnnouncementDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_NodeAnnouncementDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_NodeAnnouncementDecodeErrorZ extends CommonBase {
         */
        public static Result_NodeAnnouncementDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_NodeAnnouncementDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_NodeAnnouncementDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_NodeAnnouncementDecodeErrorZ extends CommonBase {
         */
        public Result_NodeAnnouncementDecodeErrorZ clone() {
                long ret = bindings.CResult_NodeAnnouncementDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_NodeAnnouncementDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index f9765aeeb08e2cbc3b7141fb63ca8b1147e76305..16152b3d66a6c791a4f26ca822d84a1d4fc1a51b 100644 (file)
@@ -45,6 +45,7 @@ public class Result_NodeAnnouncementInfoDecodeErrorZ extends CommonBase {
         */
        public static Result_NodeAnnouncementInfoDecodeErrorZ ok(NodeAnnouncementInfo o) {
                long ret = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_NodeAnnouncementInfoDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_NodeAnnouncementInfoDecodeErrorZ extends CommonBase {
         */
        public static Result_NodeAnnouncementInfoDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_NodeAnnouncementInfoDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_NodeAnnouncementInfoDecodeErrorZ extends CommonBase {
         */
        public Result_NodeAnnouncementInfoDecodeErrorZ clone() {
                long ret = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_NodeAnnouncementInfoDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 628c6f5f7e54f299efebd8a57c6c9437abee474a..931ce33841e9fb9e75c1fdd88137adc001333034 100644 (file)
@@ -45,6 +45,7 @@ public class Result_NodeFeaturesDecodeErrorZ extends CommonBase {
         */
        public static Result_NodeFeaturesDecodeErrorZ ok(NodeFeatures o) {
                long ret = bindings.CResult_NodeFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_NodeFeaturesDecodeErrorZ ret_hu_conv = Result_NodeFeaturesDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_NodeFeaturesDecodeErrorZ extends CommonBase {
         */
        public static Result_NodeFeaturesDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_NodeFeaturesDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_NodeFeaturesDecodeErrorZ ret_hu_conv = Result_NodeFeaturesDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
index a864a3718031899fad14f942d312bed545d6b536..0b80d3d9243fc1ad526872586ea715a9044ec939 100644 (file)
@@ -45,6 +45,7 @@ public class Result_NodeInfoDecodeErrorZ extends CommonBase {
         */
        public static Result_NodeInfoDecodeErrorZ ok(NodeInfo o) {
                long ret = bindings.CResult_NodeInfoDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_NodeInfoDecodeErrorZ ret_hu_conv = Result_NodeInfoDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_NodeInfoDecodeErrorZ extends CommonBase {
         */
        public static Result_NodeInfoDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_NodeInfoDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_NodeInfoDecodeErrorZ ret_hu_conv = Result_NodeInfoDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_NodeInfoDecodeErrorZ extends CommonBase {
         */
        public Result_NodeInfoDecodeErrorZ clone() {
                long ret = bindings.CResult_NodeInfoDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_NodeInfoDecodeErrorZ ret_hu_conv = Result_NodeInfoDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 82ace246781404eaaa224c10552c46516131ccbd..3bd9049e0400aaaab7bf5b2dfe81c56c397beaee 100644 (file)
@@ -40,6 +40,7 @@ public class Result_NoneAPIErrorZ extends CommonBase {
         */
        public static Result_NoneAPIErrorZ ok() {
                long ret = bindings.CResult_NoneAPIErrorZ_ok();
+               if (ret < 1024) { return null; }
                Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -49,6 +50,7 @@ public class Result_NoneAPIErrorZ extends CommonBase {
         */
        public static Result_NoneAPIErrorZ err(APIError e) {
                long ret = bindings.CResult_NoneAPIErrorZ_err(e.ptr);
+               if (ret < 1024) { return null; }
                Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -59,6 +61,7 @@ public class Result_NoneAPIErrorZ extends CommonBase {
         */
        public Result_NoneAPIErrorZ clone() {
                long ret = bindings.CResult_NoneAPIErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index df21ffcdc9ca7a776080f74839eba1148c7f2966..f126ce63408c3691e211c94d93040d4ad9e503e5 100644 (file)
@@ -37,6 +37,7 @@ public class Result_NoneChannelMonitorUpdateErrZ extends CommonBase {
         */
        public static Result_NoneChannelMonitorUpdateErrZ ok() {
                long ret = bindings.CResult_NoneChannelMonitorUpdateErrZ_ok();
+               if (ret < 1024) { return null; }
                Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -46,6 +47,7 @@ public class Result_NoneChannelMonitorUpdateErrZ extends CommonBase {
         */
        public static Result_NoneChannelMonitorUpdateErrZ err(ChannelMonitorUpdateErr e) {
                long ret = bindings.CResult_NoneChannelMonitorUpdateErrZ_err(e);
+               if (ret < 1024) { return null; }
                Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -56,6 +58,7 @@ public class Result_NoneChannelMonitorUpdateErrZ extends CommonBase {
         */
        public Result_NoneChannelMonitorUpdateErrZ clone() {
                long ret = bindings.CResult_NoneChannelMonitorUpdateErrZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 533d2e06a447f041779646b1579504d875280f98..8c050f74f10a52e5519aeb5d664533374db017ee 100644 (file)
@@ -37,6 +37,7 @@ public class Result_NoneErrorZ extends CommonBase {
         */
        public static Result_NoneErrorZ ok() {
                long ret = bindings.CResult_NoneErrorZ_ok();
+               if (ret < 1024) { return null; }
                Result_NoneErrorZ ret_hu_conv = Result_NoneErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -46,6 +47,7 @@ public class Result_NoneErrorZ extends CommonBase {
         */
        public static Result_NoneErrorZ err(IOError e) {
                long ret = bindings.CResult_NoneErrorZ_err(e);
+               if (ret < 1024) { return null; }
                Result_NoneErrorZ ret_hu_conv = Result_NoneErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -56,6 +58,7 @@ public class Result_NoneErrorZ extends CommonBase {
         */
        public Result_NoneErrorZ clone() {
                long ret = bindings.CResult_NoneErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_NoneErrorZ ret_hu_conv = Result_NoneErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 57efa3270c89d0ffd9833ae23c1786284dc77f3c..c12eea949d940aacbd2cb1863eb2f8f9b8a16417 100644 (file)
@@ -40,6 +40,7 @@ public class Result_NoneLightningErrorZ extends CommonBase {
         */
        public static Result_NoneLightningErrorZ ok() {
                long ret = bindings.CResult_NoneLightningErrorZ_ok();
+               if (ret < 1024) { return null; }
                Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -49,6 +50,7 @@ public class Result_NoneLightningErrorZ extends CommonBase {
         */
        public static Result_NoneLightningErrorZ err(LightningError e) {
                long ret = bindings.CResult_NoneLightningErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -60,6 +62,7 @@ public class Result_NoneLightningErrorZ extends CommonBase {
         */
        public Result_NoneLightningErrorZ clone() {
                long ret = bindings.CResult_NoneLightningErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index ea7ded425250f2cc380440406648370d23b715d1..5b093b2af254b28c20838382caf173f1e166efb4 100644 (file)
@@ -40,6 +40,7 @@ public class Result_NoneMonitorUpdateErrorZ extends CommonBase {
         */
        public static Result_NoneMonitorUpdateErrorZ ok() {
                long ret = bindings.CResult_NoneMonitorUpdateErrorZ_ok();
+               if (ret < 1024) { return null; }
                Result_NoneMonitorUpdateErrorZ ret_hu_conv = Result_NoneMonitorUpdateErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -49,6 +50,7 @@ public class Result_NoneMonitorUpdateErrorZ extends CommonBase {
         */
        public static Result_NoneMonitorUpdateErrorZ err(MonitorUpdateError e) {
                long ret = bindings.CResult_NoneMonitorUpdateErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_NoneMonitorUpdateErrorZ ret_hu_conv = Result_NoneMonitorUpdateErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -60,6 +62,7 @@ public class Result_NoneMonitorUpdateErrorZ extends CommonBase {
         */
        public Result_NoneMonitorUpdateErrorZ clone() {
                long ret = bindings.CResult_NoneMonitorUpdateErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_NoneMonitorUpdateErrorZ ret_hu_conv = Result_NoneMonitorUpdateErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 977614dd7e48bd60c3dc71aba5265ed6a36ad21d..abcb55ee0ca0ff1875572db3b3ac451d649384cd 100644 (file)
@@ -40,6 +40,7 @@ public class Result_NonePaymentSendFailureZ extends CommonBase {
         */
        public static Result_NonePaymentSendFailureZ ok() {
                long ret = bindings.CResult_NonePaymentSendFailureZ_ok();
+               if (ret < 1024) { return null; }
                Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -49,6 +50,7 @@ public class Result_NonePaymentSendFailureZ extends CommonBase {
         */
        public static Result_NonePaymentSendFailureZ err(PaymentSendFailure e) {
                long ret = bindings.CResult_NonePaymentSendFailureZ_err(e.ptr);
+               if (ret < 1024) { return null; }
                Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -59,6 +61,7 @@ public class Result_NonePaymentSendFailureZ extends CommonBase {
         */
        public Result_NonePaymentSendFailureZ clone() {
                long ret = bindings.CResult_NonePaymentSendFailureZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 95f9c6a705d6228723286abc7c79a19c7b2843b5..c05d357a8a596d09ccde0780655b42420bdcd0b4 100644 (file)
@@ -40,6 +40,7 @@ public class Result_NonePeerHandleErrorZ extends CommonBase {
         */
        public static Result_NonePeerHandleErrorZ ok() {
                long ret = bindings.CResult_NonePeerHandleErrorZ_ok();
+               if (ret < 1024) { return null; }
                Result_NonePeerHandleErrorZ ret_hu_conv = Result_NonePeerHandleErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -49,6 +50,7 @@ public class Result_NonePeerHandleErrorZ extends CommonBase {
         */
        public static Result_NonePeerHandleErrorZ err(PeerHandleError e) {
                long ret = bindings.CResult_NonePeerHandleErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_NonePeerHandleErrorZ ret_hu_conv = Result_NonePeerHandleErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -60,6 +62,7 @@ public class Result_NonePeerHandleErrorZ extends CommonBase {
         */
        public Result_NonePeerHandleErrorZ clone() {
                long ret = bindings.CResult_NonePeerHandleErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_NonePeerHandleErrorZ ret_hu_conv = Result_NonePeerHandleErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 80f9537b90d50478e4763d0c653451fe2e7014e0..bed72c1a87c33d5b2d569a9cf9901390955d6bba 100644 (file)
@@ -37,6 +37,7 @@ public class Result_NoneSemanticErrorZ extends CommonBase {
         */
        public static Result_NoneSemanticErrorZ ok() {
                long ret = bindings.CResult_NoneSemanticErrorZ_ok();
+               if (ret < 1024) { return null; }
                Result_NoneSemanticErrorZ ret_hu_conv = Result_NoneSemanticErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -46,6 +47,7 @@ public class Result_NoneSemanticErrorZ extends CommonBase {
         */
        public static Result_NoneSemanticErrorZ err(SemanticError e) {
                long ret = bindings.CResult_NoneSemanticErrorZ_err(e);
+               if (ret < 1024) { return null; }
                Result_NoneSemanticErrorZ ret_hu_conv = Result_NoneSemanticErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -56,6 +58,7 @@ public class Result_NoneSemanticErrorZ extends CommonBase {
         */
        public Result_NoneSemanticErrorZ clone() {
                long ret = bindings.CResult_NoneSemanticErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_NoneSemanticErrorZ ret_hu_conv = Result_NoneSemanticErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 149a15f0a2e9df80d11b44d3614400c1468fa23d..0b7f8eed36453b5fd032b9ca136e5447557b6c87 100644 (file)
@@ -45,6 +45,7 @@ public class Result_OpenChannelDecodeErrorZ extends CommonBase {
         */
        public static Result_OpenChannelDecodeErrorZ ok(OpenChannel o) {
                long ret = bindings.CResult_OpenChannelDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_OpenChannelDecodeErrorZ ret_hu_conv = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_OpenChannelDecodeErrorZ extends CommonBase {
         */
        public static Result_OpenChannelDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_OpenChannelDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_OpenChannelDecodeErrorZ ret_hu_conv = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_OpenChannelDecodeErrorZ extends CommonBase {
         */
        public Result_OpenChannelDecodeErrorZ clone() {
                long ret = bindings.CResult_OpenChannelDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_OpenChannelDecodeErrorZ ret_hu_conv = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 4eb02c3b5c9aa9f35d1c80248945264a3fc8fb37..e346972e7ecf0486b74cfa873b5cfca9c335bd3d 100644 (file)
@@ -45,6 +45,7 @@ public class Result_OutPointDecodeErrorZ extends CommonBase {
         */
        public static Result_OutPointDecodeErrorZ ok(OutPoint o) {
                long ret = bindings.CResult_OutPointDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_OutPointDecodeErrorZ ret_hu_conv = Result_OutPointDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_OutPointDecodeErrorZ extends CommonBase {
         */
        public static Result_OutPointDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_OutPointDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_OutPointDecodeErrorZ ret_hu_conv = Result_OutPointDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_OutPointDecodeErrorZ extends CommonBase {
         */
        public Result_OutPointDecodeErrorZ clone() {
                long ret = bindings.CResult_OutPointDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_OutPointDecodeErrorZ ret_hu_conv = Result_OutPointDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 3f4ef2f63ce923019b7b5042e2479194ead151b4..f505ff368bd5ade0b311e5b30a92dbdad486e07e 100644 (file)
@@ -42,6 +42,7 @@ public class Result_PayeePubKeyErrorZ extends CommonBase {
         */
        public static Result_PayeePubKeyErrorZ ok(PayeePubKey o) {
                long ret = bindings.CResult_PayeePubKeyErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_PayeePubKeyErrorZ ret_hu_conv = Result_PayeePubKeyErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -52,6 +53,7 @@ public class Result_PayeePubKeyErrorZ extends CommonBase {
         */
        public static Result_PayeePubKeyErrorZ err(Secp256k1Error e) {
                long ret = bindings.CResult_PayeePubKeyErrorZ_err(e);
+               if (ret < 1024) { return null; }
                Result_PayeePubKeyErrorZ ret_hu_conv = Result_PayeePubKeyErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -62,6 +64,7 @@ public class Result_PayeePubKeyErrorZ extends CommonBase {
         */
        public Result_PayeePubKeyErrorZ clone() {
                long ret = bindings.CResult_PayeePubKeyErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_PayeePubKeyErrorZ ret_hu_conv = Result_PayeePubKeyErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
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 (file)
index 0000000..747eb84
--- /dev/null
@@ -0,0 +1,71 @@
+package org.ldk.structs;
+
+import org.ldk.impl.bindings;
+import org.ldk.enums.*;
+import org.ldk.util.*;
+import java.util.Arrays;
+
+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.LDKCResult_PaymentHashPaymentSendFailureZ_result_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.LDKCResult_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.LDKCResult_PaymentHashPaymentSendFailureZ_get_err(ptr);
+                       PaymentSendFailure err_hu_conv = PaymentSendFailure.constr_from_ptr(err);
+                       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(o);
+               if (ret < 1024) { 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(PaymentSendFailure e) {
+               long ret = bindings.CResult_PaymentHashPaymentSendFailureZ_err(e.ptr);
+               if (ret < 1024) { return null; }
+               Result_PaymentHashPaymentSendFailureZ ret_hu_conv = Result_PaymentHashPaymentSendFailureZ.constr_from_ptr(ret);
+               return ret_hu_conv;
+       }
+
+       /**
+        * 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);
+               if (ret < 1024) { return null; }
+               Result_PaymentHashPaymentSendFailureZ ret_hu_conv = Result_PaymentHashPaymentSendFailureZ.constr_from_ptr(ret);
+               return ret_hu_conv;
+       }
+
+}
index ce489271ae7a6f90bbb2efa07817567a44487b75..6da50736bba2d2e43860060cd92da4124b4833c5 100644 (file)
@@ -42,6 +42,7 @@ public class Result_PaymentSecretAPIErrorZ extends CommonBase {
         */
        public static Result_PaymentSecretAPIErrorZ ok(byte[] o) {
                long ret = bindings.CResult_PaymentSecretAPIErrorZ_ok(o);
+               if (ret < 1024) { return null; }
                Result_PaymentSecretAPIErrorZ ret_hu_conv = Result_PaymentSecretAPIErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -51,6 +52,7 @@ public class Result_PaymentSecretAPIErrorZ extends CommonBase {
         */
        public static Result_PaymentSecretAPIErrorZ err(APIError e) {
                long ret = bindings.CResult_PaymentSecretAPIErrorZ_err(e.ptr);
+               if (ret < 1024) { return null; }
                Result_PaymentSecretAPIErrorZ ret_hu_conv = Result_PaymentSecretAPIErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -61,6 +63,7 @@ public class Result_PaymentSecretAPIErrorZ extends CommonBase {
         */
        public Result_PaymentSecretAPIErrorZ clone() {
                long ret = bindings.CResult_PaymentSecretAPIErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_PaymentSecretAPIErrorZ ret_hu_conv = Result_PaymentSecretAPIErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 871d6a3afc77d12f67310917879f6f1dc801538f..acc27b831473fd5455c4100ee7b38d93b6fe27ed 100644 (file)
@@ -45,6 +45,7 @@ public class Result_PingDecodeErrorZ extends CommonBase {
         */
        public static Result_PingDecodeErrorZ ok(Ping o) {
                long ret = bindings.CResult_PingDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_PingDecodeErrorZ ret_hu_conv = Result_PingDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_PingDecodeErrorZ extends CommonBase {
         */
        public static Result_PingDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_PingDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_PingDecodeErrorZ ret_hu_conv = Result_PingDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_PingDecodeErrorZ extends CommonBase {
         */
        public Result_PingDecodeErrorZ clone() {
                long ret = bindings.CResult_PingDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_PingDecodeErrorZ ret_hu_conv = Result_PingDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index ce60e19e7d50ce594598fc5e1d3cee08e10a26fb..3bd21b783ae1b87a25d52309bebdbcc439baba4f 100644 (file)
@@ -45,6 +45,7 @@ public class Result_PongDecodeErrorZ extends CommonBase {
         */
        public static Result_PongDecodeErrorZ ok(Pong o) {
                long ret = bindings.CResult_PongDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_PongDecodeErrorZ ret_hu_conv = Result_PongDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_PongDecodeErrorZ extends CommonBase {
         */
        public static Result_PongDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_PongDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_PongDecodeErrorZ ret_hu_conv = Result_PongDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_PongDecodeErrorZ extends CommonBase {
         */
        public Result_PongDecodeErrorZ clone() {
                long ret = bindings.CResult_PongDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_PongDecodeErrorZ ret_hu_conv = Result_PongDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index a0c935bbded8f2338a4c56c9a7d9203420bbc68e..87a7a40c113a4debfe5c1f89c1cd6cc0a71d151b 100644 (file)
@@ -42,6 +42,7 @@ public class Result_PositiveTimestampCreationErrorZ extends CommonBase {
         */
        public static Result_PositiveTimestampCreationErrorZ ok(PositiveTimestamp o) {
                long ret = bindings.CResult_PositiveTimestampCreationErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_PositiveTimestampCreationErrorZ ret_hu_conv = Result_PositiveTimestampCreationErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -52,6 +53,7 @@ public class Result_PositiveTimestampCreationErrorZ extends CommonBase {
         */
        public static Result_PositiveTimestampCreationErrorZ err(CreationError e) {
                long ret = bindings.CResult_PositiveTimestampCreationErrorZ_err(e);
+               if (ret < 1024) { return null; }
                Result_PositiveTimestampCreationErrorZ ret_hu_conv = Result_PositiveTimestampCreationErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -62,6 +64,7 @@ public class Result_PositiveTimestampCreationErrorZ extends CommonBase {
         */
        public Result_PositiveTimestampCreationErrorZ clone() {
                long ret = bindings.CResult_PositiveTimestampCreationErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_PositiveTimestampCreationErrorZ ret_hu_conv = Result_PositiveTimestampCreationErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index c6d50d9d25f162b685536f83272ba49e36750822..379bc10161ecefdbcdca93e683839d8f7b858b77 100644 (file)
@@ -42,6 +42,7 @@ public class Result_PrivateRouteCreationErrorZ extends CommonBase {
         */
        public static Result_PrivateRouteCreationErrorZ ok(PrivateRoute o) {
                long ret = bindings.CResult_PrivateRouteCreationErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_PrivateRouteCreationErrorZ ret_hu_conv = Result_PrivateRouteCreationErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -52,6 +53,7 @@ public class Result_PrivateRouteCreationErrorZ extends CommonBase {
         */
        public static Result_PrivateRouteCreationErrorZ err(CreationError e) {
                long ret = bindings.CResult_PrivateRouteCreationErrorZ_err(e);
+               if (ret < 1024) { return null; }
                Result_PrivateRouteCreationErrorZ ret_hu_conv = Result_PrivateRouteCreationErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -62,6 +64,7 @@ public class Result_PrivateRouteCreationErrorZ extends CommonBase {
         */
        public Result_PrivateRouteCreationErrorZ clone() {
                long ret = bindings.CResult_PrivateRouteCreationErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_PrivateRouteCreationErrorZ ret_hu_conv = Result_PrivateRouteCreationErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index e633ee53a8ae9f1dd6e31f244848ed9e6d7b42af..f4148883a96b442c996f20365db54ed51dfe22cf 100644 (file)
@@ -39,6 +39,7 @@ public class Result_PublicKeyErrorZ extends CommonBase {
         */
        public static Result_PublicKeyErrorZ ok(byte[] o) {
                long ret = bindings.CResult_PublicKeyErrorZ_ok(o);
+               if (ret < 1024) { return null; }
                Result_PublicKeyErrorZ ret_hu_conv = Result_PublicKeyErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -48,6 +49,7 @@ public class Result_PublicKeyErrorZ extends CommonBase {
         */
        public static Result_PublicKeyErrorZ err(Secp256k1Error e) {
                long ret = bindings.CResult_PublicKeyErrorZ_err(e);
+               if (ret < 1024) { return null; }
                Result_PublicKeyErrorZ ret_hu_conv = Result_PublicKeyErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -58,6 +60,7 @@ public class Result_PublicKeyErrorZ extends CommonBase {
         */
        public Result_PublicKeyErrorZ clone() {
                long ret = bindings.CResult_PublicKeyErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_PublicKeyErrorZ ret_hu_conv = Result_PublicKeyErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 802f94a997665f17054ce94f8d1e3a1a40042d2b..a15b6a02625eeac49ca5565c6a9c2a0f6f6731b1 100644 (file)
@@ -45,6 +45,7 @@ public class Result_QueryChannelRangeDecodeErrorZ extends CommonBase {
         */
        public static Result_QueryChannelRangeDecodeErrorZ ok(QueryChannelRange o) {
                long ret = bindings.CResult_QueryChannelRangeDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_QueryChannelRangeDecodeErrorZ ret_hu_conv = Result_QueryChannelRangeDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_QueryChannelRangeDecodeErrorZ extends CommonBase {
         */
        public static Result_QueryChannelRangeDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_QueryChannelRangeDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_QueryChannelRangeDecodeErrorZ ret_hu_conv = Result_QueryChannelRangeDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_QueryChannelRangeDecodeErrorZ extends CommonBase {
         */
        public Result_QueryChannelRangeDecodeErrorZ clone() {
                long ret = bindings.CResult_QueryChannelRangeDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_QueryChannelRangeDecodeErrorZ ret_hu_conv = Result_QueryChannelRangeDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 0cab26739711eb56c85a436aa7a394365acc2cbc..ac64eece141e1c1e91fc57d9e888e57e1c698182 100644 (file)
@@ -45,6 +45,7 @@ public class Result_QueryShortChannelIdsDecodeErrorZ extends CommonBase {
         */
        public static Result_QueryShortChannelIdsDecodeErrorZ ok(QueryShortChannelIds o) {
                long ret = bindings.CResult_QueryShortChannelIdsDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_QueryShortChannelIdsDecodeErrorZ ret_hu_conv = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_QueryShortChannelIdsDecodeErrorZ extends CommonBase {
         */
        public static Result_QueryShortChannelIdsDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_QueryShortChannelIdsDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_QueryShortChannelIdsDecodeErrorZ ret_hu_conv = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_QueryShortChannelIdsDecodeErrorZ extends CommonBase {
         */
        public Result_QueryShortChannelIdsDecodeErrorZ clone() {
                long ret = bindings.CResult_QueryShortChannelIdsDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_QueryShortChannelIdsDecodeErrorZ ret_hu_conv = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index ebe4c6eff9936865add04c92a93367fc0882612c..3d10fad60ba9cbf44d60a1deaa1ff60ac5576db9 100644 (file)
@@ -37,6 +37,7 @@ public class Result_RecoverableSignatureNoneZ extends CommonBase {
         */
        public static Result_RecoverableSignatureNoneZ ok(byte[] arg) {
                long ret = bindings.CResult_RecoverableSignatureNoneZ_ok(arg);
+               if (ret < 1024) { return null; }
                Result_RecoverableSignatureNoneZ ret_hu_conv = Result_RecoverableSignatureNoneZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -46,6 +47,7 @@ public class Result_RecoverableSignatureNoneZ extends CommonBase {
         */
        public static Result_RecoverableSignatureNoneZ err() {
                long ret = bindings.CResult_RecoverableSignatureNoneZ_err();
+               if (ret < 1024) { return null; }
                Result_RecoverableSignatureNoneZ ret_hu_conv = Result_RecoverableSignatureNoneZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -56,6 +58,7 @@ public class Result_RecoverableSignatureNoneZ extends CommonBase {
         */
        public Result_RecoverableSignatureNoneZ clone() {
                long ret = bindings.CResult_RecoverableSignatureNoneZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_RecoverableSignatureNoneZ ret_hu_conv = Result_RecoverableSignatureNoneZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 40eb3053744963775e3fdc362977878b08fb4994..8e304d2f40dfdeabbe09d424783aaafa7e32691a 100644 (file)
@@ -45,6 +45,7 @@ public class Result_ReplyChannelRangeDecodeErrorZ extends CommonBase {
         */
        public static Result_ReplyChannelRangeDecodeErrorZ ok(ReplyChannelRange o) {
                long ret = bindings.CResult_ReplyChannelRangeDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_ReplyChannelRangeDecodeErrorZ ret_hu_conv = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_ReplyChannelRangeDecodeErrorZ extends CommonBase {
         */
        public static Result_ReplyChannelRangeDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_ReplyChannelRangeDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_ReplyChannelRangeDecodeErrorZ ret_hu_conv = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_ReplyChannelRangeDecodeErrorZ extends CommonBase {
         */
        public Result_ReplyChannelRangeDecodeErrorZ clone() {
                long ret = bindings.CResult_ReplyChannelRangeDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_ReplyChannelRangeDecodeErrorZ ret_hu_conv = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 5e19c47a2f6a87ac5060b690a2d401960d35c4cd..71f2ba45059d2d15254edc40f453b3573b41a9d8 100644 (file)
@@ -45,6 +45,7 @@ public class Result_ReplyShortChannelIdsEndDecodeErrorZ extends CommonBase {
         */
        public static Result_ReplyShortChannelIdsEndDecodeErrorZ ok(ReplyShortChannelIdsEnd o) {
                long ret = bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_ReplyShortChannelIdsEndDecodeErrorZ ret_hu_conv = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_ReplyShortChannelIdsEndDecodeErrorZ extends CommonBase {
         */
        public static Result_ReplyShortChannelIdsEndDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_ReplyShortChannelIdsEndDecodeErrorZ ret_hu_conv = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_ReplyShortChannelIdsEndDecodeErrorZ extends CommonBase {
         */
        public Result_ReplyShortChannelIdsEndDecodeErrorZ clone() {
                long ret = bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_ReplyShortChannelIdsEndDecodeErrorZ ret_hu_conv = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 4253c0a93f159cc0e49745f42515deaf9a81fa3b..220c915026b834a912a91102ecc7647ac5ac1832 100644 (file)
@@ -45,6 +45,7 @@ public class Result_RevokeAndACKDecodeErrorZ extends CommonBase {
         */
        public static Result_RevokeAndACKDecodeErrorZ ok(RevokeAndACK o) {
                long ret = bindings.CResult_RevokeAndACKDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_RevokeAndACKDecodeErrorZ ret_hu_conv = Result_RevokeAndACKDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_RevokeAndACKDecodeErrorZ extends CommonBase {
         */
        public static Result_RevokeAndACKDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_RevokeAndACKDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_RevokeAndACKDecodeErrorZ ret_hu_conv = Result_RevokeAndACKDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_RevokeAndACKDecodeErrorZ extends CommonBase {
         */
        public Result_RevokeAndACKDecodeErrorZ clone() {
                long ret = bindings.CResult_RevokeAndACKDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_RevokeAndACKDecodeErrorZ ret_hu_conv = Result_RevokeAndACKDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 34801154197de2030a4798f44a59eff639603336..255b3ab7e5ee94e6a594229388844315c3ae44e6 100644 (file)
@@ -45,6 +45,7 @@ public class Result_RouteDecodeErrorZ extends CommonBase {
         */
        public static Result_RouteDecodeErrorZ ok(Route o) {
                long ret = bindings.CResult_RouteDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_RouteDecodeErrorZ ret_hu_conv = Result_RouteDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_RouteDecodeErrorZ extends CommonBase {
         */
        public static Result_RouteDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_RouteDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_RouteDecodeErrorZ ret_hu_conv = Result_RouteDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_RouteDecodeErrorZ extends CommonBase {
         */
        public Result_RouteDecodeErrorZ clone() {
                long ret = bindings.CResult_RouteDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_RouteDecodeErrorZ ret_hu_conv = Result_RouteDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 0dc4faeb4cd84aad6b987cffe9b75993333a9208..409cf23777b82f1f68ee6b979df080a4b778699a 100644 (file)
@@ -45,6 +45,7 @@ public class Result_RouteHopDecodeErrorZ extends CommonBase {
         */
        public static Result_RouteHopDecodeErrorZ ok(RouteHop o) {
                long ret = bindings.CResult_RouteHopDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_RouteHopDecodeErrorZ ret_hu_conv = Result_RouteHopDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_RouteHopDecodeErrorZ extends CommonBase {
         */
        public static Result_RouteHopDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_RouteHopDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_RouteHopDecodeErrorZ ret_hu_conv = Result_RouteHopDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_RouteHopDecodeErrorZ extends CommonBase {
         */
        public Result_RouteHopDecodeErrorZ clone() {
                long ret = bindings.CResult_RouteHopDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_RouteHopDecodeErrorZ ret_hu_conv = Result_RouteHopDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index f6a02435b92e454a47a160a00b64125cf82d6771..677b95ee99e87d741e44ad0a87625e2e926c6d85 100644 (file)
@@ -45,6 +45,7 @@ public class Result_RouteLightningErrorZ extends CommonBase {
         */
        public static Result_RouteLightningErrorZ ok(Route o) {
                long ret = bindings.CResult_RouteLightningErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_RouteLightningErrorZ extends CommonBase {
         */
        public static Result_RouteLightningErrorZ err(LightningError e) {
                long ret = bindings.CResult_RouteLightningErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_RouteLightningErrorZ extends CommonBase {
         */
        public Result_RouteLightningErrorZ clone() {
                long ret = bindings.CResult_RouteLightningErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 335f379a15b3e17f3d6466b46f6fbc05828620bb..f30667aa0a4b81cce8c6e5189cfd3bb840f03124 100644 (file)
@@ -45,6 +45,7 @@ public class Result_RoutingFeesDecodeErrorZ extends CommonBase {
         */
        public static Result_RoutingFeesDecodeErrorZ ok(RoutingFees o) {
                long ret = bindings.CResult_RoutingFeesDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_RoutingFeesDecodeErrorZ ret_hu_conv = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_RoutingFeesDecodeErrorZ extends CommonBase {
         */
        public static Result_RoutingFeesDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_RoutingFeesDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_RoutingFeesDecodeErrorZ ret_hu_conv = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_RoutingFeesDecodeErrorZ extends CommonBase {
         */
        public Result_RoutingFeesDecodeErrorZ clone() {
                long ret = bindings.CResult_RoutingFeesDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_RoutingFeesDecodeErrorZ ret_hu_conv = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 83e0574c01e0a7afee1402af0a416363159412ee..aada0a150e5df7d0c727c4464d2244d6c9cd7085 100644 (file)
@@ -39,6 +39,7 @@ public class Result_SecretKeyErrorZ extends CommonBase {
         */
        public static Result_SecretKeyErrorZ ok(byte[] o) {
                long ret = bindings.CResult_SecretKeyErrorZ_ok(o);
+               if (ret < 1024) { return null; }
                Result_SecretKeyErrorZ ret_hu_conv = Result_SecretKeyErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -48,6 +49,7 @@ public class Result_SecretKeyErrorZ extends CommonBase {
         */
        public static Result_SecretKeyErrorZ err(Secp256k1Error e) {
                long ret = bindings.CResult_SecretKeyErrorZ_err(e);
+               if (ret < 1024) { return null; }
                Result_SecretKeyErrorZ ret_hu_conv = Result_SecretKeyErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 15b23462dd0196436d83c101d5aed7429a6f4068..06d5cf9bd01f1af407120ffdd5b3ec78d2d1fc59 100644 (file)
@@ -45,6 +45,7 @@ public class Result_ShutdownDecodeErrorZ extends CommonBase {
         */
        public static Result_ShutdownDecodeErrorZ ok(Shutdown o) {
                long ret = bindings.CResult_ShutdownDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_ShutdownDecodeErrorZ ret_hu_conv = Result_ShutdownDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_ShutdownDecodeErrorZ extends CommonBase {
         */
        public static Result_ShutdownDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_ShutdownDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_ShutdownDecodeErrorZ ret_hu_conv = Result_ShutdownDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_ShutdownDecodeErrorZ extends CommonBase {
         */
        public Result_ShutdownDecodeErrorZ clone() {
                long ret = bindings.CResult_ShutdownDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_ShutdownDecodeErrorZ ret_hu_conv = Result_ShutdownDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index a49e15c6f246d0d8462766ee5677e401af2d1dcc..a2fd6b7c09659221c1b6e6943b913dee1cb099de 100644 (file)
@@ -37,6 +37,7 @@ public class Result_SiPrefixNoneZ extends CommonBase {
         */
        public static Result_SiPrefixNoneZ ok(SiPrefix o) {
                long ret = bindings.CResult_SiPrefixNoneZ_ok(o);
+               if (ret < 1024) { return null; }
                Result_SiPrefixNoneZ ret_hu_conv = Result_SiPrefixNoneZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -46,6 +47,7 @@ public class Result_SiPrefixNoneZ extends CommonBase {
         */
        public static Result_SiPrefixNoneZ err() {
                long ret = bindings.CResult_SiPrefixNoneZ_err();
+               if (ret < 1024) { return null; }
                Result_SiPrefixNoneZ ret_hu_conv = Result_SiPrefixNoneZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -56,6 +58,7 @@ public class Result_SiPrefixNoneZ extends CommonBase {
         */
        public Result_SiPrefixNoneZ clone() {
                long ret = bindings.CResult_SiPrefixNoneZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_SiPrefixNoneZ ret_hu_conv = Result_SiPrefixNoneZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 0652b9f250b09cb344e6f06a78ff44926cfc67f6..8d25f8b77ad73549294ef3eea43c4cbfd228f8bc 100644 (file)
@@ -45,6 +45,7 @@ public class Result_SignDecodeErrorZ extends CommonBase {
         */
        public static Result_SignDecodeErrorZ ok(Sign o) {
                long ret = bindings.CResult_SignDecodeErrorZ_ok(o == null ? 0 : o.ptr);
+               if (ret < 1024) { return null; }
                Result_SignDecodeErrorZ ret_hu_conv = Result_SignDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_SignDecodeErrorZ extends CommonBase {
         */
        public static Result_SignDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_SignDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_SignDecodeErrorZ ret_hu_conv = Result_SignDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_SignDecodeErrorZ extends CommonBase {
         */
        public Result_SignDecodeErrorZ clone() {
                long ret = bindings.CResult_SignDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_SignDecodeErrorZ ret_hu_conv = Result_SignDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 249d58dc137c857b49a1120b9056881a4c758bdb..62f3694cf15b66924586b62dd46d57da13de8808 100644 (file)
@@ -37,6 +37,7 @@ public class Result_SignatureNoneZ extends CommonBase {
         */
        public static Result_SignatureNoneZ ok(byte[] o) {
                long ret = bindings.CResult_SignatureNoneZ_ok(o);
+               if (ret < 1024) { return null; }
                Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -46,6 +47,7 @@ public class Result_SignatureNoneZ extends CommonBase {
         */
        public static Result_SignatureNoneZ err() {
                long ret = bindings.CResult_SignatureNoneZ_err();
+               if (ret < 1024) { return null; }
                Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -56,6 +58,7 @@ public class Result_SignatureNoneZ extends CommonBase {
         */
        public Result_SignatureNoneZ clone() {
                long ret = bindings.CResult_SignatureNoneZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index ce9c9286089d29f820034bd1461c20601a20f1c0..4442416f2909596b7d8c2bf9580c9bce9f53289c 100644 (file)
@@ -40,6 +40,7 @@ public class Result_SignedRawInvoiceNoneZ extends CommonBase {
         */
        public static Result_SignedRawInvoiceNoneZ ok(SignedRawInvoice o) {
                long ret = bindings.CResult_SignedRawInvoiceNoneZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_SignedRawInvoiceNoneZ ret_hu_conv = Result_SignedRawInvoiceNoneZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -50,6 +51,7 @@ public class Result_SignedRawInvoiceNoneZ extends CommonBase {
         */
        public static Result_SignedRawInvoiceNoneZ err() {
                long ret = bindings.CResult_SignedRawInvoiceNoneZ_err();
+               if (ret < 1024) { return null; }
                Result_SignedRawInvoiceNoneZ ret_hu_conv = Result_SignedRawInvoiceNoneZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -60,6 +62,7 @@ public class Result_SignedRawInvoiceNoneZ extends CommonBase {
         */
        public Result_SignedRawInvoiceNoneZ clone() {
                long ret = bindings.CResult_SignedRawInvoiceNoneZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_SignedRawInvoiceNoneZ ret_hu_conv = Result_SignedRawInvoiceNoneZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 176034af01b8d979b101aee87cbe884335325ba8..46ce0743e3f20aba007664610ac934d708ed815a 100644 (file)
@@ -45,6 +45,7 @@ public class Result_SpendableOutputDescriptorDecodeErrorZ extends CommonBase {
         */
        public static Result_SpendableOutputDescriptorDecodeErrorZ ok(SpendableOutputDescriptor o) {
                long ret = bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_ok(o.ptr);
+               if (ret < 1024) { return null; }
                Result_SpendableOutputDescriptorDecodeErrorZ ret_hu_conv = Result_SpendableOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -54,6 +55,7 @@ public class Result_SpendableOutputDescriptorDecodeErrorZ extends CommonBase {
         */
        public static Result_SpendableOutputDescriptorDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_SpendableOutputDescriptorDecodeErrorZ ret_hu_conv = Result_SpendableOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -65,6 +67,7 @@ public class Result_SpendableOutputDescriptorDecodeErrorZ extends CommonBase {
         */
        public Result_SpendableOutputDescriptorDecodeErrorZ clone() {
                long ret = bindings.CResult_SpendableOutputDescriptorDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_SpendableOutputDescriptorDecodeErrorZ ret_hu_conv = Result_SpendableOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index f0ab215b2d422c004b0d4d4e530cdfc0e32aa2b3..8f53086f04e224f522ac3c7a25285431dd47f40b 100644 (file)
@@ -45,6 +45,7 @@ public class Result_StaticPaymentOutputDescriptorDecodeErrorZ extends CommonBase
         */
        public static Result_StaticPaymentOutputDescriptorDecodeErrorZ ok(StaticPaymentOutputDescriptor o) {
                long ret = bindings.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_StaticPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_StaticPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_StaticPaymentOutputDescriptorDecodeErrorZ extends CommonBase
         */
        public static Result_StaticPaymentOutputDescriptorDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_StaticPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_StaticPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_StaticPaymentOutputDescriptorDecodeErrorZ extends CommonBase
         */
        public Result_StaticPaymentOutputDescriptorDecodeErrorZ clone() {
                long ret = bindings.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_StaticPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_StaticPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 9d5e14bebc89e5cd3e108cd58bb8b0545ac3e204..e0c95e1ec55c4442a808f1e8b70ef4a37db6f8ce 100644 (file)
@@ -39,6 +39,7 @@ public class Result_StringErrorZ extends CommonBase {
         */
        public static Result_StringErrorZ ok(String o) {
                long ret = bindings.CResult_StringErrorZ_ok(o);
+               if (ret < 1024) { return null; }
                Result_StringErrorZ ret_hu_conv = Result_StringErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -48,6 +49,7 @@ public class Result_StringErrorZ extends CommonBase {
         */
        public static Result_StringErrorZ err(Secp256k1Error e) {
                long ret = bindings.CResult_StringErrorZ_err(e);
+               if (ret < 1024) { return null; }
                Result_StringErrorZ ret_hu_conv = Result_StringErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 97ab5b0dad8f23377af3c50f5eb263e60a23cc16..cc466a5d1c60b52b54600b3652a0b4b10d8f51b6 100644 (file)
@@ -37,6 +37,7 @@ public class Result_TransactionNoneZ extends CommonBase {
         */
        public static Result_TransactionNoneZ ok(byte[] o) {
                long ret = bindings.CResult_TransactionNoneZ_ok(o);
+               if (ret < 1024) { return null; }
                Result_TransactionNoneZ ret_hu_conv = Result_TransactionNoneZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -46,6 +47,7 @@ public class Result_TransactionNoneZ extends CommonBase {
         */
        public static Result_TransactionNoneZ err() {
                long ret = bindings.CResult_TransactionNoneZ_err();
+               if (ret < 1024) { return null; }
                Result_TransactionNoneZ ret_hu_conv = Result_TransactionNoneZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -56,6 +58,7 @@ public class Result_TransactionNoneZ extends CommonBase {
         */
        public Result_TransactionNoneZ clone() {
                long ret = bindings.CResult_TransactionNoneZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_TransactionNoneZ ret_hu_conv = Result_TransactionNoneZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 7c00f3a00f08981d2160bcdb298d7e5e4811af18..d11fe7bfffaed506f0f83050f2e06697b008dc9a 100644 (file)
@@ -40,6 +40,7 @@ public class Result_TrustedCommitmentTransactionNoneZ extends CommonBase {
         */
        public static Result_TrustedCommitmentTransactionNoneZ ok(TrustedCommitmentTransaction o) {
                long ret = bindings.CResult_TrustedCommitmentTransactionNoneZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_TrustedCommitmentTransactionNoneZ ret_hu_conv = Result_TrustedCommitmentTransactionNoneZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                // Due to rust's strict-ownership memory model, in some cases we need to "move"
@@ -58,6 +59,7 @@ public class Result_TrustedCommitmentTransactionNoneZ extends CommonBase {
         */
        public static Result_TrustedCommitmentTransactionNoneZ err() {
                long ret = bindings.CResult_TrustedCommitmentTransactionNoneZ_err();
+               if (ret < 1024) { return null; }
                Result_TrustedCommitmentTransactionNoneZ ret_hu_conv = Result_TrustedCommitmentTransactionNoneZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 290b26c8437349ee57d1c47347713ce781e70fe9..f4051c3449c8d0ff2959fc3bc605778c3fa5c9b6 100644 (file)
@@ -45,6 +45,7 @@ public class Result_TxCreationKeysDecodeErrorZ extends CommonBase {
         */
        public static Result_TxCreationKeysDecodeErrorZ ok(TxCreationKeys o) {
                long ret = bindings.CResult_TxCreationKeysDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_TxCreationKeysDecodeErrorZ ret_hu_conv = Result_TxCreationKeysDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_TxCreationKeysDecodeErrorZ extends CommonBase {
         */
        public static Result_TxCreationKeysDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_TxCreationKeysDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_TxCreationKeysDecodeErrorZ ret_hu_conv = Result_TxCreationKeysDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_TxCreationKeysDecodeErrorZ extends CommonBase {
         */
        public Result_TxCreationKeysDecodeErrorZ clone() {
                long ret = bindings.CResult_TxCreationKeysDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_TxCreationKeysDecodeErrorZ ret_hu_conv = Result_TxCreationKeysDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 1ca1d7c22fa96cdd5d0dec3857ec43336307650e..188594f1b04a959c2c207764628d315432709d7d 100644 (file)
@@ -42,6 +42,7 @@ public class Result_TxCreationKeysErrorZ extends CommonBase {
         */
        public static Result_TxCreationKeysErrorZ ok(TxCreationKeys o) {
                long ret = bindings.CResult_TxCreationKeysErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_TxCreationKeysErrorZ ret_hu_conv = Result_TxCreationKeysErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -52,6 +53,7 @@ public class Result_TxCreationKeysErrorZ extends CommonBase {
         */
        public static Result_TxCreationKeysErrorZ err(Secp256k1Error e) {
                long ret = bindings.CResult_TxCreationKeysErrorZ_err(e);
+               if (ret < 1024) { return null; }
                Result_TxCreationKeysErrorZ ret_hu_conv = Result_TxCreationKeysErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -62,6 +64,7 @@ public class Result_TxCreationKeysErrorZ extends CommonBase {
         */
        public Result_TxCreationKeysErrorZ clone() {
                long ret = bindings.CResult_TxCreationKeysErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_TxCreationKeysErrorZ ret_hu_conv = Result_TxCreationKeysErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index bbea0020b48f98a13a5726566f38cc94d328d979..9e7b85d44d46d341bf881609147da8462d4340ee 100644 (file)
@@ -41,6 +41,7 @@ public class Result_TxOutAccessErrorZ extends CommonBase {
         */
        public static Result_TxOutAccessErrorZ ok(TxOut o) {
                long ret = bindings.CResult_TxOutAccessErrorZ_ok(o.ptr);
+               if (ret < 1024) { return null; }
                Result_TxOutAccessErrorZ ret_hu_conv = Result_TxOutAccessErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -50,6 +51,7 @@ public class Result_TxOutAccessErrorZ extends CommonBase {
         */
        public static Result_TxOutAccessErrorZ err(AccessError e) {
                long ret = bindings.CResult_TxOutAccessErrorZ_err(e);
+               if (ret < 1024) { return null; }
                Result_TxOutAccessErrorZ ret_hu_conv = Result_TxOutAccessErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -60,6 +62,7 @@ public class Result_TxOutAccessErrorZ extends CommonBase {
         */
        public Result_TxOutAccessErrorZ clone() {
                long ret = bindings.CResult_TxOutAccessErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_TxOutAccessErrorZ ret_hu_conv = Result_TxOutAccessErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index cccee3c61c1a71825c9eaf7d8e3292209e6a29c7..2c5a39487eb0067e165f9cd85ea63e32d424448d 100644 (file)
@@ -45,6 +45,7 @@ public class Result_UnsignedChannelAnnouncementDecodeErrorZ extends CommonBase {
         */
        public static Result_UnsignedChannelAnnouncementDecodeErrorZ ok(UnsignedChannelAnnouncement o) {
                long ret = bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_UnsignedChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_UnsignedChannelAnnouncementDecodeErrorZ extends CommonBase {
         */
        public static Result_UnsignedChannelAnnouncementDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_UnsignedChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_UnsignedChannelAnnouncementDecodeErrorZ extends CommonBase {
         */
        public Result_UnsignedChannelAnnouncementDecodeErrorZ clone() {
                long ret = bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_UnsignedChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 902aecb210f95b887e366fbc26163afa86d17338..a9ca0b326534ced1cd9c1d7c157b9a967f4557ad 100644 (file)
@@ -45,6 +45,7 @@ public class Result_UnsignedChannelUpdateDecodeErrorZ extends CommonBase {
         */
        public static Result_UnsignedChannelUpdateDecodeErrorZ ok(UnsignedChannelUpdate o) {
                long ret = bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_UnsignedChannelUpdateDecodeErrorZ ret_hu_conv = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_UnsignedChannelUpdateDecodeErrorZ extends CommonBase {
         */
        public static Result_UnsignedChannelUpdateDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_UnsignedChannelUpdateDecodeErrorZ ret_hu_conv = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_UnsignedChannelUpdateDecodeErrorZ extends CommonBase {
         */
        public Result_UnsignedChannelUpdateDecodeErrorZ clone() {
                long ret = bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_UnsignedChannelUpdateDecodeErrorZ ret_hu_conv = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index f2b453786c6523034326859a496918cf11a2f503..248f2ea9e32352eb0f767fd64f56c6ffb60b8ce5 100644 (file)
@@ -45,6 +45,7 @@ public class Result_UnsignedNodeAnnouncementDecodeErrorZ extends CommonBase {
         */
        public static Result_UnsignedNodeAnnouncementDecodeErrorZ ok(UnsignedNodeAnnouncement o) {
                long ret = bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_UnsignedNodeAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_UnsignedNodeAnnouncementDecodeErrorZ extends CommonBase {
         */
        public static Result_UnsignedNodeAnnouncementDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_UnsignedNodeAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_UnsignedNodeAnnouncementDecodeErrorZ extends CommonBase {
         */
        public Result_UnsignedNodeAnnouncementDecodeErrorZ clone() {
                long ret = bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_UnsignedNodeAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 20d44b13e0883f5a73aa486f3b7d07fa7b86ec3c..d7b8d8dd1474a672e01eee7e0984598b46517fc5 100644 (file)
@@ -45,6 +45,7 @@ public class Result_UpdateAddHTLCDecodeErrorZ extends CommonBase {
         */
        public static Result_UpdateAddHTLCDecodeErrorZ ok(UpdateAddHTLC o) {
                long ret = bindings.CResult_UpdateAddHTLCDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_UpdateAddHTLCDecodeErrorZ ret_hu_conv = Result_UpdateAddHTLCDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_UpdateAddHTLCDecodeErrorZ extends CommonBase {
         */
        public static Result_UpdateAddHTLCDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_UpdateAddHTLCDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_UpdateAddHTLCDecodeErrorZ ret_hu_conv = Result_UpdateAddHTLCDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_UpdateAddHTLCDecodeErrorZ extends CommonBase {
         */
        public Result_UpdateAddHTLCDecodeErrorZ clone() {
                long ret = bindings.CResult_UpdateAddHTLCDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_UpdateAddHTLCDecodeErrorZ ret_hu_conv = Result_UpdateAddHTLCDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 6ae81f16e0ab892c8e193b0a9276ec974ea1868b..f56b045473e15a5a57637a640a7b30c37a271e92 100644 (file)
@@ -45,6 +45,7 @@ public class Result_UpdateFailHTLCDecodeErrorZ extends CommonBase {
         */
        public static Result_UpdateFailHTLCDecodeErrorZ ok(UpdateFailHTLC o) {
                long ret = bindings.CResult_UpdateFailHTLCDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_UpdateFailHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailHTLCDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_UpdateFailHTLCDecodeErrorZ extends CommonBase {
         */
        public static Result_UpdateFailHTLCDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_UpdateFailHTLCDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_UpdateFailHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailHTLCDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_UpdateFailHTLCDecodeErrorZ extends CommonBase {
         */
        public Result_UpdateFailHTLCDecodeErrorZ clone() {
                long ret = bindings.CResult_UpdateFailHTLCDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_UpdateFailHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailHTLCDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 69b3cb6d3903822bad09b9f278d9a640117354ed..df6d5879414733682a1305ecde48a8a5598cc6e2 100644 (file)
@@ -45,6 +45,7 @@ public class Result_UpdateFailMalformedHTLCDecodeErrorZ extends CommonBase {
         */
        public static Result_UpdateFailMalformedHTLCDecodeErrorZ ok(UpdateFailMalformedHTLC o) {
                long ret = bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_UpdateFailMalformedHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailMalformedHTLCDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_UpdateFailMalformedHTLCDecodeErrorZ extends CommonBase {
         */
        public static Result_UpdateFailMalformedHTLCDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_UpdateFailMalformedHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailMalformedHTLCDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_UpdateFailMalformedHTLCDecodeErrorZ extends CommonBase {
         */
        public Result_UpdateFailMalformedHTLCDecodeErrorZ clone() {
                long ret = bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_UpdateFailMalformedHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailMalformedHTLCDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 1200e14e8534aaf5eadc98d140e3471216e28a24..330a8b3e395bab34fb609cd79bcb5644a7cd534b 100644 (file)
@@ -45,6 +45,7 @@ public class Result_UpdateFeeDecodeErrorZ extends CommonBase {
         */
        public static Result_UpdateFeeDecodeErrorZ ok(UpdateFee o) {
                long ret = bindings.CResult_UpdateFeeDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_UpdateFeeDecodeErrorZ ret_hu_conv = Result_UpdateFeeDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_UpdateFeeDecodeErrorZ extends CommonBase {
         */
        public static Result_UpdateFeeDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_UpdateFeeDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_UpdateFeeDecodeErrorZ ret_hu_conv = Result_UpdateFeeDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_UpdateFeeDecodeErrorZ extends CommonBase {
         */
        public Result_UpdateFeeDecodeErrorZ clone() {
                long ret = bindings.CResult_UpdateFeeDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_UpdateFeeDecodeErrorZ ret_hu_conv = Result_UpdateFeeDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 58be905223c01509e6e493a6cb59fd7c42352c20..db6a89d826080e1dd621ce6fa18d9a7c96a50ade 100644 (file)
@@ -45,6 +45,7 @@ public class Result_UpdateFulfillHTLCDecodeErrorZ extends CommonBase {
         */
        public static Result_UpdateFulfillHTLCDecodeErrorZ ok(UpdateFulfillHTLC o) {
                long ret = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_ok(o == null ? 0 : o.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_UpdateFulfillHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFulfillHTLCDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(o);
                return ret_hu_conv;
@@ -55,6 +56,7 @@ public class Result_UpdateFulfillHTLCDecodeErrorZ extends CommonBase {
         */
        public static Result_UpdateFulfillHTLCDecodeErrorZ err(DecodeError e) {
                long ret = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_UpdateFulfillHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFulfillHTLCDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Result_UpdateFulfillHTLCDecodeErrorZ extends CommonBase {
         */
        public Result_UpdateFulfillHTLCDecodeErrorZ clone() {
                long ret = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_UpdateFulfillHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFulfillHTLCDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 60571a14952fe0196d7ba60532c2af172b20162b..fb74d3c9dafb8dcaad11c4f8a5fa618ae31f0ddb 100644 (file)
@@ -42,6 +42,7 @@ public class Result_boolLightningErrorZ extends CommonBase {
         */
        public static Result_boolLightningErrorZ ok(boolean o) {
                long ret = bindings.CResult_boolLightningErrorZ_ok(o);
+               if (ret < 1024) { return null; }
                Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -51,6 +52,7 @@ public class Result_boolLightningErrorZ extends CommonBase {
         */
        public static Result_boolLightningErrorZ err(LightningError e) {
                long ret = bindings.CResult_boolLightningErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -62,6 +64,7 @@ public class Result_boolLightningErrorZ extends CommonBase {
         */
        public Result_boolLightningErrorZ clone() {
                long ret = bindings.CResult_boolLightningErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index cbcedfb233c1bcafb3c6c2391f586a3a9b3ea0f6..54d940179aed30db0f460b48b51d946c42a5f3b6 100644 (file)
@@ -42,6 +42,7 @@ public class Result_boolPeerHandleErrorZ extends CommonBase {
         */
        public static Result_boolPeerHandleErrorZ ok(boolean o) {
                long ret = bindings.CResult_boolPeerHandleErrorZ_ok(o);
+               if (ret < 1024) { return null; }
                Result_boolPeerHandleErrorZ ret_hu_conv = Result_boolPeerHandleErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -51,6 +52,7 @@ public class Result_boolPeerHandleErrorZ extends CommonBase {
         */
        public static Result_boolPeerHandleErrorZ err(PeerHandleError e) {
                long ret = bindings.CResult_boolPeerHandleErrorZ_err(e == null ? 0 : e.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_boolPeerHandleErrorZ ret_hu_conv = Result_boolPeerHandleErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(e);
                return ret_hu_conv;
@@ -62,6 +64,7 @@ public class Result_boolPeerHandleErrorZ extends CommonBase {
         */
        public Result_boolPeerHandleErrorZ clone() {
                long ret = bindings.CResult_boolPeerHandleErrorZ_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Result_boolPeerHandleErrorZ ret_hu_conv = Result_boolPeerHandleErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 0ca324c0a05aadd5d3f31d70cd900d336f7b2e92..5de9ff6fc79195f913334e0239e550b9cc072f51 100644 (file)
@@ -68,6 +68,7 @@ public class RevokeAndACK extends CommonBase {
         */
        public static RevokeAndACK of(byte[] channel_id_arg, byte[] per_commitment_secret_arg, byte[] next_per_commitment_point_arg) {
                long ret = bindings.RevokeAndACK_new(channel_id_arg, per_commitment_secret_arg, next_per_commitment_point_arg);
+               if (ret < 1024) { return null; }
                RevokeAndACK ret_hu_conv = new RevokeAndACK(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -78,6 +79,7 @@ public class RevokeAndACK extends CommonBase {
         */
        public RevokeAndACK clone() {
                long ret = bindings.RevokeAndACK_clone(this.ptr);
+               if (ret < 1024) { return null; }
                RevokeAndACK ret_hu_conv = new RevokeAndACK(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -96,6 +98,7 @@ public class RevokeAndACK extends CommonBase {
         */
        public static Result_RevokeAndACKDecodeErrorZ read(byte[] ser) {
                long ret = bindings.RevokeAndACK_read(ser);
+               if (ret < 1024) { return null; }
                Result_RevokeAndACKDecodeErrorZ ret_hu_conv = Result_RevokeAndACKDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 7c4e8275b4b6c0fb30305dc8e8bb00d15c47ac84..fb2c53a46076f8c91ca8c05cfa945411ec04e30e 100644 (file)
@@ -37,6 +37,7 @@ public class Route extends CommonBase {
         */
        public static Route of(RouteHop[][] paths_arg) {
                long ret = bindings.Route_new(Arrays.stream(paths_arg).map(paths_arg_conv_12 -> 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 & ~1).toArray()).toArray(long[][]::new));
+               if (ret < 1024) { return null; }
                Route ret_hu_conv = new Route(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                /* TODO 2 RouteHop[]  */;
@@ -48,6 +49,7 @@ public class Route extends CommonBase {
         */
        public Route clone() {
                long ret = bindings.Route_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Route ret_hu_conv = new Route(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -66,6 +68,7 @@ public class Route extends CommonBase {
         */
        public static Result_RouteDecodeErrorZ read(byte[] ser) {
                long ret = bindings.Route_read(ser);
+               if (ret < 1024) { return null; }
                Result_RouteDecodeErrorZ ret_hu_conv = Result_RouteDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index f13f5c14a907a27a4e80f01659cf1ac2e7a949ef..b7c3ba0dbbe96d6bb2292ffceb3d17bac479102d 100644 (file)
@@ -34,6 +34,7 @@ public class RouteHint extends CommonBase {
         */
        public RouteHint clone() {
                long ret = bindings.RouteHint_clone(this.ptr);
+               if (ret < 1024) { return null; }
                RouteHint ret_hu_conv = new RouteHint(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index ad4a93b8ee1c9dce9a2b369a54490c482fe8f211..9fccb408af1a6a02f0494201df3d8b9a476f49ca 100644 (file)
@@ -53,6 +53,7 @@ public class RouteHintHop extends CommonBase {
         */
        public RoutingFees get_fees() {
                long ret = bindings.RouteHintHop_get_fees(this.ptr);
+               if (ret < 1024) { return null; }
                RoutingFees ret_hu_conv = new RoutingFees(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -86,6 +87,7 @@ public class RouteHintHop extends CommonBase {
         */
        public Option_u64Z get_htlc_minimum_msat() {
                long ret = bindings.RouteHintHop_get_htlc_minimum_msat(this.ptr);
+               if (ret < 1024) { return null; }
                Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -103,6 +105,7 @@ public class RouteHintHop extends CommonBase {
         */
        public Option_u64Z get_htlc_maximum_msat() {
                long ret = bindings.RouteHintHop_get_htlc_maximum_msat(this.ptr);
+               if (ret < 1024) { return null; }
                Option_u64Z ret_hu_conv = Option_u64Z.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -120,6 +123,7 @@ public class RouteHintHop extends CommonBase {
         */
        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) {
                long ret = bindings.RouteHintHop_new(src_node_id_arg, short_channel_id_arg, fees_arg == null ? 0 : fees_arg.ptr & ~1, cltv_expiry_delta_arg, htlc_minimum_msat_arg.ptr, htlc_maximum_msat_arg.ptr);
+               if (ret < 1024) { return null; }
                RouteHintHop ret_hu_conv = new RouteHintHop(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                ret_hu_conv.ptrs_to.add(fees_arg);
@@ -142,6 +146,7 @@ public class RouteHintHop extends CommonBase {
         */
        public RouteHintHop clone() {
                long ret = bindings.RouteHintHop_clone(this.ptr);
+               if (ret < 1024) { return null; }
                RouteHintHop ret_hu_conv = new RouteHintHop(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index 6d22a7e6aac4f955b703cae08af2f9d826b9b34c..a408cfdcbdd5a338713ef5076dd4b9df7b0dae89 100644 (file)
@@ -39,6 +39,7 @@ public class RouteHop extends CommonBase {
         */
        public NodeFeatures get_node_features() {
                long ret = bindings.RouteHop_get_node_features(this.ptr);
+               if (ret < 1024) { return null; }
                NodeFeatures ret_hu_conv = new NodeFeatures(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -74,6 +75,7 @@ public class RouteHop extends CommonBase {
         */
        public ChannelFeatures get_channel_features() {
                long ret = bindings.RouteHop_get_channel_features(this.ptr);
+               if (ret < 1024) { return null; }
                ChannelFeatures ret_hu_conv = new ChannelFeatures(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -129,6 +131,7 @@ public class RouteHop extends CommonBase {
         */
        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) {
                long ret = bindings.RouteHop_new(pubkey_arg, node_features_arg == null ? 0 : node_features_arg.ptr & ~1, short_channel_id_arg, channel_features_arg == null ? 0 : channel_features_arg.ptr & ~1, fee_msat_arg, cltv_expiry_delta_arg);
+               if (ret < 1024) { return null; }
                RouteHop ret_hu_conv = new RouteHop(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                ret_hu_conv.ptrs_to.add(node_features_arg);
@@ -141,6 +144,7 @@ public class RouteHop extends CommonBase {
         */
        public RouteHop clone() {
                long ret = bindings.RouteHop_clone(this.ptr);
+               if (ret < 1024) { return null; }
                RouteHop ret_hu_conv = new RouteHop(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -159,6 +163,7 @@ public class RouteHop extends CommonBase {
         */
        public static Result_RouteHopDecodeErrorZ read(byte[] ser) {
                long ret = bindings.RouteHop_read(ser);
+               if (ret < 1024) { return null; }
                Result_RouteHopDecodeErrorZ ret_hu_conv = Result_RouteHopDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index b3852453a432b4f1f53e5f481c28b189eb03d63a..890277f1fae621f5d72343d7a7f0b5576034e0af 100644 (file)
@@ -55,6 +55,7 @@ public class RoutingFees extends CommonBase {
         */
        public static RoutingFees of(int base_msat_arg, int proportional_millionths_arg) {
                long ret = bindings.RoutingFees_new(base_msat_arg, proportional_millionths_arg);
+               if (ret < 1024) { return null; }
                RoutingFees ret_hu_conv = new RoutingFees(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -76,6 +77,7 @@ public class RoutingFees extends CommonBase {
         */
        public RoutingFees clone() {
                long ret = bindings.RoutingFees_clone(this.ptr);
+               if (ret < 1024) { return null; }
                RoutingFees ret_hu_conv = new RoutingFees(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -94,6 +96,7 @@ public class RoutingFees extends CommonBase {
         */
        public static Result_RoutingFeesDecodeErrorZ read(byte[] ser) {
                long ret = bindings.RoutingFees_read(ser);
+               if (ret < 1024) { return null; }
                Result_RoutingFeesDecodeErrorZ ret_hu_conv = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 2ca68de19b287532138f53a2c56d932768532953..b89b0c57512a8de24d1b347ad688b0a88c9779dc 100644 (file)
@@ -60,6 +60,8 @@ public class RoutingMessageHandler extends CommonBase {
                 * starting at the node *after* the provided publickey and including batch_amount entries
                 * immediately higher (as defined by <PublicKey as Ord>::cmp) than starting_point.
                 * If None is provided for starting_point, we start at the first node.
+                * 
+                * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None
                 */
                NodeAnnouncement[] get_next_node_announcements(byte[] starting_point, byte batch_amount);
                /**
@@ -165,12 +167,23 @@ public class RoutingMessageHandler extends CommonBase {
                }, MessageSendEventsProvider.new_impl(MessageSendEventsProvider_impl).bindings_instance);
                return impl_holder.held;
        }
+
+       /**
+        * Gets the underlying MessageSendEventsProvider.
+        */
+       public MessageSendEventsProvider get_message_send_events_provider() {
+               MessageSendEventsProvider res = new MessageSendEventsProvider(null, bindings.LDKRoutingMessageHandler_get_MessageSendEventsProvider(this.ptr));
+               this.ptrs_to.add(res);
+               return res;
+       }
+
        /**
         * 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) {
                long ret = bindings.RoutingMessageHandler_handle_node_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret);
                this.ptrs_to.add(msg);
                return ret_hu_conv;
@@ -182,6 +195,7 @@ public class RoutingMessageHandler extends CommonBase {
         */
        public Result_boolLightningErrorZ handle_channel_announcement(ChannelAnnouncement msg) {
                long ret = bindings.RoutingMessageHandler_handle_channel_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret);
                this.ptrs_to.add(msg);
                return ret_hu_conv;
@@ -193,6 +207,7 @@ public class RoutingMessageHandler extends CommonBase {
         */
        public Result_boolLightningErrorZ handle_channel_update(ChannelUpdate msg) {
                long ret = bindings.RoutingMessageHandler_handle_channel_update(this.ptr, msg == null ? 0 : msg.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret);
                this.ptrs_to.add(msg);
                return ret_hu_conv;
@@ -241,8 +256,10 @@ public class RoutingMessageHandler extends CommonBase {
         * starting at the node *after* the provided publickey and including batch_amount entries
         * immediately higher (as defined by <PublicKey as Ord>::cmp) than starting_point.
         * If None is provided for starting_point, we start at the first node.
+        * 
+        * Note that starting_point (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
-       public NodeAnnouncement[] get_next_node_announcements(byte[] starting_point, byte batch_amount) {
+       public NodeAnnouncement[] get_next_node_announcements(@Nullable byte[] starting_point, byte batch_amount) {
                long[] ret = bindings.RoutingMessageHandler_get_next_node_announcements(this.ptr, starting_point, batch_amount);
                NodeAnnouncement[] ret_conv_18_arr = new NodeAnnouncement[ret.length];
                for (int s = 0; s < ret.length; s++) {
@@ -271,6 +288,7 @@ public class RoutingMessageHandler extends CommonBase {
         */
        public Result_NoneLightningErrorZ handle_reply_channel_range(byte[] their_node_id, ReplyChannelRange msg) {
                long ret = bindings.RoutingMessageHandler_handle_reply_channel_range(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
                this.ptrs_to.add(msg);
                return ret_hu_conv;
@@ -284,6 +302,7 @@ public class RoutingMessageHandler extends CommonBase {
         */
        public Result_NoneLightningErrorZ handle_reply_short_channel_ids_end(byte[] their_node_id, ReplyShortChannelIdsEnd msg) {
                long ret = bindings.RoutingMessageHandler_handle_reply_short_channel_ids_end(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
                this.ptrs_to.add(msg);
                return ret_hu_conv;
@@ -295,6 +314,7 @@ public class RoutingMessageHandler extends CommonBase {
         */
        public Result_NoneLightningErrorZ handle_query_channel_range(byte[] their_node_id, QueryChannelRange msg) {
                long ret = bindings.RoutingMessageHandler_handle_query_channel_range(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
                this.ptrs_to.add(msg);
                return ret_hu_conv;
@@ -306,6 +326,7 @@ public class RoutingMessageHandler extends CommonBase {
         */
        public Result_NoneLightningErrorZ handle_query_short_channel_ids(byte[] their_node_id, QueryShortChannelIds msg) {
                long ret = bindings.RoutingMessageHandler_handle_query_short_channel_ids(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret);
                this.ptrs_to.add(msg);
                return ret_hu_conv;
index b630026ac3d852e3426f13aa809d4efcaaa5dcdb..109aed2e314c5f7ca54c8ee763a0456d216e6665 100644 (file)
@@ -34,6 +34,7 @@ public class Sha256 extends CommonBase {
         */
        public Sha256 clone() {
                long ret = bindings.Sha256_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Sha256 ret_hu_conv = new Sha256(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index bc02e08b5c00b0a468eb476b93851ad347cf436f..1badcd85b88e152c724feab3e450d950d71db83b 100644 (file)
@@ -55,6 +55,7 @@ public class Shutdown extends CommonBase {
         */
        public static Shutdown of(byte[] channel_id_arg, byte[] scriptpubkey_arg) {
                long ret = bindings.Shutdown_new(channel_id_arg, scriptpubkey_arg);
+               if (ret < 1024) { return null; }
                Shutdown ret_hu_conv = new Shutdown(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -65,6 +66,7 @@ public class Shutdown extends CommonBase {
         */
        public Shutdown clone() {
                long ret = bindings.Shutdown_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Shutdown ret_hu_conv = new Shutdown(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -83,6 +85,7 @@ public class Shutdown extends CommonBase {
         */
        public static Result_ShutdownDecodeErrorZ read(byte[] ser) {
                long ret = bindings.Shutdown_read(ser);
+               if (ret < 1024) { return null; }
                Result_ShutdownDecodeErrorZ ret_hu_conv = Result_ShutdownDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index a9304525a17490b3b7594adac8792c98d5e842ba..224166e22d0ae0660b8301010b181fa22d5a0d89 100644 (file)
@@ -45,6 +45,16 @@ public class Sign extends CommonBase {
                }, BaseSign.new_impl(BaseSign_impl, pubkeys).bindings_instance, pubkeys);
                return impl_holder.held;
        }
+
+       /**
+        * Gets the underlying BaseSign.
+        */
+       public BaseSign get_base_sign() {
+               BaseSign res = new BaseSign(null, bindings.LDKSign_get_BaseSign(this.ptr));
+               this.ptrs_to.add(res);
+               return res;
+       }
+
        /**
         * Serialize the object into a byte array
         */
@@ -58,6 +68,7 @@ public class Sign extends CommonBase {
         */
        public Sign clone() {
                long ret = bindings.Sign_clone(this.ptr);
+               if (ret < 1024) { return null; }
                Sign ret_hu_conv = new Sign(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index 918d862e8f09acf4dbc1e24aa5c9fb9f802d41fd..a9f320e76a54781821d837eda8563e092c990183 100644 (file)
@@ -46,6 +46,7 @@ public class SignOrCreationError extends CommonBase {
         */
        public SignOrCreationError clone() {
                long ret = bindings.SignOrCreationError_clone(this.ptr);
+               if (ret < 1024) { return null; }
                SignOrCreationError ret_hu_conv = SignOrCreationError.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index 45bf92d57456185eb902740980f4fe72a80d1e17..c6ba2007fa3b98727d4216dec17303ece23aa415 100644 (file)
@@ -38,6 +38,7 @@ public class SignedRawInvoice extends CommonBase {
         */
        public SignedRawInvoice clone() {
                long ret = bindings.SignedRawInvoice_clone(this.ptr);
+               if (ret < 1024) { return null; }
                SignedRawInvoice ret_hu_conv = new SignedRawInvoice(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -51,6 +52,7 @@ public class SignedRawInvoice extends CommonBase {
         */
        public ThreeTuple<RawInvoice, byte[], InvoiceSignature> into_parts() {
                long ret = bindings.SignedRawInvoice_into_parts(this.ptr);
+               if (ret < 1024) { return null; }
                long ret_a = bindings.LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(ret);
                RawInvoice ret_a_hu_conv = new RawInvoice(null, ret_a);
                ret_a_hu_conv.ptrs_to.add(this);;
@@ -72,6 +74,7 @@ public class SignedRawInvoice extends CommonBase {
         */
        public RawInvoice raw_invoice() {
                long ret = bindings.SignedRawInvoice_raw_invoice(this.ptr);
+               if (ret < 1024) { return null; }
                RawInvoice ret_hu_conv = new RawInvoice(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -90,6 +93,7 @@ public class SignedRawInvoice extends CommonBase {
         */
        public InvoiceSignature signature() {
                long ret = bindings.SignedRawInvoice_signature(this.ptr);
+               if (ret < 1024) { return null; }
                InvoiceSignature ret_hu_conv = new InvoiceSignature(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -100,6 +104,7 @@ public class SignedRawInvoice extends CommonBase {
         */
        public Result_PayeePubKeyErrorZ recover_payee_pub_key() {
                long ret = bindings.SignedRawInvoice_recover_payee_pub_key(this.ptr);
+               if (ret < 1024) { return null; }
                Result_PayeePubKeyErrorZ ret_hu_conv = Result_PayeePubKeyErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -118,6 +123,7 @@ public class SignedRawInvoice extends CommonBase {
         */
        public static Result_SignedRawInvoiceNoneZ from_str(String s) {
                long ret = bindings.SignedRawInvoice_from_str(s);
+               if (ret < 1024) { return null; }
                Result_SignedRawInvoiceNoneZ ret_hu_conv = Result_SignedRawInvoiceNoneZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 86fbfdec4c7f33edf405d2cd3242e1b554415551..b2ddd41507876ed9822a12e8f5496546fef7c7fa 100644 (file)
@@ -143,6 +143,7 @@ public class SocketDescriptor extends CommonBase {
         */
        public SocketDescriptor clone() {
                long ret = bindings.SocketDescriptor_clone(this.ptr);
+               if (ret < 1024) { return null; }
                SocketDescriptor ret_hu_conv = new SocketDescriptor(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index 2f0c0e87ccd36f7d36098f69a45a18bb56c03976..0657e880c99a7a93553802fc593f6f07301c42ae 100644 (file)
@@ -74,6 +74,7 @@ public class SpendableOutputDescriptor extends CommonBase {
         */
        public SpendableOutputDescriptor clone() {
                long ret = bindings.SpendableOutputDescriptor_clone(this.ptr);
+               if (ret < 1024) { return null; }
                SpendableOutputDescriptor ret_hu_conv = SpendableOutputDescriptor.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -92,6 +93,7 @@ public class SpendableOutputDescriptor extends CommonBase {
         */
        public static Result_SpendableOutputDescriptorDecodeErrorZ read(byte[] ser) {
                long ret = bindings.SpendableOutputDescriptor_read(ser);
+               if (ret < 1024) { return null; }
                Result_SpendableOutputDescriptorDecodeErrorZ ret_hu_conv = Result_SpendableOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 92df6b6df75dcb3c22d52b88115ce5a00c0a146c..9e9e1900a0251bad9f493f375dc07a7536fe985d 100644 (file)
@@ -24,6 +24,7 @@ public class StaticPaymentOutputDescriptor extends CommonBase {
         */
        public OutPoint get_outpoint() {
                long ret = bindings.StaticPaymentOutputDescriptor_get_outpoint(this.ptr);
+               if (ret < 1024) { return null; }
                OutPoint ret_hu_conv = new OutPoint(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -83,6 +84,7 @@ public class StaticPaymentOutputDescriptor extends CommonBase {
         */
        public static StaticPaymentOutputDescriptor of(OutPoint outpoint_arg, 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 & ~1, output_arg.ptr, channel_keys_id_arg, channel_value_satoshis_arg);
+               if (ret < 1024) { return null; }
                StaticPaymentOutputDescriptor ret_hu_conv = new StaticPaymentOutputDescriptor(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                ret_hu_conv.ptrs_to.add(outpoint_arg);
@@ -94,6 +96,7 @@ public class StaticPaymentOutputDescriptor extends CommonBase {
         */
        public StaticPaymentOutputDescriptor clone() {
                long ret = bindings.StaticPaymentOutputDescriptor_clone(this.ptr);
+               if (ret < 1024) { return null; }
                StaticPaymentOutputDescriptor ret_hu_conv = new StaticPaymentOutputDescriptor(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -112,6 +115,7 @@ public class StaticPaymentOutputDescriptor extends CommonBase {
         */
        public static Result_StaticPaymentOutputDescriptorDecodeErrorZ read(byte[] ser) {
                long ret = bindings.StaticPaymentOutputDescriptor_read(ser);
+               if (ret < 1024) { return null; }
                Result_StaticPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_StaticPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 87d691ce4b0105338c279223b934efc993dc52c5..63a33660c226741f57fb04cdc878c43c808c0bee 100644 (file)
@@ -36,6 +36,7 @@ public class TrustedCommitmentTransaction extends CommonBase {
         */
        public BuiltCommitmentTransaction built_transaction() {
                long ret = bindings.TrustedCommitmentTransaction_built_transaction(this.ptr);
+               if (ret < 1024) { return null; }
                BuiltCommitmentTransaction ret_hu_conv = new BuiltCommitmentTransaction(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -46,6 +47,7 @@ public class TrustedCommitmentTransaction extends CommonBase {
         */
        public TxCreationKeys keys() {
                long ret = bindings.TrustedCommitmentTransaction_keys(this.ptr);
+               if (ret < 1024) { return null; }
                TxCreationKeys ret_hu_conv = new TxCreationKeys(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -59,6 +61,7 @@ public class TrustedCommitmentTransaction extends CommonBase {
         */
        public Result_CVec_SignatureZNoneZ get_htlc_sigs(byte[] htlc_base_key, DirectedChannelTransactionParameters channel_parameters) {
                long ret = bindings.TrustedCommitmentTransaction_get_htlc_sigs(this.ptr, htlc_base_key, channel_parameters == null ? 0 : channel_parameters.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_CVec_SignatureZNoneZ ret_hu_conv = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret);
                this.ptrs_to.add(channel_parameters);
                return ret_hu_conv;
index 50545faac3559ac13feeccdf9092c459dae2cd60..64b23caf39017832cb46309ab05b03bda239f1d1 100644 (file)
@@ -112,6 +112,7 @@ public class TxCreationKeys extends CommonBase {
         */
        public static TxCreationKeys of(byte[] per_commitment_point_arg, byte[] revocation_key_arg, byte[] broadcaster_htlc_key_arg, byte[] countersignatory_htlc_key_arg, byte[] broadcaster_delayed_payment_key_arg) {
                long ret = bindings.TxCreationKeys_new(per_commitment_point_arg, revocation_key_arg, broadcaster_htlc_key_arg, countersignatory_htlc_key_arg, broadcaster_delayed_payment_key_arg);
+               if (ret < 1024) { return null; }
                TxCreationKeys ret_hu_conv = new TxCreationKeys(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -122,6 +123,7 @@ public class TxCreationKeys extends CommonBase {
         */
        public TxCreationKeys clone() {
                long ret = bindings.TxCreationKeys_clone(this.ptr);
+               if (ret < 1024) { return null; }
                TxCreationKeys ret_hu_conv = new TxCreationKeys(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -140,6 +142,7 @@ public class TxCreationKeys extends CommonBase {
         */
        public static Result_TxCreationKeysDecodeErrorZ read(byte[] ser) {
                long ret = bindings.TxCreationKeys_read(ser);
+               if (ret < 1024) { return null; }
                Result_TxCreationKeysDecodeErrorZ ret_hu_conv = Result_TxCreationKeysDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -150,6 +153,7 @@ public class TxCreationKeys extends CommonBase {
         */
        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) {
                long ret = bindings.TxCreationKeys_derive_new(per_commitment_point, broadcaster_delayed_payment_base, broadcaster_htlc_base, countersignatory_revocation_base, countersignatory_htlc_base);
+               if (ret < 1024) { return null; }
                Result_TxCreationKeysErrorZ ret_hu_conv = Result_TxCreationKeysErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -160,6 +164,7 @@ public class TxCreationKeys extends CommonBase {
         */
        public static Result_TxCreationKeysErrorZ from_channel_static_keys(byte[] per_commitment_point, ChannelPublicKeys broadcaster_keys, ChannelPublicKeys countersignatory_keys) {
                long ret = bindings.TxCreationKeys_from_channel_static_keys(per_commitment_point, broadcaster_keys == null ? 0 : broadcaster_keys.ptr & ~1, countersignatory_keys == null ? 0 : countersignatory_keys.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_TxCreationKeysErrorZ ret_hu_conv = Result_TxCreationKeysErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(broadcaster_keys);
                ret_hu_conv.ptrs_to.add(countersignatory_keys);
index daeed9d6db7a9a2bafdd3044d58abfb547ebdbff..18195de7b8d80eb57a9a0116d0d171cab7caf759 100644 (file)
@@ -23,6 +23,7 @@ public class UnsignedChannelAnnouncement extends CommonBase {
         */
        public ChannelFeatures get_features() {
                long ret = bindings.UnsignedChannelAnnouncement_get_features(this.ptr);
+               if (ret < 1024) { return null; }
                ChannelFeatures ret_hu_conv = new ChannelFeatures(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -131,6 +132,7 @@ public class UnsignedChannelAnnouncement extends CommonBase {
         */
        public UnsignedChannelAnnouncement clone() {
                long ret = bindings.UnsignedChannelAnnouncement_clone(this.ptr);
+               if (ret < 1024) { return null; }
                UnsignedChannelAnnouncement ret_hu_conv = new UnsignedChannelAnnouncement(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -149,6 +151,7 @@ public class UnsignedChannelAnnouncement extends CommonBase {
         */
        public static Result_UnsignedChannelAnnouncementDecodeErrorZ read(byte[] ser) {
                long ret = bindings.UnsignedChannelAnnouncement_read(ser);
+               if (ret < 1024) { return null; }
                Result_UnsignedChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 758565871ae17eb78e4497b4e2ba6bdc1cc5b356..dfa381e6e8dbb5dfe3cea2c1e21f35ba654c8153 100644 (file)
@@ -157,6 +157,7 @@ public class UnsignedChannelUpdate extends CommonBase {
         */
        public UnsignedChannelUpdate clone() {
                long ret = bindings.UnsignedChannelUpdate_clone(this.ptr);
+               if (ret < 1024) { return null; }
                UnsignedChannelUpdate ret_hu_conv = new UnsignedChannelUpdate(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -175,6 +176,7 @@ public class UnsignedChannelUpdate extends CommonBase {
         */
        public static Result_UnsignedChannelUpdateDecodeErrorZ read(byte[] ser) {
                long ret = bindings.UnsignedChannelUpdate_read(ser);
+               if (ret < 1024) { return null; }
                Result_UnsignedChannelUpdateDecodeErrorZ ret_hu_conv = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 3bacc584f6fc5c4d7261c603425df56c94a13e81..8e06dea057158daf10b31e59d0e5d4cb4250dc8c 100644 (file)
@@ -23,6 +23,7 @@ public class UnsignedNodeAnnouncement extends CommonBase {
         */
        public NodeFeatures get_features() {
                long ret = bindings.UnsignedNodeAnnouncement_get_features(this.ptr);
+               if (ret < 1024) { return null; }
                NodeFeatures ret_hu_conv = new NodeFeatures(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -113,6 +114,7 @@ public class UnsignedNodeAnnouncement extends CommonBase {
         */
        public UnsignedNodeAnnouncement clone() {
                long ret = bindings.UnsignedNodeAnnouncement_clone(this.ptr);
+               if (ret < 1024) { return null; }
                UnsignedNodeAnnouncement ret_hu_conv = new UnsignedNodeAnnouncement(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -131,6 +133,7 @@ public class UnsignedNodeAnnouncement extends CommonBase {
         */
        public static Result_UnsignedNodeAnnouncementDecodeErrorZ read(byte[] ser) {
                long ret = bindings.UnsignedNodeAnnouncement_read(ser);
+               if (ret < 1024) { return null; }
                Result_UnsignedNodeAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index bbb40bf8e3b2601536463975ee07a5ad77b5abd5..e9e55212e7ce7f859138587cc77eea32df8d45f9 100644 (file)
@@ -98,6 +98,7 @@ public class UpdateAddHTLC extends CommonBase {
         */
        public UpdateAddHTLC clone() {
                long ret = bindings.UpdateAddHTLC_clone(this.ptr);
+               if (ret < 1024) { return null; }
                UpdateAddHTLC ret_hu_conv = new UpdateAddHTLC(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -116,6 +117,7 @@ public class UpdateAddHTLC extends CommonBase {
         */
        public static Result_UpdateAddHTLCDecodeErrorZ read(byte[] ser) {
                long ret = bindings.UpdateAddHTLC_read(ser);
+               if (ret < 1024) { return null; }
                Result_UpdateAddHTLCDecodeErrorZ ret_hu_conv = Result_UpdateAddHTLCDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index ab5ac687c18989204a113ce75be945748f1a8011..45eda242c3ed29562fe43d34acf2d54aa409ac08 100644 (file)
@@ -53,6 +53,7 @@ public class UpdateFailHTLC extends CommonBase {
         */
        public UpdateFailHTLC clone() {
                long ret = bindings.UpdateFailHTLC_clone(this.ptr);
+               if (ret < 1024) { return null; }
                UpdateFailHTLC ret_hu_conv = new UpdateFailHTLC(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -71,6 +72,7 @@ public class UpdateFailHTLC extends CommonBase {
         */
        public static Result_UpdateFailHTLCDecodeErrorZ read(byte[] ser) {
                long ret = bindings.UpdateFailHTLC_read(ser);
+               if (ret < 1024) { return null; }
                Result_UpdateFailHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailHTLCDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 9a6f87bd53782e526187a094087e48ce9a99872f..1cbca933c77398f9ca56367e745e803256b5cae8 100644 (file)
@@ -68,6 +68,7 @@ public class UpdateFailMalformedHTLC extends CommonBase {
         */
        public UpdateFailMalformedHTLC clone() {
                long ret = bindings.UpdateFailMalformedHTLC_clone(this.ptr);
+               if (ret < 1024) { return null; }
                UpdateFailMalformedHTLC ret_hu_conv = new UpdateFailMalformedHTLC(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -86,6 +87,7 @@ public class UpdateFailMalformedHTLC extends CommonBase {
         */
        public static Result_UpdateFailMalformedHTLCDecodeErrorZ read(byte[] ser) {
                long ret = bindings.UpdateFailMalformedHTLC_read(ser);
+               if (ret < 1024) { return null; }
                Result_UpdateFailMalformedHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailMalformedHTLCDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 38fceb240fe01b42b09da27250db56fbefb74638..54637409095567f02f27f8fe42e85222a54334a1 100644 (file)
@@ -53,6 +53,7 @@ public class UpdateFee extends CommonBase {
         */
        public static UpdateFee of(byte[] channel_id_arg, int feerate_per_kw_arg) {
                long ret = bindings.UpdateFee_new(channel_id_arg, feerate_per_kw_arg);
+               if (ret < 1024) { return null; }
                UpdateFee ret_hu_conv = new UpdateFee(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -63,6 +64,7 @@ public class UpdateFee extends CommonBase {
         */
        public UpdateFee clone() {
                long ret = bindings.UpdateFee_clone(this.ptr);
+               if (ret < 1024) { return null; }
                UpdateFee ret_hu_conv = new UpdateFee(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -81,6 +83,7 @@ public class UpdateFee extends CommonBase {
         */
        public static Result_UpdateFeeDecodeErrorZ read(byte[] ser) {
                long ret = bindings.UpdateFee_read(ser);
+               if (ret < 1024) { return null; }
                Result_UpdateFeeDecodeErrorZ ret_hu_conv = Result_UpdateFeeDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 5c74f8bc82eeac4bb8078c8863a57513113eda9e..4ac2cad0fe6b52673446a4d7bb5bb5c36a673bee 100644 (file)
@@ -68,6 +68,7 @@ public class UpdateFulfillHTLC extends CommonBase {
         */
        public static UpdateFulfillHTLC of(byte[] channel_id_arg, long htlc_id_arg, byte[] payment_preimage_arg) {
                long ret = bindings.UpdateFulfillHTLC_new(channel_id_arg, htlc_id_arg, payment_preimage_arg);
+               if (ret < 1024) { return null; }
                UpdateFulfillHTLC ret_hu_conv = new UpdateFulfillHTLC(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
@@ -78,6 +79,7 @@ public class UpdateFulfillHTLC extends CommonBase {
         */
        public UpdateFulfillHTLC clone() {
                long ret = bindings.UpdateFulfillHTLC_clone(this.ptr);
+               if (ret < 1024) { return null; }
                UpdateFulfillHTLC ret_hu_conv = new UpdateFulfillHTLC(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -96,6 +98,7 @@ public class UpdateFulfillHTLC extends CommonBase {
         */
        public static Result_UpdateFulfillHTLCDecodeErrorZ read(byte[] ser) {
                long ret = bindings.UpdateFulfillHTLC_read(ser);
+               if (ret < 1024) { return null; }
                Result_UpdateFulfillHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFulfillHTLCDecodeErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
index 6023431786e51d8cbedc56245e0a2c3077ec4f57..489983ddbc2c17c2f1d61b85335801dd56d9ff70 100644 (file)
@@ -26,6 +26,7 @@ public class UserConfig extends CommonBase {
         */
        public ChannelHandshakeConfig get_own_channel_config() {
                long ret = bindings.UserConfig_get_own_channel_config(this.ptr);
+               if (ret < 1024) { return null; }
                ChannelHandshakeConfig ret_hu_conv = new ChannelHandshakeConfig(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -44,6 +45,7 @@ public class UserConfig extends CommonBase {
         */
        public ChannelHandshakeLimits get_peer_channel_config_limits() {
                long ret = bindings.UserConfig_get_peer_channel_config_limits(this.ptr);
+               if (ret < 1024) { return null; }
                ChannelHandshakeLimits ret_hu_conv = new ChannelHandshakeLimits(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -62,6 +64,7 @@ public class UserConfig extends CommonBase {
         */
        public ChannelConfig get_channel_options() {
                long ret = bindings.UserConfig_get_channel_options(this.ptr);
+               if (ret < 1024) { return null; }
                ChannelConfig ret_hu_conv = new ChannelConfig(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -125,6 +128,7 @@ public class UserConfig extends CommonBase {
         */
        public static UserConfig of(ChannelHandshakeConfig own_channel_config_arg, ChannelHandshakeLimits peer_channel_config_limits_arg, ChannelConfig channel_options_arg, boolean accept_forwards_to_priv_channels_arg) {
                long ret = bindings.UserConfig_new(own_channel_config_arg == null ? 0 : own_channel_config_arg.ptr & ~1, peer_channel_config_limits_arg == null ? 0 : peer_channel_config_limits_arg.ptr & ~1, channel_options_arg == null ? 0 : channel_options_arg.ptr & ~1, accept_forwards_to_priv_channels_arg);
+               if (ret < 1024) { return null; }
                UserConfig ret_hu_conv = new UserConfig(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                ret_hu_conv.ptrs_to.add(own_channel_config_arg);
@@ -138,6 +142,7 @@ public class UserConfig extends CommonBase {
         */
        public UserConfig clone() {
                long ret = bindings.UserConfig_clone(this.ptr);
+               if (ret < 1024) { return null; }
                UserConfig ret_hu_conv = new UserConfig(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -148,6 +153,7 @@ public class UserConfig extends CommonBase {
         */
        public static UserConfig with_default() {
                long ret = bindings.UserConfig_default();
+               if (ret < 1024) { return null; }
                UserConfig ret_hu_conv = new UserConfig(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                return ret_hu_conv;
index f2a7c07b8961eced7e6da82d3fa0bb7b682d6567..a288deb333461ba1dc2ca6285a7cb482683dc209 100644 (file)
@@ -11,6 +11,7 @@ public class UtilMethods {
         */
        public static Result_StringErrorZ sign(byte[] msg, byte[] sk) {
                long ret = bindings.sign(msg, sk);
+               if (ret < 1024) { return null; }
                Result_StringErrorZ ret_hu_conv = Result_StringErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -20,6 +21,7 @@ public class UtilMethods {
         */
        public static Result_PublicKeyErrorZ recover_pk(byte[] msg, String sig) {
                long ret = bindings.recover_pk(msg, sig);
+               if (ret < 1024) { return null; }
                Result_PublicKeyErrorZ ret_hu_conv = Result_PublicKeyErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -38,6 +40,7 @@ public class UtilMethods {
         */
        public static Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ BlockHashChannelMonitorZ_read(byte[] ser, KeysInterface arg) {
                long ret = bindings.C2Tuple_BlockHashChannelMonitorZ_read(ser, arg == null ? 0 : arg.ptr);
+               if (ret < 1024) { return null; }
                Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(arg);
                return ret_hu_conv;
@@ -48,6 +51,7 @@ public class UtilMethods {
         */
        public static Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ BlockHashChannelManagerZ_read(byte[] ser, KeysInterface arg_keys_manager, FeeEstimator arg_fee_estimator, Watch arg_chain_monitor, BroadcasterInterface arg_tx_broadcaster, Logger arg_logger, UserConfig arg_default_config, ChannelMonitor[] arg_channel_monitors) {
                long ret = bindings.C2Tuple_BlockHashChannelManagerZ_read(ser, bindings.ChannelManagerReadArgs_new(arg_keys_manager == null ? 0 : arg_keys_manager.ptr, arg_fee_estimator == null ? 0 : arg_fee_estimator.ptr, arg_chain_monitor == null ? 0 : arg_chain_monitor.ptr, arg_tx_broadcaster == null ? 0 : arg_tx_broadcaster.ptr, arg_logger == null ? 0 : arg_logger.ptr, arg_default_config == null ? 0 : arg_default_config.ptr & ~1, Arrays.stream(arg_channel_monitors).mapToLong(arg_channel_monitors_conv_16 -> arg_channel_monitors_conv_16 == null ? 0 : arg_channel_monitors_conv_16.ptr & ~1).toArray()));
+               if (ret < 1024) { return null; }
                Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(arg_keys_manager);
                ret_hu_conv.ptrs_to.add(arg_fee_estimator);
@@ -76,6 +80,7 @@ public class UtilMethods {
         */
        public static Result_SecretKeyErrorZ derive_private_key(byte[] per_commitment_point, byte[] base_secret) {
                long ret = bindings.derive_private_key(per_commitment_point, base_secret);
+               if (ret < 1024) { return null; }
                Result_SecretKeyErrorZ ret_hu_conv = Result_SecretKeyErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -90,6 +95,7 @@ public class UtilMethods {
         */
        public static Result_PublicKeyErrorZ derive_public_key(byte[] per_commitment_point, byte[] base_point) {
                long ret = bindings.derive_public_key(per_commitment_point, base_point);
+               if (ret < 1024) { return null; }
                Result_PublicKeyErrorZ ret_hu_conv = Result_PublicKeyErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -107,6 +113,7 @@ public class UtilMethods {
         */
        public static Result_SecretKeyErrorZ derive_private_revocation_key(byte[] per_commitment_secret, byte[] countersignatory_revocation_base_secret) {
                long ret = bindings.derive_private_revocation_key(per_commitment_secret, countersignatory_revocation_base_secret);
+               if (ret < 1024) { return null; }
                Result_SecretKeyErrorZ ret_hu_conv = Result_SecretKeyErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -126,6 +133,7 @@ public class UtilMethods {
         */
        public static Result_PublicKeyErrorZ derive_public_revocation_key(byte[] per_commitment_point, byte[] countersignatory_revocation_base_point) {
                long ret = bindings.derive_public_revocation_key(per_commitment_point, countersignatory_revocation_base_point);
+               if (ret < 1024) { return null; }
                Result_PublicKeyErrorZ ret_hu_conv = Result_PublicKeyErrorZ.constr_from_ptr(ret);
                return ret_hu_conv;
        }
@@ -188,6 +196,24 @@ public class UtilMethods {
                return ret;
        }
 
+       /**
+        * Gets a keysend route from us (payer) to the given target node (payee). This is needed because
+        * keysend payments do not have an invoice from which to pull the payee's supported features, which
+        * makes it tricky to otherwise supply the `payee_features` parameter of `get_route`.
+        * 
+        * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
+        */
+       public static Result_RouteLightningErrorZ get_keysend_route(byte[] our_node_id, NetworkGraph network, byte[] payee, @Nullable ChannelDetails[] first_hops, RouteHint[] last_hops, long final_value_msat, int final_cltv, Logger logger) {
+               long ret = bindings.get_keysend_route(our_node_id, network == null ? 0 : network.ptr & ~1, payee, Arrays.stream(first_hops).mapToLong(first_hops_conv_16 -> first_hops_conv_16 == null ? 0 : first_hops_conv_16.ptr & ~1).toArray(), Arrays.stream(last_hops).mapToLong(last_hops_conv_11 -> last_hops_conv_11 == null ? 0 : last_hops_conv_11.ptr & ~1).toArray(), final_value_msat, final_cltv, logger == null ? 0 : logger.ptr);
+               if (ret < 1024) { return null; }
+               Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(network);
+               /* TODO 2 ChannelDetails  */;
+               /* TODO 2 RouteHint  */;
+               ret_hu_conv.ptrs_to.add(logger);
+               return ret_hu_conv;
+       }
+
        /**
         * Gets a route from us (payer) to the given target node (payee).
         * 
@@ -208,9 +234,13 @@ public class UtilMethods {
         * The fees on channels from us to next-hops are ignored (as they are assumed to all be
         * equal), however the enabled/disabled bit on such channels as well as the
         * htlc_minimum_msat/htlc_maximum_msat *are* checked as they may change based on the receiving node.
+        * 
+        * Note that payee_features (or a relevant inner pointer) may be NULL or all-0s to represent None
+        * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
-       public static Result_RouteLightningErrorZ get_route(byte[] our_node_id, NetworkGraph network, byte[] payee, InvoiceFeatures payee_features, ChannelDetails[] first_hops, RouteHint[] last_hops, long final_value_msat, int final_cltv, Logger logger) {
+       public static Result_RouteLightningErrorZ get_route(byte[] our_node_id, NetworkGraph network, byte[] payee, @Nullable InvoiceFeatures payee_features, ChannelDetails[] first_hops, RouteHint[] last_hops, long final_value_msat, int final_cltv, Logger logger) {
                long ret = bindings.get_route(our_node_id, network == null ? 0 : network.ptr & ~1, payee, payee_features == null ? 0 : payee_features.ptr & ~1, Arrays.stream(first_hops).mapToLong(first_hops_conv_16 -> first_hops_conv_16 == null ? 0 : first_hops_conv_16.ptr & ~1).toArray(), Arrays.stream(last_hops).mapToLong(last_hops_conv_11 -> last_hops_conv_11 == null ? 0 : last_hops_conv_11.ptr & ~1).toArray(), final_value_msat, final_cltv, logger == null ? 0 : logger.ptr);
+               if (ret < 1024) { return null; }
                Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(network);
                ret_hu_conv.ptrs_to.add(payee_features);
@@ -226,6 +256,7 @@ public class UtilMethods {
         */
        public static Result_NoneErrorZ FilesystemPersister_persist_manager(String data_dir, ChannelManager manager) {
                long ret = bindings.FilesystemPersister_persist_manager(data_dir, manager == null ? 0 : manager.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_NoneErrorZ ret_hu_conv = Result_NoneErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(manager);
                return ret_hu_conv;
@@ -240,6 +271,7 @@ public class UtilMethods {
         */
        public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(ChannelManager channelmanager, KeysInterface keys_manager, Currency network, Option_u64Z amt_msat, String description) {
                long ret = bindings.create_invoice_from_channelmanager(channelmanager == null ? 0 : channelmanager.ptr & ~1, keys_manager == null ? 0 : keys_manager.ptr, network, amt_msat.ptr, description);
+               if (ret < 1024) { return null; }
                Result_InvoiceSignOrCreationErrorZ ret_hu_conv = Result_InvoiceSignOrCreationErrorZ.constr_from_ptr(ret);
                ret_hu_conv.ptrs_to.add(channelmanager);
                ret_hu_conv.ptrs_to.add(keys_manager);
index d560838a914125396516e731fe3eb86440667af5..36c5ddb6cfed802ed19f76e2536efc2886b26f48 100644 (file)
@@ -115,6 +115,7 @@ public class Watch extends CommonBase {
         */
        public Result_NoneChannelMonitorUpdateErrZ watch_channel(OutPoint funding_txo, ChannelMonitor monitor) {
                long ret = bindings.Watch_watch_channel(this.ptr, funding_txo == null ? 0 : funding_txo.ptr & ~1, monitor == null ? 0 : monitor.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret);
                this.ptrs_to.add(funding_txo);
                this.ptrs_to.add(monitor);
@@ -132,6 +133,7 @@ public class Watch extends CommonBase {
         */
        public Result_NoneChannelMonitorUpdateErrZ update_channel(OutPoint funding_txo, ChannelMonitorUpdate update) {
                long ret = bindings.Watch_update_channel(this.ptr, funding_txo == null ? 0 : funding_txo.ptr & ~1, update == null ? 0 : update.ptr & ~1);
+               if (ret < 1024) { return null; }
                Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret);
                this.ptrs_to.add(funding_txo);
                this.ptrs_to.add(update);
index 55c7a4183ff6046c6619188a744ab41ec516df21..a81dfe012abc7c11cad67751a225e1cb43433375 100644 (file)
@@ -30,7 +30,10 @@ public class WatchedOutput extends CommonBase {
 
        /**
         * First block where the transaction output may have been spent.
+        * 
+        * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
+       @Nullable
        public byte[] get_block_hash() {
                byte[] ret = bindings.WatchedOutput_get_block_hash(this.ptr);
                return ret;
@@ -38,8 +41,10 @@ public class WatchedOutput extends CommonBase {
 
        /**
         * First block where the transaction output may have been spent.
+        * 
+        * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None
         */
-       public void set_block_hash(byte[] val) {
+       public void set_block_hash(@Nullable byte[] val) {
                bindings.WatchedOutput_set_block_hash(this.ptr, val);
        }
 
@@ -48,6 +53,7 @@ public class WatchedOutput extends CommonBase {
         */
        public OutPoint get_outpoint() {
                long ret = bindings.WatchedOutput_get_outpoint(this.ptr);
+               if (ret < 1024) { return null; }
                OutPoint ret_hu_conv = new OutPoint(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
@@ -81,6 +87,7 @@ public class WatchedOutput extends CommonBase {
         */
        public static WatchedOutput of(byte[] block_hash_arg, OutPoint outpoint_arg, byte[] script_pubkey_arg) {
                long ret = bindings.WatchedOutput_new(block_hash_arg, outpoint_arg == null ? 0 : outpoint_arg.ptr & ~1, script_pubkey_arg);
+               if (ret < 1024) { return null; }
                WatchedOutput ret_hu_conv = new WatchedOutput(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                ret_hu_conv.ptrs_to.add(outpoint_arg);
@@ -92,6 +99,7 @@ public class WatchedOutput extends CommonBase {
         */
        public WatchedOutput clone() {
                long ret = bindings.WatchedOutput_clone(this.ptr);
+               if (ret < 1024) { return null; }
                WatchedOutput ret_hu_conv = new WatchedOutput(null, ret);
                ret_hu_conv.ptrs_to.add(this);
                return ret_hu_conv;
index b71fa7be0d603eac7264a54dc7ef66cb9c54f482..7435d559a1f2000ef4bb6dd3585d9f02d49f2970 100644 (file)
 #include <stdlib.h>
 
 #define DEBUG_PRINT(...) fprintf(stderr, __VA_ARGS__)
-#define MALLOC(a, _) malloc(a)
-#define FREE(p) if ((uint64_t)(p) > 1024) { free(p); }
-#define DO_ASSERT(a) (void)(a)
-#define CHECK(a)
+#include <assert.h>
+// Always run a, then assert it is true:
+#define DO_ASSERT(a) do { bool _assert_val = (a); assert(_assert_val); } while(0)
+// Assert a is true or do nothing
+#define CHECK(a) DO_ASSERT(a)
+
+void __attribute__((constructor)) debug_log_version() {
+       if (check_get_ldk_version() == NULL)
+               DEBUG_PRINT("LDK version did not match the header we built against\n");
+       if (check_get_ldk_bindings_version() == NULL)
+               DEBUG_PRINT("LDK C Bindings version did not match the header we built against\n");
+       DEBUG_PRINT("Loaded LDK-Java Bindings with LDK %s and LDK-C-Bindings %s\n", check_get_ldk_version(), check_get_ldk_bindings_version());
+}
+
+// Running a leak check across all the allocations and frees of the JDK is a mess,
+// so instead we implement our own naive leak checker here, relying on the -wrap
+// linker option to wrap malloc/calloc/realloc/free, tracking everyhing allocated
+// and free'd in Rust or C across the generated bindings shared library.
+#include <threads.h>
+#include <execinfo.h>
+
+#include <unistd.h>
+static mtx_t allocation_mtx;
+
+void __attribute__((constructor)) init_mtx() {
+       DO_ASSERT(mtx_init(&allocation_mtx, mtx_plain) == thrd_success);
+}
+
+#define BT_MAX 128
+typedef struct allocation {
+       struct allocation* next;
+       void* ptr;
+       const char* struct_name;
+       void* bt[BT_MAX];
+       int bt_len;
+       unsigned long alloc_len;
+} allocation;
+static allocation* allocation_ll = NULL;
+
+void* __real_malloc(size_t len);
+void* __real_calloc(size_t nmemb, size_t len);
+static void new_allocation(void* res, const char* struct_name, size_t len) {
+       allocation* new_alloc = __real_malloc(sizeof(allocation));
+       new_alloc->ptr = res;
+       new_alloc->struct_name = struct_name;
+       new_alloc->bt_len = backtrace(new_alloc->bt, BT_MAX);
+       new_alloc->alloc_len = len;
+       DO_ASSERT(mtx_lock(&allocation_mtx) == thrd_success);
+       new_alloc->next = allocation_ll;
+       allocation_ll = new_alloc;
+       DO_ASSERT(mtx_unlock(&allocation_mtx) == thrd_success);
+}
+static void* MALLOC(size_t len, const char* struct_name) {
+       void* res = __real_malloc(len);
+       new_allocation(res, struct_name, len);
+       return res;
+}
+void __real_free(void* ptr);
+static void alloc_freed(void* ptr) {
+       allocation* p = NULL;
+       DO_ASSERT(mtx_lock(&allocation_mtx) == thrd_success);
+       allocation* it = allocation_ll;
+       while (it->ptr != ptr) {
+               p = it; it = it->next;
+               if (it == NULL) {
+                       DEBUG_PRINT("Tried to free unknown pointer %p at:\n", ptr);
+                       void* bt[BT_MAX];
+                       int bt_len = backtrace(bt, BT_MAX);
+                       backtrace_symbols_fd(bt, bt_len, STDERR_FILENO);
+                       DEBUG_PRINT("\n\n");
+                       DO_ASSERT(mtx_unlock(&allocation_mtx) == thrd_success);
+                       return; // addrsan should catch malloc-unknown and print more info than we have
+               }
+       }
+       if (p) { p->next = it->next; } else { allocation_ll = it->next; }
+       DO_ASSERT(mtx_unlock(&allocation_mtx) == thrd_success);
+       DO_ASSERT(it->ptr == ptr);
+       __real_free(it);
+}
+static void FREE(void* ptr) {
+       if ((uint64_t)ptr < 1024) return; // Rust loves to create pointers to the NULL page for dummys
+       alloc_freed(ptr);
+       __real_free(ptr);
+}
+
+void* __wrap_malloc(size_t len) {
+       void* res = __real_malloc(len);
+       new_allocation(res, "malloc call", len);
+       return res;
+}
+void* __wrap_calloc(size_t nmemb, size_t len) {
+       void* res = __real_calloc(nmemb, len);
+       new_allocation(res, "calloc call", len);
+       return res;
+}
+void __wrap_free(void* ptr) {
+       if (ptr == NULL) return;
+       alloc_freed(ptr);
+       __real_free(ptr);
+}
+
+void* __real_realloc(void* ptr, size_t newlen);
+void* __wrap_realloc(void* ptr, size_t len) {
+       if (ptr != NULL) alloc_freed(ptr);
+       void* res = __real_realloc(ptr, len);
+       new_allocation(res, "realloc call", len);
+       return res;
+}
+void __wrap_reallocarray(void* ptr, size_t new_sz) {
+       // Rust doesn't seem to use reallocarray currently
+       DO_ASSERT(false);
+}
+
+void __attribute__((destructor)) check_leaks() {
+       unsigned long alloc_count = 0;
+       unsigned long alloc_size = 0;
+       DEBUG_PRINT("The following LDK-allocated blocks still remain.\n");
+       DEBUG_PRINT("Note that this is only accurate if System.gc(); System.runFinalization()\n");
+       DEBUG_PRINT("was called prior to exit after all LDK objects were out of scope.\n");
+       for (allocation* a = allocation_ll; a != NULL; a = a->next) {
+               DEBUG_PRINT("%s %p (%lu bytes) remains:\n", a->struct_name, a->ptr, a->alloc_len);
+               backtrace_symbols_fd(a->bt, a->bt_len, STDERR_FILENO);
+               DEBUG_PRINT("\n\n");
+               alloc_count++;
+               alloc_size += a->alloc_len;
+       }
+       DEBUG_PRINT("%lu allocations remained for %lu bytes.\n", alloc_count, alloc_size);
+       DEBUG_PRINT("Note that this is only accurate if System.gc(); System.runFinalization()\n");
+       DEBUG_PRINT("was called prior to exit after all LDK objects were out of scope.\n");
+}
 
 static jmethodID ordinal_meth = NULL;
 static jmethodID slicedef_meth = NULL;
@@ -133,7 +259,7 @@ static inline LDKStr java_to_owned_str(JNIEnv *env, jstring str) {
 }
 
 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_get_1lib_1version_1string(JNIEnv *env, jclass _c) {
-       return str_ref_to_java(env, "v0.0.99.1", strlen("v0.0.99.1"));
+       return str_ref_to_java(env, "v0.0.99.1-7-gf7a4eb8-dirty", strlen("v0.0.99.1-7-gf7a4eb8-dirty"));
 }
 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_get_1ldk_1c_1bindings_1version(JNIEnv *env, jclass _c) {
        return str_ref_to_java(env, check_get_ldk_bindings_version(), strlen(check_get_ldk_bindings_version()));
@@ -2471,11 +2597,6 @@ void ready_channel_LDKBaseSign_jcall(void* this_arg, const LDKChannelTransaction
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
 }
-static void* LDKBaseSign_JCalls_clone(const void* this_arg) {
-       LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
-       atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
-}
 static inline LDKBaseSign LDKBaseSign_init (JNIEnv *env, jclass clz, jobject o, int64_t pubkeys) {
        jclass c = (*env)->GetObjectClass(env, o);
        CHECK(c != NULL);
@@ -2725,11 +2846,10 @@ LDKCVec_u8Z write_LDKSign_jcall(const void* this_arg) {
        }
        return ret_ref;
 }
-static void* LDKSign_JCalls_clone(const void* this_arg) {
-       LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
+static void LDKSign_JCalls_cloned(LDKSign* new_obj) {
+       LDKSign_JCalls *j_calls = (LDKSign_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
        atomic_fetch_add_explicit(&j_calls->BaseSign->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKSign LDKSign_init (JNIEnv *env, jclass clz, jobject o, jobject BaseSign, int64_t pubkeys) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -2749,7 +2869,7 @@ static inline LDKSign LDKSign_init (JNIEnv *env, jclass clz, jobject o, jobject
        LDKSign ret = {
                .this_arg = (void*) calls,
                .write = write_LDKSign_jcall,
-               .clone = LDKSign_JCalls_clone,
+               .cloned = LDKSign_JCalls_cloned,
                .free = LDKSign_JCalls_free,
                .BaseSign = LDKBaseSign_init(env, clz, BaseSign, pubkeys),
        };
@@ -2761,6 +2881,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKSign_1new(JNIEnv *env, j
        *res_ptr = LDKSign_init(env, clz, o, BaseSign, pubkeys);
        return (uint64_t)res_ptr;
 }
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKSign_1get_1BaseSign(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKSign *inp = (LDKSign *)(arg & ~1);
+       uint64_t res_ptr = (uint64_t)&inp->BaseSign;
+       DO_ASSERT((res_ptr & 1) == 0);
+       return (int64_t)(res_ptr | 1);
+}
 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Sign_1write(JNIEnv *env, jclass clz, int64_t this_arg) {
        LDKSign* this_arg_conv = (LDKSign*)(((uint64_t)this_arg) & ~1);
        LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
@@ -3211,6 +3337,22 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSend
        uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1;
        return err_ref;
 }
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentHashPaymentSendFailureZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+       return ((LDKCResult_PaymentHashPaymentSendFailureZ*)arg)->result_ok;
+}
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentHashPaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_PaymentHashPaymentSendFailureZ *val = (LDKCResult_PaymentHashPaymentSendFailureZ*)(arg & ~1);
+       CHECK(val->result_ok);
+       int8_tArray res_arr = (*env)->NewByteArray(env, 32);
+       (*env)->SetByteArrayRegion(env, res_arr, 0, 32, (*val->contents.result).data);
+       return res_arr;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentHashPaymentSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_PaymentHashPaymentSendFailureZ *val = (LDKCResult_PaymentHashPaymentSendFailureZ*)(arg & ~1);
+       CHECK(!val->result_ok);
+       uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1;
+       return err_ref;
+}
 static jclass LDKNetAddress_IPv4_class = NULL;
 static jmethodID LDKNetAddress_IPv4_meth = NULL;
 static jclass LDKNetAddress_IPv6_class = NULL;
@@ -3493,10 +3635,9 @@ LDKCVec_MonitorEventZ release_pending_monitor_events_LDKWatch_jcall(const void*
        }
        return ret_constr;
 }
-static void* LDKWatch_JCalls_clone(const void* this_arg) {
-       LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
+static void LDKWatch_JCalls_cloned(LDKWatch* new_obj) {
+       LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKWatch LDKWatch_init (JNIEnv *env, jclass clz, jobject o) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -3619,10 +3760,9 @@ void broadcast_transaction_LDKBroadcasterInterface_jcall(const void* this_arg, L
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
 }
-static void* LDKBroadcasterInterface_JCalls_clone(const void* this_arg) {
-       LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
+static void LDKBroadcasterInterface_JCalls_cloned(LDKBroadcasterInterface* new_obj) {
+       LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKBroadcasterInterface LDKBroadcasterInterface_init (JNIEnv *env, jclass clz, jobject o) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -3858,10 +3998,9 @@ LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKKeysInterface_jcall(const v
        }
        return ret_conv;
 }
-static void* LDKKeysInterface_JCalls_clone(const void* this_arg) {
-       LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
+static void LDKKeysInterface_JCalls_cloned(LDKKeysInterface* new_obj) {
+       LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKKeysInterface LDKKeysInterface_init (JNIEnv *env, jclass clz, jobject o) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -4007,10 +4146,9 @@ uint32_t get_est_sat_per_1000_weight_LDKFeeEstimator_jcall(const void* this_arg,
        }
        return ret;
 }
-static void* LDKFeeEstimator_JCalls_clone(const void* this_arg) {
-       LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
+static void LDKFeeEstimator_JCalls_cloned(LDKFeeEstimator* new_obj) {
+       LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKFeeEstimator LDKFeeEstimator_init (JNIEnv *env, jclass clz, jobject o) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -4086,10 +4224,9 @@ void log_LDKLogger_jcall(const void* this_arg, const char* record) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
 }
-static void* LDKLogger_JCalls_clone(const void* this_arg) {
-       LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
+static void LDKLogger_JCalls_cloned(LDKLogger* new_obj) {
+       LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKLogger LDKLogger_init (JNIEnv *env, jclass clz, jobject o) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -4653,6 +4790,40 @@ static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ CVec_C2Tuple_TxidCV
        }
        return ret;
 }
+static jclass LDKPaymentPurpose_InvoicePayment_class = NULL;
+static jmethodID LDKPaymentPurpose_InvoicePayment_meth = NULL;
+static jclass LDKPaymentPurpose_SpontaneousPayment_class = NULL;
+static jmethodID LDKPaymentPurpose_SpontaneousPayment_meth = NULL;
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentPurpose_init (JNIEnv *env, jclass clz) {
+       LDKPaymentPurpose_InvoicePayment_class =
+               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentPurpose$InvoicePayment;"));
+       CHECK(LDKPaymentPurpose_InvoicePayment_class != NULL);
+       LDKPaymentPurpose_InvoicePayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_InvoicePayment_class, "<init>", "([B[BJ)V");
+       CHECK(LDKPaymentPurpose_InvoicePayment_meth != NULL);
+       LDKPaymentPurpose_SpontaneousPayment_class =
+               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentPurpose$SpontaneousPayment;"));
+       CHECK(LDKPaymentPurpose_SpontaneousPayment_class != NULL);
+       LDKPaymentPurpose_SpontaneousPayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_SpontaneousPayment_class, "<init>", "([B)V");
+       CHECK(LDKPaymentPurpose_SpontaneousPayment_meth != NULL);
+}
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentPurpose_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
+       LDKPaymentPurpose *obj = (LDKPaymentPurpose*)(ptr & ~1);
+       switch(obj->tag) {
+               case LDKPaymentPurpose_InvoicePayment: {
+                       int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32);
+                       (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->invoice_payment.payment_preimage.data);
+                       int8_tArray payment_secret_arr = (*env)->NewByteArray(env, 32);
+                       (*env)->SetByteArrayRegion(env, payment_secret_arr, 0, 32, obj->invoice_payment.payment_secret.data);
+                       return (*env)->NewObject(env, LDKPaymentPurpose_InvoicePayment_class, LDKPaymentPurpose_InvoicePayment_meth, payment_preimage_arr, payment_secret_arr, obj->invoice_payment.user_payment_id);
+               }
+               case LDKPaymentPurpose_SpontaneousPayment: {
+                       int8_tArray spontaneous_payment_arr = (*env)->NewByteArray(env, 32);
+                       (*env)->SetByteArrayRegion(env, spontaneous_payment_arr, 0, 32, obj->spontaneous_payment.data);
+                       return (*env)->NewObject(env, LDKPaymentPurpose_SpontaneousPayment_class, LDKPaymentPurpose_SpontaneousPayment_meth, spontaneous_payment_arr);
+               }
+               default: abort();
+       }
+}
 static jclass LDKEvent_FundingGenerationReady_class = NULL;
 static jmethodID LDKEvent_FundingGenerationReady_meth = NULL;
 static jclass LDKEvent_PaymentReceived_class = NULL;
@@ -4674,7 +4845,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *en
        LDKEvent_PaymentReceived_class =
                (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentReceived;"));
        CHECK(LDKEvent_PaymentReceived_class != NULL);
-       LDKEvent_PaymentReceived_meth = (*env)->GetMethodID(env, LDKEvent_PaymentReceived_class, "<init>", "([B[B[BJJ)V");
+       LDKEvent_PaymentReceived_meth = (*env)->GetMethodID(env, LDKEvent_PaymentReceived_class, "<init>", "([BJJ)V");
        CHECK(LDKEvent_PaymentReceived_meth != NULL);
        LDKEvent_PaymentSent_class =
                (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentSent;"));
@@ -4711,11 +4882,8 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN
                case LDKEvent_PaymentReceived: {
                        int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
                        (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_received.payment_hash.data);
-                       int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32);
-                       (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->payment_received.payment_preimage.data);
-                       int8_tArray payment_secret_arr = (*env)->NewByteArray(env, 32);
-                       (*env)->SetByteArrayRegion(env, payment_secret_arr, 0, 32, obj->payment_received.payment_secret.data);
-                       return (*env)->NewObject(env, LDKEvent_PaymentReceived_class, LDKEvent_PaymentReceived_meth, payment_hash_arr, payment_preimage_arr, payment_secret_arr, obj->payment_received.amt, obj->payment_received.user_payment_id);
+                       uint64_t purpose_ref = ((uint64_t)&obj->payment_received.purpose) | 1;
+                       return (*env)->NewObject(env, LDKEvent_PaymentReceived_class, LDKEvent_PaymentReceived_meth, payment_hash_arr, obj->payment_received.amt, purpose_ref);
                }
                case LDKEvent_PaymentSent: {
                        int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32);
@@ -6140,10 +6308,9 @@ LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_LDKMessageSendEventsP
        }
        return ret_constr;
 }
-static void* LDKMessageSendEventsProvider_JCalls_clone(const void* this_arg) {
-       LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
+static void LDKMessageSendEventsProvider_JCalls_cloned(LDKMessageSendEventsProvider* new_obj) {
+       LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKMessageSendEventsProvider LDKMessageSendEventsProvider_init (JNIEnv *env, jclass clz, jobject o) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -6229,10 +6396,9 @@ void handle_event_LDKEventHandler_jcall(const void* this_arg, LDKEvent event) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
 }
-static void* LDKEventHandler_JCalls_clone(const void* this_arg) {
-       LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg;
+static void LDKEventHandler_JCalls_cloned(LDKEventHandler* new_obj) {
+       LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKEventHandler LDKEventHandler_init (JNIEnv *env, jclass clz, jobject o) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -6307,10 +6473,9 @@ void process_pending_events_LDKEventsProvider_jcall(const void* this_arg, LDKEve
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
 }
-static void* LDKEventsProvider_JCalls_clone(const void* this_arg) {
-       LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
+static void LDKEventsProvider_JCalls_cloned(LDKEventsProvider* new_obj) {
+       LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKEventsProvider LDKEventsProvider_init (JNIEnv *env, jclass clz, jobject o) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -6339,7 +6504,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1process_1pendi
        LDKEventHandler handler_conv = *(LDKEventHandler*)(((uint64_t)handler) & ~1);
        if (handler_conv.free == LDKEventHandler_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKEventHandler_JCalls_clone(handler_conv.this_arg);
+               LDKEventHandler_JCalls_cloned(&handler_conv);
        }
        (this_arg_conv->process_pending_events)(this_arg_conv->this_arg, handler_conv);
 }
@@ -6392,10 +6557,9 @@ LDKCResult_TxOutAccessErrorZ get_utxo_LDKAccess_jcall(const void* this_arg, cons
        }
        return ret_conv;
 }
-static void* LDKAccess_JCalls_clone(const void* this_arg) {
-       LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
+static void LDKAccess_JCalls_cloned(LDKAccess* new_obj) {
+       LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKAccess LDKAccess_init (JNIEnv *env, jclass clz, jobject o) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -6499,10 +6663,9 @@ void block_disconnected_LDKListen_jcall(const void* this_arg, const uint8_t (* h
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
 }
-static void* LDKListen_JCalls_clone(const void* this_arg) {
-       LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
+static void LDKListen_JCalls_cloned(LDKListen* new_obj) {
+       LDKListen_JCalls *j_calls = (LDKListen_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKListen LDKListen_init (JNIEnv *env, jclass clz, jobject o) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -6683,10 +6846,9 @@ LDKCVec_TxidZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) {
        }
        return ret_constr;
 }
-static void* LDKConfirm_JCalls_clone(const void* this_arg) {
-       LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
+static void LDKConfirm_JCalls_cloned(LDKConfirm* new_obj) {
+       LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKConfirm LDKConfirm_init (JNIEnv *env, jclass clz, jobject o) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -6853,10 +7015,9 @@ LDKCOption_C2Tuple_usizeTransactionZZ register_output_LDKFilter_jcall(const void
        }
        return ret_conv;
 }
-static void* LDKFilter_JCalls_clone(const void* this_arg) {
-       LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
+static void LDKFilter_JCalls_cloned(LDKFilter* new_obj) {
+       LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKFilter LDKFilter_init (JNIEnv *env, jclass clz, jobject o) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -7016,10 +7177,9 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal
        }
        return ret_conv;
 }
-static void* LDKPersist_JCalls_clone(const void* this_arg) {
-       LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
+static void LDKPersist_JCalls_cloned(LDKPersist* new_obj) {
+       LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKPersist LDKPersist_init (JNIEnv *env, jclass clz, jobject o) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -7734,11 +7894,10 @@ void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublic
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
 }
-static void* LDKChannelMessageHandler_JCalls_clone(const void* this_arg) {
-       LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
+static void LDKChannelMessageHandler_JCalls_cloned(LDKChannelMessageHandler* new_obj) {
+       LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
        atomic_fetch_add_explicit(&j_calls->MessageSendEventsProvider->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKChannelMessageHandler LDKChannelMessageHandler_init (JNIEnv *env, jclass clz, jobject o, jobject MessageSendEventsProvider) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -7821,6 +7980,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1n
        *res_ptr = LDKChannelMessageHandler_init(env, clz, o, MessageSendEventsProvider);
        return (uint64_t)res_ptr;
 }
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1get_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKChannelMessageHandler *inp = (LDKChannelMessageHandler *)(arg & ~1);
+       uint64_t res_ptr = (uint64_t)&inp->MessageSendEventsProvider;
+       DO_ASSERT((res_ptr & 1) == 0);
+       return (int64_t)(res_ptr | 1);
+}
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1open_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t their_features, int64_t msg) {
        LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
        LDKPublicKey their_node_id_ref;
@@ -8429,11 +8594,10 @@ LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageH
        }
        return ret_conv;
 }
-static void* LDKRoutingMessageHandler_JCalls_clone(const void* this_arg) {
-       LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
+static void LDKRoutingMessageHandler_JCalls_cloned(LDKRoutingMessageHandler* new_obj) {
+       LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
        atomic_fetch_add_explicit(&j_calls->MessageSendEventsProvider->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKRoutingMessageHandler LDKRoutingMessageHandler_init (JNIEnv *env, jclass clz, jobject o, jobject MessageSendEventsProvider) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -8489,6 +8653,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1n
        *res_ptr = LDKRoutingMessageHandler_init(env, clz, o, MessageSendEventsProvider);
        return (uint64_t)res_ptr;
 }
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1get_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKRoutingMessageHandler *inp = (LDKRoutingMessageHandler *)(arg & ~1);
+       uint64_t res_ptr = (uint64_t)&inp->MessageSendEventsProvider;
+       DO_ASSERT((res_ptr & 1) == 0);
+       return (int64_t)(res_ptr | 1);
+}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1node_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
        LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
        LDKNodeAnnouncement msg_conv;
@@ -8744,10 +8914,9 @@ uint64_t hash_LDKSocketDescriptor_jcall(const void* this_arg) {
        }
        return ret;
 }
-static void* LDKSocketDescriptor_JCalls_clone(const void* this_arg) {
-       LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
+static void LDKSocketDescriptor_JCalls_cloned(LDKSocketDescriptor* new_obj) {
+       LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKSocketDescriptor LDKSocketDescriptor_init (JNIEnv *env, jclass clz, jobject o) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -8771,7 +8940,7 @@ static inline LDKSocketDescriptor LDKSocketDescriptor_init (JNIEnv *env, jclass
                .disconnect_socket = disconnect_socket_LDKSocketDescriptor_jcall,
                .eq = eq_LDKSocketDescriptor_jcall,
                .hash = hash_LDKSocketDescriptor_jcall,
-               .clone = LDKSocketDescriptor_JCalls_clone,
+               .cloned = LDKSocketDescriptor_JCalls_cloned,
                .free = LDKSocketDescriptor_JCalls_free,
        };
        return ret;
@@ -8856,10 +9025,9 @@ LDKCResult_NoneErrorZ persist_manager_LDKChannelManagerPersister_jcall(const voi
        }
        return ret_conv;
 }
-static void* LDKChannelManagerPersister_JCalls_clone(const void* this_arg) {
-       LDKChannelManagerPersister_JCalls *j_calls = (LDKChannelManagerPersister_JCalls*) this_arg;
+static void LDKChannelManagerPersister_JCalls_cloned(LDKChannelManagerPersister* new_obj) {
+       LDKChannelManagerPersister_JCalls *j_calls = (LDKChannelManagerPersister_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKChannelManagerPersister LDKChannelManagerPersister_init (JNIEnv *env, jclass clz, jobject o) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -8942,12 +9110,14 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFallback_1ref_1from_1ptr
 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;
 }
 
@@ -10189,7 +10359,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1
        LDKSign o_conv = *(LDKSign*)(((uint64_t)o) & ~1);
        if (o_conv.free == LDKSign_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKSign_JCalls_clone(o_conv.this_arg);
+               LDKSign_JCalls_cloned(&o_conv);
        }
        LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
        *ret_conv = CResult_SignDecodeErrorZ_ok(o_conv);
@@ -10589,6 +10759,36 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFai
        return (uint64_t)ret_conv;
 }
 
+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 (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) {
+       LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(((uint64_t)e) & ~1);
+       LDKCResult_PaymentHashPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashPaymentSendFailureZ), "LDKCResult_PaymentHashPaymentSendFailureZ");
+       *ret_conv = CResult_PaymentHashPaymentSendFailureZ_err(e_conv);
+       return (uint64_t)ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+       if ((_res & 1) != 0) return;
+       LDKCResult_PaymentHashPaymentSendFailureZ _res_conv = *(LDKCResult_PaymentHashPaymentSendFailureZ*)(((uint64_t)_res) & ~1);
+       FREE((void*)_res);
+       CResult_PaymentHashPaymentSendFailureZ_free(_res_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*)(orig & ~1);
+       LDKCResult_PaymentHashPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashPaymentSendFailureZ), "LDKCResult_PaymentHashPaymentSendFailureZ");
+       *ret_conv = CResult_PaymentHashPaymentSendFailureZ_clone(orig_conv);
+       return (uint64_t)ret_conv;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NetAddressZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
        LDKCVec_NetAddressZ _res_constr;
        _res_constr.datalen = (*env)->GetArrayLength(env, _res);
@@ -13253,6 +13453,21 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreat
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
+       if ((this_ptr & 1) != 0) return;
+       LDKPaymentPurpose this_ptr_conv = *(LDKPaymentPurpose*)(((uint64_t)this_ptr) & ~1);
+       FREE((void*)this_ptr);
+       PaymentPurpose_free(this_ptr_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+       LDKPaymentPurpose* orig_conv = (LDKPaymentPurpose*)orig;
+       LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
+       *ret_copy = PaymentPurpose_clone(orig_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
        if ((this_ptr & 1) != 0) return;
        LDKEvent this_ptr_conv = *(LDKEvent*)(((uint64_t)this_ptr) & ~1);
@@ -14187,7 +14402,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1new(JNIEnv *e
                chain_source_conv = *(LDKFilter*)(((uint64_t)chain_source) & ~1);
                if (chain_source_conv.free == LDKFilter_JCalls_free) {
                        // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-                       LDKFilter_JCalls_clone(chain_source_conv.this_arg);
+                       LDKFilter_JCalls_cloned(&chain_source_conv);
                }
                chain_source_conv_ptr = MALLOC(sizeof(LDKFilter), "LDKFilter");
                *chain_source_conv_ptr = chain_source_conv;
@@ -14195,22 +14410,22 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1new(JNIEnv *e
        LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
        if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
+               LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
        }
        LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
        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_clone(logger_conv.this_arg);
+               LDKLogger_JCalls_cloned(&logger_conv);
        }
        LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)(((uint64_t)feeest) & ~1);
        if (feeest_conv.free == LDKFeeEstimator_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKFeeEstimator_JCalls_clone(feeest_conv.this_arg);
+               LDKFeeEstimator_JCalls_cloned(&feeest_conv);
        }
        LDKPersist persister_conv = *(LDKPersist*)(((uint64_t)persister) & ~1);
        if (persister_conv.free == LDKPersist_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKPersist_JCalls_clone(persister_conv.this_arg);
+               LDKPersist_JCalls_cloned(&persister_conv);
        }
        LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv_ptr, broadcaster_conv, logger_conv, feeest_conv, persister_conv);
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
@@ -14568,17 +14783,17 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_
        LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
        if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
+               LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
        }
        LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
        if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
+               LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
        }
        LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
        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_clone(logger_conv.this_arg);
+               LDKLogger_JCalls_cloned(&logger_conv);
        }
        LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_block_connected(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv);
        int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
@@ -14604,17 +14819,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_1disconn
        LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
        if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
+               LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
        }
        LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
        if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
+               LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
        }
        LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
        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_clone(logger_conv.this_arg);
+               LDKLogger_JCalls_cloned(&logger_conv);
        }
        ChannelMonitor_block_disconnected(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
 }
@@ -14644,17 +14859,17 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1transa
        LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
        if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
+               LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
        }
        LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
        if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
+               LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
        }
        LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
        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_clone(logger_conv.this_arg);
+               LDKLogger_JCalls_cloned(&logger_conv);
        }
        LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_transactions_confirmed(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv);
        int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
@@ -14680,17 +14895,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1transaction_1u
        LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
        if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
+               LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
        }
        LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
        if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
+               LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
        }
        LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
        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_clone(logger_conv.this_arg);
+               LDKLogger_JCalls_cloned(&logger_conv);
        }
        ChannelMonitor_transaction_unconfirmed(&this_arg_conv, txid_ref, broadcaster_conv, fee_estimator_conv, logger_conv);
 }
@@ -14706,17 +14921,17 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1best_1
        LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
        if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
+               LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
        }
        LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
        if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
+               LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
        }
        LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
        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_clone(logger_conv.this_arg);
+               LDKLogger_JCalls_cloned(&logger_conv);
        }
        LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_best_block_updated(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
        int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
@@ -16162,27 +16377,27 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1new(JNIEnv
        LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(((uint64_t)fee_est) & ~1);
        if (fee_est_conv.free == LDKFeeEstimator_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKFeeEstimator_JCalls_clone(fee_est_conv.this_arg);
+               LDKFeeEstimator_JCalls_cloned(&fee_est_conv);
        }
        LDKWatch chain_monitor_conv = *(LDKWatch*)(((uint64_t)chain_monitor) & ~1);
        if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKWatch_JCalls_clone(chain_monitor_conv.this_arg);
+               LDKWatch_JCalls_cloned(&chain_monitor_conv);
        }
        LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)tx_broadcaster) & ~1);
        if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKBroadcasterInterface_JCalls_clone(tx_broadcaster_conv.this_arg);
+               LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv);
        }
        LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
        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_clone(logger_conv.this_arg);
+               LDKLogger_JCalls_cloned(&logger_conv);
        }
        LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(((uint64_t)keys_manager) & ~1);
        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_clone(keys_manager_conv.this_arg);
+               LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
        }
        LDKUserConfig config_conv;
        config_conv.inner = (void*)(config & (~1));
@@ -16327,6 +16542,21 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payme
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1spontaneous_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_preimage) {
+       LDKChannelManager this_arg_conv;
+       this_arg_conv.inner = (void*)(this_arg & (~1));
+       this_arg_conv.is_owned = false;
+       LDKRoute route_conv;
+       route_conv.inner = (void*)(route & (~1));
+       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_PaymentHashPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashPaymentSendFailureZ), "LDKCResult_PaymentHashPaymentSendFailureZ");
+       *ret_conv = ChannelManager_send_spontaneous_payment(&this_arg_conv, &route_conv, payment_preimage_ref);
+       return (uint64_t)ret_conv;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1funding_1transaction_1generated(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray temporary_channel_id, int8_tArray funding_transaction) {
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
@@ -16557,7 +16787,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1k
        LDKKeysInterface val_conv = *(LDKKeysInterface*)(((uint64_t)val) & ~1);
        if (val_conv.free == LDKKeysInterface_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKKeysInterface_JCalls_clone(val_conv.this_arg);
+               LDKKeysInterface_JCalls_cloned(&val_conv);
        }
        ChannelManagerReadArgs_set_keys_manager(&this_ptr_conv, val_conv);
 }
@@ -16577,7 +16807,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1f
        LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(((uint64_t)val) & ~1);
        if (val_conv.free == LDKFeeEstimator_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKFeeEstimator_JCalls_clone(val_conv.this_arg);
+               LDKFeeEstimator_JCalls_cloned(&val_conv);
        }
        ChannelManagerReadArgs_set_fee_estimator(&this_ptr_conv, val_conv);
 }
@@ -16597,7 +16827,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1c
        LDKWatch val_conv = *(LDKWatch*)(((uint64_t)val) & ~1);
        if (val_conv.free == LDKWatch_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKWatch_JCalls_clone(val_conv.this_arg);
+               LDKWatch_JCalls_cloned(&val_conv);
        }
        ChannelManagerReadArgs_set_chain_monitor(&this_ptr_conv, val_conv);
 }
@@ -16617,7 +16847,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1t
        LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(((uint64_t)val) & ~1);
        if (val_conv.free == LDKBroadcasterInterface_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKBroadcasterInterface_JCalls_clone(val_conv.this_arg);
+               LDKBroadcasterInterface_JCalls_cloned(&val_conv);
        }
        ChannelManagerReadArgs_set_tx_broadcaster(&this_ptr_conv, val_conv);
 }
@@ -16637,7 +16867,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1l
        LDKLogger val_conv = *(LDKLogger*)(((uint64_t)val) & ~1);
        if (val_conv.free == LDKLogger_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKLogger_JCalls_clone(val_conv.this_arg);
+               LDKLogger_JCalls_cloned(&val_conv);
        }
        ChannelManagerReadArgs_set_logger(&this_ptr_conv, val_conv);
 }
@@ -16671,27 +16901,27 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new
        LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(((uint64_t)keys_manager) & ~1);
        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_clone(keys_manager_conv.this_arg);
+               LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
        }
        LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
        if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
+               LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
        }
        LDKWatch chain_monitor_conv = *(LDKWatch*)(((uint64_t)chain_monitor) & ~1);
        if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKWatch_JCalls_clone(chain_monitor_conv.this_arg);
+               LDKWatch_JCalls_cloned(&chain_monitor_conv);
        }
        LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)tx_broadcaster) & ~1);
        if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKBroadcasterInterface_JCalls_clone(tx_broadcaster_conv.this_arg);
+               LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv);
        }
        LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
        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_clone(logger_conv.this_arg);
+               LDKLogger_JCalls_cloned(&logger_conv);
        }
        LDKUserConfig default_config_conv;
        default_config_conv.inner = (void*)(default_config & (~1));
@@ -16850,6 +17080,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1data(JNI
        this_ptr_conv.is_owned = false;
        LDKStr ret_str = ErrorMessage_get_data(&this_ptr_conv);
        jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -20150,6 +20381,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1err(JN
        this_ptr_conv.is_owned = false;
        LDKStr ret_str = LightningError_get_err(&this_ptr_conv);
        jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -21234,7 +21466,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1chan_1han
        LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)(((uint64_t)val) & ~1);
        if (val_conv.free == LDKChannelMessageHandler_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKChannelMessageHandler_JCalls_clone(val_conv.this_arg);
+               LDKChannelMessageHandler_JCalls_cloned(&val_conv);
        }
        MessageHandler_set_chan_handler(&this_ptr_conv, val_conv);
 }
@@ -21254,7 +21486,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1route_1ha
        LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)(((uint64_t)val) & ~1);
        if (val_conv.free == LDKRoutingMessageHandler_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKRoutingMessageHandler_JCalls_clone(val_conv.this_arg);
+               LDKRoutingMessageHandler_JCalls_cloned(&val_conv);
        }
        MessageHandler_set_route_handler(&this_ptr_conv, val_conv);
 }
@@ -21263,12 +21495,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new(JNIEnv
        LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)(((uint64_t)chan_handler_arg) & ~1);
        if (chan_handler_arg_conv.free == LDKChannelMessageHandler_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKChannelMessageHandler_JCalls_clone(chan_handler_arg_conv.this_arg);
+               LDKChannelMessageHandler_JCalls_cloned(&chan_handler_arg_conv);
        }
        LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)(((uint64_t)route_handler_arg) & ~1);
        if (route_handler_arg_conv.free == LDKRoutingMessageHandler_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKRoutingMessageHandler_JCalls_clone(route_handler_arg_conv.this_arg);
+               LDKRoutingMessageHandler_JCalls_cloned(&route_handler_arg_conv);
        }
        LDKMessageHandler ret_var = MessageHandler_new(chan_handler_arg_conv, route_handler_arg_conv);
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
@@ -21363,7 +21595,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new(JNIEnv *en
        LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
        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_clone(logger_conv.this_arg);
+               LDKLogger_JCalls_cloned(&logger_conv);
        }
        LDKPeerManager ret_var = PeerManager_new(message_handler_conv, our_node_secret_ref, ephemeral_random_data_ref, logger_conv);
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
@@ -21401,7 +21633,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1outbound_
        LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(((uint64_t)descriptor) & ~1);
        if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKSocketDescriptor_JCalls_clone(descriptor_conv.this_arg);
+               LDKSocketDescriptor_JCalls_cloned(&descriptor_conv);
        }
        LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
        *ret_conv = PeerManager_new_outbound_connection(&this_arg_conv, their_node_id_ref, descriptor_conv);
@@ -21415,7 +21647,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1inbound_1
        LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(((uint64_t)descriptor) & ~1);
        if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKSocketDescriptor_JCalls_clone(descriptor_conv.this_arg);
+               LDKSocketDescriptor_JCalls_cloned(&descriptor_conv);
        }
        LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
        *ret_conv = PeerManager_new_inbound_connection(&this_arg_conv, descriptor_conv);
@@ -23707,6 +23939,58 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1clone(JNIEnv
        return ret_ref;
 }
 
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_get_1keysend_1route(JNIEnv *env, jclass clz, int8_tArray our_node_id, int64_t network, int8_tArray payee, int64_tArray first_hops, int64_tArray last_hops, int64_t final_value_msat, int32_t final_cltv, int64_t logger) {
+       LDKPublicKey our_node_id_ref;
+       CHECK((*env)->GetArrayLength(env, our_node_id) == 33);
+       (*env)->GetByteArrayRegion(env, our_node_id, 0, 33, our_node_id_ref.compressed_form);
+       LDKNetworkGraph network_conv;
+       network_conv.inner = (void*)(network & (~1));
+       network_conv.is_owned = false;
+       LDKPublicKey payee_ref;
+       CHECK((*env)->GetArrayLength(env, payee) == 33);
+       (*env)->GetByteArrayRegion(env, payee, 0, 33, payee_ref.compressed_form);
+       LDKCVec_ChannelDetailsZ first_hops_constr;
+       first_hops_constr.datalen = (*env)->GetArrayLength(env, first_hops);
+       if (first_hops_constr.datalen > 0)
+               first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
+       else
+               first_hops_constr.data = NULL;
+       int64_t* first_hops_vals = (*env)->GetLongArrayElements (env, first_hops, NULL);
+       for (size_t q = 0; q < first_hops_constr.datalen; q++) {
+               int64_t first_hops_conv_16 = first_hops_vals[q];
+               LDKChannelDetails first_hops_conv_16_conv;
+               first_hops_conv_16_conv.inner = (void*)(first_hops_conv_16 & (~1));
+               first_hops_conv_16_conv.is_owned = (first_hops_conv_16 & 1) || (first_hops_conv_16 == 0);
+               first_hops_constr.data[q] = first_hops_conv_16_conv;
+       }
+       (*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0);
+       LDKCVec_RouteHintZ last_hops_constr;
+       last_hops_constr.datalen = (*env)->GetArrayLength(env, last_hops);
+       if (last_hops_constr.datalen > 0)
+               last_hops_constr.data = MALLOC(last_hops_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
+       else
+               last_hops_constr.data = NULL;
+       int64_t* last_hops_vals = (*env)->GetLongArrayElements (env, last_hops, NULL);
+       for (size_t l = 0; l < last_hops_constr.datalen; l++) {
+               int64_t last_hops_conv_11 = last_hops_vals[l];
+               LDKRouteHint last_hops_conv_11_conv;
+               last_hops_conv_11_conv.inner = (void*)(last_hops_conv_11 & (~1));
+               last_hops_conv_11_conv.is_owned = (last_hops_conv_11 & 1) || (last_hops_conv_11 == 0);
+               last_hops_conv_11_conv = RouteHint_clone(&last_hops_conv_11_conv);
+               last_hops_constr.data[l] = last_hops_conv_11_conv;
+       }
+       (*env)->ReleaseLongArrayElements(env, last_hops, last_hops_vals, 0);
+       LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+       if (logger_conv.free == LDKLogger_JCalls_free) {
+               // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+               LDKLogger_JCalls_cloned(&logger_conv);
+       }
+       LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
+       *ret_conv = get_keysend_route(our_node_id_ref, &network_conv, payee_ref, &first_hops_constr, last_hops_constr, final_value_msat, final_cltv, logger_conv);
+       FREE(first_hops_constr.data);
+       return (uint64_t)ret_conv;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_get_1route(JNIEnv *env, jclass clz, int8_tArray our_node_id, int64_t network, int8_tArray payee, int64_t payee_features, int64_tArray first_hops, int64_tArray last_hops, int64_t final_value_msat, int32_t final_cltv, int64_t logger) {
        LDKPublicKey our_node_id_ref;
        CHECK((*env)->GetArrayLength(env, our_node_id) == 33);
@@ -23755,7 +24039,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_get_1route(JNIEnv *env, jcl
        LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
        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_clone(logger_conv.this_arg);
+               LDKLogger_JCalls_cloned(&logger_conv);
        }
        LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
        *ret_conv = get_route(our_node_id_ref, &network_conv, payee_ref, payee_features_conv, &first_hops_constr, last_hops_constr, final_value_msat, final_cltv, logger_conv);
@@ -23808,7 +24092,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new(JNI
                chain_access_conv = *(LDKAccess*)(((uint64_t)chain_access) & ~1);
                if (chain_access_conv.free == LDKAccess_JCalls_free) {
                        // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-                       LDKAccess_JCalls_clone(chain_access_conv.this_arg);
+                       LDKAccess_JCalls_cloned(&chain_access_conv);
                }
                chain_access_conv_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess");
                *chain_access_conv_ptr = chain_access_conv;
@@ -23816,7 +24100,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new(JNI
        LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
        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_clone(logger_conv.this_arg);
+               LDKLogger_JCalls_cloned(&logger_conv);
        }
        LDKNetGraphMsgHandler ret_var = NetGraphMsgHandler_new(genesis_hash_ref, chain_access_conv_ptr, logger_conv);
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
@@ -23835,7 +24119,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1from_1n
                chain_access_conv = *(LDKAccess*)(((uint64_t)chain_access) & ~1);
                if (chain_access_conv.free == LDKAccess_JCalls_free) {
                        // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-                       LDKAccess_JCalls_clone(chain_access_conv.this_arg);
+                       LDKAccess_JCalls_cloned(&chain_access_conv);
                }
                chain_access_conv_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess");
                *chain_access_conv_ptr = chain_access_conv;
@@ -23843,7 +24127,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1from_1n
        LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
        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_clone(logger_conv.this_arg);
+               LDKLogger_JCalls_cloned(&logger_conv);
        }
        LDKNetworkGraph network_graph_conv;
        network_graph_conv.inner = (void*)(network_graph & (~1));
@@ -23869,7 +24153,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1add_1chain
                chain_access_conv = *(LDKAccess*)(((uint64_t)chain_access) & ~1);
                if (chain_access_conv.free == LDKAccess_JCalls_free) {
                        // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-                       LDKAccess_JCalls_clone(chain_access_conv.this_arg);
+                       LDKAccess_JCalls_cloned(&chain_access_conv);
                }
                chain_access_conv_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess");
                *chain_access_conv_ptr = chain_access_conv;
@@ -24857,7 +25141,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1chann
                chain_access_conv = *(LDKAccess*)(((uint64_t)chain_access) & ~1);
                if (chain_access_conv.free == LDKAccess_JCalls_free) {
                        // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-                       LDKAccess_JCalls_clone(chain_access_conv.this_arg);
+                       LDKAccess_JCalls_cloned(&chain_access_conv);
                }
                chain_access_conv_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess");
                *chain_access_conv_ptr = chain_access_conv;
@@ -24880,7 +25164,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1chann
                chain_access_conv = *(LDKAccess*)(((uint64_t)chain_access) & ~1);
                if (chain_access_conv.free == LDKAccess_JCalls_free) {
                        // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-                       LDKAccess_JCalls_clone(chain_access_conv.this_arg);
+                       LDKAccess_JCalls_cloned(&chain_access_conv);
                }
                chain_access_conv_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess");
                *chain_access_conv_ptr = chain_access_conv;
@@ -24946,6 +25230,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1get_1d
        this_arg_conv.is_owned = false;
        LDKStr ret_str = FilesystemPersister_get_data_dir(&this_arg_conv);
        jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -24966,7 +25251,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1read_1
        LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(((uint64_t)keys_manager) & ~1);
        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_clone(keys_manager_conv.this_arg);
+               LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
        }
        LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ");
        *ret_conv = FilesystemPersister_read_channelmonitors(&this_arg_conv, keys_manager_conv);
@@ -25000,12 +25285,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1start(
        LDKChannelManagerPersister persister_conv = *(LDKChannelManagerPersister*)(((uint64_t)persister) & ~1);
        if (persister_conv.free == LDKChannelManagerPersister_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKChannelManagerPersister_JCalls_clone(persister_conv.this_arg);
+               LDKChannelManagerPersister_JCalls_cloned(&persister_conv);
        }
        LDKEventHandler event_handler_conv = *(LDKEventHandler*)(((uint64_t)event_handler) & ~1);
        if (event_handler_conv.free == LDKEventHandler_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKEventHandler_JCalls_clone(event_handler_conv.this_arg);
+               LDKEventHandler_JCalls_cloned(&event_handler_conv);
        }
        LDKChainMonitor chain_monitor_conv;
        chain_monitor_conv.inner = (void*)(chain_monitor & (~1));
@@ -25019,7 +25304,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1start(
        LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
        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_clone(logger_conv.this_arg);
+               LDKLogger_JCalls_cloned(&logger_conv);
        }
        LDKBackgroundProcessor ret_var = BackgroundProcessor_start(persister_conv, event_handler_conv, &chain_monitor_conv, &channel_manager_conv, &peer_manager_conv, logger_conv);
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
@@ -25965,6 +26250,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Description_1into_1inner(JN
        this_arg_conv = Description_clone(&this_arg_conv);
        LDKStr ret_str = Description_into_inner(this_arg_conv);
        jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -26038,6 +26324,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_CreationError_1to_1str(JNIE
        LDKCreationError* o_conv = (LDKCreationError*)(o & ~1);
        LDKStr ret_str = CreationError_to_str(o_conv);
        jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -26058,6 +26345,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SemanticError_1to_1str(JNIE
        LDKSemanticError* o_conv = (LDKSemanticError*)(o & ~1);
        LDKStr ret_str = SemanticError_to_str(o_conv);
        jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -26087,6 +26375,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1to_1st
        LDKSignOrCreationError* o_conv = (LDKSignOrCreationError*)o;
        LDKStr ret_str = SignOrCreationError_to_str(o_conv);
        jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -26097,7 +26386,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1chan
        LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(((uint64_t)keys_manager) & ~1);
        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_clone(keys_manager_conv.this_arg);
+               LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
        }
        LDKCurrency network_conv = LDKCurrency_from_java(env, network);
        LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(((uint64_t)amt_msat) & ~1);
@@ -26134,6 +26423,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Invoice_1to_1str(JNIEnv *en
        o_conv.is_owned = false;
        LDKStr ret_str = Invoice_to_str(&o_conv);
        jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -26143,6 +26433,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1to_1str(J
        o_conv.is_owned = false;
        LDKStr ret_str = SignedRawInvoice_to_str(&o_conv);
        jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -26150,6 +26441,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Currency_1to_1str(JNIEnv *e
        LDKCurrency* o_conv = (LDKCurrency*)(o & ~1);
        LDKStr ret_str = Currency_to_str(o_conv);
        jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -26157,6 +26449,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SiPrefix_1to_1str(JNIEnv *e
        LDKSiPrefix* o_conv = (LDKSiPrefix*)(o & ~1);
        LDKStr ret_str = SiPrefix_to_str(o_conv);
        jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
index 06beaea6b325ba5b0f18a1a832150b7ff39ebf4c..38cec5434092e124d8de650fa580deaeefef74f9 100644 (file)
 #include <stdlib.h>
 
 #define DEBUG_PRINT(...) fprintf(stderr, __VA_ARGS__)
-#define MALLOC(a, _) malloc(a)
-#define FREE(p) if ((uint64_t)(p) > 1024) { free(p); }
-#define DO_ASSERT(a) (void)(a)
-#define CHECK(a)
+#include <assert.h>
+// Always run a, then assert it is true:
+#define DO_ASSERT(a) do { bool _assert_val = (a); assert(_assert_val); } while(0)
+// Assert a is true or do nothing
+#define CHECK(a) DO_ASSERT(a)
+
+void __attribute__((constructor)) debug_log_version() {
+       if (check_get_ldk_version() == NULL)
+               DEBUG_PRINT("LDK version did not match the header we built against\n");
+       if (check_get_ldk_bindings_version() == NULL)
+               DEBUG_PRINT("LDK C Bindings version did not match the header we built against\n");
+       DEBUG_PRINT("Loaded LDK-Java Bindings with LDK %s and LDK-C-Bindings %s\n", check_get_ldk_version(), check_get_ldk_bindings_version());
+}
+
+// Running a leak check across all the allocations and frees of the JDK is a mess,
+// so instead we implement our own naive leak checker here, relying on the -wrap
+// linker option to wrap malloc/calloc/realloc/free, tracking everyhing allocated
+// and free'd in Rust or C across the generated bindings shared library.
+#include <threads.h>
+#include <execinfo.h>
+
+#include <unistd.h>
+static mtx_t allocation_mtx;
+
+void __attribute__((constructor)) init_mtx() {
+       DO_ASSERT(mtx_init(&allocation_mtx, mtx_plain) == thrd_success);
+}
+
+#define BT_MAX 128
+typedef struct allocation {
+       struct allocation* next;
+       void* ptr;
+       const char* struct_name;
+       void* bt[BT_MAX];
+       int bt_len;
+       unsigned long alloc_len;
+} allocation;
+static allocation* allocation_ll = NULL;
+
+void* __real_malloc(size_t len);
+void* __real_calloc(size_t nmemb, size_t len);
+static void new_allocation(void* res, const char* struct_name, size_t len) {
+       allocation* new_alloc = __real_malloc(sizeof(allocation));
+       new_alloc->ptr = res;
+       new_alloc->struct_name = struct_name;
+       new_alloc->bt_len = backtrace(new_alloc->bt, BT_MAX);
+       new_alloc->alloc_len = len;
+       DO_ASSERT(mtx_lock(&allocation_mtx) == thrd_success);
+       new_alloc->next = allocation_ll;
+       allocation_ll = new_alloc;
+       DO_ASSERT(mtx_unlock(&allocation_mtx) == thrd_success);
+}
+static void* MALLOC(size_t len, const char* struct_name) {
+       void* res = __real_malloc(len);
+       new_allocation(res, struct_name, len);
+       return res;
+}
+void __real_free(void* ptr);
+static void alloc_freed(void* ptr) {
+       allocation* p = NULL;
+       DO_ASSERT(mtx_lock(&allocation_mtx) == thrd_success);
+       allocation* it = allocation_ll;
+       while (it->ptr != ptr) {
+               p = it; it = it->next;
+               if (it == NULL) {
+                       DEBUG_PRINT("Tried to free unknown pointer %p at:\n", ptr);
+                       void* bt[BT_MAX];
+                       int bt_len = backtrace(bt, BT_MAX);
+                       backtrace_symbols_fd(bt, bt_len, STDERR_FILENO);
+                       DEBUG_PRINT("\n\n");
+                       DO_ASSERT(mtx_unlock(&allocation_mtx) == thrd_success);
+                       return; // addrsan should catch malloc-unknown and print more info than we have
+               }
+       }
+       if (p) { p->next = it->next; } else { allocation_ll = it->next; }
+       DO_ASSERT(mtx_unlock(&allocation_mtx) == thrd_success);
+       DO_ASSERT(it->ptr == ptr);
+       __real_free(it);
+}
+static void FREE(void* ptr) {
+       if ((uint64_t)ptr < 1024) return; // Rust loves to create pointers to the NULL page for dummys
+       alloc_freed(ptr);
+       __real_free(ptr);
+}
+
+void* __wrap_malloc(size_t len) {
+       void* res = __real_malloc(len);
+       new_allocation(res, "malloc call", len);
+       return res;
+}
+void* __wrap_calloc(size_t nmemb, size_t len) {
+       void* res = __real_calloc(nmemb, len);
+       new_allocation(res, "calloc call", len);
+       return res;
+}
+void __wrap_free(void* ptr) {
+       if (ptr == NULL) return;
+       alloc_freed(ptr);
+       __real_free(ptr);
+}
+
+void* __real_realloc(void* ptr, size_t newlen);
+void* __wrap_realloc(void* ptr, size_t len) {
+       if (ptr != NULL) alloc_freed(ptr);
+       void* res = __real_realloc(ptr, len);
+       new_allocation(res, "realloc call", len);
+       return res;
+}
+void __wrap_reallocarray(void* ptr, size_t new_sz) {
+       // Rust doesn't seem to use reallocarray currently
+       DO_ASSERT(false);
+}
+
+void __attribute__((destructor)) check_leaks() {
+       unsigned long alloc_count = 0;
+       unsigned long alloc_size = 0;
+       DEBUG_PRINT("The following LDK-allocated blocks still remain.\n");
+       DEBUG_PRINT("Note that this is only accurate if System.gc(); System.runFinalization()\n");
+       DEBUG_PRINT("was called prior to exit after all LDK objects were out of scope.\n");
+       for (allocation* a = allocation_ll; a != NULL; a = a->next) {
+               DEBUG_PRINT("%s %p (%lu bytes) remains:\n", a->struct_name, a->ptr, a->alloc_len);
+               backtrace_symbols_fd(a->bt, a->bt_len, STDERR_FILENO);
+               DEBUG_PRINT("\n\n");
+               alloc_count++;
+               alloc_size += a->alloc_len;
+       }
+       DEBUG_PRINT("%lu allocations remained for %lu bytes.\n", alloc_count, alloc_size);
+       DEBUG_PRINT("Note that this is only accurate if System.gc(); System.runFinalization()\n");
+       DEBUG_PRINT("was called prior to exit after all LDK objects were out of scope.\n");
+}
 
 static jmethodID ordinal_meth = NULL;
 static jmethodID slicedef_meth = NULL;
@@ -131,7 +257,7 @@ static inline LDKStr java_to_owned_str(JNIEnv *env, jstring str) {
 }
 
 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_get_1lib_1version_1string(JNIEnv *env, jclass _c) {
-       return str_ref_to_java(env, "v0.0.99.1", strlen("v0.0.99.1"));
+       return str_ref_to_java(env, "v0.0.99.1-7-gf7a4eb8-dirty", strlen("v0.0.99.1-7-gf7a4eb8-dirty"));
 }
 JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_get_1ldk_1c_1bindings_1version(JNIEnv *env, jclass _c) {
        return str_ref_to_java(env, check_get_ldk_bindings_version(), strlen(check_get_ldk_bindings_version()));
@@ -2469,11 +2595,6 @@ void ready_channel_LDKBaseSign_jcall(void* this_arg, const LDKChannelTransaction
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
 }
-static void* LDKBaseSign_JCalls_clone(const void* this_arg) {
-       LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
-       atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
-}
 static inline LDKBaseSign LDKBaseSign_init (JNIEnv *env, jclass clz, jobject o, int64_t pubkeys) {
        jclass c = (*env)->GetObjectClass(env, o);
        CHECK(c != NULL);
@@ -2723,11 +2844,10 @@ LDKCVec_u8Z write_LDKSign_jcall(const void* this_arg) {
        }
        return ret_ref;
 }
-static void* LDKSign_JCalls_clone(const void* this_arg) {
-       LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
+static void LDKSign_JCalls_cloned(LDKSign* new_obj) {
+       LDKSign_JCalls *j_calls = (LDKSign_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
        atomic_fetch_add_explicit(&j_calls->BaseSign->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKSign LDKSign_init (JNIEnv *env, jclass clz, jobject o, jobject BaseSign, int64_t pubkeys) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -2747,7 +2867,7 @@ static inline LDKSign LDKSign_init (JNIEnv *env, jclass clz, jobject o, jobject
        LDKSign ret = {
                .this_arg = (void*) calls,
                .write = write_LDKSign_jcall,
-               .clone = LDKSign_JCalls_clone,
+               .cloned = LDKSign_JCalls_cloned,
                .free = LDKSign_JCalls_free,
                .BaseSign = LDKBaseSign_init(env, clz, BaseSign, pubkeys),
        };
@@ -2759,6 +2879,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKSign_1new(JNIEnv *env, j
        *res_ptr = LDKSign_init(env, clz, o, BaseSign, pubkeys);
        return (uint64_t)res_ptr;
 }
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKSign_1get_1BaseSign(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKSign *inp = (LDKSign *)(arg & ~1);
+       uint64_t res_ptr = (uint64_t)&inp->BaseSign;
+       DO_ASSERT((res_ptr & 1) == 0);
+       return (int64_t)(res_ptr | 1);
+}
 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Sign_1write(JNIEnv *env, jclass clz, int64_t this_arg) {
        LDKSign* this_arg_conv = (LDKSign*)(((uint64_t)this_arg) & ~1);
        LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
@@ -3209,6 +3335,22 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSend
        uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1;
        return err_ref;
 }
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentHashPaymentSendFailureZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+       return ((LDKCResult_PaymentHashPaymentSendFailureZ*)arg)->result_ok;
+}
+JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentHashPaymentSendFailureZ_1get_1ok(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_PaymentHashPaymentSendFailureZ *val = (LDKCResult_PaymentHashPaymentSendFailureZ*)(arg & ~1);
+       CHECK(val->result_ok);
+       int8_tArray res_arr = (*env)->NewByteArray(env, 32);
+       (*env)->SetByteArrayRegion(env, res_arr, 0, 32, (*val->contents.result).data);
+       return res_arr;
+}
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentHashPaymentSendFailureZ_1get_1err(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKCResult_PaymentHashPaymentSendFailureZ *val = (LDKCResult_PaymentHashPaymentSendFailureZ*)(arg & ~1);
+       CHECK(!val->result_ok);
+       uint64_t err_ref = ((uint64_t)&(*val->contents.err)) | 1;
+       return err_ref;
+}
 static jclass LDKNetAddress_IPv4_class = NULL;
 static jmethodID LDKNetAddress_IPv4_meth = NULL;
 static jclass LDKNetAddress_IPv6_class = NULL;
@@ -3491,10 +3633,9 @@ LDKCVec_MonitorEventZ release_pending_monitor_events_LDKWatch_jcall(const void*
        }
        return ret_constr;
 }
-static void* LDKWatch_JCalls_clone(const void* this_arg) {
-       LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
+static void LDKWatch_JCalls_cloned(LDKWatch* new_obj) {
+       LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKWatch LDKWatch_init (JNIEnv *env, jclass clz, jobject o) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -3617,10 +3758,9 @@ void broadcast_transaction_LDKBroadcasterInterface_jcall(const void* this_arg, L
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
 }
-static void* LDKBroadcasterInterface_JCalls_clone(const void* this_arg) {
-       LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
+static void LDKBroadcasterInterface_JCalls_cloned(LDKBroadcasterInterface* new_obj) {
+       LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKBroadcasterInterface LDKBroadcasterInterface_init (JNIEnv *env, jclass clz, jobject o) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -3856,10 +3996,9 @@ LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKKeysInterface_jcall(const v
        }
        return ret_conv;
 }
-static void* LDKKeysInterface_JCalls_clone(const void* this_arg) {
-       LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
+static void LDKKeysInterface_JCalls_cloned(LDKKeysInterface* new_obj) {
+       LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKKeysInterface LDKKeysInterface_init (JNIEnv *env, jclass clz, jobject o) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -4005,10 +4144,9 @@ uint32_t get_est_sat_per_1000_weight_LDKFeeEstimator_jcall(const void* this_arg,
        }
        return ret;
 }
-static void* LDKFeeEstimator_JCalls_clone(const void* this_arg) {
-       LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
+static void LDKFeeEstimator_JCalls_cloned(LDKFeeEstimator* new_obj) {
+       LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKFeeEstimator LDKFeeEstimator_init (JNIEnv *env, jclass clz, jobject o) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -4084,10 +4222,9 @@ void log_LDKLogger_jcall(const void* this_arg, const char* record) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
 }
-static void* LDKLogger_JCalls_clone(const void* this_arg) {
-       LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
+static void LDKLogger_JCalls_cloned(LDKLogger* new_obj) {
+       LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKLogger LDKLogger_init (JNIEnv *env, jclass clz, jobject o) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -4651,6 +4788,40 @@ static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ CVec_C2Tuple_TxidCV
        }
        return ret;
 }
+static jclass LDKPaymentPurpose_InvoicePayment_class = NULL;
+static jmethodID LDKPaymentPurpose_InvoicePayment_meth = NULL;
+static jclass LDKPaymentPurpose_SpontaneousPayment_class = NULL;
+static jmethodID LDKPaymentPurpose_SpontaneousPayment_meth = NULL;
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentPurpose_init (JNIEnv *env, jclass clz) {
+       LDKPaymentPurpose_InvoicePayment_class =
+               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentPurpose$InvoicePayment;"));
+       CHECK(LDKPaymentPurpose_InvoicePayment_class != NULL);
+       LDKPaymentPurpose_InvoicePayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_InvoicePayment_class, "<init>", "([B[BJ)V");
+       CHECK(LDKPaymentPurpose_InvoicePayment_meth != NULL);
+       LDKPaymentPurpose_SpontaneousPayment_class =
+               (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKPaymentPurpose$SpontaneousPayment;"));
+       CHECK(LDKPaymentPurpose_SpontaneousPayment_class != NULL);
+       LDKPaymentPurpose_SpontaneousPayment_meth = (*env)->GetMethodID(env, LDKPaymentPurpose_SpontaneousPayment_class, "<init>", "([B)V");
+       CHECK(LDKPaymentPurpose_SpontaneousPayment_meth != NULL);
+}
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentPurpose_1ref_1from_1ptr(JNIEnv *env, jclass clz, int64_t ptr) {
+       LDKPaymentPurpose *obj = (LDKPaymentPurpose*)(ptr & ~1);
+       switch(obj->tag) {
+               case LDKPaymentPurpose_InvoicePayment: {
+                       int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32);
+                       (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->invoice_payment.payment_preimage.data);
+                       int8_tArray payment_secret_arr = (*env)->NewByteArray(env, 32);
+                       (*env)->SetByteArrayRegion(env, payment_secret_arr, 0, 32, obj->invoice_payment.payment_secret.data);
+                       return (*env)->NewObject(env, LDKPaymentPurpose_InvoicePayment_class, LDKPaymentPurpose_InvoicePayment_meth, payment_preimage_arr, payment_secret_arr, obj->invoice_payment.user_payment_id);
+               }
+               case LDKPaymentPurpose_SpontaneousPayment: {
+                       int8_tArray spontaneous_payment_arr = (*env)->NewByteArray(env, 32);
+                       (*env)->SetByteArrayRegion(env, spontaneous_payment_arr, 0, 32, obj->spontaneous_payment.data);
+                       return (*env)->NewObject(env, LDKPaymentPurpose_SpontaneousPayment_class, LDKPaymentPurpose_SpontaneousPayment_meth, spontaneous_payment_arr);
+               }
+               default: abort();
+       }
+}
 static jclass LDKEvent_FundingGenerationReady_class = NULL;
 static jmethodID LDKEvent_FundingGenerationReady_meth = NULL;
 static jclass LDKEvent_PaymentReceived_class = NULL;
@@ -4672,7 +4843,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv *en
        LDKEvent_PaymentReceived_class =
                (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentReceived;"));
        CHECK(LDKEvent_PaymentReceived_class != NULL);
-       LDKEvent_PaymentReceived_meth = (*env)->GetMethodID(env, LDKEvent_PaymentReceived_class, "<init>", "([B[B[BJJ)V");
+       LDKEvent_PaymentReceived_meth = (*env)->GetMethodID(env, LDKEvent_PaymentReceived_class, "<init>", "([BJJ)V");
        CHECK(LDKEvent_PaymentReceived_meth != NULL);
        LDKEvent_PaymentSent_class =
                (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentSent;"));
@@ -4709,11 +4880,8 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr(JN
                case LDKEvent_PaymentReceived: {
                        int8_tArray payment_hash_arr = (*env)->NewByteArray(env, 32);
                        (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_received.payment_hash.data);
-                       int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32);
-                       (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->payment_received.payment_preimage.data);
-                       int8_tArray payment_secret_arr = (*env)->NewByteArray(env, 32);
-                       (*env)->SetByteArrayRegion(env, payment_secret_arr, 0, 32, obj->payment_received.payment_secret.data);
-                       return (*env)->NewObject(env, LDKEvent_PaymentReceived_class, LDKEvent_PaymentReceived_meth, payment_hash_arr, payment_preimage_arr, payment_secret_arr, obj->payment_received.amt, obj->payment_received.user_payment_id);
+                       uint64_t purpose_ref = ((uint64_t)&obj->payment_received.purpose) | 1;
+                       return (*env)->NewObject(env, LDKEvent_PaymentReceived_class, LDKEvent_PaymentReceived_meth, payment_hash_arr, obj->payment_received.amt, purpose_ref);
                }
                case LDKEvent_PaymentSent: {
                        int8_tArray payment_preimage_arr = (*env)->NewByteArray(env, 32);
@@ -6138,10 +6306,9 @@ LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_LDKMessageSendEventsP
        }
        return ret_constr;
 }
-static void* LDKMessageSendEventsProvider_JCalls_clone(const void* this_arg) {
-       LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
+static void LDKMessageSendEventsProvider_JCalls_cloned(LDKMessageSendEventsProvider* new_obj) {
+       LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKMessageSendEventsProvider LDKMessageSendEventsProvider_init (JNIEnv *env, jclass clz, jobject o) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -6227,10 +6394,9 @@ void handle_event_LDKEventHandler_jcall(const void* this_arg, LDKEvent event) {
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
 }
-static void* LDKEventHandler_JCalls_clone(const void* this_arg) {
-       LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg;
+static void LDKEventHandler_JCalls_cloned(LDKEventHandler* new_obj) {
+       LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKEventHandler LDKEventHandler_init (JNIEnv *env, jclass clz, jobject o) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -6305,10 +6471,9 @@ void process_pending_events_LDKEventsProvider_jcall(const void* this_arg, LDKEve
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
 }
-static void* LDKEventsProvider_JCalls_clone(const void* this_arg) {
-       LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
+static void LDKEventsProvider_JCalls_cloned(LDKEventsProvider* new_obj) {
+       LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKEventsProvider LDKEventsProvider_init (JNIEnv *env, jclass clz, jobject o) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -6337,7 +6502,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1process_1pendi
        LDKEventHandler handler_conv = *(LDKEventHandler*)(((uint64_t)handler) & ~1);
        if (handler_conv.free == LDKEventHandler_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKEventHandler_JCalls_clone(handler_conv.this_arg);
+               LDKEventHandler_JCalls_cloned(&handler_conv);
        }
        (this_arg_conv->process_pending_events)(this_arg_conv->this_arg, handler_conv);
 }
@@ -6390,10 +6555,9 @@ LDKCResult_TxOutAccessErrorZ get_utxo_LDKAccess_jcall(const void* this_arg, cons
        }
        return ret_conv;
 }
-static void* LDKAccess_JCalls_clone(const void* this_arg) {
-       LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
+static void LDKAccess_JCalls_cloned(LDKAccess* new_obj) {
+       LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKAccess LDKAccess_init (JNIEnv *env, jclass clz, jobject o) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -6497,10 +6661,9 @@ void block_disconnected_LDKListen_jcall(const void* this_arg, const uint8_t (* h
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
 }
-static void* LDKListen_JCalls_clone(const void* this_arg) {
-       LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
+static void LDKListen_JCalls_cloned(LDKListen* new_obj) {
+       LDKListen_JCalls *j_calls = (LDKListen_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKListen LDKListen_init (JNIEnv *env, jclass clz, jobject o) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -6681,10 +6844,9 @@ LDKCVec_TxidZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) {
        }
        return ret_constr;
 }
-static void* LDKConfirm_JCalls_clone(const void* this_arg) {
-       LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
+static void LDKConfirm_JCalls_cloned(LDKConfirm* new_obj) {
+       LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKConfirm LDKConfirm_init (JNIEnv *env, jclass clz, jobject o) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -6851,10 +7013,9 @@ LDKCOption_C2Tuple_usizeTransactionZZ register_output_LDKFilter_jcall(const void
        }
        return ret_conv;
 }
-static void* LDKFilter_JCalls_clone(const void* this_arg) {
-       LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
+static void LDKFilter_JCalls_cloned(LDKFilter* new_obj) {
+       LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKFilter LDKFilter_init (JNIEnv *env, jclass clz, jobject o) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -7014,10 +7175,9 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal
        }
        return ret_conv;
 }
-static void* LDKPersist_JCalls_clone(const void* this_arg) {
-       LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
+static void LDKPersist_JCalls_cloned(LDKPersist* new_obj) {
+       LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKPersist LDKPersist_init (JNIEnv *env, jclass clz, jobject o) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -7732,11 +7892,10 @@ void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublic
                DO_ASSERT((*j_calls->vm)->DetachCurrentThread(j_calls->vm) == JNI_OK);
        }
 }
-static void* LDKChannelMessageHandler_JCalls_clone(const void* this_arg) {
-       LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
+static void LDKChannelMessageHandler_JCalls_cloned(LDKChannelMessageHandler* new_obj) {
+       LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
        atomic_fetch_add_explicit(&j_calls->MessageSendEventsProvider->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKChannelMessageHandler LDKChannelMessageHandler_init (JNIEnv *env, jclass clz, jobject o, jobject MessageSendEventsProvider) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -7819,6 +7978,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1n
        *res_ptr = LDKChannelMessageHandler_init(env, clz, o, MessageSendEventsProvider);
        return (uint64_t)res_ptr;
 }
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1get_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKChannelMessageHandler *inp = (LDKChannelMessageHandler *)(arg & ~1);
+       uint64_t res_ptr = (uint64_t)&inp->MessageSendEventsProvider;
+       DO_ASSERT((res_ptr & 1) == 0);
+       return (int64_t)(res_ptr | 1);
+}
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_1open_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray their_node_id, int64_t their_features, int64_t msg) {
        LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)(((uint64_t)this_arg) & ~1);
        LDKPublicKey their_node_id_ref;
@@ -8427,11 +8592,10 @@ LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageH
        }
        return ret_conv;
 }
-static void* LDKRoutingMessageHandler_JCalls_clone(const void* this_arg) {
-       LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
+static void LDKRoutingMessageHandler_JCalls_cloned(LDKRoutingMessageHandler* new_obj) {
+       LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
        atomic_fetch_add_explicit(&j_calls->MessageSendEventsProvider->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKRoutingMessageHandler LDKRoutingMessageHandler_init (JNIEnv *env, jclass clz, jobject o, jobject MessageSendEventsProvider) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -8487,6 +8651,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1n
        *res_ptr = LDKRoutingMessageHandler_init(env, clz, o, MessageSendEventsProvider);
        return (uint64_t)res_ptr;
 }
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1get_1MessageSendEventsProvider(JNIEnv *env, jclass clz, int64_t arg) {
+       LDKRoutingMessageHandler *inp = (LDKRoutingMessageHandler *)(arg & ~1);
+       uint64_t res_ptr = (uint64_t)&inp->MessageSendEventsProvider;
+       DO_ASSERT((res_ptr & 1) == 0);
+       return (int64_t)(res_ptr | 1);
+}
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle_1node_1announcement(JNIEnv *env, jclass clz, int64_t this_arg, int64_t msg) {
        LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)(((uint64_t)this_arg) & ~1);
        LDKNodeAnnouncement msg_conv;
@@ -8742,10 +8912,9 @@ uint64_t hash_LDKSocketDescriptor_jcall(const void* this_arg) {
        }
        return ret;
 }
-static void* LDKSocketDescriptor_JCalls_clone(const void* this_arg) {
-       LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
+static void LDKSocketDescriptor_JCalls_cloned(LDKSocketDescriptor* new_obj) {
+       LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKSocketDescriptor LDKSocketDescriptor_init (JNIEnv *env, jclass clz, jobject o) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -8769,7 +8938,7 @@ static inline LDKSocketDescriptor LDKSocketDescriptor_init (JNIEnv *env, jclass
                .disconnect_socket = disconnect_socket_LDKSocketDescriptor_jcall,
                .eq = eq_LDKSocketDescriptor_jcall,
                .hash = hash_LDKSocketDescriptor_jcall,
-               .clone = LDKSocketDescriptor_JCalls_clone,
+               .cloned = LDKSocketDescriptor_JCalls_cloned,
                .free = LDKSocketDescriptor_JCalls_free,
        };
        return ret;
@@ -8854,10 +9023,9 @@ LDKCResult_NoneErrorZ persist_manager_LDKChannelManagerPersister_jcall(const voi
        }
        return ret_conv;
 }
-static void* LDKChannelManagerPersister_JCalls_clone(const void* this_arg) {
-       LDKChannelManagerPersister_JCalls *j_calls = (LDKChannelManagerPersister_JCalls*) this_arg;
+static void LDKChannelManagerPersister_JCalls_cloned(LDKChannelManagerPersister* new_obj) {
+       LDKChannelManagerPersister_JCalls *j_calls = (LDKChannelManagerPersister_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKChannelManagerPersister LDKChannelManagerPersister_init (JNIEnv *env, jclass clz, jobject o) {
        jclass c = (*env)->GetObjectClass(env, o);
@@ -8940,12 +9108,14 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFallback_1ref_1from_1ptr
 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;
 }
 
@@ -10187,7 +10357,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1SignDecodeErrorZ_1
        LDKSign o_conv = *(LDKSign*)(((uint64_t)o) & ~1);
        if (o_conv.free == LDKSign_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKSign_JCalls_clone(o_conv.this_arg);
+               LDKSign_JCalls_cloned(&o_conv);
        }
        LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
        *ret_conv = CResult_SignDecodeErrorZ_ok(o_conv);
@@ -10587,6 +10757,36 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFai
        return (uint64_t)ret_conv;
 }
 
+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 (uint64_t)ret_conv;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1err(JNIEnv *env, jclass clz, int64_t e) {
+       LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(((uint64_t)e) & ~1);
+       LDKCResult_PaymentHashPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashPaymentSendFailureZ), "LDKCResult_PaymentHashPaymentSendFailureZ");
+       *ret_conv = CResult_PaymentHashPaymentSendFailureZ_err(e_conv);
+       return (uint64_t)ret_conv;
+}
+
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1free(JNIEnv *env, jclass clz, int64_t _res) {
+       if ((_res & 1) != 0) return;
+       LDKCResult_PaymentHashPaymentSendFailureZ _res_conv = *(LDKCResult_PaymentHashPaymentSendFailureZ*)(((uint64_t)_res) & ~1);
+       FREE((void*)_res);
+       CResult_PaymentHashPaymentSendFailureZ_free(_res_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*)(orig & ~1);
+       LDKCResult_PaymentHashPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashPaymentSendFailureZ), "LDKCResult_PaymentHashPaymentSendFailureZ");
+       *ret_conv = CResult_PaymentHashPaymentSendFailureZ_clone(orig_conv);
+       return (uint64_t)ret_conv;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NetAddressZ_1free(JNIEnv *env, jclass clz, int64_tArray _res) {
        LDKCVec_NetAddressZ _res_constr;
        _res_constr.datalen = (*env)->GetArrayLength(env, _res);
@@ -13251,6 +13451,21 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreat
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
+       if ((this_ptr & 1) != 0) return;
+       LDKPaymentPurpose this_ptr_conv = *(LDKPaymentPurpose*)(((uint64_t)this_ptr) & ~1);
+       FREE((void*)this_ptr);
+       PaymentPurpose_free(this_ptr_conv);
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+       LDKPaymentPurpose* orig_conv = (LDKPaymentPurpose*)orig;
+       LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
+       *ret_copy = PaymentPurpose_clone(orig_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
        if ((this_ptr & 1) != 0) return;
        LDKEvent this_ptr_conv = *(LDKEvent*)(((uint64_t)this_ptr) & ~1);
@@ -14185,7 +14400,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1new(JNIEnv *e
                chain_source_conv = *(LDKFilter*)(((uint64_t)chain_source) & ~1);
                if (chain_source_conv.free == LDKFilter_JCalls_free) {
                        // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-                       LDKFilter_JCalls_clone(chain_source_conv.this_arg);
+                       LDKFilter_JCalls_cloned(&chain_source_conv);
                }
                chain_source_conv_ptr = MALLOC(sizeof(LDKFilter), "LDKFilter");
                *chain_source_conv_ptr = chain_source_conv;
@@ -14193,22 +14408,22 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1new(JNIEnv *e
        LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
        if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
+               LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
        }
        LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
        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_clone(logger_conv.this_arg);
+               LDKLogger_JCalls_cloned(&logger_conv);
        }
        LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)(((uint64_t)feeest) & ~1);
        if (feeest_conv.free == LDKFeeEstimator_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKFeeEstimator_JCalls_clone(feeest_conv.this_arg);
+               LDKFeeEstimator_JCalls_cloned(&feeest_conv);
        }
        LDKPersist persister_conv = *(LDKPersist*)(((uint64_t)persister) & ~1);
        if (persister_conv.free == LDKPersist_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKPersist_JCalls_clone(persister_conv.this_arg);
+               LDKPersist_JCalls_cloned(&persister_conv);
        }
        LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv_ptr, broadcaster_conv, logger_conv, feeest_conv, persister_conv);
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
@@ -14566,17 +14781,17 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_
        LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
        if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
+               LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
        }
        LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
        if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
+               LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
        }
        LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
        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_clone(logger_conv.this_arg);
+               LDKLogger_JCalls_cloned(&logger_conv);
        }
        LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_block_connected(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv);
        int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
@@ -14602,17 +14817,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_1disconn
        LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
        if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
+               LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
        }
        LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
        if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
+               LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
        }
        LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
        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_clone(logger_conv.this_arg);
+               LDKLogger_JCalls_cloned(&logger_conv);
        }
        ChannelMonitor_block_disconnected(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
 }
@@ -14642,17 +14857,17 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1transa
        LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
        if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
+               LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
        }
        LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
        if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
+               LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
        }
        LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
        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_clone(logger_conv.this_arg);
+               LDKLogger_JCalls_cloned(&logger_conv);
        }
        LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_transactions_confirmed(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_conv);
        int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
@@ -14678,17 +14893,17 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1transaction_1u
        LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
        if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
+               LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
        }
        LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
        if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
+               LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
        }
        LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
        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_clone(logger_conv.this_arg);
+               LDKLogger_JCalls_cloned(&logger_conv);
        }
        ChannelMonitor_transaction_unconfirmed(&this_arg_conv, txid_ref, broadcaster_conv, fee_estimator_conv, logger_conv);
 }
@@ -14704,17 +14919,17 @@ JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1best_1
        LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)broadcaster) & ~1);
        if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
+               LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
        }
        LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
        if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
+               LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
        }
        LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
        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_clone(logger_conv.this_arg);
+               LDKLogger_JCalls_cloned(&logger_conv);
        }
        LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_best_block_updated(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
        int64_tArray ret_arr = (*env)->NewLongArray(env, ret_var.datalen);
@@ -16160,27 +16375,27 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1new(JNIEnv
        LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(((uint64_t)fee_est) & ~1);
        if (fee_est_conv.free == LDKFeeEstimator_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKFeeEstimator_JCalls_clone(fee_est_conv.this_arg);
+               LDKFeeEstimator_JCalls_cloned(&fee_est_conv);
        }
        LDKWatch chain_monitor_conv = *(LDKWatch*)(((uint64_t)chain_monitor) & ~1);
        if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKWatch_JCalls_clone(chain_monitor_conv.this_arg);
+               LDKWatch_JCalls_cloned(&chain_monitor_conv);
        }
        LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)tx_broadcaster) & ~1);
        if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKBroadcasterInterface_JCalls_clone(tx_broadcaster_conv.this_arg);
+               LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv);
        }
        LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
        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_clone(logger_conv.this_arg);
+               LDKLogger_JCalls_cloned(&logger_conv);
        }
        LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(((uint64_t)keys_manager) & ~1);
        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_clone(keys_manager_conv.this_arg);
+               LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
        }
        LDKUserConfig config_conv;
        config_conv.inner = (void*)(config & (~1));
@@ -16325,6 +16540,21 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payme
        return (uint64_t)ret_conv;
 }
 
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1spontaneous_1payment(JNIEnv *env, jclass clz, int64_t this_arg, int64_t route, int8_tArray payment_preimage) {
+       LDKChannelManager this_arg_conv;
+       this_arg_conv.inner = (void*)(this_arg & (~1));
+       this_arg_conv.is_owned = false;
+       LDKRoute route_conv;
+       route_conv.inner = (void*)(route & (~1));
+       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_PaymentHashPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentHashPaymentSendFailureZ), "LDKCResult_PaymentHashPaymentSendFailureZ");
+       *ret_conv = ChannelManager_send_spontaneous_payment(&this_arg_conv, &route_conv, payment_preimage_ref);
+       return (uint64_t)ret_conv;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1funding_1transaction_1generated(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray temporary_channel_id, int8_tArray funding_transaction) {
        LDKChannelManager this_arg_conv;
        this_arg_conv.inner = (void*)(this_arg & (~1));
@@ -16555,7 +16785,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1k
        LDKKeysInterface val_conv = *(LDKKeysInterface*)(((uint64_t)val) & ~1);
        if (val_conv.free == LDKKeysInterface_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKKeysInterface_JCalls_clone(val_conv.this_arg);
+               LDKKeysInterface_JCalls_cloned(&val_conv);
        }
        ChannelManagerReadArgs_set_keys_manager(&this_ptr_conv, val_conv);
 }
@@ -16575,7 +16805,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1f
        LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(((uint64_t)val) & ~1);
        if (val_conv.free == LDKFeeEstimator_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKFeeEstimator_JCalls_clone(val_conv.this_arg);
+               LDKFeeEstimator_JCalls_cloned(&val_conv);
        }
        ChannelManagerReadArgs_set_fee_estimator(&this_ptr_conv, val_conv);
 }
@@ -16595,7 +16825,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1c
        LDKWatch val_conv = *(LDKWatch*)(((uint64_t)val) & ~1);
        if (val_conv.free == LDKWatch_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKWatch_JCalls_clone(val_conv.this_arg);
+               LDKWatch_JCalls_cloned(&val_conv);
        }
        ChannelManagerReadArgs_set_chain_monitor(&this_ptr_conv, val_conv);
 }
@@ -16615,7 +16845,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1t
        LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(((uint64_t)val) & ~1);
        if (val_conv.free == LDKBroadcasterInterface_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKBroadcasterInterface_JCalls_clone(val_conv.this_arg);
+               LDKBroadcasterInterface_JCalls_cloned(&val_conv);
        }
        ChannelManagerReadArgs_set_tx_broadcaster(&this_ptr_conv, val_conv);
 }
@@ -16635,7 +16865,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1l
        LDKLogger val_conv = *(LDKLogger*)(((uint64_t)val) & ~1);
        if (val_conv.free == LDKLogger_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKLogger_JCalls_clone(val_conv.this_arg);
+               LDKLogger_JCalls_cloned(&val_conv);
        }
        ChannelManagerReadArgs_set_logger(&this_ptr_conv, val_conv);
 }
@@ -16669,27 +16899,27 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new
        LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(((uint64_t)keys_manager) & ~1);
        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_clone(keys_manager_conv.this_arg);
+               LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
        }
        LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(((uint64_t)fee_estimator) & ~1);
        if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
+               LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
        }
        LDKWatch chain_monitor_conv = *(LDKWatch*)(((uint64_t)chain_monitor) & ~1);
        if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKWatch_JCalls_clone(chain_monitor_conv.this_arg);
+               LDKWatch_JCalls_cloned(&chain_monitor_conv);
        }
        LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(((uint64_t)tx_broadcaster) & ~1);
        if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKBroadcasterInterface_JCalls_clone(tx_broadcaster_conv.this_arg);
+               LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv);
        }
        LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
        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_clone(logger_conv.this_arg);
+               LDKLogger_JCalls_cloned(&logger_conv);
        }
        LDKUserConfig default_config_conv;
        default_config_conv.inner = (void*)(default_config & (~1));
@@ -16848,6 +17078,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1data(JNI
        this_ptr_conv.is_owned = false;
        LDKStr ret_str = ErrorMessage_get_data(&this_ptr_conv);
        jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -20148,6 +20379,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1err(JN
        this_ptr_conv.is_owned = false;
        LDKStr ret_str = LightningError_get_err(&this_ptr_conv);
        jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -21232,7 +21464,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1chan_1han
        LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)(((uint64_t)val) & ~1);
        if (val_conv.free == LDKChannelMessageHandler_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKChannelMessageHandler_JCalls_clone(val_conv.this_arg);
+               LDKChannelMessageHandler_JCalls_cloned(&val_conv);
        }
        MessageHandler_set_chan_handler(&this_ptr_conv, val_conv);
 }
@@ -21252,7 +21484,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1route_1ha
        LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)(((uint64_t)val) & ~1);
        if (val_conv.free == LDKRoutingMessageHandler_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKRoutingMessageHandler_JCalls_clone(val_conv.this_arg);
+               LDKRoutingMessageHandler_JCalls_cloned(&val_conv);
        }
        MessageHandler_set_route_handler(&this_ptr_conv, val_conv);
 }
@@ -21261,12 +21493,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new(JNIEnv
        LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)(((uint64_t)chan_handler_arg) & ~1);
        if (chan_handler_arg_conv.free == LDKChannelMessageHandler_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKChannelMessageHandler_JCalls_clone(chan_handler_arg_conv.this_arg);
+               LDKChannelMessageHandler_JCalls_cloned(&chan_handler_arg_conv);
        }
        LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)(((uint64_t)route_handler_arg) & ~1);
        if (route_handler_arg_conv.free == LDKRoutingMessageHandler_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKRoutingMessageHandler_JCalls_clone(route_handler_arg_conv.this_arg);
+               LDKRoutingMessageHandler_JCalls_cloned(&route_handler_arg_conv);
        }
        LDKMessageHandler ret_var = MessageHandler_new(chan_handler_arg_conv, route_handler_arg_conv);
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
@@ -21361,7 +21593,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new(JNIEnv *en
        LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
        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_clone(logger_conv.this_arg);
+               LDKLogger_JCalls_cloned(&logger_conv);
        }
        LDKPeerManager ret_var = PeerManager_new(message_handler_conv, our_node_secret_ref, ephemeral_random_data_ref, logger_conv);
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
@@ -21399,7 +21631,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1outbound_
        LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(((uint64_t)descriptor) & ~1);
        if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKSocketDescriptor_JCalls_clone(descriptor_conv.this_arg);
+               LDKSocketDescriptor_JCalls_cloned(&descriptor_conv);
        }
        LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
        *ret_conv = PeerManager_new_outbound_connection(&this_arg_conv, their_node_id_ref, descriptor_conv);
@@ -21413,7 +21645,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1inbound_1
        LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(((uint64_t)descriptor) & ~1);
        if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKSocketDescriptor_JCalls_clone(descriptor_conv.this_arg);
+               LDKSocketDescriptor_JCalls_cloned(&descriptor_conv);
        }
        LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
        *ret_conv = PeerManager_new_inbound_connection(&this_arg_conv, descriptor_conv);
@@ -23705,6 +23937,58 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1clone(JNIEnv
        return ret_ref;
 }
 
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_get_1keysend_1route(JNIEnv *env, jclass clz, int8_tArray our_node_id, int64_t network, int8_tArray payee, int64_tArray first_hops, int64_tArray last_hops, int64_t final_value_msat, int32_t final_cltv, int64_t logger) {
+       LDKPublicKey our_node_id_ref;
+       CHECK((*env)->GetArrayLength(env, our_node_id) == 33);
+       (*env)->GetByteArrayRegion(env, our_node_id, 0, 33, our_node_id_ref.compressed_form);
+       LDKNetworkGraph network_conv;
+       network_conv.inner = (void*)(network & (~1));
+       network_conv.is_owned = false;
+       LDKPublicKey payee_ref;
+       CHECK((*env)->GetArrayLength(env, payee) == 33);
+       (*env)->GetByteArrayRegion(env, payee, 0, 33, payee_ref.compressed_form);
+       LDKCVec_ChannelDetailsZ first_hops_constr;
+       first_hops_constr.datalen = (*env)->GetArrayLength(env, first_hops);
+       if (first_hops_constr.datalen > 0)
+               first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
+       else
+               first_hops_constr.data = NULL;
+       int64_t* first_hops_vals = (*env)->GetLongArrayElements (env, first_hops, NULL);
+       for (size_t q = 0; q < first_hops_constr.datalen; q++) {
+               int64_t first_hops_conv_16 = first_hops_vals[q];
+               LDKChannelDetails first_hops_conv_16_conv;
+               first_hops_conv_16_conv.inner = (void*)(first_hops_conv_16 & (~1));
+               first_hops_conv_16_conv.is_owned = (first_hops_conv_16 & 1) || (first_hops_conv_16 == 0);
+               first_hops_constr.data[q] = first_hops_conv_16_conv;
+       }
+       (*env)->ReleaseLongArrayElements(env, first_hops, first_hops_vals, 0);
+       LDKCVec_RouteHintZ last_hops_constr;
+       last_hops_constr.datalen = (*env)->GetArrayLength(env, last_hops);
+       if (last_hops_constr.datalen > 0)
+               last_hops_constr.data = MALLOC(last_hops_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
+       else
+               last_hops_constr.data = NULL;
+       int64_t* last_hops_vals = (*env)->GetLongArrayElements (env, last_hops, NULL);
+       for (size_t l = 0; l < last_hops_constr.datalen; l++) {
+               int64_t last_hops_conv_11 = last_hops_vals[l];
+               LDKRouteHint last_hops_conv_11_conv;
+               last_hops_conv_11_conv.inner = (void*)(last_hops_conv_11 & (~1));
+               last_hops_conv_11_conv.is_owned = (last_hops_conv_11 & 1) || (last_hops_conv_11 == 0);
+               last_hops_conv_11_conv = RouteHint_clone(&last_hops_conv_11_conv);
+               last_hops_constr.data[l] = last_hops_conv_11_conv;
+       }
+       (*env)->ReleaseLongArrayElements(env, last_hops, last_hops_vals, 0);
+       LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
+       if (logger_conv.free == LDKLogger_JCalls_free) {
+               // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
+               LDKLogger_JCalls_cloned(&logger_conv);
+       }
+       LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
+       *ret_conv = get_keysend_route(our_node_id_ref, &network_conv, payee_ref, &first_hops_constr, last_hops_constr, final_value_msat, final_cltv, logger_conv);
+       FREE(first_hops_constr.data);
+       return (uint64_t)ret_conv;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_get_1route(JNIEnv *env, jclass clz, int8_tArray our_node_id, int64_t network, int8_tArray payee, int64_t payee_features, int64_tArray first_hops, int64_tArray last_hops, int64_t final_value_msat, int32_t final_cltv, int64_t logger) {
        LDKPublicKey our_node_id_ref;
        CHECK((*env)->GetArrayLength(env, our_node_id) == 33);
@@ -23753,7 +24037,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_get_1route(JNIEnv *env, jcl
        LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
        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_clone(logger_conv.this_arg);
+               LDKLogger_JCalls_cloned(&logger_conv);
        }
        LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
        *ret_conv = get_route(our_node_id_ref, &network_conv, payee_ref, payee_features_conv, &first_hops_constr, last_hops_constr, final_value_msat, final_cltv, logger_conv);
@@ -23806,7 +24090,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new(JNI
                chain_access_conv = *(LDKAccess*)(((uint64_t)chain_access) & ~1);
                if (chain_access_conv.free == LDKAccess_JCalls_free) {
                        // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-                       LDKAccess_JCalls_clone(chain_access_conv.this_arg);
+                       LDKAccess_JCalls_cloned(&chain_access_conv);
                }
                chain_access_conv_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess");
                *chain_access_conv_ptr = chain_access_conv;
@@ -23814,7 +24098,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new(JNI
        LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
        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_clone(logger_conv.this_arg);
+               LDKLogger_JCalls_cloned(&logger_conv);
        }
        LDKNetGraphMsgHandler ret_var = NetGraphMsgHandler_new(genesis_hash_ref, chain_access_conv_ptr, logger_conv);
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
@@ -23833,7 +24117,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1from_1n
                chain_access_conv = *(LDKAccess*)(((uint64_t)chain_access) & ~1);
                if (chain_access_conv.free == LDKAccess_JCalls_free) {
                        // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-                       LDKAccess_JCalls_clone(chain_access_conv.this_arg);
+                       LDKAccess_JCalls_cloned(&chain_access_conv);
                }
                chain_access_conv_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess");
                *chain_access_conv_ptr = chain_access_conv;
@@ -23841,7 +24125,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1from_1n
        LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
        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_clone(logger_conv.this_arg);
+               LDKLogger_JCalls_cloned(&logger_conv);
        }
        LDKNetworkGraph network_graph_conv;
        network_graph_conv.inner = (void*)(network_graph & (~1));
@@ -23867,7 +24151,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1add_1chain
                chain_access_conv = *(LDKAccess*)(((uint64_t)chain_access) & ~1);
                if (chain_access_conv.free == LDKAccess_JCalls_free) {
                        // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-                       LDKAccess_JCalls_clone(chain_access_conv.this_arg);
+                       LDKAccess_JCalls_cloned(&chain_access_conv);
                }
                chain_access_conv_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess");
                *chain_access_conv_ptr = chain_access_conv;
@@ -24855,7 +25139,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1chann
                chain_access_conv = *(LDKAccess*)(((uint64_t)chain_access) & ~1);
                if (chain_access_conv.free == LDKAccess_JCalls_free) {
                        // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-                       LDKAccess_JCalls_clone(chain_access_conv.this_arg);
+                       LDKAccess_JCalls_cloned(&chain_access_conv);
                }
                chain_access_conv_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess");
                *chain_access_conv_ptr = chain_access_conv;
@@ -24878,7 +25162,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1update_1chann
                chain_access_conv = *(LDKAccess*)(((uint64_t)chain_access) & ~1);
                if (chain_access_conv.free == LDKAccess_JCalls_free) {
                        // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-                       LDKAccess_JCalls_clone(chain_access_conv.this_arg);
+                       LDKAccess_JCalls_cloned(&chain_access_conv);
                }
                chain_access_conv_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess");
                *chain_access_conv_ptr = chain_access_conv;
@@ -24944,6 +25228,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1get_1d
        this_arg_conv.is_owned = false;
        LDKStr ret_str = FilesystemPersister_get_data_dir(&this_arg_conv);
        jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -24964,7 +25249,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FilesystemPersister_1read_1
        LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(((uint64_t)keys_manager) & ~1);
        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_clone(keys_manager_conv.this_arg);
+               LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
        }
        LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ), "LDKCResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ");
        *ret_conv = FilesystemPersister_read_channelmonitors(&this_arg_conv, keys_manager_conv);
@@ -24998,12 +25283,12 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1start(
        LDKChannelManagerPersister persister_conv = *(LDKChannelManagerPersister*)(((uint64_t)persister) & ~1);
        if (persister_conv.free == LDKChannelManagerPersister_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKChannelManagerPersister_JCalls_clone(persister_conv.this_arg);
+               LDKChannelManagerPersister_JCalls_cloned(&persister_conv);
        }
        LDKEventHandler event_handler_conv = *(LDKEventHandler*)(((uint64_t)event_handler) & ~1);
        if (event_handler_conv.free == LDKEventHandler_JCalls_free) {
                // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
-               LDKEventHandler_JCalls_clone(event_handler_conv.this_arg);
+               LDKEventHandler_JCalls_cloned(&event_handler_conv);
        }
        LDKChainMonitor chain_monitor_conv;
        chain_monitor_conv.inner = (void*)(chain_monitor & (~1));
@@ -25017,7 +25302,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_BackgroundProcessor_1start(
        LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
        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_clone(logger_conv.this_arg);
+               LDKLogger_JCalls_cloned(&logger_conv);
        }
        LDKBackgroundProcessor ret_var = BackgroundProcessor_start(persister_conv, event_handler_conv, &chain_monitor_conv, &channel_manager_conv, &peer_manager_conv, logger_conv);
        CHECK((((uint64_t)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this.
@@ -25963,6 +26248,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Description_1into_1inner(JN
        this_arg_conv = Description_clone(&this_arg_conv);
        LDKStr ret_str = Description_into_inner(this_arg_conv);
        jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -26036,6 +26322,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_CreationError_1to_1str(JNIE
        LDKCreationError* o_conv = (LDKCreationError*)(o & ~1);
        LDKStr ret_str = CreationError_to_str(o_conv);
        jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -26056,6 +26343,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SemanticError_1to_1str(JNIE
        LDKSemanticError* o_conv = (LDKSemanticError*)(o & ~1);
        LDKStr ret_str = SemanticError_to_str(o_conv);
        jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -26085,6 +26373,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1to_1st
        LDKSignOrCreationError* o_conv = (LDKSignOrCreationError*)o;
        LDKStr ret_str = SignOrCreationError_to_str(o_conv);
        jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -26095,7 +26384,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_create_1invoice_1from_1chan
        LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(((uint64_t)keys_manager) & ~1);
        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_clone(keys_manager_conv.this_arg);
+               LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
        }
        LDKCurrency network_conv = LDKCurrency_from_java(env, network);
        LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(((uint64_t)amt_msat) & ~1);
@@ -26132,6 +26421,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Invoice_1to_1str(JNIEnv *en
        o_conv.is_owned = false;
        LDKStr ret_str = Invoice_to_str(&o_conv);
        jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -26141,6 +26431,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SignedRawInvoice_1to_1str(J
        o_conv.is_owned = false;
        LDKStr ret_str = SignedRawInvoice_to_str(&o_conv);
        jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -26148,6 +26439,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_Currency_1to_1str(JNIEnv *e
        LDKCurrency* o_conv = (LDKCurrency*)(o & ~1);
        LDKStr ret_str = Currency_to_str(o_conv);
        jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -26155,6 +26447,7 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_SiPrefix_1to_1str(JNIEnv *e
        LDKSiPrefix* o_conv = (LDKSiPrefix*)(o & ~1);
        LDKStr ret_str = SiPrefix_to_str(o_conv);
        jstring ret_conv = str_ref_to_java(env, ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
index 759305525159c3d78737cd8d190c15031a18cf56..2e1d56f58ee44471585b02170573c50187d9fa4b 100644 (file)
@@ -1095,6 +1095,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BaseSign_1get_1pubkeys
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKSign_1new
   (JNIEnv *, jclass, jobject, jobject, jlong);
 
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKSign_get_BaseSign
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKSign_1get_1BaseSign
+  (JNIEnv *, jclass, jlong);
+
 /*
  * Class:     org_ldk_impl_bindings
  * Method:    Sign_write
@@ -1375,6 +1383,30 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFai
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1get_1err
   (JNIEnv *, jclass, jlong);
 
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKCResult_PaymentHashPaymentSendFailureZ_result_ok
+ * Signature: (J)Z
+ */
+JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentHashPaymentSendFailureZ_1result_1ok
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKCResult_PaymentHashPaymentSendFailureZ_get_ok
+ * Signature: (J)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentHashPaymentSendFailureZ_1get_1ok
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKCResult_PaymentHashPaymentSendFailureZ_get_err
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PaymentHashPaymentSendFailureZ_1get_1err
+  (JNIEnv *, jclass, jlong);
+
 /*
  * Class:     org_ldk_impl_bindings
  * Method:    LDKNetAddress_ref_from_ptr
@@ -2143,6 +2175,14 @@ JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1TxidCVec_1C2
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32ScriptZZZZ_1new
   (JNIEnv *, jclass, jlongArray);
 
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKPaymentPurpose_ref_from_ptr
+ * Signature: (J)Lorg/ldk/impl/bindings/LDKPaymentPurpose;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPaymentPurpose_1ref_1from_1ptr
+  (JNIEnv *, jclass, jlong);
+
 /*
  * Class:     org_ldk_impl_bindings
  * Method:    LDKEvent_ref_from_ptr
@@ -3631,6 +3671,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Persist_1update_1persisted_1c
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1new
   (JNIEnv *, jclass, jobject, jobject);
 
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKChannelMessageHandler_get_MessageSendEventsProvider
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1get_1MessageSendEventsProvider
+  (JNIEnv *, jclass, jlong);
+
 /*
  * Class:     org_ldk_impl_bindings
  * Method:    ChannelMessageHandler_handle_open_channel
@@ -3799,6 +3847,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1handle_
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1new
   (JNIEnv *, jclass, jobject, jobject);
 
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    LDKRoutingMessageHandler_get_MessageSendEventsProvider
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1get_1MessageSendEventsProvider
+  (JNIEnv *, jclass, jlong);
+
 /*
  * Class:     org_ldk_impl_bindings
  * Method:    RoutingMessageHandler_handle_node_announcement
@@ -5407,6 +5463,38 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailur
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1clone
   (JNIEnv *, jclass, jlong);
 
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    CResult_PaymentHashPaymentSendFailureZ_ok
+ * Signature: ([B)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1ok
+  (JNIEnv *, jclass, jbyteArray);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    CResult_PaymentHashPaymentSendFailureZ_err
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1err
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    CResult_PaymentHashPaymentSendFailureZ_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1free
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    CResult_PaymentHashPaymentSendFailureZ_clone
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PaymentHashPaymentSendFailureZ_1clone
+  (JNIEnv *, jclass, jlong);
+
 /*
  * Class:     org_ldk_impl_bindings
  * Method:    CVec_NetAddressZ_free
@@ -7807,6 +7895,22 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreation
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1InvoiceSignOrCreationErrorZ_1clone
   (JNIEnv *, jclass, jlong);
 
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    PaymentPurpose_free
+ * Signature: (J)V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1free
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    PaymentPurpose_clone
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentPurpose_1clone
+  (JNIEnv *, jclass, jlong);
+
 /*
  * Class:     org_ldk_impl_bindings
  * Method:    Event_free
@@ -10079,6 +10183,14 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payment
   (JNIEnv *, jclass, jlong, jlong, jbyteArray, jbyteArray);
 
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    ChannelManager_send_spontaneous_payment
+ * Signature: (JJ[B)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1spontaneous_1payment
+  (JNIEnv *, jclass, jlong, jlong, jbyteArray);
+
 /*
  * Class:     org_ldk_impl_bindings
  * Method:    ChannelManager_funding_transaction_generated
@@ -15615,6 +15727,14 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1eq
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHintHop_1clone
   (JNIEnv *, jclass, jlong);
 
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    get_keysend_route
+ * Signature: ([BJ[B[J[JJIJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_get_1keysend_1route
+  (JNIEnv *, jclass, jbyteArray, jlong, jbyteArray, jlongArray, jlongArray, jlong, jint, jlong);
+
 /*
  * Class:     org_ldk_impl_bindings
  * Method:    get_route
diff --git a/src/main/jni/org_ldk_impl_bindings_LDKPaymentPurpose.h b/src/main/jni/org_ldk_impl_bindings_LDKPaymentPurpose.h
new file mode 100644 (file)
index 0000000..0d8dc49
--- /dev/null
@@ -0,0 +1,21 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class org_ldk_impl_bindings_LDKPaymentPurpose */
+
+#ifndef _Included_org_ldk_impl_bindings_LDKPaymentPurpose
+#define _Included_org_ldk_impl_bindings_LDKPaymentPurpose
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*
+ * Class:     org_ldk_impl_bindings_LDKPaymentPurpose
+ * Method:    init
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKPaymentPurpose_init
+  (JNIEnv *, jclass);
+
+#ifdef __cplusplus
+}
+#endif
+#endif