Fix write method generation w/ upstream changes
[ldk-java] / src / main / java / org / ldk / impl / bindings.java
index d62f0866a3aa00f92ae31df025348f3991fddef4..097aa22037352e7cda7159c188483f08d47ed134 100644 (file)
@@ -13,8 +13,10 @@ public class bindings {
        static {
                System.loadLibrary("lightningjni");
                init(java.lang.Enum.class, VecOrSliceDef.class);
+               init_class_cache();
        }
        static native void init(java.lang.Class c, java.lang.Class slicedef);
+       static native void init_class_cache();
 
        public static native boolean deref_bool(long ptr);
        public static native long deref_long(long ptr);
@@ -24,6 +26,7 @@ public class bindings {
        public static native long bytes_to_u8_vec(byte[] bytes);
        public static native long new_txpointer_copy_data(byte[] txdata);
        public static native void txpointer_free(long ptr);
+       public static native byte[] txpointer_get_buffer(long ptr);
        public static native long vec_slice_len(long vec);
        public static native long new_empty_slice_vec();
 
@@ -35,9 +38,9 @@ public class bindings {
        static { LDKSecp256k1Error.values(); /* Force enum statics to run */ }
        public static native VecOrSliceDef LDKCVecTempl_u8_arr_info(long vec_ptr);
        public static native long LDKCVecTempl_u8_new(byte[] elems);
-       public static native long LDKC2TupleTempl_usize__Transaction_new(long a, long b);
+       public static native long LDKC2TupleTempl_usize__Transaction_new(long a, byte[] b);
        public static native long LDKC2Tuple_usizeTransactionZ_get_a(long ptr);
-       public static native long LDKC2Tuple_usizeTransactionZ_get_b(long ptr);
+       public static native byte[] LDKC2Tuple_usizeTransactionZ_get_b(long ptr);
        public static native boolean LDKCResult_NoneChannelMonitorUpdateErrZ_result_ok(long arg);
        public static native byte LDKCResult_NoneChannelMonitorUpdateErrZ_get_ok(long arg);
        public static native LDKChannelMonitorUpdateErr LDKCResult_NoneChannelMonitorUpdateErrZ_get_err(long arg);
@@ -336,14 +339,15 @@ public class bindings {
                 byte[] get_per_commitment_point(long idx);
                 byte[] release_commitment_secret(long idx);
                 long key_derivation_params();
-                long sign_counterparty_commitment(int feerate_per_kw, long commitment_tx, long keys, long[] htlcs);
+                long sign_counterparty_commitment(int feerate_per_kw, byte[] commitment_tx, long keys, long[] htlcs);
                 long sign_holder_commitment(long holder_commitment_tx);
                 long sign_holder_commitment_htlc_transactions(long holder_commitment_tx);
-                long sign_justice_transaction(long justice_tx, long input, long amount, byte[] per_commitment_key, long htlc);
-                long sign_counterparty_htlc_transaction(long htlc_tx, long input, long amount, byte[] per_commitment_point, long htlc);
-                long sign_closing_transaction(long closing_tx);
+                long sign_justice_transaction(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, long htlc);
+                long sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, long htlc);
+                long sign_closing_transaction(byte[] closing_tx);
                 long sign_channel_announcement(long msg);
                 void on_accept(long channel_points, short counterparty_selected_contest_delay, short holder_selected_contest_delay);
+                byte[] write();
        }
        public static native long LDKChannelKeys_new(LDKChannelKeys impl, long pubkeys);
        public static native LDKChannelKeys LDKChannelKeys_get_obj_from_jcalls(long val);
@@ -354,21 +358,23 @@ public class bindings {
        // LDKC2Tuple_u64u64Z ChannelKeys_key_derivation_params LDKChannelKeys* this_arg
        public static native long ChannelKeys_key_derivation_params(long this_arg);
        // LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ChannelKeys_sign_counterparty_commitment LDKChannelKeys* this_arg, uint32_t feerate_per_kw, LDKTransaction commitment_tx, const LDKPreCalculatedTxCreationKeys *keys, LDKCVec_HTLCOutputInCommitmentZ htlcs
-       public static native long ChannelKeys_sign_counterparty_commitment(long this_arg, int feerate_per_kw, long commitment_tx, long keys, long[] htlcs);
+       public static native long ChannelKeys_sign_counterparty_commitment(long this_arg, int feerate_per_kw, byte[] commitment_tx, long keys, long[] htlcs);
        // LDKCResult_SignatureNoneZ ChannelKeys_sign_holder_commitment LDKChannelKeys* this_arg, const LDKHolderCommitmentTransaction *holder_commitment_tx
        public static native long ChannelKeys_sign_holder_commitment(long this_arg, long holder_commitment_tx);
        // LDKCResult_CVec_SignatureZNoneZ ChannelKeys_sign_holder_commitment_htlc_transactions LDKChannelKeys* this_arg, const LDKHolderCommitmentTransaction *holder_commitment_tx
        public static native long ChannelKeys_sign_holder_commitment_htlc_transactions(long this_arg, long holder_commitment_tx);
        // LDKCResult_SignatureNoneZ ChannelKeys_sign_justice_transaction LDKChannelKeys* this_arg, LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (*per_commitment_key)[32], const LDKHTLCOutputInCommitment *htlc
-       public static native long ChannelKeys_sign_justice_transaction(long this_arg, long justice_tx, long input, long amount, byte[] per_commitment_key, long htlc);
+       public static native long ChannelKeys_sign_justice_transaction(long this_arg, byte[] justice_tx, long input, long amount, byte[] per_commitment_key, long htlc);
        // LDKCResult_SignatureNoneZ ChannelKeys_sign_counterparty_htlc_transaction LDKChannelKeys* this_arg, LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, LDKPublicKey per_commitment_point, const LDKHTLCOutputInCommitment *htlc
-       public static native long ChannelKeys_sign_counterparty_htlc_transaction(long this_arg, long htlc_tx, long input, long amount, byte[] per_commitment_point, long htlc);
+       public static native long ChannelKeys_sign_counterparty_htlc_transaction(long this_arg, byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, long htlc);
        // LDKCResult_SignatureNoneZ ChannelKeys_sign_closing_transaction LDKChannelKeys* this_arg, LDKTransaction closing_tx
-       public static native long ChannelKeys_sign_closing_transaction(long this_arg, long closing_tx);
+       public static native long ChannelKeys_sign_closing_transaction(long this_arg, byte[] closing_tx);
        // LDKCResult_SignatureNoneZ ChannelKeys_sign_channel_announcement LDKChannelKeys* this_arg, const LDKUnsignedChannelAnnouncement *msg
        public static native long ChannelKeys_sign_channel_announcement(long this_arg, long msg);
        // void ChannelKeys_on_accept LDKChannelKeys* this_arg, const LDKChannelPublicKeys *channel_points, uint16_t counterparty_selected_contest_delay, uint16_t holder_selected_contest_delay
        public static native void ChannelKeys_on_accept(long this_arg, long channel_points, short counterparty_selected_contest_delay, short holder_selected_contest_delay);
+       // LDKCVec_u8Z ChannelKeys_write LDKChannelKeys* this_arg
+       public static native byte[] ChannelKeys_write(long this_arg);
        // LDKChannelPublicKeys ChannelKeys_get_pubkeys LDKChannelKeys* this_arg
        public static native long ChannelKeys_get_pubkeys(long this_arg);
        public static native long[] LDKCVecTempl_MonitorEvent_arr_info(long vec_ptr);
@@ -397,12 +403,12 @@ public class bindings {
        // void Filter_register_output LDKFilter* this_arg, const LDKOutPoint *outpoint, LDKu8slice script_pubkey
        public static native void Filter_register_output(long this_arg, long outpoint, byte[] script_pubkey);
        public interface LDKBroadcasterInterface {
-                void broadcast_transaction(long tx);
+                void broadcast_transaction(byte[] tx);
        }
        public static native long LDKBroadcasterInterface_new(LDKBroadcasterInterface impl);
        public static native LDKBroadcasterInterface LDKBroadcasterInterface_get_obj_from_jcalls(long val);
        // void BroadcasterInterface_broadcast_transaction LDKBroadcasterInterface* this_arg, LDKTransaction tx
-       public static native void BroadcasterInterface_broadcast_transaction(long this_arg, long tx);
+       public static native void BroadcasterInterface_broadcast_transaction(long this_arg, byte[] tx);
        public interface LDKFeeEstimator {
                 int get_est_sat_per_1000_weight(LDKConfirmationTarget confirmation_target);
        }
@@ -413,7 +419,6 @@ public class bindings {
        public static native VecOrSliceDef LDKCVecTempl_C2TupleTempl_usize__Transaction_arr_info(long vec_ptr);
        public static native long LDKCVecTempl_C2TupleTempl_usize__Transaction_new(long[] elems);
        public static native VecOrSliceDef LDKCVecTempl_Transaction_arr_info(long vec_ptr);
-       public static native long LDKCVecTempl_Transaction_new(long[] elems);
        public static native VecOrSliceDef LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut_arr_info(long vec_ptr);
        public static native long LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut_new(long[] elems);
        public interface LDKKeysInterface {
@@ -743,7 +748,7 @@ public class bindings {
        // extern const void (*CVec_SpendableOutputDescriptorZ_free)(LDKCVec_SpendableOutputDescriptorZ);
        public static native void CVec_SpendableOutputDescriptorZ_free(long[] arg);
        // extern const void (*CVec_TransactionZ_free)(LDKCVec_TransactionZ);
-       public static native void CVec_TransactionZ_free(long[] arg);
+       public static native void CVec_TransactionZ_free(byte[][] arg);
        // extern const void (*CVec_TxOutZ_free)(LDKCVec_TxOutZ);
        public static native void CVec_TxOutZ_free(long[] arg);
        // extern const void (*CVec_UpdateAddHTLCZ_free)(LDKCVec_UpdateAddHTLCZ);
@@ -759,11 +764,11 @@ public class bindings {
        // extern const void (*CVec_u8Z_free)(LDKCVec_u8Z);
        public static native void CVec_u8Z_free(byte[] arg);
        // void Transaction_free(LDKTransaction _res);
-       public static native void Transaction_free(long _res);
+       public static native void Transaction_free(byte[] _res);
        // void TxOut_free(LDKTxOut _res);
        public static native void TxOut_free(long _res);
        // LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, LDKTransaction b);
-       public static native long C2Tuple_usizeTransactionZ_new(long a, long b);
+       public static native long C2Tuple_usizeTransactionZ_new(long a, byte[] b);
        // LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_ok(void);
        public static native long CResult_NoneChannelMonitorUpdateErrZ_ok();
        // LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_ok(void);
@@ -960,8 +965,8 @@ public class bindings {
        public static native long ChannelMonitorUpdate_get_update_id(long this_ptr);
        // void ChannelMonitorUpdate_set_update_id(LDKChannelMonitorUpdate *this_ptr, uint64_t val);
        public static native void ChannelMonitorUpdate_set_update_id(long this_ptr, long val);
-       // LDKCVec_u8Z ChannelMonitorUpdate_write(const LDKChannelMonitorUpdate *obj);
-       public static native byte[] ChannelMonitorUpdate_write(long obj);
+       // LDKCVec_u8Z ChannelMonitorUpdate_write(const LDKChannelMonitorUpdate *this_ptr);
+       public static native byte[] ChannelMonitorUpdate_write(long this_ptr);
        // LDKChannelMonitorUpdate ChannelMonitorUpdate_read(LDKu8slice ser);
        public static native long ChannelMonitorUpdate_read(byte[] ser);
        // LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const LDKChannelMonitorUpdateErr *orig);
@@ -982,6 +987,8 @@ public class bindings {
        public static native long HTLCUpdate_read(byte[] ser);
        // void ChannelMonitor_free(LDKChannelMonitor this_ptr);
        public static native void ChannelMonitor_free(long this_ptr);
+       // LDKCVec_u8Z ChannelMonitor_write(const LDKChannelMonitor *this_ptr);
+       public static native byte[] ChannelMonitor_write(long this_ptr);
        // MUST_USE_RES LDKCResult_NoneMonitorUpdateErrorZ ChannelMonitor_update_monitor(LDKChannelMonitor *this_arg, LDKChannelMonitorUpdate updates, const LDKBroadcasterInterface *broadcaster, const LDKLogger *logger);
        public static native long ChannelMonitor_update_monitor(long this_arg, long updates, long broadcaster, long logger);
        // MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const LDKChannelMonitor *this_arg);
@@ -993,7 +1000,7 @@ public class bindings {
        // MUST_USE_RES LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(LDKChannelMonitor *this_arg);
        public static native long[] ChannelMonitor_get_and_clear_pending_events(long this_arg);
        // MUST_USE_RES LDKCVec_TransactionZ ChannelMonitor_get_latest_holder_commitment_txn(LDKChannelMonitor *this_arg, const LDKLogger *logger);
-       public static native long[] ChannelMonitor_get_latest_holder_commitment_txn(long this_arg, long logger);
+       public static native byte[][] ChannelMonitor_get_latest_holder_commitment_txn(long this_arg, long logger);
        // MUST_USE_RES LDKCVec_C2Tuple_TxidCVec_TxOutZZZ ChannelMonitor_block_connected(LDKChannelMonitor *this_arg, const uint8_t (*header)[80], LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height, LDKBroadcasterInterface broadcaster, LDKFeeEstimator fee_estimator, LDKLogger logger);
        public static native long[] ChannelMonitor_block_connected(long this_arg, byte[] header, long[] txdata, int height, long broadcaster, long fee_estimator, long logger);
        // void ChannelMonitor_block_disconnected(LDKChannelMonitor *this_arg, const uint8_t (*header)[80], uint32_t height, LDKBroadcasterInterface broadcaster, LDKFeeEstimator fee_estimator, LDKLogger logger);
@@ -1022,6 +1029,8 @@ public class bindings {
        public static native void SpendableOutputDescriptor_free(long this_ptr);
        // LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const LDKSpendableOutputDescriptor *orig);
        public static native long SpendableOutputDescriptor_clone(long orig);
+       // LDKChannelKeys ChannelKeys_clone(const LDKChannelKeys *orig);
+       public static native long ChannelKeys_clone(long orig);
        // void ChannelKeys_free(LDKChannelKeys this_ptr);
        public static native void ChannelKeys_free(long this_ptr);
        // void KeysInterface_free(LDKKeysInterface this_ptr);
@@ -1064,8 +1073,8 @@ public class bindings {
        public static native short InMemoryChannelKeys_holder_selected_contest_delay(long this_arg);
        // LDKChannelKeys InMemoryChannelKeys_as_ChannelKeys(const LDKInMemoryChannelKeys *this_arg);
        public static native long InMemoryChannelKeys_as_ChannelKeys(long this_arg);
-       // LDKCVec_u8Z InMemoryChannelKeys_write(const LDKInMemoryChannelKeys *obj);
-       public static native byte[] InMemoryChannelKeys_write(long obj);
+       // LDKCVec_u8Z InMemoryChannelKeys_write(const LDKInMemoryChannelKeys *this_ptr);
+       public static native byte[] InMemoryChannelKeys_write(long this_ptr);
        // LDKInMemoryChannelKeys InMemoryChannelKeys_read(LDKu8slice ser);
        public static native long InMemoryChannelKeys_read(byte[] ser);
        // void KeysManager_free(LDKKeysManager this_ptr);
@@ -1158,6 +1167,8 @@ public class bindings {
        public static native void ChannelManager_block_disconnected(long this_arg, byte[] header);
        // LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const LDKChannelManager *this_arg);
        public static native long ChannelManager_as_ChannelMessageHandler(long this_arg);
+       // LDKCVec_u8Z ChannelManager_write(const LDKChannelManager *this_ptr);
+       public static native byte[] ChannelManager_write(long this_ptr);
        // void ChannelManagerReadArgs_free(LDKChannelManagerReadArgs this_ptr);
        public static native void ChannelManagerReadArgs_free(long this_ptr);
        // const LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const LDKChannelManagerReadArgs *this_ptr);
@@ -1910,8 +1921,8 @@ public class bindings {
        public static native byte[] AnnouncementSignatures_write(long obj);
        // LDKAnnouncementSignatures AnnouncementSignatures_read(LDKu8slice ser);
        public static native long AnnouncementSignatures_read(byte[] ser);
-       // LDKCVec_u8Z ChannelReestablish_write(const LDKChannelReestablish *obj);
-       public static native byte[] ChannelReestablish_write(long obj);
+       // LDKCVec_u8Z ChannelReestablish_write(const LDKChannelReestablish *this_ptr);
+       public static native byte[] ChannelReestablish_write(long this_ptr);
        // LDKChannelReestablish ChannelReestablish_read(LDKu8slice ser);
        public static native long ChannelReestablish_read(byte[] ser);
        // LDKCVec_u8Z ClosingSigned_write(const LDKClosingSigned *obj);
@@ -1934,8 +1945,8 @@ public class bindings {
        public static native byte[] FundingLocked_write(long obj);
        // LDKFundingLocked FundingLocked_read(LDKu8slice ser);
        public static native long FundingLocked_read(byte[] ser);
-       // LDKCVec_u8Z Init_write(const LDKInit *obj);
-       public static native byte[] Init_write(long obj);
+       // LDKCVec_u8Z Init_write(const LDKInit *this_ptr);
+       public static native byte[] Init_write(long this_ptr);
        // LDKInit Init_read(LDKu8slice ser);
        public static native long Init_read(byte[] ser);
        // LDKCVec_u8Z OpenChannel_write(const LDKOpenChannel *obj);
@@ -1970,36 +1981,36 @@ public class bindings {
        public static native byte[] UpdateAddHTLC_write(long obj);
        // LDKUpdateAddHTLC UpdateAddHTLC_read(LDKu8slice ser);
        public static native long UpdateAddHTLC_read(byte[] ser);
-       // LDKCVec_u8Z Ping_write(const LDKPing *obj);
-       public static native byte[] Ping_write(long obj);
+       // LDKCVec_u8Z Ping_write(const LDKPing *this_ptr);
+       public static native byte[] Ping_write(long this_ptr);
        // LDKPing Ping_read(LDKu8slice ser);
        public static native long Ping_read(byte[] ser);
-       // LDKCVec_u8Z Pong_write(const LDKPong *obj);
-       public static native byte[] Pong_write(long obj);
+       // LDKCVec_u8Z Pong_write(const LDKPong *this_ptr);
+       public static native byte[] Pong_write(long this_ptr);
        // LDKPong Pong_read(LDKu8slice ser);
        public static native long Pong_read(byte[] ser);
-       // LDKCVec_u8Z UnsignedChannelAnnouncement_write(const LDKUnsignedChannelAnnouncement *obj);
-       public static native byte[] UnsignedChannelAnnouncement_write(long obj);
+       // LDKCVec_u8Z UnsignedChannelAnnouncement_write(const LDKUnsignedChannelAnnouncement *this_ptr);
+       public static native byte[] UnsignedChannelAnnouncement_write(long this_ptr);
        // LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_read(LDKu8slice ser);
        public static native long UnsignedChannelAnnouncement_read(byte[] ser);
        // LDKCVec_u8Z ChannelAnnouncement_write(const LDKChannelAnnouncement *obj);
        public static native byte[] ChannelAnnouncement_write(long obj);
        // LDKChannelAnnouncement ChannelAnnouncement_read(LDKu8slice ser);
        public static native long ChannelAnnouncement_read(byte[] ser);
-       // LDKCVec_u8Z UnsignedChannelUpdate_write(const LDKUnsignedChannelUpdate *obj);
-       public static native byte[] UnsignedChannelUpdate_write(long obj);
+       // LDKCVec_u8Z UnsignedChannelUpdate_write(const LDKUnsignedChannelUpdate *this_ptr);
+       public static native byte[] UnsignedChannelUpdate_write(long this_ptr);
        // LDKUnsignedChannelUpdate UnsignedChannelUpdate_read(LDKu8slice ser);
        public static native long UnsignedChannelUpdate_read(byte[] ser);
        // LDKCVec_u8Z ChannelUpdate_write(const LDKChannelUpdate *obj);
        public static native byte[] ChannelUpdate_write(long obj);
        // LDKChannelUpdate ChannelUpdate_read(LDKu8slice ser);
        public static native long ChannelUpdate_read(byte[] ser);
-       // LDKCVec_u8Z ErrorMessage_write(const LDKErrorMessage *obj);
-       public static native byte[] ErrorMessage_write(long obj);
+       // LDKCVec_u8Z ErrorMessage_write(const LDKErrorMessage *this_ptr);
+       public static native byte[] ErrorMessage_write(long this_ptr);
        // LDKErrorMessage ErrorMessage_read(LDKu8slice ser);
        public static native long ErrorMessage_read(byte[] ser);
-       // LDKCVec_u8Z UnsignedNodeAnnouncement_write(const LDKUnsignedNodeAnnouncement *obj);
-       public static native byte[] UnsignedNodeAnnouncement_write(long obj);
+       // LDKCVec_u8Z UnsignedNodeAnnouncement_write(const LDKUnsignedNodeAnnouncement *this_ptr);
+       public static native byte[] UnsignedNodeAnnouncement_write(long this_ptr);
        // LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_read(LDKu8slice ser);
        public static native long UnsignedNodeAnnouncement_read(byte[] ser);
        // LDKCVec_u8Z NodeAnnouncement_write(const LDKNodeAnnouncement *obj);
@@ -2008,24 +2019,24 @@ public class bindings {
        public static native long NodeAnnouncement_read(byte[] ser);
        // LDKQueryShortChannelIds QueryShortChannelIds_read(LDKu8slice ser);
        public static native long QueryShortChannelIds_read(byte[] ser);
-       // LDKCVec_u8Z QueryShortChannelIds_write(const LDKQueryShortChannelIds *obj);
-       public static native byte[] QueryShortChannelIds_write(long obj);
+       // LDKCVec_u8Z QueryShortChannelIds_write(const LDKQueryShortChannelIds *this_ptr);
+       public static native byte[] QueryShortChannelIds_write(long this_ptr);
        // LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_read(LDKu8slice ser);
        public static native long ReplyShortChannelIdsEnd_read(byte[] ser);
-       // LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const LDKReplyShortChannelIdsEnd *obj);
-       public static native byte[] ReplyShortChannelIdsEnd_write(long obj);
+       // LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const LDKReplyShortChannelIdsEnd *this_ptr);
+       public static native byte[] ReplyShortChannelIdsEnd_write(long this_ptr);
        // LDKQueryChannelRange QueryChannelRange_read(LDKu8slice ser);
        public static native long QueryChannelRange_read(byte[] ser);
-       // LDKCVec_u8Z QueryChannelRange_write(const LDKQueryChannelRange *obj);
-       public static native byte[] QueryChannelRange_write(long obj);
+       // LDKCVec_u8Z QueryChannelRange_write(const LDKQueryChannelRange *this_ptr);
+       public static native byte[] QueryChannelRange_write(long this_ptr);
        // LDKReplyChannelRange ReplyChannelRange_read(LDKu8slice ser);
        public static native long ReplyChannelRange_read(byte[] ser);
-       // LDKCVec_u8Z ReplyChannelRange_write(const LDKReplyChannelRange *obj);
-       public static native byte[] ReplyChannelRange_write(long obj);
+       // LDKCVec_u8Z ReplyChannelRange_write(const LDKReplyChannelRange *this_ptr);
+       public static native byte[] ReplyChannelRange_write(long this_ptr);
        // LDKGossipTimestampFilter GossipTimestampFilter_read(LDKu8slice ser);
        public static native long GossipTimestampFilter_read(byte[] ser);
-       // LDKCVec_u8Z GossipTimestampFilter_write(const LDKGossipTimestampFilter *obj);
-       public static native byte[] GossipTimestampFilter_write(long obj);
+       // LDKCVec_u8Z GossipTimestampFilter_write(const LDKGossipTimestampFilter *this_ptr);
+       public static native byte[] GossipTimestampFilter_write(long this_ptr);
        // void MessageHandler_free(LDKMessageHandler this_ptr);
        public static native void MessageHandler_free(long this_ptr);
        // const LDKChannelMessageHandler *MessageHandler_get_chan_handler(const LDKMessageHandler *this_ptr);
@@ -2038,6 +2049,8 @@ public class bindings {
        public static native void MessageHandler_set_route_handler(long this_ptr, long val);
        // MUST_USE_RES LDKMessageHandler MessageHandler_new(LDKChannelMessageHandler chan_handler_arg, LDKRoutingMessageHandler route_handler_arg);
        public static native long MessageHandler_new(long chan_handler_arg, long route_handler_arg);
+       // LDKSocketDescriptor SocketDescriptor_clone(const LDKSocketDescriptor *orig);
+       public static native long SocketDescriptor_clone(long orig);
        // void SocketDescriptor_free(LDKSocketDescriptor this_ptr);
        public static native void SocketDescriptor_free(long this_ptr);
        // void PeerHandleError_free(LDKPeerHandleError this_ptr);
@@ -2110,6 +2123,8 @@ public class bindings {
        public static native long TxCreationKeys_read(byte[] ser);
        // void PreCalculatedTxCreationKeys_free(LDKPreCalculatedTxCreationKeys this_ptr);
        public static native void PreCalculatedTxCreationKeys_free(long this_ptr);
+       // LDKPreCalculatedTxCreationKeys PreCalculatedTxCreationKeys_clone(const LDKPreCalculatedTxCreationKeys *orig);
+       public static native long PreCalculatedTxCreationKeys_clone(long orig);
        // MUST_USE_RES LDKPreCalculatedTxCreationKeys PreCalculatedTxCreationKeys_new(LDKTxCreationKeys keys);
        public static native long PreCalculatedTxCreationKeys_new(long keys);
        // MUST_USE_RES LDKTxCreationKeys PreCalculatedTxCreationKeys_trust_key_derivation(const LDKPreCalculatedTxCreationKeys *this_arg);
@@ -2179,15 +2194,15 @@ public class bindings {
        // LDKCVec_u8Z make_funding_redeemscript(LDKPublicKey broadcaster, LDKPublicKey countersignatory);
        public static native byte[] make_funding_redeemscript(byte[] broadcaster, byte[] countersignatory);
        // LDKTransaction build_htlc_transaction(const uint8_t (*prev_hash)[32], uint32_t feerate_per_kw, uint16_t contest_delay, const LDKHTLCOutputInCommitment *htlc, LDKPublicKey broadcaster_delayed_payment_key, LDKPublicKey revocation_key);
-       public static native long build_htlc_transaction(byte[] prev_hash, int feerate_per_kw, short contest_delay, long htlc, byte[] broadcaster_delayed_payment_key, byte[] revocation_key);
+       public static native byte[] build_htlc_transaction(byte[] prev_hash, int feerate_per_kw, short contest_delay, long htlc, byte[] broadcaster_delayed_payment_key, byte[] revocation_key);
        // void HolderCommitmentTransaction_free(LDKHolderCommitmentTransaction this_ptr);
        public static native void HolderCommitmentTransaction_free(long this_ptr);
        // LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const LDKHolderCommitmentTransaction *orig);
        public static native long HolderCommitmentTransaction_clone(long orig);
        // LDKTransaction HolderCommitmentTransaction_get_unsigned_tx(const LDKHolderCommitmentTransaction *this_ptr);
-       public static native long HolderCommitmentTransaction_get_unsigned_tx(long this_ptr);
+       public static native byte[] HolderCommitmentTransaction_get_unsigned_tx(long this_ptr);
        // void HolderCommitmentTransaction_set_unsigned_tx(LDKHolderCommitmentTransaction *this_ptr, LDKTransaction val);
-       public static native void HolderCommitmentTransaction_set_unsigned_tx(long this_ptr, long val);
+       public static native void HolderCommitmentTransaction_set_unsigned_tx(long this_ptr, byte[] val);
        // LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const LDKHolderCommitmentTransaction *this_ptr);
        public static native byte[] HolderCommitmentTransaction_get_counterparty_sig(long this_ptr);
        // void HolderCommitmentTransaction_set_counterparty_sig(LDKHolderCommitmentTransaction *this_ptr, LDKSignature val);
@@ -2199,7 +2214,7 @@ public class bindings {
        // void HolderCommitmentTransaction_set_per_htlc(LDKHolderCommitmentTransaction *this_ptr, LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ val);
        public static native void HolderCommitmentTransaction_set_per_htlc(long this_ptr, long[] val);
        // MUST_USE_RES LDKHolderCommitmentTransaction HolderCommitmentTransaction_new_missing_holder_sig(LDKTransaction unsigned_tx, LDKSignature counterparty_sig, LDKPublicKey holder_funding_key, LDKPublicKey counterparty_funding_key, LDKTxCreationKeys keys, uint32_t feerate_per_kw, LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ htlc_data);
-       public static native long HolderCommitmentTransaction_new_missing_holder_sig(long unsigned_tx, byte[] counterparty_sig, byte[] holder_funding_key, byte[] counterparty_funding_key, long keys, int feerate_per_kw, long[] htlc_data);
+       public static native long HolderCommitmentTransaction_new_missing_holder_sig(byte[] unsigned_tx, byte[] counterparty_sig, byte[] holder_funding_key, byte[] counterparty_funding_key, long keys, int feerate_per_kw, long[] htlc_data);
        // MUST_USE_RES LDKTxCreationKeys HolderCommitmentTransaction_trust_key_derivation(const LDKHolderCommitmentTransaction *this_arg);
        public static native long HolderCommitmentTransaction_trust_key_derivation(long this_arg);
        // MUST_USE_RES LDKThirtyTwoBytes HolderCommitmentTransaction_txid(const LDKHolderCommitmentTransaction *this_arg);
@@ -2208,8 +2223,8 @@ public class bindings {
        public static native byte[] HolderCommitmentTransaction_get_holder_sig(long this_arg, byte[] funding_key, byte[] funding_redeemscript, long channel_value_satoshis);
        // MUST_USE_RES LDKCResult_CVec_SignatureZNoneZ HolderCommitmentTransaction_get_htlc_sigs(const LDKHolderCommitmentTransaction *this_arg, const uint8_t (*htlc_base_key)[32], uint16_t counterparty_selected_contest_delay);
        public static native long HolderCommitmentTransaction_get_htlc_sigs(long this_arg, byte[] htlc_base_key, short counterparty_selected_contest_delay);
-       // LDKCVec_u8Z HolderCommitmentTransaction_write(const LDKHolderCommitmentTransaction *obj);
-       public static native byte[] HolderCommitmentTransaction_write(long obj);
+       // LDKCVec_u8Z HolderCommitmentTransaction_write(const LDKHolderCommitmentTransaction *this_ptr);
+       public static native byte[] HolderCommitmentTransaction_write(long this_ptr);
        // LDKHolderCommitmentTransaction HolderCommitmentTransaction_read(LDKu8slice ser);
        public static native long HolderCommitmentTransaction_read(byte[] ser);
        // void InitFeatures_free(LDKInitFeatures this_ptr);
@@ -2256,8 +2271,8 @@ public class bindings {
        public static native void Route_set_paths(long this_ptr, long[][] val);
        // MUST_USE_RES LDKRoute Route_new(LDKCVec_CVec_RouteHopZZ paths_arg);
        public static native long Route_new(long[][] paths_arg);
-       // LDKCVec_u8Z Route_write(const LDKRoute *obj);
-       public static native byte[] Route_write(long obj);
+       // LDKCVec_u8Z Route_write(const LDKRoute *this_ptr);
+       public static native byte[] Route_write(long this_ptr);
        // LDKRoute Route_read(LDKu8slice ser);
        public static native long Route_read(byte[] ser);
        // void RouteHint_free(LDKRouteHint this_ptr);
@@ -2376,8 +2391,8 @@ public class bindings {
        public static native long RoutingFees_new(int base_msat_arg, int proportional_millionths_arg);
        // LDKRoutingFees RoutingFees_read(LDKu8slice ser);
        public static native long RoutingFees_read(byte[] ser);
-       // LDKCVec_u8Z RoutingFees_write(const LDKRoutingFees *obj);
-       public static native byte[] RoutingFees_write(long obj);
+       // LDKCVec_u8Z RoutingFees_write(const LDKRoutingFees *this_ptr);
+       public static native byte[] RoutingFees_write(long this_ptr);
        // void NodeAnnouncementInfo_free(LDKNodeAnnouncementInfo this_ptr);
        public static native void NodeAnnouncementInfo_free(long this_ptr);
        // LDKNodeFeatures NodeAnnouncementInfo_get_features(const LDKNodeAnnouncementInfo *this_ptr);
@@ -2404,8 +2419,8 @@ public class bindings {
        public static native void NodeAnnouncementInfo_set_announcement_message(long this_ptr, long val);
        // MUST_USE_RES LDKNodeAnnouncementInfo NodeAnnouncementInfo_new(LDKNodeFeatures features_arg, uint32_t last_update_arg, LDKThreeBytes rgb_arg, LDKThirtyTwoBytes alias_arg, LDKCVec_NetAddressZ addresses_arg, LDKNodeAnnouncement announcement_message_arg);
        public static native long NodeAnnouncementInfo_new(long features_arg, int last_update_arg, byte[] rgb_arg, byte[] alias_arg, long[] addresses_arg, long announcement_message_arg);
-       // LDKCVec_u8Z NodeAnnouncementInfo_write(const LDKNodeAnnouncementInfo *obj);
-       public static native byte[] NodeAnnouncementInfo_write(long obj);
+       // LDKCVec_u8Z NodeAnnouncementInfo_write(const LDKNodeAnnouncementInfo *this_ptr);
+       public static native byte[] NodeAnnouncementInfo_write(long this_ptr);
        // LDKNodeAnnouncementInfo NodeAnnouncementInfo_read(LDKu8slice ser);
        public static native long NodeAnnouncementInfo_read(byte[] ser);
        // void NodeInfo_free(LDKNodeInfo this_ptr);
@@ -2422,12 +2437,12 @@ public class bindings {
        public static native void NodeInfo_set_announcement_info(long this_ptr, long val);
        // MUST_USE_RES LDKNodeInfo NodeInfo_new(LDKCVec_u64Z channels_arg, LDKRoutingFees lowest_inbound_channel_fees_arg, LDKNodeAnnouncementInfo announcement_info_arg);
        public static native long NodeInfo_new(long[] channels_arg, long lowest_inbound_channel_fees_arg, long announcement_info_arg);
-       // LDKCVec_u8Z NodeInfo_write(const LDKNodeInfo *obj);
-       public static native byte[] NodeInfo_write(long obj);
+       // LDKCVec_u8Z NodeInfo_write(const LDKNodeInfo *this_ptr);
+       public static native byte[] NodeInfo_write(long this_ptr);
        // LDKNodeInfo NodeInfo_read(LDKu8slice ser);
        public static native long NodeInfo_read(byte[] ser);
-       // LDKCVec_u8Z NetworkGraph_write(const LDKNetworkGraph *obj);
-       public static native byte[] NetworkGraph_write(long obj);
+       // LDKCVec_u8Z NetworkGraph_write(const LDKNetworkGraph *this_ptr);
+       public static native byte[] NetworkGraph_write(long this_ptr);
        // LDKNetworkGraph NetworkGraph_read(LDKu8slice ser);
        public static native long NetworkGraph_read(byte[] ser);
        // MUST_USE_RES LDKNetworkGraph NetworkGraph_new(void);