]> git.bitcoin.ninja Git - ldk-java/commitdiff
Update auto-generated bindings to latest upstream
authorMatt Corallo <git@bluematt.me>
Sat, 7 Aug 2021 22:34:45 +0000 (22:34 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 9 Aug 2021 14:35:23 +0000 (14:35 +0000)
Note that the inclusion of enum constructor functions fixes #30.

272 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/BroadcasterInterface.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/Confirm.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/EventHandler.java
src/main/java/org/ldk/structs/EventsProvider.java
src/main/java/org/ldk/structs/ExpiryTime.java
src/main/java/org/ldk/structs/Fallback.java
src/main/java/org/ldk/structs/FeeEstimator.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/Listen.java
src/main/java/org/ldk/structs/LockedNetworkGraph.java
src/main/java/org/ldk/structs/Logger.java
src/main/java/org/ldk/structs/MessageHandler.java
src/main/java/org/ldk/structs/MessageSendEvent.java
src/main/java/org/ldk/structs/MessageSendEventsProvider.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/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_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/TxOut.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
ts/bindings.c
ts/bindings.c.body
ts/bindings.ts
ts/structs/APIError.ts
ts/structs/ChannelManager.ts
ts/structs/ChannelManagerReadArgs.ts
ts/structs/ChannelMonitor.ts
ts/structs/CommitmentUpdate.ts
ts/structs/Confirm.ts
ts/structs/ErrorAction.ts
ts/structs/Event.ts
ts/structs/Fallback.ts
ts/structs/HTLCFailChannelUpdate.ts
ts/structs/KeysManager.ts
ts/structs/MessageSendEvent.ts
ts/structs/MessageSendEventsProvider.ts
ts/structs/MonitorEvent.ts
ts/structs/NetAddress.ts
ts/structs/NodeAnnouncementInfo.ts
ts/structs/PaymentSendFailure.ts
ts/structs/Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.ts
ts/structs/Route.ts
ts/structs/RoutingMessageHandler.ts
ts/structs/SignOrCreationError.ts
ts/structs/SpendableOutputDescriptor.ts
ts/structs/TxOut.ts
ts/structs/UnsignedNodeAnnouncement.ts
ts/structs/UtilMethods.ts
ts/structs/Watch.ts

index 9a5c9f2d4f9781d177698e6089959dea11d736a4..01db9fe6be5e5c7691925355c397431be1c61572 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.2";
        }
        public static native String get_ldk_c_bindings_version();
        public static native String get_ldk_version();
@@ -77,6 +77,10 @@ public class bindings {
        static { SemanticError.values(); /* Force enum statics to run */ }
        static { SiPrefix.values(); /* Force enum statics to run */ }
        public static native long LDKCVec_u8Z_new(byte[] elems);
+       // struct LDKCVec_u8Z TxOut_get_script_pubkey (struct LDKTxOut* thing)
+       public static native byte[] TxOut_get_script_pubkey(long thing);
+       // uint64_t TxOut_get_value (struct LDKTxOut* thing)
+       public static native long TxOut_get_value(long thing);
        public static native boolean LDKCResult_SecretKeyErrorZ_result_ok(long arg);
        public static native byte[] LDKCResult_SecretKeyErrorZ_get_ok(long arg);
        public static native Secp256k1Error LDKCResult_SecretKeyErrorZ_get_err(long arg);
@@ -432,6 +436,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);
@@ -985,6 +990,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 +1045,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
@@ -1105,6 +1112,8 @@ public class bindings {
        public static native String _ldk_c_bindings_get_compiled_version();
        // void Transaction_free(struct LDKTransaction _res);
        public static native void Transaction_free(byte[] _res);
+       // struct LDKTxOut TxOut_new(struct LDKCVec_u8Z script_pubkey, uint64_t value);
+       public static native long TxOut_new(byte[] script_pubkey, long value);
        // void TxOut_free(struct LDKTxOut _res);
        public static native void TxOut_free(long _res);
        // struct LDKTxOut TxOut_clone(const struct LDKTxOut *NONNULL_PTR orig);
@@ -2069,12 +2078,64 @@ public class bindings {
        public static native void Event_free(long this_ptr);
        // struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig);
        public static native long Event_clone(long orig);
+       // struct LDKEvent Event_funding_generation_ready(struct LDKThirtyTwoBytes temporary_channel_id, uint64_t channel_value_satoshis, struct LDKCVec_u8Z output_script, uint64_t user_channel_id);
+       public static native long Event_funding_generation_ready(byte[] temporary_channel_id, long channel_value_satoshis, byte[] output_script, long user_channel_id);
+       // struct LDKEvent Event_payment_received(struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_secret, uint64_t amt, uint64_t user_payment_id);
+       public static native long Event_payment_received(byte[] payment_hash, byte[] payment_preimage, byte[] payment_secret, long amt, long user_payment_id);
+       // struct LDKEvent Event_payment_sent(struct LDKThirtyTwoBytes payment_preimage);
+       public static native long Event_payment_sent(byte[] payment_preimage);
+       // struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_hash, bool rejected_by_dest);
+       public static native long Event_payment_failed(byte[] payment_hash, boolean rejected_by_dest);
+       // struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable);
+       public static native long Event_pending_htlcs_forwardable(long time_forwardable);
+       // struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs);
+       public static native long Event_spendable_outputs(long[] outputs);
        // struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
        public static native byte[] Event_write(long obj);
        // void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr);
        public static native void MessageSendEvent_free(long this_ptr);
        // struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig);
        public static native long MessageSendEvent_clone(long orig);
+       // struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg);
+       public static native long MessageSendEvent_send_accept_channel(byte[] node_id, long msg);
+       // struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg);
+       public static native long MessageSendEvent_send_open_channel(byte[] node_id, long msg);
+       // struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg);
+       public static native long MessageSendEvent_send_funding_created(byte[] node_id, long msg);
+       // struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg);
+       public static native long MessageSendEvent_send_funding_signed(byte[] node_id, long msg);
+       // struct LDKMessageSendEvent MessageSendEvent_send_funding_locked(struct LDKPublicKey node_id, struct LDKFundingLocked msg);
+       public static native long MessageSendEvent_send_funding_locked(byte[] node_id, long msg);
+       // struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg);
+       public static native long MessageSendEvent_send_announcement_signatures(byte[] node_id, long msg);
+       // struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates);
+       public static native long MessageSendEvent_update_htlcs(byte[] node_id, long updates);
+       // struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg);
+       public static native long MessageSendEvent_send_revoke_and_ack(byte[] node_id, long msg);
+       // struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg);
+       public static native long MessageSendEvent_send_closing_signed(byte[] node_id, long msg);
+       // struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg);
+       public static native long MessageSendEvent_send_shutdown(byte[] node_id, long msg);
+       // struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg);
+       public static native long MessageSendEvent_send_channel_reestablish(byte[] node_id, long msg);
+       // struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
+       public static native long MessageSendEvent_broadcast_channel_announcement(long msg, long update_msg);
+       // struct LDKMessageSendEvent MessageSendEvent_broadcast_node_announcement(struct LDKNodeAnnouncement msg);
+       public static native long MessageSendEvent_broadcast_node_announcement(long msg);
+       // struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg);
+       public static native long MessageSendEvent_broadcast_channel_update(long msg);
+       // struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg);
+       public static native long MessageSendEvent_send_channel_update(byte[] node_id, long msg);
+       // struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action);
+       public static native long MessageSendEvent_handle_error(byte[] node_id, long action);
+       // struct LDKMessageSendEvent MessageSendEvent_payment_failure_network_update(struct LDKHTLCFailChannelUpdate update);
+       public static native long MessageSendEvent_payment_failure_network_update(long update);
+       // struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg);
+       public static native long MessageSendEvent_send_channel_range_query(byte[] node_id, long msg);
+       // struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg);
+       public static native long MessageSendEvent_send_short_ids_query(byte[] node_id, long msg);
+       // struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg);
+       public static native long MessageSendEvent_send_reply_channel_range(byte[] node_id, long msg);
        // void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
        public static native void MessageSendEventsProvider_free(long this_ptr);
        // void EventsProvider_free(struct LDKEventsProvider this_ptr);
@@ -2085,6 +2146,16 @@ public class bindings {
        public static native void APIError_free(long this_ptr);
        // struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig);
        public static native long APIError_clone(long orig);
+       // struct LDKAPIError APIError_apimisuse_error(struct LDKStr err);
+       public static native long APIError_apimisuse_error(String err);
+       // struct LDKAPIError APIError_fee_rate_too_high(struct LDKStr err, uint32_t feerate);
+       public static native long APIError_fee_rate_too_high(String err, int feerate);
+       // struct LDKAPIError APIError_route_error(struct LDKStr err);
+       public static native long APIError_route_error(String err);
+       // struct LDKAPIError APIError_channel_unavailable(struct LDKStr err);
+       public static native long APIError_channel_unavailable(String err);
+       // struct LDKAPIError APIError_monitor_update_failed(void);
+       public static native long APIError_monitor_update_failed();
        // struct LDKCResult_StringErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]);
        public static native long sign(byte[] msg, byte[] sk);
        // struct LDKCResult_PublicKeyErrorZ recover_pk(struct LDKu8slice msg, struct LDKStr sig);
@@ -2093,6 +2164,16 @@ public class bindings {
        public static native boolean verify(byte[] msg, String sig, byte[] pk);
        // enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig);
        public static native Level Level_clone(long orig);
+       // enum LDKLevel Level_trace(void);
+       public static native Level Level_trace();
+       // enum LDKLevel Level_debug(void);
+       public static native Level Level_debug();
+       // enum LDKLevel Level_info(void);
+       public static native Level Level_info();
+       // enum LDKLevel Level_warn(void);
+       public static native Level Level_warn();
+       // enum LDKLevel Level_error(void);
+       public static native Level Level_error();
        // bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b);
        public static native boolean Level_eq(long a, long b);
        // uint64_t Level_hash(const enum LDKLevel *NONNULL_PTR o);
@@ -2231,6 +2312,10 @@ public class bindings {
        public static native int BestBlock_height(long this_arg);
        // enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig);
        public static native AccessError AccessError_clone(long orig);
+       // enum LDKAccessError AccessError_unknown_chain(void);
+       public static native AccessError AccessError_unknown_chain();
+       // enum LDKAccessError AccessError_unknown_tx(void);
+       public static native AccessError AccessError_unknown_tx();
        // void Access_free(struct LDKAccess this_ptr);
        public static native void Access_free(long this_ptr);
        // void Listen_free(struct LDKListen this_ptr);
@@ -2265,6 +2350,12 @@ public class bindings {
        public static native void BroadcasterInterface_free(long this_ptr);
        // enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig);
        public static native ConfirmationTarget ConfirmationTarget_clone(long orig);
+       // enum LDKConfirmationTarget ConfirmationTarget_background(void);
+       public static native ConfirmationTarget ConfirmationTarget_background();
+       // enum LDKConfirmationTarget ConfirmationTarget_normal(void);
+       public static native ConfirmationTarget ConfirmationTarget_normal();
+       // enum LDKConfirmationTarget ConfirmationTarget_high_priority(void);
+       public static native ConfirmationTarget ConfirmationTarget_high_priority();
        // void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
        public static native void FeeEstimator_free(long this_ptr);
        // void ChainMonitor_free(struct LDKChainMonitor this_obj);
@@ -2293,6 +2384,10 @@ public class bindings {
        public static native long ChannelMonitorUpdate_read(byte[] ser);
        // enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig);
        public static native ChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(long orig);
+       // enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_temporary_failure(void);
+       public static native ChannelMonitorUpdateErr ChannelMonitorUpdateErr_temporary_failure();
+       // enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_permanent_failure(void);
+       public static native ChannelMonitorUpdateErr ChannelMonitorUpdateErr_permanent_failure();
        // void MonitorUpdateError_free(struct LDKMonitorUpdateError this_obj);
        public static native void MonitorUpdateError_free(long this_obj);
        // struct LDKMonitorUpdateError MonitorUpdateError_clone(const struct LDKMonitorUpdateError *NONNULL_PTR orig);
@@ -2301,6 +2396,10 @@ public class bindings {
        public static native void MonitorEvent_free(long this_ptr);
        // struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig);
        public static native long MonitorEvent_clone(long orig);
+       // struct LDKMonitorEvent MonitorEvent_htlcevent(struct LDKHTLCUpdate a);
+       public static native long MonitorEvent_htlcevent(long a);
+       // struct LDKMonitorEvent MonitorEvent_commitment_tx_broadcasted(struct LDKOutPoint a);
+       public static native long MonitorEvent_commitment_tx_broadcasted(long a);
        // void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
        public static native void HTLCUpdate_free(long this_obj);
        // struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig);
@@ -2437,6 +2536,12 @@ public class bindings {
        public static native void SpendableOutputDescriptor_free(long this_ptr);
        // struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig);
        public static native long SpendableOutputDescriptor_clone(long orig);
+       // struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output);
+       public static native long SpendableOutputDescriptor_static_output(long outpoint, long output);
+       // struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a);
+       public static native long SpendableOutputDescriptor_delayed_payment_output(long a);
+       // struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a);
+       public static native long SpendableOutputDescriptor_static_payment_output(long a);
        // struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
        public static native byte[] SpendableOutputDescriptor_write(long obj);
        // struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser);
@@ -2615,6 +2720,14 @@ public class bindings {
        public static native void PaymentSendFailure_free(long this_ptr);
        // struct LDKPaymentSendFailure PaymentSendFailure_clone(const struct LDKPaymentSendFailure *NONNULL_PTR orig);
        public static native long PaymentSendFailure_clone(long orig);
+       // struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a);
+       public static native long PaymentSendFailure_parameter_error(long a);
+       // struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a);
+       public static native long PaymentSendFailure_path_parameter_error(long[] a);
+       // struct LDKPaymentSendFailure PaymentSendFailure_all_failed_retry_safe(struct LDKCVec_APIErrorZ a);
+       public static native long PaymentSendFailure_all_failed_retry_safe(long[] a);
+       // struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ a);
+       public static native long PaymentSendFailure_partial_failure(long[] a);
        // MUST_USE_RES struct LDKChannelManager ChannelManager_new(struct LDKFeeEstimator fee_est, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKLogger logger, struct LDKKeysInterface keys_manager, struct LDKUserConfig config, struct LDKChainParameters params);
        public static native long ChannelManager_new(long fee_est, long chain_monitor, long tx_broadcaster, long logger, long keys_manager, long config, long params);
        // MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg);
@@ -3145,6 +3258,14 @@ public class bindings {
        public static native void NetAddress_free(long this_ptr);
        // struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig);
        public static native long NetAddress_clone(long orig);
+       // struct LDKNetAddress NetAddress_ipv4(struct LDKFourBytes addr, uint16_t port);
+       public static native long NetAddress_ipv4(byte[] addr, short port);
+       // struct LDKNetAddress NetAddress_ipv6(struct LDKSixteenBytes addr, uint16_t port);
+       public static native long NetAddress_ipv6(byte[] addr, short port);
+       // struct LDKNetAddress NetAddress_onion_v2(struct LDKTenBytes addr, uint16_t port);
+       public static native long NetAddress_onion_v2(byte[] addr, short port);
+       // struct LDKNetAddress NetAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port);
+       public static native long NetAddress_onion_v3(byte[] ed25519_pubkey, short checksum, byte version, short port);
        // struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
        public static native byte[] NetAddress_write(long obj);
        // struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ Result_read(struct LDKu8slice ser);
@@ -3389,6 +3510,14 @@ public class bindings {
        public static native void ErrorAction_free(long this_ptr);
        // struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig);
        public static native long ErrorAction_clone(long orig);
+       // struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg);
+       public static native long ErrorAction_disconnect_peer(long msg);
+       // struct LDKErrorAction ErrorAction_ignore_error(void);
+       public static native long ErrorAction_ignore_error();
+       // struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a);
+       public static native long ErrorAction_ignore_and_log(Level a);
+       // struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg);
+       public static native long ErrorAction_send_error_message(long msg);
        // void LightningError_free(struct LDKLightningError this_obj);
        public static native void LightningError_free(long this_obj);
        // struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr);
@@ -3429,6 +3558,12 @@ public class bindings {
        public static native void HTLCFailChannelUpdate_free(long this_ptr);
        // struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_clone(const struct LDKHTLCFailChannelUpdate *NONNULL_PTR orig);
        public static native long HTLCFailChannelUpdate_clone(long orig);
+       // struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_channel_update_message(struct LDKChannelUpdate msg);
+       public static native long HTLCFailChannelUpdate_channel_update_message(long msg);
+       // struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_channel_closed(uint64_t short_channel_id, bool is_permanent);
+       public static native long HTLCFailChannelUpdate_channel_closed(long short_channel_id, boolean is_permanent);
+       // struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent);
+       public static native long HTLCFailChannelUpdate_node_failure(byte[] node_id, boolean is_permanent);
        // void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
        public static native void ChannelMessageHandler_free(long this_ptr);
        // void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr);
@@ -4271,12 +4406,30 @@ public class bindings {
        public static native long PositiveTimestamp_clone(long orig);
        // enum LDKSiPrefix SiPrefix_clone(const enum LDKSiPrefix *NONNULL_PTR orig);
        public static native SiPrefix SiPrefix_clone(long orig);
+       // enum LDKSiPrefix SiPrefix_milli(void);
+       public static native SiPrefix SiPrefix_milli();
+       // enum LDKSiPrefix SiPrefix_micro(void);
+       public static native SiPrefix SiPrefix_micro();
+       // enum LDKSiPrefix SiPrefix_nano(void);
+       public static native SiPrefix SiPrefix_nano();
+       // enum LDKSiPrefix SiPrefix_pico(void);
+       public static native SiPrefix SiPrefix_pico();
        // bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b);
        public static native boolean SiPrefix_eq(long a, long b);
        // MUST_USE_RES uint64_t SiPrefix_multiplier(const enum LDKSiPrefix *NONNULL_PTR this_arg);
        public static native long SiPrefix_multiplier(long this_arg);
        // enum LDKCurrency Currency_clone(const enum LDKCurrency *NONNULL_PTR orig);
        public static native Currency Currency_clone(long orig);
+       // enum LDKCurrency Currency_bitcoin(void);
+       public static native Currency Currency_bitcoin();
+       // enum LDKCurrency Currency_bitcoin_testnet(void);
+       public static native Currency Currency_bitcoin_testnet();
+       // enum LDKCurrency Currency_regtest(void);
+       public static native Currency Currency_regtest();
+       // enum LDKCurrency Currency_simnet(void);
+       public static native Currency Currency_simnet();
+       // enum LDKCurrency Currency_signet(void);
+       public static native Currency Currency_signet();
        // bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b);
        public static native boolean Currency_eq(long a, long b);
        // void Sha256_free(struct LDKSha256 this_obj);
@@ -4313,6 +4466,12 @@ public class bindings {
        public static native void Fallback_free(long this_ptr);
        // struct LDKFallback Fallback_clone(const struct LDKFallback *NONNULL_PTR orig);
        public static native long Fallback_clone(long orig);
+       // struct LDKFallback Fallback_seg_wit_program(struct LDKu5 version, struct LDKCVec_u8Z program);
+       public static native long Fallback_seg_wit_program(byte version, byte[] program);
+       // struct LDKFallback Fallback_pub_key_hash(struct LDKTwentyBytes a);
+       public static native long Fallback_pub_key_hash(byte[] a);
+       // struct LDKFallback Fallback_script_hash(struct LDKTwentyBytes a);
+       public static native long Fallback_script_hash(byte[] a);
        // bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallback *NONNULL_PTR b);
        public static native boolean Fallback_eq(long a, long b);
        // void InvoiceSignature_free(struct LDKInvoiceSignature this_obj);
@@ -4419,12 +4578,36 @@ public class bindings {
        public static native long PrivateRoute_into_inner(long this_arg);
        // enum LDKCreationError CreationError_clone(const enum LDKCreationError *NONNULL_PTR orig);
        public static native CreationError CreationError_clone(long orig);
+       // enum LDKCreationError CreationError_description_too_long(void);
+       public static native CreationError CreationError_description_too_long();
+       // enum LDKCreationError CreationError_route_too_long(void);
+       public static native CreationError CreationError_route_too_long();
+       // enum LDKCreationError CreationError_timestamp_out_of_bounds(void);
+       public static native CreationError CreationError_timestamp_out_of_bounds();
+       // enum LDKCreationError CreationError_expiry_time_out_of_bounds(void);
+       public static native CreationError CreationError_expiry_time_out_of_bounds();
        // bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b);
        public static native boolean CreationError_eq(long a, long b);
        // struct LDKStr CreationError_to_str(const enum LDKCreationError *NONNULL_PTR o);
        public static native String CreationError_to_str(long o);
        // enum LDKSemanticError SemanticError_clone(const enum LDKSemanticError *NONNULL_PTR orig);
        public static native SemanticError SemanticError_clone(long orig);
+       // enum LDKSemanticError SemanticError_no_payment_hash(void);
+       public static native SemanticError SemanticError_no_payment_hash();
+       // enum LDKSemanticError SemanticError_multiple_payment_hashes(void);
+       public static native SemanticError SemanticError_multiple_payment_hashes();
+       // enum LDKSemanticError SemanticError_no_description(void);
+       public static native SemanticError SemanticError_no_description();
+       // enum LDKSemanticError SemanticError_multiple_descriptions(void);
+       public static native SemanticError SemanticError_multiple_descriptions();
+       // enum LDKSemanticError SemanticError_multiple_payment_secrets(void);
+       public static native SemanticError SemanticError_multiple_payment_secrets();
+       // enum LDKSemanticError SemanticError_invalid_features(void);
+       public static native SemanticError SemanticError_invalid_features();
+       // enum LDKSemanticError SemanticError_invalid_recovery_id(void);
+       public static native SemanticError SemanticError_invalid_recovery_id();
+       // enum LDKSemanticError SemanticError_invalid_signature(void);
+       public static native SemanticError SemanticError_invalid_signature();
        // bool SemanticError_eq(const enum LDKSemanticError *NONNULL_PTR a, const enum LDKSemanticError *NONNULL_PTR b);
        public static native boolean SemanticError_eq(long a, long b);
        // struct LDKStr SemanticError_to_str(const enum LDKSemanticError *NONNULL_PTR o);
@@ -4433,6 +4616,10 @@ public class bindings {
        public static native void SignOrCreationError_free(long this_ptr);
        // struct LDKSignOrCreationError SignOrCreationError_clone(const struct LDKSignOrCreationError *NONNULL_PTR orig);
        public static native long SignOrCreationError_clone(long orig);
+       // struct LDKSignOrCreationError SignOrCreationError_sign_error(void);
+       public static native long SignOrCreationError_sign_error();
+       // struct LDKSignOrCreationError SignOrCreationError_creation_error(enum LDKCreationError a);
+       public static native long SignOrCreationError_creation_error(CreationError a);
        // bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a, const struct LDKSignOrCreationError *NONNULL_PTR b);
        public static native boolean SignOrCreationError_eq(long a, long b);
        // struct LDKStr SignOrCreationError_to_str(const struct LDKSignOrCreationError *NONNULL_PTR o);
index 19fdbcf1f659f07d88bc59cac021f73f18d48105..96e81b8ce843e8b54f159efb258ed81050639a8d 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -39,6 +40,9 @@ public class APIError extends CommonBase {
        }
 
        public final static class APIMisuseError extends APIError {
+               /**
+                * A human-readable error message
+               */
                public final String err;
                private APIMisuseError(long ptr, bindings.LDKAPIError.APIMisuseError obj) {
                        super(null, ptr);
@@ -46,7 +50,13 @@ public class APIError extends CommonBase {
                }
        }
        public final static class FeeRateTooHigh extends APIError {
+               /**
+                * A human-readable error message
+               */
                public final String err;
+               /**
+                * The feerate which was too high.
+               */
                public final int feerate;
                private FeeRateTooHigh(long ptr, bindings.LDKAPIError.FeeRateTooHigh obj) {
                        super(null, ptr);
@@ -55,6 +65,9 @@ public class APIError extends CommonBase {
                }
        }
        public final static class RouteError extends APIError {
+               /**
+                * A human-readable error message
+               */
                public final String err;
                private RouteError(long ptr, bindings.LDKAPIError.RouteError obj) {
                        super(null, ptr);
@@ -62,6 +75,9 @@ public class APIError extends CommonBase {
                }
        }
        public final static class ChannelUnavailable extends APIError {
+               /**
+                * A human-readable error message
+               */
                public final String err;
                private ChannelUnavailable(long ptr, bindings.LDKAPIError.ChannelUnavailable obj) {
                        super(null, ptr);
@@ -78,9 +94,65 @@ 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;
        }
 
+       /**
+        * Utility method to constructs a new APIMisuseError-variant APIError
+        */
+       public static APIError apimisuse_error(java.lang.String err) {
+               long ret = bindings.APIError_apimisuse_error(err);
+               if (ret < 1024) { return null; }
+               APIError ret_hu_conv = APIError.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new FeeRateTooHigh-variant APIError
+        */
+       public static APIError fee_rate_too_high(java.lang.String err, int feerate) {
+               long ret = bindings.APIError_fee_rate_too_high(err, feerate);
+               if (ret < 1024) { return null; }
+               APIError ret_hu_conv = APIError.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new RouteError-variant APIError
+        */
+       public static APIError route_error(java.lang.String err) {
+               long ret = bindings.APIError_route_error(err);
+               if (ret < 1024) { return null; }
+               APIError ret_hu_conv = APIError.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new ChannelUnavailable-variant APIError
+        */
+       public static APIError channel_unavailable(java.lang.String err) {
+               long ret = bindings.APIError_channel_unavailable(err);
+               if (ret < 1024) { return null; }
+               APIError ret_hu_conv = APIError.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new MonitorUpdateFailed-variant APIError
+        */
+       public static APIError monitor_update_failed() {
+               long ret = bindings.APIError_monitor_update_failed();
+               if (ret < 1024) { return null; }
+               APIError ret_hu_conv = APIError.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
 }
index cc61466ef5f0100f68a14870956413a6b9f6b5ad..e4286b2300db702cbdce25820ca1dfb0af4114a2 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -233,6 +234,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 +253,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..b52d295c9cd8d075e4f0bb1ce3037c1c47e6dedf 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 /**
  * The `Access` trait defines behavior for accessing chain data and state, such as blocks and
@@ -54,6 +55,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..9b7bfbe8cb404eb0aec555d735f2e3e61ec8af83 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -83,6 +84,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 +95,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 +114,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..9858c5d5ec82cab87e18da9bcac8c9318796525b 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -53,6 +54,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 +71,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..71a146efc9a9b86a2d29f270373d07ea68157374 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 /**
  * A trait to sign lightning channel transactions as described in BOLT 3.
@@ -275,6 +276,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 +297,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 +321,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 +347,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 +374,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 +388,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 +403,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 +432,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..77664b50f914c880a676913f33cf39d944006e8f 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -23,6 +24,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;
@@ -32,8 +34,9 @@ public class BestBlock extends CommonBase {
         * Constructs a `BestBlock` that represents the genesis block at height 0 of the given
         * network.
         */
-       public static BestBlock from_genesis(Network network) {
+       public static BestBlock from_genesis(org.ldk.enums.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 +47,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 6deb39736f43c82f309da44277d647a0368a2a29..5e6a76f828ec0a7992a90613c1e70077ef1fa61b 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 /**
  * An interface to send a transaction to the Bitcoin network.
index 3ac8da0e95c1febf7a2e93d50ce6426fd28162fb..76a15bccc89f5bcd44fcbcd36519e315c23c4368 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -59,6 +60,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 +71,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 +90,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..bed7751667474fc9874f7ac35658b43fbedbab7c 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -34,9 +35,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 +57,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 +69,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 +81,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 +93,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..c65be86d10fe3f6391f43bce896abb19885ddffa 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -33,7 +34,7 @@ public class ChainParameters extends CommonBase {
        /**
         * The network for determining the `chain_hash` in Lightning messages.
         */
-       public void set_network(Network val) {
+       public void set_network(org.ldk.enums.Network val) {
                bindings.ChainParameters_set_network(this.ptr, val);
        }
 
@@ -44,6 +45,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;
@@ -62,8 +64,9 @@ public class ChainParameters extends CommonBase {
        /**
         * Constructs a new ChainParameters given each field
         */
-       public static ChainParameters of(Network network_arg, BestBlock best_block_arg) {
+       public static ChainParameters of(org.ldk.enums.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 +78,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..2d4307a8f6c0548b1ac3b46af2ec7ee50a51f354 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -83,6 +84,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 +103,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 +115,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 +134,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..51680d6a39fbeb3778cd2a9ecf571d326ea11865 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -207,6 +208,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 +219,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 +230,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 +249,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..535c6a0ae152e29490f475b863e823e827959615 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -41,6 +42,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 +90,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..da32093df7fa3c4c14476c26c17f0e75f31d6547 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -44,6 +45,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 +65,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 +83,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 +97,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 +139,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 +250,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 +284,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 +386,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 +399,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..c0e61d0a0ebca0b6399e5e0a4789a088cd0282f7 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -34,6 +35,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 +46,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 +57,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 +76,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..633a36772d9a05d9a06ef2f014f49b6ce1492651 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -118,6 +119,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 +130,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 +141,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..93bb3a1fdac19ac34778b03be169b94fd105e2fe 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -221,6 +222,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 +233,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 +244,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..9f7e5bd03432bc4166efdfb1d8beaeafe4b9d5a0 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -24,6 +25,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 +56,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 +70,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 +95,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 +109,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 +122,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 +140,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 +157,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 +170,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 +185,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 +204,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..923f5b305b621b945db2baf8901f83519f9ec7af 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -69,6 +70,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 +88,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 +112,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) {
+       public Result_NoneAPIErrorZ create_channel(byte[] their_network_key, long channel_value_satoshis, long push_msat, long user_id, @Nullable 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 +168,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 +179,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,9 +232,12 @@ 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) {
+       public Result_NonePaymentSendFailureZ send_payment(Route route, byte[] payment_hash, @Nullable 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;
@@ -256,6 +267,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;
        }
@@ -281,7 +293,7 @@ public class ChannelManager extends CommonBase {
         * [`get_and_clear_pending_msg_events`]: MessageSendEventsProvider::get_and_clear_pending_msg_events
         */
        public void broadcast_node_announcement(byte[] rgb, byte[] alias, NetAddress[] addresses) {
-               bindings.ChannelManager_broadcast_node_announcement(this.ptr, rgb, alias, Arrays.stream(addresses).mapToLong(addresses_conv_12 -> addresses_conv_12.ptr).toArray());
+               bindings.ChannelManager_broadcast_node_announcement(this.ptr, rgb, alias, addresses != null ? Arrays.stream(addresses).mapToLong(addresses_conv_12 -> addresses_conv_12.ptr).toArray() : null);
                /* TODO 2 NetAddress  */;
        }
 
@@ -395,6 +407,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, () -> {
@@ -452,6 +465,7 @@ public class ChannelManager extends CommonBase {
         */
        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 +476,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 +488,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 +500,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 +512,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 +545,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 +557,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..abff5e62d1933129c4cb2276d9c6b45bf4a07528 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 /**
  * Trait which handles persisting a [`ChannelManager`] to disk.
@@ -54,6 +55,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..5669175ea7d05f80e500a87e95761285eaf50e82 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -49,6 +50,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 +73,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 +98,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 +123,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 +145,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 +166,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;
@@ -180,7 +187,8 @@ public class ChannelManagerReadArgs extends CommonBase {
         * populate a HashMap directly from C.
         */
        public static ChannelManagerReadArgs of(KeysInterface keys_manager, FeeEstimator fee_estimator, Watch chain_monitor, BroadcasterInterface tx_broadcaster, Logger logger, UserConfig default_config, ChannelMonitor[] channel_monitors) {
-               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());
+               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, channel_monitors != null ? Arrays.stream(channel_monitors).mapToLong(channel_monitors_conv_16 -> channel_monitors_conv_16 == null ? 0 : channel_monitors_conv_16.ptr & ~1).toArray() : null);
+               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..e694bb9d364c8794cf0c7bdbd0eade0d4321bfee 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 /**
  * A trait to describe an object which can receive channel messages.
@@ -202,6 +203,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..75d8140babefbd9902959af8cf86be431d5461b0 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -38,6 +39,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 +61,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 +84,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);;
@@ -197,7 +201,7 @@ public class ChannelMonitor extends CommonBase {
         * [`get_outputs_to_watch`]: #method.get_outputs_to_watch
         */
        public TwoTuple<byte[], TwoTuple<Integer, TxOut>[]>[] block_connected(byte[] header, TwoTuple<Long, byte[]>[] txdata, int height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) {
-               long[] ret = bindings.ChannelMonitor_block_connected(this.ptr, header, Arrays.stream(txdata).mapToLong(txdata_conv_24 -> bindings.C2Tuple_usizeTransactionZ_new(txdata_conv_24.a, txdata_conv_24.b)).toArray(), height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
+               long[] ret = bindings.ChannelMonitor_block_connected(this.ptr, header, txdata != null ? Arrays.stream(txdata).mapToLong(txdata_conv_24 -> bindings.C2Tuple_usizeTransactionZ_new(txdata_conv_24.a, txdata_conv_24.b)).toArray() : null, height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
                TwoTuple<byte[], TwoTuple<Integer, TxOut>[]>[] ret_conv_46_arr = new TwoTuple[ret.length];
                for (int u = 0; u < ret.length; u++) {
                        long ret_conv_46 = ret[u];
@@ -247,7 +251,7 @@ public class ChannelMonitor extends CommonBase {
         * [`block_connected`]: Self::block_connected
         */
        public TwoTuple<byte[], TwoTuple<Integer, TxOut>[]>[] transactions_confirmed(byte[] header, TwoTuple<Long, byte[]>[] txdata, int height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) {
-               long[] ret = bindings.ChannelMonitor_transactions_confirmed(this.ptr, header, Arrays.stream(txdata).mapToLong(txdata_conv_24 -> bindings.C2Tuple_usizeTransactionZ_new(txdata_conv_24.a, txdata_conv_24.b)).toArray(), height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
+               long[] ret = bindings.ChannelMonitor_transactions_confirmed(this.ptr, header, txdata != null ? Arrays.stream(txdata).mapToLong(txdata_conv_24 -> bindings.C2Tuple_usizeTransactionZ_new(txdata_conv_24.a, txdata_conv_24.b)).toArray() : null, height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
                TwoTuple<byte[], TwoTuple<Integer, TxOut>[]>[] ret_conv_46_arr = new TwoTuple[ret.length];
                for (int u = 0; u < ret.length; u++) {
                        long ret_conv_46 = ret[u];
@@ -343,6 +347,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..14015a014edd8dbcd21d31d4e54844dc10b46c7b 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -59,6 +60,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 +79,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..49c0fcf33f8e7f0b45d0259e697304b61e3d3cbe 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -116,6 +117,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 +128,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 +147,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..c3eb2507a1c4e16df4bde51aee7574bed047465c 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -68,6 +69,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 +88,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..980ed9e0c633aad4439ea14d1decd3817a40bd65 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -27,6 +28,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 +77,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 +92,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 +116,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 +129,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 +143,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 +165,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 +179,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 +198,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..f55325ae9916f9a7f323d80f75deace3d99283e4 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -38,6 +39,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 +58,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 +70,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 +89,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..83482b26df88f7f993b2fd4df29b5acf9b7c4911 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -68,6 +69,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 +80,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 +99,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..487c099e436ed5de9781c05aea534343ef4d7435 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -60,6 +61,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 +72,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 +91,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..ceb8a799f00315de4094e371f0bdf70e2b8982a2 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -28,6 +29,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 +48,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 +95,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 +111,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..e59e98a9a41d0ab9bed0f7b342a475f1c3237113 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -23,7 +24,7 @@ public class CommitmentUpdate extends CommonBase {
         * update_add_htlc messages which should be sent
         */
        public void set_update_add_htlcs(UpdateAddHTLC[] val) {
-               bindings.CommitmentUpdate_set_update_add_htlcs(this.ptr, Arrays.stream(val).mapToLong(val_conv_15 -> val_conv_15 == null ? 0 : val_conv_15.ptr & ~1).toArray());
+               bindings.CommitmentUpdate_set_update_add_htlcs(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_15 -> val_conv_15 == null ? 0 : val_conv_15.ptr & ~1).toArray() : null);
                /* TODO 2 UpdateAddHTLC  */;
        }
 
@@ -31,7 +32,7 @@ public class CommitmentUpdate extends CommonBase {
         * update_fulfill_htlc messages which should be sent
         */
        public void set_update_fulfill_htlcs(UpdateFulfillHTLC[] val) {
-               bindings.CommitmentUpdate_set_update_fulfill_htlcs(this.ptr, Arrays.stream(val).mapToLong(val_conv_19 -> val_conv_19 == null ? 0 : val_conv_19.ptr & ~1).toArray());
+               bindings.CommitmentUpdate_set_update_fulfill_htlcs(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_19 -> val_conv_19 == null ? 0 : val_conv_19.ptr & ~1).toArray() : null);
                /* TODO 2 UpdateFulfillHTLC  */;
        }
 
@@ -39,7 +40,7 @@ public class CommitmentUpdate extends CommonBase {
         * update_fail_htlc messages which should be sent
         */
        public void set_update_fail_htlcs(UpdateFailHTLC[] val) {
-               bindings.CommitmentUpdate_set_update_fail_htlcs(this.ptr, Arrays.stream(val).mapToLong(val_conv_16 -> val_conv_16 == null ? 0 : val_conv_16.ptr & ~1).toArray());
+               bindings.CommitmentUpdate_set_update_fail_htlcs(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_16 -> val_conv_16 == null ? 0 : val_conv_16.ptr & ~1).toArray() : null);
                /* TODO 2 UpdateFailHTLC  */;
        }
 
@@ -47,15 +48,19 @@ public class CommitmentUpdate extends CommonBase {
         * update_fail_malformed_htlc messages which should be sent
         */
        public void set_update_fail_malformed_htlcs(UpdateFailMalformedHTLC[] val) {
-               bindings.CommitmentUpdate_set_update_fail_malformed_htlcs(this.ptr, Arrays.stream(val).mapToLong(val_conv_25 -> val_conv_25 == null ? 0 : val_conv_25.ptr & ~1).toArray());
+               bindings.CommitmentUpdate_set_update_fail_malformed_htlcs(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_25 -> val_conv_25 == null ? 0 : val_conv_25.ptr & ~1).toArray() : null);
                /* TODO 2 UpdateFailMalformedHTLC  */;
        }
 
        /**
         * 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 +68,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 +81,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;
@@ -91,7 +99,8 @@ public class CommitmentUpdate extends CommonBase {
         * Constructs a new CommitmentUpdate given each field
         */
        public static CommitmentUpdate of(UpdateAddHTLC[] update_add_htlcs_arg, UpdateFulfillHTLC[] update_fulfill_htlcs_arg, UpdateFailHTLC[] update_fail_htlcs_arg, UpdateFailMalformedHTLC[] update_fail_malformed_htlcs_arg, UpdateFee update_fee_arg, CommitmentSigned commitment_signed_arg) {
-               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);
+               long ret = bindings.CommitmentUpdate_new(update_add_htlcs_arg != null ? Arrays.stream(update_add_htlcs_arg).mapToLong(update_add_htlcs_arg_conv_15 -> update_add_htlcs_arg_conv_15 == null ? 0 : update_add_htlcs_arg_conv_15.ptr & ~1).toArray() : null, update_fulfill_htlcs_arg != null ? Arrays.stream(update_fulfill_htlcs_arg).mapToLong(update_fulfill_htlcs_arg_conv_19 -> update_fulfill_htlcs_arg_conv_19 == null ? 0 : update_fulfill_htlcs_arg_conv_19.ptr & ~1).toArray() : null, update_fail_htlcs_arg != null ? Arrays.stream(update_fail_htlcs_arg).mapToLong(update_fail_htlcs_arg_conv_16 -> update_fail_htlcs_arg_conv_16 == null ? 0 : update_fail_htlcs_arg_conv_16.ptr & ~1).toArray() : null, update_fail_malformed_htlcs_arg != null ? Arrays.stream(update_fail_malformed_htlcs_arg).mapToLong(update_fail_malformed_htlcs_arg_conv_25 -> update_fail_malformed_htlcs_arg_conv_25 == null ? 0 : update_fail_malformed_htlcs_arg_conv_25.ptr & ~1).toArray() : null, 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 +117,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 67594fde1b66ccae89ae9d11c822f1a969ff79cc..161d97af8731faa5d2ca0eed119416e80d4b3a3a 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 /**
  * The `Confirm` trait is used to notify when transactions have been confirmed on chain or
@@ -151,7 +152,7 @@ public class Confirm extends CommonBase {
         * [`best_block_updated`]: Self::best_block_updated
         */
        public void transactions_confirmed(byte[] header, TwoTuple<Long, byte[]>[] txdata, int height) {
-               bindings.Confirm_transactions_confirmed(this.ptr, header, Arrays.stream(txdata).mapToLong(txdata_conv_24 -> bindings.C2Tuple_usizeTransactionZ_new(txdata_conv_24.a, txdata_conv_24.b)).toArray(), height);
+               bindings.Confirm_transactions_confirmed(this.ptr, header, txdata != null ? Arrays.stream(txdata).mapToLong(txdata_conv_24 -> bindings.C2Tuple_usizeTransactionZ_new(txdata_conv_24.a, txdata_conv_24.b)).toArray() : null, height);
                /* TODO 2 TwoTuple<Long, byte[]>  */;
        }
 
index 887b60ae9c88b232dc68aa91b6a9980083260712..7d083371dbc236dc734d175163fc7b599284c5ce 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -23,6 +24,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 +58,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 +70,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 +89,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..3c625d07c7054bec59ae351df118c9908c2fa365 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -58,6 +59,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 +70,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..198e61d1234569383d5318686899820fe2d82b98 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -23,6 +24,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..756ee4ead900b2af97efe297a33e30476e57da4e 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -24,6 +25,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 +134,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 +146,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 +165,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..6be70625c0286fca3ec914da8bd3a7ca93726b7e 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -37,6 +38,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;
@@ -48,8 +50,9 @@ public class Description extends CommonBase {
         * 
         * Please note that single characters may use more than one byte due to UTF8 encoding.
         */
-       public static Result_DescriptionCreationErrorZ of(String description) {
+       public static Result_DescriptionCreationErrorZ of(java.lang.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..b86804ca37e2d8b4843e9b965f058e0c56211bd0 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -27,6 +28,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 +39,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 +70,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..d67d896483170abc6c6c0fc8b54e128c1b3761e1 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -86,6 +87,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 +105,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 +124,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 +141,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 +154,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 +167,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 +186,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..3ff8ed72d3e4f0c8373cc9554d95dc964ad3ccd9 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -35,7 +36,12 @@ public class ErrorAction extends CommonBase {
        }
 
        public final static class DisconnectPeer extends ErrorAction {
-               public final ErrorMessage msg;
+               /**
+                * An error message which we should make an effort to send before we disconnect.
+                * 
+                * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+               */
+               @Nullable public final ErrorMessage msg;
                private DisconnectPeer(long ptr, bindings.LDKErrorAction.DisconnectPeer obj) {
                        super(null, ptr);
                        long msg = obj.msg;
@@ -57,6 +63,9 @@ public class ErrorAction extends CommonBase {
                }
        }
        public final static class SendErrorMessage extends ErrorAction {
+               /**
+                * The message to send.
+               */
                public final ErrorMessage msg;
                private SendErrorMessage(long ptr, bindings.LDKErrorAction.SendErrorMessage obj) {
                        super(null, ptr);
@@ -71,9 +80,56 @@ 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;
        }
 
+       /**
+        * Utility method to constructs a new DisconnectPeer-variant ErrorAction
+        */
+       public static ErrorAction disconnect_peer(ErrorMessage msg) {
+               long ret = bindings.ErrorAction_disconnect_peer(msg == null ? 0 : msg.ptr & ~1);
+               if (ret < 1024) { return null; }
+               ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new IgnoreError-variant ErrorAction
+        */
+       public static ErrorAction ignore_error() {
+               long ret = bindings.ErrorAction_ignore_error();
+               if (ret < 1024) { return null; }
+               ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new IgnoreAndLog-variant ErrorAction
+        */
+       public static ErrorAction ignore_and_log(org.ldk.enums.Level a) {
+               long ret = bindings.ErrorAction_ignore_and_log(a);
+               if (ret < 1024) { return null; }
+               ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new SendErrorMessage-variant ErrorAction
+        */
+       public static ErrorAction send_error_message(ErrorMessage msg) {
+               long ret = bindings.ErrorAction_send_error_message(msg == null ? 0 : msg.ptr & ~1);
+               if (ret < 1024) { return null; }
+               ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
 }
index c68a56d95341263c55f928e73e17be9eb15004dd..2c1b2141570f58693d7a7fc49c8e85265cb552c2 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -50,15 +51,16 @@ public class ErrorMessage extends CommonBase {
         * or printed to stdout).  Otherwise, a well crafted error message may trigger a security
         * vulnerability in the terminal emulator or the logging subsystem.
         */
-       public void set_data(String val) {
+       public void set_data(java.lang.String val) {
                bindings.ErrorMessage_set_data(this.ptr, val);
        }
 
        /**
         * Constructs a new ErrorMessage given each field
         */
-       public static ErrorMessage of(byte[] channel_id_arg, String data_arg) {
+       public static ErrorMessage of(byte[] channel_id_arg, java.lang.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 +71,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 +90,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..7ce8b6a8b2edae9987766a2e6cc69209110ea148 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -24,6 +25,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 +37,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 +49,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..4bd1fad4408225d0cad607fbc413038b376d2680 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -45,9 +46,22 @@ public class Event extends CommonBase {
        }
 
        public final static class FundingGenerationReady extends Event {
+               /**
+                * The random channel_id we picked which you'll need to pass into
+                * ChannelManager::funding_transaction_generated.
+               */
                public final byte[] temporary_channel_id;
+               /**
+                * The value, in satoshis, that the output should have.
+               */
                public final long channel_value_satoshis;
+               /**
+                * The script which should be used in the transaction output.
+               */
                public final byte[] output_script;
+               /**
+                * The value passed in to ChannelManager::create_channel
+               */
                public final long user_channel_id;
                private FundingGenerationReady(long ptr, bindings.LDKEvent.FundingGenerationReady obj) {
                        super(null, ptr);
@@ -58,10 +72,50 @@ public class Event extends CommonBase {
                }
        }
        public final static class PaymentReceived extends Event {
+               /**
+                * The hash for which the preimage should be handed to the ChannelManager.
+               */
                public final byte[] payment_hash;
-               public final byte[] payment_preimage;
+               /**
+                * The preimage to the payment_hash, if the payment hash (and secret) were fetched via
+                * [`ChannelManager::create_inbound_payment`]. If provided, this can be handed directly to
+                * [`ChannelManager::claim_funds`].
+                * 
+                * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
+                * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
+                * 
+                * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None
+               */
+               @Nullable public final byte[] payment_preimage;
+               /**
+                * The \"payment secret\". This authenticates the sender to the recipient, preventing a
+                * number of deanonymization attacks during the routing process.
+                * It is provided here for your reference, however its accuracy is enforced directly by
+                * [`ChannelManager`] using the values you previously provided to
+                * [`ChannelManager::create_inbound_payment`] or
+                * [`ChannelManager::create_inbound_payment_for_hash`].
+                * 
+                * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
+                * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
+                * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
+               */
                public final byte[] payment_secret;
+               /**
+                * The value, in thousandths of a satoshi, that this payment is for. Note that you must
+                * compare this to the expected value before accepting the payment (as otherwise you are
+                * providing proof-of-payment for less than the value you expected!).
+               */
                public final long amt;
+               /**
+                * This is the `user_payment_id` which was provided to
+                * [`ChannelManager::create_inbound_payment_for_hash`] or
+                * [`ChannelManager::create_inbound_payment`]. It has no meaning inside of LDK and is
+                * simply copied here. It may be used to correlate PaymentReceived events with invoice
+                * metadata stored elsewhere.
+                * 
+                * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment
+                * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash
+               */
                public final long user_payment_id;
                private PaymentReceived(long ptr, bindings.LDKEvent.PaymentReceived obj) {
                        super(null, ptr);
@@ -73,6 +127,11 @@ public class Event extends CommonBase {
                }
        }
        public final static class PaymentSent extends Event {
+               /**
+                * The preimage to the hash given to ChannelManager::send_payment.
+                * Note that this serves as a payment receipt, if you wish to have such a thing, you must
+                * store it somehow!
+               */
                public final byte[] payment_preimage;
                private PaymentSent(long ptr, bindings.LDKEvent.PaymentSent obj) {
                        super(null, ptr);
@@ -80,7 +139,15 @@ public class Event extends CommonBase {
                }
        }
        public final static class PaymentFailed extends Event {
+               /**
+                * The hash which was given to ChannelManager::send_payment.
+               */
                public final byte[] payment_hash;
+               /**
+                * Indicates the payment was rejected for some reason by the recipient. This implies that
+                * the payment has failed, not just the route in question. If this is not set, you may
+                * retry the payment via a different route.
+               */
                public final boolean rejected_by_dest;
                private PaymentFailed(long ptr, bindings.LDKEvent.PaymentFailed obj) {
                        super(null, ptr);
@@ -89,6 +156,12 @@ public class Event extends CommonBase {
                }
        }
        public final static class PendingHTLCsForwardable extends Event {
+               /**
+                * The minimum amount of time that should be waited prior to calling
+                * process_pending_htlc_forwards. To increase the effort required to correlate payments,
+                * you should wait a random amount of time in roughly the range (now + time_forwardable,
+                * now + 5*time_forwardable).
+               */
                public final long time_forwardable;
                private PendingHTLCsForwardable(long ptr, bindings.LDKEvent.PendingHTLCsForwardable obj) {
                        super(null, ptr);
@@ -96,6 +169,9 @@ public class Event extends CommonBase {
                }
        }
        public final static class SpendableOutputs extends Event {
+               /**
+                * The outputs which you should store as spendable by you.
+               */
                public final SpendableOutputDescriptor[] outputs;
                private SpendableOutputs(long ptr, bindings.LDKEvent.SpendableOutputs obj) {
                        super(null, ptr);
@@ -115,11 +191,79 @@ 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;
        }
 
+       /**
+        * Utility method to constructs a new FundingGenerationReady-variant Event
+        */
+       public static Event funding_generation_ready(byte[] temporary_channel_id, long channel_value_satoshis, byte[] output_script, long user_channel_id) {
+               long ret = bindings.Event_funding_generation_ready(temporary_channel_id, channel_value_satoshis, output_script, user_channel_id);
+               if (ret < 1024) { return null; }
+               Event ret_hu_conv = Event.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new PaymentReceived-variant Event
+        */
+       public static Event payment_received(byte[] payment_hash, byte[] payment_preimage, byte[] payment_secret, long amt, long user_payment_id) {
+               long ret = bindings.Event_payment_received(payment_hash, payment_preimage, payment_secret, amt, user_payment_id);
+               if (ret < 1024) { return null; }
+               Event ret_hu_conv = Event.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new PaymentSent-variant Event
+        */
+       public static Event payment_sent(byte[] payment_preimage) {
+               long ret = bindings.Event_payment_sent(payment_preimage);
+               if (ret < 1024) { return null; }
+               Event ret_hu_conv = Event.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new PaymentFailed-variant Event
+        */
+       public static Event payment_failed(byte[] payment_hash, boolean rejected_by_dest) {
+               long ret = bindings.Event_payment_failed(payment_hash, rejected_by_dest);
+               if (ret < 1024) { return null; }
+               Event ret_hu_conv = Event.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new PendingHTLCsForwardable-variant Event
+        */
+       public static Event pending_htlcs_forwardable(long time_forwardable) {
+               long ret = bindings.Event_pending_htlcs_forwardable(time_forwardable);
+               if (ret < 1024) { return null; }
+               Event ret_hu_conv = Event.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new SpendableOutputs-variant Event
+        */
+       public static Event spendable_outputs(SpendableOutputDescriptor[] outputs) {
+               long ret = bindings.Event_spendable_outputs(outputs != null ? Arrays.stream(outputs).mapToLong(outputs_conv_27 -> outputs_conv_27.ptr).toArray() : null);
+               if (ret < 1024) { return null; }
+               Event ret_hu_conv = Event.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               /* TODO 2 SpendableOutputDescriptor  */;
+               return ret_hu_conv;
+       }
+
        /**
         * Serialize the Event object into a byte array which can be read by Event_read
         */
index 7714aa5139eac07fc4db81f5a65b7ee76b72a60e..288e1395e4c805ebeb134109b9d533af632a80bc 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 /**
  * A trait implemented for objects handling events from [`EventsProvider`].
index 3ab3f1715ac736289ef6e955e09b996a90b7d0ac..03f8921bdbb6c67a88b1baf8a209d4ab458dc022 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 /**
  * A trait indicating an object may generate events.
index 061b549d023a25e426eb8f265bc6dc0daad680f0..e88c139340bfeab24c693ca3d0192289a655b0b4 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -40,6 +41,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 +54,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 +66,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..fe2cf61dcf7ebd6ec9c47c933c5392188bec4756 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -61,11 +62,45 @@ 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;
        }
 
+       /**
+        * Utility method to constructs a new SegWitProgram-variant Fallback
+        */
+       public static Fallback seg_wit_program(UInt5 version, byte[] program) {
+               long ret = bindings.Fallback_seg_wit_program(version.getVal(), program);
+               if (ret < 1024) { return null; }
+               Fallback ret_hu_conv = Fallback.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new PubKeyHash-variant Fallback
+        */
+       public static Fallback pub_key_hash(byte[] a) {
+               long ret = bindings.Fallback_pub_key_hash(a);
+               if (ret < 1024) { return null; }
+               Fallback ret_hu_conv = Fallback.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new ScriptHash-variant Fallback
+        */
+       public static Fallback script_hash(byte[] a) {
+               long ret = bindings.Fallback_script_hash(a);
+               if (ret < 1024) { return null; }
+               Fallback ret_hu_conv = Fallback.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
        /**
         * Checks if two Fallbacks contain equal inner contents.
         * This ignores pointers and is_owned flags and looks at the values in fields.
index c58b4796e57d336c93bf43c7a6f74bcb7eab7c28..bf452b1b74f2123a70b9b75865c9a884f62edea6 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 /**
  * A trait which should be implemented to provide feerate information on a number of time
@@ -60,7 +61,7 @@ public class FeeEstimator extends CommonBase {
         * satoshis-per-byte * 250
         * ceil(satoshis-per-kbyte / 4)
         */
-       public int get_est_sat_per_1000_weight(ConfirmationTarget confirmation_target) {
+       public int get_est_sat_per_1000_weight(org.ldk.enums.ConfirmationTarget confirmation_target) {
                int ret = bindings.FeeEstimator_get_est_sat_per_1000_weight(this.ptr, confirmation_target);
                return ret;
        }
index 4df4cb285e082b1342b9875307ddc094fc296fb6..fe70a48428943f0e7a8ad9d75113ab761af7c4ca 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -33,8 +34,9 @@ public class FilesystemPersister extends CommonBase {
         * Initialize a new FilesystemPersister and set the path to the individual channels'
         * files.
         */
-       public static FilesystemPersister of(String path_to_channel_data) {
+       public static FilesystemPersister of(java.lang.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 +55,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 +67,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..701e70f5c0ad06ff894c34aada3f4e38b437348f 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 /**
  * The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
@@ -98,6 +99,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..40777425d86ed09a27374b1d04eede2230c762af 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -83,6 +84,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 +95,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 +114,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..2208f2f4d24aad0fefcfe94b08cbbb521881a600 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -53,6 +54,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 +65,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 +84,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..67791c525a71af0b0003ee9c804f7278d4eec8ad 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -53,6 +54,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 +65,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 +84,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..ca69712253f169629f31fe07c171c45bc9f55ccd 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -70,6 +71,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 +82,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 +93,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..d2ef7514853147f93525fa7e6f008d3bd75eebf6 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -34,6 +35,9 @@ public class HTLCFailChannelUpdate extends CommonBase {
        }
 
        public final static class ChannelUpdateMessage extends HTLCFailChannelUpdate {
+               /**
+                * The unwrapped message we received
+               */
                public final ChannelUpdate msg;
                private ChannelUpdateMessage(long ptr, bindings.LDKHTLCFailChannelUpdate.ChannelUpdateMessage obj) {
                        super(null, ptr);
@@ -44,7 +48,14 @@ public class HTLCFailChannelUpdate extends CommonBase {
                }
        }
        public final static class ChannelClosed extends HTLCFailChannelUpdate {
+               /**
+                * The short_channel_id which has now closed.
+               */
                public final long short_channel_id;
+               /**
+                * when this true, this channel should be permanently removed from the
+                * consideration. Otherwise, this channel can be restored as new channel_update is received
+               */
                public final boolean is_permanent;
                private ChannelClosed(long ptr, bindings.LDKHTLCFailChannelUpdate.ChannelClosed obj) {
                        super(null, ptr);
@@ -53,7 +64,15 @@ public class HTLCFailChannelUpdate extends CommonBase {
                }
        }
        public final static class NodeFailure extends HTLCFailChannelUpdate {
+               /**
+                * The node_id that has failed.
+               */
                public final byte[] node_id;
+               /**
+                * when this true, node should be permanently removed from the
+                * consideration. Otherwise, the channels connected to this node can be
+                * restored as new channel_update is received
+               */
                public final boolean is_permanent;
                private NodeFailure(long ptr, bindings.LDKHTLCFailChannelUpdate.NodeFailure obj) {
                        super(null, ptr);
@@ -66,9 +85,44 @@ 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;
        }
 
+       /**
+        * Utility method to constructs a new ChannelUpdateMessage-variant HTLCFailChannelUpdate
+        */
+       public static HTLCFailChannelUpdate channel_update_message(ChannelUpdate msg) {
+               long ret = bindings.HTLCFailChannelUpdate_channel_update_message(msg == null ? 0 : msg.ptr & ~1);
+               if (ret < 1024) { return null; }
+               HTLCFailChannelUpdate ret_hu_conv = HTLCFailChannelUpdate.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new ChannelClosed-variant HTLCFailChannelUpdate
+        */
+       public static HTLCFailChannelUpdate channel_closed(long short_channel_id, boolean is_permanent) {
+               long ret = bindings.HTLCFailChannelUpdate_channel_closed(short_channel_id, is_permanent);
+               if (ret < 1024) { return null; }
+               HTLCFailChannelUpdate ret_hu_conv = HTLCFailChannelUpdate.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new NodeFailure-variant HTLCFailChannelUpdate
+        */
+       public static HTLCFailChannelUpdate node_failure(byte[] node_id, boolean is_permanent) {
+               long ret = bindings.HTLCFailChannelUpdate_node_failure(node_id, is_permanent);
+               if (ret < 1024) { return null; }
+               HTLCFailChannelUpdate ret_hu_conv = HTLCFailChannelUpdate.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
 }
index 97a054bf3f58162809460ff18b19ecd9bf20224f..074cc15825b56d86919313809b3833349c02115c 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -93,6 +94,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 +114,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 +125,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 +144,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..2206a59240c4915412a4d09da35c381adf96c51b 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -25,6 +26,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 +45,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..a916cd5175e13144efac72d14e734bcb291e2eae 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -47,6 +48,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 +67,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 +78,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..8790d4e56fb1f1081b5e5f03971e5aac5ddb81f7 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -24,6 +25,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 +37,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 +49,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..8b35588778fed62db46d878919443152eaf9de71 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -116,6 +117,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 +128,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 +140,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 +183,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 +197,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 +212,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 +228,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 +240,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 +252,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 +271,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..05927db1ff8bc07d1f5a935e2aa9129df50a5354 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -23,6 +24,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 +43,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 +55,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 +74,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..4548ae49c5276b17568ff9fabd4d6327c42d2316 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -34,6 +35,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 +46,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 +57,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 +84,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..452fbb0a4b60e6e1ef3045c2347daf0509770061 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -39,6 +40,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 +51,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 +63,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 +85,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 +109,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 +120,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 +131,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 +211,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;
@@ -204,8 +220,9 @@ public class Invoice extends CommonBase {
        /**
         * Read a Invoice object from a string
         */
-       public static Result_InvoiceNoneZ from_str(String s) {
+       public static Result_InvoiceNoneZ from_str(java.lang.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..da08d2fecf8986bafe9a80c5d4afed20cfa63362 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -34,6 +35,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 +46,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 +57,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 +84,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..690787d500afe7b9e42843f4d205ab89a8ad6a22 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -34,6 +35,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..4fdc63351cb9a387353754ef7dd2643865a94160 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 /**
  * A trait to describe an object which can get user secrets and key material.
@@ -156,6 +157,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 +185,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 +198,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..87b6c48e96a92441455375e36c85398263951d6e 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -47,6 +48,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 +63,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;
@@ -80,7 +83,8 @@ public class KeysManager extends CommonBase {
         * this KeysManager or one of the `InMemorySigner` created by this KeysManager.
         */
        public Result_TransactionNoneZ spend_spendable_outputs(SpendableOutputDescriptor[] descriptors, TxOut[] outputs, byte[] change_destination_script, int feerate_sat_per_1000_weight) {
-               long ret = bindings.KeysManager_spend_spendable_outputs(this.ptr, 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);
+               long ret = bindings.KeysManager_spend_spendable_outputs(this.ptr, descriptors != null ? Arrays.stream(descriptors).mapToLong(descriptors_conv_27 -> descriptors_conv_27.ptr).toArray() : null, outputs != null ? Arrays.stream(outputs).mapToLong(outputs_conv_7 -> outputs_conv_7.ptr).toArray() : null, change_destination_script, feerate_sat_per_1000_weight);
+               if (ret < 1024) { return null; }
                Result_TransactionNoneZ ret_hu_conv = Result_TransactionNoneZ.constr_from_ptr(ret);
                /* TODO 2 SpendableOutputDescriptor  */;
                /* TODO 2 TxOut  */;
@@ -93,6 +97,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..a14893e885403af522afe00f5d2a0c4d8b527e99 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -29,7 +30,7 @@ public class LightningError extends CommonBase {
        /**
         * A human-readable message describing the error
         */
-       public void set_err(String val) {
+       public void set_err(java.lang.String val) {
                bindings.LightningError_set_err(this.ptr, val);
        }
 
@@ -38,6 +39,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;
@@ -53,8 +55,9 @@ public class LightningError extends CommonBase {
        /**
         * Constructs a new LightningError given each field
         */
-       public static LightningError of(String err_arg, ErrorAction action_arg) {
+       public static LightningError of(java.lang.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 +68,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 d975ccaa6a46e535ee3aec2a84b2b73d55dcfb14..2e6b835de1b8536c6b232ae79b4fab8d800c91fb 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 /**
  * The `Listen` trait is used to notify when blocks have been connected or disconnected from the
index c77af3793905dffe5b5ecfcff3aa717a595fe36d..fabcb4ef611a96309464cbca74aad3ae29450299 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -23,6 +24,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 4edaa8af425ee89efd48164778dee538f17f66d9..3535744d28a7e937907e65b4efb29fb0aa232116 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 /**
  * A trait encapsulating the operations required of a logger
index 7077b4a2460e59432ce0cb59aa7f97bd0c5b6a34..2e32c5a87f748ad4700b9f0dae529da337123270 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -26,6 +27,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 +53,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 +76,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..670c5b427fb89cd6a6c9f23230910d85c29a0c91 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -85,7 +86,13 @@ public class MessageSendEvent extends CommonBase {
        }
 
        public final static class SendAcceptChannel extends MessageSendEvent {
+               /**
+                * The node_id of the node which should receive this message
+               */
                public final byte[] node_id;
+               /**
+                * The message which should be sent.
+               */
                public final AcceptChannel msg;
                private SendAcceptChannel(long ptr, bindings.LDKMessageSendEvent.SendAcceptChannel obj) {
                        super(null, ptr);
@@ -97,7 +104,13 @@ public class MessageSendEvent extends CommonBase {
                }
        }
        public final static class SendOpenChannel extends MessageSendEvent {
+               /**
+                * The node_id of the node which should receive this message
+               */
                public final byte[] node_id;
+               /**
+                * The message which should be sent.
+               */
                public final OpenChannel msg;
                private SendOpenChannel(long ptr, bindings.LDKMessageSendEvent.SendOpenChannel obj) {
                        super(null, ptr);
@@ -109,7 +122,13 @@ public class MessageSendEvent extends CommonBase {
                }
        }
        public final static class SendFundingCreated extends MessageSendEvent {
+               /**
+                * The node_id of the node which should receive this message
+               */
                public final byte[] node_id;
+               /**
+                * The message which should be sent.
+               */
                public final FundingCreated msg;
                private SendFundingCreated(long ptr, bindings.LDKMessageSendEvent.SendFundingCreated obj) {
                        super(null, ptr);
@@ -121,7 +140,13 @@ public class MessageSendEvent extends CommonBase {
                }
        }
        public final static class SendFundingSigned extends MessageSendEvent {
+               /**
+                * The node_id of the node which should receive this message
+               */
                public final byte[] node_id;
+               /**
+                * The message which should be sent.
+               */
                public final FundingSigned msg;
                private SendFundingSigned(long ptr, bindings.LDKMessageSendEvent.SendFundingSigned obj) {
                        super(null, ptr);
@@ -133,7 +158,13 @@ public class MessageSendEvent extends CommonBase {
                }
        }
        public final static class SendFundingLocked extends MessageSendEvent {
+               /**
+                * The node_id of the node which should receive these message(s)
+               */
                public final byte[] node_id;
+               /**
+                * The funding_locked message which should be sent.
+               */
                public final FundingLocked msg;
                private SendFundingLocked(long ptr, bindings.LDKMessageSendEvent.SendFundingLocked obj) {
                        super(null, ptr);
@@ -145,7 +176,13 @@ public class MessageSendEvent extends CommonBase {
                }
        }
        public final static class SendAnnouncementSignatures extends MessageSendEvent {
+               /**
+                * The node_id of the node which should receive these message(s)
+               */
                public final byte[] node_id;
+               /**
+                * The announcement_signatures message which should be sent.
+               */
                public final AnnouncementSignatures msg;
                private SendAnnouncementSignatures(long ptr, bindings.LDKMessageSendEvent.SendAnnouncementSignatures obj) {
                        super(null, ptr);
@@ -157,7 +194,13 @@ public class MessageSendEvent extends CommonBase {
                }
        }
        public final static class UpdateHTLCs extends MessageSendEvent {
+               /**
+                * The node_id of the node which should receive these message(s)
+               */
                public final byte[] node_id;
+               /**
+                * The update messages which should be sent. ALL messages in the struct should be sent!
+               */
                public final CommitmentUpdate updates;
                private UpdateHTLCs(long ptr, bindings.LDKMessageSendEvent.UpdateHTLCs obj) {
                        super(null, ptr);
@@ -169,7 +212,13 @@ public class MessageSendEvent extends CommonBase {
                }
        }
        public final static class SendRevokeAndACK extends MessageSendEvent {
+               /**
+                * The node_id of the node which should receive this message
+               */
                public final byte[] node_id;
+               /**
+                * The message which should be sent.
+               */
                public final RevokeAndACK msg;
                private SendRevokeAndACK(long ptr, bindings.LDKMessageSendEvent.SendRevokeAndACK obj) {
                        super(null, ptr);
@@ -181,7 +230,13 @@ public class MessageSendEvent extends CommonBase {
                }
        }
        public final static class SendClosingSigned extends MessageSendEvent {
+               /**
+                * The node_id of the node which should receive this message
+               */
                public final byte[] node_id;
+               /**
+                * The message which should be sent.
+               */
                public final ClosingSigned msg;
                private SendClosingSigned(long ptr, bindings.LDKMessageSendEvent.SendClosingSigned obj) {
                        super(null, ptr);
@@ -193,7 +248,13 @@ public class MessageSendEvent extends CommonBase {
                }
        }
        public final static class SendShutdown extends MessageSendEvent {
+               /**
+                * The node_id of the node which should receive this message
+               */
                public final byte[] node_id;
+               /**
+                * The message which should be sent.
+               */
                public final Shutdown msg;
                private SendShutdown(long ptr, bindings.LDKMessageSendEvent.SendShutdown obj) {
                        super(null, ptr);
@@ -205,7 +266,13 @@ public class MessageSendEvent extends CommonBase {
                }
        }
        public final static class SendChannelReestablish extends MessageSendEvent {
+               /**
+                * The node_id of the node which should receive this message
+               */
                public final byte[] node_id;
+               /**
+                * The message which should be sent.
+               */
                public final ChannelReestablish msg;
                private SendChannelReestablish(long ptr, bindings.LDKMessageSendEvent.SendChannelReestablish obj) {
                        super(null, ptr);
@@ -217,7 +284,13 @@ public class MessageSendEvent extends CommonBase {
                }
        }
        public final static class BroadcastChannelAnnouncement extends MessageSendEvent {
+               /**
+                * The channel_announcement which should be sent.
+               */
                public final ChannelAnnouncement msg;
+               /**
+                * The followup channel_update which should be sent.
+               */
                public final ChannelUpdate update_msg;
                private BroadcastChannelAnnouncement(long ptr, bindings.LDKMessageSendEvent.BroadcastChannelAnnouncement obj) {
                        super(null, ptr);
@@ -232,6 +305,9 @@ public class MessageSendEvent extends CommonBase {
                }
        }
        public final static class BroadcastNodeAnnouncement extends MessageSendEvent {
+               /**
+                * The node_announcement which should be sent.
+               */
                public final NodeAnnouncement msg;
                private BroadcastNodeAnnouncement(long ptr, bindings.LDKMessageSendEvent.BroadcastNodeAnnouncement obj) {
                        super(null, ptr);
@@ -242,6 +318,9 @@ public class MessageSendEvent extends CommonBase {
                }
        }
        public final static class BroadcastChannelUpdate extends MessageSendEvent {
+               /**
+                * The channel_update which should be sent.
+               */
                public final ChannelUpdate msg;
                private BroadcastChannelUpdate(long ptr, bindings.LDKMessageSendEvent.BroadcastChannelUpdate obj) {
                        super(null, ptr);
@@ -252,7 +331,13 @@ public class MessageSendEvent extends CommonBase {
                }
        }
        public final static class SendChannelUpdate extends MessageSendEvent {
+               /**
+                * The node_id of the node which should receive this message
+               */
                public final byte[] node_id;
+               /**
+                * The channel_update which should be sent.
+               */
                public final ChannelUpdate msg;
                private SendChannelUpdate(long ptr, bindings.LDKMessageSendEvent.SendChannelUpdate obj) {
                        super(null, ptr);
@@ -264,7 +349,13 @@ public class MessageSendEvent extends CommonBase {
                }
        }
        public final static class HandleError extends MessageSendEvent {
+               /**
+                * The node_id of the node which should receive this message
+               */
                public final byte[] node_id;
+               /**
+                * The action which should be taken.
+               */
                public final ErrorAction action;
                private HandleError(long ptr, bindings.LDKMessageSendEvent.HandleError obj) {
                        super(null, ptr);
@@ -276,6 +367,9 @@ public class MessageSendEvent extends CommonBase {
                }
        }
        public final static class PaymentFailureNetworkUpdate extends MessageSendEvent {
+               /**
+                * The channel/node update which should be sent to NetGraphMsgHandler
+               */
                public final HTLCFailChannelUpdate update;
                private PaymentFailureNetworkUpdate(long ptr, bindings.LDKMessageSendEvent.PaymentFailureNetworkUpdate obj) {
                        super(null, ptr);
@@ -286,7 +380,13 @@ public class MessageSendEvent extends CommonBase {
                }
        }
        public final static class SendChannelRangeQuery extends MessageSendEvent {
+               /**
+                * The node_id of this message recipient
+               */
                public final byte[] node_id;
+               /**
+                * The query_channel_range which should be sent.
+               */
                public final QueryChannelRange msg;
                private SendChannelRangeQuery(long ptr, bindings.LDKMessageSendEvent.SendChannelRangeQuery obj) {
                        super(null, ptr);
@@ -298,7 +398,13 @@ public class MessageSendEvent extends CommonBase {
                }
        }
        public final static class SendShortIdsQuery extends MessageSendEvent {
+               /**
+                * The node_id of this message recipient
+               */
                public final byte[] node_id;
+               /**
+                * The query_short_channel_ids which should be sent.
+               */
                public final QueryShortChannelIds msg;
                private SendShortIdsQuery(long ptr, bindings.LDKMessageSendEvent.SendShortIdsQuery obj) {
                        super(null, ptr);
@@ -310,7 +416,13 @@ public class MessageSendEvent extends CommonBase {
                }
        }
        public final static class SendReplyChannelRange extends MessageSendEvent {
+               /**
+                * The node_id of this message recipient
+               */
                public final byte[] node_id;
+               /**
+                * The reply_channel_range which should be sent.
+               */
                public final ReplyChannelRange msg;
                private SendReplyChannelRange(long ptr, bindings.LDKMessageSendEvent.SendReplyChannelRange obj) {
                        super(null, ptr);
@@ -326,9 +438,249 @@ 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;
        }
 
+       /**
+        * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent
+        */
+       public static MessageSendEvent send_accept_channel(byte[] node_id, AcceptChannel msg) {
+               long ret = bindings.MessageSendEvent_send_accept_channel(node_id, msg == null ? 0 : msg.ptr & ~1);
+               if (ret < 1024) { return null; }
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent
+        */
+       public static MessageSendEvent send_open_channel(byte[] node_id, OpenChannel msg) {
+               long ret = bindings.MessageSendEvent_send_open_channel(node_id, msg == null ? 0 : msg.ptr & ~1);
+               if (ret < 1024) { return null; }
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent
+        */
+       public static MessageSendEvent send_funding_created(byte[] node_id, FundingCreated msg) {
+               long ret = bindings.MessageSendEvent_send_funding_created(node_id, msg == null ? 0 : msg.ptr & ~1);
+               if (ret < 1024) { return null; }
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent
+        */
+       public static MessageSendEvent send_funding_signed(byte[] node_id, FundingSigned msg) {
+               long ret = bindings.MessageSendEvent_send_funding_signed(node_id, msg == null ? 0 : msg.ptr & ~1);
+               if (ret < 1024) { return null; }
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new SendFundingLocked-variant MessageSendEvent
+        */
+       public static MessageSendEvent send_funding_locked(byte[] node_id, FundingLocked msg) {
+               long ret = bindings.MessageSendEvent_send_funding_locked(node_id, msg == null ? 0 : msg.ptr & ~1);
+               if (ret < 1024) { return null; }
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent
+        */
+       public static MessageSendEvent send_announcement_signatures(byte[] node_id, AnnouncementSignatures msg) {
+               long ret = bindings.MessageSendEvent_send_announcement_signatures(node_id, msg == null ? 0 : msg.ptr & ~1);
+               if (ret < 1024) { return null; }
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent
+        */
+       public static MessageSendEvent update_htlcs(byte[] node_id, CommitmentUpdate updates) {
+               long ret = bindings.MessageSendEvent_update_htlcs(node_id, updates == null ? 0 : updates.ptr & ~1);
+               if (ret < 1024) { return null; }
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(updates);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent
+        */
+       public static MessageSendEvent send_revoke_and_ack(byte[] node_id, RevokeAndACK msg) {
+               long ret = bindings.MessageSendEvent_send_revoke_and_ack(node_id, msg == null ? 0 : msg.ptr & ~1);
+               if (ret < 1024) { return null; }
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent
+        */
+       public static MessageSendEvent send_closing_signed(byte[] node_id, ClosingSigned msg) {
+               long ret = bindings.MessageSendEvent_send_closing_signed(node_id, msg == null ? 0 : msg.ptr & ~1);
+               if (ret < 1024) { return null; }
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new SendShutdown-variant MessageSendEvent
+        */
+       public static MessageSendEvent send_shutdown(byte[] node_id, Shutdown msg) {
+               long ret = bindings.MessageSendEvent_send_shutdown(node_id, msg == null ? 0 : msg.ptr & ~1);
+               if (ret < 1024) { return null; }
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent
+        */
+       public static MessageSendEvent send_channel_reestablish(byte[] node_id, ChannelReestablish msg) {
+               long ret = bindings.MessageSendEvent_send_channel_reestablish(node_id, msg == null ? 0 : msg.ptr & ~1);
+               if (ret < 1024) { return null; }
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent
+        */
+       public static MessageSendEvent broadcast_channel_announcement(ChannelAnnouncement msg, ChannelUpdate update_msg) {
+               long ret = bindings.MessageSendEvent_broadcast_channel_announcement(msg == null ? 0 : msg.ptr & ~1, update_msg == null ? 0 : update_msg.ptr & ~1);
+               if (ret < 1024) { return null; }
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               ret_hu_conv.ptrs_to.add(update_msg);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent
+        */
+       public static MessageSendEvent broadcast_node_announcement(NodeAnnouncement msg) {
+               long ret = bindings.MessageSendEvent_broadcast_node_announcement(msg == null ? 0 : msg.ptr & ~1);
+               if (ret < 1024) { return null; }
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent
+        */
+       public static MessageSendEvent broadcast_channel_update(ChannelUpdate msg) {
+               long ret = bindings.MessageSendEvent_broadcast_channel_update(msg == null ? 0 : msg.ptr & ~1);
+               if (ret < 1024) { return null; }
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent
+        */
+       public static MessageSendEvent send_channel_update(byte[] node_id, ChannelUpdate msg) {
+               long ret = bindings.MessageSendEvent_send_channel_update(node_id, msg == null ? 0 : msg.ptr & ~1);
+               if (ret < 1024) { return null; }
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new HandleError-variant MessageSendEvent
+        */
+       public static MessageSendEvent handle_error(byte[] node_id, ErrorAction action) {
+               long ret = bindings.MessageSendEvent_handle_error(node_id, action.ptr);
+               if (ret < 1024) { return null; }
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new PaymentFailureNetworkUpdate-variant MessageSendEvent
+        */
+       public static MessageSendEvent payment_failure_network_update(HTLCFailChannelUpdate update) {
+               long ret = bindings.MessageSendEvent_payment_failure_network_update(update.ptr);
+               if (ret < 1024) { return null; }
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent
+        */
+       public static MessageSendEvent send_channel_range_query(byte[] node_id, QueryChannelRange msg) {
+               long ret = bindings.MessageSendEvent_send_channel_range_query(node_id, msg == null ? 0 : msg.ptr & ~1);
+               if (ret < 1024) { return null; }
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent
+        */
+       public static MessageSendEvent send_short_ids_query(byte[] node_id, QueryShortChannelIds msg) {
+               long ret = bindings.MessageSendEvent_send_short_ids_query(node_id, msg == null ? 0 : msg.ptr & ~1);
+               if (ret < 1024) { return null; }
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent
+        */
+       public static MessageSendEvent send_reply_channel_range(byte[] node_id, ReplyChannelRange msg) {
+               long ret = bindings.MessageSendEvent_send_reply_channel_range(node_id, msg == null ? 0 : msg.ptr & ~1);
+               if (ret < 1024) { return null; }
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
 }
index c548e4e4a51ab9e45f820d313bcb35c7f100d011..97fe69401942cf5a1868414aceedfba8a8ee563e 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 /**
  * A trait indicating an object may generate message send events
@@ -35,7 +36,7 @@ public class MessageSendEventsProvider extends CommonBase {
                impl_holder.held = new MessageSendEventsProvider(new bindings.LDKMessageSendEventsProvider() {
                        @Override public long[] get_and_clear_pending_msg_events() {
                                MessageSendEvent[] ret = arg.get_and_clear_pending_msg_events();
-                               long[] result = Arrays.stream(ret).mapToLong(ret_conv_18 -> ret_conv_18.ptr).toArray();
+                               long[] result = ret != null ? Arrays.stream(ret).mapToLong(ret_conv_18 -> ret_conv_18.ptr).toArray() : null;
                                /* TODO 2 MessageSendEvent  */;
                                return result;
                        }
index ec25b9722e7ce0ce803276ae26dabf8bc552a701..c06fba18c608dc798055c3362977171bf8b51791 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -34,6 +35,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..d93c085a2d5c27c8bc6857ec1d8d469cbc19ef14 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -53,9 +54,34 @@ 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;
        }
 
+       /**
+        * Utility method to constructs a new HTLCEvent-variant MonitorEvent
+        */
+       public static MonitorEvent htlcevent(HTLCUpdate a) {
+               long ret = bindings.MonitorEvent_htlcevent(a == null ? 0 : a.ptr & ~1);
+               if (ret < 1024) { return null; }
+               MonitorEvent ret_hu_conv = MonitorEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(a);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new CommitmentTxBroadcasted-variant MonitorEvent
+        */
+       public static MonitorEvent commitment_tx_broadcasted(OutPoint a) {
+               long ret = bindings.MonitorEvent_commitment_tx_broadcasted(a == null ? 0 : a.ptr & ~1);
+               if (ret < 1024) { return null; }
+               MonitorEvent ret_hu_conv = MonitorEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(a);
+               return ret_hu_conv;
+       }
+
 }
index 6c6c278318f78275a1e7bb572bfa274296d976e3..63fdecb5056b498025099fac196bb5de50b1b3ef 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -27,6 +28,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..420d9bb5c23806ec4499f6cbc9491525d13655f2 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -35,7 +36,13 @@ public class NetAddress extends CommonBase {
        }
 
        public final static class IPv4 extends NetAddress {
+               /**
+                * The 4-byte IPv4 address
+               */
                public final byte[] addr;
+               /**
+                * The port on which the node is listening
+               */
                public final short port;
                private IPv4(long ptr, bindings.LDKNetAddress.IPv4 obj) {
                        super(null, ptr);
@@ -44,7 +51,13 @@ public class NetAddress extends CommonBase {
                }
        }
        public final static class IPv6 extends NetAddress {
+               /**
+                * The 16-byte IPv6 address
+               */
                public final byte[] addr;
+               /**
+                * The port on which the node is listening
+               */
                public final short port;
                private IPv6(long ptr, bindings.LDKNetAddress.IPv6 obj) {
                        super(null, ptr);
@@ -53,7 +66,13 @@ public class NetAddress extends CommonBase {
                }
        }
        public final static class OnionV2 extends NetAddress {
+               /**
+                * The bytes (usually encoded in base32 with \".onion\" appended)
+               */
                public final byte[] addr;
+               /**
+                * The port on which the node is listening
+               */
                public final short port;
                private OnionV2(long ptr, bindings.LDKNetAddress.OnionV2 obj) {
                        super(null, ptr);
@@ -62,9 +81,21 @@ public class NetAddress extends CommonBase {
                }
        }
        public final static class OnionV3 extends NetAddress {
+               /**
+                * The ed25519 long-term public key of the peer
+               */
                public final byte[] ed25519_pubkey;
+               /**
+                * The checksum of the pubkey and version, as included in the onion address
+               */
                public final short checksum;
+               /**
+                * The version byte, as defined by the Tor Onion v3 spec.
+               */
                public final byte version;
+               /**
+                * The port on which the node is listening
+               */
                public final short port;
                private OnionV3(long ptr, bindings.LDKNetAddress.OnionV3 obj) {
                        super(null, ptr);
@@ -79,11 +110,56 @@ 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;
        }
 
+       /**
+        * Utility method to constructs a new IPv4-variant NetAddress
+        */
+       public static NetAddress ipv4(byte[] addr, short port) {
+               long ret = bindings.NetAddress_ipv4(addr, port);
+               if (ret < 1024) { return null; }
+               NetAddress ret_hu_conv = NetAddress.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new IPv6-variant NetAddress
+        */
+       public static NetAddress ipv6(byte[] addr, short port) {
+               long ret = bindings.NetAddress_ipv6(addr, port);
+               if (ret < 1024) { return null; }
+               NetAddress ret_hu_conv = NetAddress.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new OnionV2-variant NetAddress
+        */
+       public static NetAddress onion_v2(byte[] addr, short port) {
+               long ret = bindings.NetAddress_onion_v2(addr, port);
+               if (ret < 1024) { return null; }
+               NetAddress ret_hu_conv = NetAddress.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new OnionV3-variant NetAddress
+        */
+       public static NetAddress onion_v3(byte[] ed25519_pubkey, short checksum, byte version, short port) {
+               long ret = bindings.NetAddress_onion_v3(ed25519_pubkey, checksum, version, port);
+               if (ret < 1024) { return null; }
+               NetAddress ret_hu_conv = NetAddress.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
        /**
         * Serialize the NetAddress object into a byte array which can be read by NetAddress_read
         */
@@ -97,6 +173,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..802258808d4557a20e5e3a09cce03b331aa60588 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -28,9 +29,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 +45,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 +63,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 +79,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 +91,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 +103,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..b010679db4e687ceb4d71293f6e38809988fa9d8 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -23,6 +24,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 +43,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 +53,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 +69,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 +83,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 +98,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 +117,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 +149,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 +162,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..96d7b725b2653d402f94a12c2cd5787f85e60ffe 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -38,6 +39,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 +58,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 +70,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 +89,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..26385c8512323aa8e5b2571dc3e0e6fc4ac78aea 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -23,6 +24,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;
@@ -91,7 +93,7 @@ public class NodeAnnouncementInfo extends CommonBase {
         * Internet-level addresses via which one can connect to the node
         */
        public void set_addresses(NetAddress[] val) {
-               bindings.NodeAnnouncementInfo_set_addresses(this.ptr, Arrays.stream(val).mapToLong(val_conv_12 -> val_conv_12.ptr).toArray());
+               bindings.NodeAnnouncementInfo_set_addresses(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_12 -> val_conv_12.ptr).toArray() : null);
                /* TODO 2 NetAddress  */;
        }
 
@@ -100,9 +102,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 +119,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);
        }
@@ -123,7 +131,8 @@ public class NodeAnnouncementInfo extends CommonBase {
         * Constructs a new NodeAnnouncementInfo given each field
         */
        public static NodeAnnouncementInfo of(NodeFeatures features_arg, int last_update_arg, byte[] rgb_arg, 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);
+               long ret = bindings.NodeAnnouncementInfo_new(features_arg == null ? 0 : features_arg.ptr & ~1, last_update_arg, rgb_arg, alias_arg, addresses_arg != null ? Arrays.stream(addresses_arg).mapToLong(addresses_arg_conv_12 -> addresses_arg_conv_12.ptr).toArray() : null, announcement_message_arg == null ? 0 : announcement_message_arg.ptr & ~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 +146,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 +165,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..9d78059f4e7db1c917dffd4783a4ebbc4ef427bc 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -34,6 +35,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 +46,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 +57,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 +84,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..5bf3853e0fc500844ad459bfbae7e3f019685f17 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -29,9 +30,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 +46,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 +58,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 +74,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 +87,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 +100,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 +119,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..0475b023e626cc7a31603ec61de97062117d333c 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -293,6 +294,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 +313,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..0cb6c0a1ed8f82c92f50e3bdd282996c40c82fc8 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -51,6 +52,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 +63,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 +75,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..89aa6ad24046cfc6a4d28dc01339a99fc1890386 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -45,6 +46,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 +57,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 +69,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..dd6d36ea12b39576257520b4aee39783f9244ce9 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -45,6 +46,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 +57,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 +69,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..f05c62d6a9e22d65f9cab26ab843e6d814957f15 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -45,6 +46,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 +57,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 +69,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..0a8ba4293b6c2625248d7287e1c07ff41e2a5055 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -56,6 +57,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 +68,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 +114,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..efe6a6a7eb7f5243f8f3951db34e59b995a2f1c0 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -34,6 +35,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;
index 4e9bb14976d3f4eb311dd718187d21dfa27a734f..c9963b58d6af07be563d085c89e1a204ab2570da 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -94,9 +95,57 @@ 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;
        }
 
+       /**
+        * Utility method to constructs a new ParameterError-variant PaymentSendFailure
+        */
+       public static PaymentSendFailure parameter_error(APIError a) {
+               long ret = bindings.PaymentSendFailure_parameter_error(a.ptr);
+               if (ret < 1024) { return null; }
+               PaymentSendFailure ret_hu_conv = PaymentSendFailure.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new PathParameterError-variant PaymentSendFailure
+        */
+       public static PaymentSendFailure path_parameter_error(Result_NoneAPIErrorZ[] a) {
+               long ret = bindings.PaymentSendFailure_path_parameter_error(a != null ? Arrays.stream(a).mapToLong(a_conv_22 -> a_conv_22 != null ? a_conv_22.ptr : 0).toArray() : null);
+               if (ret < 1024) { return null; }
+               PaymentSendFailure ret_hu_conv = PaymentSendFailure.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               /* TODO 2 Result_NoneAPIErrorZ  */;
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new AllFailedRetrySafe-variant PaymentSendFailure
+        */
+       public static PaymentSendFailure all_failed_retry_safe(APIError[] a) {
+               long ret = bindings.PaymentSendFailure_all_failed_retry_safe(a != null ? Arrays.stream(a).mapToLong(a_conv_10 -> a_conv_10.ptr).toArray() : null);
+               if (ret < 1024) { return null; }
+               PaymentSendFailure ret_hu_conv = PaymentSendFailure.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               /* TODO 2 APIError  */;
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new PartialFailure-variant PaymentSendFailure
+        */
+       public static PaymentSendFailure partial_failure(Result_NoneAPIErrorZ[] a) {
+               long ret = bindings.PaymentSendFailure_partial_failure(a != null ? Arrays.stream(a).mapToLong(a_conv_22 -> a_conv_22 != null ? a_conv_22.ptr : 0).toArray() : null);
+               if (ret < 1024) { return null; }
+               PaymentSendFailure ret_hu_conv = PaymentSendFailure.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               /* TODO 2 Result_NoneAPIErrorZ  */;
+               return ret_hu_conv;
+       }
+
 }
index 37e984ad0a065374b85ec58db185c3a8b6688c18..1814e943926bbaee7cb756ab8366ae5f84c4c5a4 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -42,6 +43,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 +54,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..c78e85e79cf0976c3fefeb19783c5b6d4057eeed 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -43,6 +44,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 +79,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 +100,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 +122,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 +146,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..57e740669264bc57958c727a220d93682eb3289c 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 /**
  * `Persist` defines behavior for persisting channel monitors: this could mean
@@ -106,6 +107,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 +140,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..20fd551986515338812def0b4218133c6eed731d 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -55,6 +56,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 +67,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 +86,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..908c064b2ef7f6a984451c34f3c31ac12c813e14 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -40,6 +41,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 +52,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 +71,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..fea0ba8604d879fe8e7cf9a94ccc295a657e5e30 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -39,6 +40,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 +53,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 +65,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..be446f1bbad8c6325e4636e2f262138981f245cc 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -37,6 +38,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 +49,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 +60,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..6be4e4ed000e6555fceb92f6eac07808b25fd6eb 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -71,6 +72,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 +83,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 +102,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..ee23d7535649e702b6092a498e1fad9a72637c19 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -52,6 +53,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 +64,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 +75,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..637e344d1378013a1b24b6c52ce16d1f919b594c 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -23,6 +24,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 +54,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..647bab9d8017472059f1008fa854c8b0095fd4d9 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -27,6 +28,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 +58,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,55 +72,94 @@ 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;
@@ -137,6 +179,7 @@ public class RawInvoice extends CommonBase {
 
        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;
index b02a85876d852692f832988a636ba31ed0aab049..3dbb672374ec2ee318d1c093c9c2601ec6caadb8 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -96,6 +97,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 +108,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 +119,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..30edc9778032e2c2d367b45d68dfa567a981a9c0 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -58,6 +59,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 +70,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 +81,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..8eee81353b739bb790752a6e79138a047800e111 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_AcceptChannelDecodeErrorZ extends CommonBase {
        private Result_AcceptChannelDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..2f6c4e865d2b8a8cf2f1a31dad7ef3f1126a0b77 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_AnnouncementSignaturesDecodeErrorZ extends CommonBase {
        private Result_AnnouncementSignaturesDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..ab99e6b240db73314061ffe36d3fa87b4fbb04e5 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_BuiltCommitmentTransactionDecodeErrorZ extends CommonBase {
        private Result_BuiltCommitmentTransactionDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..fe4f27343f280cfc1a9691a50d17a000579a2cf0 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ extends CommonBase {
        private Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -51,6 +52,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 +71,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..8a7392f2eea1049e48d683c02c60a2774571d691 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ extends CommonBase {
        private Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -51,6 +52,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 +63,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..85fbf4eb6728d0ca5ec6b136f993bdcd5c2c6af2 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_C2Tuple_SignatureCVec_SignatureZZNoneZ extends CommonBase {
        private Result_C2Tuple_SignatureCVec_SignatureZZNoneZ(Object _dummy, long ptr) { super(ptr); }
@@ -43,6 +44,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 +54,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 +65,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..c31c02990a344157e46a4633c4f454b5b8b7c275 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_CResult_NetAddressu8ZDecodeErrorZ extends CommonBase {
        private Result_CResult_NetAddressu8ZDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -44,6 +45,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 +55,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 +67,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..d7a654d805e2874f6d3c4e666eada9a995243918 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ extends CommonBase {
        private Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -52,7 +53,8 @@ public class Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ extends CommonB
         * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the success state.
         */
        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());
+               long ret = bindings.CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(o != null ? 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() : null);
+               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;
@@ -61,8 +63,9 @@ public class Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ extends CommonB
        /**
         * Creates a new CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ in the error state.
         */
-       public static Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ err(IOError e) {
+       public static Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ err(org.ldk.enums.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..c027e41b447eace383f5c48bee02a48fe561044d 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_CVec_CVec_u8ZZNoneZ extends CommonBase {
        private Result_CVec_CVec_u8ZZNoneZ(Object _dummy, long ptr) { super(ptr); }
@@ -37,6 +38,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 +48,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 +59,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..5aaba99afaf16dd4d99ba4f4085e9124a494c54b 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_CVec_SignatureZNoneZ extends CommonBase {
        private Result_CVec_SignatureZNoneZ(Object _dummy, long ptr) { super(ptr); }
@@ -37,6 +38,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 +48,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 +59,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..aa397e5be639a82fd2bdc6c0a71978903ba579c6 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_CVec_u8ZPeerHandleErrorZ extends CommonBase {
        private Result_CVec_u8ZPeerHandleErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -42,6 +43,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 +53,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 +65,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..3bceb81bc5476b6e034732e81f27188a255f4926 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_ChannelAnnouncementDecodeErrorZ extends CommonBase {
        private Result_ChannelAnnouncementDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..ff5ec80e529cc68a5b5177bf2db3af41e4ed4f85 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_ChannelConfigDecodeErrorZ extends CommonBase {
        private Result_ChannelConfigDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..9efbca8ba9327e3272500f1ccf77a413dd4a245a 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_ChannelFeaturesDecodeErrorZ extends CommonBase {
        private Result_ChannelFeaturesDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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..0099acf516d67b89dc5542ee848d949c366a5122 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_ChannelInfoDecodeErrorZ extends CommonBase {
        private Result_ChannelInfoDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..df5c335c86fce21e00e89bfd8440eef4a4bfee77 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_ChannelMonitorUpdateDecodeErrorZ extends CommonBase {
        private Result_ChannelMonitorUpdateDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..c56540a3b33de5283f7bc7fa551b20ae1d1ac29f 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_ChannelPublicKeysDecodeErrorZ extends CommonBase {
        private Result_ChannelPublicKeysDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..67b2468d625b8ecdf1909dfceabb02214fab8899 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_ChannelReestablishDecodeErrorZ extends CommonBase {
        private Result_ChannelReestablishDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..3e3cd57e495a566e21043eb64dcc4e4421ea380f 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_ChannelTransactionParametersDecodeErrorZ extends CommonBase {
        private Result_ChannelTransactionParametersDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..20907472e7eb9450b2747389dbabbae1b76c48bc 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_ChannelUpdateDecodeErrorZ extends CommonBase {
        private Result_ChannelUpdateDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..a888b51f461390bce42f034569d3623fdae2dda9 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_ClosingSignedDecodeErrorZ extends CommonBase {
        private Result_ClosingSignedDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..744b3ab2466c8ab17c65de94779a02c7c68cc571 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_CommitmentSignedDecodeErrorZ extends CommonBase {
        private Result_CommitmentSignedDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..d7b913df367ae2e9deba19f3d1c61d1fd2a9b01c 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_CommitmentTransactionDecodeErrorZ extends CommonBase {
        private Result_CommitmentTransactionDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..b556510ad5c6b73f0ec26e63775302ec78b7c24e 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_CounterpartyChannelTransactionParametersDecodeErrorZ extends CommonBase {
        private Result_CounterpartyChannelTransactionParametersDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..3f4791b25ed11275466d32cfb81803e8519c6bc3 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_DelayedPaymentOutputDescriptorDecodeErrorZ extends CommonBase {
        private Result_DelayedPaymentOutputDescriptorDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..28558ed9f988c5e89b1ae195365e706bc47c7006 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_DescriptionCreationErrorZ extends CommonBase {
        private Result_DescriptionCreationErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -42,6 +43,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;
@@ -50,8 +52,9 @@ public class Result_DescriptionCreationErrorZ extends CommonBase {
        /**
         * Creates a new CResult_DescriptionCreationErrorZ in the error state.
         */
-       public static Result_DescriptionCreationErrorZ err(CreationError e) {
+       public static Result_DescriptionCreationErrorZ err(org.ldk.enums.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 +65,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..9d2d0a4753b9c1debc5c4d0253d94bbb39fed0a0 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_DirectionalChannelInfoDecodeErrorZ extends CommonBase {
        private Result_DirectionalChannelInfoDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..cf2970869870398ec1bce82335e0b6b6c7d39306 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_ErrorMessageDecodeErrorZ extends CommonBase {
        private Result_ErrorMessageDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..3e431670ef5fa17661cf4b6498312521c85d26b5 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_ExpiryTimeCreationErrorZ extends CommonBase {
        private Result_ExpiryTimeCreationErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -42,6 +43,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;
@@ -50,8 +52,9 @@ public class Result_ExpiryTimeCreationErrorZ extends CommonBase {
        /**
         * Creates a new CResult_ExpiryTimeCreationErrorZ in the error state.
         */
-       public static Result_ExpiryTimeCreationErrorZ err(CreationError e) {
+       public static Result_ExpiryTimeCreationErrorZ err(org.ldk.enums.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 +65,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..c53184f31a00dd586f3f073e9969e68a374b7569 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_FundingCreatedDecodeErrorZ extends CommonBase {
        private Result_FundingCreatedDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..9bc93de5dd624c7b7318666a66ca703bd21d25f3 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_FundingLockedDecodeErrorZ extends CommonBase {
        private Result_FundingLockedDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..00f7838ba1cd1deb69e52e0bd5f19541e1cf0bd7 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_FundingSignedDecodeErrorZ extends CommonBase {
        private Result_FundingSignedDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..39f286047d05765f8147776634ca2d07ab3c6457 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_GossipTimestampFilterDecodeErrorZ extends CommonBase {
        private Result_GossipTimestampFilterDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..4e3a6e78e609b3828bfa1bd8cdef49c566407951 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_HTLCOutputInCommitmentDecodeErrorZ extends CommonBase {
        private Result_HTLCOutputInCommitmentDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..2ed041632a1aafca4b4bbe99a87ef6290d8deb00 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_HTLCUpdateDecodeErrorZ extends CommonBase {
        private Result_HTLCUpdateDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..7d8f1a4425ce73832c4c8f881d4d11759e196ad0 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_HolderCommitmentTransactionDecodeErrorZ extends CommonBase {
        private Result_HolderCommitmentTransactionDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..c08bc7347cf2d24adde544462c7f97e53e7f4f1f 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_InMemorySignerDecodeErrorZ extends CommonBase {
        private Result_InMemorySignerDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..e5d72ca31a33909bbea407a3b0ab4b76ca0cb2a5 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_InitDecodeErrorZ extends CommonBase {
        private Result_InitDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..2b5842a8cb27727f637b88a382f96ef65bb64580 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_InitFeaturesDecodeErrorZ extends CommonBase {
        private Result_InitFeaturesDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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..2a16df933606a8dff7b3e62498e3e145a3c61db8 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_InvoiceFeaturesDecodeErrorZ extends CommonBase {
        private Result_InvoiceFeaturesDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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..3e018b807319f9c0851ccf6300dd0a46033c4430 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_InvoiceNoneZ extends CommonBase {
        private Result_InvoiceNoneZ(Object _dummy, long ptr) { super(ptr); }
@@ -40,6 +41,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 +52,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 +63,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..edcc9e147a390558e3964843b798c707aebfc792 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_InvoiceSemanticErrorZ extends CommonBase {
        private Result_InvoiceSemanticErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -42,6 +43,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;
@@ -50,8 +52,9 @@ public class Result_InvoiceSemanticErrorZ extends CommonBase {
        /**
         * Creates a new CResult_InvoiceSemanticErrorZ in the error state.
         */
-       public static Result_InvoiceSemanticErrorZ err(SemanticError e) {
+       public static Result_InvoiceSemanticErrorZ err(org.ldk.enums.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 +65,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..6fe8356bf1fafae1f0f1e247a7821ae07e50f406 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_InvoiceSignOrCreationErrorZ extends CommonBase {
        private Result_InvoiceSignOrCreationErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +68,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..608bff1815135aad925bccacdcd9909f3a0f9a09 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_NetAddressDecodeErrorZ extends CommonBase {
        private Result_NetAddressDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +56,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 +68,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..0cadc853a95ab3ad6600bf75c16b41fa752ed434 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_NetAddressu8Z extends CommonBase {
        private Result_NetAddressu8Z(Object _dummy, long ptr) { super(ptr); }
@@ -42,6 +43,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 +53,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 +64,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..ee85fbc3f62b410ddfa6b909a196f7a62b67981d 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_NetworkGraphDecodeErrorZ extends CommonBase {
        private Result_NetworkGraphDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..3439d1ec74d1228ba8939ab204b56d7a82016b8d 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_NodeAnnouncementDecodeErrorZ extends CommonBase {
        private Result_NodeAnnouncementDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..fc9d2079cd9434fb2e14be436d2be084210692e9 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_NodeAnnouncementInfoDecodeErrorZ extends CommonBase {
        private Result_NodeAnnouncementInfoDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..907204c9edcd68535afe4913d1a46e11d676c520 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_NodeFeaturesDecodeErrorZ extends CommonBase {
        private Result_NodeFeaturesDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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..3d627f116c9a3d1b73528671ea66fb0e703ca515 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_NodeInfoDecodeErrorZ extends CommonBase {
        private Result_NodeInfoDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..38f33576879c3db7651047d5242de134f3af4809 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_NoneAPIErrorZ extends CommonBase {
        private Result_NoneAPIErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -40,6 +41,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 +51,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 +62,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..579a84182d16ac29a74d033f063004b19621e66e 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_NoneChannelMonitorUpdateErrZ extends CommonBase {
        private Result_NoneChannelMonitorUpdateErrZ(Object _dummy, long ptr) { super(ptr); }
@@ -37,6 +38,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;
        }
@@ -44,8 +46,9 @@ public class Result_NoneChannelMonitorUpdateErrZ extends CommonBase {
        /**
         * Creates a new CResult_NoneChannelMonitorUpdateErrZ in the error state.
         */
-       public static Result_NoneChannelMonitorUpdateErrZ err(ChannelMonitorUpdateErr e) {
+       public static Result_NoneChannelMonitorUpdateErrZ err(org.ldk.enums.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 +59,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..df8293e1ade8706150e71ed8c05a2eb78a207f85 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_NoneErrorZ extends CommonBase {
        private Result_NoneErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -37,6 +38,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;
        }
@@ -44,8 +46,9 @@ public class Result_NoneErrorZ extends CommonBase {
        /**
         * Creates a new CResult_NoneErrorZ in the error state.
         */
-       public static Result_NoneErrorZ err(IOError e) {
+       public static Result_NoneErrorZ err(org.ldk.enums.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 +59,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..69ac5768809bff396bba34047ecfd17cd556e0b0 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_NoneLightningErrorZ extends CommonBase {
        private Result_NoneLightningErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -40,6 +41,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 +51,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 +63,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..88cec61fcb3ada6457db5206674e1b5ff6c7c034 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_NoneMonitorUpdateErrorZ extends CommonBase {
        private Result_NoneMonitorUpdateErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -40,6 +41,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 +51,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 +63,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..40ce31668ba23070fb914c575d8c15df7fd92428 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_NonePaymentSendFailureZ extends CommonBase {
        private Result_NonePaymentSendFailureZ(Object _dummy, long ptr) { super(ptr); }
@@ -40,6 +41,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 +51,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 +62,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..be711982a229e163bb724bda789eba4258a5aed1 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_NonePeerHandleErrorZ extends CommonBase {
        private Result_NonePeerHandleErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -40,6 +41,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 +51,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 +63,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..eaa13eb54956816146a7726973f0a938ddd71f45 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_NoneSemanticErrorZ extends CommonBase {
        private Result_NoneSemanticErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -37,6 +38,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;
        }
@@ -44,8 +46,9 @@ public class Result_NoneSemanticErrorZ extends CommonBase {
        /**
         * Creates a new CResult_NoneSemanticErrorZ in the error state.
         */
-       public static Result_NoneSemanticErrorZ err(SemanticError e) {
+       public static Result_NoneSemanticErrorZ err(org.ldk.enums.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 +59,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..02e8d1dc4bb22909ac547babd4ddd88e9e72b711 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_OpenChannelDecodeErrorZ extends CommonBase {
        private Result_OpenChannelDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..45948abe8f73f781bff39c7c21f3705b597e7c62 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_OutPointDecodeErrorZ extends CommonBase {
        private Result_OutPointDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..27924358188042fa973034de537bae200cc98162 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_PayeePubKeyErrorZ extends CommonBase {
        private Result_PayeePubKeyErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -42,6 +43,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;
@@ -50,8 +52,9 @@ public class Result_PayeePubKeyErrorZ extends CommonBase {
        /**
         * Creates a new CResult_PayeePubKeyErrorZ in the error state.
         */
-       public static Result_PayeePubKeyErrorZ err(Secp256k1Error e) {
+       public static Result_PayeePubKeyErrorZ err(org.ldk.enums.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 +65,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;
        }
index ce489271ae7a6f90bbb2efa07817567a44487b75..841755f9f2813a10dc8d3f9d7487695c4c27d69b 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_PaymentSecretAPIErrorZ extends CommonBase {
        private Result_PaymentSecretAPIErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -42,6 +43,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 +53,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 +64,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..5953cea23eeeb786530b06b59a7fd68c77126e94 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_PingDecodeErrorZ extends CommonBase {
        private Result_PingDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..d18a1f6e8c6a9a96b6016ffeeea46e92f4a1afb3 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_PongDecodeErrorZ extends CommonBase {
        private Result_PongDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..994822c2cb52b6ba874ccd7f4f2bdff7990e3a93 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_PositiveTimestampCreationErrorZ extends CommonBase {
        private Result_PositiveTimestampCreationErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -42,6 +43,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;
@@ -50,8 +52,9 @@ public class Result_PositiveTimestampCreationErrorZ extends CommonBase {
        /**
         * Creates a new CResult_PositiveTimestampCreationErrorZ in the error state.
         */
-       public static Result_PositiveTimestampCreationErrorZ err(CreationError e) {
+       public static Result_PositiveTimestampCreationErrorZ err(org.ldk.enums.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 +65,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..ea1d96de71d6d48c7b8cd497aea99ba9f9c58d1f 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_PrivateRouteCreationErrorZ extends CommonBase {
        private Result_PrivateRouteCreationErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -42,6 +43,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;
@@ -50,8 +52,9 @@ public class Result_PrivateRouteCreationErrorZ extends CommonBase {
        /**
         * Creates a new CResult_PrivateRouteCreationErrorZ in the error state.
         */
-       public static Result_PrivateRouteCreationErrorZ err(CreationError e) {
+       public static Result_PrivateRouteCreationErrorZ err(org.ldk.enums.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 +65,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..da9c9af6238f00fccd98e27b7a479fb046d92044 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_PublicKeyErrorZ extends CommonBase {
        private Result_PublicKeyErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -39,6 +40,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;
        }
@@ -46,8 +48,9 @@ public class Result_PublicKeyErrorZ extends CommonBase {
        /**
         * Creates a new CResult_PublicKeyErrorZ in the error state.
         */
-       public static Result_PublicKeyErrorZ err(Secp256k1Error e) {
+       public static Result_PublicKeyErrorZ err(org.ldk.enums.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 +61,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..8b7ea87d33c10a55984323d0e43c772a121f9b4d 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_QueryChannelRangeDecodeErrorZ extends CommonBase {
        private Result_QueryChannelRangeDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..a203a8f0a74c3c2145e8360d868ec8d0a2dd9fcc 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_QueryShortChannelIdsDecodeErrorZ extends CommonBase {
        private Result_QueryShortChannelIdsDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..c9dc20260cb4885d810f56d811e14fa298753647 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_RecoverableSignatureNoneZ extends CommonBase {
        private Result_RecoverableSignatureNoneZ(Object _dummy, long ptr) { super(ptr); }
@@ -37,6 +38,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 +48,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 +59,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..5c59bc908e0d65457f4e45fd759c6a3cbcc9c8db 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_ReplyChannelRangeDecodeErrorZ extends CommonBase {
        private Result_ReplyChannelRangeDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..4b7cf3cb041fdb5d7c6ec548e85005831f51d20f 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_ReplyShortChannelIdsEndDecodeErrorZ extends CommonBase {
        private Result_ReplyShortChannelIdsEndDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..b531a774f6e708a675150a5713dd22c738988f5c 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_RevokeAndACKDecodeErrorZ extends CommonBase {
        private Result_RevokeAndACKDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..d2c528b8303816a7119c668b93f52c10a1852014 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_RouteDecodeErrorZ extends CommonBase {
        private Result_RouteDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..e2f1a77fc76ca71bd45c746d004d600ac6f84a2d 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_RouteHopDecodeErrorZ extends CommonBase {
        private Result_RouteHopDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..775fcd9c09bf1a21ef7880886a7e0333b227d4c9 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_RouteLightningErrorZ extends CommonBase {
        private Result_RouteLightningErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..7aedaa6378f27f3766f65f61f6a49f8ae838b562 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_RoutingFeesDecodeErrorZ extends CommonBase {
        private Result_RoutingFeesDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..74102103220ab6ee018a50b0128cb1facf2fd6fe 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_SecretKeyErrorZ extends CommonBase {
        private Result_SecretKeyErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -39,6 +40,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;
        }
@@ -46,8 +48,9 @@ public class Result_SecretKeyErrorZ extends CommonBase {
        /**
         * Creates a new CResult_SecretKeyErrorZ in the error state.
         */
-       public static Result_SecretKeyErrorZ err(Secp256k1Error e) {
+       public static Result_SecretKeyErrorZ err(org.ldk.enums.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..48e31eb1acf858c4637aafa3d38eb5381d7820a9 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_ShutdownDecodeErrorZ extends CommonBase {
        private Result_ShutdownDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..1561bb2405b16a50c0b5f288b4b2c90a1049e317 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_SiPrefixNoneZ extends CommonBase {
        private Result_SiPrefixNoneZ(Object _dummy, long ptr) { super(ptr); }
@@ -35,8 +36,9 @@ public class Result_SiPrefixNoneZ extends CommonBase {
        /**
         * Creates a new CResult_SiPrefixNoneZ in the success state.
         */
-       public static Result_SiPrefixNoneZ ok(SiPrefix o) {
+       public static Result_SiPrefixNoneZ ok(org.ldk.enums.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 +48,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 +59,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..5d454d8abf01a3f25ea6805327367831604be495 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_SignDecodeErrorZ extends CommonBase {
        private Result_SignDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..b008a8114df8ea475daacfd4df922fadb60585eb 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_SignatureNoneZ extends CommonBase {
        private Result_SignatureNoneZ(Object _dummy, long ptr) { super(ptr); }
@@ -37,6 +38,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 +48,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 +59,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..593dcdc34fb8f0e45973a55fccea444059701b39 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_SignedRawInvoiceNoneZ extends CommonBase {
        private Result_SignedRawInvoiceNoneZ(Object _dummy, long ptr) { super(ptr); }
@@ -40,6 +41,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 +52,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 +63,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..c01dd857a60f6d1a223779506d75e92be88a8438 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_SpendableOutputDescriptorDecodeErrorZ extends CommonBase {
        private Result_SpendableOutputDescriptorDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +56,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 +68,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..475a4aeae9e6f8d8ef1b0e8c06c0707f1d615c48 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_StaticPaymentOutputDescriptorDecodeErrorZ extends CommonBase {
        private Result_StaticPaymentOutputDescriptorDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..adefd2f7e95984c83d9a7e88f95b542cc0d9f0a9 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_StringErrorZ extends CommonBase {
        private Result_StringErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -37,8 +38,9 @@ public class Result_StringErrorZ extends CommonBase {
        /**
         * Creates a new CResult_StringErrorZ in the success state.
         */
-       public static Result_StringErrorZ ok(String o) {
+       public static Result_StringErrorZ ok(java.lang.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;
        }
@@ -46,8 +48,9 @@ public class Result_StringErrorZ extends CommonBase {
        /**
         * Creates a new CResult_StringErrorZ in the error state.
         */
-       public static Result_StringErrorZ err(Secp256k1Error e) {
+       public static Result_StringErrorZ err(org.ldk.enums.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..0f6f8e830d0bde731bb5a5ad33d62a4b8fda163f 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_TransactionNoneZ extends CommonBase {
        private Result_TransactionNoneZ(Object _dummy, long ptr) { super(ptr); }
@@ -37,6 +38,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 +48,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 +59,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..68be3d9e6cc13d9c05c68911698b24b33db66ee2 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_TrustedCommitmentTransactionNoneZ extends CommonBase {
        private Result_TrustedCommitmentTransactionNoneZ(Object _dummy, long ptr) { super(ptr); }
@@ -40,6 +41,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 +60,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..2ca2053c82aa32b8382c0b3bd87a52b52d40dd29 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_TxCreationKeysDecodeErrorZ extends CommonBase {
        private Result_TxCreationKeysDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..8528e911678be460c5f94aa1ccd80dfc6974bf92 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_TxCreationKeysErrorZ extends CommonBase {
        private Result_TxCreationKeysErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -42,6 +43,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;
@@ -50,8 +52,9 @@ public class Result_TxCreationKeysErrorZ extends CommonBase {
        /**
         * Creates a new CResult_TxCreationKeysErrorZ in the error state.
         */
-       public static Result_TxCreationKeysErrorZ err(Secp256k1Error e) {
+       public static Result_TxCreationKeysErrorZ err(org.ldk.enums.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 +65,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..bf1ad2006bdd2f0f826a70ef7744cb9b1dbcd273 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_TxOutAccessErrorZ extends CommonBase {
        private Result_TxOutAccessErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -41,6 +42,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;
        }
@@ -48,8 +50,9 @@ public class Result_TxOutAccessErrorZ extends CommonBase {
        /**
         * Creates a new CResult_TxOutAccessErrorZ in the error state.
         */
-       public static Result_TxOutAccessErrorZ err(AccessError e) {
+       public static Result_TxOutAccessErrorZ err(org.ldk.enums.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 +63,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..0f85cdfcda29e89d729333a5707114ef391cdbcf 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_UnsignedChannelAnnouncementDecodeErrorZ extends CommonBase {
        private Result_UnsignedChannelAnnouncementDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..7cff904409b28d5a15b547b1e5f853b36aadacd3 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_UnsignedChannelUpdateDecodeErrorZ extends CommonBase {
        private Result_UnsignedChannelUpdateDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..020b54f328328a88cdc9163ffb44380d7d7506f5 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_UnsignedNodeAnnouncementDecodeErrorZ extends CommonBase {
        private Result_UnsignedNodeAnnouncementDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..91428f87a210e44959b6d1cc1aecf639648d9f14 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_UpdateAddHTLCDecodeErrorZ extends CommonBase {
        private Result_UpdateAddHTLCDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..8d83f7a19c562a2fdd25aa4d7eff34d3bb6415de 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_UpdateFailHTLCDecodeErrorZ extends CommonBase {
        private Result_UpdateFailHTLCDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..5e05a3f2de3409e1fd96ef9c9ab2d6dde844422b 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_UpdateFailMalformedHTLCDecodeErrorZ extends CommonBase {
        private Result_UpdateFailMalformedHTLCDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..3004b3ec3440769b8ffd78f7a3dcd02f26678f0d 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_UpdateFeeDecodeErrorZ extends CommonBase {
        private Result_UpdateFeeDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..0f2302dca00289f582cf7e6a2519a195920593aa 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_UpdateFulfillHTLCDecodeErrorZ extends CommonBase {
        private Result_UpdateFulfillHTLCDecodeErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -45,6 +46,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 +57,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 +69,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..a3a91d1dadc5ffa754e15789d49740942d464f10 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_boolLightningErrorZ extends CommonBase {
        private Result_boolLightningErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -42,6 +43,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 +53,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 +65,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..470321fcaa1644d3ca1cd6dba52667161d533d70 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class Result_boolPeerHandleErrorZ extends CommonBase {
        private Result_boolPeerHandleErrorZ(Object _dummy, long ptr) { super(ptr); }
@@ -42,6 +43,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 +53,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 +65,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..8ae79682dff363c828c3da51f9d5b995394c4c42 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -68,6 +69,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 +80,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 +99,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..5d0515532004c3b97b0f7b3a1616bf50c75150c0 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -28,7 +29,7 @@ public class Route extends CommonBase {
         * ensure it is viable.
         */
        public void set_paths(RouteHop[][] val) {
-               bindings.Route_set_paths(this.ptr, Arrays.stream(val).map(val_conv_12 -> Arrays.stream(val_conv_12).mapToLong(val_conv_12_conv_10 -> val_conv_12_conv_10 == null ? 0 : val_conv_12_conv_10.ptr & ~1).toArray()).toArray(long[][]::new));
+               bindings.Route_set_paths(this.ptr, val != null ? Arrays.stream(val).map(val_conv_12 -> val_conv_12 != null ? Arrays.stream(val_conv_12).mapToLong(val_conv_12_conv_10 -> val_conv_12_conv_10 == null ? 0 : val_conv_12_conv_10.ptr & ~1).toArray() : null).toArray(long[][]::new) : null);
                /* TODO 2 RouteHop[]  */;
        }
 
@@ -36,7 +37,8 @@ public class Route extends CommonBase {
         * Constructs a new Route given each field
         */
        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));
+               long ret = bindings.Route_new(paths_arg != null ? Arrays.stream(paths_arg).map(paths_arg_conv_12 -> paths_arg_conv_12 != null ? Arrays.stream(paths_arg_conv_12).mapToLong(paths_arg_conv_12_conv_10 -> paths_arg_conv_12_conv_10 == null ? 0 : paths_arg_conv_12_conv_10.ptr & ~1).toArray() : null).toArray(long[][]::new) : null);
+               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 +50,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 +69,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..33753cf85ce37ebfb0a120d2bf573a22cab48dba 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -34,6 +35,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..26030859fd3be944055f83fad860b8d813af367b 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -53,6 +54,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 +88,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 +106,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 +124,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 +147,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..9434554027f4999b3238d75657ba080bd8604953 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -39,6 +40,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 +76,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 +132,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 +145,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 +164,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..f1afc840c10818431209969eb31899f6ca373793 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -55,6 +56,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 +78,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 +97,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..7b1ea66a21f8cb14610a5cda1237fad1e471055b 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 /**
  * A trait to describe an object which can receive routing messages.
@@ -60,6 +61,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);
                /**
@@ -120,13 +123,13 @@ public class RoutingMessageHandler extends CommonBase {
                        }
                        @Override public long[] get_next_channel_announcements(long starting_point, byte batch_amount) {
                                ThreeTuple<ChannelAnnouncement, ChannelUpdate, ChannelUpdate>[] ret = arg.get_next_channel_announcements(starting_point, batch_amount);
-                               long[] result = Arrays.stream(ret).mapToLong(ret_conv_63 -> bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(ret_conv_63.a == null ? 0 : ret_conv_63.a.ptr & ~1, ret_conv_63.b == null ? 0 : ret_conv_63.b.ptr & ~1, ret_conv_63.c == null ? 0 : ret_conv_63.c.ptr & ~1)).toArray();
+                               long[] result = ret != null ? Arrays.stream(ret).mapToLong(ret_conv_63 -> bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(ret_conv_63.a == null ? 0 : ret_conv_63.a.ptr & ~1, ret_conv_63.b == null ? 0 : ret_conv_63.b.ptr & ~1, ret_conv_63.c == null ? 0 : ret_conv_63.c.ptr & ~1)).toArray() : null;
                                /* TODO 2 ThreeTuple<ChannelAnnouncement, ChannelUpdate, ChannelUpdate>  */;
                                return result;
                        }
                        @Override public long[] get_next_node_announcements(byte[] starting_point, byte batch_amount) {
                                NodeAnnouncement[] ret = arg.get_next_node_announcements(starting_point, batch_amount);
-                               long[] result = Arrays.stream(ret).mapToLong(ret_conv_18 -> ret_conv_18 == null ? 0 : ret_conv_18.ptr & ~1).toArray();
+                               long[] result = ret != null ? Arrays.stream(ret).mapToLong(ret_conv_18 -> ret_conv_18 == null ? 0 : ret_conv_18.ptr & ~1).toArray() : null;
                                /* TODO 2 NodeAnnouncement  */;
                                return result;
                        }
@@ -165,12 +168,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 +196,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 +208,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 +257,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 +289,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 +303,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 +315,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 +327,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..76c110a7372691e2cf37777bdd9c8900dc4a99fc 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -34,6 +35,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..e35dd79faf38c6516a6e6ccf913889a61670ff10 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -55,6 +56,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 +67,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 +86,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..0a9d65af4d9c32b918533d2d36562510a61f96d4 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 /**
  * A cloneable signer.
@@ -45,6 +46,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 +69,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..f087a97c85d787cc4391474dcc90e59ea0b848bc 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -46,11 +47,34 @@ 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;
        }
 
+       /**
+        * Utility method to constructs a new SignError-variant SignOrCreationError
+        */
+       public static SignOrCreationError sign_error() {
+               long ret = bindings.SignOrCreationError_sign_error();
+               if (ret < 1024) { return null; }
+               SignOrCreationError ret_hu_conv = SignOrCreationError.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new CreationError-variant SignOrCreationError
+        */
+       public static SignOrCreationError creation_error(org.ldk.enums.CreationError a) {
+               long ret = bindings.SignOrCreationError_creation_error(a);
+               if (ret < 1024) { return null; }
+               SignOrCreationError ret_hu_conv = SignOrCreationError.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
        /**
         * Checks if two SignOrCreationErrors contain equal inner contents.
         * This ignores pointers and is_owned flags and looks at the values in fields.
index 45bf92d57456185eb902740980f4fe72a80d1e17..c097c202990ba3dc555f508ed9c15df641c3edfe 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -38,6 +39,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 +53,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 +75,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 +94,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 +105,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;
        }
@@ -116,8 +122,9 @@ public class SignedRawInvoice extends CommonBase {
        /**
         * Read a SignedRawInvoice object from a string
         */
-       public static Result_SignedRawInvoiceNoneZ from_str(String s) {
+       public static Result_SignedRawInvoiceNoneZ from_str(java.lang.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..c1bdaf55971aef36f86281db2396f0be40e178fe 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 /**
  * Provides an object which can be used to send data to and which uniquely identifies a connection
@@ -143,6 +144,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..ea1b4fd6d821db6f11ecc8f8da3a5d77466733ec 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -36,7 +37,13 @@ public class SpendableOutputDescriptor extends CommonBase {
        }
 
        public final static class StaticOutput extends SpendableOutputDescriptor {
+               /**
+                * The outpoint which is spendable
+               */
                public final OutPoint outpoint;
+               /**
+                * The output which is referenced by the given outpoint.
+               */
                public final TxOut output;
                private StaticOutput(long ptr, bindings.LDKSpendableOutputDescriptor.StaticOutput obj) {
                        super(null, ptr);
@@ -74,11 +81,48 @@ 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;
        }
 
+       /**
+        * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor
+        */
+       public static SpendableOutputDescriptor static_output(OutPoint outpoint, TxOut output) {
+               long ret = bindings.SpendableOutputDescriptor_static_output(outpoint == null ? 0 : outpoint.ptr & ~1, output.ptr);
+               if (ret < 1024) { return null; }
+               SpendableOutputDescriptor ret_hu_conv = SpendableOutputDescriptor.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(outpoint);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor
+        */
+       public static SpendableOutputDescriptor delayed_payment_output(DelayedPaymentOutputDescriptor a) {
+               long ret = bindings.SpendableOutputDescriptor_delayed_payment_output(a == null ? 0 : a.ptr & ~1);
+               if (ret < 1024) { return null; }
+               SpendableOutputDescriptor ret_hu_conv = SpendableOutputDescriptor.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(a);
+               return ret_hu_conv;
+       }
+
+       /**
+        * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor
+        */
+       public static SpendableOutputDescriptor static_payment_output(StaticPaymentOutputDescriptor a) {
+               long ret = bindings.SpendableOutputDescriptor_static_payment_output(a == null ? 0 : a.ptr & ~1);
+               if (ret < 1024) { return null; }
+               SpendableOutputDescriptor ret_hu_conv = SpendableOutputDescriptor.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(a);
+               return ret_hu_conv;
+       }
+
        /**
         * Serialize the SpendableOutputDescriptor object into a byte array which can be read by SpendableOutputDescriptor_read
         */
@@ -92,6 +136,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..ee0685a0e0546915e769e95906bb2709a1e7c533 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -24,6 +25,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 +85,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 +97,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 +116,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..5f425d9433dcc82493b5b74e5ae2f0b74dcb8a12 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -36,6 +37,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 +48,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 +62,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..796c3b60e2eea9a774804cfd0b746b61790c11e6 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -112,6 +113,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 +124,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 +143,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 +154,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 +165,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 c3d2259e56be618cd26c6d6245d4ca39a89f253d..80b67a24358b325557eef77d8c6cb3b262f53bde 100644 (file)
@@ -4,13 +4,29 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 public class TxOut extends CommonBase{
-       TxOut(java.lang.Object _dummy, long ptr) { super(ptr); }
-       long to_c_ptr() { return 0; }
+       /** The script_pubkey in this output */
+       public final byte[] script_pubkey;
+       /** The value, in satoshis, of this output */
+       public final long value;
+
+       TxOut(java.lang.Object _dummy, long ptr) {
+               super(ptr);
+               this.script_pubkey = bindings.TxOut_get_script_pubkey(ptr);
+               this.value = bindings.TxOut_get_value(ptr);
+       }
+       public TxOut(long value, byte[] script_pubkey) {
+               super(bindings.TxOut_new(script_pubkey, value));
+               this.script_pubkey = bindings.TxOut_get_script_pubkey(ptr);
+               this.value = bindings.TxOut_get_value(ptr);
+       }
+
        @Override @SuppressWarnings("deprecation")
        protected void finalize() throws Throwable {
                super.finalize();
                if (ptr != 0) { bindings.TxOut_free(ptr); }
        }
+
 }
\ No newline at end of file
index daeed9d6db7a9a2bafdd3044d58abfb547ebdbff..4f789fa42560d521ba8709602b637686bc3784c2 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -23,6 +24,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 +133,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 +152,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..242b58194e2bc285aac597d9ab8cb92c647ea087 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -157,6 +158,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 +177,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..237e4010ce9df90afcf73e85cd44a24b0174d671 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -23,6 +24,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;
@@ -104,7 +106,7 @@ public class UnsignedNodeAnnouncement extends CommonBase {
         * List of addresses on which this node is reachable
         */
        public void set_addresses(NetAddress[] val) {
-               bindings.UnsignedNodeAnnouncement_set_addresses(this.ptr, Arrays.stream(val).mapToLong(val_conv_12 -> val_conv_12.ptr).toArray());
+               bindings.UnsignedNodeAnnouncement_set_addresses(this.ptr, val != null ? Arrays.stream(val).mapToLong(val_conv_12 -> val_conv_12.ptr).toArray() : null);
                /* TODO 2 NetAddress  */;
        }
 
@@ -113,6 +115,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 +134,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..23448cd9de31157104dc96cdda5c93780d5f6f7e 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -98,6 +99,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 +118,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..e1126ae41c88727dc407c1007759ff42084c9023 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -53,6 +54,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 +73,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..dab67c1420b348b7cce4f873140afa7bfca01d02 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -68,6 +69,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 +88,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..b90623891b787722afee62c0351c743831a1c993 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -53,6 +54,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 +65,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 +84,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..626a78dff2656897cac462f169d5e8975785b86d 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -68,6 +69,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 +80,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 +99,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..3b1f2a90d87bf17a9d0e01027d2ba9357a13c54a 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -26,6 +27,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 +46,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 +65,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 +129,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 +143,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 +154,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..5d1eb7afeea0f1fc079dbbbc02aa04cf82d3f9a0 100644 (file)
@@ -1,6 +1,7 @@
 package org.ldk.structs;
 import org.ldk.impl.bindings;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 import org.ldk.enums.*;
 
 public class UtilMethods {
@@ -11,6 +12,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;
        }
@@ -18,8 +20,9 @@ public class UtilMethods {
        /**
         * Recovers the PublicKey of the signer of the message given the message and the signature.
         */
-       public static Result_PublicKeyErrorZ recover_pk(byte[] msg, String sig) {
+       public static Result_PublicKeyErrorZ recover_pk(byte[] msg, java.lang.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;
        }
@@ -28,7 +31,7 @@ public class UtilMethods {
         * Verifies a message was signed by a PrivateKey that derives to a given PublicKey, given a message, a signature,
         * and the PublicKey.
         */
-       public static boolean verify(byte[] msg, String sig, byte[] pk) {
+       public static boolean verify(byte[] msg, java.lang.String sig, byte[] pk) {
                boolean ret = bindings.verify(msg, sig, pk);
                return ret;
        }
@@ -38,6 +41,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;
@@ -47,7 +51,8 @@ public class UtilMethods {
         * Read a C2Tuple_BlockHashChannelManagerZ from a byte array, created by C2Tuple_BlockHashChannelManagerZ_write
         */
        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()));
+               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, arg_channel_monitors != null ? 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() : null));
+               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 +81,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 +96,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 +114,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 +134,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;
        }
@@ -208,9 +217,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) {
-               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);
+       public static Result_RouteLightningErrorZ get_route(byte[] our_node_id, NetworkGraph network, byte[] payee, @Nullable InvoiceFeatures payee_features, @Nullable 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, first_hops != null ? Arrays.stream(first_hops).mapToLong(first_hops_conv_16 -> first_hops_conv_16 == null ? 0 : first_hops_conv_16.ptr & ~1).toArray() : null, last_hops != null ? Arrays.stream(last_hops).mapToLong(last_hops_conv_11 -> last_hops_conv_11 == null ? 0 : last_hops_conv_11.ptr & ~1).toArray() : null, 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);
@@ -224,8 +237,9 @@ public class UtilMethods {
         * Writes the provided `ChannelManager` to the path provided at `FilesystemPersister`
         * initialization, within a file called \"manager\".
         */
-       public static Result_NoneErrorZ FilesystemPersister_persist_manager(String data_dir, ChannelManager manager) {
+       public static Result_NoneErrorZ FilesystemPersister_persist_manager(java.lang.String data_dir, ChannelManager manager) {
                long ret = bindings.FilesystemPersister_persist_manager(data_dir, manager == null ? 0 : manager.ptr & ~1);
+               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;
@@ -238,8 +252,9 @@ public class UtilMethods {
         * doesn't have to store preimage/payment secret information and (b) `ChannelManager` can verify
         * that the payment secret is valid when the invoice is paid.
         */
-       public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(ChannelManager channelmanager, KeysInterface keys_manager, Currency network, Option_u64Z amt_msat, String description) {
+       public static Result_InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(ChannelManager channelmanager, KeysInterface keys_manager, org.ldk.enums.Currency network, Option_u64Z amt_msat, java.lang.String description) {
                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..015f7e4f46b3caadd036f34ef19cb73958ad5719 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 /**
  * The `Watch` trait defines behavior for watching on-chain activity pertaining to channels as
@@ -95,7 +96,7 @@ public class Watch extends CommonBase {
                        }
                        @Override public long[] release_pending_monitor_events() {
                                MonitorEvent[] ret = arg.release_pending_monitor_events();
-                               long[] result = Arrays.stream(ret).mapToLong(ret_conv_14 -> ret_conv_14.ptr).toArray();
+                               long[] result = ret != null ? Arrays.stream(ret).mapToLong(ret_conv_14 -> ret_conv_14.ptr).toArray() : null;
                                /* TODO 2 MonitorEvent  */;
                                return result;
                        }
@@ -115,6 +116,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 +134,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..bb38965aeee054295ebe7dbf69bb35ffd249a7e5 100644 (file)
@@ -4,6 +4,7 @@ import org.ldk.impl.bindings;
 import org.ldk.enums.*;
 import org.ldk.util.*;
 import java.util.Arrays;
+import javax.annotation.Nullable;
 
 
 /**
@@ -30,7 +31,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 +42,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 +54,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 +88,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 +100,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..fa9b3853ded69ffe4c3c5f3597f96dbd37ce6407 100644 (file)
@@ -133,7 +133,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.2", strlen("v0.0.99.2"));
 }
 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()));
@@ -732,6 +732,21 @@ static inline LDKCVec_u8Z CVec_u8Z_clone(const LDKCVec_u8Z *orig) {
        memcpy(ret.data, orig->data, sizeof(int8_t) * ret.datalen);
        return ret;
 }
+struct LDKCVec_u8Z TxOut_get_script_pubkey (struct LDKTxOut* thing) {  return CVec_u8Z_clone(&thing->script_pubkey);}JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxOut_1get_1script_1pubkey(JNIEnv *env, jclass clz, int64_t thing) {
+       LDKTxOut* thing_conv = (LDKTxOut*)(thing & ~1);
+       LDKCVec_u8Z ret_var = TxOut_get_script_pubkey(thing_conv);
+       int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+       (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+       CVec_u8Z_free(ret_var);
+       return ret_arr;
+}
+
+uint64_t TxOut_get_value (struct LDKTxOut* thing) {    return thing->value;}JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1get_1value(JNIEnv *env, jclass clz, int64_t thing) {
+       LDKTxOut* thing_conv = (LDKTxOut*)(thing & ~1);
+       int64_t ret_val = TxOut_get_value(thing_conv);
+       return ret_val;
+}
+
 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeyErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        return ((LDKCResult_SecretKeyErrorZ*)arg)->result_ok;
 }
@@ -2471,11 +2486,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 +2735,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 +2758,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 +2770,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);
@@ -3493,10 +3508,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 +3633,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 +3871,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 +4019,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 +4097,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);
@@ -6140,10 +6150,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 +6238,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 +6315,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 +6346,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 +6399,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 +6505,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 +6688,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 +6857,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 +7019,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 +7736,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 +7822,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 +8436,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 +8495,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 +8756,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 +8782,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 +8867,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 +8952,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;
 }
 
@@ -8960,6 +8972,16 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Transaction_1free(JNIEnv *env,
        Transaction_free(_res_ref);
 }
 
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1new(JNIEnv *env, jclass clz, int8_tArray script_pubkey, int64_t value) {
+       LDKCVec_u8Z script_pubkey_ref;
+       script_pubkey_ref.datalen = (*env)->GetArrayLength(env, script_pubkey);
+       script_pubkey_ref.data = MALLOC(script_pubkey_ref.datalen, "LDKCVec_u8Z Bytes");
+       (*env)->GetByteArrayRegion(env, script_pubkey, 0, script_pubkey_ref.datalen, script_pubkey_ref.data);
+       LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
+       *ret_ref = TxOut_new(script_pubkey_ref, value);
+       return (uint64_t)ret_ref;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        LDKTxOut _res_conv = *(LDKTxOut*)(((uint64_t)_res) & ~1);
@@ -10189,7 +10211,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);
@@ -13268,6 +13290,84 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1clone(JNIEnv *env, j
        return ret_ref;
 }
 
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1funding_1generation_1ready(JNIEnv *env, jclass clz, int8_tArray temporary_channel_id, int64_t channel_value_satoshis, int8_tArray output_script, int64_t user_channel_id) {
+       LDKThirtyTwoBytes temporary_channel_id_ref;
+       CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32);
+       (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_ref.data);
+       LDKCVec_u8Z output_script_ref;
+       output_script_ref.datalen = (*env)->GetArrayLength(env, output_script);
+       output_script_ref.data = MALLOC(output_script_ref.datalen, "LDKCVec_u8Z Bytes");
+       (*env)->GetByteArrayRegion(env, output_script, 0, output_script_ref.datalen, output_script_ref.data);
+       LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+       *ret_copy = Event_funding_generation_ready(temporary_channel_id_ref, channel_value_satoshis, output_script_ref, user_channel_id);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1received(JNIEnv *env, jclass clz, int8_tArray payment_hash, int8_tArray payment_preimage, int8_tArray payment_secret, int64_t amt, int64_t user_payment_id) {
+       LDKThirtyTwoBytes payment_hash_ref;
+       CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
+       (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
+       LDKThirtyTwoBytes payment_preimage_ref;
+       CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
+       (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
+       LDKThirtyTwoBytes payment_secret_ref;
+       CHECK((*env)->GetArrayLength(env, payment_secret) == 32);
+       (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data);
+       LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+       *ret_copy = Event_payment_received(payment_hash_ref, payment_preimage_ref, payment_secret_ref, amt, user_payment_id);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1sent(JNIEnv *env, jclass clz, int8_tArray payment_preimage) {
+       LDKThirtyTwoBytes payment_preimage_ref;
+       CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
+       (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
+       LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+       *ret_copy = Event_payment_sent(payment_preimage_ref);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1failed(JNIEnv *env, jclass clz, int8_tArray payment_hash, jboolean rejected_by_dest) {
+       LDKThirtyTwoBytes payment_hash_ref;
+       CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
+       (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
+       LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+       *ret_copy = Event_payment_failed(payment_hash_ref, rejected_by_dest);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1pending_1htlcs_1forwardable(JNIEnv *env, jclass clz, int64_t time_forwardable) {
+       LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+       *ret_copy = Event_pending_htlcs_forwardable(time_forwardable);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1spendable_1outputs(JNIEnv *env, jclass clz, int64_tArray outputs) {
+       LDKCVec_SpendableOutputDescriptorZ outputs_constr;
+       outputs_constr.datalen = (*env)->GetArrayLength(env, outputs);
+       if (outputs_constr.datalen > 0)
+               outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
+       else
+               outputs_constr.data = NULL;
+       int64_t* outputs_vals = (*env)->GetLongArrayElements (env, outputs, NULL);
+       for (size_t b = 0; b < outputs_constr.datalen; b++) {
+               int64_t outputs_conv_27 = outputs_vals[b];
+               LDKSpendableOutputDescriptor outputs_conv_27_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)outputs_conv_27) & ~1);
+               outputs_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uint64_t)outputs_conv_27) & ~1));
+               outputs_constr.data[b] = outputs_conv_27_conv;
+       }
+       (*env)->ReleaseLongArrayElements(env, outputs, outputs_vals, 0);
+       LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+       *ret_copy = Event_spendable_outputs(outputs_constr);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Event_1write(JNIEnv *env, jclass clz, int64_t obj) {
        LDKEvent* obj_conv = (LDKEvent*)obj;
        LDKCVec_u8Z ret_var = Event_write(obj_conv);
@@ -13292,6 +13392,272 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1clone(JNI
        return ret_ref;
 }
 
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1accept_1channel(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK((*env)->GetArrayLength(env, node_id) == 33);
+       (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+       LDKAcceptChannel msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = AcceptChannel_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_accept_channel(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1open_1channel(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK((*env)->GetArrayLength(env, node_id) == 33);
+       (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+       LDKOpenChannel msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = OpenChannel_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_open_channel(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1funding_1created(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK((*env)->GetArrayLength(env, node_id) == 33);
+       (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+       LDKFundingCreated msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = FundingCreated_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_funding_created(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1funding_1signed(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK((*env)->GetArrayLength(env, node_id) == 33);
+       (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+       LDKFundingSigned msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = FundingSigned_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_funding_signed(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1funding_1locked(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK((*env)->GetArrayLength(env, node_id) == 33);
+       (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+       LDKFundingLocked msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = FundingLocked_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_funding_locked(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1announcement_1signatures(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK((*env)->GetArrayLength(env, node_id) == 33);
+       (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+       LDKAnnouncementSignatures msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = AnnouncementSignatures_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_announcement_signatures(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1update_1htlcs(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t updates) {
+       LDKPublicKey node_id_ref;
+       CHECK((*env)->GetArrayLength(env, node_id) == 33);
+       (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+       LDKCommitmentUpdate updates_conv;
+       updates_conv.inner = (void*)(updates & (~1));
+       updates_conv.is_owned = (updates & 1) || (updates == 0);
+       updates_conv = CommitmentUpdate_clone(&updates_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_update_htlcs(node_id_ref, updates_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1revoke_1and_1ack(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK((*env)->GetArrayLength(env, node_id) == 33);
+       (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+       LDKRevokeAndACK msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = RevokeAndACK_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_revoke_and_ack(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1closing_1signed(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK((*env)->GetArrayLength(env, node_id) == 33);
+       (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+       LDKClosingSigned msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ClosingSigned_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_closing_signed(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1shutdown(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK((*env)->GetArrayLength(env, node_id) == 33);
+       (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+       LDKShutdown msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = Shutdown_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_shutdown(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1reestablish(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK((*env)->GetArrayLength(env, node_id) == 33);
+       (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+       LDKChannelReestablish msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ChannelReestablish_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_channel_reestablish(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1channel_1announcement(JNIEnv *env, jclass clz, int64_t msg, int64_t update_msg) {
+       LDKChannelAnnouncement msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ChannelAnnouncement_clone(&msg_conv);
+       LDKChannelUpdate update_msg_conv;
+       update_msg_conv.inner = (void*)(update_msg & (~1));
+       update_msg_conv.is_owned = (update_msg & 1) || (update_msg == 0);
+       update_msg_conv = ChannelUpdate_clone(&update_msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_broadcast_channel_announcement(msg_conv, update_msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1node_1announcement(JNIEnv *env, jclass clz, int64_t msg) {
+       LDKNodeAnnouncement msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = NodeAnnouncement_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_broadcast_node_announcement(msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1channel_1update(JNIEnv *env, jclass clz, int64_t msg) {
+       LDKChannelUpdate msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ChannelUpdate_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_broadcast_channel_update(msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1update(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK((*env)->GetArrayLength(env, node_id) == 33);
+       (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+       LDKChannelUpdate msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ChannelUpdate_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_channel_update(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1handle_1error(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t action) {
+       LDKPublicKey node_id_ref;
+       CHECK((*env)->GetArrayLength(env, node_id) == 33);
+       (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+       LDKErrorAction action_conv = *(LDKErrorAction*)(((uint64_t)action) & ~1);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_handle_error(node_id_ref, action_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1payment_1failure_1network_1update(JNIEnv *env, jclass clz, int64_t update) {
+       LDKHTLCFailChannelUpdate update_conv = *(LDKHTLCFailChannelUpdate*)(((uint64_t)update) & ~1);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_payment_failure_network_update(update_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1range_1query(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK((*env)->GetArrayLength(env, node_id) == 33);
+       (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+       LDKQueryChannelRange msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = QueryChannelRange_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_channel_range_query(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1short_1ids_1query(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK((*env)->GetArrayLength(env, node_id) == 33);
+       (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+       LDKQueryShortChannelIds msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = QueryShortChannelIds_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_short_ids_query(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1reply_1channel_1range(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK((*env)->GetArrayLength(env, node_id) == 33);
+       (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+       LDKReplyChannelRange msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ReplyChannelRange_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_reply_channel_range(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
        if ((this_ptr & 1) != 0) return;
        LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(((uint64_t)this_ptr) & ~1);
@@ -13320,10 +13686,49 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_APIError_1free(JNIEnv *env, jc
        APIError_free(this_ptr_conv);
 }
 
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
-       LDKAPIError* orig_conv = (LDKAPIError*)orig;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+       LDKAPIError* orig_conv = (LDKAPIError*)orig;
+       LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
+       *ret_copy = APIError_clone(orig_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1apimisuse_1error(JNIEnv *env, jclass clz, jstring err) {
+       LDKStr err_conv = java_to_owned_str(env, err);
+       LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
+       *ret_copy = APIError_apimisuse_error(err_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1fee_1rate_1too_1high(JNIEnv *env, jclass clz, jstring err, int32_t feerate) {
+       LDKStr err_conv = java_to_owned_str(env, err);
+       LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
+       *ret_copy = APIError_fee_rate_too_high(err_conv, feerate);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1route_1error(JNIEnv *env, jclass clz, jstring err) {
+       LDKStr err_conv = java_to_owned_str(env, err);
+       LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
+       *ret_copy = APIError_route_error(err_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1channel_1unavailable(JNIEnv *env, jclass clz, jstring err) {
+       LDKStr err_conv = java_to_owned_str(env, err);
+       LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
+       *ret_copy = APIError_channel_unavailable(err_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1monitor_1update_1failed(JNIEnv *env, jclass clz) {
        LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
-       *ret_copy = APIError_clone(orig_conv);
+       *ret_copy = APIError_monitor_update_failed();
        uint64_t ret_ref = (uint64_t)ret_copy;
        return ret_ref;
 }
@@ -13372,6 +13777,31 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1clone(JNIEnv *env, jc
        return ret_conv;
 }
 
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1trace(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKLevel_to_java(env, Level_trace());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1debug(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKLevel_to_java(env, Level_debug());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1info(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKLevel_to_java(env, Level_info());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1warn(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKLevel_to_java(env, Level_warn());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1error(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKLevel_to_java(env, Level_error());
+       return ret_conv;
+}
+
 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Level_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
        LDKLevel* a_conv = (LDKLevel*)(a & ~1);
        LDKLevel* b_conv = (LDKLevel*)(b & ~1);
@@ -14002,6 +14432,16 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_AccessError_1clone(JNIEnv *e
        return ret_conv;
 }
 
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_AccessError_1unknown_1chain(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKAccessError_to_java(env, AccessError_unknown_chain());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_AccessError_1unknown_1tx(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKAccessError_to_java(env, AccessError_unknown_tx());
+       return ret_conv;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Access_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
        if ((this_ptr & 1) != 0) return;
        LDKAccess this_ptr_conv = *(LDKAccess*)(((uint64_t)this_ptr) & ~1);
@@ -14166,6 +14606,21 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1clone(JN
        return ret_conv;
 }
 
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1background(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_background());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1normal(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_normal());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1high_1priority(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_high_priority());
+       return ret_conv;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
        if ((this_ptr & 1) != 0) return;
        LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)(((uint64_t)this_ptr) & ~1);
@@ -14187,7 +14642,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 +14650,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.
@@ -14321,6 +14776,16 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1clo
        return ret_conv;
 }
 
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1temporary_1failure(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKChannelMonitorUpdateErr_to_java(env, ChannelMonitorUpdateErr_temporary_failure());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1permanent_1failure(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKChannelMonitorUpdateErr_to_java(env, ChannelMonitorUpdateErr_permanent_failure());
+       return ret_conv;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
        LDKMonitorUpdateError this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
@@ -14357,6 +14822,28 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1clone(JNIEnv
        return ret_ref;
 }
 
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1htlcevent(JNIEnv *env, jclass clz, int64_t a) {
+       LDKHTLCUpdate a_conv;
+       a_conv.inner = (void*)(a & (~1));
+       a_conv.is_owned = (a & 1) || (a == 0);
+       a_conv = HTLCUpdate_clone(&a_conv);
+       LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
+       *ret_copy = MonitorEvent_htlcevent(a_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1commitment_1tx_1broadcasted(JNIEnv *env, jclass clz, int64_t a) {
+       LDKOutPoint a_conv;
+       a_conv.inner = (void*)(a & (~1));
+       a_conv.is_owned = (a & 1) || (a == 0);
+       a_conv = OutPoint_clone(&a_conv);
+       LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
+       *ret_copy = MonitorEvent_commitment_tx_broadcasted(a_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
        LDKHTLCUpdate this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
@@ -14568,17 +15055,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 +15091,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 +15131,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 +15167,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 +15193,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);
@@ -15227,6 +15714,40 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1
        return ret_ref;
 }
 
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1static_1output(JNIEnv *env, jclass clz, int64_t outpoint, int64_t output) {
+       LDKOutPoint outpoint_conv;
+       outpoint_conv.inner = (void*)(outpoint & (~1));
+       outpoint_conv.is_owned = (outpoint & 1) || (outpoint == 0);
+       outpoint_conv = OutPoint_clone(&outpoint_conv);
+       LDKTxOut output_conv = *(LDKTxOut*)(((uint64_t)output) & ~1);
+       LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
+       *ret_copy = SpendableOutputDescriptor_static_output(outpoint_conv, output_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1delayed_1payment_1output(JNIEnv *env, jclass clz, int64_t a) {
+       LDKDelayedPaymentOutputDescriptor a_conv;
+       a_conv.inner = (void*)(a & (~1));
+       a_conv.is_owned = (a & 1) || (a == 0);
+       a_conv = DelayedPaymentOutputDescriptor_clone(&a_conv);
+       LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
+       *ret_copy = SpendableOutputDescriptor_delayed_payment_output(a_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1static_1payment_1output(JNIEnv *env, jclass clz, int64_t a) {
+       LDKStaticPaymentOutputDescriptor a_conv;
+       a_conv.inner = (void*)(a & (~1));
+       a_conv.is_owned = (a & 1) || (a == 0);
+       a_conv = StaticPaymentOutputDescriptor_clone(&a_conv);
+       LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
+       *ret_copy = SpendableOutputDescriptor_static_payment_output(a_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) {
        LDKSpendableOutputDescriptor* obj_conv = (LDKSpendableOutputDescriptor*)obj;
        LDKCVec_u8Z ret_var = SpendableOutputDescriptor_write(obj_conv);
@@ -16158,31 +16679,102 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone(J
        return ret_ref;
 }
 
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1parameter_1error(JNIEnv *env, jclass clz, int64_t a) {
+       LDKAPIError a_conv = *(LDKAPIError*)(((uint64_t)a) & ~1);
+       LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
+       *ret_copy = PaymentSendFailure_parameter_error(a_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1path_1parameter_1error(JNIEnv *env, jclass clz, int64_tArray a) {
+       LDKCVec_CResult_NoneAPIErrorZZ a_constr;
+       a_constr.datalen = (*env)->GetArrayLength(env, a);
+       if (a_constr.datalen > 0)
+               a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
+       else
+               a_constr.data = NULL;
+       int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL);
+       for (size_t w = 0; w < a_constr.datalen; w++) {
+               int64_t a_conv_22 = a_vals[w];
+               LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1);
+               a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1));
+               a_constr.data[w] = a_conv_22_conv;
+       }
+       (*env)->ReleaseLongArrayElements(env, a, a_vals, 0);
+       LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
+       *ret_copy = PaymentSendFailure_path_parameter_error(a_constr);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1all_1failed_1retry_1safe(JNIEnv *env, jclass clz, int64_tArray a) {
+       LDKCVec_APIErrorZ a_constr;
+       a_constr.datalen = (*env)->GetArrayLength(env, a);
+       if (a_constr.datalen > 0)
+               a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements");
+       else
+               a_constr.data = NULL;
+       int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL);
+       for (size_t k = 0; k < a_constr.datalen; k++) {
+               int64_t a_conv_10 = a_vals[k];
+               LDKAPIError a_conv_10_conv = *(LDKAPIError*)(((uint64_t)a_conv_10) & ~1);
+               a_conv_10_conv = APIError_clone((LDKAPIError*)(((uint64_t)a_conv_10) & ~1));
+               a_constr.data[k] = a_conv_10_conv;
+       }
+       (*env)->ReleaseLongArrayElements(env, a, a_vals, 0);
+       LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
+       *ret_copy = PaymentSendFailure_all_failed_retry_safe(a_constr);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1partial_1failure(JNIEnv *env, jclass clz, int64_tArray a) {
+       LDKCVec_CResult_NoneAPIErrorZZ a_constr;
+       a_constr.datalen = (*env)->GetArrayLength(env, a);
+       if (a_constr.datalen > 0)
+               a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
+       else
+               a_constr.data = NULL;
+       int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL);
+       for (size_t w = 0; w < a_constr.datalen; w++) {
+               int64_t a_conv_22 = a_vals[w];
+               LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1);
+               a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1));
+               a_constr.data[w] = a_conv_22_conv;
+       }
+       (*env)->ReleaseLongArrayElements(env, a, a_vals, 0);
+       LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
+       *ret_copy = PaymentSendFailure_partial_failure(a_constr);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1new(JNIEnv *env, jclass clz, int64_t fee_est, int64_t chain_monitor, int64_t tx_broadcaster, int64_t logger, int64_t keys_manager, int64_t config, int64_t params) {
        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));
@@ -16557,7 +17149,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 +17169,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 +17189,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 +17209,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 +17229,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 +17263,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 +17442,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;
 }
 
@@ -18886,6 +19479,46 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1clone(JNIEnv *e
        return ret_ref;
 }
 
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1ipv4(JNIEnv *env, jclass clz, int8_tArray addr, int16_t port) {
+       LDKFourBytes addr_ref;
+       CHECK((*env)->GetArrayLength(env, addr) == 4);
+       (*env)->GetByteArrayRegion(env, addr, 0, 4, addr_ref.data);
+       LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
+       *ret_copy = NetAddress_ipv4(addr_ref, port);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1ipv6(JNIEnv *env, jclass clz, int8_tArray addr, int16_t port) {
+       LDKSixteenBytes addr_ref;
+       CHECK((*env)->GetArrayLength(env, addr) == 16);
+       (*env)->GetByteArrayRegion(env, addr, 0, 16, addr_ref.data);
+       LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
+       *ret_copy = NetAddress_ipv6(addr_ref, port);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1onion_1v2(JNIEnv *env, jclass clz, int8_tArray addr, int16_t port) {
+       LDKTenBytes addr_ref;
+       CHECK((*env)->GetArrayLength(env, addr) == 10);
+       (*env)->GetByteArrayRegion(env, addr, 0, 10, addr_ref.data);
+       LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
+       *ret_copy = NetAddress_onion_v2(addr_ref, port);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1onion_1v3(JNIEnv *env, jclass clz, int8_tArray ed25519_pubkey, int16_t checksum, int8_t version, int16_t port) {
+       LDKThirtyTwoBytes ed25519_pubkey_ref;
+       CHECK((*env)->GetArrayLength(env, ed25519_pubkey) == 32);
+       (*env)->GetByteArrayRegion(env, ed25519_pubkey, 0, 32, ed25519_pubkey_ref.data);
+       LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
+       *ret_copy = NetAddress_onion_v3(ed25519_pubkey_ref, checksum, version, port);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetAddress_1write(JNIEnv *env, jclass clz, int64_t obj) {
        LDKNetAddress* obj_conv = (LDKNetAddress*)obj;
        LDKCVec_u8Z ret_var = NetAddress_write(obj_conv);
@@ -20137,6 +20770,43 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1clone(JNIEnv *
        return ret_ref;
 }
 
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1disconnect_1peer(JNIEnv *env, jclass clz, int64_t msg) {
+       LDKErrorMessage msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ErrorMessage_clone(&msg_conv);
+       LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
+       *ret_copy = ErrorAction_disconnect_peer(msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1ignore_1error(JNIEnv *env, jclass clz) {
+       LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
+       *ret_copy = ErrorAction_ignore_error();
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1ignore_1and_1log(JNIEnv *env, jclass clz, jclass a) {
+       LDKLevel a_conv = LDKLevel_from_java(env, a);
+       LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
+       *ret_copy = ErrorAction_ignore_and_log(a_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1send_1error_1message(JNIEnv *env, jclass clz, int64_t msg) {
+       LDKErrorMessage msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ErrorMessage_clone(&msg_conv);
+       LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
+       *ret_copy = ErrorAction_send_error_message(msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
        LDKLightningError this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
@@ -20150,6 +20820,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;
 }
 
@@ -20467,6 +21138,34 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCFailChannelUpdate_1clon
        return ret_ref;
 }
 
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCFailChannelUpdate_1channel_1update_1message(JNIEnv *env, jclass clz, int64_t msg) {
+       LDKChannelUpdate msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ChannelUpdate_clone(&msg_conv);
+       LDKHTLCFailChannelUpdate *ret_copy = MALLOC(sizeof(LDKHTLCFailChannelUpdate), "LDKHTLCFailChannelUpdate");
+       *ret_copy = HTLCFailChannelUpdate_channel_update_message(msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCFailChannelUpdate_1channel_1closed(JNIEnv *env, jclass clz, int64_t short_channel_id, jboolean is_permanent) {
+       LDKHTLCFailChannelUpdate *ret_copy = MALLOC(sizeof(LDKHTLCFailChannelUpdate), "LDKHTLCFailChannelUpdate");
+       *ret_copy = HTLCFailChannelUpdate_channel_closed(short_channel_id, is_permanent);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCFailChannelUpdate_1node_1failure(JNIEnv *env, jclass clz, int8_tArray node_id, jboolean is_permanent) {
+       LDKPublicKey node_id_ref;
+       CHECK((*env)->GetArrayLength(env, node_id) == 33);
+       (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+       LDKHTLCFailChannelUpdate *ret_copy = MALLOC(sizeof(LDKHTLCFailChannelUpdate), "LDKHTLCFailChannelUpdate");
+       *ret_copy = HTLCFailChannelUpdate_node_failure(node_id_ref, is_permanent);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
        if ((this_ptr & 1) != 0) return;
        LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)(((uint64_t)this_ptr) & ~1);
@@ -21234,7 +21933,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 +21953,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 +21962,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 +22062,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 +22100,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 +22114,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);
@@ -23722,20 +24421,24 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_get_1route(JNIEnv *env, jcl
        payee_features_conv.is_owned = (payee_features & 1) || (payee_features == 0);
        payee_features_conv = InvoiceFeatures_clone(&payee_features_conv);
        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_ChannelDetailsZ *first_hops_ptr = NULL;
+       if (first_hops != NULL) {
+               first_hops_constr.datalen = (*env)->GetArrayLength(env, first_hops);
+               if (first_hops_constr.datalen > 0)
+                       first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
+               else
+                       first_hops_constr.data = NULL;
+               int64_t* first_hops_vals = (*env)->GetLongArrayElements (env, first_hops, NULL);
+               for (size_t q = 0; q < first_hops_constr.datalen; q++) {
+                       int64_t first_hops_conv_16 = first_hops_vals[q];
+                       LDKChannelDetails first_hops_conv_16_conv;
+                       first_hops_conv_16_conv.inner = (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);
+               first_hops_ptr = &first_hops_constr;
+       }
        LDKCVec_RouteHintZ last_hops_constr;
        last_hops_constr.datalen = (*env)->GetArrayLength(env, last_hops);
        if (last_hops_constr.datalen > 0)
@@ -23755,11 +24458,11 @@ 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);
-       FREE(first_hops_constr.data);
+       *ret_conv = get_route(our_node_id_ref, &network_conv, payee_ref, payee_features_conv, first_hops_ptr, last_hops_constr, final_value_msat, final_cltv, logger_conv);
+       if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
        return (uint64_t)ret_conv;
 }
 
@@ -23808,7 +24511,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 +24519,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 +24538,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 +24546,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 +24572,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 +25560,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 +25583,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 +25649,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 +25670,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 +25704,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 +25723,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.
@@ -25261,6 +25965,26 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SiPrefix_1clone(JNIEnv *env,
        return ret_conv;
 }
 
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SiPrefix_1milli(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKSiPrefix_to_java(env, SiPrefix_milli());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SiPrefix_1micro(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKSiPrefix_to_java(env, SiPrefix_micro());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SiPrefix_1nano(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKSiPrefix_to_java(env, SiPrefix_nano());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SiPrefix_1pico(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKSiPrefix_to_java(env, SiPrefix_pico());
+       return ret_conv;
+}
+
 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SiPrefix_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
        LDKSiPrefix* a_conv = (LDKSiPrefix*)(a & ~1);
        LDKSiPrefix* b_conv = (LDKSiPrefix*)(b & ~1);
@@ -25280,6 +26004,31 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1clone(JNIEnv *env,
        return ret_conv;
 }
 
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1bitcoin(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKCurrency_to_java(env, Currency_bitcoin());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1bitcoin_1testnet(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKCurrency_to_java(env, Currency_bitcoin_testnet());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1regtest(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKCurrency_to_java(env, Currency_regtest());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1simnet(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKCurrency_to_java(env, Currency_simnet());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1signet(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKCurrency_to_java(env, Currency_signet());
+       return ret_conv;
+}
+
 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Currency_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
        LDKCurrency* a_conv = (LDKCurrency*)(a & ~1);
        LDKCurrency* b_conv = (LDKCurrency*)(b & ~1);
@@ -25462,6 +26211,38 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1clone(JNIEnv *env
        return ret_ref;
 }
 
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1seg_1wit_1program(JNIEnv *env, jclass clz, int8_t version, int8_tArray program) {
+       
+       LDKCVec_u8Z program_ref;
+       program_ref.datalen = (*env)->GetArrayLength(env, program);
+       program_ref.data = MALLOC(program_ref.datalen, "LDKCVec_u8Z Bytes");
+       (*env)->GetByteArrayRegion(env, program, 0, program_ref.datalen, program_ref.data);
+       LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
+       *ret_copy = Fallback_seg_wit_program((LDKu5){ ._0 = version }, program_ref);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1pub_1key_1hash(JNIEnv *env, jclass clz, int8_tArray a) {
+       LDKTwentyBytes a_ref;
+       CHECK((*env)->GetArrayLength(env, a) == 20);
+       (*env)->GetByteArrayRegion(env, a, 0, 20, a_ref.data);
+       LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
+       *ret_copy = Fallback_pub_key_hash(a_ref);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1script_1hash(JNIEnv *env, jclass clz, int8_tArray a) {
+       LDKTwentyBytes a_ref;
+       CHECK((*env)->GetArrayLength(env, a) == 20);
+       (*env)->GetByteArrayRegion(env, a, 0, 20, a_ref.data);
+       LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
+       *ret_copy = Fallback_script_hash(a_ref);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Fallback_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
        LDKFallback* a_conv = (LDKFallback*)a;
        LDKFallback* b_conv = (LDKFallback*)b;
@@ -25965,6 +26746,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;
 }
 
@@ -26027,6 +26809,26 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1clone(JNIEnv
        return ret_conv;
 }
 
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1description_1too_1long(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKCreationError_to_java(env, CreationError_description_too_long());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1route_1too_1long(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKCreationError_to_java(env, CreationError_route_too_long());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1timestamp_1out_1of_1bounds(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKCreationError_to_java(env, CreationError_timestamp_out_of_bounds());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1expiry_1time_1out_1of_1bounds(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKCreationError_to_java(env, CreationError_expiry_time_out_of_bounds());
+       return ret_conv;
+}
+
 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CreationError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
        LDKCreationError* a_conv = (LDKCreationError*)(a & ~1);
        LDKCreationError* b_conv = (LDKCreationError*)(b & ~1);
@@ -26038,6 +26840,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;
 }
 
@@ -26047,6 +26850,46 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1clone(JNIEnv
        return ret_conv;
 }
 
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1no_1payment_1hash(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_no_payment_hash());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1multiple_1payment_1hashes(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_multiple_payment_hashes());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1no_1description(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_no_description());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1multiple_1descriptions(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_multiple_descriptions());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1multiple_1payment_1secrets(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_multiple_payment_secrets());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1invalid_1features(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_invalid_features());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1invalid_1recovery_1id(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_invalid_recovery_id());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1invalid_1signature(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_invalid_signature());
+       return ret_conv;
+}
+
 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SemanticError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
        LDKSemanticError* a_conv = (LDKSemanticError*)(a & ~1);
        LDKSemanticError* b_conv = (LDKSemanticError*)(b & ~1);
@@ -26058,6 +26901,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;
 }
 
@@ -26076,6 +26920,21 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1clone(
        return ret_ref;
 }
 
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1sign_1error(JNIEnv *env, jclass clz) {
+       LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
+       *ret_copy = SignOrCreationError_sign_error();
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1creation_1error(JNIEnv *env, jclass clz, jclass a) {
+       LDKCreationError a_conv = LDKCreationError_from_java(env, a);
+       LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
+       *ret_copy = SignOrCreationError_creation_error(a_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
        LDKSignOrCreationError* a_conv = (LDKSignOrCreationError*)a;
        LDKSignOrCreationError* b_conv = (LDKSignOrCreationError*)b;
@@ -26087,6 +26946,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 +26957,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 +26994,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 +27004,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 +27012,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 +27020,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..7b63fbd7f2c553f6f40592e212a09ce54def93e6 100644 (file)
@@ -131,7 +131,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.2", strlen("v0.0.99.2"));
 }
 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()));
@@ -730,6 +730,21 @@ static inline LDKCVec_u8Z CVec_u8Z_clone(const LDKCVec_u8Z *orig) {
        memcpy(ret.data, orig->data, sizeof(int8_t) * ret.datalen);
        return ret;
 }
+struct LDKCVec_u8Z TxOut_get_script_pubkey (struct LDKTxOut* thing) {  return CVec_u8Z_clone(&thing->script_pubkey);}JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_TxOut_1get_1script_1pubkey(JNIEnv *env, jclass clz, int64_t thing) {
+       LDKTxOut* thing_conv = (LDKTxOut*)(thing & ~1);
+       LDKCVec_u8Z ret_var = TxOut_get_script_pubkey(thing_conv);
+       int8_tArray ret_arr = (*env)->NewByteArray(env, ret_var.datalen);
+       (*env)->SetByteArrayRegion(env, ret_arr, 0, ret_var.datalen, ret_var.data);
+       CVec_u8Z_free(ret_var);
+       return ret_arr;
+}
+
+uint64_t TxOut_get_value (struct LDKTxOut* thing) {    return thing->value;}JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1get_1value(JNIEnv *env, jclass clz, int64_t thing) {
+       LDKTxOut* thing_conv = (LDKTxOut*)(thing & ~1);
+       int64_t ret_val = TxOut_get_value(thing_conv);
+       return ret_val;
+}
+
 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeyErrorZ_1result_1ok(JNIEnv *env, jclass clz, int64_t arg) {
        return ((LDKCResult_SecretKeyErrorZ*)arg)->result_ok;
 }
@@ -2469,11 +2484,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 +2733,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 +2756,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 +2768,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);
@@ -3491,10 +3506,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 +3631,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 +3869,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 +4017,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 +4095,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);
@@ -6138,10 +6148,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 +6236,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 +6313,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 +6344,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 +6397,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 +6503,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 +6686,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 +6855,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 +7017,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 +7734,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 +7820,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 +8434,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 +8493,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 +8754,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 +8780,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 +8865,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 +8950,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;
 }
 
@@ -8958,6 +8970,16 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Transaction_1free(JNIEnv *env,
        Transaction_free(_res_ref);
 }
 
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxOut_1new(JNIEnv *env, jclass clz, int8_tArray script_pubkey, int64_t value) {
+       LDKCVec_u8Z script_pubkey_ref;
+       script_pubkey_ref.datalen = (*env)->GetArrayLength(env, script_pubkey);
+       script_pubkey_ref.data = MALLOC(script_pubkey_ref.datalen, "LDKCVec_u8Z Bytes");
+       (*env)->GetByteArrayRegion(env, script_pubkey, 0, script_pubkey_ref.datalen, script_pubkey_ref.data);
+       LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
+       *ret_ref = TxOut_new(script_pubkey_ref, value);
+       return (uint64_t)ret_ref;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_1free(JNIEnv *env, jclass clz, int64_t _res) {
        if ((_res & 1) != 0) return;
        LDKTxOut _res_conv = *(LDKTxOut*)(((uint64_t)_res) & ~1);
@@ -10187,7 +10209,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);
@@ -13266,6 +13288,84 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1clone(JNIEnv *env, j
        return ret_ref;
 }
 
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1funding_1generation_1ready(JNIEnv *env, jclass clz, int8_tArray temporary_channel_id, int64_t channel_value_satoshis, int8_tArray output_script, int64_t user_channel_id) {
+       LDKThirtyTwoBytes temporary_channel_id_ref;
+       CHECK((*env)->GetArrayLength(env, temporary_channel_id) == 32);
+       (*env)->GetByteArrayRegion(env, temporary_channel_id, 0, 32, temporary_channel_id_ref.data);
+       LDKCVec_u8Z output_script_ref;
+       output_script_ref.datalen = (*env)->GetArrayLength(env, output_script);
+       output_script_ref.data = MALLOC(output_script_ref.datalen, "LDKCVec_u8Z Bytes");
+       (*env)->GetByteArrayRegion(env, output_script, 0, output_script_ref.datalen, output_script_ref.data);
+       LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+       *ret_copy = Event_funding_generation_ready(temporary_channel_id_ref, channel_value_satoshis, output_script_ref, user_channel_id);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1received(JNIEnv *env, jclass clz, int8_tArray payment_hash, int8_tArray payment_preimage, int8_tArray payment_secret, int64_t amt, int64_t user_payment_id) {
+       LDKThirtyTwoBytes payment_hash_ref;
+       CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
+       (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
+       LDKThirtyTwoBytes payment_preimage_ref;
+       CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
+       (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
+       LDKThirtyTwoBytes payment_secret_ref;
+       CHECK((*env)->GetArrayLength(env, payment_secret) == 32);
+       (*env)->GetByteArrayRegion(env, payment_secret, 0, 32, payment_secret_ref.data);
+       LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+       *ret_copy = Event_payment_received(payment_hash_ref, payment_preimage_ref, payment_secret_ref, amt, user_payment_id);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1sent(JNIEnv *env, jclass clz, int8_tArray payment_preimage) {
+       LDKThirtyTwoBytes payment_preimage_ref;
+       CHECK((*env)->GetArrayLength(env, payment_preimage) == 32);
+       (*env)->GetByteArrayRegion(env, payment_preimage, 0, 32, payment_preimage_ref.data);
+       LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+       *ret_copy = Event_payment_sent(payment_preimage_ref);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1payment_1failed(JNIEnv *env, jclass clz, int8_tArray payment_hash, jboolean rejected_by_dest) {
+       LDKThirtyTwoBytes payment_hash_ref;
+       CHECK((*env)->GetArrayLength(env, payment_hash) == 32);
+       (*env)->GetByteArrayRegion(env, payment_hash, 0, 32, payment_hash_ref.data);
+       LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+       *ret_copy = Event_payment_failed(payment_hash_ref, rejected_by_dest);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1pending_1htlcs_1forwardable(JNIEnv *env, jclass clz, int64_t time_forwardable) {
+       LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+       *ret_copy = Event_pending_htlcs_forwardable(time_forwardable);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Event_1spendable_1outputs(JNIEnv *env, jclass clz, int64_tArray outputs) {
+       LDKCVec_SpendableOutputDescriptorZ outputs_constr;
+       outputs_constr.datalen = (*env)->GetArrayLength(env, outputs);
+       if (outputs_constr.datalen > 0)
+               outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
+       else
+               outputs_constr.data = NULL;
+       int64_t* outputs_vals = (*env)->GetLongArrayElements (env, outputs, NULL);
+       for (size_t b = 0; b < outputs_constr.datalen; b++) {
+               int64_t outputs_conv_27 = outputs_vals[b];
+               LDKSpendableOutputDescriptor outputs_conv_27_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)outputs_conv_27) & ~1);
+               outputs_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uint64_t)outputs_conv_27) & ~1));
+               outputs_constr.data[b] = outputs_conv_27_conv;
+       }
+       (*env)->ReleaseLongArrayElements(env, outputs, outputs_vals, 0);
+       LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+       *ret_copy = Event_spendable_outputs(outputs_constr);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_Event_1write(JNIEnv *env, jclass clz, int64_t obj) {
        LDKEvent* obj_conv = (LDKEvent*)obj;
        LDKCVec_u8Z ret_var = Event_write(obj_conv);
@@ -13290,6 +13390,272 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1clone(JNI
        return ret_ref;
 }
 
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1accept_1channel(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK((*env)->GetArrayLength(env, node_id) == 33);
+       (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+       LDKAcceptChannel msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = AcceptChannel_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_accept_channel(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1open_1channel(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK((*env)->GetArrayLength(env, node_id) == 33);
+       (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+       LDKOpenChannel msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = OpenChannel_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_open_channel(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1funding_1created(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK((*env)->GetArrayLength(env, node_id) == 33);
+       (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+       LDKFundingCreated msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = FundingCreated_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_funding_created(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1funding_1signed(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK((*env)->GetArrayLength(env, node_id) == 33);
+       (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+       LDKFundingSigned msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = FundingSigned_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_funding_signed(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1funding_1locked(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK((*env)->GetArrayLength(env, node_id) == 33);
+       (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+       LDKFundingLocked msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = FundingLocked_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_funding_locked(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1announcement_1signatures(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK((*env)->GetArrayLength(env, node_id) == 33);
+       (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+       LDKAnnouncementSignatures msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = AnnouncementSignatures_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_announcement_signatures(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1update_1htlcs(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t updates) {
+       LDKPublicKey node_id_ref;
+       CHECK((*env)->GetArrayLength(env, node_id) == 33);
+       (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+       LDKCommitmentUpdate updates_conv;
+       updates_conv.inner = (void*)(updates & (~1));
+       updates_conv.is_owned = (updates & 1) || (updates == 0);
+       updates_conv = CommitmentUpdate_clone(&updates_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_update_htlcs(node_id_ref, updates_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1revoke_1and_1ack(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK((*env)->GetArrayLength(env, node_id) == 33);
+       (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+       LDKRevokeAndACK msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = RevokeAndACK_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_revoke_and_ack(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1closing_1signed(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK((*env)->GetArrayLength(env, node_id) == 33);
+       (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+       LDKClosingSigned msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ClosingSigned_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_closing_signed(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1shutdown(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK((*env)->GetArrayLength(env, node_id) == 33);
+       (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+       LDKShutdown msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = Shutdown_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_shutdown(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1reestablish(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK((*env)->GetArrayLength(env, node_id) == 33);
+       (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+       LDKChannelReestablish msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ChannelReestablish_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_channel_reestablish(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1channel_1announcement(JNIEnv *env, jclass clz, int64_t msg, int64_t update_msg) {
+       LDKChannelAnnouncement msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ChannelAnnouncement_clone(&msg_conv);
+       LDKChannelUpdate update_msg_conv;
+       update_msg_conv.inner = (void*)(update_msg & (~1));
+       update_msg_conv.is_owned = (update_msg & 1) || (update_msg == 0);
+       update_msg_conv = ChannelUpdate_clone(&update_msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_broadcast_channel_announcement(msg_conv, update_msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1node_1announcement(JNIEnv *env, jclass clz, int64_t msg) {
+       LDKNodeAnnouncement msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = NodeAnnouncement_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_broadcast_node_announcement(msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1channel_1update(JNIEnv *env, jclass clz, int64_t msg) {
+       LDKChannelUpdate msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ChannelUpdate_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_broadcast_channel_update(msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1update(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK((*env)->GetArrayLength(env, node_id) == 33);
+       (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+       LDKChannelUpdate msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ChannelUpdate_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_channel_update(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1handle_1error(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t action) {
+       LDKPublicKey node_id_ref;
+       CHECK((*env)->GetArrayLength(env, node_id) == 33);
+       (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+       LDKErrorAction action_conv = *(LDKErrorAction*)(((uint64_t)action) & ~1);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_handle_error(node_id_ref, action_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1payment_1failure_1network_1update(JNIEnv *env, jclass clz, int64_t update) {
+       LDKHTLCFailChannelUpdate update_conv = *(LDKHTLCFailChannelUpdate*)(((uint64_t)update) & ~1);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_payment_failure_network_update(update_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1range_1query(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK((*env)->GetArrayLength(env, node_id) == 33);
+       (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+       LDKQueryChannelRange msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = QueryChannelRange_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_channel_range_query(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1short_1ids_1query(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK((*env)->GetArrayLength(env, node_id) == 33);
+       (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+       LDKQueryShortChannelIds msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = QueryShortChannelIds_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_short_ids_query(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1reply_1channel_1range(JNIEnv *env, jclass clz, int8_tArray node_id, int64_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK((*env)->GetArrayLength(env, node_id) == 33);
+       (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+       LDKReplyChannelRange msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ReplyChannelRange_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_reply_channel_range(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
        if ((this_ptr & 1) != 0) return;
        LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(((uint64_t)this_ptr) & ~1);
@@ -13318,10 +13684,49 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_APIError_1free(JNIEnv *env, jc
        APIError_free(this_ptr_conv);
 }
 
-JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
-       LDKAPIError* orig_conv = (LDKAPIError*)orig;
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1clone(JNIEnv *env, jclass clz, int64_t orig) {
+       LDKAPIError* orig_conv = (LDKAPIError*)orig;
+       LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
+       *ret_copy = APIError_clone(orig_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1apimisuse_1error(JNIEnv *env, jclass clz, jstring err) {
+       LDKStr err_conv = java_to_owned_str(env, err);
+       LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
+       *ret_copy = APIError_apimisuse_error(err_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1fee_1rate_1too_1high(JNIEnv *env, jclass clz, jstring err, int32_t feerate) {
+       LDKStr err_conv = java_to_owned_str(env, err);
+       LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
+       *ret_copy = APIError_fee_rate_too_high(err_conv, feerate);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1route_1error(JNIEnv *env, jclass clz, jstring err) {
+       LDKStr err_conv = java_to_owned_str(env, err);
+       LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
+       *ret_copy = APIError_route_error(err_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1channel_1unavailable(JNIEnv *env, jclass clz, jstring err) {
+       LDKStr err_conv = java_to_owned_str(env, err);
+       LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
+       *ret_copy = APIError_channel_unavailable(err_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_APIError_1monitor_1update_1failed(JNIEnv *env, jclass clz) {
        LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
-       *ret_copy = APIError_clone(orig_conv);
+       *ret_copy = APIError_monitor_update_failed();
        uint64_t ret_ref = (uint64_t)ret_copy;
        return ret_ref;
 }
@@ -13370,6 +13775,31 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1clone(JNIEnv *env, jc
        return ret_conv;
 }
 
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1trace(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKLevel_to_java(env, Level_trace());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1debug(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKLevel_to_java(env, Level_debug());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1info(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKLevel_to_java(env, Level_info());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1warn(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKLevel_to_java(env, Level_warn());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1error(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKLevel_to_java(env, Level_error());
+       return ret_conv;
+}
+
 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Level_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
        LDKLevel* a_conv = (LDKLevel*)(a & ~1);
        LDKLevel* b_conv = (LDKLevel*)(b & ~1);
@@ -14000,6 +14430,16 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_AccessError_1clone(JNIEnv *e
        return ret_conv;
 }
 
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_AccessError_1unknown_1chain(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKAccessError_to_java(env, AccessError_unknown_chain());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_AccessError_1unknown_1tx(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKAccessError_to_java(env, AccessError_unknown_tx());
+       return ret_conv;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Access_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
        if ((this_ptr & 1) != 0) return;
        LDKAccess this_ptr_conv = *(LDKAccess*)(((uint64_t)this_ptr) & ~1);
@@ -14164,6 +14604,21 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1clone(JN
        return ret_conv;
 }
 
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1background(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_background());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1normal(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_normal());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1high_1priority(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKConfirmationTarget_to_java(env, ConfirmationTarget_high_priority());
+       return ret_conv;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
        if ((this_ptr & 1) != 0) return;
        LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)(((uint64_t)this_ptr) & ~1);
@@ -14185,7 +14640,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 +14648,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.
@@ -14319,6 +14774,16 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1clo
        return ret_conv;
 }
 
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1temporary_1failure(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKChannelMonitorUpdateErr_to_java(env, ChannelMonitorUpdateErr_temporary_failure());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1permanent_1failure(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKChannelMonitorUpdateErr_to_java(env, ChannelMonitorUpdateErr_permanent_failure());
+       return ret_conv;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
        LDKMonitorUpdateError this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
@@ -14355,6 +14820,28 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1clone(JNIEnv
        return ret_ref;
 }
 
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1htlcevent(JNIEnv *env, jclass clz, int64_t a) {
+       LDKHTLCUpdate a_conv;
+       a_conv.inner = (void*)(a & (~1));
+       a_conv.is_owned = (a & 1) || (a == 0);
+       a_conv = HTLCUpdate_clone(&a_conv);
+       LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
+       *ret_copy = MonitorEvent_htlcevent(a_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1commitment_1tx_1broadcasted(JNIEnv *env, jclass clz, int64_t a) {
+       LDKOutPoint a_conv;
+       a_conv.inner = (void*)(a & (~1));
+       a_conv.is_owned = (a & 1) || (a == 0);
+       a_conv = OutPoint_clone(&a_conv);
+       LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
+       *ret_copy = MonitorEvent_commitment_tx_broadcasted(a_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
        LDKHTLCUpdate this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
@@ -14566,17 +15053,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 +15089,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 +15129,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 +15165,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 +15191,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);
@@ -15225,6 +15712,40 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1
        return ret_ref;
 }
 
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1static_1output(JNIEnv *env, jclass clz, int64_t outpoint, int64_t output) {
+       LDKOutPoint outpoint_conv;
+       outpoint_conv.inner = (void*)(outpoint & (~1));
+       outpoint_conv.is_owned = (outpoint & 1) || (outpoint == 0);
+       outpoint_conv = OutPoint_clone(&outpoint_conv);
+       LDKTxOut output_conv = *(LDKTxOut*)(((uint64_t)output) & ~1);
+       LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
+       *ret_copy = SpendableOutputDescriptor_static_output(outpoint_conv, output_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1delayed_1payment_1output(JNIEnv *env, jclass clz, int64_t a) {
+       LDKDelayedPaymentOutputDescriptor a_conv;
+       a_conv.inner = (void*)(a & (~1));
+       a_conv.is_owned = (a & 1) || (a == 0);
+       a_conv = DelayedPaymentOutputDescriptor_clone(&a_conv);
+       LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
+       *ret_copy = SpendableOutputDescriptor_delayed_payment_output(a_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1static_1payment_1output(JNIEnv *env, jclass clz, int64_t a) {
+       LDKStaticPaymentOutputDescriptor a_conv;
+       a_conv.inner = (void*)(a & (~1));
+       a_conv.is_owned = (a & 1) || (a == 0);
+       a_conv = StaticPaymentOutputDescriptor_clone(&a_conv);
+       LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
+       *ret_copy = SpendableOutputDescriptor_static_payment_output(a_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1write(JNIEnv *env, jclass clz, int64_t obj) {
        LDKSpendableOutputDescriptor* obj_conv = (LDKSpendableOutputDescriptor*)obj;
        LDKCVec_u8Z ret_var = SpendableOutputDescriptor_write(obj_conv);
@@ -16156,31 +16677,102 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone(J
        return ret_ref;
 }
 
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1parameter_1error(JNIEnv *env, jclass clz, int64_t a) {
+       LDKAPIError a_conv = *(LDKAPIError*)(((uint64_t)a) & ~1);
+       LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
+       *ret_copy = PaymentSendFailure_parameter_error(a_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1path_1parameter_1error(JNIEnv *env, jclass clz, int64_tArray a) {
+       LDKCVec_CResult_NoneAPIErrorZZ a_constr;
+       a_constr.datalen = (*env)->GetArrayLength(env, a);
+       if (a_constr.datalen > 0)
+               a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
+       else
+               a_constr.data = NULL;
+       int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL);
+       for (size_t w = 0; w < a_constr.datalen; w++) {
+               int64_t a_conv_22 = a_vals[w];
+               LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1);
+               a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1));
+               a_constr.data[w] = a_conv_22_conv;
+       }
+       (*env)->ReleaseLongArrayElements(env, a, a_vals, 0);
+       LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
+       *ret_copy = PaymentSendFailure_path_parameter_error(a_constr);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1all_1failed_1retry_1safe(JNIEnv *env, jclass clz, int64_tArray a) {
+       LDKCVec_APIErrorZ a_constr;
+       a_constr.datalen = (*env)->GetArrayLength(env, a);
+       if (a_constr.datalen > 0)
+               a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements");
+       else
+               a_constr.data = NULL;
+       int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL);
+       for (size_t k = 0; k < a_constr.datalen; k++) {
+               int64_t a_conv_10 = a_vals[k];
+               LDKAPIError a_conv_10_conv = *(LDKAPIError*)(((uint64_t)a_conv_10) & ~1);
+               a_conv_10_conv = APIError_clone((LDKAPIError*)(((uint64_t)a_conv_10) & ~1));
+               a_constr.data[k] = a_conv_10_conv;
+       }
+       (*env)->ReleaseLongArrayElements(env, a, a_vals, 0);
+       LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
+       *ret_copy = PaymentSendFailure_all_failed_retry_safe(a_constr);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1partial_1failure(JNIEnv *env, jclass clz, int64_tArray a) {
+       LDKCVec_CResult_NoneAPIErrorZZ a_constr;
+       a_constr.datalen = (*env)->GetArrayLength(env, a);
+       if (a_constr.datalen > 0)
+               a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
+       else
+               a_constr.data = NULL;
+       int64_t* a_vals = (*env)->GetLongArrayElements (env, a, NULL);
+       for (size_t w = 0; w < a_constr.datalen; w++) {
+               int64_t a_conv_22 = a_vals[w];
+               LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1);
+               a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1));
+               a_constr.data[w] = a_conv_22_conv;
+       }
+       (*env)->ReleaseLongArrayElements(env, a, a_vals, 0);
+       LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
+       *ret_copy = PaymentSendFailure_partial_failure(a_constr);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1new(JNIEnv *env, jclass clz, int64_t fee_est, int64_t chain_monitor, int64_t tx_broadcaster, int64_t logger, int64_t keys_manager, int64_t config, int64_t params) {
        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));
@@ -16555,7 +17147,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 +17167,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 +17187,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 +17207,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 +17227,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 +17261,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 +17440,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;
 }
 
@@ -18884,6 +19477,46 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1clone(JNIEnv *e
        return ret_ref;
 }
 
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1ipv4(JNIEnv *env, jclass clz, int8_tArray addr, int16_t port) {
+       LDKFourBytes addr_ref;
+       CHECK((*env)->GetArrayLength(env, addr) == 4);
+       (*env)->GetByteArrayRegion(env, addr, 0, 4, addr_ref.data);
+       LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
+       *ret_copy = NetAddress_ipv4(addr_ref, port);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1ipv6(JNIEnv *env, jclass clz, int8_tArray addr, int16_t port) {
+       LDKSixteenBytes addr_ref;
+       CHECK((*env)->GetArrayLength(env, addr) == 16);
+       (*env)->GetByteArrayRegion(env, addr, 0, 16, addr_ref.data);
+       LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
+       *ret_copy = NetAddress_ipv6(addr_ref, port);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1onion_1v2(JNIEnv *env, jclass clz, int8_tArray addr, int16_t port) {
+       LDKTenBytes addr_ref;
+       CHECK((*env)->GetArrayLength(env, addr) == 10);
+       (*env)->GetByteArrayRegion(env, addr, 0, 10, addr_ref.data);
+       LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
+       *ret_copy = NetAddress_onion_v2(addr_ref, port);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_NetAddress_1onion_1v3(JNIEnv *env, jclass clz, int8_tArray ed25519_pubkey, int16_t checksum, int8_t version, int16_t port) {
+       LDKThirtyTwoBytes ed25519_pubkey_ref;
+       CHECK((*env)->GetArrayLength(env, ed25519_pubkey) == 32);
+       (*env)->GetByteArrayRegion(env, ed25519_pubkey, 0, 32, ed25519_pubkey_ref.data);
+       LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
+       *ret_copy = NetAddress_onion_v3(ed25519_pubkey_ref, checksum, version, port);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_NetAddress_1write(JNIEnv *env, jclass clz, int64_t obj) {
        LDKNetAddress* obj_conv = (LDKNetAddress*)obj;
        LDKCVec_u8Z ret_var = NetAddress_write(obj_conv);
@@ -20135,6 +20768,43 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1clone(JNIEnv *
        return ret_ref;
 }
 
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1disconnect_1peer(JNIEnv *env, jclass clz, int64_t msg) {
+       LDKErrorMessage msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ErrorMessage_clone(&msg_conv);
+       LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
+       *ret_copy = ErrorAction_disconnect_peer(msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1ignore_1error(JNIEnv *env, jclass clz) {
+       LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
+       *ret_copy = ErrorAction_ignore_error();
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1ignore_1and_1log(JNIEnv *env, jclass clz, jclass a) {
+       LDKLevel a_conv = LDKLevel_from_java(env, a);
+       LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
+       *ret_copy = ErrorAction_ignore_and_log(a_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ErrorAction_1send_1error_1message(JNIEnv *env, jclass clz, int64_t msg) {
+       LDKErrorMessage msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ErrorMessage_clone(&msg_conv);
+       LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
+       *ret_copy = ErrorAction_send_error_message(msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1free(JNIEnv *env, jclass clz, int64_t this_obj) {
        LDKLightningError this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
@@ -20148,6 +20818,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;
 }
 
@@ -20465,6 +21136,34 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCFailChannelUpdate_1clon
        return ret_ref;
 }
 
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCFailChannelUpdate_1channel_1update_1message(JNIEnv *env, jclass clz, int64_t msg) {
+       LDKChannelUpdate msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ChannelUpdate_clone(&msg_conv);
+       LDKHTLCFailChannelUpdate *ret_copy = MALLOC(sizeof(LDKHTLCFailChannelUpdate), "LDKHTLCFailChannelUpdate");
+       *ret_copy = HTLCFailChannelUpdate_channel_update_message(msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCFailChannelUpdate_1channel_1closed(JNIEnv *env, jclass clz, int64_t short_channel_id, jboolean is_permanent) {
+       LDKHTLCFailChannelUpdate *ret_copy = MALLOC(sizeof(LDKHTLCFailChannelUpdate), "LDKHTLCFailChannelUpdate");
+       *ret_copy = HTLCFailChannelUpdate_channel_closed(short_channel_id, is_permanent);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_HTLCFailChannelUpdate_1node_1failure(JNIEnv *env, jclass clz, int8_tArray node_id, jboolean is_permanent) {
+       LDKPublicKey node_id_ref;
+       CHECK((*env)->GetArrayLength(env, node_id) == 33);
+       (*env)->GetByteArrayRegion(env, node_id, 0, 33, node_id_ref.compressed_form);
+       LDKHTLCFailChannelUpdate *ret_copy = MALLOC(sizeof(LDKHTLCFailChannelUpdate), "LDKHTLCFailChannelUpdate");
+       *ret_copy = HTLCFailChannelUpdate_node_failure(node_id_ref, is_permanent);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1free(JNIEnv *env, jclass clz, int64_t this_ptr) {
        if ((this_ptr & 1) != 0) return;
        LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)(((uint64_t)this_ptr) & ~1);
@@ -21232,7 +21931,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 +21951,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 +21960,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 +22060,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 +22098,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 +22112,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);
@@ -23720,20 +24419,24 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_get_1route(JNIEnv *env, jcl
        payee_features_conv.is_owned = (payee_features & 1) || (payee_features == 0);
        payee_features_conv = InvoiceFeatures_clone(&payee_features_conv);
        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_ChannelDetailsZ *first_hops_ptr = NULL;
+       if (first_hops != NULL) {
+               first_hops_constr.datalen = (*env)->GetArrayLength(env, first_hops);
+               if (first_hops_constr.datalen > 0)
+                       first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
+               else
+                       first_hops_constr.data = NULL;
+               int64_t* first_hops_vals = (*env)->GetLongArrayElements (env, first_hops, NULL);
+               for (size_t q = 0; q < first_hops_constr.datalen; q++) {
+                       int64_t first_hops_conv_16 = first_hops_vals[q];
+                       LDKChannelDetails first_hops_conv_16_conv;
+                       first_hops_conv_16_conv.inner = (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);
+               first_hops_ptr = &first_hops_constr;
+       }
        LDKCVec_RouteHintZ last_hops_constr;
        last_hops_constr.datalen = (*env)->GetArrayLength(env, last_hops);
        if (last_hops_constr.datalen > 0)
@@ -23753,11 +24456,11 @@ 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);
-       FREE(first_hops_constr.data);
+       *ret_conv = get_route(our_node_id_ref, &network_conv, payee_ref, payee_features_conv, first_hops_ptr, last_hops_constr, final_value_msat, final_cltv, logger_conv);
+       if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
        return (uint64_t)ret_conv;
 }
 
@@ -23806,7 +24509,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 +24517,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 +24536,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 +24544,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 +24570,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 +25558,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 +25581,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 +25647,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 +25668,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 +25702,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 +25721,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.
@@ -25259,6 +25963,26 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SiPrefix_1clone(JNIEnv *env,
        return ret_conv;
 }
 
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SiPrefix_1milli(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKSiPrefix_to_java(env, SiPrefix_milli());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SiPrefix_1micro(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKSiPrefix_to_java(env, SiPrefix_micro());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SiPrefix_1nano(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKSiPrefix_to_java(env, SiPrefix_nano());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SiPrefix_1pico(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKSiPrefix_to_java(env, SiPrefix_pico());
+       return ret_conv;
+}
+
 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SiPrefix_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
        LDKSiPrefix* a_conv = (LDKSiPrefix*)(a & ~1);
        LDKSiPrefix* b_conv = (LDKSiPrefix*)(b & ~1);
@@ -25278,6 +26002,31 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1clone(JNIEnv *env,
        return ret_conv;
 }
 
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1bitcoin(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKCurrency_to_java(env, Currency_bitcoin());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1bitcoin_1testnet(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKCurrency_to_java(env, Currency_bitcoin_testnet());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1regtest(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKCurrency_to_java(env, Currency_regtest());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1simnet(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKCurrency_to_java(env, Currency_simnet());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Currency_1signet(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKCurrency_to_java(env, Currency_signet());
+       return ret_conv;
+}
+
 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Currency_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
        LDKCurrency* a_conv = (LDKCurrency*)(a & ~1);
        LDKCurrency* b_conv = (LDKCurrency*)(b & ~1);
@@ -25460,6 +26209,38 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1clone(JNIEnv *env
        return ret_ref;
 }
 
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1seg_1wit_1program(JNIEnv *env, jclass clz, int8_t version, int8_tArray program) {
+       
+       LDKCVec_u8Z program_ref;
+       program_ref.datalen = (*env)->GetArrayLength(env, program);
+       program_ref.data = MALLOC(program_ref.datalen, "LDKCVec_u8Z Bytes");
+       (*env)->GetByteArrayRegion(env, program, 0, program_ref.datalen, program_ref.data);
+       LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
+       *ret_copy = Fallback_seg_wit_program((LDKu5){ ._0 = version }, program_ref);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1pub_1key_1hash(JNIEnv *env, jclass clz, int8_tArray a) {
+       LDKTwentyBytes a_ref;
+       CHECK((*env)->GetArrayLength(env, a) == 20);
+       (*env)->GetByteArrayRegion(env, a, 0, 20, a_ref.data);
+       LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
+       *ret_copy = Fallback_pub_key_hash(a_ref);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Fallback_1script_1hash(JNIEnv *env, jclass clz, int8_tArray a) {
+       LDKTwentyBytes a_ref;
+       CHECK((*env)->GetArrayLength(env, a) == 20);
+       (*env)->GetByteArrayRegion(env, a, 0, 20, a_ref.data);
+       LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
+       *ret_copy = Fallback_script_hash(a_ref);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_Fallback_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
        LDKFallback* a_conv = (LDKFallback*)a;
        LDKFallback* b_conv = (LDKFallback*)b;
@@ -25963,6 +26744,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;
 }
 
@@ -26025,6 +26807,26 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1clone(JNIEnv
        return ret_conv;
 }
 
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1description_1too_1long(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKCreationError_to_java(env, CreationError_description_too_long());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1route_1too_1long(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKCreationError_to_java(env, CreationError_route_too_long());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1timestamp_1out_1of_1bounds(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKCreationError_to_java(env, CreationError_timestamp_out_of_bounds());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_CreationError_1expiry_1time_1out_1of_1bounds(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKCreationError_to_java(env, CreationError_expiry_time_out_of_bounds());
+       return ret_conv;
+}
+
 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_CreationError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
        LDKCreationError* a_conv = (LDKCreationError*)(a & ~1);
        LDKCreationError* b_conv = (LDKCreationError*)(b & ~1);
@@ -26036,6 +26838,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;
 }
 
@@ -26045,6 +26848,46 @@ JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1clone(JNIEnv
        return ret_conv;
 }
 
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1no_1payment_1hash(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_no_payment_hash());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1multiple_1payment_1hashes(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_multiple_payment_hashes());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1no_1description(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_no_description());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1multiple_1descriptions(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_multiple_descriptions());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1multiple_1payment_1secrets(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_multiple_payment_secrets());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1invalid_1features(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_invalid_features());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1invalid_1recovery_1id(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_invalid_recovery_id());
+       return ret_conv;
+}
+
+JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_SemanticError_1invalid_1signature(JNIEnv *env, jclass clz) {
+       jclass ret_conv = LDKSemanticError_to_java(env, SemanticError_invalid_signature());
+       return ret_conv;
+}
+
 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SemanticError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
        LDKSemanticError* a_conv = (LDKSemanticError*)(a & ~1);
        LDKSemanticError* b_conv = (LDKSemanticError*)(b & ~1);
@@ -26056,6 +26899,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;
 }
 
@@ -26074,6 +26918,21 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1clone(
        return ret_ref;
 }
 
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1sign_1error(JNIEnv *env, jclass clz) {
+       LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
+       *ret_copy = SignOrCreationError_sign_error();
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1creation_1error(JNIEnv *env, jclass clz, jclass a) {
+       LDKCreationError a_conv = LDKCreationError_from_java(env, a);
+       LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
+       *ret_copy = SignOrCreationError_creation_error(a_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1eq(JNIEnv *env, jclass clz, int64_t a, int64_t b) {
        LDKSignOrCreationError* a_conv = (LDKSignOrCreationError*)a;
        LDKSignOrCreationError* b_conv = (LDKSignOrCreationError*)b;
@@ -26085,6 +26944,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 +26955,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 +26992,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 +27002,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 +27010,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 +27018,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..4bc7528737af97e5909b9d2971ee10a515445b36 100644 (file)
@@ -143,6 +143,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_new_1empty_1slice_1vec
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1u8Z_1new
   (JNIEnv *, jclass, jbyteArray);
 
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    TxOut_get_script_pubkey
+ * Signature: (J)[B
+ */
+JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_TxOut_1get_1script_1pubkey
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    TxOut_get_value
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxOut_1get_1value
+  (JNIEnv *, jclass, jlong);
+
 /*
  * Class:     org_ldk_impl_bindings
  * Method:    LDKCResult_SecretKeyErrorZ_result_ok
@@ -1095,6 +1111,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
@@ -3631,6 +3655,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 +3831,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
@@ -3967,6 +4007,14 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings__1ldk_1c_1bindings_1get_1co
 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Transaction_1free
   (JNIEnv *, jclass, jbyteArray);
 
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    TxOut_new
+ * Signature: ([BJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxOut_1new
+  (JNIEnv *, jclass, jbyteArray, jlong);
+
 /*
  * Class:     org_ldk_impl_bindings
  * Method:    TxOut_free
@@ -7823,6 +7871,54 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1clone
   (JNIEnv *, jclass, jlong);
 
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    Event_funding_generation_ready
+ * Signature: ([BJ[BJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1funding_1generation_1ready
+  (JNIEnv *, jclass, jbyteArray, jlong, jbyteArray, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    Event_payment_received
+ * Signature: ([B[B[BJJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1received
+  (JNIEnv *, jclass, jbyteArray, jbyteArray, jbyteArray, jlong, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    Event_payment_sent
+ * Signature: ([B)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1sent
+  (JNIEnv *, jclass, jbyteArray);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    Event_payment_failed
+ * Signature: ([BZ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1payment_1failed
+  (JNIEnv *, jclass, jbyteArray, jboolean);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    Event_pending_htlcs_forwardable
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1pending_1htlcs_1forwardable
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    Event_spendable_outputs
+ * Signature: ([J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Event_1spendable_1outputs
+  (JNIEnv *, jclass, jlongArray);
+
 /*
  * Class:     org_ldk_impl_bindings
  * Method:    Event_write
@@ -7847,6 +7943,166 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1free
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1clone
   (JNIEnv *, jclass, jlong);
 
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    MessageSendEvent_send_accept_channel
+ * Signature: ([BJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1accept_1channel
+  (JNIEnv *, jclass, jbyteArray, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    MessageSendEvent_send_open_channel
+ * Signature: ([BJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1open_1channel
+  (JNIEnv *, jclass, jbyteArray, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    MessageSendEvent_send_funding_created
+ * Signature: ([BJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1funding_1created
+  (JNIEnv *, jclass, jbyteArray, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    MessageSendEvent_send_funding_signed
+ * Signature: ([BJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1funding_1signed
+  (JNIEnv *, jclass, jbyteArray, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    MessageSendEvent_send_funding_locked
+ * Signature: ([BJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1funding_1locked
+  (JNIEnv *, jclass, jbyteArray, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    MessageSendEvent_send_announcement_signatures
+ * Signature: ([BJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1announcement_1signatures
+  (JNIEnv *, jclass, jbyteArray, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    MessageSendEvent_update_htlcs
+ * Signature: ([BJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1update_1htlcs
+  (JNIEnv *, jclass, jbyteArray, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    MessageSendEvent_send_revoke_and_ack
+ * Signature: ([BJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1revoke_1and_1ack
+  (JNIEnv *, jclass, jbyteArray, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    MessageSendEvent_send_closing_signed
+ * Signature: ([BJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1closing_1signed
+  (JNIEnv *, jclass, jbyteArray, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    MessageSendEvent_send_shutdown
+ * Signature: ([BJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1shutdown
+  (JNIEnv *, jclass, jbyteArray, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    MessageSendEvent_send_channel_reestablish
+ * Signature: ([BJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1reestablish
+  (JNIEnv *, jclass, jbyteArray, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    MessageSendEvent_broadcast_channel_announcement
+ * Signature: (JJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1channel_1announcement
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    MessageSendEvent_broadcast_node_announcement
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1node_1announcement
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    MessageSendEvent_broadcast_channel_update
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1broadcast_1channel_1update
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    MessageSendEvent_send_channel_update
+ * Signature: ([BJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1update
+  (JNIEnv *, jclass, jbyteArray, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    MessageSendEvent_handle_error
+ * Signature: ([BJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1handle_1error
+  (JNIEnv *, jclass, jbyteArray, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    MessageSendEvent_payment_failure_network_update
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1payment_1failure_1network_1update
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    MessageSendEvent_send_channel_range_query
+ * Signature: ([BJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1channel_1range_1query
+  (JNIEnv *, jclass, jbyteArray, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    MessageSendEvent_send_short_ids_query
+ * Signature: ([BJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1short_1ids_1query
+  (JNIEnv *, jclass, jbyteArray, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    MessageSendEvent_send_reply_channel_range
+ * Signature: ([BJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1send_1reply_1channel_1range
+  (JNIEnv *, jclass, jbyteArray, jlong);
+
 /*
  * Class:     org_ldk_impl_bindings
  * Method:    MessageSendEventsProvider_free
@@ -7887,6 +8143,46 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_APIError_1free
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_APIError_1clone
   (JNIEnv *, jclass, jlong);
 
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    APIError_apimisuse_error
+ * Signature: (Ljava/lang/String;)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_APIError_1apimisuse_1error
+  (JNIEnv *, jclass, jstring);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    APIError_fee_rate_too_high
+ * Signature: (Ljava/lang/String;I)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_APIError_1fee_1rate_1too_1high
+  (JNIEnv *, jclass, jstring, jint);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    APIError_route_error
+ * Signature: (Ljava/lang/String;)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_APIError_1route_1error
+  (JNIEnv *, jclass, jstring);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    APIError_channel_unavailable
+ * Signature: (Ljava/lang/String;)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_APIError_1channel_1unavailable
+  (JNIEnv *, jclass, jstring);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    APIError_monitor_update_failed
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_APIError_1monitor_1update_1failed
+  (JNIEnv *, jclass);
+
 /*
  * Class:     org_ldk_impl_bindings
  * Method:    sign
@@ -7919,6 +8215,46 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_verify
 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Level_1clone
   (JNIEnv *, jclass, jlong);
 
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    Level_trace
+ * Signature: ()Lorg/ldk/enums/Level;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Level_1trace
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    Level_debug
+ * Signature: ()Lorg/ldk/enums/Level;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Level_1debug
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    Level_info
+ * Signature: ()Lorg/ldk/enums/Level;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Level_1info
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    Level_warn
+ * Signature: ()Lorg/ldk/enums/Level;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Level_1warn
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    Level_error
+ * Signature: ()Lorg/ldk/enums/Level;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Level_1error
+  (JNIEnv *, jclass);
+
 /*
  * Class:     org_ldk_impl_bindings
  * Method:    Level_eq
@@ -8471,6 +8807,22 @@ JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_BestBlock_1height
 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_AccessError_1clone
   (JNIEnv *, jclass, jlong);
 
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    AccessError_unknown_chain
+ * Signature: ()Lorg/ldk/enums/AccessError;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_AccessError_1unknown_1chain
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    AccessError_unknown_tx
+ * Signature: ()Lorg/ldk/enums/AccessError;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_AccessError_1unknown_1tx
+  (JNIEnv *, jclass);
+
 /*
  * Class:     org_ldk_impl_bindings
  * Method:    Access_free
@@ -8607,6 +8959,30 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1free
 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1clone
   (JNIEnv *, jclass, jlong);
 
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    ConfirmationTarget_background
+ * Signature: ()Lorg/ldk/enums/ConfirmationTarget;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1background
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    ConfirmationTarget_normal
+ * Signature: ()Lorg/ldk/enums/ConfirmationTarget;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1normal
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    ConfirmationTarget_high_priority
+ * Signature: ()Lorg/ldk/enums/ConfirmationTarget;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_ConfirmationTarget_1high_1priority
+  (JNIEnv *, jclass);
+
 /*
  * Class:     org_ldk_impl_bindings
  * Method:    FeeEstimator_free
@@ -8713,11 +9089,27 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1read
 
 /*
  * Class:     org_ldk_impl_bindings
- * Method:    ChannelMonitorUpdateErr_clone
- * Signature: (J)Lorg/ldk/enums/ChannelMonitorUpdateErr;
+ * Method:    ChannelMonitorUpdateErr_clone
+ * Signature: (J)Lorg/ldk/enums/ChannelMonitorUpdateErr;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1clone
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    ChannelMonitorUpdateErr_temporary_failure
+ * Signature: ()Lorg/ldk/enums/ChannelMonitorUpdateErr;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1temporary_1failure
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    ChannelMonitorUpdateErr_permanent_failure
+ * Signature: ()Lorg/ldk/enums/ChannelMonitorUpdateErr;
  */
-JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1clone
-  (JNIEnv *, jclass, jlong);
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdateErr_1permanent_1failure
+  (JNIEnv *, jclass);
 
 /*
  * Class:     org_ldk_impl_bindings
@@ -8751,6 +9143,22 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1free
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1clone
   (JNIEnv *, jclass, jlong);
 
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    MonitorEvent_htlcevent
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1htlcevent
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    MonitorEvent_commitment_tx_broadcasted
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1commitment_1tx_1broadcasted
+  (JNIEnv *, jclass, jlong);
+
 /*
  * Class:     org_ldk_impl_bindings
  * Method:    HTLCUpdate_free
@@ -9295,6 +9703,30 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1fre
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1clone
   (JNIEnv *, jclass, jlong);
 
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    SpendableOutputDescriptor_static_output
+ * Signature: (JJ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1static_1output
+  (JNIEnv *, jclass, jlong, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    SpendableOutputDescriptor_delayed_payment_output
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1delayed_1payment_1output
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    SpendableOutputDescriptor_static_payment_output
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1static_1payment_1output
+  (JNIEnv *, jclass, jlong);
+
 /*
  * Class:     org_ldk_impl_bindings
  * Method:    SpendableOutputDescriptor_write
@@ -10007,6 +10439,38 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1clone
   (JNIEnv *, jclass, jlong);
 
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    PaymentSendFailure_parameter_error
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1parameter_1error
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    PaymentSendFailure_path_parameter_error
+ * Signature: ([J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1path_1parameter_1error
+  (JNIEnv *, jclass, jlongArray);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    PaymentSendFailure_all_failed_retry_safe
+ * Signature: ([J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1all_1failed_1retry_1safe
+  (JNIEnv *, jclass, jlongArray);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    PaymentSendFailure_partial_failure
+ * Signature: ([J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1partial_1failure
+  (JNIEnv *, jclass, jlongArray);
+
 /*
  * Class:     org_ldk_impl_bindings
  * Method:    ChannelManager_new
@@ -12127,6 +12591,38 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetAddress_1free
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetAddress_1clone
   (JNIEnv *, jclass, jlong);
 
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    NetAddress_ipv4
+ * Signature: ([BS)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetAddress_1ipv4
+  (JNIEnv *, jclass, jbyteArray, jshort);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    NetAddress_ipv6
+ * Signature: ([BS)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetAddress_1ipv6
+  (JNIEnv *, jclass, jbyteArray, jshort);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    NetAddress_onion_v2
+ * Signature: ([BS)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetAddress_1onion_1v2
+  (JNIEnv *, jclass, jbyteArray, jshort);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    NetAddress_onion_v3
+ * Signature: ([BSBS)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetAddress_1onion_1v3
+  (JNIEnv *, jclass, jbyteArray, jshort, jbyte, jshort);
+
 /*
  * Class:     org_ldk_impl_bindings
  * Method:    NetAddress_write
@@ -13103,6 +13599,38 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorAction_1free
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorAction_1clone
   (JNIEnv *, jclass, jlong);
 
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    ErrorAction_disconnect_peer
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorAction_1disconnect_1peer
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    ErrorAction_ignore_error
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorAction_1ignore_1error
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    ErrorAction_ignore_and_log
+ * Signature: (Lorg/ldk/enums/Level;)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorAction_1ignore_1and_1log
+  (JNIEnv *, jclass, jobject);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    ErrorAction_send_error_message
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorAction_1send_1error_1message
+  (JNIEnv *, jclass, jlong);
+
 /*
  * Class:     org_ldk_impl_bindings
  * Method:    LightningError_free
@@ -13263,6 +13791,30 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCFailChannelUpdate_1free
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCFailChannelUpdate_1clone
   (JNIEnv *, jclass, jlong);
 
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    HTLCFailChannelUpdate_channel_update_message
+ * Signature: (J)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCFailChannelUpdate_1channel_1update_1message
+  (JNIEnv *, jclass, jlong);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    HTLCFailChannelUpdate_channel_closed
+ * Signature: (JZ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCFailChannelUpdate_1channel_1closed
+  (JNIEnv *, jclass, jlong, jboolean);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    HTLCFailChannelUpdate_node_failure
+ * Signature: ([BZ)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCFailChannelUpdate_1node_1failure
+  (JNIEnv *, jclass, jbyteArray, jboolean);
+
 /*
  * Class:     org_ldk_impl_bindings
  * Method:    ChannelMessageHandler_free
@@ -16631,6 +17183,38 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PositiveTimestamp_1clone
 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_SiPrefix_1clone
   (JNIEnv *, jclass, jlong);
 
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    SiPrefix_milli
+ * Signature: ()Lorg/ldk/enums/SiPrefix;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_SiPrefix_1milli
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    SiPrefix_micro
+ * Signature: ()Lorg/ldk/enums/SiPrefix;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_SiPrefix_1micro
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    SiPrefix_nano
+ * Signature: ()Lorg/ldk/enums/SiPrefix;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_SiPrefix_1nano
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    SiPrefix_pico
+ * Signature: ()Lorg/ldk/enums/SiPrefix;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_SiPrefix_1pico
+  (JNIEnv *, jclass);
+
 /*
  * Class:     org_ldk_impl_bindings
  * Method:    SiPrefix_eq
@@ -16655,6 +17239,46 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SiPrefix_1multiplier
 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Currency_1clone
   (JNIEnv *, jclass, jlong);
 
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    Currency_bitcoin
+ * Signature: ()Lorg/ldk/enums/Currency;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Currency_1bitcoin
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    Currency_bitcoin_testnet
+ * Signature: ()Lorg/ldk/enums/Currency;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Currency_1bitcoin_1testnet
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    Currency_regtest
+ * Signature: ()Lorg/ldk/enums/Currency;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Currency_1regtest
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    Currency_simnet
+ * Signature: ()Lorg/ldk/enums/Currency;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Currency_1simnet
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    Currency_signet
+ * Signature: ()Lorg/ldk/enums/Currency;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_Currency_1signet
+  (JNIEnv *, jclass);
+
 /*
  * Class:     org_ldk_impl_bindings
  * Method:    Currency_eq
@@ -16799,6 +17423,30 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Fallback_1free
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Fallback_1clone
   (JNIEnv *, jclass, jlong);
 
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    Fallback_seg_wit_program
+ * Signature: (B[B)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Fallback_1seg_1wit_1program
+  (JNIEnv *, jclass, jbyte, jbyteArray);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    Fallback_pub_key_hash
+ * Signature: ([B)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Fallback_1pub_1key_1hash
+  (JNIEnv *, jclass, jbyteArray);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    Fallback_script_hash
+ * Signature: ([B)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Fallback_1script_1hash
+  (JNIEnv *, jclass, jbyteArray);
+
 /*
  * Class:     org_ldk_impl_bindings
  * Method:    Fallback_eq
@@ -17223,6 +17871,38 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PrivateRoute_1into_1inner
 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CreationError_1clone
   (JNIEnv *, jclass, jlong);
 
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    CreationError_description_too_long
+ * Signature: ()Lorg/ldk/enums/CreationError;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CreationError_1description_1too_1long
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    CreationError_route_too_long
+ * Signature: ()Lorg/ldk/enums/CreationError;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CreationError_1route_1too_1long
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    CreationError_timestamp_out_of_bounds
+ * Signature: ()Lorg/ldk/enums/CreationError;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CreationError_1timestamp_1out_1of_1bounds
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    CreationError_expiry_time_out_of_bounds
+ * Signature: ()Lorg/ldk/enums/CreationError;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_CreationError_1expiry_1time_1out_1of_1bounds
+  (JNIEnv *, jclass);
+
 /*
  * Class:     org_ldk_impl_bindings
  * Method:    CreationError_eq
@@ -17247,6 +17927,70 @@ JNIEXPORT jstring JNICALL Java_org_ldk_impl_bindings_CreationError_1to_1str
 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_SemanticError_1clone
   (JNIEnv *, jclass, jlong);
 
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    SemanticError_no_payment_hash
+ * Signature: ()Lorg/ldk/enums/SemanticError;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_SemanticError_1no_1payment_1hash
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    SemanticError_multiple_payment_hashes
+ * Signature: ()Lorg/ldk/enums/SemanticError;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_SemanticError_1multiple_1payment_1hashes
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    SemanticError_no_description
+ * Signature: ()Lorg/ldk/enums/SemanticError;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_SemanticError_1no_1description
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    SemanticError_multiple_descriptions
+ * Signature: ()Lorg/ldk/enums/SemanticError;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_SemanticError_1multiple_1descriptions
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    SemanticError_multiple_payment_secrets
+ * Signature: ()Lorg/ldk/enums/SemanticError;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_SemanticError_1multiple_1payment_1secrets
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    SemanticError_invalid_features
+ * Signature: ()Lorg/ldk/enums/SemanticError;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_SemanticError_1invalid_1features
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    SemanticError_invalid_recovery_id
+ * Signature: ()Lorg/ldk/enums/SemanticError;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_SemanticError_1invalid_1recovery_1id
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    SemanticError_invalid_signature
+ * Signature: ()Lorg/ldk/enums/SemanticError;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_SemanticError_1invalid_1signature
+  (JNIEnv *, jclass);
+
 /*
  * Class:     org_ldk_impl_bindings
  * Method:    SemanticError_eq
@@ -17279,6 +18023,22 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1free
 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1clone
   (JNIEnv *, jclass, jlong);
 
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    SignOrCreationError_sign_error
+ * Signature: ()J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1sign_1error
+  (JNIEnv *, jclass);
+
+/*
+ * Class:     org_ldk_impl_bindings
+ * Method:    SignOrCreationError_creation_error
+ * Signature: (Lorg/ldk/enums/CreationError;)J
+ */
+JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_SignOrCreationError_1creation_1error
+  (JNIEnv *, jclass, jobject);
+
 /*
  * Class:     org_ldk_impl_bindings
  * Method:    SignOrCreationError_eq
index 665c4f05a6d7e354760ddf64d6149046250259af..cad8efba6ac42bb6c209e1cb08449e11ddc3ade9 100644 (file)
@@ -326,6 +326,21 @@ static inline LDKCVec_u8Z CVec_u8Z_clone(const LDKCVec_u8Z *orig) {
        memcpy(ret.data, orig->data, sizeof(int8_t) * ret.datalen);
        return ret;
 }
+struct LDKCVec_u8Z TxOut_get_script_pubkey (struct LDKTxOut* thing) {  return CVec_u8Z_clone(&thing->script_pubkey);}int8_tArray  __attribute__((visibility("default"))) TS_TxOut_get_script_pubkey(uint32_t thing) {
+       LDKTxOut* thing_conv = (LDKTxOut*)(thing & ~1);
+       LDKCVec_u8Z ret_var = TxOut_get_script_pubkey(thing_conv);
+       int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+       memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+       CVec_u8Z_free(ret_var);
+       return ret_arr;
+}
+
+uint64_t TxOut_get_value (struct LDKTxOut* thing) {    return thing->value;}int64_t  __attribute__((visibility("default"))) TS_TxOut_get_value(uint32_t thing) {
+       LDKTxOut* thing_conv = (LDKTxOut*)(thing & ~1);
+       int64_t ret_val = TxOut_get_value(thing_conv);
+       return ret_val;
+}
+
 jboolean  __attribute__((visibility("default"))) TS_LDKCResult_SecretKeyErrorZ_result_ok(uint32_t arg) {
        return ((LDKCResult_SecretKeyErrorZ*)arg)->result_ok;
 }
@@ -1599,10 +1614,9 @@ void ready_channel_LDKBaseSign_jcall(void* this_arg, const LDKChannelTransaction
        }
        js_invoke_function_1(j_calls->ready_channel_meth, channel_parameters_ref);
 }
-static void* LDKBaseSign_JCalls_clone(const void* this_arg) {
-       LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
+static void LDKBaseSign_JCalls_cloned(LDKBaseSign* new_obj) {
+       LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKBaseSign LDKBaseSign_init (/*TODO: JS Object Reference */void* o, uint32_t pubkeys) {
        LDKBaseSign_JCalls *calls = MALLOC(sizeof(LDKBaseSign_JCalls), "LDKBaseSign_JCalls");
@@ -1800,11 +1814,10 @@ LDKCVec_u8Z write_LDKSign_jcall(const void* this_arg) {
        memcpy(ret_ref.data, (uint8_t*)(ret + 4), ret_ref.datalen);
        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 (/*TODO: JS Object Reference */void* o, /*TODO: JS Object Reference */void* BaseSign, uint32_t pubkeys) {
        LDKSign_JCalls *calls = MALLOC(sizeof(LDKSign_JCalls), "LDKSign_JCalls");
@@ -1819,7 +1832,7 @@ static inline LDKSign LDKSign_init (/*TODO: JS Object Reference */void* o, /*TOD
        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(BaseSign, pubkeys),
        };
@@ -2381,10 +2394,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 (/*TODO: JS Object Reference */void* o) {
        LDKWatch_JCalls *calls = MALLOC(sizeof(LDKWatch_JCalls), "LDKWatch_JCalls");
@@ -2469,10 +2481,9 @@ void broadcast_transaction_LDKBroadcasterInterface_jcall(const void* this_arg, L
        Transaction_free(tx_var);
        js_invoke_function_1(j_calls->broadcast_transaction_meth, tx_arr);
 }
-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 (/*TODO: JS Object Reference */void* o) {
        LDKBroadcasterInterface_JCalls *calls = MALLOC(sizeof(LDKBroadcasterInterface_JCalls), "LDKBroadcasterInterface_JCalls");
@@ -2585,10 +2596,9 @@ LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKKeysInterface_jcall(const v
        ret_conv = CResult_RecoverableSignatureNoneZ_clone((LDKCResult_RecoverableSignatureNoneZ*)(((uint64_t)ret) & ~1));
        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 (/*TODO: JS Object Reference */void* o) {
        LDKKeysInterface_JCalls *calls = MALLOC(sizeof(LDKKeysInterface_JCalls), "LDKKeysInterface_JCalls");
@@ -2687,10 +2697,9 @@ uint32_t get_est_sat_per_1000_weight_LDKFeeEstimator_jcall(const void* this_arg,
        uint32_t confirmation_target_conv = LDKConfirmationTarget_to_js(confirmation_target);
        return js_invoke_function_1(j_calls->get_est_sat_per_1000_weight_meth, confirmation_target_conv);
 }
-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 (/*TODO: JS Object Reference */void* o) {
        LDKFeeEstimator_JCalls *calls = MALLOC(sizeof(LDKFeeEstimator_JCalls), "LDKFeeEstimator_JCalls");
@@ -2733,10 +2742,9 @@ void log_LDKLogger_jcall(const void* this_arg, const char* record) {
        jstring record_conv = str_ref_to_ts(record_str, strlen(record_str));
        js_invoke_function_1(j_calls->log_meth, record_conv);
 }
-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 (/*TODO: JS Object Reference */void* o) {
        LDKLogger_JCalls *calls = MALLOC(sizeof(LDKLogger_JCalls), "LDKLogger_JCalls");
@@ -4675,10 +4683,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 (/*TODO: JS Object Reference */void* o) {
        LDKMessageSendEventsProvider_JCalls *calls = MALLOC(sizeof(LDKMessageSendEventsProvider_JCalls), "LDKMessageSendEventsProvider_JCalls");
@@ -4730,10 +4737,9 @@ void handle_event_LDKEventHandler_jcall(const void* this_arg, LDKEvent event) {
        uint64_t event_ref = (uint64_t)event_copy;
        js_invoke_function_1(j_calls->handle_event_meth, event_ref);
 }
-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 (/*TODO: JS Object Reference */void* o) {
        LDKEventHandler_JCalls *calls = MALLOC(sizeof(LDKEventHandler_JCalls), "LDKEventHandler_JCalls");
@@ -4775,10 +4781,9 @@ void process_pending_events_LDKEventsProvider_jcall(const void* this_arg, LDKEve
        *ret = handler;
        js_invoke_function_1(j_calls->process_pending_events_meth, (uint64_t)ret);
 }
-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 (/*TODO: JS Object Reference */void* o) {
        LDKEventsProvider_JCalls *calls = MALLOC(sizeof(LDKEventsProvider_JCalls), "LDKEventsProvider_JCalls");
@@ -4823,10 +4828,9 @@ LDKCResult_TxOutAccessErrorZ get_utxo_LDKAccess_jcall(const void* this_arg, cons
        ret_conv = CResult_TxOutAccessErrorZ_clone((LDKCResult_TxOutAccessErrorZ*)(((uint64_t)ret) & ~1));
        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 (/*TODO: JS Object Reference */void* o) {
        LDKAccess_JCalls *calls = MALLOC(sizeof(LDKAccess_JCalls), "LDKAccess_JCalls");
@@ -4882,10 +4886,9 @@ void block_disconnected_LDKListen_jcall(const void* this_arg, const uint8_t (* h
        memcpy((uint8_t*)(header_arr + 4), *header, 80);
        js_invoke_function_2(j_calls->block_disconnected_meth, header_arr, height);
 }
-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 (/*TODO: JS Object Reference */void* o) {
        LDKListen_JCalls *calls = MALLOC(sizeof(LDKListen_JCalls), "LDKListen_JCalls");
@@ -4985,10 +4988,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 (/*TODO: JS Object Reference */void* o) {
        LDKConfirm_JCalls *calls = MALLOC(sizeof(LDKConfirm_JCalls), "LDKConfirm_JCalls");
@@ -5100,10 +5102,9 @@ LDKCOption_C2Tuple_usizeTransactionZZ register_output_LDKFilter_jcall(const void
        ret_conv = COption_C2Tuple_usizeTransactionZZ_clone((LDKCOption_C2Tuple_usizeTransactionZZ*)(((uint64_t)ret) & ~1));
        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 (/*TODO: JS Object Reference */void* o) {
        LDKFilter_JCalls *calls = MALLOC(sizeof(LDKFilter_JCalls), "LDKFilter_JCalls");
@@ -5212,10 +5213,9 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal
        ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1));
        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 (/*TODO: JS Object Reference */void* o) {
        LDKPersist_JCalls *calls = MALLOC(sizeof(LDKPersist_JCalls), "LDKPersist_JCalls");
@@ -5610,11 +5610,10 @@ void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublic
        }
        js_invoke_function_2(j_calls->handle_error_meth, their_node_id_arr, msg_ref);
 }
-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 (/*TODO: JS Object Reference */void* o, /*TODO: JS Object Reference */void* MessageSendEventsProvider) {
        LDKChannelMessageHandler_JCalls *calls = MALLOC(sizeof(LDKChannelMessageHandler_JCalls), "LDKChannelMessageHandler_JCalls");
@@ -6082,11 +6081,10 @@ LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageH
        ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1));
        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 (/*TODO: JS Object Reference */void* o, /*TODO: JS Object Reference */void* MessageSendEventsProvider) {
        LDKRoutingMessageHandler_JCalls *calls = MALLOC(sizeof(LDKRoutingMessageHandler_JCalls), "LDKRoutingMessageHandler_JCalls");
@@ -6294,10 +6292,9 @@ uint64_t hash_LDKSocketDescriptor_jcall(const void* this_arg) {
        LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
        return js_invoke_function_0(j_calls->hash_meth);
 }
-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 (/*TODO: JS Object Reference */void* o) {
        LDKSocketDescriptor_JCalls *calls = MALLOC(sizeof(LDKSocketDescriptor_JCalls), "LDKSocketDescriptor_JCalls");
@@ -6310,7 +6307,7 @@ static inline LDKSocketDescriptor LDKSocketDescriptor_init (/*TODO: JS Object Re
                .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;
@@ -6366,10 +6363,9 @@ LDKCResult_NoneErrorZ persist_manager_LDKChannelManagerPersister_jcall(const voi
        ret_conv = CResult_NoneErrorZ_clone((LDKCResult_NoneErrorZ*)(((uint64_t)ret) & ~1));
        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 (/*TODO: JS Object Reference */void* o) {
        LDKChannelManagerPersister_JCalls *calls = MALLOC(sizeof(LDKChannelManagerPersister_JCalls), "LDKChannelManagerPersister_JCalls");
@@ -6424,12 +6420,14 @@ uint32_t __attribute__((visibility("default"))) TS_LDKFallback_ref_from_ptr(uint
 jstring  __attribute__((visibility("default"))) TS__ldk_get_compiled_version() {
        LDKStr ret_str = _ldk_get_compiled_version();
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
 jstring  __attribute__((visibility("default"))) TS__ldk_c_bindings_get_compiled_version() {
        LDKStr ret_str = _ldk_c_bindings_get_compiled_version();
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -6442,6 +6440,16 @@ void  __attribute__((visibility("default"))) TS_Transaction_free(int8_tArray _re
        Transaction_free(_res_ref);
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_TxOut_new(int8_tArray script_pubkey, int64_t value) {
+       LDKCVec_u8Z script_pubkey_ref;
+       script_pubkey_ref.datalen = *((uint32_t*)script_pubkey);
+       script_pubkey_ref.data = MALLOC(script_pubkey_ref.datalen, "LDKCVec_u8Z Bytes");
+       memcpy(script_pubkey_ref.data, (uint8_t*)(script_pubkey + 4), script_pubkey_ref.datalen);
+       LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
+       *ret_ref = TxOut_new(script_pubkey_ref, value);
+       return (uint64_t)ret_ref;
+}
+
 void  __attribute__((visibility("default"))) TS_TxOut_free(uint32_t _res) {
        if ((_res & 1) != 0) return;
        LDKTxOut _res_conv = *(LDKTxOut*)(((uint64_t)_res) & ~1);
@@ -10725,6 +10733,83 @@ uint32_t  __attribute__((visibility("default"))) TS_Event_clone(uint32_t orig) {
        return ret_ref;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_Event_funding_generation_ready(int8_tArray temporary_channel_id, int64_t channel_value_satoshis, int8_tArray output_script, int64_t user_channel_id) {
+       LDKThirtyTwoBytes temporary_channel_id_ref;
+       CHECK(*((uint32_t*)temporary_channel_id) == 32);
+       memcpy(temporary_channel_id_ref.data, (uint8_t*)(temporary_channel_id + 4), 32);
+       LDKCVec_u8Z output_script_ref;
+       output_script_ref.datalen = *((uint32_t*)output_script);
+       output_script_ref.data = MALLOC(output_script_ref.datalen, "LDKCVec_u8Z Bytes");
+       memcpy(output_script_ref.data, (uint8_t*)(output_script + 4), output_script_ref.datalen);
+       LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+       *ret_copy = Event_funding_generation_ready(temporary_channel_id_ref, channel_value_satoshis, output_script_ref, user_channel_id);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Event_payment_received(int8_tArray payment_hash, int8_tArray payment_preimage, int8_tArray payment_secret, int64_t amt, int64_t user_payment_id) {
+       LDKThirtyTwoBytes payment_hash_ref;
+       CHECK(*((uint32_t*)payment_hash) == 32);
+       memcpy(payment_hash_ref.data, (uint8_t*)(payment_hash + 4), 32);
+       LDKThirtyTwoBytes payment_preimage_ref;
+       CHECK(*((uint32_t*)payment_preimage) == 32);
+       memcpy(payment_preimage_ref.data, (uint8_t*)(payment_preimage + 4), 32);
+       LDKThirtyTwoBytes payment_secret_ref;
+       CHECK(*((uint32_t*)payment_secret) == 32);
+       memcpy(payment_secret_ref.data, (uint8_t*)(payment_secret + 4), 32);
+       LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+       *ret_copy = Event_payment_received(payment_hash_ref, payment_preimage_ref, payment_secret_ref, amt, user_payment_id);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Event_payment_sent(int8_tArray payment_preimage) {
+       LDKThirtyTwoBytes payment_preimage_ref;
+       CHECK(*((uint32_t*)payment_preimage) == 32);
+       memcpy(payment_preimage_ref.data, (uint8_t*)(payment_preimage + 4), 32);
+       LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+       *ret_copy = Event_payment_sent(payment_preimage_ref);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Event_payment_failed(int8_tArray payment_hash, jboolean rejected_by_dest) {
+       LDKThirtyTwoBytes payment_hash_ref;
+       CHECK(*((uint32_t*)payment_hash) == 32);
+       memcpy(payment_hash_ref.data, (uint8_t*)(payment_hash + 4), 32);
+       LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+       *ret_copy = Event_payment_failed(payment_hash_ref, rejected_by_dest);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Event_pending_htlcs_forwardable(int64_t time_forwardable) {
+       LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+       *ret_copy = Event_pending_htlcs_forwardable(time_forwardable);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Event_spendable_outputs(uint32_tArray outputs) {
+       LDKCVec_SpendableOutputDescriptorZ outputs_constr;
+       outputs_constr.datalen = *((uint32_t*)outputs);
+       if (outputs_constr.datalen > 0)
+               outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
+       else
+               outputs_constr.data = NULL;
+       uint32_t* outputs_vals = (uint32_t*)(outputs + 4);
+       for (size_t b = 0; b < outputs_constr.datalen; b++) {
+               uint32_t outputs_conv_27 = outputs_vals[b];
+               LDKSpendableOutputDescriptor outputs_conv_27_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)outputs_conv_27) & ~1);
+               outputs_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uint64_t)outputs_conv_27) & ~1));
+               outputs_constr.data[b] = outputs_conv_27_conv;
+       }
+       LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+       *ret_copy = Event_spendable_outputs(outputs_constr);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 int8_tArray  __attribute__((visibility("default"))) TS_Event_write(uint32_t obj) {
        LDKEvent* obj_conv = (LDKEvent*)obj;
        LDKCVec_u8Z ret_var = Event_write(obj_conv);
@@ -10749,6 +10834,272 @@ uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_clone(uint3
        return ret_ref;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_accept_channel(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKAcceptChannel msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = AcceptChannel_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_accept_channel(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_open_channel(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKOpenChannel msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = OpenChannel_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_open_channel(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_funding_created(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKFundingCreated msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = FundingCreated_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_funding_created(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_funding_signed(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKFundingSigned msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = FundingSigned_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_funding_signed(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_funding_locked(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKFundingLocked msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = FundingLocked_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_funding_locked(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_announcement_signatures(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKAnnouncementSignatures msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = AnnouncementSignatures_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_announcement_signatures(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_update_htlcs(int8_tArray node_id, uint32_t updates) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKCommitmentUpdate updates_conv;
+       updates_conv.inner = (void*)(updates & (~1));
+       updates_conv.is_owned = (updates & 1) || (updates == 0);
+       updates_conv = CommitmentUpdate_clone(&updates_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_update_htlcs(node_id_ref, updates_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_revoke_and_ack(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKRevokeAndACK msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = RevokeAndACK_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_revoke_and_ack(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_closing_signed(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKClosingSigned msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ClosingSigned_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_closing_signed(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_shutdown(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKShutdown msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = Shutdown_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_shutdown(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_channel_reestablish(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKChannelReestablish msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ChannelReestablish_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_channel_reestablish(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_broadcast_channel_announcement(uint32_t msg, uint32_t update_msg) {
+       LDKChannelAnnouncement msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ChannelAnnouncement_clone(&msg_conv);
+       LDKChannelUpdate update_msg_conv;
+       update_msg_conv.inner = (void*)(update_msg & (~1));
+       update_msg_conv.is_owned = (update_msg & 1) || (update_msg == 0);
+       update_msg_conv = ChannelUpdate_clone(&update_msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_broadcast_channel_announcement(msg_conv, update_msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_broadcast_node_announcement(uint32_t msg) {
+       LDKNodeAnnouncement msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = NodeAnnouncement_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_broadcast_node_announcement(msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_broadcast_channel_update(uint32_t msg) {
+       LDKChannelUpdate msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ChannelUpdate_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_broadcast_channel_update(msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_channel_update(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKChannelUpdate msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ChannelUpdate_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_channel_update(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_handle_error(int8_tArray node_id, uint32_t action) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKErrorAction action_conv = *(LDKErrorAction*)(((uint64_t)action) & ~1);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_handle_error(node_id_ref, action_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_payment_failure_network_update(uint32_t update) {
+       LDKHTLCFailChannelUpdate update_conv = *(LDKHTLCFailChannelUpdate*)(((uint64_t)update) & ~1);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_payment_failure_network_update(update_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_channel_range_query(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKQueryChannelRange msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = QueryChannelRange_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_channel_range_query(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_short_ids_query(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKQueryShortChannelIds msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = QueryShortChannelIds_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_short_ids_query(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_reply_channel_range(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKReplyChannelRange msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ReplyChannelRange_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_reply_channel_range(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 void  __attribute__((visibility("default"))) TS_MessageSendEventsProvider_free(uint32_t this_ptr) {
        if ((this_ptr & 1) != 0) return;
        LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(((uint64_t)this_ptr) & ~1);
@@ -10780,7 +11131,46 @@ void  __attribute__((visibility("default"))) TS_APIError_free(uint32_t this_ptr)
 uint32_t  __attribute__((visibility("default"))) TS_APIError_clone(uint32_t orig) {
        LDKAPIError* orig_conv = (LDKAPIError*)orig;
        LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
-       *ret_copy = APIError_clone(orig_conv);
+       *ret_copy = APIError_clone(orig_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_APIError_apimisuse_error(jstring err) {
+       LDKStr err_conv = str_ref_to_owned_c(err);
+       LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
+       *ret_copy = APIError_apimisuse_error(err_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_APIError_fee_rate_too_high(jstring err, int32_t feerate) {
+       LDKStr err_conv = str_ref_to_owned_c(err);
+       LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
+       *ret_copy = APIError_fee_rate_too_high(err_conv, feerate);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_APIError_route_error(jstring err) {
+       LDKStr err_conv = str_ref_to_owned_c(err);
+       LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
+       *ret_copy = APIError_route_error(err_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_APIError_channel_unavailable(jstring err) {
+       LDKStr err_conv = str_ref_to_owned_c(err);
+       LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
+       *ret_copy = APIError_channel_unavailable(err_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_APIError_monitor_update_failed() {
+       LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
+       *ret_copy = APIError_monitor_update_failed();
        uint64_t ret_ref = (uint64_t)ret_copy;
        return ret_ref;
 }
@@ -10826,6 +11216,31 @@ uint32_t  __attribute__((visibility("default"))) TS_Level_clone(uint32_t orig) {
        return ret_conv;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_Level_trace() {
+       uint32_t ret_conv = LDKLevel_to_js(Level_trace());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Level_debug() {
+       uint32_t ret_conv = LDKLevel_to_js(Level_debug());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Level_info() {
+       uint32_t ret_conv = LDKLevel_to_js(Level_info());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Level_warn() {
+       uint32_t ret_conv = LDKLevel_to_js(Level_warn());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Level_error() {
+       uint32_t ret_conv = LDKLevel_to_js(Level_error());
+       return ret_conv;
+}
+
 jboolean  __attribute__((visibility("default"))) TS_Level_eq(uint32_t a, uint32_t b) {
        LDKLevel* a_conv = (LDKLevel*)(a & ~1);
        LDKLevel* b_conv = (LDKLevel*)(b & ~1);
@@ -11455,6 +11870,16 @@ uint32_t  __attribute__((visibility("default"))) TS_AccessError_clone(uint32_t o
        return ret_conv;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_AccessError_unknown_chain() {
+       uint32_t ret_conv = LDKAccessError_to_js(AccessError_unknown_chain());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_AccessError_unknown_tx() {
+       uint32_t ret_conv = LDKAccessError_to_js(AccessError_unknown_tx());
+       return ret_conv;
+}
+
 void  __attribute__((visibility("default"))) TS_Access_free(uint32_t this_ptr) {
        if ((this_ptr & 1) != 0) return;
        LDKAccess this_ptr_conv = *(LDKAccess*)(((uint64_t)this_ptr) & ~1);
@@ -11619,6 +12044,21 @@ uint32_t  __attribute__((visibility("default"))) TS_ConfirmationTarget_clone(uin
        return ret_conv;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_ConfirmationTarget_background() {
+       uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_background());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_ConfirmationTarget_normal() {
+       uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_normal());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_ConfirmationTarget_high_priority() {
+       uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_high_priority());
+       return ret_conv;
+}
+
 void  __attribute__((visibility("default"))) TS_FeeEstimator_free(uint32_t this_ptr) {
        if ((this_ptr & 1) != 0) return;
        LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)(((uint64_t)this_ptr) & ~1);
@@ -11753,6 +12193,16 @@ uint32_t  __attribute__((visibility("default"))) TS_ChannelMonitorUpdateErr_clon
        return ret_conv;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_ChannelMonitorUpdateErr_temporary_failure() {
+       uint32_t ret_conv = LDKChannelMonitorUpdateErr_to_js(ChannelMonitorUpdateErr_temporary_failure());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_ChannelMonitorUpdateErr_permanent_failure() {
+       uint32_t ret_conv = LDKChannelMonitorUpdateErr_to_js(ChannelMonitorUpdateErr_permanent_failure());
+       return ret_conv;
+}
+
 void  __attribute__((visibility("default"))) TS_MonitorUpdateError_free(uint32_t this_obj) {
        LDKMonitorUpdateError this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
@@ -11789,6 +12239,28 @@ uint32_t  __attribute__((visibility("default"))) TS_MonitorEvent_clone(uint32_t
        return ret_ref;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_MonitorEvent_htlcevent(uint32_t a) {
+       LDKHTLCUpdate a_conv;
+       a_conv.inner = (void*)(a & (~1));
+       a_conv.is_owned = (a & 1) || (a == 0);
+       a_conv = HTLCUpdate_clone(&a_conv);
+       LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
+       *ret_copy = MonitorEvent_htlcevent(a_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MonitorEvent_commitment_tx_broadcasted(uint32_t a) {
+       LDKOutPoint a_conv;
+       a_conv.inner = (void*)(a & (~1));
+       a_conv.is_owned = (a & 1) || (a == 0);
+       a_conv = OutPoint_clone(&a_conv);
+       LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
+       *ret_copy = MonitorEvent_commitment_tx_broadcasted(a_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 void  __attribute__((visibility("default"))) TS_HTLCUpdate_free(uint32_t this_obj) {
        LDKHTLCUpdate this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
@@ -12586,6 +13058,40 @@ uint32_t  __attribute__((visibility("default"))) TS_SpendableOutputDescriptor_cl
        return ret_ref;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_SpendableOutputDescriptor_static_output(uint32_t outpoint, uint32_t output) {
+       LDKOutPoint outpoint_conv;
+       outpoint_conv.inner = (void*)(outpoint & (~1));
+       outpoint_conv.is_owned = (outpoint & 1) || (outpoint == 0);
+       outpoint_conv = OutPoint_clone(&outpoint_conv);
+       LDKTxOut output_conv = *(LDKTxOut*)(((uint64_t)output) & ~1);
+       LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
+       *ret_copy = SpendableOutputDescriptor_static_output(outpoint_conv, output_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SpendableOutputDescriptor_delayed_payment_output(uint32_t a) {
+       LDKDelayedPaymentOutputDescriptor a_conv;
+       a_conv.inner = (void*)(a & (~1));
+       a_conv.is_owned = (a & 1) || (a == 0);
+       a_conv = DelayedPaymentOutputDescriptor_clone(&a_conv);
+       LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
+       *ret_copy = SpendableOutputDescriptor_delayed_payment_output(a_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SpendableOutputDescriptor_static_payment_output(uint32_t a) {
+       LDKStaticPaymentOutputDescriptor a_conv;
+       a_conv.inner = (void*)(a & (~1));
+       a_conv.is_owned = (a & 1) || (a == 0);
+       a_conv = StaticPaymentOutputDescriptor_clone(&a_conv);
+       LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
+       *ret_copy = SpendableOutputDescriptor_static_payment_output(a_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 int8_tArray  __attribute__((visibility("default"))) TS_SpendableOutputDescriptor_write(uint32_t obj) {
        LDKSpendableOutputDescriptor* obj_conv = (LDKSpendableOutputDescriptor*)obj;
        LDKCVec_u8Z ret_var = SpendableOutputDescriptor_write(obj_conv);
@@ -13513,6 +14019,74 @@ uint32_t  __attribute__((visibility("default"))) TS_PaymentSendFailure_clone(uin
        return ret_ref;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_PaymentSendFailure_parameter_error(uint32_t a) {
+       LDKAPIError a_conv = *(LDKAPIError*)(((uint64_t)a) & ~1);
+       LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
+       *ret_copy = PaymentSendFailure_parameter_error(a_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_PaymentSendFailure_path_parameter_error(uint32_tArray a) {
+       LDKCVec_CResult_NoneAPIErrorZZ a_constr;
+       a_constr.datalen = *((uint32_t*)a);
+       if (a_constr.datalen > 0)
+               a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
+       else
+               a_constr.data = NULL;
+       uint32_t* a_vals = (uint32_t*)(a + 4);
+       for (size_t w = 0; w < a_constr.datalen; w++) {
+               uint32_t a_conv_22 = a_vals[w];
+               LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1);
+               a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1));
+               a_constr.data[w] = a_conv_22_conv;
+       }
+       LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
+       *ret_copy = PaymentSendFailure_path_parameter_error(a_constr);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_PaymentSendFailure_all_failed_retry_safe(uint32_tArray a) {
+       LDKCVec_APIErrorZ a_constr;
+       a_constr.datalen = *((uint32_t*)a);
+       if (a_constr.datalen > 0)
+               a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements");
+       else
+               a_constr.data = NULL;
+       uint32_t* a_vals = (uint32_t*)(a + 4);
+       for (size_t k = 0; k < a_constr.datalen; k++) {
+               uint32_t a_conv_10 = a_vals[k];
+               LDKAPIError a_conv_10_conv = *(LDKAPIError*)(((uint64_t)a_conv_10) & ~1);
+               a_conv_10_conv = APIError_clone((LDKAPIError*)(((uint64_t)a_conv_10) & ~1));
+               a_constr.data[k] = a_conv_10_conv;
+       }
+       LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
+       *ret_copy = PaymentSendFailure_all_failed_retry_safe(a_constr);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_PaymentSendFailure_partial_failure(uint32_tArray a) {
+       LDKCVec_CResult_NoneAPIErrorZZ a_constr;
+       a_constr.datalen = *((uint32_t*)a);
+       if (a_constr.datalen > 0)
+               a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
+       else
+               a_constr.data = NULL;
+       uint32_t* a_vals = (uint32_t*)(a + 4);
+       for (size_t w = 0; w < a_constr.datalen; w++) {
+               uint32_t a_conv_22 = a_vals[w];
+               LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1);
+               a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1));
+               a_constr.data[w] = a_conv_22_conv;
+       }
+       LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
+       *ret_copy = PaymentSendFailure_partial_failure(a_constr);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 uint32_t  __attribute__((visibility("default"))) TS_ChannelManager_new(uint32_t fee_est, uint32_t chain_monitor, uint32_t tx_broadcaster, uint32_t logger, uint32_t keys_manager, uint32_t config, uint32_t params) {
        LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(((uint64_t)fee_est) & ~1);
        LDKWatch chain_monitor_conv = *(LDKWatch*)(((uint64_t)chain_monitor) & ~1);
@@ -14140,6 +14714,7 @@ jstring  __attribute__((visibility("default"))) TS_ErrorMessage_get_data(uint32_
        this_ptr_conv.is_owned = false;
        LDKStr ret_str = ErrorMessage_get_data(&this_ptr_conv);
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -16178,6 +16753,46 @@ uint32_t  __attribute__((visibility("default"))) TS_NetAddress_clone(uint32_t or
        return ret_ref;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_NetAddress_ipv4(int8_tArray addr, int16_t port) {
+       LDKFourBytes addr_ref;
+       CHECK(*((uint32_t*)addr) == 4);
+       memcpy(addr_ref.data, (uint8_t*)(addr + 4), 4);
+       LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
+       *ret_copy = NetAddress_ipv4(addr_ref, port);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_NetAddress_ipv6(int8_tArray addr, int16_t port) {
+       LDKSixteenBytes addr_ref;
+       CHECK(*((uint32_t*)addr) == 16);
+       memcpy(addr_ref.data, (uint8_t*)(addr + 4), 16);
+       LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
+       *ret_copy = NetAddress_ipv6(addr_ref, port);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_NetAddress_onion_v2(int8_tArray addr, int16_t port) {
+       LDKTenBytes addr_ref;
+       CHECK(*((uint32_t*)addr) == 10);
+       memcpy(addr_ref.data, (uint8_t*)(addr + 4), 10);
+       LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
+       *ret_copy = NetAddress_onion_v2(addr_ref, port);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_NetAddress_onion_v3(int8_tArray ed25519_pubkey, int16_t checksum, int8_t version, int16_t port) {
+       LDKThirtyTwoBytes ed25519_pubkey_ref;
+       CHECK(*((uint32_t*)ed25519_pubkey) == 32);
+       memcpy(ed25519_pubkey_ref.data, (uint8_t*)(ed25519_pubkey + 4), 32);
+       LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
+       *ret_copy = NetAddress_onion_v3(ed25519_pubkey_ref, checksum, version, port);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 int8_tArray  __attribute__((visibility("default"))) TS_NetAddress_write(uint32_t obj) {
        LDKNetAddress* obj_conv = (LDKNetAddress*)obj;
        LDKCVec_u8Z ret_var = NetAddress_write(obj_conv);
@@ -17422,6 +18037,43 @@ uint32_t  __attribute__((visibility("default"))) TS_ErrorAction_clone(uint32_t o
        return ret_ref;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_ErrorAction_disconnect_peer(uint32_t msg) {
+       LDKErrorMessage msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ErrorMessage_clone(&msg_conv);
+       LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
+       *ret_copy = ErrorAction_disconnect_peer(msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_ErrorAction_ignore_error() {
+       LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
+       *ret_copy = ErrorAction_ignore_error();
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_ErrorAction_ignore_and_log(uint32_t a) {
+       LDKLevel a_conv = LDKLevel_from_js(a);
+       LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
+       *ret_copy = ErrorAction_ignore_and_log(a_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_ErrorAction_send_error_message(uint32_t msg) {
+       LDKErrorMessage msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ErrorMessage_clone(&msg_conv);
+       LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
+       *ret_copy = ErrorAction_send_error_message(msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 void  __attribute__((visibility("default"))) TS_LightningError_free(uint32_t this_obj) {
        LDKLightningError this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
@@ -17435,6 +18087,7 @@ jstring  __attribute__((visibility("default"))) TS_LightningError_get_err(uint32
        this_ptr_conv.is_owned = false;
        LDKStr ret_str = LightningError_get_err(&this_ptr_conv);
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -17744,6 +18397,34 @@ uint32_t  __attribute__((visibility("default"))) TS_HTLCFailChannelUpdate_clone(
        return ret_ref;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_HTLCFailChannelUpdate_channel_update_message(uint32_t msg) {
+       LDKChannelUpdate msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ChannelUpdate_clone(&msg_conv);
+       LDKHTLCFailChannelUpdate *ret_copy = MALLOC(sizeof(LDKHTLCFailChannelUpdate), "LDKHTLCFailChannelUpdate");
+       *ret_copy = HTLCFailChannelUpdate_channel_update_message(msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_HTLCFailChannelUpdate_channel_closed(int64_t short_channel_id, jboolean is_permanent) {
+       LDKHTLCFailChannelUpdate *ret_copy = MALLOC(sizeof(LDKHTLCFailChannelUpdate), "LDKHTLCFailChannelUpdate");
+       *ret_copy = HTLCFailChannelUpdate_channel_closed(short_channel_id, is_permanent);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_HTLCFailChannelUpdate_node_failure(int8_tArray node_id, jboolean is_permanent) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKHTLCFailChannelUpdate *ret_copy = MALLOC(sizeof(LDKHTLCFailChannelUpdate), "LDKHTLCFailChannelUpdate");
+       *ret_copy = HTLCFailChannelUpdate_node_failure(node_id_ref, is_permanent);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 void  __attribute__((visibility("default"))) TS_ChannelMessageHandler_free(uint32_t this_ptr) {
        if ((this_ptr & 1) != 0) return;
        LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)(((uint64_t)this_ptr) & ~1);
@@ -20925,18 +21606,22 @@ uint32_t  __attribute__((visibility("default"))) TS_get_route(int8_tArray our_no
        payee_features_conv.is_owned = (payee_features & 1) || (payee_features == 0);
        payee_features_conv = InvoiceFeatures_clone(&payee_features_conv);
        LDKCVec_ChannelDetailsZ first_hops_constr;
-       first_hops_constr.datalen = *((uint32_t*)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;
-       uint32_t* first_hops_vals = (uint32_t*)(first_hops + 4);
-       for (size_t q = 0; q < first_hops_constr.datalen; q++) {
-               uint32_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;
+       LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
+       if (first_hops != 0) {
+               first_hops_constr.datalen = *((uint32_t*)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;
+               uint32_t* first_hops_vals = (uint32_t*)(first_hops + 4);
+               for (size_t q = 0; q < first_hops_constr.datalen; q++) {
+                       uint32_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;
+               }
+               first_hops_ptr = &first_hops_constr;
        }
        LDKCVec_RouteHintZ last_hops_constr;
        last_hops_constr.datalen = *((uint32_t*)last_hops);
@@ -20955,8 +21640,8 @@ uint32_t  __attribute__((visibility("default"))) TS_get_route(int8_tArray our_no
        }
        LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
        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);
-       FREE(first_hops_constr.data);
+       *ret_conv = get_route(our_node_id_ref, &network_conv, payee_ref, payee_features_conv, first_hops_ptr, last_hops_constr, final_value_msat, final_cltv, logger_conv);
+       if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
        return (uint64_t)ret_conv;
 }
 
@@ -22105,6 +22790,7 @@ jstring  __attribute__((visibility("default"))) TS_FilesystemPersister_get_data_
        this_arg_conv.is_owned = false;
        LDKStr ret_str = FilesystemPersister_get_data_dir(&this_arg_conv);
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -22404,6 +23090,26 @@ uint32_t  __attribute__((visibility("default"))) TS_SiPrefix_clone(uint32_t orig
        return ret_conv;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_SiPrefix_milli() {
+       uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_milli());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SiPrefix_micro() {
+       uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_micro());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SiPrefix_nano() {
+       uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_nano());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SiPrefix_pico() {
+       uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_pico());
+       return ret_conv;
+}
+
 jboolean  __attribute__((visibility("default"))) TS_SiPrefix_eq(uint32_t a, uint32_t b) {
        LDKSiPrefix* a_conv = (LDKSiPrefix*)(a & ~1);
        LDKSiPrefix* b_conv = (LDKSiPrefix*)(b & ~1);
@@ -22423,6 +23129,31 @@ uint32_t  __attribute__((visibility("default"))) TS_Currency_clone(uint32_t orig
        return ret_conv;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_Currency_bitcoin() {
+       uint32_t ret_conv = LDKCurrency_to_js(Currency_bitcoin());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Currency_bitcoin_testnet() {
+       uint32_t ret_conv = LDKCurrency_to_js(Currency_bitcoin_testnet());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Currency_regtest() {
+       uint32_t ret_conv = LDKCurrency_to_js(Currency_regtest());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Currency_simnet() {
+       uint32_t ret_conv = LDKCurrency_to_js(Currency_simnet());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Currency_signet() {
+       uint32_t ret_conv = LDKCurrency_to_js(Currency_signet());
+       return ret_conv;
+}
+
 jboolean  __attribute__((visibility("default"))) TS_Currency_eq(uint32_t a, uint32_t b) {
        LDKCurrency* a_conv = (LDKCurrency*)(a & ~1);
        LDKCurrency* b_conv = (LDKCurrency*)(b & ~1);
@@ -22605,6 +23336,38 @@ uint32_t  __attribute__((visibility("default"))) TS_Fallback_clone(uint32_t orig
        return ret_ref;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_Fallback_seg_wit_program(int8_t version, int8_tArray program) {
+       
+       LDKCVec_u8Z program_ref;
+       program_ref.datalen = *((uint32_t*)program);
+       program_ref.data = MALLOC(program_ref.datalen, "LDKCVec_u8Z Bytes");
+       memcpy(program_ref.data, (uint8_t*)(program + 4), program_ref.datalen);
+       LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
+       *ret_copy = Fallback_seg_wit_program((LDKu5){ ._0 = version }, program_ref);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Fallback_pub_key_hash(int8_tArray a) {
+       LDKTwentyBytes a_ref;
+       CHECK(*((uint32_t*)a) == 20);
+       memcpy(a_ref.data, (uint8_t*)(a + 4), 20);
+       LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
+       *ret_copy = Fallback_pub_key_hash(a_ref);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Fallback_script_hash(int8_tArray a) {
+       LDKTwentyBytes a_ref;
+       CHECK(*((uint32_t*)a) == 20);
+       memcpy(a_ref.data, (uint8_t*)(a + 4), 20);
+       LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
+       *ret_copy = Fallback_script_hash(a_ref);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 jboolean  __attribute__((visibility("default"))) TS_Fallback_eq(uint32_t a, uint32_t b) {
        LDKFallback* a_conv = (LDKFallback*)a;
        LDKFallback* b_conv = (LDKFallback*)b;
@@ -23105,6 +23868,7 @@ jstring  __attribute__((visibility("default"))) TS_Description_into_inner(uint32
        this_arg_conv = Description_clone(&this_arg_conv);
        LDKStr ret_str = Description_into_inner(this_arg_conv);
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -23167,6 +23931,26 @@ uint32_t  __attribute__((visibility("default"))) TS_CreationError_clone(uint32_t
        return ret_conv;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_CreationError_description_too_long() {
+       uint32_t ret_conv = LDKCreationError_to_js(CreationError_description_too_long());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_CreationError_route_too_long() {
+       uint32_t ret_conv = LDKCreationError_to_js(CreationError_route_too_long());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_CreationError_timestamp_out_of_bounds() {
+       uint32_t ret_conv = LDKCreationError_to_js(CreationError_timestamp_out_of_bounds());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_CreationError_expiry_time_out_of_bounds() {
+       uint32_t ret_conv = LDKCreationError_to_js(CreationError_expiry_time_out_of_bounds());
+       return ret_conv;
+}
+
 jboolean  __attribute__((visibility("default"))) TS_CreationError_eq(uint32_t a, uint32_t b) {
        LDKCreationError* a_conv = (LDKCreationError*)(a & ~1);
        LDKCreationError* b_conv = (LDKCreationError*)(b & ~1);
@@ -23178,6 +23962,7 @@ jstring  __attribute__((visibility("default"))) TS_CreationError_to_str(uint32_t
        LDKCreationError* o_conv = (LDKCreationError*)(o & ~1);
        LDKStr ret_str = CreationError_to_str(o_conv);
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -23187,6 +23972,46 @@ uint32_t  __attribute__((visibility("default"))) TS_SemanticError_clone(uint32_t
        return ret_conv;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_SemanticError_no_payment_hash() {
+       uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_no_payment_hash());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SemanticError_multiple_payment_hashes() {
+       uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_multiple_payment_hashes());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SemanticError_no_description() {
+       uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_no_description());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SemanticError_multiple_descriptions() {
+       uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_multiple_descriptions());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SemanticError_multiple_payment_secrets() {
+       uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_multiple_payment_secrets());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SemanticError_invalid_features() {
+       uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_invalid_features());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SemanticError_invalid_recovery_id() {
+       uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_invalid_recovery_id());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SemanticError_invalid_signature() {
+       uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_invalid_signature());
+       return ret_conv;
+}
+
 jboolean  __attribute__((visibility("default"))) TS_SemanticError_eq(uint32_t a, uint32_t b) {
        LDKSemanticError* a_conv = (LDKSemanticError*)(a & ~1);
        LDKSemanticError* b_conv = (LDKSemanticError*)(b & ~1);
@@ -23198,6 +24023,7 @@ jstring  __attribute__((visibility("default"))) TS_SemanticError_to_str(uint32_t
        LDKSemanticError* o_conv = (LDKSemanticError*)(o & ~1);
        LDKStr ret_str = SemanticError_to_str(o_conv);
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -23216,6 +24042,21 @@ uint32_t  __attribute__((visibility("default"))) TS_SignOrCreationError_clone(ui
        return ret_ref;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_SignOrCreationError_sign_error() {
+       LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
+       *ret_copy = SignOrCreationError_sign_error();
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SignOrCreationError_creation_error(uint32_t a) {
+       LDKCreationError a_conv = LDKCreationError_from_js(a);
+       LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
+       *ret_copy = SignOrCreationError_creation_error(a_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 jboolean  __attribute__((visibility("default"))) TS_SignOrCreationError_eq(uint32_t a, uint32_t b) {
        LDKSignOrCreationError* a_conv = (LDKSignOrCreationError*)a;
        LDKSignOrCreationError* b_conv = (LDKSignOrCreationError*)b;
@@ -23227,6 +24068,7 @@ jstring  __attribute__((visibility("default"))) TS_SignOrCreationError_to_str(ui
        LDKSignOrCreationError* o_conv = (LDKSignOrCreationError*)o;
        LDKStr ret_str = SignOrCreationError_to_str(o_conv);
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -23270,6 +24112,7 @@ jstring  __attribute__((visibility("default"))) TS_Invoice_to_str(uint32_t o) {
        o_conv.is_owned = false;
        LDKStr ret_str = Invoice_to_str(&o_conv);
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -23279,6 +24122,7 @@ jstring  __attribute__((visibility("default"))) TS_SignedRawInvoice_to_str(uint3
        o_conv.is_owned = false;
        LDKStr ret_str = SignedRawInvoice_to_str(&o_conv);
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -23286,6 +24130,7 @@ jstring  __attribute__((visibility("default"))) TS_Currency_to_str(uint32_t o) {
        LDKCurrency* o_conv = (LDKCurrency*)(o & ~1);
        LDKStr ret_str = Currency_to_str(o_conv);
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -23293,6 +24138,7 @@ jstring  __attribute__((visibility("default"))) TS_SiPrefix_to_str(uint32_t o) {
        LDKSiPrefix* o_conv = (LDKSiPrefix*)(o & ~1);
        LDKStr ret_str = SiPrefix_to_str(o_conv);
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
index 739af0116285184421be5fc5a01cc6f52061f35d..d304be50a76fb212a86262cfc26d3a9dae6ba222 100644 (file)
@@ -324,6 +324,21 @@ static inline LDKCVec_u8Z CVec_u8Z_clone(const LDKCVec_u8Z *orig) {
        memcpy(ret.data, orig->data, sizeof(int8_t) * ret.datalen);
        return ret;
 }
+struct LDKCVec_u8Z TxOut_get_script_pubkey (struct LDKTxOut* thing) {  return CVec_u8Z_clone(&thing->script_pubkey);}int8_tArray  __attribute__((visibility("default"))) TS_TxOut_get_script_pubkey(uint32_t thing) {
+       LDKTxOut* thing_conv = (LDKTxOut*)(thing & ~1);
+       LDKCVec_u8Z ret_var = TxOut_get_script_pubkey(thing_conv);
+       int8_tArray ret_arr = init_arr(ret_var.datalen, sizeof(uint8_t), "Native int8_tArray Bytes");
+       memcpy((uint8_t*)(ret_arr + 4), ret_var.data, ret_var.datalen);
+       CVec_u8Z_free(ret_var);
+       return ret_arr;
+}
+
+uint64_t TxOut_get_value (struct LDKTxOut* thing) {    return thing->value;}int64_t  __attribute__((visibility("default"))) TS_TxOut_get_value(uint32_t thing) {
+       LDKTxOut* thing_conv = (LDKTxOut*)(thing & ~1);
+       int64_t ret_val = TxOut_get_value(thing_conv);
+       return ret_val;
+}
+
 jboolean  __attribute__((visibility("default"))) TS_LDKCResult_SecretKeyErrorZ_result_ok(uint32_t arg) {
        return ((LDKCResult_SecretKeyErrorZ*)arg)->result_ok;
 }
@@ -1597,10 +1612,9 @@ void ready_channel_LDKBaseSign_jcall(void* this_arg, const LDKChannelTransaction
        }
        js_invoke_function_1(j_calls->ready_channel_meth, channel_parameters_ref);
 }
-static void* LDKBaseSign_JCalls_clone(const void* this_arg) {
-       LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
+static void LDKBaseSign_JCalls_cloned(LDKBaseSign* new_obj) {
+       LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) new_obj->this_arg;
        atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
-       return (void*) this_arg;
 }
 static inline LDKBaseSign LDKBaseSign_init (/*TODO: JS Object Reference */void* o, uint32_t pubkeys) {
        LDKBaseSign_JCalls *calls = MALLOC(sizeof(LDKBaseSign_JCalls), "LDKBaseSign_JCalls");
@@ -1798,11 +1812,10 @@ LDKCVec_u8Z write_LDKSign_jcall(const void* this_arg) {
        memcpy(ret_ref.data, (uint8_t*)(ret + 4), ret_ref.datalen);
        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 (/*TODO: JS Object Reference */void* o, /*TODO: JS Object Reference */void* BaseSign, uint32_t pubkeys) {
        LDKSign_JCalls *calls = MALLOC(sizeof(LDKSign_JCalls), "LDKSign_JCalls");
@@ -1817,7 +1830,7 @@ static inline LDKSign LDKSign_init (/*TODO: JS Object Reference */void* o, /*TOD
        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(BaseSign, pubkeys),
        };
@@ -2379,10 +2392,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 (/*TODO: JS Object Reference */void* o) {
        LDKWatch_JCalls *calls = MALLOC(sizeof(LDKWatch_JCalls), "LDKWatch_JCalls");
@@ -2467,10 +2479,9 @@ void broadcast_transaction_LDKBroadcasterInterface_jcall(const void* this_arg, L
        Transaction_free(tx_var);
        js_invoke_function_1(j_calls->broadcast_transaction_meth, tx_arr);
 }
-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 (/*TODO: JS Object Reference */void* o) {
        LDKBroadcasterInterface_JCalls *calls = MALLOC(sizeof(LDKBroadcasterInterface_JCalls), "LDKBroadcasterInterface_JCalls");
@@ -2583,10 +2594,9 @@ LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKKeysInterface_jcall(const v
        ret_conv = CResult_RecoverableSignatureNoneZ_clone((LDKCResult_RecoverableSignatureNoneZ*)(((uint64_t)ret) & ~1));
        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 (/*TODO: JS Object Reference */void* o) {
        LDKKeysInterface_JCalls *calls = MALLOC(sizeof(LDKKeysInterface_JCalls), "LDKKeysInterface_JCalls");
@@ -2685,10 +2695,9 @@ uint32_t get_est_sat_per_1000_weight_LDKFeeEstimator_jcall(const void* this_arg,
        uint32_t confirmation_target_conv = LDKConfirmationTarget_to_js(confirmation_target);
        return js_invoke_function_1(j_calls->get_est_sat_per_1000_weight_meth, confirmation_target_conv);
 }
-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 (/*TODO: JS Object Reference */void* o) {
        LDKFeeEstimator_JCalls *calls = MALLOC(sizeof(LDKFeeEstimator_JCalls), "LDKFeeEstimator_JCalls");
@@ -2731,10 +2740,9 @@ void log_LDKLogger_jcall(const void* this_arg, const char* record) {
        jstring record_conv = str_ref_to_ts(record_str, strlen(record_str));
        js_invoke_function_1(j_calls->log_meth, record_conv);
 }
-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 (/*TODO: JS Object Reference */void* o) {
        LDKLogger_JCalls *calls = MALLOC(sizeof(LDKLogger_JCalls), "LDKLogger_JCalls");
@@ -4673,10 +4681,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 (/*TODO: JS Object Reference */void* o) {
        LDKMessageSendEventsProvider_JCalls *calls = MALLOC(sizeof(LDKMessageSendEventsProvider_JCalls), "LDKMessageSendEventsProvider_JCalls");
@@ -4728,10 +4735,9 @@ void handle_event_LDKEventHandler_jcall(const void* this_arg, LDKEvent event) {
        uint64_t event_ref = (uint64_t)event_copy;
        js_invoke_function_1(j_calls->handle_event_meth, event_ref);
 }
-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 (/*TODO: JS Object Reference */void* o) {
        LDKEventHandler_JCalls *calls = MALLOC(sizeof(LDKEventHandler_JCalls), "LDKEventHandler_JCalls");
@@ -4773,10 +4779,9 @@ void process_pending_events_LDKEventsProvider_jcall(const void* this_arg, LDKEve
        *ret = handler;
        js_invoke_function_1(j_calls->process_pending_events_meth, (uint64_t)ret);
 }
-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 (/*TODO: JS Object Reference */void* o) {
        LDKEventsProvider_JCalls *calls = MALLOC(sizeof(LDKEventsProvider_JCalls), "LDKEventsProvider_JCalls");
@@ -4821,10 +4826,9 @@ LDKCResult_TxOutAccessErrorZ get_utxo_LDKAccess_jcall(const void* this_arg, cons
        ret_conv = CResult_TxOutAccessErrorZ_clone((LDKCResult_TxOutAccessErrorZ*)(((uint64_t)ret) & ~1));
        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 (/*TODO: JS Object Reference */void* o) {
        LDKAccess_JCalls *calls = MALLOC(sizeof(LDKAccess_JCalls), "LDKAccess_JCalls");
@@ -4880,10 +4884,9 @@ void block_disconnected_LDKListen_jcall(const void* this_arg, const uint8_t (* h
        memcpy((uint8_t*)(header_arr + 4), *header, 80);
        js_invoke_function_2(j_calls->block_disconnected_meth, header_arr, height);
 }
-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 (/*TODO: JS Object Reference */void* o) {
        LDKListen_JCalls *calls = MALLOC(sizeof(LDKListen_JCalls), "LDKListen_JCalls");
@@ -4983,10 +4986,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 (/*TODO: JS Object Reference */void* o) {
        LDKConfirm_JCalls *calls = MALLOC(sizeof(LDKConfirm_JCalls), "LDKConfirm_JCalls");
@@ -5098,10 +5100,9 @@ LDKCOption_C2Tuple_usizeTransactionZZ register_output_LDKFilter_jcall(const void
        ret_conv = COption_C2Tuple_usizeTransactionZZ_clone((LDKCOption_C2Tuple_usizeTransactionZZ*)(((uint64_t)ret) & ~1));
        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 (/*TODO: JS Object Reference */void* o) {
        LDKFilter_JCalls *calls = MALLOC(sizeof(LDKFilter_JCalls), "LDKFilter_JCalls");
@@ -5210,10 +5211,9 @@ LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcal
        ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone((LDKCResult_NoneChannelMonitorUpdateErrZ*)(((uint64_t)ret) & ~1));
        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 (/*TODO: JS Object Reference */void* o) {
        LDKPersist_JCalls *calls = MALLOC(sizeof(LDKPersist_JCalls), "LDKPersist_JCalls");
@@ -5608,11 +5608,10 @@ void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublic
        }
        js_invoke_function_2(j_calls->handle_error_meth, their_node_id_arr, msg_ref);
 }
-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 (/*TODO: JS Object Reference */void* o, /*TODO: JS Object Reference */void* MessageSendEventsProvider) {
        LDKChannelMessageHandler_JCalls *calls = MALLOC(sizeof(LDKChannelMessageHandler_JCalls), "LDKChannelMessageHandler_JCalls");
@@ -6080,11 +6079,10 @@ LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageH
        ret_conv = CResult_NoneLightningErrorZ_clone((LDKCResult_NoneLightningErrorZ*)(((uint64_t)ret) & ~1));
        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 (/*TODO: JS Object Reference */void* o, /*TODO: JS Object Reference */void* MessageSendEventsProvider) {
        LDKRoutingMessageHandler_JCalls *calls = MALLOC(sizeof(LDKRoutingMessageHandler_JCalls), "LDKRoutingMessageHandler_JCalls");
@@ -6292,10 +6290,9 @@ uint64_t hash_LDKSocketDescriptor_jcall(const void* this_arg) {
        LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
        return js_invoke_function_0(j_calls->hash_meth);
 }
-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 (/*TODO: JS Object Reference */void* o) {
        LDKSocketDescriptor_JCalls *calls = MALLOC(sizeof(LDKSocketDescriptor_JCalls), "LDKSocketDescriptor_JCalls");
@@ -6308,7 +6305,7 @@ static inline LDKSocketDescriptor LDKSocketDescriptor_init (/*TODO: JS Object Re
                .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;
@@ -6364,10 +6361,9 @@ LDKCResult_NoneErrorZ persist_manager_LDKChannelManagerPersister_jcall(const voi
        ret_conv = CResult_NoneErrorZ_clone((LDKCResult_NoneErrorZ*)(((uint64_t)ret) & ~1));
        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 (/*TODO: JS Object Reference */void* o) {
        LDKChannelManagerPersister_JCalls *calls = MALLOC(sizeof(LDKChannelManagerPersister_JCalls), "LDKChannelManagerPersister_JCalls");
@@ -6422,12 +6418,14 @@ uint32_t __attribute__((visibility("default"))) TS_LDKFallback_ref_from_ptr(uint
 jstring  __attribute__((visibility("default"))) TS__ldk_get_compiled_version() {
        LDKStr ret_str = _ldk_get_compiled_version();
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
 jstring  __attribute__((visibility("default"))) TS__ldk_c_bindings_get_compiled_version() {
        LDKStr ret_str = _ldk_c_bindings_get_compiled_version();
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -6440,6 +6438,16 @@ void  __attribute__((visibility("default"))) TS_Transaction_free(int8_tArray _re
        Transaction_free(_res_ref);
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_TxOut_new(int8_tArray script_pubkey, int64_t value) {
+       LDKCVec_u8Z script_pubkey_ref;
+       script_pubkey_ref.datalen = *((uint32_t*)script_pubkey);
+       script_pubkey_ref.data = MALLOC(script_pubkey_ref.datalen, "LDKCVec_u8Z Bytes");
+       memcpy(script_pubkey_ref.data, (uint8_t*)(script_pubkey + 4), script_pubkey_ref.datalen);
+       LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
+       *ret_ref = TxOut_new(script_pubkey_ref, value);
+       return (uint64_t)ret_ref;
+}
+
 void  __attribute__((visibility("default"))) TS_TxOut_free(uint32_t _res) {
        if ((_res & 1) != 0) return;
        LDKTxOut _res_conv = *(LDKTxOut*)(((uint64_t)_res) & ~1);
@@ -10723,6 +10731,83 @@ uint32_t  __attribute__((visibility("default"))) TS_Event_clone(uint32_t orig) {
        return ret_ref;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_Event_funding_generation_ready(int8_tArray temporary_channel_id, int64_t channel_value_satoshis, int8_tArray output_script, int64_t user_channel_id) {
+       LDKThirtyTwoBytes temporary_channel_id_ref;
+       CHECK(*((uint32_t*)temporary_channel_id) == 32);
+       memcpy(temporary_channel_id_ref.data, (uint8_t*)(temporary_channel_id + 4), 32);
+       LDKCVec_u8Z output_script_ref;
+       output_script_ref.datalen = *((uint32_t*)output_script);
+       output_script_ref.data = MALLOC(output_script_ref.datalen, "LDKCVec_u8Z Bytes");
+       memcpy(output_script_ref.data, (uint8_t*)(output_script + 4), output_script_ref.datalen);
+       LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+       *ret_copy = Event_funding_generation_ready(temporary_channel_id_ref, channel_value_satoshis, output_script_ref, user_channel_id);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Event_payment_received(int8_tArray payment_hash, int8_tArray payment_preimage, int8_tArray payment_secret, int64_t amt, int64_t user_payment_id) {
+       LDKThirtyTwoBytes payment_hash_ref;
+       CHECK(*((uint32_t*)payment_hash) == 32);
+       memcpy(payment_hash_ref.data, (uint8_t*)(payment_hash + 4), 32);
+       LDKThirtyTwoBytes payment_preimage_ref;
+       CHECK(*((uint32_t*)payment_preimage) == 32);
+       memcpy(payment_preimage_ref.data, (uint8_t*)(payment_preimage + 4), 32);
+       LDKThirtyTwoBytes payment_secret_ref;
+       CHECK(*((uint32_t*)payment_secret) == 32);
+       memcpy(payment_secret_ref.data, (uint8_t*)(payment_secret + 4), 32);
+       LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+       *ret_copy = Event_payment_received(payment_hash_ref, payment_preimage_ref, payment_secret_ref, amt, user_payment_id);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Event_payment_sent(int8_tArray payment_preimage) {
+       LDKThirtyTwoBytes payment_preimage_ref;
+       CHECK(*((uint32_t*)payment_preimage) == 32);
+       memcpy(payment_preimage_ref.data, (uint8_t*)(payment_preimage + 4), 32);
+       LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+       *ret_copy = Event_payment_sent(payment_preimage_ref);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Event_payment_failed(int8_tArray payment_hash, jboolean rejected_by_dest) {
+       LDKThirtyTwoBytes payment_hash_ref;
+       CHECK(*((uint32_t*)payment_hash) == 32);
+       memcpy(payment_hash_ref.data, (uint8_t*)(payment_hash + 4), 32);
+       LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+       *ret_copy = Event_payment_failed(payment_hash_ref, rejected_by_dest);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Event_pending_htlcs_forwardable(int64_t time_forwardable) {
+       LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+       *ret_copy = Event_pending_htlcs_forwardable(time_forwardable);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Event_spendable_outputs(uint32_tArray outputs) {
+       LDKCVec_SpendableOutputDescriptorZ outputs_constr;
+       outputs_constr.datalen = *((uint32_t*)outputs);
+       if (outputs_constr.datalen > 0)
+               outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
+       else
+               outputs_constr.data = NULL;
+       uint32_t* outputs_vals = (uint32_t*)(outputs + 4);
+       for (size_t b = 0; b < outputs_constr.datalen; b++) {
+               uint32_t outputs_conv_27 = outputs_vals[b];
+               LDKSpendableOutputDescriptor outputs_conv_27_conv = *(LDKSpendableOutputDescriptor*)(((uint64_t)outputs_conv_27) & ~1);
+               outputs_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)(((uint64_t)outputs_conv_27) & ~1));
+               outputs_constr.data[b] = outputs_conv_27_conv;
+       }
+       LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
+       *ret_copy = Event_spendable_outputs(outputs_constr);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 int8_tArray  __attribute__((visibility("default"))) TS_Event_write(uint32_t obj) {
        LDKEvent* obj_conv = (LDKEvent*)obj;
        LDKCVec_u8Z ret_var = Event_write(obj_conv);
@@ -10747,6 +10832,272 @@ uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_clone(uint3
        return ret_ref;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_accept_channel(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKAcceptChannel msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = AcceptChannel_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_accept_channel(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_open_channel(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKOpenChannel msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = OpenChannel_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_open_channel(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_funding_created(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKFundingCreated msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = FundingCreated_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_funding_created(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_funding_signed(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKFundingSigned msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = FundingSigned_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_funding_signed(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_funding_locked(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKFundingLocked msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = FundingLocked_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_funding_locked(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_announcement_signatures(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKAnnouncementSignatures msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = AnnouncementSignatures_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_announcement_signatures(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_update_htlcs(int8_tArray node_id, uint32_t updates) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKCommitmentUpdate updates_conv;
+       updates_conv.inner = (void*)(updates & (~1));
+       updates_conv.is_owned = (updates & 1) || (updates == 0);
+       updates_conv = CommitmentUpdate_clone(&updates_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_update_htlcs(node_id_ref, updates_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_revoke_and_ack(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKRevokeAndACK msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = RevokeAndACK_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_revoke_and_ack(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_closing_signed(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKClosingSigned msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ClosingSigned_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_closing_signed(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_shutdown(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKShutdown msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = Shutdown_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_shutdown(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_channel_reestablish(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKChannelReestablish msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ChannelReestablish_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_channel_reestablish(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_broadcast_channel_announcement(uint32_t msg, uint32_t update_msg) {
+       LDKChannelAnnouncement msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ChannelAnnouncement_clone(&msg_conv);
+       LDKChannelUpdate update_msg_conv;
+       update_msg_conv.inner = (void*)(update_msg & (~1));
+       update_msg_conv.is_owned = (update_msg & 1) || (update_msg == 0);
+       update_msg_conv = ChannelUpdate_clone(&update_msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_broadcast_channel_announcement(msg_conv, update_msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_broadcast_node_announcement(uint32_t msg) {
+       LDKNodeAnnouncement msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = NodeAnnouncement_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_broadcast_node_announcement(msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_broadcast_channel_update(uint32_t msg) {
+       LDKChannelUpdate msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ChannelUpdate_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_broadcast_channel_update(msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_channel_update(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKChannelUpdate msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ChannelUpdate_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_channel_update(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_handle_error(int8_tArray node_id, uint32_t action) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKErrorAction action_conv = *(LDKErrorAction*)(((uint64_t)action) & ~1);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_handle_error(node_id_ref, action_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_payment_failure_network_update(uint32_t update) {
+       LDKHTLCFailChannelUpdate update_conv = *(LDKHTLCFailChannelUpdate*)(((uint64_t)update) & ~1);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_payment_failure_network_update(update_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_channel_range_query(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKQueryChannelRange msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = QueryChannelRange_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_channel_range_query(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_short_ids_query(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKQueryShortChannelIds msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = QueryShortChannelIds_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_short_ids_query(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MessageSendEvent_send_reply_channel_range(int8_tArray node_id, uint32_t msg) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKReplyChannelRange msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ReplyChannelRange_clone(&msg_conv);
+       LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
+       *ret_copy = MessageSendEvent_send_reply_channel_range(node_id_ref, msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 void  __attribute__((visibility("default"))) TS_MessageSendEventsProvider_free(uint32_t this_ptr) {
        if ((this_ptr & 1) != 0) return;
        LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(((uint64_t)this_ptr) & ~1);
@@ -10778,7 +11129,46 @@ void  __attribute__((visibility("default"))) TS_APIError_free(uint32_t this_ptr)
 uint32_t  __attribute__((visibility("default"))) TS_APIError_clone(uint32_t orig) {
        LDKAPIError* orig_conv = (LDKAPIError*)orig;
        LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
-       *ret_copy = APIError_clone(orig_conv);
+       *ret_copy = APIError_clone(orig_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_APIError_apimisuse_error(jstring err) {
+       LDKStr err_conv = str_ref_to_owned_c(err);
+       LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
+       *ret_copy = APIError_apimisuse_error(err_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_APIError_fee_rate_too_high(jstring err, int32_t feerate) {
+       LDKStr err_conv = str_ref_to_owned_c(err);
+       LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
+       *ret_copy = APIError_fee_rate_too_high(err_conv, feerate);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_APIError_route_error(jstring err) {
+       LDKStr err_conv = str_ref_to_owned_c(err);
+       LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
+       *ret_copy = APIError_route_error(err_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_APIError_channel_unavailable(jstring err) {
+       LDKStr err_conv = str_ref_to_owned_c(err);
+       LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
+       *ret_copy = APIError_channel_unavailable(err_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_APIError_monitor_update_failed() {
+       LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
+       *ret_copy = APIError_monitor_update_failed();
        uint64_t ret_ref = (uint64_t)ret_copy;
        return ret_ref;
 }
@@ -10824,6 +11214,31 @@ uint32_t  __attribute__((visibility("default"))) TS_Level_clone(uint32_t orig) {
        return ret_conv;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_Level_trace() {
+       uint32_t ret_conv = LDKLevel_to_js(Level_trace());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Level_debug() {
+       uint32_t ret_conv = LDKLevel_to_js(Level_debug());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Level_info() {
+       uint32_t ret_conv = LDKLevel_to_js(Level_info());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Level_warn() {
+       uint32_t ret_conv = LDKLevel_to_js(Level_warn());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Level_error() {
+       uint32_t ret_conv = LDKLevel_to_js(Level_error());
+       return ret_conv;
+}
+
 jboolean  __attribute__((visibility("default"))) TS_Level_eq(uint32_t a, uint32_t b) {
        LDKLevel* a_conv = (LDKLevel*)(a & ~1);
        LDKLevel* b_conv = (LDKLevel*)(b & ~1);
@@ -11453,6 +11868,16 @@ uint32_t  __attribute__((visibility("default"))) TS_AccessError_clone(uint32_t o
        return ret_conv;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_AccessError_unknown_chain() {
+       uint32_t ret_conv = LDKAccessError_to_js(AccessError_unknown_chain());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_AccessError_unknown_tx() {
+       uint32_t ret_conv = LDKAccessError_to_js(AccessError_unknown_tx());
+       return ret_conv;
+}
+
 void  __attribute__((visibility("default"))) TS_Access_free(uint32_t this_ptr) {
        if ((this_ptr & 1) != 0) return;
        LDKAccess this_ptr_conv = *(LDKAccess*)(((uint64_t)this_ptr) & ~1);
@@ -11617,6 +12042,21 @@ uint32_t  __attribute__((visibility("default"))) TS_ConfirmationTarget_clone(uin
        return ret_conv;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_ConfirmationTarget_background() {
+       uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_background());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_ConfirmationTarget_normal() {
+       uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_normal());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_ConfirmationTarget_high_priority() {
+       uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_high_priority());
+       return ret_conv;
+}
+
 void  __attribute__((visibility("default"))) TS_FeeEstimator_free(uint32_t this_ptr) {
        if ((this_ptr & 1) != 0) return;
        LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)(((uint64_t)this_ptr) & ~1);
@@ -11751,6 +12191,16 @@ uint32_t  __attribute__((visibility("default"))) TS_ChannelMonitorUpdateErr_clon
        return ret_conv;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_ChannelMonitorUpdateErr_temporary_failure() {
+       uint32_t ret_conv = LDKChannelMonitorUpdateErr_to_js(ChannelMonitorUpdateErr_temporary_failure());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_ChannelMonitorUpdateErr_permanent_failure() {
+       uint32_t ret_conv = LDKChannelMonitorUpdateErr_to_js(ChannelMonitorUpdateErr_permanent_failure());
+       return ret_conv;
+}
+
 void  __attribute__((visibility("default"))) TS_MonitorUpdateError_free(uint32_t this_obj) {
        LDKMonitorUpdateError this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
@@ -11787,6 +12237,28 @@ uint32_t  __attribute__((visibility("default"))) TS_MonitorEvent_clone(uint32_t
        return ret_ref;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_MonitorEvent_htlcevent(uint32_t a) {
+       LDKHTLCUpdate a_conv;
+       a_conv.inner = (void*)(a & (~1));
+       a_conv.is_owned = (a & 1) || (a == 0);
+       a_conv = HTLCUpdate_clone(&a_conv);
+       LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
+       *ret_copy = MonitorEvent_htlcevent(a_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_MonitorEvent_commitment_tx_broadcasted(uint32_t a) {
+       LDKOutPoint a_conv;
+       a_conv.inner = (void*)(a & (~1));
+       a_conv.is_owned = (a & 1) || (a == 0);
+       a_conv = OutPoint_clone(&a_conv);
+       LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
+       *ret_copy = MonitorEvent_commitment_tx_broadcasted(a_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 void  __attribute__((visibility("default"))) TS_HTLCUpdate_free(uint32_t this_obj) {
        LDKHTLCUpdate this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
@@ -12584,6 +13056,40 @@ uint32_t  __attribute__((visibility("default"))) TS_SpendableOutputDescriptor_cl
        return ret_ref;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_SpendableOutputDescriptor_static_output(uint32_t outpoint, uint32_t output) {
+       LDKOutPoint outpoint_conv;
+       outpoint_conv.inner = (void*)(outpoint & (~1));
+       outpoint_conv.is_owned = (outpoint & 1) || (outpoint == 0);
+       outpoint_conv = OutPoint_clone(&outpoint_conv);
+       LDKTxOut output_conv = *(LDKTxOut*)(((uint64_t)output) & ~1);
+       LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
+       *ret_copy = SpendableOutputDescriptor_static_output(outpoint_conv, output_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SpendableOutputDescriptor_delayed_payment_output(uint32_t a) {
+       LDKDelayedPaymentOutputDescriptor a_conv;
+       a_conv.inner = (void*)(a & (~1));
+       a_conv.is_owned = (a & 1) || (a == 0);
+       a_conv = DelayedPaymentOutputDescriptor_clone(&a_conv);
+       LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
+       *ret_copy = SpendableOutputDescriptor_delayed_payment_output(a_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SpendableOutputDescriptor_static_payment_output(uint32_t a) {
+       LDKStaticPaymentOutputDescriptor a_conv;
+       a_conv.inner = (void*)(a & (~1));
+       a_conv.is_owned = (a & 1) || (a == 0);
+       a_conv = StaticPaymentOutputDescriptor_clone(&a_conv);
+       LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
+       *ret_copy = SpendableOutputDescriptor_static_payment_output(a_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 int8_tArray  __attribute__((visibility("default"))) TS_SpendableOutputDescriptor_write(uint32_t obj) {
        LDKSpendableOutputDescriptor* obj_conv = (LDKSpendableOutputDescriptor*)obj;
        LDKCVec_u8Z ret_var = SpendableOutputDescriptor_write(obj_conv);
@@ -13511,6 +14017,74 @@ uint32_t  __attribute__((visibility("default"))) TS_PaymentSendFailure_clone(uin
        return ret_ref;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_PaymentSendFailure_parameter_error(uint32_t a) {
+       LDKAPIError a_conv = *(LDKAPIError*)(((uint64_t)a) & ~1);
+       LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
+       *ret_copy = PaymentSendFailure_parameter_error(a_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_PaymentSendFailure_path_parameter_error(uint32_tArray a) {
+       LDKCVec_CResult_NoneAPIErrorZZ a_constr;
+       a_constr.datalen = *((uint32_t*)a);
+       if (a_constr.datalen > 0)
+               a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
+       else
+               a_constr.data = NULL;
+       uint32_t* a_vals = (uint32_t*)(a + 4);
+       for (size_t w = 0; w < a_constr.datalen; w++) {
+               uint32_t a_conv_22 = a_vals[w];
+               LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1);
+               a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1));
+               a_constr.data[w] = a_conv_22_conv;
+       }
+       LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
+       *ret_copy = PaymentSendFailure_path_parameter_error(a_constr);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_PaymentSendFailure_all_failed_retry_safe(uint32_tArray a) {
+       LDKCVec_APIErrorZ a_constr;
+       a_constr.datalen = *((uint32_t*)a);
+       if (a_constr.datalen > 0)
+               a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements");
+       else
+               a_constr.data = NULL;
+       uint32_t* a_vals = (uint32_t*)(a + 4);
+       for (size_t k = 0; k < a_constr.datalen; k++) {
+               uint32_t a_conv_10 = a_vals[k];
+               LDKAPIError a_conv_10_conv = *(LDKAPIError*)(((uint64_t)a_conv_10) & ~1);
+               a_conv_10_conv = APIError_clone((LDKAPIError*)(((uint64_t)a_conv_10) & ~1));
+               a_constr.data[k] = a_conv_10_conv;
+       }
+       LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
+       *ret_copy = PaymentSendFailure_all_failed_retry_safe(a_constr);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_PaymentSendFailure_partial_failure(uint32_tArray a) {
+       LDKCVec_CResult_NoneAPIErrorZZ a_constr;
+       a_constr.datalen = *((uint32_t*)a);
+       if (a_constr.datalen > 0)
+               a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
+       else
+               a_constr.data = NULL;
+       uint32_t* a_vals = (uint32_t*)(a + 4);
+       for (size_t w = 0; w < a_constr.datalen; w++) {
+               uint32_t a_conv_22 = a_vals[w];
+               LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1);
+               a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)(((uint64_t)a_conv_22) & ~1));
+               a_constr.data[w] = a_conv_22_conv;
+       }
+       LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
+       *ret_copy = PaymentSendFailure_partial_failure(a_constr);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 uint32_t  __attribute__((visibility("default"))) TS_ChannelManager_new(uint32_t fee_est, uint32_t chain_monitor, uint32_t tx_broadcaster, uint32_t logger, uint32_t keys_manager, uint32_t config, uint32_t params) {
        LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(((uint64_t)fee_est) & ~1);
        LDKWatch chain_monitor_conv = *(LDKWatch*)(((uint64_t)chain_monitor) & ~1);
@@ -14138,6 +14712,7 @@ jstring  __attribute__((visibility("default"))) TS_ErrorMessage_get_data(uint32_
        this_ptr_conv.is_owned = false;
        LDKStr ret_str = ErrorMessage_get_data(&this_ptr_conv);
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -16176,6 +16751,46 @@ uint32_t  __attribute__((visibility("default"))) TS_NetAddress_clone(uint32_t or
        return ret_ref;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_NetAddress_ipv4(int8_tArray addr, int16_t port) {
+       LDKFourBytes addr_ref;
+       CHECK(*((uint32_t*)addr) == 4);
+       memcpy(addr_ref.data, (uint8_t*)(addr + 4), 4);
+       LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
+       *ret_copy = NetAddress_ipv4(addr_ref, port);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_NetAddress_ipv6(int8_tArray addr, int16_t port) {
+       LDKSixteenBytes addr_ref;
+       CHECK(*((uint32_t*)addr) == 16);
+       memcpy(addr_ref.data, (uint8_t*)(addr + 4), 16);
+       LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
+       *ret_copy = NetAddress_ipv6(addr_ref, port);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_NetAddress_onion_v2(int8_tArray addr, int16_t port) {
+       LDKTenBytes addr_ref;
+       CHECK(*((uint32_t*)addr) == 10);
+       memcpy(addr_ref.data, (uint8_t*)(addr + 4), 10);
+       LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
+       *ret_copy = NetAddress_onion_v2(addr_ref, port);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_NetAddress_onion_v3(int8_tArray ed25519_pubkey, int16_t checksum, int8_t version, int16_t port) {
+       LDKThirtyTwoBytes ed25519_pubkey_ref;
+       CHECK(*((uint32_t*)ed25519_pubkey) == 32);
+       memcpy(ed25519_pubkey_ref.data, (uint8_t*)(ed25519_pubkey + 4), 32);
+       LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
+       *ret_copy = NetAddress_onion_v3(ed25519_pubkey_ref, checksum, version, port);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 int8_tArray  __attribute__((visibility("default"))) TS_NetAddress_write(uint32_t obj) {
        LDKNetAddress* obj_conv = (LDKNetAddress*)obj;
        LDKCVec_u8Z ret_var = NetAddress_write(obj_conv);
@@ -17420,6 +18035,43 @@ uint32_t  __attribute__((visibility("default"))) TS_ErrorAction_clone(uint32_t o
        return ret_ref;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_ErrorAction_disconnect_peer(uint32_t msg) {
+       LDKErrorMessage msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ErrorMessage_clone(&msg_conv);
+       LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
+       *ret_copy = ErrorAction_disconnect_peer(msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_ErrorAction_ignore_error() {
+       LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
+       *ret_copy = ErrorAction_ignore_error();
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_ErrorAction_ignore_and_log(uint32_t a) {
+       LDKLevel a_conv = LDKLevel_from_js(a);
+       LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
+       *ret_copy = ErrorAction_ignore_and_log(a_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_ErrorAction_send_error_message(uint32_t msg) {
+       LDKErrorMessage msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ErrorMessage_clone(&msg_conv);
+       LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
+       *ret_copy = ErrorAction_send_error_message(msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 void  __attribute__((visibility("default"))) TS_LightningError_free(uint32_t this_obj) {
        LDKLightningError this_obj_conv;
        this_obj_conv.inner = (void*)(this_obj & (~1));
@@ -17433,6 +18085,7 @@ jstring  __attribute__((visibility("default"))) TS_LightningError_get_err(uint32
        this_ptr_conv.is_owned = false;
        LDKStr ret_str = LightningError_get_err(&this_ptr_conv);
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -17742,6 +18395,34 @@ uint32_t  __attribute__((visibility("default"))) TS_HTLCFailChannelUpdate_clone(
        return ret_ref;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_HTLCFailChannelUpdate_channel_update_message(uint32_t msg) {
+       LDKChannelUpdate msg_conv;
+       msg_conv.inner = (void*)(msg & (~1));
+       msg_conv.is_owned = (msg & 1) || (msg == 0);
+       msg_conv = ChannelUpdate_clone(&msg_conv);
+       LDKHTLCFailChannelUpdate *ret_copy = MALLOC(sizeof(LDKHTLCFailChannelUpdate), "LDKHTLCFailChannelUpdate");
+       *ret_copy = HTLCFailChannelUpdate_channel_update_message(msg_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_HTLCFailChannelUpdate_channel_closed(int64_t short_channel_id, jboolean is_permanent) {
+       LDKHTLCFailChannelUpdate *ret_copy = MALLOC(sizeof(LDKHTLCFailChannelUpdate), "LDKHTLCFailChannelUpdate");
+       *ret_copy = HTLCFailChannelUpdate_channel_closed(short_channel_id, is_permanent);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_HTLCFailChannelUpdate_node_failure(int8_tArray node_id, jboolean is_permanent) {
+       LDKPublicKey node_id_ref;
+       CHECK(*((uint32_t*)node_id) == 33);
+       memcpy(node_id_ref.compressed_form, (uint8_t*)(node_id + 4), 33);
+       LDKHTLCFailChannelUpdate *ret_copy = MALLOC(sizeof(LDKHTLCFailChannelUpdate), "LDKHTLCFailChannelUpdate");
+       *ret_copy = HTLCFailChannelUpdate_node_failure(node_id_ref, is_permanent);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 void  __attribute__((visibility("default"))) TS_ChannelMessageHandler_free(uint32_t this_ptr) {
        if ((this_ptr & 1) != 0) return;
        LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)(((uint64_t)this_ptr) & ~1);
@@ -20923,18 +21604,22 @@ uint32_t  __attribute__((visibility("default"))) TS_get_route(int8_tArray our_no
        payee_features_conv.is_owned = (payee_features & 1) || (payee_features == 0);
        payee_features_conv = InvoiceFeatures_clone(&payee_features_conv);
        LDKCVec_ChannelDetailsZ first_hops_constr;
-       first_hops_constr.datalen = *((uint32_t*)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;
-       uint32_t* first_hops_vals = (uint32_t*)(first_hops + 4);
-       for (size_t q = 0; q < first_hops_constr.datalen; q++) {
-               uint32_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;
+       LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
+       if (first_hops != 0) {
+               first_hops_constr.datalen = *((uint32_t*)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;
+               uint32_t* first_hops_vals = (uint32_t*)(first_hops + 4);
+               for (size_t q = 0; q < first_hops_constr.datalen; q++) {
+                       uint32_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;
+               }
+               first_hops_ptr = &first_hops_constr;
        }
        LDKCVec_RouteHintZ last_hops_constr;
        last_hops_constr.datalen = *((uint32_t*)last_hops);
@@ -20953,8 +21638,8 @@ uint32_t  __attribute__((visibility("default"))) TS_get_route(int8_tArray our_no
        }
        LDKLogger logger_conv = *(LDKLogger*)(((uint64_t)logger) & ~1);
        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);
-       FREE(first_hops_constr.data);
+       *ret_conv = get_route(our_node_id_ref, &network_conv, payee_ref, payee_features_conv, first_hops_ptr, last_hops_constr, final_value_msat, final_cltv, logger_conv);
+       if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
        return (uint64_t)ret_conv;
 }
 
@@ -22103,6 +22788,7 @@ jstring  __attribute__((visibility("default"))) TS_FilesystemPersister_get_data_
        this_arg_conv.is_owned = false;
        LDKStr ret_str = FilesystemPersister_get_data_dir(&this_arg_conv);
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -22402,6 +23088,26 @@ uint32_t  __attribute__((visibility("default"))) TS_SiPrefix_clone(uint32_t orig
        return ret_conv;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_SiPrefix_milli() {
+       uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_milli());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SiPrefix_micro() {
+       uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_micro());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SiPrefix_nano() {
+       uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_nano());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SiPrefix_pico() {
+       uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_pico());
+       return ret_conv;
+}
+
 jboolean  __attribute__((visibility("default"))) TS_SiPrefix_eq(uint32_t a, uint32_t b) {
        LDKSiPrefix* a_conv = (LDKSiPrefix*)(a & ~1);
        LDKSiPrefix* b_conv = (LDKSiPrefix*)(b & ~1);
@@ -22421,6 +23127,31 @@ uint32_t  __attribute__((visibility("default"))) TS_Currency_clone(uint32_t orig
        return ret_conv;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_Currency_bitcoin() {
+       uint32_t ret_conv = LDKCurrency_to_js(Currency_bitcoin());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Currency_bitcoin_testnet() {
+       uint32_t ret_conv = LDKCurrency_to_js(Currency_bitcoin_testnet());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Currency_regtest() {
+       uint32_t ret_conv = LDKCurrency_to_js(Currency_regtest());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Currency_simnet() {
+       uint32_t ret_conv = LDKCurrency_to_js(Currency_simnet());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Currency_signet() {
+       uint32_t ret_conv = LDKCurrency_to_js(Currency_signet());
+       return ret_conv;
+}
+
 jboolean  __attribute__((visibility("default"))) TS_Currency_eq(uint32_t a, uint32_t b) {
        LDKCurrency* a_conv = (LDKCurrency*)(a & ~1);
        LDKCurrency* b_conv = (LDKCurrency*)(b & ~1);
@@ -22603,6 +23334,38 @@ uint32_t  __attribute__((visibility("default"))) TS_Fallback_clone(uint32_t orig
        return ret_ref;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_Fallback_seg_wit_program(int8_t version, int8_tArray program) {
+       
+       LDKCVec_u8Z program_ref;
+       program_ref.datalen = *((uint32_t*)program);
+       program_ref.data = MALLOC(program_ref.datalen, "LDKCVec_u8Z Bytes");
+       memcpy(program_ref.data, (uint8_t*)(program + 4), program_ref.datalen);
+       LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
+       *ret_copy = Fallback_seg_wit_program((LDKu5){ ._0 = version }, program_ref);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Fallback_pub_key_hash(int8_tArray a) {
+       LDKTwentyBytes a_ref;
+       CHECK(*((uint32_t*)a) == 20);
+       memcpy(a_ref.data, (uint8_t*)(a + 4), 20);
+       LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
+       *ret_copy = Fallback_pub_key_hash(a_ref);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_Fallback_script_hash(int8_tArray a) {
+       LDKTwentyBytes a_ref;
+       CHECK(*((uint32_t*)a) == 20);
+       memcpy(a_ref.data, (uint8_t*)(a + 4), 20);
+       LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
+       *ret_copy = Fallback_script_hash(a_ref);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 jboolean  __attribute__((visibility("default"))) TS_Fallback_eq(uint32_t a, uint32_t b) {
        LDKFallback* a_conv = (LDKFallback*)a;
        LDKFallback* b_conv = (LDKFallback*)b;
@@ -23103,6 +23866,7 @@ jstring  __attribute__((visibility("default"))) TS_Description_into_inner(uint32
        this_arg_conv = Description_clone(&this_arg_conv);
        LDKStr ret_str = Description_into_inner(this_arg_conv);
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -23165,6 +23929,26 @@ uint32_t  __attribute__((visibility("default"))) TS_CreationError_clone(uint32_t
        return ret_conv;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_CreationError_description_too_long() {
+       uint32_t ret_conv = LDKCreationError_to_js(CreationError_description_too_long());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_CreationError_route_too_long() {
+       uint32_t ret_conv = LDKCreationError_to_js(CreationError_route_too_long());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_CreationError_timestamp_out_of_bounds() {
+       uint32_t ret_conv = LDKCreationError_to_js(CreationError_timestamp_out_of_bounds());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_CreationError_expiry_time_out_of_bounds() {
+       uint32_t ret_conv = LDKCreationError_to_js(CreationError_expiry_time_out_of_bounds());
+       return ret_conv;
+}
+
 jboolean  __attribute__((visibility("default"))) TS_CreationError_eq(uint32_t a, uint32_t b) {
        LDKCreationError* a_conv = (LDKCreationError*)(a & ~1);
        LDKCreationError* b_conv = (LDKCreationError*)(b & ~1);
@@ -23176,6 +23960,7 @@ jstring  __attribute__((visibility("default"))) TS_CreationError_to_str(uint32_t
        LDKCreationError* o_conv = (LDKCreationError*)(o & ~1);
        LDKStr ret_str = CreationError_to_str(o_conv);
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -23185,6 +23970,46 @@ uint32_t  __attribute__((visibility("default"))) TS_SemanticError_clone(uint32_t
        return ret_conv;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_SemanticError_no_payment_hash() {
+       uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_no_payment_hash());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SemanticError_multiple_payment_hashes() {
+       uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_multiple_payment_hashes());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SemanticError_no_description() {
+       uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_no_description());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SemanticError_multiple_descriptions() {
+       uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_multiple_descriptions());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SemanticError_multiple_payment_secrets() {
+       uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_multiple_payment_secrets());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SemanticError_invalid_features() {
+       uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_invalid_features());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SemanticError_invalid_recovery_id() {
+       uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_invalid_recovery_id());
+       return ret_conv;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SemanticError_invalid_signature() {
+       uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_invalid_signature());
+       return ret_conv;
+}
+
 jboolean  __attribute__((visibility("default"))) TS_SemanticError_eq(uint32_t a, uint32_t b) {
        LDKSemanticError* a_conv = (LDKSemanticError*)(a & ~1);
        LDKSemanticError* b_conv = (LDKSemanticError*)(b & ~1);
@@ -23196,6 +24021,7 @@ jstring  __attribute__((visibility("default"))) TS_SemanticError_to_str(uint32_t
        LDKSemanticError* o_conv = (LDKSemanticError*)(o & ~1);
        LDKStr ret_str = SemanticError_to_str(o_conv);
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -23214,6 +24040,21 @@ uint32_t  __attribute__((visibility("default"))) TS_SignOrCreationError_clone(ui
        return ret_ref;
 }
 
+uint32_t  __attribute__((visibility("default"))) TS_SignOrCreationError_sign_error() {
+       LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
+       *ret_copy = SignOrCreationError_sign_error();
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
+uint32_t  __attribute__((visibility("default"))) TS_SignOrCreationError_creation_error(uint32_t a) {
+       LDKCreationError a_conv = LDKCreationError_from_js(a);
+       LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
+       *ret_copy = SignOrCreationError_creation_error(a_conv);
+       uint64_t ret_ref = (uint64_t)ret_copy;
+       return ret_ref;
+}
+
 jboolean  __attribute__((visibility("default"))) TS_SignOrCreationError_eq(uint32_t a, uint32_t b) {
        LDKSignOrCreationError* a_conv = (LDKSignOrCreationError*)a;
        LDKSignOrCreationError* b_conv = (LDKSignOrCreationError*)b;
@@ -23225,6 +24066,7 @@ jstring  __attribute__((visibility("default"))) TS_SignOrCreationError_to_str(ui
        LDKSignOrCreationError* o_conv = (LDKSignOrCreationError*)o;
        LDKStr ret_str = SignOrCreationError_to_str(o_conv);
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -23268,6 +24110,7 @@ jstring  __attribute__((visibility("default"))) TS_Invoice_to_str(uint32_t o) {
        o_conv.is_owned = false;
        LDKStr ret_str = Invoice_to_str(&o_conv);
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -23277,6 +24120,7 @@ jstring  __attribute__((visibility("default"))) TS_SignedRawInvoice_to_str(uint3
        o_conv.is_owned = false;
        LDKStr ret_str = SignedRawInvoice_to_str(&o_conv);
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -23284,6 +24128,7 @@ jstring  __attribute__((visibility("default"))) TS_Currency_to_str(uint32_t o) {
        LDKCurrency* o_conv = (LDKCurrency*)(o & ~1);
        LDKStr ret_str = Currency_to_str(o_conv);
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
@@ -23291,6 +24136,7 @@ jstring  __attribute__((visibility("default"))) TS_SiPrefix_to_str(uint32_t o) {
        LDKSiPrefix* o_conv = (LDKSiPrefix*)(o & ~1);
        LDKStr ret_str = SiPrefix_to_str(o_conv);
        jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
+       Str_free(ret_str);
        return ret_conv;
 }
 
index 055daec02ed2d9225ea6fa2115f2209d5cb0429c..615aad462119f18fa5ccfc1036271cad5c98e0b9 100644 (file)
@@ -152,6 +152,22 @@ public static native long new_empty_slice_vec();
 */
 
        public static native long LDKCVec_u8Z_new(number[] elems);
+       // struct LDKCVec_u8Z TxOut_get_script_pubkey (struct LDKTxOut* thing)
+       export function TxOut_get_script_pubkey(thing: number): Uint8Array {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.TxOut_get_script_pubkey(thing);
+               return decodeArray(nativeResponseValue);
+       }
+       // uint64_t TxOut_get_value (struct LDKTxOut* thing)
+       export function TxOut_get_value(thing: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.TxOut_get_value(thing);
+               return nativeResponseValue;
+       }
        public static native boolean LDKCResult_SecretKeyErrorZ_result_ok(long arg);
        public static native Uint8Array LDKCResult_SecretKeyErrorZ_get_ok(long arg);
        public static native Secp256k1Error LDKCResult_SecretKeyErrorZ_get_err(long arg);
@@ -1870,6 +1886,14 @@ public static native long new_empty_slice_vec();
                const nativeResponseValue = wasm.Transaction_free(encodeArray(_res));
                // debug statements here
        }
+       // struct LDKTxOut TxOut_new(struct LDKCVec_u8Z script_pubkey, uint64_t value);
+       export function TxOut_new(script_pubkey: Uint8Array, value: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.TxOut_new(encodeArray(script_pubkey), value);
+               return nativeResponseValue;
+       }
        // void TxOut_free(struct LDKTxOut _res);
        export function TxOut_free(_res: number): void {
                if(!isWasmInitialized) {
@@ -5726,6 +5750,54 @@ public static native long new_empty_slice_vec();
                const nativeResponseValue = wasm.Event_clone(orig);
                return nativeResponseValue;
        }
+       // struct LDKEvent Event_funding_generation_ready(struct LDKThirtyTwoBytes temporary_channel_id, uint64_t channel_value_satoshis, struct LDKCVec_u8Z output_script, uint64_t user_channel_id);
+       export function Event_funding_generation_ready(temporary_channel_id: Uint8Array, channel_value_satoshis: number, output_script: Uint8Array, user_channel_id: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.Event_funding_generation_ready(encodeArray(temporary_channel_id), channel_value_satoshis, encodeArray(output_script), user_channel_id);
+               return nativeResponseValue;
+       }
+       // struct LDKEvent Event_payment_received(struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_secret, uint64_t amt, uint64_t user_payment_id);
+       export function Event_payment_received(payment_hash: Uint8Array, payment_preimage: Uint8Array, payment_secret: Uint8Array, amt: number, user_payment_id: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.Event_payment_received(encodeArray(payment_hash), encodeArray(payment_preimage), encodeArray(payment_secret), amt, user_payment_id);
+               return nativeResponseValue;
+       }
+       // struct LDKEvent Event_payment_sent(struct LDKThirtyTwoBytes payment_preimage);
+       export function Event_payment_sent(payment_preimage: Uint8Array): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.Event_payment_sent(encodeArray(payment_preimage));
+               return nativeResponseValue;
+       }
+       // struct LDKEvent Event_payment_failed(struct LDKThirtyTwoBytes payment_hash, bool rejected_by_dest);
+       export function Event_payment_failed(payment_hash: Uint8Array, rejected_by_dest: boolean): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.Event_payment_failed(encodeArray(payment_hash), rejected_by_dest);
+               return nativeResponseValue;
+       }
+       // struct LDKEvent Event_pending_htlcs_forwardable(uint64_t time_forwardable);
+       export function Event_pending_htlcs_forwardable(time_forwardable: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.Event_pending_htlcs_forwardable(time_forwardable);
+               return nativeResponseValue;
+       }
+       // struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs);
+       export function Event_spendable_outputs(outputs: number[]): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.Event_spendable_outputs(outputs);
+               return nativeResponseValue;
+       }
        // struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj);
        export function Event_write(obj: number): Uint8Array {
                if(!isWasmInitialized) {
@@ -5750,6 +5822,166 @@ public static native long new_empty_slice_vec();
                const nativeResponseValue = wasm.MessageSendEvent_clone(orig);
                return nativeResponseValue;
        }
+       // struct LDKMessageSendEvent MessageSendEvent_send_accept_channel(struct LDKPublicKey node_id, struct LDKAcceptChannel msg);
+       export function MessageSendEvent_send_accept_channel(node_id: Uint8Array, msg: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.MessageSendEvent_send_accept_channel(encodeArray(node_id), msg);
+               return nativeResponseValue;
+       }
+       // struct LDKMessageSendEvent MessageSendEvent_send_open_channel(struct LDKPublicKey node_id, struct LDKOpenChannel msg);
+       export function MessageSendEvent_send_open_channel(node_id: Uint8Array, msg: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.MessageSendEvent_send_open_channel(encodeArray(node_id), msg);
+               return nativeResponseValue;
+       }
+       // struct LDKMessageSendEvent MessageSendEvent_send_funding_created(struct LDKPublicKey node_id, struct LDKFundingCreated msg);
+       export function MessageSendEvent_send_funding_created(node_id: Uint8Array, msg: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.MessageSendEvent_send_funding_created(encodeArray(node_id), msg);
+               return nativeResponseValue;
+       }
+       // struct LDKMessageSendEvent MessageSendEvent_send_funding_signed(struct LDKPublicKey node_id, struct LDKFundingSigned msg);
+       export function MessageSendEvent_send_funding_signed(node_id: Uint8Array, msg: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.MessageSendEvent_send_funding_signed(encodeArray(node_id), msg);
+               return nativeResponseValue;
+       }
+       // struct LDKMessageSendEvent MessageSendEvent_send_funding_locked(struct LDKPublicKey node_id, struct LDKFundingLocked msg);
+       export function MessageSendEvent_send_funding_locked(node_id: Uint8Array, msg: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.MessageSendEvent_send_funding_locked(encodeArray(node_id), msg);
+               return nativeResponseValue;
+       }
+       // struct LDKMessageSendEvent MessageSendEvent_send_announcement_signatures(struct LDKPublicKey node_id, struct LDKAnnouncementSignatures msg);
+       export function MessageSendEvent_send_announcement_signatures(node_id: Uint8Array, msg: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.MessageSendEvent_send_announcement_signatures(encodeArray(node_id), msg);
+               return nativeResponseValue;
+       }
+       // struct LDKMessageSendEvent MessageSendEvent_update_htlcs(struct LDKPublicKey node_id, struct LDKCommitmentUpdate updates);
+       export function MessageSendEvent_update_htlcs(node_id: Uint8Array, updates: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.MessageSendEvent_update_htlcs(encodeArray(node_id), updates);
+               return nativeResponseValue;
+       }
+       // struct LDKMessageSendEvent MessageSendEvent_send_revoke_and_ack(struct LDKPublicKey node_id, struct LDKRevokeAndACK msg);
+       export function MessageSendEvent_send_revoke_and_ack(node_id: Uint8Array, msg: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.MessageSendEvent_send_revoke_and_ack(encodeArray(node_id), msg);
+               return nativeResponseValue;
+       }
+       // struct LDKMessageSendEvent MessageSendEvent_send_closing_signed(struct LDKPublicKey node_id, struct LDKClosingSigned msg);
+       export function MessageSendEvent_send_closing_signed(node_id: Uint8Array, msg: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.MessageSendEvent_send_closing_signed(encodeArray(node_id), msg);
+               return nativeResponseValue;
+       }
+       // struct LDKMessageSendEvent MessageSendEvent_send_shutdown(struct LDKPublicKey node_id, struct LDKShutdown msg);
+       export function MessageSendEvent_send_shutdown(node_id: Uint8Array, msg: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.MessageSendEvent_send_shutdown(encodeArray(node_id), msg);
+               return nativeResponseValue;
+       }
+       // struct LDKMessageSendEvent MessageSendEvent_send_channel_reestablish(struct LDKPublicKey node_id, struct LDKChannelReestablish msg);
+       export function MessageSendEvent_send_channel_reestablish(node_id: Uint8Array, msg: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.MessageSendEvent_send_channel_reestablish(encodeArray(node_id), msg);
+               return nativeResponseValue;
+       }
+       // struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_announcement(struct LDKChannelAnnouncement msg, struct LDKChannelUpdate update_msg);
+       export function MessageSendEvent_broadcast_channel_announcement(msg: number, update_msg: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.MessageSendEvent_broadcast_channel_announcement(msg, update_msg);
+               return nativeResponseValue;
+       }
+       // struct LDKMessageSendEvent MessageSendEvent_broadcast_node_announcement(struct LDKNodeAnnouncement msg);
+       export function MessageSendEvent_broadcast_node_announcement(msg: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.MessageSendEvent_broadcast_node_announcement(msg);
+               return nativeResponseValue;
+       }
+       // struct LDKMessageSendEvent MessageSendEvent_broadcast_channel_update(struct LDKChannelUpdate msg);
+       export function MessageSendEvent_broadcast_channel_update(msg: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.MessageSendEvent_broadcast_channel_update(msg);
+               return nativeResponseValue;
+       }
+       // struct LDKMessageSendEvent MessageSendEvent_send_channel_update(struct LDKPublicKey node_id, struct LDKChannelUpdate msg);
+       export function MessageSendEvent_send_channel_update(node_id: Uint8Array, msg: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.MessageSendEvent_send_channel_update(encodeArray(node_id), msg);
+               return nativeResponseValue;
+       }
+       // struct LDKMessageSendEvent MessageSendEvent_handle_error(struct LDKPublicKey node_id, struct LDKErrorAction action);
+       export function MessageSendEvent_handle_error(node_id: Uint8Array, action: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.MessageSendEvent_handle_error(encodeArray(node_id), action);
+               return nativeResponseValue;
+       }
+       // struct LDKMessageSendEvent MessageSendEvent_payment_failure_network_update(struct LDKHTLCFailChannelUpdate update);
+       export function MessageSendEvent_payment_failure_network_update(update: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.MessageSendEvent_payment_failure_network_update(update);
+               return nativeResponseValue;
+       }
+       // struct LDKMessageSendEvent MessageSendEvent_send_channel_range_query(struct LDKPublicKey node_id, struct LDKQueryChannelRange msg);
+       export function MessageSendEvent_send_channel_range_query(node_id: Uint8Array, msg: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.MessageSendEvent_send_channel_range_query(encodeArray(node_id), msg);
+               return nativeResponseValue;
+       }
+       // struct LDKMessageSendEvent MessageSendEvent_send_short_ids_query(struct LDKPublicKey node_id, struct LDKQueryShortChannelIds msg);
+       export function MessageSendEvent_send_short_ids_query(node_id: Uint8Array, msg: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.MessageSendEvent_send_short_ids_query(encodeArray(node_id), msg);
+               return nativeResponseValue;
+       }
+       // struct LDKMessageSendEvent MessageSendEvent_send_reply_channel_range(struct LDKPublicKey node_id, struct LDKReplyChannelRange msg);
+       export function MessageSendEvent_send_reply_channel_range(node_id: Uint8Array, msg: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.MessageSendEvent_send_reply_channel_range(encodeArray(node_id), msg);
+               return nativeResponseValue;
+       }
        // void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr);
        export function MessageSendEventsProvider_free(this_ptr: number): void {
                if(!isWasmInitialized) {
@@ -5790,6 +6022,46 @@ public static native long new_empty_slice_vec();
                const nativeResponseValue = wasm.APIError_clone(orig);
                return nativeResponseValue;
        }
+       // struct LDKAPIError APIError_apimisuse_error(struct LDKStr err);
+       export function APIError_apimisuse_error(err: String): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.APIError_apimisuse_error(err);
+               return nativeResponseValue;
+       }
+       // struct LDKAPIError APIError_fee_rate_too_high(struct LDKStr err, uint32_t feerate);
+       export function APIError_fee_rate_too_high(err: String, feerate: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.APIError_fee_rate_too_high(err, feerate);
+               return nativeResponseValue;
+       }
+       // struct LDKAPIError APIError_route_error(struct LDKStr err);
+       export function APIError_route_error(err: String): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.APIError_route_error(err);
+               return nativeResponseValue;
+       }
+       // struct LDKAPIError APIError_channel_unavailable(struct LDKStr err);
+       export function APIError_channel_unavailable(err: String): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.APIError_channel_unavailable(err);
+               return nativeResponseValue;
+       }
+       // struct LDKAPIError APIError_monitor_update_failed(void);
+       export function APIError_monitor_update_failed(): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.APIError_monitor_update_failed();
+               return nativeResponseValue;
+       }
        // struct LDKCResult_StringErrorZ sign(struct LDKu8slice msg, const uint8_t (*sk)[32]);
        export function sign(msg: Uint8Array, sk: Uint8Array): number {
                if(!isWasmInitialized) {
@@ -5822,6 +6094,46 @@ public static native long new_empty_slice_vec();
                const nativeResponseValue = wasm.Level_clone(orig);
                return nativeResponseValue;
        }
+       // enum LDKLevel Level_trace(void);
+       export function Level_trace(): Level {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.Level_trace();
+               return nativeResponseValue;
+       }
+       // enum LDKLevel Level_debug(void);
+       export function Level_debug(): Level {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.Level_debug();
+               return nativeResponseValue;
+       }
+       // enum LDKLevel Level_info(void);
+       export function Level_info(): Level {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.Level_info();
+               return nativeResponseValue;
+       }
+       // enum LDKLevel Level_warn(void);
+       export function Level_warn(): Level {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.Level_warn();
+               return nativeResponseValue;
+       }
+       // enum LDKLevel Level_error(void);
+       export function Level_error(): Level {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.Level_error();
+               return nativeResponseValue;
+       }
        // bool Level_eq(const enum LDKLevel *NONNULL_PTR a, const enum LDKLevel *NONNULL_PTR b);
        export function Level_eq(a: number, b: number): boolean {
                if(!isWasmInitialized) {
@@ -6374,6 +6686,22 @@ public static native long new_empty_slice_vec();
                const nativeResponseValue = wasm.AccessError_clone(orig);
                return nativeResponseValue;
        }
+       // enum LDKAccessError AccessError_unknown_chain(void);
+       export function AccessError_unknown_chain(): AccessError {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.AccessError_unknown_chain();
+               return nativeResponseValue;
+       }
+       // enum LDKAccessError AccessError_unknown_tx(void);
+       export function AccessError_unknown_tx(): AccessError {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.AccessError_unknown_tx();
+               return nativeResponseValue;
+       }
        // void Access_free(struct LDKAccess this_ptr);
        export function Access_free(this_ptr: number): void {
                if(!isWasmInitialized) {
@@ -6510,6 +6838,30 @@ public static native long new_empty_slice_vec();
                const nativeResponseValue = wasm.ConfirmationTarget_clone(orig);
                return nativeResponseValue;
        }
+       // enum LDKConfirmationTarget ConfirmationTarget_background(void);
+       export function ConfirmationTarget_background(): ConfirmationTarget {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.ConfirmationTarget_background();
+               return nativeResponseValue;
+       }
+       // enum LDKConfirmationTarget ConfirmationTarget_normal(void);
+       export function ConfirmationTarget_normal(): ConfirmationTarget {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.ConfirmationTarget_normal();
+               return nativeResponseValue;
+       }
+       // enum LDKConfirmationTarget ConfirmationTarget_high_priority(void);
+       export function ConfirmationTarget_high_priority(): ConfirmationTarget {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.ConfirmationTarget_high_priority();
+               return nativeResponseValue;
+       }
        // void FeeEstimator_free(struct LDKFeeEstimator this_ptr);
        export function FeeEstimator_free(this_ptr: number): void {
                if(!isWasmInitialized) {
@@ -6622,6 +6974,22 @@ public static native long new_empty_slice_vec();
                const nativeResponseValue = wasm.ChannelMonitorUpdateErr_clone(orig);
                return nativeResponseValue;
        }
+       // enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_temporary_failure(void);
+       export function ChannelMonitorUpdateErr_temporary_failure(): ChannelMonitorUpdateErr {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.ChannelMonitorUpdateErr_temporary_failure();
+               return nativeResponseValue;
+       }
+       // enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_permanent_failure(void);
+       export function ChannelMonitorUpdateErr_permanent_failure(): ChannelMonitorUpdateErr {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.ChannelMonitorUpdateErr_permanent_failure();
+               return nativeResponseValue;
+       }
        // void MonitorUpdateError_free(struct LDKMonitorUpdateError this_obj);
        export function MonitorUpdateError_free(this_obj: number): void {
                if(!isWasmInitialized) {
@@ -6654,6 +7022,22 @@ public static native long new_empty_slice_vec();
                const nativeResponseValue = wasm.MonitorEvent_clone(orig);
                return nativeResponseValue;
        }
+       // struct LDKMonitorEvent MonitorEvent_htlcevent(struct LDKHTLCUpdate a);
+       export function MonitorEvent_htlcevent(a: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.MonitorEvent_htlcevent(a);
+               return nativeResponseValue;
+       }
+       // struct LDKMonitorEvent MonitorEvent_commitment_tx_broadcasted(struct LDKOutPoint a);
+       export function MonitorEvent_commitment_tx_broadcasted(a: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.MonitorEvent_commitment_tx_broadcasted(a);
+               return nativeResponseValue;
+       }
        // void HTLCUpdate_free(struct LDKHTLCUpdate this_obj);
        export function HTLCUpdate_free(this_obj: number): void {
                if(!isWasmInitialized) {
@@ -7198,6 +7582,30 @@ public static native long new_empty_slice_vec();
                const nativeResponseValue = wasm.SpendableOutputDescriptor_clone(orig);
                return nativeResponseValue;
        }
+       // struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_output(struct LDKOutPoint outpoint, struct LDKTxOut output);
+       export function SpendableOutputDescriptor_static_output(outpoint: number, output: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.SpendableOutputDescriptor_static_output(outpoint, output);
+               return nativeResponseValue;
+       }
+       // struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_delayed_payment_output(struct LDKDelayedPaymentOutputDescriptor a);
+       export function SpendableOutputDescriptor_delayed_payment_output(a: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.SpendableOutputDescriptor_delayed_payment_output(a);
+               return nativeResponseValue;
+       }
+       // struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_static_payment_output(struct LDKStaticPaymentOutputDescriptor a);
+       export function SpendableOutputDescriptor_static_payment_output(a: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.SpendableOutputDescriptor_static_payment_output(a);
+               return nativeResponseValue;
+       }
        // struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj);
        export function SpendableOutputDescriptor_write(obj: number): Uint8Array {
                if(!isWasmInitialized) {
@@ -7910,6 +8318,38 @@ public static native long new_empty_slice_vec();
                const nativeResponseValue = wasm.PaymentSendFailure_clone(orig);
                return nativeResponseValue;
        }
+       // struct LDKPaymentSendFailure PaymentSendFailure_parameter_error(struct LDKAPIError a);
+       export function PaymentSendFailure_parameter_error(a: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.PaymentSendFailure_parameter_error(a);
+               return nativeResponseValue;
+       }
+       // struct LDKPaymentSendFailure PaymentSendFailure_path_parameter_error(struct LDKCVec_CResult_NoneAPIErrorZZ a);
+       export function PaymentSendFailure_path_parameter_error(a: number[]): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.PaymentSendFailure_path_parameter_error(a);
+               return nativeResponseValue;
+       }
+       // struct LDKPaymentSendFailure PaymentSendFailure_all_failed_retry_safe(struct LDKCVec_APIErrorZ a);
+       export function PaymentSendFailure_all_failed_retry_safe(a: number[]): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.PaymentSendFailure_all_failed_retry_safe(a);
+               return nativeResponseValue;
+       }
+       // struct LDKPaymentSendFailure PaymentSendFailure_partial_failure(struct LDKCVec_CResult_NoneAPIErrorZZ a);
+       export function PaymentSendFailure_partial_failure(a: number[]): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.PaymentSendFailure_partial_failure(a);
+               return nativeResponseValue;
+       }
        // MUST_USE_RES struct LDKChannelManager ChannelManager_new(struct LDKFeeEstimator fee_est, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKLogger logger, struct LDKKeysInterface keys_manager, struct LDKUserConfig config, struct LDKChainParameters params);
        export function ChannelManager_new(fee_est: number, chain_monitor: number, tx_broadcaster: number, logger: number, keys_manager: number, config: number, params: number): number {
                if(!isWasmInitialized) {
@@ -10030,6 +10470,38 @@ public static native long new_empty_slice_vec();
                const nativeResponseValue = wasm.NetAddress_clone(orig);
                return nativeResponseValue;
        }
+       // struct LDKNetAddress NetAddress_ipv4(struct LDKFourBytes addr, uint16_t port);
+       export function NetAddress_ipv4(addr: Uint8Array, port: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.NetAddress_ipv4(encodeArray(addr), port);
+               return nativeResponseValue;
+       }
+       // struct LDKNetAddress NetAddress_ipv6(struct LDKSixteenBytes addr, uint16_t port);
+       export function NetAddress_ipv6(addr: Uint8Array, port: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.NetAddress_ipv6(encodeArray(addr), port);
+               return nativeResponseValue;
+       }
+       // struct LDKNetAddress NetAddress_onion_v2(struct LDKTenBytes addr, uint16_t port);
+       export function NetAddress_onion_v2(addr: Uint8Array, port: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.NetAddress_onion_v2(encodeArray(addr), port);
+               return nativeResponseValue;
+       }
+       // struct LDKNetAddress NetAddress_onion_v3(struct LDKThirtyTwoBytes ed25519_pubkey, uint16_t checksum, uint8_t version, uint16_t port);
+       export function NetAddress_onion_v3(ed25519_pubkey: Uint8Array, checksum: number, version: number, port: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.NetAddress_onion_v3(encodeArray(ed25519_pubkey), checksum, version, port);
+               return nativeResponseValue;
+       }
        // struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj);
        export function NetAddress_write(obj: number): Uint8Array {
                if(!isWasmInitialized) {
@@ -11006,6 +11478,38 @@ public static native long new_empty_slice_vec();
                const nativeResponseValue = wasm.ErrorAction_clone(orig);
                return nativeResponseValue;
        }
+       // struct LDKErrorAction ErrorAction_disconnect_peer(struct LDKErrorMessage msg);
+       export function ErrorAction_disconnect_peer(msg: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.ErrorAction_disconnect_peer(msg);
+               return nativeResponseValue;
+       }
+       // struct LDKErrorAction ErrorAction_ignore_error(void);
+       export function ErrorAction_ignore_error(): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.ErrorAction_ignore_error();
+               return nativeResponseValue;
+       }
+       // struct LDKErrorAction ErrorAction_ignore_and_log(enum LDKLevel a);
+       export function ErrorAction_ignore_and_log(a: Level): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.ErrorAction_ignore_and_log(a);
+               return nativeResponseValue;
+       }
+       // struct LDKErrorAction ErrorAction_send_error_message(struct LDKErrorMessage msg);
+       export function ErrorAction_send_error_message(msg: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.ErrorAction_send_error_message(msg);
+               return nativeResponseValue;
+       }
        // void LightningError_free(struct LDKLightningError this_obj);
        export function LightningError_free(this_obj: number): void {
                if(!isWasmInitialized) {
@@ -11166,6 +11670,30 @@ public static native long new_empty_slice_vec();
                const nativeResponseValue = wasm.HTLCFailChannelUpdate_clone(orig);
                return nativeResponseValue;
        }
+       // struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_channel_update_message(struct LDKChannelUpdate msg);
+       export function HTLCFailChannelUpdate_channel_update_message(msg: number): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.HTLCFailChannelUpdate_channel_update_message(msg);
+               return nativeResponseValue;
+       }
+       // struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_channel_closed(uint64_t short_channel_id, bool is_permanent);
+       export function HTLCFailChannelUpdate_channel_closed(short_channel_id: number, is_permanent: boolean): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.HTLCFailChannelUpdate_channel_closed(short_channel_id, is_permanent);
+               return nativeResponseValue;
+       }
+       // struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_node_failure(struct LDKPublicKey node_id, bool is_permanent);
+       export function HTLCFailChannelUpdate_node_failure(node_id: Uint8Array, is_permanent: boolean): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.HTLCFailChannelUpdate_node_failure(encodeArray(node_id), is_permanent);
+               return nativeResponseValue;
+       }
        // void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr);
        export function ChannelMessageHandler_free(this_ptr: number): void {
                if(!isWasmInitialized) {
@@ -14534,6 +15062,38 @@ public static native long new_empty_slice_vec();
                const nativeResponseValue = wasm.SiPrefix_clone(orig);
                return nativeResponseValue;
        }
+       // enum LDKSiPrefix SiPrefix_milli(void);
+       export function SiPrefix_milli(): SiPrefix {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.SiPrefix_milli();
+               return nativeResponseValue;
+       }
+       // enum LDKSiPrefix SiPrefix_micro(void);
+       export function SiPrefix_micro(): SiPrefix {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.SiPrefix_micro();
+               return nativeResponseValue;
+       }
+       // enum LDKSiPrefix SiPrefix_nano(void);
+       export function SiPrefix_nano(): SiPrefix {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.SiPrefix_nano();
+               return nativeResponseValue;
+       }
+       // enum LDKSiPrefix SiPrefix_pico(void);
+       export function SiPrefix_pico(): SiPrefix {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.SiPrefix_pico();
+               return nativeResponseValue;
+       }
        // bool SiPrefix_eq(const enum LDKSiPrefix *NONNULL_PTR a, const enum LDKSiPrefix *NONNULL_PTR b);
        export function SiPrefix_eq(a: number, b: number): boolean {
                if(!isWasmInitialized) {
@@ -14558,6 +15118,46 @@ public static native long new_empty_slice_vec();
                const nativeResponseValue = wasm.Currency_clone(orig);
                return nativeResponseValue;
        }
+       // enum LDKCurrency Currency_bitcoin(void);
+       export function Currency_bitcoin(): Currency {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.Currency_bitcoin();
+               return nativeResponseValue;
+       }
+       // enum LDKCurrency Currency_bitcoin_testnet(void);
+       export function Currency_bitcoin_testnet(): Currency {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.Currency_bitcoin_testnet();
+               return nativeResponseValue;
+       }
+       // enum LDKCurrency Currency_regtest(void);
+       export function Currency_regtest(): Currency {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.Currency_regtest();
+               return nativeResponseValue;
+       }
+       // enum LDKCurrency Currency_simnet(void);
+       export function Currency_simnet(): Currency {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.Currency_simnet();
+               return nativeResponseValue;
+       }
+       // enum LDKCurrency Currency_signet(void);
+       export function Currency_signet(): Currency {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.Currency_signet();
+               return nativeResponseValue;
+       }
        // bool Currency_eq(const enum LDKCurrency *NONNULL_PTR a, const enum LDKCurrency *NONNULL_PTR b);
        export function Currency_eq(a: number, b: number): boolean {
                if(!isWasmInitialized) {
@@ -14702,6 +15302,30 @@ public static native long new_empty_slice_vec();
                const nativeResponseValue = wasm.Fallback_clone(orig);
                return nativeResponseValue;
        }
+       // struct LDKFallback Fallback_seg_wit_program(struct LDKu5 version, struct LDKCVec_u8Z program);
+       export function Fallback_seg_wit_program(version: number, program: Uint8Array): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.Fallback_seg_wit_program(version, encodeArray(program));
+               return nativeResponseValue;
+       }
+       // struct LDKFallback Fallback_pub_key_hash(struct LDKTwentyBytes a);
+       export function Fallback_pub_key_hash(a: Uint8Array): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.Fallback_pub_key_hash(encodeArray(a));
+               return nativeResponseValue;
+       }
+       // struct LDKFallback Fallback_script_hash(struct LDKTwentyBytes a);
+       export function Fallback_script_hash(a: Uint8Array): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.Fallback_script_hash(encodeArray(a));
+               return nativeResponseValue;
+       }
        // bool Fallback_eq(const struct LDKFallback *NONNULL_PTR a, const struct LDKFallback *NONNULL_PTR b);
        export function Fallback_eq(a: number, b: number): boolean {
                if(!isWasmInitialized) {
@@ -15126,6 +15750,38 @@ public static native long new_empty_slice_vec();
                const nativeResponseValue = wasm.CreationError_clone(orig);
                return nativeResponseValue;
        }
+       // enum LDKCreationError CreationError_description_too_long(void);
+       export function CreationError_description_too_long(): CreationError {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.CreationError_description_too_long();
+               return nativeResponseValue;
+       }
+       // enum LDKCreationError CreationError_route_too_long(void);
+       export function CreationError_route_too_long(): CreationError {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.CreationError_route_too_long();
+               return nativeResponseValue;
+       }
+       // enum LDKCreationError CreationError_timestamp_out_of_bounds(void);
+       export function CreationError_timestamp_out_of_bounds(): CreationError {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.CreationError_timestamp_out_of_bounds();
+               return nativeResponseValue;
+       }
+       // enum LDKCreationError CreationError_expiry_time_out_of_bounds(void);
+       export function CreationError_expiry_time_out_of_bounds(): CreationError {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.CreationError_expiry_time_out_of_bounds();
+               return nativeResponseValue;
+       }
        // bool CreationError_eq(const enum LDKCreationError *NONNULL_PTR a, const enum LDKCreationError *NONNULL_PTR b);
        export function CreationError_eq(a: number, b: number): boolean {
                if(!isWasmInitialized) {
@@ -15150,6 +15806,70 @@ public static native long new_empty_slice_vec();
                const nativeResponseValue = wasm.SemanticError_clone(orig);
                return nativeResponseValue;
        }
+       // enum LDKSemanticError SemanticError_no_payment_hash(void);
+       export function SemanticError_no_payment_hash(): SemanticError {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.SemanticError_no_payment_hash();
+               return nativeResponseValue;
+       }
+       // enum LDKSemanticError SemanticError_multiple_payment_hashes(void);
+       export function SemanticError_multiple_payment_hashes(): SemanticError {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.SemanticError_multiple_payment_hashes();
+               return nativeResponseValue;
+       }
+       // enum LDKSemanticError SemanticError_no_description(void);
+       export function SemanticError_no_description(): SemanticError {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.SemanticError_no_description();
+               return nativeResponseValue;
+       }
+       // enum LDKSemanticError SemanticError_multiple_descriptions(void);
+       export function SemanticError_multiple_descriptions(): SemanticError {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.SemanticError_multiple_descriptions();
+               return nativeResponseValue;
+       }
+       // enum LDKSemanticError SemanticError_multiple_payment_secrets(void);
+       export function SemanticError_multiple_payment_secrets(): SemanticError {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.SemanticError_multiple_payment_secrets();
+               return nativeResponseValue;
+       }
+       // enum LDKSemanticError SemanticError_invalid_features(void);
+       export function SemanticError_invalid_features(): SemanticError {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.SemanticError_invalid_features();
+               return nativeResponseValue;
+       }
+       // enum LDKSemanticError SemanticError_invalid_recovery_id(void);
+       export function SemanticError_invalid_recovery_id(): SemanticError {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.SemanticError_invalid_recovery_id();
+               return nativeResponseValue;
+       }
+       // enum LDKSemanticError SemanticError_invalid_signature(void);
+       export function SemanticError_invalid_signature(): SemanticError {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.SemanticError_invalid_signature();
+               return nativeResponseValue;
+       }
        // bool SemanticError_eq(const enum LDKSemanticError *NONNULL_PTR a, const enum LDKSemanticError *NONNULL_PTR b);
        export function SemanticError_eq(a: number, b: number): boolean {
                if(!isWasmInitialized) {
@@ -15182,6 +15902,22 @@ public static native long new_empty_slice_vec();
                const nativeResponseValue = wasm.SignOrCreationError_clone(orig);
                return nativeResponseValue;
        }
+       // struct LDKSignOrCreationError SignOrCreationError_sign_error(void);
+       export function SignOrCreationError_sign_error(): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.SignOrCreationError_sign_error();
+               return nativeResponseValue;
+       }
+       // struct LDKSignOrCreationError SignOrCreationError_creation_error(enum LDKCreationError a);
+       export function SignOrCreationError_creation_error(a: CreationError): number {
+               if(!isWasmInitialized) {
+                       throw new Error("initializeWasm() must be awaited first!");
+               }
+               const nativeResponseValue = wasm.SignOrCreationError_creation_error(a);
+               return nativeResponseValue;
+       }
        // bool SignOrCreationError_eq(const struct LDKSignOrCreationError *NONNULL_PTR a, const struct LDKSignOrCreationError *NONNULL_PTR b);
        export function SignOrCreationError_eq(a: number, b: number): boolean {
                if(!isWasmInitialized) {
index 86c7a8f1298d890022f0b955ed8987e6805a5fe0..02a1ddbf41e30eb29b1a5b157319f31e3843b4b5 100644 (file)
@@ -71,4 +71,39 @@ export class MonitorUpdateFailed extends APIError {
                return ret_hu_conv;
        }
 
+       public static APIError constructor_apimisuse_error(String err) {
+               number ret = bindings.APIError_apimisuse_error(err);
+               APIError ret_hu_conv = APIError.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       public static APIError constructor_fee_rate_too_high(String err, number feerate) {
+               number ret = bindings.APIError_fee_rate_too_high(err, feerate);
+               APIError ret_hu_conv = APIError.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       public static APIError constructor_route_error(String err) {
+               number ret = bindings.APIError_route_error(err);
+               APIError ret_hu_conv = APIError.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       public static APIError constructor_channel_unavailable(String err) {
+               number ret = bindings.APIError_channel_unavailable(err);
+               APIError ret_hu_conv = APIError.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       public static APIError constructor_monitor_update_failed() {
+               number ret = bindings.APIError_monitor_update_failed();
+               APIError ret_hu_conv = APIError.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
 }
index 86590bfc6e10156ce8c90976c3100988288f6f9b..9d9eeffa4b65048b71d057dcb16a583fa779a0b0 100644 (file)
@@ -100,7 +100,7 @@ import * as bindings from '../bindings' // TODO: figure out location
        }
 
        public void broadcast_node_announcement(Uint8Array rgb, Uint8Array alias, NetAddress[] addresses) {
-               bindings.ChannelManager_broadcast_node_announcement(this.ptr, rgb, alias, Arrays.stream(addresses).map(addresses_conv_12 -> addresses_conv_12.ptr).toArray(number[]::new));
+               bindings.ChannelManager_broadcast_node_announcement(this.ptr, rgb, alias, addresses != null ? Arrays.stream(addresses).map(addresses_conv_12 -> addresses_conv_12.ptr).toArray(number[]::new) : null);
                /* TODO 2 NetAddress  */;
        }
 
index 596df3a8117b6987e2f389b1c4afdfd0a987afd8..772c721ef8d3e1aefd95c76d02f3d46233274a58 100644 (file)
@@ -91,7 +91,7 @@ import * as bindings from '../bindings' // TODO: figure out location
        }
 
        public static ChannelManagerReadArgs constructor_new(KeysInterface keys_manager, FeeEstimator fee_estimator, Watch chain_monitor, BroadcasterInterface tx_broadcaster, Logger logger, UserConfig default_config, ChannelMonitor[] channel_monitors) {
-               number 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).map(channel_monitors_conv_16 -> channel_monitors_conv_16 == null ? 0 : channel_monitors_conv_16.ptr & ~1).toArray(number[]::new));
+               number 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, channel_monitors != null ? Arrays.stream(channel_monitors).map(channel_monitors_conv_16 -> channel_monitors_conv_16 == null ? 0 : channel_monitors_conv_16.ptr & ~1).toArray(number[]::new) : null);
                const ret_hu_conv: ChannelManagerReadArgs = new ChannelManagerReadArgs(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                ret_hu_conv.ptrs_to.add(keys_manager);
index a937362ba46819f34758304f72a778ab499b0538..2d3cac7cbcaf45afc45baee5b4ffae2e81591b57 100644 (file)
@@ -118,7 +118,7 @@ import * as bindings from '../bindings' // TODO: figure out location
        }
 
        public TwoTuple<Uint8Array, TwoTuple<Number, TxOut>[]>[] block_connected(Uint8Array header, TwoTuple<Number, Uint8Array>[] txdata, number height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) {
-               number[] ret = bindings.ChannelMonitor_block_connected(this.ptr, header, Arrays.stream(txdata).map(txdata_conv_30 -> bindings.C2Tuple_usizeTransactionZ_new(txdata_conv_30.a, txdata_conv_30.b)).toArray(number[]::new), height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
+               number[] ret = bindings.ChannelMonitor_block_connected(this.ptr, header, txdata != null ? Arrays.stream(txdata).map(txdata_conv_30 -> bindings.C2Tuple_usizeTransactionZ_new(txdata_conv_30.a, txdata_conv_30.b)).toArray(number[]::new) : null, height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
                TwoTuple<Uint8Array, TwoTuple<Number, TxOut>[]>[] ret_conv_49_arr = new TwoTuple[ret.length];
                for (int x = 0; x < ret.length; x++) {
                        number ret_conv_49 = ret[x];
@@ -155,7 +155,7 @@ import * as bindings from '../bindings' // TODO: figure out location
        }
 
        public TwoTuple<Uint8Array, TwoTuple<Number, TxOut>[]>[] transactions_confirmed(Uint8Array header, TwoTuple<Number, Uint8Array>[] txdata, number height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) {
-               number[] ret = bindings.ChannelMonitor_transactions_confirmed(this.ptr, header, Arrays.stream(txdata).map(txdata_conv_30 -> bindings.C2Tuple_usizeTransactionZ_new(txdata_conv_30.a, txdata_conv_30.b)).toArray(number[]::new), height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
+               number[] ret = bindings.ChannelMonitor_transactions_confirmed(this.ptr, header, txdata != null ? Arrays.stream(txdata).map(txdata_conv_30 -> bindings.C2Tuple_usizeTransactionZ_new(txdata_conv_30.a, txdata_conv_30.b)).toArray(number[]::new) : null, height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr);
                TwoTuple<Uint8Array, TwoTuple<Number, TxOut>[]>[] ret_conv_49_arr = new TwoTuple[ret.length];
                for (int x = 0; x < ret.length; x++) {
                        number ret_conv_49 = ret[x];
index 39aed69e9e74069695fada2e7a50d06241c33ef5..9117bc2322f17576201a24a8b2b16526a5c156f7 100644 (file)
@@ -19,22 +19,22 @@ import * as bindings from '../bindings' // TODO: figure out location
                     }
                 }
        public void set_update_add_htlcs(UpdateAddHTLC[] val) {
-               bindings.CommitmentUpdate_set_update_add_htlcs(this.ptr, Arrays.stream(val).map(val_conv_15 -> val_conv_15 == null ? 0 : val_conv_15.ptr & ~1).toArray(number[]::new));
+               bindings.CommitmentUpdate_set_update_add_htlcs(this.ptr, val != null ? Arrays.stream(val).map(val_conv_15 -> val_conv_15 == null ? 0 : val_conv_15.ptr & ~1).toArray(number[]::new) : null);
                /* TODO 2 UpdateAddHTLC  */;
        }
 
        public void set_update_fulfill_htlcs(UpdateFulfillHTLC[] val) {
-               bindings.CommitmentUpdate_set_update_fulfill_htlcs(this.ptr, Arrays.stream(val).map(val_conv_19 -> val_conv_19 == null ? 0 : val_conv_19.ptr & ~1).toArray(number[]::new));
+               bindings.CommitmentUpdate_set_update_fulfill_htlcs(this.ptr, val != null ? Arrays.stream(val).map(val_conv_19 -> val_conv_19 == null ? 0 : val_conv_19.ptr & ~1).toArray(number[]::new) : null);
                /* TODO 2 UpdateFulfillHTLC  */;
        }
 
        public void set_update_fail_htlcs(UpdateFailHTLC[] val) {
-               bindings.CommitmentUpdate_set_update_fail_htlcs(this.ptr, Arrays.stream(val).map(val_conv_16 -> val_conv_16 == null ? 0 : val_conv_16.ptr & ~1).toArray(number[]::new));
+               bindings.CommitmentUpdate_set_update_fail_htlcs(this.ptr, val != null ? Arrays.stream(val).map(val_conv_16 -> val_conv_16 == null ? 0 : val_conv_16.ptr & ~1).toArray(number[]::new) : null);
                /* TODO 2 UpdateFailHTLC  */;
        }
 
        public void set_update_fail_malformed_htlcs(UpdateFailMalformedHTLC[] val) {
-               bindings.CommitmentUpdate_set_update_fail_malformed_htlcs(this.ptr, Arrays.stream(val).map(val_conv_25 -> val_conv_25 == null ? 0 : val_conv_25.ptr & ~1).toArray(number[]::new));
+               bindings.CommitmentUpdate_set_update_fail_malformed_htlcs(this.ptr, val != null ? Arrays.stream(val).map(val_conv_25 -> val_conv_25 == null ? 0 : val_conv_25.ptr & ~1).toArray(number[]::new) : null);
                /* TODO 2 UpdateFailMalformedHTLC  */;
        }
 
@@ -63,7 +63,7 @@ import * as bindings from '../bindings' // TODO: figure out location
        }
 
        public static CommitmentUpdate constructor_new(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) {
-               number ret = bindings.CommitmentUpdate_new(Arrays.stream(update_add_htlcs_arg).map(update_add_htlcs_arg_conv_15 -> update_add_htlcs_arg_conv_15 == null ? 0 : update_add_htlcs_arg_conv_15.ptr & ~1).toArray(number[]::new), Arrays.stream(update_fulfill_htlcs_arg).map(update_fulfill_htlcs_arg_conv_19 -> update_fulfill_htlcs_arg_conv_19 == null ? 0 : update_fulfill_htlcs_arg_conv_19.ptr & ~1).toArray(number[]::new), Arrays.stream(update_fail_htlcs_arg).map(update_fail_htlcs_arg_conv_16 -> update_fail_htlcs_arg_conv_16 == null ? 0 : update_fail_htlcs_arg_conv_16.ptr & ~1).toArray(number[]::new), Arrays.stream(update_fail_malformed_htlcs_arg).map(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(number[]::new), update_fee_arg == null ? 0 : update_fee_arg.ptr & ~1, commitment_signed_arg == null ? 0 : commitment_signed_arg.ptr & ~1);
+               number ret = bindings.CommitmentUpdate_new(update_add_htlcs_arg != null ? Arrays.stream(update_add_htlcs_arg).map(update_add_htlcs_arg_conv_15 -> update_add_htlcs_arg_conv_15 == null ? 0 : update_add_htlcs_arg_conv_15.ptr & ~1).toArray(number[]::new) : null, update_fulfill_htlcs_arg != null ? Arrays.stream(update_fulfill_htlcs_arg).map(update_fulfill_htlcs_arg_conv_19 -> update_fulfill_htlcs_arg_conv_19 == null ? 0 : update_fulfill_htlcs_arg_conv_19.ptr & ~1).toArray(number[]::new) : null, update_fail_htlcs_arg != null ? Arrays.stream(update_fail_htlcs_arg).map(update_fail_htlcs_arg_conv_16 -> update_fail_htlcs_arg_conv_16 == null ? 0 : update_fail_htlcs_arg_conv_16.ptr & ~1).toArray(number[]::new) : null, update_fail_malformed_htlcs_arg != null ? Arrays.stream(update_fail_malformed_htlcs_arg).map(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(number[]::new) : null, update_fee_arg == null ? 0 : update_fee_arg.ptr & ~1, commitment_signed_arg == null ? 0 : commitment_signed_arg.ptr & ~1);
                const ret_hu_conv: CommitmentUpdate = new CommitmentUpdate(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                /* TODO 2 UpdateAddHTLC  */;
index 26d0a1829d9275dda3e71f44ebd4b6f7dbd8680b..ce8f5083315ab30141bb2043e7db865b08973e45 100644 (file)
@@ -77,7 +77,7 @@ import * as bindings from '../bindings' // TODO: figure out location
                 held: Confirm;
             }
        public void transactions_confirmed(Uint8Array header, TwoTuple<Number, Uint8Array>[] txdata, number height) {
-               bindings.Confirm_transactions_confirmed(this.ptr, header, Arrays.stream(txdata).map(txdata_conv_30 -> bindings.C2Tuple_usizeTransactionZ_new(txdata_conv_30.a, txdata_conv_30.b)).toArray(number[]::new), height);
+               bindings.Confirm_transactions_confirmed(this.ptr, header, txdata != null ? Arrays.stream(txdata).map(txdata_conv_30 -> bindings.C2Tuple_usizeTransactionZ_new(txdata_conv_30.a, txdata_conv_30.b)).toArray(number[]::new) : null, height);
                /* TODO 2 TwoTuple<Number, Uint8Array>  */;
        }
 
index 09faa34988853bad391a26021c1b6f9cabb05a4a..6bcb77499dfaf3d3632eb4fc3d18b337a7e75660 100644 (file)
@@ -65,4 +65,34 @@ export class SendErrorMessage extends ErrorAction {
                return ret_hu_conv;
        }
 
+       public static ErrorAction constructor_disconnect_peer(ErrorMessage msg) {
+               number ret = bindings.ErrorAction_disconnect_peer(msg == null ? 0 : msg.ptr & ~1);
+               ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
+       public static ErrorAction constructor_ignore_error() {
+               number ret = bindings.ErrorAction_ignore_error();
+               ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       public static ErrorAction constructor_ignore_and_log(Level a) {
+               number ret = bindings.ErrorAction_ignore_and_log(a);
+               ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       public static ErrorAction constructor_send_error_message(ErrorMessage msg) {
+               number ret = bindings.ErrorAction_send_error_message(msg == null ? 0 : msg.ptr & ~1);
+               ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
 }
index 1dabb5eee30ec24cddad223ea423b5e94135264c..2590433d0b15c33bf17f98dda1c67efb6698af4a 100644 (file)
@@ -105,6 +105,49 @@ export class SpendableOutputs extends Event {
                return ret_hu_conv;
        }
 
+       public static Event constructor_funding_generation_ready(Uint8Array temporary_channel_id, number channel_value_satoshis, Uint8Array output_script, number user_channel_id) {
+               number ret = bindings.Event_funding_generation_ready(temporary_channel_id, channel_value_satoshis, output_script, user_channel_id);
+               Event ret_hu_conv = Event.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       public static Event constructor_payment_received(Uint8Array payment_hash, Uint8Array payment_preimage, Uint8Array payment_secret, number amt, number user_payment_id) {
+               number ret = bindings.Event_payment_received(payment_hash, payment_preimage, payment_secret, amt, user_payment_id);
+               Event ret_hu_conv = Event.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       public static Event constructor_payment_sent(Uint8Array payment_preimage) {
+               number ret = bindings.Event_payment_sent(payment_preimage);
+               Event ret_hu_conv = Event.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       public static Event constructor_payment_failed(Uint8Array payment_hash, boolean rejected_by_dest) {
+               number ret = bindings.Event_payment_failed(payment_hash, rejected_by_dest);
+               Event ret_hu_conv = Event.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       public static Event constructor_pending_htlcs_forwardable(number time_forwardable) {
+               number ret = bindings.Event_pending_htlcs_forwardable(time_forwardable);
+               Event ret_hu_conv = Event.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       public static Event constructor_spendable_outputs(SpendableOutputDescriptor[] outputs) {
+               number ret = bindings.Event_spendable_outputs(outputs != null ? Arrays.stream(outputs).map(outputs_conv_27 -> outputs_conv_27.ptr).toArray(number[]::new) : null);
+               Event ret_hu_conv = Event.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               /* TODO 2 SpendableOutputDescriptor  */;
+               return ret_hu_conv;
+       }
+
        public Uint8Array write() {
                Uint8Array ret = bindings.Event_write(this.ptr);
                return ret;
index 433603f3ec342bd24ec5d40ba03c50a301cffe60..637597a394899326a1dd0673b8775d80bf97ea58 100644 (file)
@@ -55,6 +55,27 @@ export class ScriptHash extends Fallback {
                return ret_hu_conv;
        }
 
+       public static Fallback constructor_seg_wit_program(UInt5 version, Uint8Array program) {
+               number ret = bindings.Fallback_seg_wit_program(version.getVal(), program);
+               Fallback ret_hu_conv = Fallback.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       public static Fallback constructor_pub_key_hash(Uint8Array a) {
+               number ret = bindings.Fallback_pub_key_hash(a);
+               Fallback ret_hu_conv = Fallback.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       public static Fallback constructor_script_hash(Uint8Array a) {
+               number ret = bindings.Fallback_script_hash(a);
+               Fallback ret_hu_conv = Fallback.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
        public boolean eq(Fallback b) {
                boolean ret = bindings.Fallback_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
                this.ptrs_to.add(b);
index b89c14622ff4f5af312ea9b3c1068a6dd4774c4b..dd5ac4473bcbff07cacd1b2e1ac69c7a9fd66ff0 100644 (file)
@@ -58,4 +58,26 @@ export class NodeFailure extends HTLCFailChannelUpdate {
                return ret_hu_conv;
        }
 
+       public static HTLCFailChannelUpdate constructor_channel_update_message(ChannelUpdate msg) {
+               number ret = bindings.HTLCFailChannelUpdate_channel_update_message(msg == null ? 0 : msg.ptr & ~1);
+               HTLCFailChannelUpdate ret_hu_conv = HTLCFailChannelUpdate.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
+       public static HTLCFailChannelUpdate constructor_channel_closed(number short_channel_id, boolean is_permanent) {
+               number ret = bindings.HTLCFailChannelUpdate_channel_closed(short_channel_id, is_permanent);
+               HTLCFailChannelUpdate ret_hu_conv = HTLCFailChannelUpdate.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       public static HTLCFailChannelUpdate constructor_node_failure(Uint8Array node_id, boolean is_permanent) {
+               number ret = bindings.HTLCFailChannelUpdate_node_failure(node_id, is_permanent);
+               HTLCFailChannelUpdate ret_hu_conv = HTLCFailChannelUpdate.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
 }
index c444e1f8800fa73bd05fd7d6748a9bf70b9fd22c..a21a9a9e8aed83d050d494f5e458a4ebd8dc9081 100644 (file)
@@ -33,7 +33,7 @@ import * as bindings from '../bindings' // TODO: figure out location
        }
 
        public Result_TransactionNoneZ spend_spendable_outputs(SpendableOutputDescriptor[] descriptors, TxOut[] outputs, Uint8Array change_destination_script, number feerate_sat_per_1000_weight) {
-               number ret = bindings.KeysManager_spend_spendable_outputs(this.ptr, Arrays.stream(descriptors).map(descriptors_conv_27 -> descriptors_conv_27.ptr).toArray(number[]::new), Arrays.stream(outputs).map(outputs_conv_7 -> outputs_conv_7.ptr).toArray(number[]::new), change_destination_script, feerate_sat_per_1000_weight);
+               number ret = bindings.KeysManager_spend_spendable_outputs(this.ptr, descriptors != null ? Arrays.stream(descriptors).map(descriptors_conv_27 -> descriptors_conv_27.ptr).toArray(number[]::new) : null, outputs != null ? Arrays.stream(outputs).map(outputs_conv_7 -> outputs_conv_7.ptr).toArray(number[]::new) : null, change_destination_script, feerate_sat_per_1000_weight);
                Result_TransactionNoneZ ret_hu_conv = Result_TransactionNoneZ.constr_from_ptr(ret);
                /* TODO 2 SpendableOutputDescriptor  */;
                /* TODO 2 TxOut  */;
index b5b708c1ee0f94597b610a6a1f746ccee69815f1..608d7965ddbb4b4c753d9d387f0895e73dc59bb3 100644 (file)
@@ -318,4 +318,163 @@ export class SendReplyChannelRange extends MessageSendEvent {
                return ret_hu_conv;
        }
 
+       public static MessageSendEvent constructor_send_accept_channel(Uint8Array node_id, AcceptChannel msg) {
+               number ret = bindings.MessageSendEvent_send_accept_channel(node_id, msg == null ? 0 : msg.ptr & ~1);
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
+       public static MessageSendEvent constructor_send_open_channel(Uint8Array node_id, OpenChannel msg) {
+               number ret = bindings.MessageSendEvent_send_open_channel(node_id, msg == null ? 0 : msg.ptr & ~1);
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
+       public static MessageSendEvent constructor_send_funding_created(Uint8Array node_id, FundingCreated msg) {
+               number ret = bindings.MessageSendEvent_send_funding_created(node_id, msg == null ? 0 : msg.ptr & ~1);
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
+       public static MessageSendEvent constructor_send_funding_signed(Uint8Array node_id, FundingSigned msg) {
+               number ret = bindings.MessageSendEvent_send_funding_signed(node_id, msg == null ? 0 : msg.ptr & ~1);
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
+       public static MessageSendEvent constructor_send_funding_locked(Uint8Array node_id, FundingLocked msg) {
+               number ret = bindings.MessageSendEvent_send_funding_locked(node_id, msg == null ? 0 : msg.ptr & ~1);
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
+       public static MessageSendEvent constructor_send_announcement_signatures(Uint8Array node_id, AnnouncementSignatures msg) {
+               number ret = bindings.MessageSendEvent_send_announcement_signatures(node_id, msg == null ? 0 : msg.ptr & ~1);
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
+       public static MessageSendEvent constructor_update_htlcs(Uint8Array node_id, CommitmentUpdate updates) {
+               number ret = bindings.MessageSendEvent_update_htlcs(node_id, updates == null ? 0 : updates.ptr & ~1);
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(updates);
+               return ret_hu_conv;
+       }
+
+       public static MessageSendEvent constructor_send_revoke_and_ack(Uint8Array node_id, RevokeAndACK msg) {
+               number ret = bindings.MessageSendEvent_send_revoke_and_ack(node_id, msg == null ? 0 : msg.ptr & ~1);
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
+       public static MessageSendEvent constructor_send_closing_signed(Uint8Array node_id, ClosingSigned msg) {
+               number ret = bindings.MessageSendEvent_send_closing_signed(node_id, msg == null ? 0 : msg.ptr & ~1);
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
+       public static MessageSendEvent constructor_send_shutdown(Uint8Array node_id, Shutdown msg) {
+               number ret = bindings.MessageSendEvent_send_shutdown(node_id, msg == null ? 0 : msg.ptr & ~1);
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
+       public static MessageSendEvent constructor_send_channel_reestablish(Uint8Array node_id, ChannelReestablish msg) {
+               number ret = bindings.MessageSendEvent_send_channel_reestablish(node_id, msg == null ? 0 : msg.ptr & ~1);
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
+       public static MessageSendEvent constructor_broadcast_channel_announcement(ChannelAnnouncement msg, ChannelUpdate update_msg) {
+               number ret = bindings.MessageSendEvent_broadcast_channel_announcement(msg == null ? 0 : msg.ptr & ~1, update_msg == null ? 0 : update_msg.ptr & ~1);
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               ret_hu_conv.ptrs_to.add(update_msg);
+               return ret_hu_conv;
+       }
+
+       public static MessageSendEvent constructor_broadcast_node_announcement(NodeAnnouncement msg) {
+               number ret = bindings.MessageSendEvent_broadcast_node_announcement(msg == null ? 0 : msg.ptr & ~1);
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
+       public static MessageSendEvent constructor_broadcast_channel_update(ChannelUpdate msg) {
+               number ret = bindings.MessageSendEvent_broadcast_channel_update(msg == null ? 0 : msg.ptr & ~1);
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
+       public static MessageSendEvent constructor_send_channel_update(Uint8Array node_id, ChannelUpdate msg) {
+               number ret = bindings.MessageSendEvent_send_channel_update(node_id, msg == null ? 0 : msg.ptr & ~1);
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
+       public static MessageSendEvent constructor_handle_error(Uint8Array node_id, ErrorAction action) {
+               number ret = bindings.MessageSendEvent_handle_error(node_id, action.ptr);
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       public static MessageSendEvent constructor_payment_failure_network_update(HTLCFailChannelUpdate update) {
+               number ret = bindings.MessageSendEvent_payment_failure_network_update(update.ptr);
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       public static MessageSendEvent constructor_send_channel_range_query(Uint8Array node_id, QueryChannelRange msg) {
+               number ret = bindings.MessageSendEvent_send_channel_range_query(node_id, msg == null ? 0 : msg.ptr & ~1);
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
+       public static MessageSendEvent constructor_send_short_ids_query(Uint8Array node_id, QueryShortChannelIds msg) {
+               number ret = bindings.MessageSendEvent_send_short_ids_query(node_id, msg == null ? 0 : msg.ptr & ~1);
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
+       public static MessageSendEvent constructor_send_reply_channel_range(Uint8Array node_id, ReplyChannelRange msg) {
+               number ret = bindings.MessageSendEvent_send_reply_channel_range(node_id, msg == null ? 0 : msg.ptr & ~1);
+               MessageSendEvent ret_hu_conv = MessageSendEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(msg);
+               return ret_hu_conv;
+       }
+
 }
index 6b218bb12c0ffab7b317f6b3218dc386e9115416..711f0749ffcc76a0144ab8f6c9b67457a3ae8dfb 100644 (file)
@@ -34,7 +34,7 @@ import * as bindings from '../bindings' // TODO: figure out location
                         // todo: in-line interface filling
                         get_and_clear_pending_msg_events (): number[] {
                                                        MessageSendEvent[] ret = arg.get_and_clear_pending_msg_events();
-                               result: number[] = Arrays.stream(ret).map(ret_conv_18 -> ret_conv_18.ptr).toArray(number[]::new);
+                               result: number[] = ret != null ? Arrays.stream(ret).map(ret_conv_18 -> ret_conv_18.ptr).toArray(number[]::new) : null;
                                /* TODO 2 MessageSendEvent  */;
                                return result;
                                                },
index e226f96e4bd14a86fd0927ef0615ab8b006278c0..49b729e05d8250f70e60368b6bb8f578f1e3adf6 100644 (file)
@@ -47,4 +47,20 @@ export class CommitmentTxBroadcasted extends MonitorEvent {
                return ret_hu_conv;
        }
 
+       public static MonitorEvent constructor_htlcevent(HTLCUpdate a) {
+               number ret = bindings.MonitorEvent_htlcevent(a == null ? 0 : a.ptr & ~1);
+               MonitorEvent ret_hu_conv = MonitorEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(a);
+               return ret_hu_conv;
+       }
+
+       public static MonitorEvent constructor_commitment_tx_broadcasted(OutPoint a) {
+               number ret = bindings.MonitorEvent_commitment_tx_broadcasted(a == null ? 0 : a.ptr & ~1);
+               MonitorEvent ret_hu_conv = MonitorEvent.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(a);
+               return ret_hu_conv;
+       }
+
 }
index b1d54a1700e446965059ed470b85f0d5c62ace3d..0c93f092731777c077962a208073c7dd5cc0b64b 100644 (file)
@@ -73,6 +73,34 @@ export class OnionV3 extends NetAddress {
                return ret_hu_conv;
        }
 
+       public static NetAddress constructor_ipv4(Uint8Array addr, number port) {
+               number ret = bindings.NetAddress_ipv4(addr, port);
+               NetAddress ret_hu_conv = NetAddress.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       public static NetAddress constructor_ipv6(Uint8Array addr, number port) {
+               number ret = bindings.NetAddress_ipv6(addr, port);
+               NetAddress ret_hu_conv = NetAddress.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       public static NetAddress constructor_onion_v2(Uint8Array addr, number port) {
+               number ret = bindings.NetAddress_onion_v2(addr, port);
+               NetAddress ret_hu_conv = NetAddress.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       public static NetAddress constructor_onion_v3(Uint8Array ed25519_pubkey, number checksum, number version, number port) {
+               number ret = bindings.NetAddress_onion_v3(ed25519_pubkey, checksum, version, port);
+               NetAddress ret_hu_conv = NetAddress.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
        public Uint8Array write() {
                Uint8Array ret = bindings.NetAddress_write(this.ptr);
                return ret;
index ff71ce14e793cee4f3a5d9238e75465167b92718..940ca656351611f18067a86c6ed0015b5cc5a258 100644 (file)
@@ -58,7 +58,7 @@ import * as bindings from '../bindings' // TODO: figure out location
        }
 
        public void set_addresses(NetAddress[] val) {
-               bindings.NodeAnnouncementInfo_set_addresses(this.ptr, Arrays.stream(val).map(val_conv_12 -> val_conv_12.ptr).toArray(number[]::new));
+               bindings.NodeAnnouncementInfo_set_addresses(this.ptr, val != null ? Arrays.stream(val).map(val_conv_12 -> val_conv_12.ptr).toArray(number[]::new) : null);
                /* TODO 2 NetAddress  */;
        }
 
@@ -75,7 +75,7 @@ import * as bindings from '../bindings' // TODO: figure out location
        }
 
        public static NodeAnnouncementInfo constructor_new(NodeFeatures features_arg, number last_update_arg, Uint8Array rgb_arg, Uint8Array alias_arg, NetAddress[] addresses_arg, NodeAnnouncement announcement_message_arg) {
-               number ret = bindings.NodeAnnouncementInfo_new(features_arg == null ? 0 : features_arg.ptr & ~1, last_update_arg, rgb_arg, alias_arg, Arrays.stream(addresses_arg).map(addresses_arg_conv_12 -> addresses_arg_conv_12.ptr).toArray(number[]::new), announcement_message_arg == null ? 0 : announcement_message_arg.ptr & ~1);
+               number ret = bindings.NodeAnnouncementInfo_new(features_arg == null ? 0 : features_arg.ptr & ~1, last_update_arg, rgb_arg, alias_arg, addresses_arg != null ? Arrays.stream(addresses_arg).map(addresses_arg_conv_12 -> addresses_arg_conv_12.ptr).toArray(number[]::new) : null, announcement_message_arg == null ? 0 : announcement_message_arg.ptr & ~1);
                const ret_hu_conv: NodeAnnouncementInfo = new NodeAnnouncementInfo(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                ret_hu_conv.ptrs_to.add(features_arg);
index 36daa4ec969adc29aef2b3bb2a3e8e592f421c70..803aace9bb019c37781b28209c0a0600bdf66679 100644 (file)
@@ -86,4 +86,35 @@ export class PartialFailure extends PaymentSendFailure {
                return ret_hu_conv;
        }
 
+       public static PaymentSendFailure constructor_parameter_error(APIError a) {
+               number ret = bindings.PaymentSendFailure_parameter_error(a.ptr);
+               PaymentSendFailure ret_hu_conv = PaymentSendFailure.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       public static PaymentSendFailure constructor_path_parameter_error(Result_NoneAPIErrorZ[] a) {
+               number ret = bindings.PaymentSendFailure_path_parameter_error(a != null ? Arrays.stream(a).map(a_conv_22 -> a_conv_22 != null ? a_conv_22.ptr : 0).toArray(number[]::new) : null);
+               PaymentSendFailure ret_hu_conv = PaymentSendFailure.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               /* TODO 2 Result_NoneAPIErrorZ  */;
+               return ret_hu_conv;
+       }
+
+       public static PaymentSendFailure constructor_all_failed_retry_safe(APIError[] a) {
+               number ret = bindings.PaymentSendFailure_all_failed_retry_safe(a != null ? Arrays.stream(a).map(a_conv_10 -> a_conv_10.ptr).toArray(number[]::new) : null);
+               PaymentSendFailure ret_hu_conv = PaymentSendFailure.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               /* TODO 2 APIError  */;
+               return ret_hu_conv;
+       }
+
+       public static PaymentSendFailure constructor_partial_failure(Result_NoneAPIErrorZ[] a) {
+               number ret = bindings.PaymentSendFailure_partial_failure(a != null ? Arrays.stream(a).map(a_conv_22 -> a_conv_22 != null ? a_conv_22.ptr : 0).toArray(number[]::new) : null);
+               PaymentSendFailure ret_hu_conv = PaymentSendFailure.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               /* TODO 2 Result_NoneAPIErrorZ  */;
+               return ret_hu_conv;
+       }
+
 }
index ed3768c2176c370d8e5ec5099bce1f4e0a4998dd..5c7ad0a51e9d2081df3f1dd9ed7a8aa26d10440e 100644 (file)
@@ -46,7 +46,7 @@ public class Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ extends CommonB
        }
 
        public static Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ constructor__ok(TwoTuple<Uint8Array, ChannelMonitor>[] o) {
-               number ret = bindings.CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(Arrays.stream(o).map(o_conv_38 -> bindings.C2Tuple_BlockHashChannelMonitorZ_new(o_conv_38.a, o_conv_38.b == null ? 0 : o_conv_38.b.ptr & ~1)).toArray(number[]::new));
+               number ret = bindings.CResult_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ_ok(o != null ? Arrays.stream(o).map(o_conv_38 -> bindings.C2Tuple_BlockHashChannelMonitorZ_new(o_conv_38.a, o_conv_38.b == null ? 0 : o_conv_38.b.ptr & ~1)).toArray(number[]::new) : null);
                Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ ret_hu_conv = Result_CVec_C2Tuple_BlockHashChannelMonitorZZErrorZ.constr_from_ptr(ret);
                /* TODO 2 TwoTuple<Uint8Array, ChannelMonitor>  */;
                return ret_hu_conv;
index 737c9b019e569b0c57a777bb51b13252721d9433..29561c2dd45af8dc20d8b243927c867434ca82b4 100644 (file)
@@ -19,12 +19,12 @@ import * as bindings from '../bindings' // TODO: figure out location
                     }
                 }
        public void set_paths(RouteHop[][] val) {
-               bindings.Route_set_paths(this.ptr, Arrays.stream(val).map(val_conv_12 -> Arrays.stream(val_conv_12).map(val_conv_12_conv_10 -> val_conv_12_conv_10 == null ? 0 : val_conv_12_conv_10.ptr & ~1).toArray(number[]::new)).toArray(number[][]::new));
+               bindings.Route_set_paths(this.ptr, val != null ? Arrays.stream(val).map(val_conv_12 -> val_conv_12 != null ? Arrays.stream(val_conv_12).map(val_conv_12_conv_10 -> val_conv_12_conv_10 == null ? 0 : val_conv_12_conv_10.ptr & ~1).toArray(number[]::new) : null).toArray(number[][]::new) : null);
                /* TODO 2 RouteHop[]  */;
        }
 
        public static Route constructor_new(RouteHop[][] paths_arg) {
-               number ret = bindings.Route_new(Arrays.stream(paths_arg).map(paths_arg_conv_12 -> Arrays.stream(paths_arg_conv_12).map(paths_arg_conv_12_conv_10 -> paths_arg_conv_12_conv_10 == null ? 0 : paths_arg_conv_12_conv_10.ptr & ~1).toArray(number[]::new)).toArray(number[][]::new));
+               number ret = bindings.Route_new(paths_arg != null ? Arrays.stream(paths_arg).map(paths_arg_conv_12 -> paths_arg_conv_12 != null ? Arrays.stream(paths_arg_conv_12).map(paths_arg_conv_12_conv_10 -> paths_arg_conv_12_conv_10 == null ? 0 : paths_arg_conv_12_conv_10.ptr & ~1).toArray(number[]::new) : null).toArray(number[][]::new) : null);
                const ret_hu_conv: Route = new Route(null, ret);
                ret_hu_conv.ptrs_to.add(ret_hu_conv);
                /* TODO 2 RouteHop[]  */;
index 04d3d5f54e87a252953cde2e8b96a2923c542834..128294a8ec9cd8ff2352a3a95c67fcae30a7a475 100644 (file)
@@ -61,14 +61,14 @@ import * as bindings from '../bindings' // TODO: figure out location
 
                                                get_next_channel_announcements (starting_point: number, batch_amount: number): number[] {
                                                        ThreeTuple<ChannelAnnouncement, ChannelUpdate, ChannelUpdate>[] ret = arg.get_next_channel_announcements(starting_point, batch_amount);
-                               result: number[] = Arrays.stream(ret).map(ret_conv_63 -> bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(ret_conv_63.a == null ? 0 : ret_conv_63.a.ptr & ~1, ret_conv_63.b == null ? 0 : ret_conv_63.b.ptr & ~1, ret_conv_63.c == null ? 0 : ret_conv_63.c.ptr & ~1)).toArray(number[]::new);
+                               result: number[] = ret != null ? Arrays.stream(ret).map(ret_conv_63 -> bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(ret_conv_63.a == null ? 0 : ret_conv_63.a.ptr & ~1, ret_conv_63.b == null ? 0 : ret_conv_63.b.ptr & ~1, ret_conv_63.c == null ? 0 : ret_conv_63.c.ptr & ~1)).toArray(number[]::new) : null;
                                /* TODO 2 ThreeTuple<ChannelAnnouncement, ChannelUpdate, ChannelUpdate>  */;
                                return result;
                                                },
 
                                                get_next_node_announcements (starting_point: Uint8Array, batch_amount: number): number[] {
                                                        NodeAnnouncement[] ret = arg.get_next_node_announcements(starting_point, batch_amount);
-                               result: number[] = Arrays.stream(ret).map(ret_conv_18 -> ret_conv_18 == null ? 0 : ret_conv_18.ptr & ~1).toArray(number[]::new);
+                               result: number[] = ret != null ? Arrays.stream(ret).map(ret_conv_18 -> ret_conv_18 == null ? 0 : ret_conv_18.ptr & ~1).toArray(number[]::new) : null;
                                /* TODO 2 NodeAnnouncement  */;
                                return result;
                                                },
index c40ee79aa9c971289a1ba867d2c4d3a9cff2268b..c6e5c76a78d80910349ed69bd36f6d49639f42df 100644 (file)
@@ -39,6 +39,20 @@ export class CreationError extends SignOrCreationError {
                return ret_hu_conv;
        }
 
+       public static SignOrCreationError constructor_sign_error() {
+               number ret = bindings.SignOrCreationError_sign_error();
+               SignOrCreationError ret_hu_conv = SignOrCreationError.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
+       public static SignOrCreationError constructor_creation_error(CreationError a) {
+               number ret = bindings.SignOrCreationError_creation_error(a);
+               SignOrCreationError ret_hu_conv = SignOrCreationError.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               return ret_hu_conv;
+       }
+
        public boolean eq(SignOrCreationError b) {
                boolean ret = bindings.SignOrCreationError_eq(this.ptr, b == null ? 0 : b.ptr & ~1);
                this.ptrs_to.add(b);
index caf6286f85360060f8fd5a397a0f01605dade792..33d2980825027d12c10213a4959019da68094829 100644 (file)
@@ -64,6 +64,30 @@ export class StaticPaymentOutput extends SpendableOutputDescriptor {
                return ret_hu_conv;
        }
 
+       public static SpendableOutputDescriptor constructor_static_output(OutPoint outpoint, TxOut output) {
+               number ret = bindings.SpendableOutputDescriptor_static_output(outpoint == null ? 0 : outpoint.ptr & ~1, output.ptr);
+               SpendableOutputDescriptor ret_hu_conv = SpendableOutputDescriptor.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(outpoint);
+               return ret_hu_conv;
+       }
+
+       public static SpendableOutputDescriptor constructor_delayed_payment_output(DelayedPaymentOutputDescriptor a) {
+               number ret = bindings.SpendableOutputDescriptor_delayed_payment_output(a == null ? 0 : a.ptr & ~1);
+               SpendableOutputDescriptor ret_hu_conv = SpendableOutputDescriptor.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(a);
+               return ret_hu_conv;
+       }
+
+       public static SpendableOutputDescriptor constructor_static_payment_output(StaticPaymentOutputDescriptor a) {
+               number ret = bindings.SpendableOutputDescriptor_static_payment_output(a == null ? 0 : a.ptr & ~1);
+               SpendableOutputDescriptor ret_hu_conv = SpendableOutputDescriptor.constr_from_ptr(ret);
+               ret_hu_conv.ptrs_to.add(ret_hu_conv);
+               ret_hu_conv.ptrs_to.add(a);
+               return ret_hu_conv;
+       }
+
        public Uint8Array write() {
                Uint8Array ret = bindings.SpendableOutputDescriptor_write(this.ptr);
                return ret;
index c0dc8c12ecdad95b8432e1b3927805955bfff8af..09969ade581fcbf10ecbd22e136cdb5f8e7badbd 100644 (file)
@@ -3,11 +3,26 @@ import CommonBase from './CommonBase';
 import * as bindings from '../bindings' // TODO: figure out location
 
 public class TxOut extends CommonBase{
-       TxOut(java.lang.Object _dummy, long ptr) { super(ptr); }
-       long to_c_ptr() { return 0; }
+       /** The script_pubkey in this output */
+       public final byte[] script_pubkey;
+       /** The value, in satoshis, of this output */
+       public final long value;
+
+       TxOut(java.lang.Object _dummy, long ptr) {
+               super(ptr);
+               this.script_pubkey = bindings.TxOut_get_script_pubkey(ptr);
+               this.value = bindings.TxOut_get_value(ptr);
+       }
+       public TxOut(long value, byte[] script_pubkey) {
+               super(bindings.TxOut_new(script_pubkey, value));
+               this.script_pubkey = bindings.TxOut_get_script_pubkey(ptr);
+               this.value = bindings.TxOut_get_value(ptr);
+       }
+
        @Override @SuppressWarnings("deprecation")
        protected void finalize() throws Throwable {
                super.finalize();
                if (ptr != 0) { bindings.TxOut_free(ptr); }
        }
+
 }
\ No newline at end of file
index e7a35ed53d96cbd527599349526936ffab59caef..524f81b26f982579c6a1830381374d2f0f29cb58 100644 (file)
@@ -67,7 +67,7 @@ import * as bindings from '../bindings' // TODO: figure out location
        }
 
        public void set_addresses(NetAddress[] val) {
-               bindings.UnsignedNodeAnnouncement_set_addresses(this.ptr, Arrays.stream(val).map(val_conv_12 -> val_conv_12.ptr).toArray(number[]::new));
+               bindings.UnsignedNodeAnnouncement_set_addresses(this.ptr, val != null ? Arrays.stream(val).map(val_conv_12 -> val_conv_12.ptr).toArray(number[]::new) : null);
                /* TODO 2 NetAddress  */;
        }
 
index 298df049d1721eca5c68261da10b1d1d12e69472..fa0c2d44248b6b670b5a6c0c32430535b2d783dc 100644 (file)
@@ -23,7 +23,7 @@
        }
 
        public static Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ constructor_BlockHashChannelManagerZ_read(Uint8Array 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) {
-               number 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).map(arg_channel_monitors_conv_16 -> arg_channel_monitors_conv_16 == null ? 0 : arg_channel_monitors_conv_16.ptr & ~1).toArray(number[]::new)));
+               number 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, arg_channel_monitors != null ? Arrays.stream(arg_channel_monitors).map(arg_channel_monitors_conv_16 -> arg_channel_monitors_conv_16 == null ? 0 : arg_channel_monitors_conv_16.ptr & ~1).toArray(number[]::new) : 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);
@@ -93,7 +93,7 @@
        }
 
        public static Result_RouteLightningErrorZ constructor_et_route(Uint8Array our_node_id, NetworkGraph network, Uint8Array payee, InvoiceFeatures payee_features, ChannelDetails[] first_hops, RouteHint[] last_hops, number final_value_msat, number final_cltv, Logger logger) {
-               number 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).map(first_hops_conv_16 -> first_hops_conv_16 == null ? 0 : first_hops_conv_16.ptr & ~1).toArray(number[]::new), Arrays.stream(last_hops).map(last_hops_conv_11 -> last_hops_conv_11 == null ? 0 : last_hops_conv_11.ptr & ~1).toArray(number[]::new), final_value_msat, final_cltv, logger == null ? 0 : logger.ptr);
+               number ret = bindings.get_route(our_node_id, network == null ? 0 : network.ptr & ~1, payee, payee_features == null ? 0 : payee_features.ptr & ~1, first_hops != null ? Arrays.stream(first_hops).map(first_hops_conv_16 -> first_hops_conv_16 == null ? 0 : first_hops_conv_16.ptr & ~1).toArray(number[]::new) : null, last_hops != null ? Arrays.stream(last_hops).map(last_hops_conv_11 -> last_hops_conv_11 == null ? 0 : last_hops_conv_11.ptr & ~1).toArray(number[]::new) : null, final_value_msat, final_cltv, logger == null ? 0 : logger.ptr);
                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);
index b1a752e9994033b9bb8657a3ab9d7d1f124c9f13..d2765e3d6b6c3f78e755cb769ead9746e5263c17 100644 (file)
@@ -54,7 +54,7 @@ import * as bindings from '../bindings' // TODO: figure out location
 
                                                release_pending_monitor_events (): number[] {
                                                        MonitorEvent[] ret = arg.release_pending_monitor_events();
-                               result: number[] = Arrays.stream(ret).map(ret_conv_14 -> ret_conv_14.ptr).toArray(number[]::new);
+                               result: number[] = ret != null ? Arrays.stream(ret).map(ret_conv_14 -> ret_conv_14.ptr).toArray(number[]::new) : null;
                                /* TODO 2 MonitorEvent  */;
                                return result;
                                                },