Test current state of things, which actually doesn't crash!
[ldk-java] / src / main / java / org / ldk / impl / bindings.java
index e96e4c2eba30cb254873cb9170d95ac17d78eb78..947468c35abb8269d2eed8762519dbd9a40f9964 100644 (file)
@@ -5,105 +5,107 @@ public class bindings {
                System.loadLibrary("lightningjni");
        }
 
+       public static native long LDKSecretKey_new();
+
        public interface LDKMessageSendEventsProvider {
-                long get_and_clear_pending_msg_events(/* TODO */);
+                long get_and_clear_pending_msg_events();
        }
        public static native long LDKMessageSendEventsProvider_new(LDKMessageSendEventsProvider impl);
        public interface LDKEventsProvider {
-                long get_and_clear_pending_events(/* TODO */);
+                long get_and_clear_pending_events();
        }
        public static native long LDKEventsProvider_new(LDKEventsProvider impl);
        public interface LDKLogger {
-                void log(/* TODO */);
+                void log(String record);
        }
        public static native long LDKLogger_new(LDKLogger impl);
        public interface LDKChainWatchInterface {
-                void install_watch_tx(/* TODO */);
-                void install_watch_outpoint(/* TODO */);
-                void watch_all_txn(/* TODO */);
-                long get_chain_utxo(/* TODO */);
-                long filter_block(/* TODO */);
-                long reentered(/* TODO */);
+                void install_watch_tx(byte[] txid, long script_pub_key);
+                void install_watch_outpoint(long outpoint, long out_script);
+                void watch_all_txn();
+                long get_chain_utxo(long genesis_hash, long unspent_tx_output_identifier);
+                long filter_block(long block);
+                long reentered();
        }
        public static native long LDKChainWatchInterface_new(LDKChainWatchInterface impl);
        public interface LDKBroadcasterInterface {
-                void broadcast_transaction(/* TODO */);
+                void broadcast_transaction(long tx);
        }
        public static native long LDKBroadcasterInterface_new(LDKBroadcasterInterface impl);
        public interface LDKChainListener {
-                void block_connected(/* TODO */);
-                void block_disconnected(/* TODO */);
+                void block_connected(byte[] header, int height, long txn_matched, long indexes_of_txn_matched);
+                void block_disconnected(byte[] header, int disconnected_height);
        }
        public static native long LDKChainListener_new(LDKChainListener impl);
        public interface LDKFeeEstimator {
-                int get_est_sat_per_1000_weight(/* TODO */);
+                int get_est_sat_per_1000_weight(long confirmation_target);
        }
        public static native long LDKFeeEstimator_new(LDKFeeEstimator impl);
        public interface LDKChannelKeys {
-                long get_per_commitment_point(/* TODO */);
-                long release_commitment_secret(/* TODO */);
-                long key_derivation_params(/* TODO */);
-                long sign_remote_commitment(/* TODO */);
-                long sign_local_commitment(/* TODO */);
-                long sign_local_commitment_htlc_transactions(/* TODO */);
-                long sign_justice_transaction(/* TODO */);
-                long sign_remote_htlc_transaction(/* TODO */);
-                long sign_closing_transaction(/* TODO */);
-                long sign_channel_announcement(/* TODO */);
-                void on_accept(/* TODO */);
+                long get_per_commitment_point(long idx);
+                long release_commitment_secret(long idx);
+                long key_derivation_params();
+                long sign_remote_commitment(int feerate_per_kw, long commitment_tx, long keys, long htlcs);
+                long sign_local_commitment(long local_commitment_tx);
+                long sign_local_commitment_htlc_transactions(long local_commitment_tx);
+                long sign_justice_transaction(long justice_tx, long input, long amount, byte[] per_commitment_key, long htlc);
+                long sign_remote_htlc_transaction(long htlc_tx, long input, long amount, long per_commitment_point, long htlc);
+                long sign_closing_transaction(long closing_tx);
+                long sign_channel_announcement(long msg);
+                void on_accept(long channel_points, short remote_to_self_delay, short local_to_self_delay);
        }
        public static native long LDKChannelKeys_new(LDKChannelKeys impl);
        public interface LDKKeysInterface {
-                long get_node_secret(/* TODO */);
-                long get_destination_script(/* TODO */);
-                long get_shutdown_pubkey(/* TODO */);
-                long get_channel_keys(/* TODO */);
-                long get_secure_random_bytes(/* TODO */);
+                long get_node_secret();
+                long get_destination_script();
+                long get_shutdown_pubkey();
+                long get_channel_keys(boolean inbound, long channel_value_satoshis);
+                long get_secure_random_bytes();
        }
        public static native long LDKKeysInterface_new(LDKKeysInterface impl);
        public interface LDKManyChannelMonitor {
-                long add_monitor(/* TODO */);
-                long update_monitor(/* TODO */);
-                long get_and_clear_pending_monitor_events(/* TODO */);
+                long add_monitor(long funding_txo, long monitor);
+                long update_monitor(long funding_txo, long monitor);
+                long get_and_clear_pending_monitor_events();
        }
        public static native long LDKManyChannelMonitor_new(LDKManyChannelMonitor impl);
        public interface LDKChannelMessageHandler {
-                void handle_open_channel(/* TODO */);
-                void handle_accept_channel(/* TODO */);
-                void handle_funding_created(/* TODO */);
-                void handle_funding_signed(/* TODO */);
-                void handle_funding_locked(/* TODO */);
-                void handle_shutdown(/* TODO */);
-                void handle_closing_signed(/* TODO */);
-                void handle_update_add_htlc(/* TODO */);
-                void handle_update_fulfill_htlc(/* TODO */);
-                void handle_update_fail_htlc(/* TODO */);
-                void handle_update_fail_malformed_htlc(/* TODO */);
-                void handle_commitment_signed(/* TODO */);
-                void handle_revoke_and_ack(/* TODO */);
-                void handle_update_fee(/* TODO */);
-                void handle_announcement_signatures(/* TODO */);
-                void peer_disconnected(/* TODO */);
-                void peer_connected(/* TODO */);
-                void handle_channel_reestablish(/* TODO */);
-                void handle_error(/* TODO */);
+                void handle_open_channel(long their_node_id, long their_features, long msg);
+                void handle_accept_channel(long their_node_id, long their_features, long msg);
+                void handle_funding_created(long their_node_id, long msg);
+                void handle_funding_signed(long their_node_id, long msg);
+                void handle_funding_locked(long their_node_id, long msg);
+                void handle_shutdown(long their_node_id, long msg);
+                void handle_closing_signed(long their_node_id, long msg);
+                void handle_update_add_htlc(long their_node_id, long msg);
+                void handle_update_fulfill_htlc(long their_node_id, long msg);
+                void handle_update_fail_htlc(long their_node_id, long msg);
+                void handle_update_fail_malformed_htlc(long their_node_id, long msg);
+                void handle_commitment_signed(long their_node_id, long msg);
+                void handle_revoke_and_ack(long their_node_id, long msg);
+                void handle_update_fee(long their_node_id, long msg);
+                void handle_announcement_signatures(long their_node_id, long msg);
+                void peer_disconnected(long their_node_id, boolean no_connection_possible);
+                void peer_connected(long their_node_id, long msg);
+                void handle_channel_reestablish(long their_node_id, long msg);
+                void handle_error(long their_node_id, long msg);
        }
-       public static native long LDKChannelMessageHandler_new(LDKChannelMessageHandler impl);
+       public static native long LDKChannelMessageHandler_new(LDKChannelMessageHandler impl, LDKMessageSendEventsProvider MessageSendEventsProvider);
        public interface LDKRoutingMessageHandler {
-                long handle_node_announcement(/* TODO */);
-                long handle_channel_announcement(/* TODO */);
-                long handle_channel_update(/* TODO */);
-                void handle_htlc_fail_channel_update(/* TODO */);
-                long get_next_channel_announcements(/* TODO */);
-                long get_next_node_announcements(/* TODO */);
-                boolean should_request_full_sync(/* TODO */);
+                long handle_node_announcement(long msg);
+                long handle_channel_announcement(long msg);
+                long handle_channel_update(long msg);
+                void handle_htlc_fail_channel_update(long update);
+                long get_next_channel_announcements(long starting_point, byte batch_amount);
+                long get_next_node_announcements(long starting_point, byte batch_amount);
+                boolean should_request_full_sync(long node_id);
        }
        public static native long LDKRoutingMessageHandler_new(LDKRoutingMessageHandler impl);
        public interface LDKSocketDescriptor {
-                long send_data(/* TODO */);
-                void disconnect_socket(/* TODO */);
-                boolean eq(/* TODO */);
-                long hash(/* TODO */);
+                long send_data(long data, boolean resume_read);
+                void disconnect_socket();
+                boolean eq(long other_arg);
+                long hash();
        }
        public static native long LDKSocketDescriptor_new(LDKSocketDescriptor impl);
        /// extern const void (*C2Tuple_HTLCOutputInCommitmentSignatureZ_free)(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ);
@@ -289,15 +291,15 @@ public class bindings {
        /// void ChannelHandshakeConfig_set_minimum_depth(LDKChannelHandshakeConfig *this_ptr, uint32_t val);
        public static native void ChannelHandshakeConfig_set_minimum_depth(long this_ptr, int val);
        /// uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const LDKChannelHandshakeConfig *this_ptr);
-       public static native long ChannelHandshakeConfig_get_our_to_self_delay(long this_ptr);
+       public static native short ChannelHandshakeConfig_get_our_to_self_delay(long this_ptr);
        /// void ChannelHandshakeConfig_set_our_to_self_delay(LDKChannelHandshakeConfig *this_ptr, uint16_t val);
-       public static native void ChannelHandshakeConfig_set_our_to_self_delay(long this_ptr, long val);
+       public static native void ChannelHandshakeConfig_set_our_to_self_delay(long this_ptr, short val);
        /// uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const LDKChannelHandshakeConfig *this_ptr);
        public static native long ChannelHandshakeConfig_get_our_htlc_minimum_msat(long this_ptr);
        /// void ChannelHandshakeConfig_set_our_htlc_minimum_msat(LDKChannelHandshakeConfig *this_ptr, uint64_t val);
        public static native void ChannelHandshakeConfig_set_our_htlc_minimum_msat(long this_ptr, long val);
        /// MUST_USE_RES LDKChannelHandshakeConfig ChannelHandshakeConfig_new(uint32_t minimum_depth_arg, uint16_t our_to_self_delay_arg, uint64_t our_htlc_minimum_msat_arg);
-       public static native long ChannelHandshakeConfig_new(int minimum_depth_arg, long our_to_self_delay_arg, long our_htlc_minimum_msat_arg);
+       public static native long ChannelHandshakeConfig_new(int minimum_depth_arg, short our_to_self_delay_arg, long our_htlc_minimum_msat_arg);
        /// MUST_USE_RES LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void);
        public static native long ChannelHandshakeConfig_default();
        /// void ChannelHandshakeLimits_free(LDKChannelHandshakeLimits this_ptr);
@@ -319,9 +321,9 @@ public class bindings {
        /// void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(LDKChannelHandshakeLimits *this_ptr, uint64_t val);
        public static native void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(long this_ptr, long val);
        /// uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const LDKChannelHandshakeLimits *this_ptr);
-       public static native long ChannelHandshakeLimits_get_min_max_accepted_htlcs(long this_ptr);
+       public static native short ChannelHandshakeLimits_get_min_max_accepted_htlcs(long this_ptr);
        /// void ChannelHandshakeLimits_set_min_max_accepted_htlcs(LDKChannelHandshakeLimits *this_ptr, uint16_t val);
-       public static native void ChannelHandshakeLimits_set_min_max_accepted_htlcs(long this_ptr, long val);
+       public static native void ChannelHandshakeLimits_set_min_max_accepted_htlcs(long this_ptr, short val);
        /// uint64_t ChannelHandshakeLimits_get_min_dust_limit_satoshis(const LDKChannelHandshakeLimits *this_ptr);
        public static native long ChannelHandshakeLimits_get_min_dust_limit_satoshis(long this_ptr);
        /// void ChannelHandshakeLimits_set_min_dust_limit_satoshis(LDKChannelHandshakeLimits *this_ptr, uint64_t val);
@@ -339,11 +341,11 @@ public class bindings {
        /// void ChannelHandshakeLimits_set_force_announced_channel_preference(LDKChannelHandshakeLimits *this_ptr, bool val);
        public static native void ChannelHandshakeLimits_set_force_announced_channel_preference(long this_ptr, boolean val);
        /// uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const LDKChannelHandshakeLimits *this_ptr);
-       public static native long ChannelHandshakeLimits_get_their_to_self_delay(long this_ptr);
+       public static native short ChannelHandshakeLimits_get_their_to_self_delay(long this_ptr);
        /// void ChannelHandshakeLimits_set_their_to_self_delay(LDKChannelHandshakeLimits *this_ptr, uint16_t val);
-       public static native void ChannelHandshakeLimits_set_their_to_self_delay(long this_ptr, long val);
+       public static native void ChannelHandshakeLimits_set_their_to_self_delay(long this_ptr, short val);
        /// MUST_USE_RES LDKChannelHandshakeLimits ChannelHandshakeLimits_new(uint64_t min_funding_satoshis_arg, uint64_t max_htlc_minimum_msat_arg, uint64_t min_max_htlc_value_in_flight_msat_arg, uint64_t max_channel_reserve_satoshis_arg, uint16_t min_max_accepted_htlcs_arg, uint64_t min_dust_limit_satoshis_arg, uint64_t max_dust_limit_satoshis_arg, uint32_t max_minimum_depth_arg, bool force_announced_channel_preference_arg, uint16_t their_to_self_delay_arg);
-       public static native long ChannelHandshakeLimits_new(long min_funding_satoshis_arg, long max_htlc_minimum_msat_arg, long min_max_htlc_value_in_flight_msat_arg, long max_channel_reserve_satoshis_arg, long min_max_accepted_htlcs_arg, long min_dust_limit_satoshis_arg, long max_dust_limit_satoshis_arg, int max_minimum_depth_arg, boolean force_announced_channel_preference_arg, long their_to_self_delay_arg);
+       public static native long ChannelHandshakeLimits_new(long min_funding_satoshis_arg, long max_htlc_minimum_msat_arg, long min_max_htlc_value_in_flight_msat_arg, long max_channel_reserve_satoshis_arg, short min_max_accepted_htlcs_arg, long min_dust_limit_satoshis_arg, long max_dust_limit_satoshis_arg, int max_minimum_depth_arg, boolean force_announced_channel_preference_arg, short their_to_self_delay_arg);
        /// MUST_USE_RES LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void);
        public static native long ChannelHandshakeLimits_default();
        /// void ChannelConfig_free(LDKChannelConfig this_ptr);
@@ -433,11 +435,11 @@ public class bindings {
        /// void OutPoint_set_txid(LDKOutPoint *this_ptr, LDKThirtyTwoBytes val);
        public static native void OutPoint_set_txid(long this_ptr, long val);
        /// uint16_t OutPoint_get_index(const LDKOutPoint *this_ptr);
-       public static native long OutPoint_get_index(long this_ptr);
+       public static native short OutPoint_get_index(long this_ptr);
        /// void OutPoint_set_index(LDKOutPoint *this_ptr, uint16_t val);
-       public static native void OutPoint_set_index(long this_ptr, long val);
+       public static native void OutPoint_set_index(long this_ptr, short val);
        /// MUST_USE_RES LDKOutPoint OutPoint_new(LDKThirtyTwoBytes txid_arg, uint16_t index_arg);
-       public static native long OutPoint_new(long txid_arg, long index_arg);
+       public static native long OutPoint_new(long txid_arg, short index_arg);
        /// MUST_USE_RES LDKThirtyTwoBytes OutPoint_to_channel_id(const LDKOutPoint *this_arg);
        public static native long OutPoint_to_channel_id(long this_arg);
        /// LDKCVec_u8Z OutPoint_write(const LDKOutPoint *obj);
@@ -481,9 +483,9 @@ public class bindings {
        /// MUST_USE_RES LDKChannelPublicKeys InMemoryChannelKeys_remote_pubkeys(const LDKInMemoryChannelKeys *this_arg);
        public static native long InMemoryChannelKeys_remote_pubkeys(long this_arg);
        /// MUST_USE_RES uint16_t InMemoryChannelKeys_remote_to_self_delay(const LDKInMemoryChannelKeys *this_arg);
-       public static native long InMemoryChannelKeys_remote_to_self_delay(long this_arg);
+       public static native short InMemoryChannelKeys_remote_to_self_delay(long this_arg);
        /// MUST_USE_RES uint16_t InMemoryChannelKeys_local_to_self_delay(const LDKInMemoryChannelKeys *this_arg);
-       public static native long InMemoryChannelKeys_local_to_self_delay(long this_arg);
+       public static native short InMemoryChannelKeys_local_to_self_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);
@@ -659,23 +661,23 @@ public class bindings {
        /// void Ping_free(LDKPing this_ptr);
        public static native void Ping_free(long this_ptr);
        /// uint16_t Ping_get_ponglen(const LDKPing *this_ptr);
-       public static native long Ping_get_ponglen(long this_ptr);
+       public static native short Ping_get_ponglen(long this_ptr);
        /// void Ping_set_ponglen(LDKPing *this_ptr, uint16_t val);
-       public static native void Ping_set_ponglen(long this_ptr, long val);
+       public static native void Ping_set_ponglen(long this_ptr, short val);
        /// uint16_t Ping_get_byteslen(const LDKPing *this_ptr);
-       public static native long Ping_get_byteslen(long this_ptr);
+       public static native short Ping_get_byteslen(long this_ptr);
        /// void Ping_set_byteslen(LDKPing *this_ptr, uint16_t val);
-       public static native void Ping_set_byteslen(long this_ptr, long val);
+       public static native void Ping_set_byteslen(long this_ptr, short val);
        /// MUST_USE_RES LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg);
-       public static native long Ping_new(long ponglen_arg, long byteslen_arg);
+       public static native long Ping_new(short ponglen_arg, short byteslen_arg);
        /// void Pong_free(LDKPong this_ptr);
        public static native void Pong_free(long this_ptr);
        /// uint16_t Pong_get_byteslen(const LDKPong *this_ptr);
-       public static native long Pong_get_byteslen(long this_ptr);
+       public static native short Pong_get_byteslen(long this_ptr);
        /// void Pong_set_byteslen(LDKPong *this_ptr, uint16_t val);
-       public static native void Pong_set_byteslen(long this_ptr, long val);
+       public static native void Pong_set_byteslen(long this_ptr, short val);
        /// MUST_USE_RES LDKPong Pong_new(uint16_t byteslen_arg);
-       public static native long Pong_new(long byteslen_arg);
+       public static native long Pong_new(short byteslen_arg);
        /// void OpenChannel_free(LDKOpenChannel this_ptr);
        public static native void OpenChannel_free(long this_ptr);
        /// const uint8_t (*OpenChannel_get_chain_hash(const LDKOpenChannel *this_ptr))[32];
@@ -715,13 +717,13 @@ public class bindings {
        /// void OpenChannel_set_feerate_per_kw(LDKOpenChannel *this_ptr, uint32_t val);
        public static native void OpenChannel_set_feerate_per_kw(long this_ptr, int val);
        /// uint16_t OpenChannel_get_to_self_delay(const LDKOpenChannel *this_ptr);
-       public static native long OpenChannel_get_to_self_delay(long this_ptr);
+       public static native short OpenChannel_get_to_self_delay(long this_ptr);
        /// void OpenChannel_set_to_self_delay(LDKOpenChannel *this_ptr, uint16_t val);
-       public static native void OpenChannel_set_to_self_delay(long this_ptr, long val);
+       public static native void OpenChannel_set_to_self_delay(long this_ptr, short val);
        /// uint16_t OpenChannel_get_max_accepted_htlcs(const LDKOpenChannel *this_ptr);
-       public static native long OpenChannel_get_max_accepted_htlcs(long this_ptr);
+       public static native short OpenChannel_get_max_accepted_htlcs(long this_ptr);
        /// void OpenChannel_set_max_accepted_htlcs(LDKOpenChannel *this_ptr, uint16_t val);
-       public static native void OpenChannel_set_max_accepted_htlcs(long this_ptr, long val);
+       public static native void OpenChannel_set_max_accepted_htlcs(long this_ptr, short val);
        /// LDKPublicKey OpenChannel_get_funding_pubkey(const LDKOpenChannel *this_ptr);
        public static native long OpenChannel_get_funding_pubkey(long this_ptr);
        /// void OpenChannel_set_funding_pubkey(LDKOpenChannel *this_ptr, LDKPublicKey val);
@@ -777,13 +779,13 @@ public class bindings {
        /// void AcceptChannel_set_minimum_depth(LDKAcceptChannel *this_ptr, uint32_t val);
        public static native void AcceptChannel_set_minimum_depth(long this_ptr, int val);
        /// uint16_t AcceptChannel_get_to_self_delay(const LDKAcceptChannel *this_ptr);
-       public static native long AcceptChannel_get_to_self_delay(long this_ptr);
+       public static native short AcceptChannel_get_to_self_delay(long this_ptr);
        /// void AcceptChannel_set_to_self_delay(LDKAcceptChannel *this_ptr, uint16_t val);
-       public static native void AcceptChannel_set_to_self_delay(long this_ptr, long val);
+       public static native void AcceptChannel_set_to_self_delay(long this_ptr, short val);
        /// uint16_t AcceptChannel_get_max_accepted_htlcs(const LDKAcceptChannel *this_ptr);
-       public static native long AcceptChannel_get_max_accepted_htlcs(long this_ptr);
+       public static native short AcceptChannel_get_max_accepted_htlcs(long this_ptr);
        /// void AcceptChannel_set_max_accepted_htlcs(LDKAcceptChannel *this_ptr, uint16_t val);
-       public static native void AcceptChannel_set_max_accepted_htlcs(long this_ptr, long val);
+       public static native void AcceptChannel_set_max_accepted_htlcs(long this_ptr, short val);
        /// LDKPublicKey AcceptChannel_get_funding_pubkey(const LDKAcceptChannel *this_ptr);
        public static native long AcceptChannel_get_funding_pubkey(long this_ptr);
        /// void AcceptChannel_set_funding_pubkey(LDKAcceptChannel *this_ptr, LDKPublicKey val);
@@ -819,15 +821,15 @@ public class bindings {
        /// void FundingCreated_set_funding_txid(LDKFundingCreated *this_ptr, LDKThirtyTwoBytes val);
        public static native void FundingCreated_set_funding_txid(long this_ptr, long val);
        /// uint16_t FundingCreated_get_funding_output_index(const LDKFundingCreated *this_ptr);
-       public static native long FundingCreated_get_funding_output_index(long this_ptr);
+       public static native short FundingCreated_get_funding_output_index(long this_ptr);
        /// void FundingCreated_set_funding_output_index(LDKFundingCreated *this_ptr, uint16_t val);
-       public static native void FundingCreated_set_funding_output_index(long this_ptr, long val);
+       public static native void FundingCreated_set_funding_output_index(long this_ptr, short val);
        /// LDKSignature FundingCreated_get_signature(const LDKFundingCreated *this_ptr);
        public static native long FundingCreated_get_signature(long this_ptr);
        /// void FundingCreated_set_signature(LDKFundingCreated *this_ptr, LDKSignature val);
        public static native void FundingCreated_set_signature(long this_ptr, long val);
        /// MUST_USE_RES LDKFundingCreated FundingCreated_new(LDKThirtyTwoBytes temporary_channel_id_arg, LDKThirtyTwoBytes funding_txid_arg, uint16_t funding_output_index_arg, LDKSignature signature_arg);
-       public static native long FundingCreated_new(long temporary_channel_id_arg, long funding_txid_arg, long funding_output_index_arg, long signature_arg);
+       public static native long FundingCreated_new(long temporary_channel_id_arg, long funding_txid_arg, short funding_output_index_arg, long signature_arg);
        /// void FundingSigned_free(LDKFundingSigned this_ptr);
        public static native void FundingSigned_free(long this_ptr);
        /// const uint8_t (*FundingSigned_get_channel_id(const LDKFundingSigned *this_ptr))[32];
@@ -939,9 +941,9 @@ public class bindings {
        /// void UpdateFailMalformedHTLC_set_htlc_id(LDKUpdateFailMalformedHTLC *this_ptr, uint64_t val);
        public static native void UpdateFailMalformedHTLC_set_htlc_id(long this_ptr, long val);
        /// uint16_t UpdateFailMalformedHTLC_get_failure_code(const LDKUpdateFailMalformedHTLC *this_ptr);
-       public static native long UpdateFailMalformedHTLC_get_failure_code(long this_ptr);
+       public static native short UpdateFailMalformedHTLC_get_failure_code(long this_ptr);
        /// void UpdateFailMalformedHTLC_set_failure_code(LDKUpdateFailMalformedHTLC *this_ptr, uint16_t val);
-       public static native void UpdateFailMalformedHTLC_set_failure_code(long this_ptr, long val);
+       public static native void UpdateFailMalformedHTLC_set_failure_code(long this_ptr, short val);
        /// void CommitmentSigned_free(LDKCommitmentSigned this_ptr);
        public static native void CommitmentSigned_free(long this_ptr);
        /// const uint8_t (*CommitmentSigned_get_channel_id(const LDKCommitmentSigned *this_ptr))[32];
@@ -1133,9 +1135,9 @@ public class bindings {
        /// void UnsignedChannelUpdate_set_flags(LDKUnsignedChannelUpdate *this_ptr, uint8_t val);
        public static native void UnsignedChannelUpdate_set_flags(long this_ptr, byte val);
        /// uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const LDKUnsignedChannelUpdate *this_ptr);
-       public static native long UnsignedChannelUpdate_get_cltv_expiry_delta(long this_ptr);
+       public static native short UnsignedChannelUpdate_get_cltv_expiry_delta(long this_ptr);
        /// void UnsignedChannelUpdate_set_cltv_expiry_delta(LDKUnsignedChannelUpdate *this_ptr, uint16_t val);
-       public static native void UnsignedChannelUpdate_set_cltv_expiry_delta(long this_ptr, long val);
+       public static native void UnsignedChannelUpdate_set_cltv_expiry_delta(long this_ptr, short val);
        /// uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const LDKUnsignedChannelUpdate *this_ptr);
        public static native long UnsignedChannelUpdate_get_htlc_minimum_msat(long this_ptr);
        /// void UnsignedChannelUpdate_set_htlc_minimum_msat(LDKUnsignedChannelUpdate *this_ptr, uint64_t val);
@@ -1415,7 +1417,7 @@ public class bindings {
        /// MUST_USE_RES LDKCResult_TxCreationKeysSecpErrorZ TxCreationKeys_derive_new(LDKPublicKey per_commitment_point, LDKPublicKey a_delayed_payment_base, LDKPublicKey a_htlc_base, LDKPublicKey b_revocation_base, LDKPublicKey b_htlc_base);
        public static native long TxCreationKeys_derive_new(long per_commitment_point, long a_delayed_payment_base, long a_htlc_base, long b_revocation_base, long b_htlc_base);
        /// LDKCVec_u8Z get_revokeable_redeemscript(LDKPublicKey revocation_key, uint16_t to_self_delay, LDKPublicKey delayed_payment_key);
-       public static native long get_revokeable_redeemscript(long revocation_key, long to_self_delay, long delayed_payment_key);
+       public static native long get_revokeable_redeemscript(long revocation_key, short to_self_delay, long delayed_payment_key);
        /// void HTLCOutputInCommitment_free(LDKHTLCOutputInCommitment this_ptr);
        public static native void HTLCOutputInCommitment_free(long this_ptr);
        /// bool HTLCOutputInCommitment_get_offered(const LDKHTLCOutputInCommitment *this_ptr);
@@ -1443,7 +1445,7 @@ public class bindings {
        /// LDKCVec_u8Z make_funding_redeemscript(LDKPublicKey a, LDKPublicKey b);
        public static native long make_funding_redeemscript(long a, long b);
        /// LDKCVec_u8Z build_htlc_transaction(const uint8_t (*prev_hash)[32], uint32_t feerate_per_kw, uint16_t to_self_delay, const LDKHTLCOutputInCommitment *htlc, LDKPublicKey a_delayed_payment_key, LDKPublicKey revocation_key);
-       public static native long build_htlc_transaction(byte[] prev_hash, int feerate_per_kw, long to_self_delay, long htlc, long a_delayed_payment_key, long revocation_key);
+       public static native long build_htlc_transaction(byte[] prev_hash, int feerate_per_kw, short to_self_delay, long htlc, long a_delayed_payment_key, long revocation_key);
        /// void LocalCommitmentTransaction_free(LDKLocalCommitmentTransaction this_ptr);
        public static native void LocalCommitmentTransaction_free(long this_ptr);
        /// LDKCVec_u8Z LocalCommitmentTransaction_get_unsigned_tx(const LDKLocalCommitmentTransaction *this_ptr);
@@ -1469,7 +1471,7 @@ public class bindings {
        /// MUST_USE_RES LDKSignature LocalCommitmentTransaction_get_local_sig(const LDKLocalCommitmentTransaction *this_arg, const uint8_t (*funding_key)[32], LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis);
        public static native long LocalCommitmentTransaction_get_local_sig(long this_arg, byte[] funding_key, long funding_redeemscript, long channel_value_satoshis);
        /// MUST_USE_RES LDKCResult_CVec_SignatureZNoneZ LocalCommitmentTransaction_get_htlc_sigs(const LDKLocalCommitmentTransaction *this_arg, const uint8_t (*htlc_base_key)[32], uint16_t local_csv);
-       public static native long LocalCommitmentTransaction_get_htlc_sigs(long this_arg, byte[] htlc_base_key, long local_csv);
+       public static native long LocalCommitmentTransaction_get_htlc_sigs(long this_arg, byte[] htlc_base_key, short local_csv);
        /// LDKCVec_u8Z LocalCommitmentTransaction_write(const LDKLocalCommitmentTransaction *obj);
        public static native long LocalCommitmentTransaction_write(long obj);
        /// LDKLocalCommitmentTransaction LocalCommitmentTransaction_read(LDKu8slice ser);
@@ -1523,15 +1525,15 @@ public class bindings {
        /// void RouteHint_set_fees(LDKRouteHint *this_ptr, LDKRoutingFees val);
        public static native void RouteHint_set_fees(long this_ptr, long val);
        /// uint16_t RouteHint_get_cltv_expiry_delta(const LDKRouteHint *this_ptr);
-       public static native long RouteHint_get_cltv_expiry_delta(long this_ptr);
+       public static native short RouteHint_get_cltv_expiry_delta(long this_ptr);
        /// void RouteHint_set_cltv_expiry_delta(LDKRouteHint *this_ptr, uint16_t val);
-       public static native void RouteHint_set_cltv_expiry_delta(long this_ptr, long val);
+       public static native void RouteHint_set_cltv_expiry_delta(long this_ptr, short val);
        /// uint64_t RouteHint_get_htlc_minimum_msat(const LDKRouteHint *this_ptr);
        public static native long RouteHint_get_htlc_minimum_msat(long this_ptr);
        /// void RouteHint_set_htlc_minimum_msat(LDKRouteHint *this_ptr, uint64_t val);
        public static native void RouteHint_set_htlc_minimum_msat(long this_ptr, long val);
        /// MUST_USE_RES LDKRouteHint RouteHint_new(LDKPublicKey src_node_id_arg, uint64_t short_channel_id_arg, LDKRoutingFees fees_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg);
-       public static native long RouteHint_new(long src_node_id_arg, long short_channel_id_arg, long fees_arg, long cltv_expiry_delta_arg, long htlc_minimum_msat_arg);
+       public static native long RouteHint_new(long src_node_id_arg, long short_channel_id_arg, long fees_arg, short cltv_expiry_delta_arg, long htlc_minimum_msat_arg);
        /// LDKCResult_RouteLightningErrorZ get_route(LDKPublicKey our_node_id, const LDKNetworkGraph *network, LDKPublicKey target, LDKCVec_ChannelDetailsZ *first_hops, LDKCVec_RouteHintZ last_hops, uint64_t final_value_msat, uint32_t final_cltv, LDKLogger logger);
        public static native long get_route(long our_node_id, long network, long target, long first_hops, long last_hops, long final_value_msat, int final_cltv, long logger);
        /// void NetworkGraph_free(LDKNetworkGraph this_ptr);
@@ -1561,9 +1563,9 @@ public class bindings {
        /// void DirectionalChannelInfo_set_enabled(LDKDirectionalChannelInfo *this_ptr, bool val);
        public static native void DirectionalChannelInfo_set_enabled(long this_ptr, boolean val);
        /// uint16_t DirectionalChannelInfo_get_cltv_expiry_delta(const LDKDirectionalChannelInfo *this_ptr);
-       public static native long DirectionalChannelInfo_get_cltv_expiry_delta(long this_ptr);
+       public static native short DirectionalChannelInfo_get_cltv_expiry_delta(long this_ptr);
        /// void DirectionalChannelInfo_set_cltv_expiry_delta(LDKDirectionalChannelInfo *this_ptr, uint16_t val);
-       public static native void DirectionalChannelInfo_set_cltv_expiry_delta(long this_ptr, long val);
+       public static native void DirectionalChannelInfo_set_cltv_expiry_delta(long this_ptr, short val);
        /// uint64_t DirectionalChannelInfo_get_htlc_minimum_msat(const LDKDirectionalChannelInfo *this_ptr);
        public static native long DirectionalChannelInfo_get_htlc_minimum_msat(long this_ptr);
        /// void DirectionalChannelInfo_set_htlc_minimum_msat(LDKDirectionalChannelInfo *this_ptr, uint64_t val);