From: Matt Corallo Date: Mon, 25 Jan 2021 21:03:23 +0000 (-0500) Subject: Bindings updates X-Git-Tag: v0.0.1~36^2~4 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=22f5f4208b1f3b5542292250f1612b944f5cd7fd;p=ldk-java Bindings updates --- diff --git a/src/main/java/org/ldk/impl/bindings.java b/src/main/java/org/ldk/impl/bindings.java index ab59c289..f9d99ca5 100644 --- a/src/main/java/org/ldk/impl/bindings.java +++ b/src/main/java/org/ldk/impl/bindings.java @@ -292,7 +292,6 @@ public class bindings { byte[] write(); } public static native long LDKChannelKeys_new(LDKChannelKeys impl, long pubkeys); - public static native LDKChannelKeys LDKChannelKeys_get_obj_from_jcalls(long val); // LDKPublicKey ChannelKeys_get_per_commitment_point LDKChannelKeys* this_arg, uint64_t idx public static native byte[] ChannelKeys_get_per_commitment_point(long this_arg, long idx); // LDKThirtyTwoBytes ChannelKeys_release_commitment_secret LDKChannelKeys* this_arg, uint64_t idx @@ -406,7 +405,6 @@ public class bindings { long[] release_pending_monitor_events(); } public static native long LDKWatch_new(LDKWatch impl); - public static native LDKWatch LDKWatch_get_obj_from_jcalls(long val); // LDKCResult_NoneChannelMonitorUpdateErrZ Watch_watch_channel LDKWatch* this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor public static native long Watch_watch_channel(long this_arg, long funding_txo, long monitor); // LDKCResult_NoneChannelMonitorUpdateErrZ Watch_update_channel LDKWatch* this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update @@ -417,7 +415,6 @@ public class bindings { 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, struct LDKTransaction tx public static native void BroadcasterInterface_broadcast_transaction(long this_arg, byte[] tx); public interface LDKKeysInterface { @@ -429,7 +426,6 @@ public class bindings { long read_chan_signer(byte[] reader); } public static native long LDKKeysInterface_new(LDKKeysInterface impl); - public static native LDKKeysInterface LDKKeysInterface_get_obj_from_jcalls(long val); // LDKSecretKey KeysInterface_get_node_secret LDKKeysInterface* this_arg public static native byte[] KeysInterface_get_node_secret(long this_arg); // LDKCVec_u8Z KeysInterface_get_destination_script LDKKeysInterface* this_arg @@ -446,14 +442,12 @@ public class bindings { int get_est_sat_per_1000_weight(LDKConfirmationTarget confirmation_target); } public static native long LDKFeeEstimator_new(LDKFeeEstimator impl); - public static native LDKFeeEstimator LDKFeeEstimator_get_obj_from_jcalls(long val); // uint32_t FeeEstimator_get_est_sat_per_1000_weight LDKFeeEstimator* this_arg, enum LDKConfirmationTarget confirmation_target public static native int FeeEstimator_get_est_sat_per_1000_weight(long this_arg, LDKConfirmationTarget confirmation_target); public interface LDKLogger { void log(String record); } public static native long LDKLogger_new(LDKLogger impl); - public static native LDKLogger LDKLogger_get_obj_from_jcalls(long val); public static native long LDKC2Tuple_BlockHashChannelManagerZ_new(byte[] a, long b); public static native byte[] LDKC2Tuple_BlockHashChannelManagerZ_get_a(long ptr); public static native long LDKC2Tuple_BlockHashChannelManagerZ_get_b(long ptr); @@ -567,21 +561,18 @@ public class bindings { long[] get_and_clear_pending_msg_events(); } public static native long LDKMessageSendEventsProvider_new(LDKMessageSendEventsProvider impl); - public static native LDKMessageSendEventsProvider LDKMessageSendEventsProvider_get_obj_from_jcalls(long val); // LDKCVec_MessageSendEventZ MessageSendEventsProvider_get_and_clear_pending_msg_events LDKMessageSendEventsProvider* this_arg public static native long[] MessageSendEventsProvider_get_and_clear_pending_msg_events(long this_arg); public interface LDKEventsProvider { long[] get_and_clear_pending_events(); } public static native long LDKEventsProvider_new(LDKEventsProvider impl); - public static native LDKEventsProvider LDKEventsProvider_get_obj_from_jcalls(long val); // LDKCVec_EventZ EventsProvider_get_and_clear_pending_events LDKEventsProvider* this_arg public static native long[] EventsProvider_get_and_clear_pending_events(long this_arg); public interface LDKAccess { long get_utxo(byte[] genesis_hash, long short_channel_id); } public static native long LDKAccess_new(LDKAccess impl); - public static native LDKAccess LDKAccess_get_obj_from_jcalls(long val); // LDKCResult_TxOutAccessErrorZ Access_get_utxo LDKAccess* this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id public static native long Access_get_utxo(long this_arg, byte[] genesis_hash, long short_channel_id); public interface LDKFilter { @@ -589,7 +580,6 @@ public class bindings { void register_output(long outpoint, byte[] script_pubkey); } public static native long LDKFilter_new(LDKFilter impl); - public static native LDKFilter LDKFilter_get_obj_from_jcalls(long val); // void Filter_register_tx LDKFilter* this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey public static native void Filter_register_tx(long this_arg, byte[] txid, byte[] script_pubkey); // void Filter_register_output LDKFilter* this_arg, const struct LDKOutPoint *NONNULL_PTR outpoint, struct LDKu8slice script_pubkey @@ -599,7 +589,6 @@ public class bindings { long update_persisted_channel(long id, long update, long data); } public static native long LDKPersist_new(LDKPersist impl); - public static native LDKPersist LDKPersist_get_obj_from_jcalls(long val); // LDKCResult_NoneChannelMonitorUpdateErrZ Persist_persist_new_channel LDKPersist* this_arg, struct LDKOutPoint id, const struct LDKChannelMonitor *NONNULL_PTR data public static native long Persist_persist_new_channel(long this_arg, long id, long data); // LDKCResult_NoneChannelMonitorUpdateErrZ Persist_update_persisted_channel LDKPersist* this_arg, struct LDKOutPoint id, const struct LDKChannelMonitorUpdate *NONNULL_PTR update, const struct LDKChannelMonitor *NONNULL_PTR data @@ -626,7 +615,6 @@ 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 LDKChannelMessageHandler LDKChannelMessageHandler_get_obj_from_jcalls(long val); // void ChannelMessageHandler_handle_open_channel LDKChannelMessageHandler* 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* this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg @@ -679,7 +667,6 @@ 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 LDKRoutingMessageHandler LDKRoutingMessageHandler_get_obj_from_jcalls(long val); // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_node_announcement LDKRoutingMessageHandler* 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* this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg @@ -709,7 +696,6 @@ public class bindings { long hash(); } public static native long LDKSocketDescriptor_new(LDKSocketDescriptor impl); - public static native LDKSocketDescriptor LDKSocketDescriptor_get_obj_from_jcalls(long val); // uintptr_t SocketDescriptor_send_data LDKSocketDescriptor* this_arg, struct LDKu8slice data, bool resume_read public static native long SocketDescriptor_send_data(long this_arg, byte[] data, boolean resume_read); // void SocketDescriptor_disconnect_socket LDKSocketDescriptor* this_arg diff --git a/src/main/jni/bindings.c b/src/main/jni/bindings.c index 8786c90d..3df1ce62 100644 --- a/src/main/jni/bindings.c +++ b/src/main/jni/bindings.c @@ -1119,7 +1119,7 @@ static inline LDKCVec_EventZ CVec_EventZ_clone(const LDKCVec_EventZ *orig) { } return ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1usizeTransactionZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1usizeTransactionZ_1new(JNIEnv *env, jclass clz, intptr_t a, int8_tArray b) { LDKC2Tuple_usizeTransactionZ* ret = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); ret->a = a; LDKTransaction b_ref; @@ -1130,7 +1130,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1usizeTransactio ret->b = b_ref; return (long)ret; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1usizeTransactionZ_1get_1a(JNIEnv *env, jclass clz, int64_t ptr) { +JNIEXPORT intptr_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1usizeTransactionZ_1get_1a(JNIEnv *env, jclass clz, int64_t ptr) { LDKC2Tuple_usizeTransactionZ *tuple = (LDKC2Tuple_usizeTransactionZ*)ptr; return tuple->a; } @@ -1413,6 +1413,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1SignatureC LDKC2Tuple_SignatureCVec_SignatureZZ *tuple = (LDKC2Tuple_SignatureCVec_SignatureZZ*)ptr; LDKCVec_SignatureZ b_var = tuple->b; jobjectArray b_arr = (*env)->NewObjectArray(env, b_var.datalen, arr_of_B_clz, NULL); + ; for (size_t i = 0; i < b_var.datalen; i++) { int8_tArray arr_conv_8_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, arr_conv_8_arr, 0, 64, b_var.data[i].compact_form); @@ -1457,6 +1458,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1Sign CHECK(val->result_ok); LDKCVec_SignatureZ res_var = (*val->contents.result); jobjectArray res_arr = (*env)->NewObjectArray(env, res_var.datalen, arr_of_B_clz, NULL); + ; for (size_t i = 0; i < res_var.datalen; i++) { int8_tArray arr_conv_8_arr = (*env)->NewByteArray(env, 64); (*env)->SetByteArrayRegion(env, arr_conv_8_arr, 0, 64, res_var.data[i].compact_form); @@ -1590,7 +1592,7 @@ LDKCResult_CVec_SignatureZNoneZ sign_holder_commitment_htlc_transactions_jcall(c FREE((void*)ret); return ret_conv; } -LDKCResult_SignatureNoneZ sign_justice_transaction_jcall(const void* this_arg, LDKTransaction justice_tx, uint64_t input, uint64_t amount, const uint8_t (* per_commitment_key)[32], const LDKHTLCOutputInCommitment * htlc) { +LDKCResult_SignatureNoneZ sign_justice_transaction_jcall(const void* this_arg, LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (* per_commitment_key)[32], const LDKHTLCOutputInCommitment * htlc) { LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; JNIEnv *env; DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK); @@ -1616,7 +1618,7 @@ LDKCResult_SignatureNoneZ sign_justice_transaction_jcall(const void* this_arg, L FREE((void*)ret); return ret_conv; } -LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_jcall(const void* this_arg, LDKTransaction htlc_tx, uint64_t input, uint64_t amount, LDKPublicKey per_commitment_point, const LDKHTLCOutputInCommitment * htlc) { +LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_jcall(const void* this_arg, LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, LDKPublicKey per_commitment_point, const LDKHTLCOutputInCommitment * htlc) { LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; JNIEnv *env; DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK); @@ -1776,11 +1778,6 @@ JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1new (JNIEnv *e *res_ptr = LDKChannelKeys_init(env, clz, o, pubkeys); return (long)res_ptr; } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1get_1obj_1from_1jcalls (JNIEnv *env, jclass clz, int64_t val) { - jobject ret = (*env)->NewLocalRef(env, ((LDKChannelKeys_JCalls*)val)->o); - CHECK(ret != NULL); - return ret; -} JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1get_1per_1commitment_1point(JNIEnv *env, jclass clz, int64_t this_arg, int64_t idx) { LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg; int8_tArray arg_arr = (*env)->NewByteArray(env, 33); @@ -1832,7 +1829,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1holder_1 return (long)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1justice_1transaction(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray justice_tx, int64_t input, int64_t amount, int8_tArray per_commitment_key, int64_t htlc) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1justice_1transaction(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray justice_tx, intptr_t input, int64_t amount, int8_tArray per_commitment_key, int64_t htlc) { LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg; LDKTransaction justice_tx_ref; justice_tx_ref.datalen = (*env)->GetArrayLength(env, justice_tx); @@ -1851,7 +1848,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1justice_ return (long)ret_conv; } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1counterparty_1htlc_1transaction(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray htlc_tx, int64_t input, int64_t amount, int8_tArray per_commitment_point, int64_t htlc) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1sign_1counterparty_1htlc_1transaction(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray htlc_tx, intptr_t input, int64_t amount, int8_tArray per_commitment_point, int64_t htlc) { LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg; LDKTransaction htlc_tx_ref; htlc_tx_ref.datalen = (*env)->GetArrayLength(env, htlc_tx); @@ -2413,11 +2410,6 @@ JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKWatch_1new (JNIEnv *env, jc *res_ptr = LDKWatch_init(env, clz, o); return (long)res_ptr; } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKWatch_1get_1obj_1from_1jcalls (JNIEnv *env, jclass clz, int64_t val) { - jobject ret = (*env)->NewLocalRef(env, ((LDKWatch_JCalls*)val)->o); - CHECK(ret != NULL); - return ret; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Watch_1watch_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t funding_txo, int64_t monitor) { LDKWatch* this_arg_conv = (LDKWatch*)this_arg; LDKOutPoint funding_txo_conv; @@ -2525,11 +2517,6 @@ JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1new ( *res_ptr = LDKBroadcasterInterface_init(env, clz, o); return (long)res_ptr; } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1get_1obj_1from_1jcalls (JNIEnv *env, jclass clz, int64_t val) { - jobject ret = (*env)->NewLocalRef(env, ((LDKBroadcasterInterface_JCalls*)val)->o); - CHECK(ret != NULL); - return ret; -} JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1broadcast_1transaction(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray tx) { LDKBroadcasterInterface* this_arg_conv = (LDKBroadcasterInterface*)this_arg; LDKTransaction tx_ref; @@ -2676,11 +2663,6 @@ JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1new (JNIEnv *res_ptr = LDKKeysInterface_init(env, clz, o); return (long)res_ptr; } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1get_1obj_1from_1jcalls (JNIEnv *env, jclass clz, int64_t val) { - jobject ret = (*env)->NewLocalRef(env, ((LDKKeysInterface_JCalls*)val)->o); - CHECK(ret != NULL); - return ret; -} JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_KeysInterface_1get_1node_1secret(JNIEnv *env, jclass clz, int64_t this_arg) { LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg; int8_tArray arg_arr = (*env)->NewByteArray(env, 32); @@ -2780,11 +2762,6 @@ JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1new (JNIEnv * *res_ptr = LDKFeeEstimator_init(env, clz, o); return (long)res_ptr; } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1get_1obj_1from_1jcalls (JNIEnv *env, jclass clz, int64_t val) { - jobject ret = (*env)->NewLocalRef(env, ((LDKFeeEstimator_JCalls*)val)->o); - CHECK(ret != NULL); - return ret; -} JNIEXPORT int32_t JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1get_1est_1sat_1per_11000_1weight(JNIEnv *env, jclass clz, int64_t this_arg, jclass confirmation_target) { LDKFeeEstimator* this_arg_conv = (LDKFeeEstimator*)this_arg; LDKConfirmationTarget confirmation_target_conv = LDKConfirmationTarget_from_java(env, confirmation_target); @@ -2843,11 +2820,6 @@ JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKLogger_1new (JNIEnv *env, j *res_ptr = LDKLogger_init(env, clz, o); return (long)res_ptr; } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKLogger_1get_1obj_1from_1jcalls (JNIEnv *env, jclass clz, int64_t val) { - jobject ret = (*env)->NewLocalRef(env, ((LDKLogger_JCalls*)val)->o); - CHECK(ret != NULL); - return ret; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_LDKC2Tuple_1BlockHashChannelManagerZ_1new(JNIEnv *env, jclass clz, int8_tArray a, int64_t b) { LDKC2Tuple_BlockHashChannelManagerZ* ret = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelManagerZ), "LDKC2Tuple_BlockHashChannelManagerZ"); LDKThirtyTwoBytes a_ref; @@ -3861,11 +3833,6 @@ JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1 *res_ptr = LDKMessageSendEventsProvider_init(env, clz, o); return (long)res_ptr; } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1get_1obj_1from_1jcalls (JNIEnv *env, jclass clz, int64_t val) { - jobject ret = (*env)->NewLocalRef(env, ((LDKMessageSendEventsProvider_JCalls*)val)->o); - CHECK(ret != NULL); - return ret; -} JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1get_1and_1clear_1pending_1msg_1events(JNIEnv *env, jclass clz, int64_t this_arg) { LDKMessageSendEventsProvider* this_arg_conv = (LDKMessageSendEventsProvider*)this_arg; LDKCVec_MessageSendEventZ ret_var = (this_arg_conv->get_and_clear_pending_msg_events)(this_arg_conv->this_arg); @@ -3947,11 +3914,6 @@ JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1new (JNIEnv *res_ptr = LDKEventsProvider_init(env, clz, o); return (long)res_ptr; } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1get_1obj_1from_1jcalls (JNIEnv *env, jclass clz, int64_t val) { - jobject ret = (*env)->NewLocalRef(env, ((LDKEventsProvider_JCalls*)val)->o); - CHECK(ret != NULL); - return ret; -} JNIEXPORT int64_tArray JNICALL Java_org_ldk_impl_bindings_EventsProvider_1get_1and_1clear_1pending_1events(JNIEnv *env, jclass clz, int64_t this_arg) { LDKEventsProvider* this_arg_conv = (LDKEventsProvider*)this_arg; LDKCVec_EventZ ret_var = (this_arg_conv->get_and_clear_pending_events)(this_arg_conv->this_arg); @@ -4023,11 +3985,6 @@ JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKAccess_1new (JNIEnv *env, j *res_ptr = LDKAccess_init(env, clz, o); return (long)res_ptr; } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAccess_1get_1obj_1from_1jcalls (JNIEnv *env, jclass clz, int64_t val) { - jobject ret = (*env)->NewLocalRef(env, ((LDKAccess_JCalls*)val)->o); - CHECK(ret != NULL); - return ret; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Access_1get_1utxo(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray genesis_hash, int64_t short_channel_id) { LDKAccess* this_arg_conv = (LDKAccess*)this_arg; unsigned char genesis_hash_arr[32]; @@ -4118,11 +4075,6 @@ JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKFilter_1new (JNIEnv *env, j *res_ptr = LDKFilter_init(env, clz, o); return (long)res_ptr; } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFilter_1get_1obj_1from_1jcalls (JNIEnv *env, jclass clz, int64_t val) { - jobject ret = (*env)->NewLocalRef(env, ((LDKFilter_JCalls*)val)->o); - CHECK(ret != NULL); - return ret; -} JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1register_1tx(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray txid, int8_tArray script_pubkey) { LDKFilter* this_arg_conv = (LDKFilter*)this_arg; unsigned char txid_arr[32]; @@ -4255,11 +4207,6 @@ JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKPersist_1new (JNIEnv *env, *res_ptr = LDKPersist_init(env, clz, o); return (long)res_ptr; } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPersist_1get_1obj_1from_1jcalls (JNIEnv *env, jclass clz, int64_t val) { - jobject ret = (*env)->NewLocalRef(env, ((LDKPersist_JCalls*)val)->o); - CHECK(ret != NULL); - return ret; -} JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Persist_1persist_1new_1channel(JNIEnv *env, jclass clz, int64_t this_arg, int64_t id, int64_t data) { LDKPersist* this_arg_conv = (LDKPersist*)this_arg; LDKOutPoint id_conv; @@ -4777,11 +4724,6 @@ JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1new *res_ptr = LDKChannelMessageHandler_init(env, clz, o, MessageSendEventsProvider); return (long)res_ptr; } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1get_1obj_1from_1jcalls (JNIEnv *env, jclass clz, int64_t val) { - jobject ret = (*env)->NewLocalRef(env, ((LDKChannelMessageHandler_JCalls*)val)->o); - CHECK(ret != NULL); - return ret; -} 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*)this_arg; LDKPublicKey their_node_id_ref; @@ -5301,11 +5243,6 @@ JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1new *res_ptr = LDKRoutingMessageHandler_init(env, clz, o, MessageSendEventsProvider); return (long)res_ptr; } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1get_1obj_1from_1jcalls (JNIEnv *env, jclass clz, int64_t val) { - jobject ret = (*env)->NewLocalRef(env, ((LDKRoutingMessageHandler_JCalls*)val)->o); - CHECK(ret != NULL); - return ret; -} 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*)this_arg; LDKNodeAnnouncement msg_conv; @@ -5472,7 +5409,7 @@ static void LDKSocketDescriptor_JCalls_free(void* this_arg) { FREE(j_calls); } } -uint64_t send_data_jcall(void* this_arg, LDKu8slice data, bool resume_read) { +uintptr_t send_data_jcall(void* this_arg, LDKu8slice data, bool resume_read) { LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; JNIEnv *env; DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK); @@ -5546,17 +5483,12 @@ JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1new (JNIE *res_ptr = LDKSocketDescriptor_init(env, clz, o); return (long)res_ptr; } -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1get_1obj_1from_1jcalls (JNIEnv *env, jclass clz, int64_t val) { - jobject ret = (*env)->NewLocalRef(env, ((LDKSocketDescriptor_JCalls*)val)->o); - CHECK(ret != NULL); - return ret; -} -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1send_1data(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray data, jboolean resume_read) { +JNIEXPORT intptr_t JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1send_1data(JNIEnv *env, jclass clz, int64_t this_arg, int8_tArray data, jboolean resume_read) { LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg; LDKu8slice data_ref; data_ref.datalen = (*env)->GetArrayLength(env, data); data_ref.data = (*env)->GetByteArrayElements (env, data, NULL); - int64_t ret_val = (this_arg_conv->send_data)(this_arg_conv->this_arg, data_ref, resume_read); + intptr_t ret_val = (this_arg_conv->send_data)(this_arg_conv->this_arg, data_ref, resume_read); (*env)->ReleaseByteArrayElements(env, data, (int8_t*)data_ref.data, 0); return ret_val; } @@ -5647,7 +5579,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1fr C2Tuple_usizeTransactionZ_free(_res_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1new(JNIEnv *env, jclass clz, int64_t a, int8_tArray b) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1new(JNIEnv *env, jclass clz, intptr_t a, int8_tArray b) { LDKTransaction b_ref; b_ref.datalen = (*env)->GetArrayLength(env, b); b_ref.data = MALLOC(b_ref.datalen, "LDKTransaction Bytes"); @@ -7431,15 +7363,15 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1m ChannelHandshakeConfig_set_minimum_depth(&this_ptr_conv, val); } -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = ChannelHandshakeConfig_get_our_to_self_delay(&this_ptr_conv); + int16_t ret_val = ChannelHandshakeConfig_get_our_to_self_delay(&this_ptr_conv); return ret_val; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, jshort val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; @@ -7461,7 +7393,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1o ChannelHandshakeConfig_set_our_htlc_minimum_msat(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1new(JNIEnv *env, jclass clz, int32_t minimum_depth_arg, jshort our_to_self_delay_arg, int64_t our_htlc_minimum_msat_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1new(JNIEnv *env, jclass clz, int32_t minimum_depth_arg, int16_t our_to_self_delay_arg, int64_t our_htlc_minimum_msat_arg) { LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg); CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -7564,15 +7496,15 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1m ChannelHandshakeLimits_set_max_channel_reserve_satoshis(&this_ptr_conv, val); } -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = ChannelHandshakeLimits_get_min_max_accepted_htlcs(&this_ptr_conv); + int16_t ret_val = ChannelHandshakeLimits_get_min_max_accepted_htlcs(&this_ptr_conv); return ret_val; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, jshort val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; @@ -7639,22 +7571,22 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1f ChannelHandshakeLimits_set_force_announced_channel_preference(&this_ptr_conv, val); } -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1their_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1their_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = ChannelHandshakeLimits_get_their_to_self_delay(&this_ptr_conv); + int16_t ret_val = ChannelHandshakeLimits_get_their_to_self_delay(&this_ptr_conv); return ret_val; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1their_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, jshort val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1their_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; ChannelHandshakeLimits_set_their_to_self_delay(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1new(JNIEnv *env, jclass clz, int64_t min_funding_satoshis_arg, int64_t max_htlc_minimum_msat_arg, int64_t min_max_htlc_value_in_flight_msat_arg, int64_t max_channel_reserve_satoshis_arg, jshort min_max_accepted_htlcs_arg, int64_t min_dust_limit_satoshis_arg, int64_t max_dust_limit_satoshis_arg, int32_t max_minimum_depth_arg, jboolean force_announced_channel_preference_arg, jshort their_to_self_delay_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1new(JNIEnv *env, jclass clz, int64_t min_funding_satoshis_arg, int64_t max_htlc_minimum_msat_arg, int64_t min_max_htlc_value_in_flight_msat_arg, int64_t max_channel_reserve_satoshis_arg, int16_t min_max_accepted_htlcs_arg, int64_t min_dust_limit_satoshis_arg, int64_t max_dust_limit_satoshis_arg, int32_t max_minimum_depth_arg, jboolean force_announced_channel_preference_arg, int16_t their_to_self_delay_arg) { LDKChannelHandshakeLimits ret_var = 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, min_dust_limit_satoshis_arg, max_dust_limit_satoshis_arg, max_minimum_depth_arg, force_announced_channel_preference_arg, their_to_self_delay_arg); CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -8298,6 +8230,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1l LDKLogger* logger_conv = (LDKLogger*)logger; LDKCVec_TransactionZ ret_var = ChannelMonitor_get_latest_holder_commitment_txn(&this_arg_conv, logger_conv); jobjectArray ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); + ; for (size_t i = 0; i < ret_var.datalen; i++) { LDKTransaction arr_conv_8_var = ret_var.data[i]; int8_tArray arr_conv_8_arr = (*env)->NewByteArray(env, arr_conv_8_var.datalen); @@ -8444,22 +8377,22 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1txid(JNIEnv *en OutPoint_set_txid(&this_ptr_conv, val_ref); } -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1index(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1index(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKOutPoint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = OutPoint_get_index(&this_ptr_conv); + int16_t ret_val = OutPoint_get_index(&this_ptr_conv); return ret_val; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1index(JNIEnv *env, jclass clz, int64_t this_ptr, jshort val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1index(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { LDKOutPoint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; OutPoint_set_index(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1new(JNIEnv *env, jclass clz, int8_tArray txid_arg, jshort index_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_OutPoint_1new(JNIEnv *env, jclass clz, int8_tArray txid_arg, int16_t index_arg) { LDKThirtyTwoBytes txid_arg_ref; CHECK((*env)->GetArrayLength(env, txid_arg) == 32); (*env)->GetByteArrayRegion(env, txid_arg, 0, 32, txid_arg_ref.data); @@ -8740,19 +8673,19 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1counte return ret_ref; } -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1counterparty_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1counterparty_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) { LDKInMemoryChannelKeys this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; - jshort ret_val = InMemoryChannelKeys_counterparty_selected_contest_delay(&this_arg_conv); + int16_t ret_val = InMemoryChannelKeys_counterparty_selected_contest_delay(&this_arg_conv); return ret_val; } -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1holder_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1holder_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) { LDKInMemoryChannelKeys this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; - jshort ret_val = InMemoryChannelKeys_holder_selected_contest_delay(&this_arg_conv); + int16_t ret_val = InMemoryChannelKeys_holder_selected_contest_delay(&this_arg_conv); return ret_val; } @@ -9041,7 +8974,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free(JNIEn PaymentSendFailure_free(this_ptr_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1new(JNIEnv *env, jclass clz, jclass network, int64_t fee_est, int64_t chain_monitor, int64_t tx_broadcaster, int64_t logger, int64_t keys_manager, int64_t config, int64_t current_blockchain_height) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelManager_1new(JNIEnv *env, jclass clz, jclass network, int64_t fee_est, int64_t chain_monitor, int64_t tx_broadcaster, int64_t logger, int64_t keys_manager, int64_t config, intptr_t current_blockchain_height) { LDKNetwork network_conv = LDKNetwork_from_java(env, network); LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)fee_est; if (fee_est_conv.free == LDKFeeEstimator_JCalls_free) { @@ -9707,37 +9640,37 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1clone(JNIEnv *env, jc return ret_ref; } -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Ping_1get_1ponglen(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Ping_1get_1ponglen(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = Ping_get_ponglen(&this_ptr_conv); + int16_t ret_val = Ping_get_ponglen(&this_ptr_conv); return ret_val; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1ponglen(JNIEnv *env, jclass clz, int64_t this_ptr, jshort val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1ponglen(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; Ping_set_ponglen(&this_ptr_conv, val); } -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Ping_1get_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Ping_1get_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = Ping_get_byteslen(&this_ptr_conv); + int16_t ret_val = Ping_get_byteslen(&this_ptr_conv); return ret_val; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr, jshort val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; Ping_set_byteslen(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1new(JNIEnv *env, jclass clz, jshort ponglen_arg, jshort byteslen_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Ping_1new(JNIEnv *env, jclass clz, int16_t ponglen_arg, int16_t byteslen_arg) { LDKPing ret_var = Ping_new(ponglen_arg, byteslen_arg); CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -9769,22 +9702,22 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1clone(JNIEnv *env, jc return ret_ref; } -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Pong_1get_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_Pong_1get_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKPong this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = Pong_get_byteslen(&this_ptr_conv); + int16_t ret_val = Pong_get_byteslen(&this_ptr_conv); return ret_val; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1set_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr, jshort val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1set_1byteslen(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { LDKPong this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; Pong_set_byteslen(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1new(JNIEnv *env, jclass clz, jshort byteslen_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_Pong_1new(JNIEnv *env, jclass clz, int16_t byteslen_arg) { LDKPong ret_var = Pong_new(byteslen_arg); CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -9959,30 +9892,30 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1feerate_1per OpenChannel_set_feerate_per_kw(&this_ptr_conv, val); } -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = OpenChannel_get_to_self_delay(&this_ptr_conv); + int16_t ret_val = OpenChannel_get_to_self_delay(&this_ptr_conv); return ret_val; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, jshort val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; OpenChannel_set_to_self_delay(&this_ptr_conv, val); } -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = OpenChannel_get_max_accepted_htlcs(&this_ptr_conv); + int16_t ret_val = OpenChannel_get_max_accepted_htlcs(&this_ptr_conv); return ret_val; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, jshort val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; @@ -10233,30 +10166,30 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1minimum_1d AcceptChannel_set_minimum_depth(&this_ptr_conv, val); } -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = AcceptChannel_get_to_self_delay(&this_ptr_conv); + int16_t ret_val = AcceptChannel_get_to_self_delay(&this_ptr_conv); return ret_val; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, jshort val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1to_1self_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; AcceptChannel_set_to_self_delay(&this_ptr_conv, val); } -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = AcceptChannel_get_max_accepted_htlcs(&this_ptr_conv); + int16_t ret_val = AcceptChannel_get_max_accepted_htlcs(&this_ptr_conv); return ret_val; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, jshort val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1accepted_1htlcs(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; @@ -10436,15 +10369,15 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1 FundingCreated_set_funding_txid(&this_ptr_conv, val_ref); } -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = FundingCreated_get_funding_output_index(&this_ptr_conv); + int16_t ret_val = FundingCreated_get_funding_output_index(&this_ptr_conv); return ret_val; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr, jshort val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1output_1index(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; @@ -10470,7 +10403,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1signature FundingCreated_set_signature(&this_ptr_conv, val_ref); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1new(JNIEnv *env, jclass clz, int8_tArray temporary_channel_id_arg, int8_tArray funding_txid_arg, jshort funding_output_index_arg, int8_tArray signature_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_FundingCreated_1new(JNIEnv *env, jclass clz, int8_tArray temporary_channel_id_arg, int8_tArray funding_txid_arg, int16_t funding_output_index_arg, int8_tArray signature_arg) { LDKThirtyTwoBytes temporary_channel_id_arg_ref; CHECK((*env)->GetArrayLength(env, temporary_channel_id_arg) == 32); (*env)->GetByteArrayRegion(env, temporary_channel_id_arg, 0, 32, temporary_channel_id_arg_ref.data); @@ -11117,15 +11050,15 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1 UpdateFailMalformedHTLC_set_htlc_id(&this_ptr_conv, val); } -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1failure_1code(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1failure_1code(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = UpdateFailMalformedHTLC_get_failure_code(&this_ptr_conv); + int16_t ret_val = UpdateFailMalformedHTLC_get_failure_code(&this_ptr_conv); return ret_val; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1failure_1code(JNIEnv *env, jclass clz, int64_t this_ptr, jshort val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1failure_1code(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; @@ -12316,15 +12249,15 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fl UnsignedChannelUpdate_set_flags(&this_ptr_conv, val); } -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = UnsignedChannelUpdate_get_cltv_expiry_delta(&this_ptr_conv); + int16_t ret_val = UnsignedChannelUpdate_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, jshort val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; @@ -14173,6 +14106,7 @@ JNIEXPORT jobjectArray JNICALL Java_org_ldk_impl_bindings_PeerManager_1get_1peer this_arg_conv.is_owned = false; LDKCVec_PublicKeyZ ret_var = PeerManager_get_peer_node_ids(&this_arg_conv); jobjectArray ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); + ; for (size_t i = 0; i < ret_var.datalen; i++) { int8_tArray arr_conv_8_arr = (*env)->NewByteArray(env, 33); (*env)->SetByteArrayRegion(env, arr_conv_8_arr, 0, 33, ret_var.data[i].compressed_form); @@ -14692,7 +14626,7 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1from_1chann return (long)ret_conv; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1revokeable_1redeemscript(JNIEnv *env, jclass clz, int8_tArray revocation_key, jshort contest_delay, int8_tArray broadcaster_delayed_payment_key) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_get_1revokeable_1redeemscript(JNIEnv *env, jclass clz, int8_tArray revocation_key, int16_t contest_delay, int8_tArray broadcaster_delayed_payment_key) { LDKPublicKey revocation_key_ref; CHECK((*env)->GetArrayLength(env, revocation_key) == 33); (*env)->GetByteArrayRegion(env, revocation_key, 0, 33, revocation_key_ref.compressed_form); @@ -14845,7 +14779,7 @@ JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_make_1funding_1redeemsc return arg_arr; } -JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1htlc_1transaction(JNIEnv *env, jclass clz, int8_tArray prev_hash, int32_t feerate_per_kw, jshort contest_delay, int64_t htlc, int8_tArray broadcaster_delayed_payment_key, int8_tArray revocation_key) { +JNIEXPORT int8_tArray JNICALL Java_org_ldk_impl_bindings_build_1htlc_1transaction(JNIEnv *env, jclass clz, int8_tArray prev_hash, int32_t feerate_per_kw, int16_t contest_delay, int64_t htlc, int8_tArray broadcaster_delayed_payment_key, int8_tArray revocation_key) { unsigned char prev_hash_arr[32]; CHECK((*env)->GetArrayLength(env, prev_hash) == 32); (*env)->GetByteArrayRegion(env, prev_hash, 0, 32, prev_hash_arr); @@ -14913,15 +14847,15 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1 ChannelTransactionParameters_set_holder_pubkeys(&this_ptr_conv, val_conv); } -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1holder_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1get_1holder_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = ChannelTransactionParameters_get_holder_selected_contest_delay(&this_ptr_conv); + int16_t ret_val = ChannelTransactionParameters_get_holder_selected_contest_delay(&this_ptr_conv); return ret_val; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1holder_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, jshort val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1set_1holder_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; @@ -14995,7 +14929,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1 ChannelTransactionParameters_set_funding_outpoint(&this_ptr_conv, val_conv); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1new(JNIEnv *env, jclass clz, int64_t holder_pubkeys_arg, jshort holder_selected_contest_delay_arg, jboolean is_outbound_from_holder_arg, int64_t counterparty_parameters_arg, int64_t funding_outpoint_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_ChannelTransactionParameters_1new(JNIEnv *env, jclass clz, int64_t holder_pubkeys_arg, int16_t holder_selected_contest_delay_arg, jboolean is_outbound_from_holder_arg, int64_t counterparty_parameters_arg, int64_t funding_outpoint_arg) { LDKChannelPublicKeys holder_pubkeys_arg_conv; holder_pubkeys_arg_conv.inner = (void*)(holder_pubkeys_arg & (~1)); holder_pubkeys_arg_conv.is_owned = (holder_pubkeys_arg & 1) || (holder_pubkeys_arg == 0); @@ -15068,22 +15002,22 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransaction CounterpartyChannelTransactionParameters_set_pubkeys(&this_ptr_conv, val_conv); } -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1get_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1get_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKCounterpartyChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = CounterpartyChannelTransactionParameters_get_selected_contest_delay(&this_ptr_conv); + int16_t ret_val = CounterpartyChannelTransactionParameters_get_selected_contest_delay(&this_ptr_conv); return ret_val; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1set_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, jshort val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1set_1selected_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { LDKCounterpartyChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CounterpartyChannelTransactionParameters_set_selected_contest_delay(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1new(JNIEnv *env, jclass clz, int64_t pubkeys_arg, jshort selected_contest_delay_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_CounterpartyChannelTransactionParameters_1new(JNIEnv *env, jclass clz, int64_t pubkeys_arg, int16_t selected_contest_delay_arg) { LDKChannelPublicKeys pubkeys_arg_conv; pubkeys_arg_conv.inner = (void*)(pubkeys_arg & (~1)); pubkeys_arg_conv.is_owned = (pubkeys_arg & 1) || (pubkeys_arg == 0); @@ -15222,11 +15156,11 @@ JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionP return ret_ref; } -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) { +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_DirectedChannelTransactionParameters_1contest_1delay(JNIEnv *env, jclass clz, int64_t this_arg) { LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; - jshort ret_val = DirectedChannelTransactionParameters_contest_delay(&this_arg_conv); + int16_t ret_val = DirectedChannelTransactionParameters_contest_delay(&this_arg_conv); return ret_val; } @@ -16069,15 +16003,15 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1fees(JNIEnv *e RouteHint_set_fees(&this_ptr_conv, val_conv); } -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKRouteHint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = RouteHint_get_cltv_expiry_delta(&this_ptr_conv); + int16_t ret_val = RouteHint_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, jshort val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { LDKRouteHint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; @@ -16099,7 +16033,7 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1htlc_1minimum_ RouteHint_set_htlc_minimum_msat(&this_ptr_conv, val); } -JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1new(JNIEnv *env, jclass clz, int8_tArray src_node_id_arg, int64_t short_channel_id_arg, int64_t fees_arg, jshort cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg) { +JNIEXPORT int64_t JNICALL Java_org_ldk_impl_bindings_RouteHint_1new(JNIEnv *env, jclass clz, int8_tArray src_node_id_arg, int64_t short_channel_id_arg, int64_t fees_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg) { LDKPublicKey src_node_id_arg_ref; CHECK((*env)->GetArrayLength(env, src_node_id_arg) == 33); (*env)->GetByteArrayRegion(env, src_node_id_arg, 0, 33, src_node_id_arg_ref.compressed_form); @@ -16316,15 +16250,15 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1e DirectionalChannelInfo_set_enabled(&this_ptr_conv, val); } -JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { +JNIEXPORT int16_t JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr) { LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = DirectionalChannelInfo_get_cltv_expiry_delta(&this_ptr_conv); + int16_t ret_val = DirectionalChannelInfo_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } -JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, jshort val) { +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1cltv_1expiry_1delta(JNIEnv *env, jclass clz, int64_t this_ptr, int16_t val) { LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; diff --git a/src/main/jni/org_ldk_impl_bindings.h b/src/main/jni/org_ldk_impl_bindings.h index b2af42cc..ee3cbdae 100644 --- a/src/main/jni/org_ldk_impl_bindings.h +++ b/src/main/jni/org_ldk_impl_bindings.h @@ -511,14 +511,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNo JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1new (JNIEnv *, jclass, jobject, jlong); -/* - * Class: org_ldk_impl_bindings - * Method: LDKChannelKeys_get_obj_from_jcalls - * Signature: (J)Lorg/ldk/impl/bindings/LDKChannelKeys; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1get_1obj_1from_1jcalls - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: ChannelKeys_get_per_commitment_point @@ -863,14 +855,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVec_1ChannelMonitorZ_1new JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKWatch_1new (JNIEnv *, jclass, jobject); -/* - * Class: org_ldk_impl_bindings - * Method: LDKWatch_get_obj_from_jcalls - * Signature: (J)Lorg/ldk/impl/bindings/LDKWatch; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKWatch_1get_1obj_1from_1jcalls - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: Watch_watch_channel @@ -903,14 +887,6 @@ JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_Watch_1release_1pending_ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1new (JNIEnv *, jclass, jobject); -/* - * Class: org_ldk_impl_bindings - * Method: LDKBroadcasterInterface_get_obj_from_jcalls - * Signature: (J)Lorg/ldk/impl/bindings/LDKBroadcasterInterface; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1get_1obj_1from_1jcalls - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: BroadcasterInterface_broadcast_transaction @@ -927,14 +903,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1broadcas JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1new (JNIEnv *, jclass, jobject); -/* - * Class: org_ldk_impl_bindings - * Method: LDKKeysInterface_get_obj_from_jcalls - * Signature: (J)Lorg/ldk/impl/bindings/LDKKeysInterface; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1get_1obj_1from_1jcalls - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: KeysInterface_get_node_secret @@ -991,14 +959,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysInterface_1read_1chan_1si JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1new (JNIEnv *, jclass, jobject); -/* - * Class: org_ldk_impl_bindings - * Method: LDKFeeEstimator_get_obj_from_jcalls - * Signature: (J)Lorg/ldk/impl/bindings/LDKFeeEstimator; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1get_1obj_1from_1jcalls - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: FeeEstimator_get_est_sat_per_1000_weight @@ -1015,14 +975,6 @@ JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1get_1est_1sat_1p JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKLogger_1new (JNIEnv *, jclass, jobject); -/* - * Class: org_ldk_impl_bindings - * Method: LDKLogger_get_obj_from_jcalls - * Signature: (J)Lorg/ldk/impl/bindings/LDKLogger; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKLogger_1get_1obj_1from_1jcalls - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: LDKC2Tuple_BlockHashChannelManagerZ_new @@ -1903,14 +1855,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NetworkGraphDecod JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1new (JNIEnv *, jclass, jobject); -/* - * Class: org_ldk_impl_bindings - * Method: LDKMessageSendEventsProvider_get_obj_from_jcalls - * Signature: (J)Lorg/ldk/impl/bindings/LDKMessageSendEventsProvider; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1get_1obj_1from_1jcalls - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: MessageSendEventsProvider_get_and_clear_pending_msg_events @@ -1927,14 +1871,6 @@ JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvide JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1new (JNIEnv *, jclass, jobject); -/* - * Class: org_ldk_impl_bindings - * Method: LDKEventsProvider_get_obj_from_jcalls - * Signature: (J)Lorg/ldk/impl/bindings/LDKEventsProvider; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1get_1obj_1from_1jcalls - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: EventsProvider_get_and_clear_pending_events @@ -1951,14 +1887,6 @@ JNIEXPORT jlongArray JNICALL Java_org_ldk_impl_bindings_EventsProvider_1get_1and JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKAccess_1new (JNIEnv *, jclass, jobject); -/* - * Class: org_ldk_impl_bindings - * Method: LDKAccess_get_obj_from_jcalls - * Signature: (J)Lorg/ldk/impl/bindings/LDKAccess; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAccess_1get_1obj_1from_1jcalls - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: Access_get_utxo @@ -1975,14 +1903,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Access_1get_1utxo JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKFilter_1new (JNIEnv *, jclass, jobject); -/* - * Class: org_ldk_impl_bindings - * Method: LDKFilter_get_obj_from_jcalls - * Signature: (J)Lorg/ldk/impl/bindings/LDKFilter; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFilter_1get_1obj_1from_1jcalls - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: Filter_register_tx @@ -2007,14 +1927,6 @@ JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1register_1output JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKPersist_1new (JNIEnv *, jclass, jobject); -/* - * Class: org_ldk_impl_bindings - * Method: LDKPersist_get_obj_from_jcalls - * Signature: (J)Lorg/ldk/impl/bindings/LDKPersist; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKPersist_1get_1obj_1from_1jcalls - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: Persist_persist_new_channel @@ -2039,14 +1951,6 @@ 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_obj_from_jcalls - * Signature: (J)Lorg/ldk/impl/bindings/LDKChannelMessageHandler; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1get_1obj_1from_1jcalls - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: ChannelMessageHandler_handle_open_channel @@ -2207,14 +2111,6 @@ 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_obj_from_jcalls - * Signature: (J)Lorg/ldk/impl/bindings/LDKRoutingMessageHandler; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1get_1obj_1from_1jcalls - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: RoutingMessageHandler_handle_node_announcement @@ -2311,14 +2207,6 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1handle JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1new (JNIEnv *, jclass, jobject); -/* - * Class: org_ldk_impl_bindings - * Method: LDKSocketDescriptor_get_obj_from_jcalls - * Signature: (J)Lorg/ldk/impl/bindings/LDKSocketDescriptor; - */ -JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1get_1obj_1from_1jcalls - (JNIEnv *, jclass, jlong); - /* * Class: org_ldk_impl_bindings * Method: SocketDescriptor_send_data diff --git a/ts/bindings.c b/ts/bindings.c index 704e37ae..e7dd5783 100644 --- a/ts/bindings.c +++ b/ts/bindings.c @@ -8,7 +8,7 @@ void *memcpy(void *dest, const void *src, size_t n); int memcmp(const void *s1, const void *s2, size_t n); void __attribute__((noreturn)) abort(void); -void assert(scalar expression); +void assert(bool expression); // Always run a, then assert it is true: #define DO_ASSERT(a) do { bool _assert_val = (a); assert(_assert_val); } while(0) @@ -107,7 +107,11 @@ _Static_assert(sizeof(void*) == 4, "Pointers mut be 32 bits"); typedef struct int64_tArray {uint32_t len;int64_t *ptr;} int64_tArray; typedef struct uint32_tArray {uint32_t len;int32_t *ptr;} uint32_tArray; +typedef struct ptrArray {uint32_t len;int32_t *ptr;} ptrArray; typedef struct int8_tArray {uint32_t len;int8_t *ptr;} int8_tArray; +typedef struct jstring {} jstring; + +jstring conv_owned_string(const char* _src) { jstring a; return a; } typedef bool jboolean; @@ -229,7 +233,7 @@ uint32_t LDKCVec_1u8Z_1new(void* ctx_TODO, int8_tArray elems) { ret->data = NULL; } else { ret->data = MALLOC(sizeof(uint8_t) * ret->datalen, "LDKCVec_u8Z Data"); - int8_t *java_elems = elems.ptr; + int8_t *java_elems = (int8_t*)elems.ptr; for (size_t i = 0; i < ret->datalen; i++) { ret->data[i] = java_elems[i]; } @@ -305,7 +309,7 @@ uint32_t LDKCVec_1SpendableOutputDescriptorZ_1new(void* ctx_TODO, uint32_tArray ret->data = NULL; } else { ret->data = MALLOC(sizeof(LDKSpendableOutputDescriptor) * ret->datalen, "LDKCVec_SpendableOutputDescriptorZ Data"); - uint32_t *java_elems = elems.ptr; + uint32_t *java_elems = (uint32_t*)elems.ptr; for (size_t i = 0; i < ret->datalen; i++) { uint32_t arr_elem = java_elems[i]; LDKSpendableOutputDescriptor arr_elem_conv = *(LDKSpendableOutputDescriptor*)arr_elem; @@ -531,7 +535,7 @@ uint32_t LDKCVec_1MessageSendEventZ_1new(void* ctx_TODO, uint32_tArray elems) { ret->data = NULL; } else { ret->data = MALLOC(sizeof(LDKMessageSendEvent) * ret->datalen, "LDKCVec_MessageSendEventZ Data"); - uint32_t *java_elems = elems.ptr; + uint32_t *java_elems = (uint32_t*)elems.ptr; for (size_t i = 0; i < ret->datalen; i++) { uint32_t arr_elem = java_elems[i]; LDKMessageSendEvent arr_elem_conv = *(LDKMessageSendEvent*)arr_elem; @@ -589,7 +593,7 @@ uint32_t LDKEvent_1ref_1from_1ptr (void* ctx_TODO, uint32_t ptr) { case LDKEvent_SpendableOutputs: { LDKCVec_SpendableOutputDescriptorZ outputs_var = obj->spendable_outputs.outputs; uint32_tArray outputs_arr = { .len = outputs_var.datalen, .ptr = MALLOC(outputs_var.datalen * sizeof(int32_t), "Native uint32_tArray Bytes") }; - uint32_t *outputs_arr_ptr = outputs_arr.ptr; + uint32_t *outputs_arr_ptr = (uint32_t*)outputs_arr.ptr; for (size_t b = 0; b < outputs_var.datalen; b++) { long arr_conv_27_ref = (long)&outputs_var.data[b]; outputs_arr_ptr[b] = arr_conv_27_ref; @@ -606,7 +610,7 @@ uint32_t LDKCVec_1EventZ_1new(void* ctx_TODO, uint32_tArray elems) { ret->data = NULL; } else { ret->data = MALLOC(sizeof(LDKEvent) * ret->datalen, "LDKCVec_EventZ Data"); - uint32_t *java_elems = elems.ptr; + uint32_t *java_elems = (uint32_t*)elems.ptr; for (size_t i = 0; i < ret->datalen; i++) { uint32_t arr_elem = java_elems[i]; LDKEvent arr_elem_conv = *(LDKEvent*)arr_elem; @@ -623,7 +627,7 @@ static inline LDKCVec_EventZ CVec_EventZ_clone(const LDKCVec_EventZ *orig) { } return ret; } -uint32_t LDKC2Tuple_1usizeTransactionZ_1new(void* ctx_TODO, int64_t a, int8_tArray b) { +uint32_t LDKC2Tuple_1usizeTransactionZ_1new(void* ctx_TODO, intptr_t a, int8_tArray b) { LDKC2Tuple_usizeTransactionZ* ret = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); ret->a = a; LDKTransaction b_ref; @@ -634,7 +638,7 @@ uint32_t LDKC2Tuple_1usizeTransactionZ_1new(void* ctx_TODO, int64_t a, int8_tArr ret->b = b_ref; return (long)ret; } -int64_t LDKC2Tuple_1usizeTransactionZ_1get_1a(void* ctx_TODO, uint32_t ptr) { +intptr_t LDKC2Tuple_1usizeTransactionZ_1get_1a(void* ctx_TODO, uint32_t ptr) { LDKC2Tuple_usizeTransactionZ *tuple = (LDKC2Tuple_usizeTransactionZ*)ptr; return tuple->a; } @@ -652,7 +656,7 @@ uint32_t LDKCVec_1C2Tuple_1usizeTransactionZZ_1new(void* ctx_TODO, uint32_tArray ret->data = NULL; } else { ret->data = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ) * ret->datalen, "LDKCVec_C2Tuple_usizeTransactionZZ Data"); - uint32_t *java_elems = elems.ptr; + uint32_t *java_elems = (uint32_t*)elems.ptr; for (size_t i = 0; i < ret->datalen; i++) { uint32_t arr_elem = java_elems[i]; LDKC2Tuple_usizeTransactionZ arr_elem_conv = *(LDKC2Tuple_usizeTransactionZ*)arr_elem; @@ -694,7 +698,7 @@ uint32_t LDKCVec_1MonitorEventZ_1new(void* ctx_TODO, uint32_tArray elems) { ret->data = NULL; } else { ret->data = MALLOC(sizeof(LDKMonitorEvent) * ret->datalen, "LDKCVec_MonitorEventZ Data"); - uint32_t *java_elems = elems.ptr; + uint32_t *java_elems = (uint32_t*)elems.ptr; for (size_t i = 0; i < ret->datalen; i++) { uint32_t arr_elem = java_elems[i]; LDKMonitorEvent arr_elem_conv; @@ -813,7 +817,7 @@ uint32_t LDKCVec_1C2Tuple_1u32TxOutZZ_1new(void* ctx_TODO, uint32_tArray elems) ret->data = NULL; } else { ret->data = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ) * ret->datalen, "LDKCVec_C2Tuple_u32TxOutZZ Data"); - uint32_t *java_elems = elems.ptr; + uint32_t *java_elems = (uint32_t*)elems.ptr; for (size_t i = 0; i < ret->datalen; i++) { uint32_t arr_elem = java_elems[i]; LDKC2Tuple_u32TxOutZ arr_elem_conv = *(LDKC2Tuple_u32TxOutZ*)arr_elem; @@ -836,11 +840,11 @@ uint32_t LDKC2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1new(void* ctx_TODO, int8_tA else b_constr.data = NULL; uint32_t* b_vals = (uint32_t*) b.ptr; - for (size_t a = 0; a < b_constr.datalen; a++) { - uint32_t arr_conv_26 = b_vals[a]; - LDKC2Tuple_u32TxOutZ arr_conv_26_conv = *(LDKC2Tuple_u32TxOutZ*)arr_conv_26; - FREE((void*)arr_conv_26); - b_constr.data[a] = arr_conv_26_conv; + for (size_t z = 0; z < b_constr.datalen; z++) { + uint32_t arr_conv_25 = b_vals[z]; + LDKC2Tuple_u32TxOutZ arr_conv_25_conv = *(LDKC2Tuple_u32TxOutZ*)arr_conv_25; + FREE((void*)arr_conv_25); + b_constr.data[z] = arr_conv_25_conv; } ret->b = b_constr; return (long)ret; @@ -855,10 +859,10 @@ uint32_tArray LDKC2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1get_1b(void* ctx_TODO, LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *tuple = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)ptr; LDKCVec_C2Tuple_u32TxOutZZ b_var = tuple->b; uint32_tArray b_arr = { .len = b_var.datalen, .ptr = MALLOC(b_var.datalen * sizeof(int32_t), "Native uint32_tArray Bytes") }; - uint32_t *b_arr_ptr = b_arr.ptr; - for (size_t a = 0; a < b_var.datalen; a++) { - long arr_conv_26_ref = (long)&b_var.data[a]; - b_arr_ptr[a] = arr_conv_26_ref; + uint32_t *b_arr_ptr = (uint32_t*)b_arr.ptr; + for (size_t z = 0; z < b_var.datalen; z++) { + long arr_conv_25_ref = (long)&b_var.data[z]; + b_arr_ptr[z] = arr_conv_25_ref; } return b_arr; } @@ -869,7 +873,7 @@ uint32_t LDKCVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZZ_1new(void* ctx_TODO, ret->data = NULL; } else { ret->data = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ) * ret->datalen, "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ Data"); - uint32_t *java_elems = elems.ptr; + uint32_t *java_elems = (uint32_t*)elems.ptr; for (size_t i = 0; i < ret->datalen; i++) { uint32_t arr_elem = java_elems[i]; LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ arr_elem_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)arr_elem; @@ -879,7 +883,7 @@ uint32_t LDKCVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZZ_1new(void* ctx_TODO, } return (long)ret; } -uint32_t LDKC2Tuple_1SignatureCVec_1SignatureZZ_1new(void* ctx_TODO, int8_tArray a, uint32_tArray b) { +uint32_t LDKC2Tuple_1SignatureCVec_1SignatureZZ_1new(void* ctx_TODO, int8_tArray a, ptrArray b) { LDKC2Tuple_SignatureCVec_SignatureZZ* ret = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); LDKSignature a_ref; CHECK(a.len == 64); @@ -892,12 +896,12 @@ uint32_t LDKC2Tuple_1SignatureCVec_1SignatureZZ_1new(void* ctx_TODO, int8_tArray else b_constr.data = NULL; int8_tArray* b_vals = (int8_tArray*) b.ptr; - for (size_t i = 0; i < b_constr.datalen; i++) { - int8_tArray arr_conv_8 = b_vals[i]; - LDKSignature arr_conv_8_ref; - CHECK(arr_conv_8.len == 64); - memcpy(arr_conv_8_ref.compact_form, arr_conv_8.ptr, 64); - b_constr.data[i] = arr_conv_8_ref; + for (size_t m = 0; m < b_constr.datalen; m++) { + int8_tArray arr_conv_12 = b_vals[m]; + LDKSignature arr_conv_12_ref; + CHECK(arr_conv_12.len == 64); + memcpy(arr_conv_12_ref.compact_form, arr_conv_12.ptr, 64); + b_constr.data[m] = arr_conv_12_ref; } ret->b = b_constr; return (long)ret; @@ -908,14 +912,15 @@ int8_tArray LDKC2Tuple_1SignatureCVec_1SignatureZZ_1get_1a(void* ctx_TODO, uint3 memcpy(a_arr.ptr, tuple->a.compact_form, 64); return a_arr; } -uint32_tArray LDKC2Tuple_1SignatureCVec_1SignatureZZ_1get_1b(void* ctx_TODO, uint32_t ptr) { +ptrArray LDKC2Tuple_1SignatureCVec_1SignatureZZ_1get_1b(void* ctx_TODO, uint32_t ptr) { LDKC2Tuple_SignatureCVec_SignatureZZ *tuple = (LDKC2Tuple_SignatureCVec_SignatureZZ*)ptr; LDKCVec_SignatureZ b_var = tuple->b; - uint32_tArray b_arr = (*env)->NewObjectArray(env, b_var.datalen, arr_of_B_clz, NULL); - for (size_t i = 0; i < b_var.datalen; i++) { - int8_tArray arr_conv_8_arr = { .len = 64, .ptr = MALLOC(64, "Native int8_tArray Bytes") }; - memcpy(arr_conv_8_arr.ptr, b_var.data[i].compact_form, 64); - (*env)->SetObjectArrayElement(env, b_arr, i, arr_conv_8_arr); + ptrArray b_arr = { .len = b_var.datalen, .ptr = MALLOC(b_var.datalen * sizeof(int32_t), "Native Object Bytes") }; + int8_tArray *b_arr_ptr = (int8_tArray*)b_arr.ptr; + for (size_t m = 0; m < b_var.datalen; m++) { + int8_tArray arr_conv_12_arr = { .len = 64, .ptr = MALLOC(64, "Native int8_tArray Bytes") }; + memcpy(arr_conv_12_arr.ptr, b_var.data[m].compact_form, 64); + b_arr_ptr[m] = arr_conv_12_arr; } return b_arr; } @@ -951,15 +956,16 @@ void LDKCResult_1SignatureNoneZ_1get_1err (void* ctx_TODO, uint32_t arg) { jboolean LDKCResult_1CVec_1SignatureZNoneZ_1result_1ok (void* ctx_TODO, uint32_t arg) { return ((LDKCResult_CVec_SignatureZNoneZ*)arg)->result_ok; } -uint32_tArray LDKCResult_1CVec_1SignatureZNoneZ_1get_1ok (void* ctx_TODO, uint32_t arg) { +ptrArray LDKCResult_1CVec_1SignatureZNoneZ_1get_1ok (void* ctx_TODO, uint32_t arg) { LDKCResult_CVec_SignatureZNoneZ *val = (LDKCResult_CVec_SignatureZNoneZ*)arg; CHECK(val->result_ok); LDKCVec_SignatureZ res_var = (*val->contents.result); - uint32_tArray res_arr = (*env)->NewObjectArray(env, res_var.datalen, arr_of_B_clz, NULL); - for (size_t i = 0; i < res_var.datalen; i++) { - int8_tArray arr_conv_8_arr = { .len = 64, .ptr = MALLOC(64, "Native int8_tArray Bytes") }; - memcpy(arr_conv_8_arr.ptr, res_var.data[i].compact_form, 64); - (*env)->SetObjectArrayElement(env, res_arr, i, arr_conv_8_arr); + ptrArray res_arr = { .len = res_var.datalen, .ptr = MALLOC(res_var.datalen * sizeof(int32_t), "Native Object Bytes") }; + int8_tArray *res_arr_ptr = (int8_tArray*)res_arr.ptr; + for (size_t m = 0; m < res_var.datalen; m++) { + int8_tArray arr_conv_12_arr = { .len = 64, .ptr = MALLOC(64, "Native int8_tArray Bytes") }; + memcpy(arr_conv_12_arr.ptr, res_var.data[m].compact_form, 64); + res_arr_ptr[m] = arr_conv_12_arr; } return res_arr; } @@ -968,6 +974,247 @@ void LDKCResult_1CVec_1SignatureZNoneZ_1get_1err (void* ctx_TODO, uint32_t arg) CHECK(!val->result_ok); return *val->contents.err; } +typedef struct LDKChannelKeys_JCalls { + atomic_size_t refcnt; + // TODO: Object pointer o; + // TODO: Some kind of method pointer get_per_commitment_point_meth; + // TODO: Some kind of method pointer release_commitment_secret_meth; + // TODO: Some kind of method pointer key_derivation_params_meth; + // TODO: Some kind of method pointer sign_counterparty_commitment_meth; + // TODO: Some kind of method pointer sign_holder_commitment_meth; + // TODO: Some kind of method pointer sign_holder_commitment_htlc_transactions_meth; + // TODO: Some kind of method pointer sign_justice_transaction_meth; + // TODO: Some kind of method pointer sign_counterparty_htlc_transaction_meth; + // TODO: Some kind of method pointer sign_closing_transaction_meth; + // TODO: Some kind of method pointer sign_channel_announcement_meth; + // TODO: Some kind of method pointer ready_channel_meth; + // TODO: Some kind of method pointer write_meth; +} LDKChannelKeys_JCalls; +static void LDKChannelKeys_JCalls_free(void* this_arg) { + LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + // TODO: do any release required for j_calls->o (refcnt-- in java, but may be redundant) + FREE(j_calls); + } +} +LDKPublicKey get_per_commitment_point_jcall(const void* this_arg, uint64_t idx) { + LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; + //TODO: jobject obj = get object we can call against on j_calls->o + int8_tArray arg; // TODO: Call get_per_commitment_point on j_calls with instance obj, returning an object, idx); + LDKPublicKey arg_ref; + CHECK(arg.len == 33); + memcpy(arg_ref.compressed_form, arg.ptr, 33); + return arg_ref; +} +LDKThirtyTwoBytes release_commitment_secret_jcall(const void* this_arg, uint64_t idx) { + LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; + //TODO: jobject obj = get object we can call against on j_calls->o + int8_tArray arg; // TODO: Call release_commitment_secret on j_calls with instance obj, returning an object, idx); + LDKThirtyTwoBytes arg_ref; + CHECK(arg.len == 32); + memcpy(arg_ref.data, arg.ptr, 32); + return arg_ref; +} +LDKC2Tuple_u64u64Z key_derivation_params_jcall(const void* this_arg) { + LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; + //TODO: jobject obj = get object we can call against on j_calls->o + LDKC2Tuple_u64u64Z* ret; // TODO: Call key_derivation_params on j_calls with instance obj, returning a pointer); + LDKC2Tuple_u64u64Z ret_conv = *(LDKC2Tuple_u64u64Z*)ret; + FREE((void*)ret); + return ret_conv; +} +LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_jcall(const void* this_arg, const LDKCommitmentTransaction * commitment_tx) { + LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; + LDKCommitmentTransaction commitment_tx_var = *commitment_tx; + if (commitment_tx->inner != NULL) + commitment_tx_var = CommitmentTransaction_clone(commitment_tx); + CHECK((((long)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long commitment_tx_ref = (long)commitment_tx_var.inner; + if (commitment_tx_var.is_owned) { + commitment_tx_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret; // TODO: Call sign_counterparty_commitment on j_calls with instance obj, returning a pointer, commitment_tx_ref); + LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)ret; + FREE((void*)ret); + return ret_conv; +} +LDKCResult_SignatureNoneZ sign_holder_commitment_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * commitment_tx) { + LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; + LDKHolderCommitmentTransaction commitment_tx_var = *commitment_tx; + if (commitment_tx->inner != NULL) + commitment_tx_var = HolderCommitmentTransaction_clone(commitment_tx); + CHECK((((long)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long commitment_tx_ref = (long)commitment_tx_var.inner; + if (commitment_tx_var.is_owned) { + commitment_tx_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + LDKCResult_SignatureNoneZ* ret; // TODO: Call sign_holder_commitment on j_calls with instance obj, returning a pointer, commitment_tx_ref); + LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)ret; + FREE((void*)ret); + return ret_conv; +} +LDKCResult_CVec_SignatureZNoneZ sign_holder_commitment_htlc_transactions_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * commitment_tx) { + LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; + LDKHolderCommitmentTransaction commitment_tx_var = *commitment_tx; + if (commitment_tx->inner != NULL) + commitment_tx_var = HolderCommitmentTransaction_clone(commitment_tx); + CHECK((((long)commitment_tx_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&commitment_tx_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long commitment_tx_ref = (long)commitment_tx_var.inner; + if (commitment_tx_var.is_owned) { + commitment_tx_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + LDKCResult_CVec_SignatureZNoneZ* ret; // TODO: Call sign_holder_commitment_htlc_transactions on j_calls with instance obj, returning a pointer, commitment_tx_ref); + LDKCResult_CVec_SignatureZNoneZ ret_conv = *(LDKCResult_CVec_SignatureZNoneZ*)ret; + FREE((void*)ret); + return ret_conv; +} +LDKCResult_SignatureNoneZ sign_justice_transaction_jcall(const void* this_arg, LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (* per_commitment_key)[32], const LDKHTLCOutputInCommitment * htlc) { + LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; + LDKTransaction justice_tx_var = justice_tx; + int8_tArray justice_tx_arr = { .len = justice_tx_var.datalen, .ptr = MALLOC(justice_tx_var.datalen, "Native int8_tArray Bytes") }; + memcpy(justice_tx_arr.ptr, justice_tx_var.data, justice_tx_var.datalen); + Transaction_free(justice_tx_var); + int8_tArray per_commitment_key_arr = { .len = 32, .ptr = MALLOC(32, "Native int8_tArray Bytes") }; + memcpy(per_commitment_key_arr.ptr, *per_commitment_key, 32); + LDKHTLCOutputInCommitment htlc_var = *htlc; + if (htlc->inner != NULL) + htlc_var = HTLCOutputInCommitment_clone(htlc); + CHECK((((long)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long htlc_ref = (long)htlc_var.inner; + if (htlc_var.is_owned) { + htlc_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + LDKCResult_SignatureNoneZ* ret; // TODO: Call sign_justice_transaction on j_calls with instance obj, returning a pointer, justice_tx_arr, input, amount, per_commitment_key_arr, htlc_ref); + LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)ret; + FREE((void*)ret); + return ret_conv; +} +LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_jcall(const void* this_arg, LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, LDKPublicKey per_commitment_point, const LDKHTLCOutputInCommitment * htlc) { + LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; + LDKTransaction htlc_tx_var = htlc_tx; + int8_tArray htlc_tx_arr = { .len = htlc_tx_var.datalen, .ptr = MALLOC(htlc_tx_var.datalen, "Native int8_tArray Bytes") }; + memcpy(htlc_tx_arr.ptr, htlc_tx_var.data, htlc_tx_var.datalen); + Transaction_free(htlc_tx_var); + int8_tArray per_commitment_point_arr = { .len = 33, .ptr = MALLOC(33, "Native int8_tArray Bytes") }; + memcpy(per_commitment_point_arr.ptr, per_commitment_point.compressed_form, 33); + LDKHTLCOutputInCommitment htlc_var = *htlc; + if (htlc->inner != NULL) + htlc_var = HTLCOutputInCommitment_clone(htlc); + CHECK((((long)htlc_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&htlc_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long htlc_ref = (long)htlc_var.inner; + if (htlc_var.is_owned) { + htlc_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + LDKCResult_SignatureNoneZ* ret; // TODO: Call sign_counterparty_htlc_transaction on j_calls with instance obj, returning a pointer, htlc_tx_arr, input, amount, per_commitment_point_arr, htlc_ref); + LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)ret; + FREE((void*)ret); + return ret_conv; +} +LDKCResult_SignatureNoneZ sign_closing_transaction_jcall(const void* this_arg, LDKTransaction closing_tx) { + LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; + LDKTransaction closing_tx_var = closing_tx; + int8_tArray closing_tx_arr = { .len = closing_tx_var.datalen, .ptr = MALLOC(closing_tx_var.datalen, "Native int8_tArray Bytes") }; + memcpy(closing_tx_arr.ptr, closing_tx_var.data, closing_tx_var.datalen); + Transaction_free(closing_tx_var); + //TODO: jobject obj = get object we can call against on j_calls->o + LDKCResult_SignatureNoneZ* ret; // TODO: Call sign_closing_transaction on j_calls with instance obj, returning a pointer, closing_tx_arr); + LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)ret; + FREE((void*)ret); + return ret_conv; +} +LDKCResult_SignatureNoneZ sign_channel_announcement_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement * msg) { + LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; + LDKUnsignedChannelAnnouncement msg_var = *msg; + if (msg->inner != NULL) + msg_var = UnsignedChannelAnnouncement_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + LDKCResult_SignatureNoneZ* ret; // TODO: Call sign_channel_announcement on j_calls with instance obj, returning a pointer, msg_ref); + LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)ret; + FREE((void*)ret); + return ret_conv; +} +void ready_channel_jcall(void* this_arg, const LDKChannelTransactionParameters * channel_parameters) { + LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; + LDKChannelTransactionParameters channel_parameters_var = *channel_parameters; + if (channel_parameters->inner != NULL) + channel_parameters_var = ChannelTransactionParameters_clone(channel_parameters); + CHECK((((long)channel_parameters_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&channel_parameters_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long channel_parameters_ref = (long)channel_parameters_var.inner; + if (channel_parameters_var.is_owned) { + channel_parameters_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + return; //TODO: Call ready_channel on j_calls with instance obj, channel_parameters_ref); +} +LDKCVec_u8Z write_jcall(const void* this_arg) { + LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; + //TODO: jobject obj = get object we can call against on j_calls->o + int8_tArray arg; // TODO: Call write on j_calls with instance obj, returning an object); + LDKCVec_u8Z arg_ref; + arg_ref.datalen = arg.len; + arg_ref.data = MALLOC(arg_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(arg_ref.data, arg.ptr, arg_ref.datalen); + return arg_ref; +} +static void* LDKChannelKeys_JCalls_clone(const void* this_arg) { + LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); + return (void*) this_arg; +} +static inline LDKChannelKeys LDKChannelKeys_init (void* ctx_TODO, /*TODO: JS Object Reference */void* o, uint32_t pubkeys) { + LDKChannelKeys_JCalls *calls = MALLOC(sizeof(LDKChannelKeys_JCalls), "LDKChannelKeys_JCalls"); + atomic_init(&calls->refcnt, 1); + //TODO: Assign calls->o from o + + LDKChannelPublicKeys pubkeys_conv; + pubkeys_conv.inner = (void*)(pubkeys & (~1)); + pubkeys_conv.is_owned = (pubkeys & 1) || (pubkeys == 0); + if (pubkeys_conv.inner != NULL) + pubkeys_conv = ChannelPublicKeys_clone(&pubkeys_conv); + + LDKChannelKeys ret = { + .this_arg = (void*) calls, + .get_per_commitment_point = get_per_commitment_point_jcall, + .release_commitment_secret = release_commitment_secret_jcall, + .key_derivation_params = key_derivation_params_jcall, + .sign_counterparty_commitment = sign_counterparty_commitment_jcall, + .sign_holder_commitment = sign_holder_commitment_jcall, + .sign_holder_commitment_htlc_transactions = sign_holder_commitment_htlc_transactions_jcall, + .sign_justice_transaction = sign_justice_transaction_jcall, + .sign_counterparty_htlc_transaction = sign_counterparty_htlc_transaction_jcall, + .sign_closing_transaction = sign_closing_transaction_jcall, + .sign_channel_announcement = sign_channel_announcement_jcall, + .ready_channel = ready_channel_jcall, + .clone = LDKChannelKeys_JCalls_clone, + .write = write_jcall, + .free = LDKChannelKeys_JCalls_free, + .pubkeys = pubkeys_conv, + .set_pubkeys = NULL, + }; + return ret; +} +long LDKChannelKeys_1new (void* ctx_TODO, /*TODO: JS Object Reference */void* o, uint32_t pubkeys) { + LDKChannelKeys *res_ptr = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys"); + *res_ptr = LDKChannelKeys_init(NULL, o, pubkeys); + return (long)res_ptr; +} int8_tArray ChannelKeys_1get_1per_1commitment_1point(void* ctx_TODO, uint32_t this_arg, int64_t idx) { LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg; int8_tArray arg_arr = { .len = 33, .ptr = MALLOC(33, "Native int8_tArray Bytes") }; @@ -1019,7 +1266,7 @@ uint32_t ChannelKeys_1sign_1holder_1commitment_1htlc_1transactions(void* ctx_TOD return (long)ret_conv; } -uint32_t ChannelKeys_1sign_1justice_1transaction(void* ctx_TODO, uint32_t this_arg, int8_tArray justice_tx, int64_t input, int64_t amount, int8_tArray per_commitment_key, uint32_t htlc) { +uint32_t ChannelKeys_1sign_1justice_1transaction(void* ctx_TODO, uint32_t this_arg, int8_tArray justice_tx, intptr_t input, int64_t amount, int8_tArray per_commitment_key, uint32_t htlc) { LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg; LDKTransaction justice_tx_ref; justice_tx_ref.datalen = justice_tx.len; @@ -1038,7 +1285,7 @@ uint32_t ChannelKeys_1sign_1justice_1transaction(void* ctx_TODO, uint32_t this_a return (long)ret_conv; } -uint32_t ChannelKeys_1sign_1counterparty_1htlc_1transaction(void* ctx_TODO, uint32_t this_arg, int8_tArray htlc_tx, int64_t input, int64_t amount, int8_tArray per_commitment_point, uint32_t htlc) { +uint32_t ChannelKeys_1sign_1counterparty_1htlc_1transaction(void* ctx_TODO, uint32_t this_arg, int8_tArray htlc_tx, intptr_t input, int64_t amount, int8_tArray per_commitment_point, uint32_t htlc) { LDKChannelKeys* this_arg_conv = (LDKChannelKeys*)this_arg; LDKTransaction htlc_tx_ref; htlc_tx_ref.datalen = htlc_tx.len; @@ -1250,7 +1497,7 @@ uint32_t LDKAPIError_1ref_1from_1ptr (void* ctx_TODO, uint32_t ptr) { char* err_buf = MALLOC(err_str.len + 1, "str conv buf"); memcpy(err_buf, err_str.chars, err_str.len); err_buf[err_str.len] = 0; - jstring err_conv = (*env)->NewStringUTF(env, err_str.chars); + jstring err_conv = conv_owned_string(err_str.chars); FREE(err_buf); return 0 /* LDKAPIError - RouteError */; (void) err_conv; } @@ -1298,7 +1545,7 @@ uint32_t LDKCVec_1ChannelDetailsZ_1new(void* ctx_TODO, uint32_tArray elems) { ret->data = NULL; } else { ret->data = MALLOC(sizeof(LDKChannelDetails) * ret->datalen, "LDKCVec_ChannelDetailsZ Data"); - uint32_t *java_elems = elems.ptr; + uint32_t *java_elems = (uint32_t*)elems.ptr; for (size_t i = 0; i < ret->datalen; i++) { uint32_t arr_elem = java_elems[i]; LDKChannelDetails arr_elem_conv; @@ -1368,7 +1615,7 @@ uint32_t LDKCVec_1NetAddressZ_1new(void* ctx_TODO, uint32_tArray elems) { ret->data = NULL; } else { ret->data = MALLOC(sizeof(LDKNetAddress) * ret->datalen, "LDKCVec_NetAddressZ Data"); - uint32_t *java_elems = elems.ptr; + uint32_t *java_elems = (uint32_t*)elems.ptr; for (size_t i = 0; i < ret->datalen; i++) { uint32_t arr_elem = java_elems[i]; LDKNetAddress arr_elem_conv = *(LDKNetAddress*)arr_elem; @@ -1392,7 +1639,7 @@ uint32_t LDKCVec_1ChannelMonitorZ_1new(void* ctx_TODO, uint32_tArray elems) { ret->data = NULL; } else { ret->data = MALLOC(sizeof(LDKChannelMonitor) * ret->datalen, "LDKCVec_ChannelMonitorZ Data"); - uint32_t *java_elems = elems.ptr; + uint32_t *java_elems = (uint32_t*)elems.ptr; for (size_t i = 0; i < ret->datalen; i++) { uint32_t arr_elem = java_elems[i]; LDKChannelMonitor arr_elem_conv; @@ -1404,6 +1651,110 @@ uint32_t LDKCVec_1ChannelMonitorZ_1new(void* ctx_TODO, uint32_tArray elems) { } return (long)ret; } +typedef struct LDKWatch_JCalls { + atomic_size_t refcnt; + // TODO: Object pointer o; + // TODO: Some kind of method pointer watch_channel_meth; + // TODO: Some kind of method pointer update_channel_meth; + // TODO: Some kind of method pointer release_pending_monitor_events_meth; +} LDKWatch_JCalls; +static void LDKWatch_JCalls_free(void* this_arg) { + LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + // TODO: do any release required for j_calls->o (refcnt-- in java, but may be redundant) + FREE(j_calls); + } +} +LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) { + LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg; + LDKOutPoint funding_txo_var = funding_txo; + CHECK((((long)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long funding_txo_ref = (long)funding_txo_var.inner; + if (funding_txo_var.is_owned) { + funding_txo_ref |= 1; + } + LDKChannelMonitor monitor_var = monitor; + CHECK((((long)monitor_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&monitor_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long monitor_ref = (long)monitor_var.inner; + if (monitor_var.is_owned) { + monitor_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + LDKCResult_NoneChannelMonitorUpdateErrZ* ret; // TODO: Call watch_channel on j_calls with instance obj, returning a pointer, funding_txo_ref, monitor_ref); + LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)ret; + FREE((void*)ret); + return ret_conv; +} +LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate update) { + LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg; + LDKOutPoint funding_txo_var = funding_txo; + CHECK((((long)funding_txo_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&funding_txo_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long funding_txo_ref = (long)funding_txo_var.inner; + if (funding_txo_var.is_owned) { + funding_txo_ref |= 1; + } + LDKChannelMonitorUpdate update_var = update; + CHECK((((long)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long update_ref = (long)update_var.inner; + if (update_var.is_owned) { + update_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + LDKCResult_NoneChannelMonitorUpdateErrZ* ret; // TODO: Call update_channel on j_calls with instance obj, returning a pointer, funding_txo_ref, update_ref); + LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)ret; + FREE((void*)ret); + return ret_conv; +} +LDKCVec_MonitorEventZ release_pending_monitor_events_jcall(const void* this_arg) { + LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg; + //TODO: jobject obj = get object we can call against on j_calls->o + uint32_tArray arg; // TODO: Call release_pending_monitor_events on j_calls with instance obj, returning an object); + LDKCVec_MonitorEventZ arg_constr; + arg_constr.datalen = arg.len; + if (arg_constr.datalen > 0) + arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements"); + else + arg_constr.data = NULL; + uint32_t* arg_vals = (uint32_t*) arg.ptr; + for (size_t o = 0; o < arg_constr.datalen; o++) { + uint32_t arr_conv_14 = arg_vals[o]; + LDKMonitorEvent arr_conv_14_conv; + arr_conv_14_conv.inner = (void*)(arr_conv_14 & (~1)); + arr_conv_14_conv.is_owned = (arr_conv_14 & 1) || (arr_conv_14 == 0); + if (arr_conv_14_conv.inner != NULL) + arr_conv_14_conv = MonitorEvent_clone(&arr_conv_14_conv); + arg_constr.data[o] = arr_conv_14_conv; + } + return arg_constr; +} +static void* LDKWatch_JCalls_clone(const void* this_arg) { + LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); + return (void*) this_arg; +} +static inline LDKWatch LDKWatch_init (void* ctx_TODO, /*TODO: JS Object Reference */void* o) { + LDKWatch_JCalls *calls = MALLOC(sizeof(LDKWatch_JCalls), "LDKWatch_JCalls"); + atomic_init(&calls->refcnt, 1); + //TODO: Assign calls->o from o + + LDKWatch ret = { + .this_arg = (void*) calls, + .watch_channel = watch_channel_jcall, + .update_channel = update_channel_jcall, + .release_pending_monitor_events = release_pending_monitor_events_jcall, + .free = LDKWatch_JCalls_free, + }; + return ret; +} +long LDKWatch_1new (void* ctx_TODO, /*TODO: JS Object Reference */void* o) { + LDKWatch *res_ptr = MALLOC(sizeof(LDKWatch), "LDKWatch"); + *res_ptr = LDKWatch_init(NULL, o); + return (long)res_ptr; +} uint32_t Watch_1watch_1channel(void* ctx_TODO, uint32_t this_arg, uint32_t funding_txo, uint32_t monitor) { LDKWatch* this_arg_conv = (LDKWatch*)this_arg; LDKOutPoint funding_txo_conv; @@ -1441,7 +1792,7 @@ uint32_tArray Watch_1release_1pending_1monitor_1events(void* ctx_TODO, uint32_t LDKWatch* this_arg_conv = (LDKWatch*)this_arg; LDKCVec_MonitorEventZ ret_var = (this_arg_conv->release_pending_monitor_events)(this_arg_conv->this_arg); uint32_tArray ret_arr = { .len = ret_var.datalen, .ptr = MALLOC(ret_var.datalen * sizeof(int32_t), "Native uint32_tArray Bytes") }; - uint32_t *ret_arr_ptr = ret_arr.ptr; + uint32_t *ret_arr_ptr = (uint32_t*)ret_arr.ptr; for (size_t o = 0; o < ret_var.datalen; o++) { LDKMonitorEvent arr_conv_14_var = ret_var.data[o]; CHECK((((long)arr_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. @@ -1456,6 +1807,49 @@ uint32_tArray Watch_1release_1pending_1monitor_1events(void* ctx_TODO, uint32_t return ret_arr; } +typedef struct LDKBroadcasterInterface_JCalls { + atomic_size_t refcnt; + // TODO: Object pointer o; + // TODO: Some kind of method pointer broadcast_transaction_meth; +} LDKBroadcasterInterface_JCalls; +static void LDKBroadcasterInterface_JCalls_free(void* this_arg) { + LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + // TODO: do any release required for j_calls->o (refcnt-- in java, but may be redundant) + FREE(j_calls); + } +} +void broadcast_transaction_jcall(const void* this_arg, LDKTransaction tx) { + LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg; + LDKTransaction tx_var = tx; + int8_tArray tx_arr = { .len = tx_var.datalen, .ptr = MALLOC(tx_var.datalen, "Native int8_tArray Bytes") }; + memcpy(tx_arr.ptr, tx_var.data, tx_var.datalen); + Transaction_free(tx_var); + //TODO: jobject obj = get object we can call against on j_calls->o + return; //TODO: Call broadcast_transaction on j_calls with instance obj, tx_arr); +} +static void* LDKBroadcasterInterface_JCalls_clone(const void* this_arg) { + LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); + return (void*) this_arg; +} +static inline LDKBroadcasterInterface LDKBroadcasterInterface_init (void* ctx_TODO, /*TODO: JS Object Reference */void* o) { + LDKBroadcasterInterface_JCalls *calls = MALLOC(sizeof(LDKBroadcasterInterface_JCalls), "LDKBroadcasterInterface_JCalls"); + atomic_init(&calls->refcnt, 1); + //TODO: Assign calls->o from o + + LDKBroadcasterInterface ret = { + .this_arg = (void*) calls, + .broadcast_transaction = broadcast_transaction_jcall, + .free = LDKBroadcasterInterface_JCalls_free, + }; + return ret; +} +long LDKBroadcasterInterface_1new (void* ctx_TODO, /*TODO: JS Object Reference */void* o) { + LDKBroadcasterInterface *res_ptr = MALLOC(sizeof(LDKBroadcasterInterface), "LDKBroadcasterInterface"); + *res_ptr = LDKBroadcasterInterface_init(NULL, o); + return (long)res_ptr; +} void BroadcasterInterface_1broadcast_1transaction(void* ctx_TODO, uint32_t this_arg, int8_tArray tx) { LDKBroadcasterInterface* this_arg_conv = (LDKBroadcasterInterface*)this_arg; LDKTransaction tx_ref; @@ -1466,6 +1860,106 @@ void BroadcasterInterface_1broadcast_1transaction(void* ctx_TODO, uint32_t this_ (this_arg_conv->broadcast_transaction)(this_arg_conv->this_arg, tx_ref); } +typedef struct LDKKeysInterface_JCalls { + atomic_size_t refcnt; + // TODO: Object pointer o; + // TODO: Some kind of method pointer get_node_secret_meth; + // TODO: Some kind of method pointer get_destination_script_meth; + // TODO: Some kind of method pointer get_shutdown_pubkey_meth; + // TODO: Some kind of method pointer get_channel_keys_meth; + // TODO: Some kind of method pointer get_secure_random_bytes_meth; + // TODO: Some kind of method pointer read_chan_signer_meth; +} LDKKeysInterface_JCalls; +static void LDKKeysInterface_JCalls_free(void* this_arg) { + LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + // TODO: do any release required for j_calls->o (refcnt-- in java, but may be redundant) + FREE(j_calls); + } +} +LDKSecretKey get_node_secret_jcall(const void* this_arg) { + LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; + //TODO: jobject obj = get object we can call against on j_calls->o + int8_tArray arg; // TODO: Call get_node_secret on j_calls with instance obj, returning an object); + LDKSecretKey arg_ref; + CHECK(arg.len == 32); + memcpy(arg_ref.bytes, arg.ptr, 32); + return arg_ref; +} +LDKCVec_u8Z get_destination_script_jcall(const void* this_arg) { + LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; + //TODO: jobject obj = get object we can call against on j_calls->o + int8_tArray arg; // TODO: Call get_destination_script on j_calls with instance obj, returning an object); + LDKCVec_u8Z arg_ref; + arg_ref.datalen = arg.len; + arg_ref.data = MALLOC(arg_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(arg_ref.data, arg.ptr, arg_ref.datalen); + return arg_ref; +} +LDKPublicKey get_shutdown_pubkey_jcall(const void* this_arg) { + LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; + //TODO: jobject obj = get object we can call against on j_calls->o + int8_tArray arg; // TODO: Call get_shutdown_pubkey on j_calls with instance obj, returning an object); + LDKPublicKey arg_ref; + CHECK(arg.len == 33); + memcpy(arg_ref.compressed_form, arg.ptr, 33); + return arg_ref; +} +LDKChannelKeys get_channel_keys_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) { + LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; + //TODO: jobject obj = get object we can call against on j_calls->o + LDKChannelKeys* ret; // TODO: Call get_channel_keys on j_calls with instance obj, returning a pointer, inbound, channel_value_satoshis); + LDKChannelKeys ret_conv = *(LDKChannelKeys*)ret; + ret_conv = ChannelKeys_clone(ret); + return ret_conv; +} +LDKThirtyTwoBytes get_secure_random_bytes_jcall(const void* this_arg) { + LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; + //TODO: jobject obj = get object we can call against on j_calls->o + int8_tArray arg; // TODO: Call get_secure_random_bytes on j_calls with instance obj, returning an object); + LDKThirtyTwoBytes arg_ref; + CHECK(arg.len == 32); + memcpy(arg_ref.data, arg.ptr, 32); + return arg_ref; +} +LDKCResult_ChanKeySignerDecodeErrorZ read_chan_signer_jcall(const void* this_arg, LDKu8slice reader) { + LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; + LDKu8slice reader_var = reader; + int8_tArray reader_arr = { .len = reader_var.datalen, .ptr = MALLOC(reader_var.datalen, "Native int8_tArray Bytes") }; + memcpy(reader_arr.ptr, reader_var.data, reader_var.datalen); + //TODO: jobject obj = get object we can call against on j_calls->o + LDKCResult_ChanKeySignerDecodeErrorZ* ret; // TODO: Call read_chan_signer on j_calls with instance obj, returning a pointer, reader_arr); + LDKCResult_ChanKeySignerDecodeErrorZ ret_conv = *(LDKCResult_ChanKeySignerDecodeErrorZ*)ret; + FREE((void*)ret); + return ret_conv; +} +static void* LDKKeysInterface_JCalls_clone(const void* this_arg) { + LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); + return (void*) this_arg; +} +static inline LDKKeysInterface LDKKeysInterface_init (void* ctx_TODO, /*TODO: JS Object Reference */void* o) { + LDKKeysInterface_JCalls *calls = MALLOC(sizeof(LDKKeysInterface_JCalls), "LDKKeysInterface_JCalls"); + atomic_init(&calls->refcnt, 1); + //TODO: Assign calls->o from o + + LDKKeysInterface ret = { + .this_arg = (void*) calls, + .get_node_secret = get_node_secret_jcall, + .get_destination_script = get_destination_script_jcall, + .get_shutdown_pubkey = get_shutdown_pubkey_jcall, + .get_channel_keys = get_channel_keys_jcall, + .get_secure_random_bytes = get_secure_random_bytes_jcall, + .read_chan_signer = read_chan_signer_jcall, + .free = LDKKeysInterface_JCalls_free, + }; + return ret; +} +long LDKKeysInterface_1new (void* ctx_TODO, /*TODO: JS Object Reference */void* o) { + LDKKeysInterface *res_ptr = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface"); + *res_ptr = LDKKeysInterface_init(NULL, o); + return (long)res_ptr; +} int8_tArray KeysInterface_1get_1node_1secret(void* ctx_TODO, uint32_t this_arg) { LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg; int8_tArray arg_arr = { .len = 32, .ptr = MALLOC(32, "Native int8_tArray Bytes") }; @@ -1513,6 +2007,46 @@ uint32_t KeysInterface_1read_1chan_1signer(void* ctx_TODO, uint32_t this_arg, in return (long)ret_conv; } +typedef struct LDKFeeEstimator_JCalls { + atomic_size_t refcnt; + // TODO: Object pointer o; + // TODO: Some kind of method pointer get_est_sat_per_1000_weight_meth; +} LDKFeeEstimator_JCalls; +static void LDKFeeEstimator_JCalls_free(void* this_arg) { + LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + // TODO: do any release required for j_calls->o (refcnt-- in java, but may be redundant) + FREE(j_calls); + } +} +uint32_t get_est_sat_per_1000_weight_jcall(const void* this_arg, LDKConfirmationTarget confirmation_target) { + LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg; + uint32_t confirmation_target_conv = LDKConfirmationTarget_to_js(confirmation_target); + //TODO: jobject obj = get object we can call against on j_calls->o + return 0; //TODO: Call get_est_sat_per_1000_weight on j_calls with instance obj, returning number, confirmation_target_conv); +} +static void* LDKFeeEstimator_JCalls_clone(const void* this_arg) { + LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); + return (void*) this_arg; +} +static inline LDKFeeEstimator LDKFeeEstimator_init (void* ctx_TODO, /*TODO: JS Object Reference */void* o) { + LDKFeeEstimator_JCalls *calls = MALLOC(sizeof(LDKFeeEstimator_JCalls), "LDKFeeEstimator_JCalls"); + atomic_init(&calls->refcnt, 1); + //TODO: Assign calls->o from o + + LDKFeeEstimator ret = { + .this_arg = (void*) calls, + .get_est_sat_per_1000_weight = get_est_sat_per_1000_weight_jcall, + .free = LDKFeeEstimator_JCalls_free, + }; + return ret; +} +long LDKFeeEstimator_1new (void* ctx_TODO, /*TODO: JS Object Reference */void* o) { + LDKFeeEstimator *res_ptr = MALLOC(sizeof(LDKFeeEstimator), "LDKFeeEstimator"); + *res_ptr = LDKFeeEstimator_init(NULL, o); + return (long)res_ptr; +} int32_t FeeEstimator_1get_1est_1sat_1per_11000_1weight(void* ctx_TODO, uint32_t this_arg, uint32_t confirmation_target) { LDKFeeEstimator* this_arg_conv = (LDKFeeEstimator*)this_arg; LDKConfirmationTarget confirmation_target_conv = LDKConfirmationTarget_from_js(confirmation_target); @@ -1520,6 +2054,46 @@ int32_t FeeEstimator_1get_1est_1sat_1per_11000_1weight(void* ctx_TODO, uint32_t return ret_val; } +typedef struct LDKLogger_JCalls { + atomic_size_t refcnt; + // TODO: Object pointer o; + // TODO: Some kind of method pointer log_meth; +} LDKLogger_JCalls; +static void LDKLogger_JCalls_free(void* this_arg) { + LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + // TODO: do any release required for j_calls->o (refcnt-- in java, but may be redundant) + FREE(j_calls); + } +} +void log_jcall(const void* this_arg, const char* record) { + LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg; + jstring record_conv = conv_owned_string(record); + //TODO: jobject obj = get object we can call against on j_calls->o + return; //TODO: Call log on j_calls with instance obj, record_conv); +} +static void* LDKLogger_JCalls_clone(const void* this_arg) { + LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); + return (void*) this_arg; +} +static inline LDKLogger LDKLogger_init (void* ctx_TODO, /*TODO: JS Object Reference */void* o) { + LDKLogger_JCalls *calls = MALLOC(sizeof(LDKLogger_JCalls), "LDKLogger_JCalls"); + atomic_init(&calls->refcnt, 1); + //TODO: Assign calls->o from o + + LDKLogger ret = { + .this_arg = (void*) calls, + .log = log_jcall, + .free = LDKLogger_JCalls_free, + }; + return ret; +} +long LDKLogger_1new (void* ctx_TODO, /*TODO: JS Object Reference */void* o) { + LDKLogger *res_ptr = MALLOC(sizeof(LDKLogger), "LDKLogger"); + *res_ptr = LDKLogger_init(NULL, o); + return (long)res_ptr; +} uint32_t LDKC2Tuple_1BlockHashChannelManagerZ_1new(void* ctx_TODO, int8_tArray a, uint32_t b) { LDKC2Tuple_BlockHashChannelManagerZ* ret = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelManagerZ), "LDKC2Tuple_BlockHashChannelManagerZ"); LDKThirtyTwoBytes a_ref; @@ -1619,7 +2193,7 @@ uint32_t LDKCVec_1u64Z_1new(void* ctx_TODO, int64_tArray elems) { ret->data = NULL; } else { ret->data = MALLOC(sizeof(uint64_t) * ret->datalen, "LDKCVec_u64Z Data"); - int64_t *java_elems = elems.ptr; + int64_t *java_elems = (int64_t*)elems.ptr; for (size_t i = 0; i < ret->datalen; i++) { ret->data[i] = java_elems[i]; } @@ -1638,7 +2212,7 @@ uint32_t LDKCVec_1UpdateAddHTLCZ_1new(void* ctx_TODO, uint32_tArray elems) { ret->data = NULL; } else { ret->data = MALLOC(sizeof(LDKUpdateAddHTLC) * ret->datalen, "LDKCVec_UpdateAddHTLCZ Data"); - uint32_t *java_elems = elems.ptr; + uint32_t *java_elems = (uint32_t*)elems.ptr; for (size_t i = 0; i < ret->datalen; i++) { uint32_t arr_elem = java_elems[i]; LDKUpdateAddHTLC arr_elem_conv; @@ -1665,7 +2239,7 @@ uint32_t LDKCVec_1UpdateFulfillHTLCZ_1new(void* ctx_TODO, uint32_tArray elems) { ret->data = NULL; } else { ret->data = MALLOC(sizeof(LDKUpdateFulfillHTLC) * ret->datalen, "LDKCVec_UpdateFulfillHTLCZ Data"); - uint32_t *java_elems = elems.ptr; + uint32_t *java_elems = (uint32_t*)elems.ptr; for (size_t i = 0; i < ret->datalen; i++) { uint32_t arr_elem = java_elems[i]; LDKUpdateFulfillHTLC arr_elem_conv; @@ -1692,7 +2266,7 @@ uint32_t LDKCVec_1UpdateFailHTLCZ_1new(void* ctx_TODO, uint32_tArray elems) { ret->data = NULL; } else { ret->data = MALLOC(sizeof(LDKUpdateFailHTLC) * ret->datalen, "LDKCVec_UpdateFailHTLCZ Data"); - uint32_t *java_elems = elems.ptr; + uint32_t *java_elems = (uint32_t*)elems.ptr; for (size_t i = 0; i < ret->datalen; i++) { uint32_t arr_elem = java_elems[i]; LDKUpdateFailHTLC arr_elem_conv; @@ -1719,7 +2293,7 @@ uint32_t LDKCVec_1UpdateFailMalformedHTLCZ_1new(void* ctx_TODO, uint32_tArray el ret->data = NULL; } else { ret->data = MALLOC(sizeof(LDKUpdateFailMalformedHTLC) * ret->datalen, "LDKCVec_UpdateFailMalformedHTLCZ Data"); - uint32_t *java_elems = elems.ptr; + uint32_t *java_elems = (uint32_t*)elems.ptr; for (size_t i = 0; i < ret->datalen; i++) { uint32_t arr_elem = java_elems[i]; LDKUpdateFailMalformedHTLC arr_elem_conv; @@ -1817,7 +2391,7 @@ uint32_t LDKCVec_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1new( ret->data = NULL; } else { ret->data = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) * ret->datalen, "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Data"); - uint32_t *java_elems = elems.ptr; + uint32_t *java_elems = (uint32_t*)elems.ptr; for (size_t i = 0; i < ret->datalen; i++) { uint32_t arr_elem = java_elems[i]; LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arr_elem_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)arr_elem; @@ -1841,7 +2415,7 @@ uint32_t LDKCVec_1NodeAnnouncementZ_1new(void* ctx_TODO, uint32_tArray elems) { ret->data = NULL; } else { ret->data = MALLOC(sizeof(LDKNodeAnnouncement) * ret->datalen, "LDKCVec_NodeAnnouncementZ Data"); - uint32_t *java_elems = elems.ptr; + uint32_t *java_elems = (uint32_t*)elems.ptr; for (size_t i = 0; i < ret->datalen; i++) { uint32_t arr_elem = java_elems[i]; LDKNodeAnnouncement arr_elem_conv; @@ -2279,7 +2853,7 @@ uint32_t LDKCVec_1RouteHopZ_1new(void* ctx_TODO, uint32_tArray elems) { ret->data = NULL; } else { ret->data = MALLOC(sizeof(LDKRouteHop) * ret->datalen, "LDKCVec_RouteHopZ Data"); - uint32_t *java_elems = elems.ptr; + uint32_t *java_elems = (uint32_t*)elems.ptr; for (size_t i = 0; i < ret->datalen; i++) { uint32_t arr_elem = java_elems[i]; LDKRouteHop arr_elem_conv; @@ -2334,7 +2908,7 @@ uint32_t LDKCVec_1RouteHintZ_1new(void* ctx_TODO, uint32_tArray elems) { ret->data = NULL; } else { ret->data = MALLOC(sizeof(LDKRouteHint) * ret->datalen, "LDKCVec_RouteHintZ Data"); - uint32_t *java_elems = elems.ptr; + uint32_t *java_elems = (uint32_t*)elems.ptr; for (size_t i = 0; i < ret->datalen; i++) { uint32_t arr_elem = java_elems[i]; LDKRouteHint arr_elem_conv; @@ -2459,11 +3033,64 @@ uint32_t LDKCResult_1NetworkGraphDecodeErrorZ_1get_1err (void* ctx_TODO, uint32_ long err_ref = (long)err_var.inner & ~1; return err_ref; } +typedef struct LDKMessageSendEventsProvider_JCalls { + atomic_size_t refcnt; + // TODO: Object pointer o; + // TODO: Some kind of method pointer get_and_clear_pending_msg_events_meth; +} LDKMessageSendEventsProvider_JCalls; +static void LDKMessageSendEventsProvider_JCalls_free(void* this_arg) { + LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + // TODO: do any release required for j_calls->o (refcnt-- in java, but may be redundant) + FREE(j_calls); + } +} +LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_jcall(const void* this_arg) { + LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg; + //TODO: jobject obj = get object we can call against on j_calls->o + uint32_tArray arg; // TODO: Call get_and_clear_pending_msg_events on j_calls with instance obj, returning an object); + LDKCVec_MessageSendEventZ arg_constr; + arg_constr.datalen = arg.len; + if (arg_constr.datalen > 0) + arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ Elements"); + else + arg_constr.data = NULL; + uint32_t* arg_vals = (uint32_t*) arg.ptr; + for (size_t s = 0; s < arg_constr.datalen; s++) { + uint32_t arr_conv_18 = arg_vals[s]; + LDKMessageSendEvent arr_conv_18_conv = *(LDKMessageSendEvent*)arr_conv_18; + FREE((void*)arr_conv_18); + arg_constr.data[s] = arr_conv_18_conv; + } + return arg_constr; +} +static void* LDKMessageSendEventsProvider_JCalls_clone(const void* this_arg) { + LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); + return (void*) this_arg; +} +static inline LDKMessageSendEventsProvider LDKMessageSendEventsProvider_init (void* ctx_TODO, /*TODO: JS Object Reference */void* o) { + LDKMessageSendEventsProvider_JCalls *calls = MALLOC(sizeof(LDKMessageSendEventsProvider_JCalls), "LDKMessageSendEventsProvider_JCalls"); + atomic_init(&calls->refcnt, 1); + //TODO: Assign calls->o from o + + LDKMessageSendEventsProvider ret = { + .this_arg = (void*) calls, + .get_and_clear_pending_msg_events = get_and_clear_pending_msg_events_jcall, + .free = LDKMessageSendEventsProvider_JCalls_free, + }; + return ret; +} +long LDKMessageSendEventsProvider_1new (void* ctx_TODO, /*TODO: JS Object Reference */void* o) { + LDKMessageSendEventsProvider *res_ptr = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); + *res_ptr = LDKMessageSendEventsProvider_init(NULL, o); + return (long)res_ptr; +} uint32_tArray MessageSendEventsProvider_1get_1and_1clear_1pending_1msg_1events(void* ctx_TODO, uint32_t this_arg) { LDKMessageSendEventsProvider* this_arg_conv = (LDKMessageSendEventsProvider*)this_arg; LDKCVec_MessageSendEventZ ret_var = (this_arg_conv->get_and_clear_pending_msg_events)(this_arg_conv->this_arg); uint32_tArray ret_arr = { .len = ret_var.datalen, .ptr = MALLOC(ret_var.datalen * sizeof(int32_t), "Native uint32_tArray Bytes") }; - uint32_t *ret_arr_ptr = ret_arr.ptr; + uint32_t *ret_arr_ptr = (uint32_t*)ret_arr.ptr; for (size_t s = 0; s < ret_var.datalen; s++) { LDKMessageSendEvent *arr_conv_18_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent"); *arr_conv_18_copy = MessageSendEvent_clone(&ret_var.data[s]); @@ -2474,11 +3101,64 @@ uint32_tArray MessageSendEventsProvider_1get_1and_1clear_1pending_1msg_1events(v return ret_arr; } +typedef struct LDKEventsProvider_JCalls { + atomic_size_t refcnt; + // TODO: Object pointer o; + // TODO: Some kind of method pointer get_and_clear_pending_events_meth; +} LDKEventsProvider_JCalls; +static void LDKEventsProvider_JCalls_free(void* this_arg) { + LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + // TODO: do any release required for j_calls->o (refcnt-- in java, but may be redundant) + FREE(j_calls); + } +} +LDKCVec_EventZ get_and_clear_pending_events_jcall(const void* this_arg) { + LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg; + //TODO: jobject obj = get object we can call against on j_calls->o + uint32_tArray arg; // TODO: Call get_and_clear_pending_events on j_calls with instance obj, returning an object); + LDKCVec_EventZ arg_constr; + arg_constr.datalen = arg.len; + if (arg_constr.datalen > 0) + arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKEvent), "LDKCVec_EventZ Elements"); + else + arg_constr.data = NULL; + uint32_t* arg_vals = (uint32_t*) arg.ptr; + for (size_t h = 0; h < arg_constr.datalen; h++) { + uint32_t arr_conv_7 = arg_vals[h]; + LDKEvent arr_conv_7_conv = *(LDKEvent*)arr_conv_7; + FREE((void*)arr_conv_7); + arg_constr.data[h] = arr_conv_7_conv; + } + return arg_constr; +} +static void* LDKEventsProvider_JCalls_clone(const void* this_arg) { + LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); + return (void*) this_arg; +} +static inline LDKEventsProvider LDKEventsProvider_init (void* ctx_TODO, /*TODO: JS Object Reference */void* o) { + LDKEventsProvider_JCalls *calls = MALLOC(sizeof(LDKEventsProvider_JCalls), "LDKEventsProvider_JCalls"); + atomic_init(&calls->refcnt, 1); + //TODO: Assign calls->o from o + + LDKEventsProvider ret = { + .this_arg = (void*) calls, + .get_and_clear_pending_events = get_and_clear_pending_events_jcall, + .free = LDKEventsProvider_JCalls_free, + }; + return ret; +} +long LDKEventsProvider_1new (void* ctx_TODO, /*TODO: JS Object Reference */void* o) { + LDKEventsProvider *res_ptr = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); + *res_ptr = LDKEventsProvider_init(NULL, o); + return (long)res_ptr; +} uint32_tArray EventsProvider_1get_1and_1clear_1pending_1events(void* ctx_TODO, uint32_t this_arg) { LDKEventsProvider* this_arg_conv = (LDKEventsProvider*)this_arg; LDKCVec_EventZ ret_var = (this_arg_conv->get_and_clear_pending_events)(this_arg_conv->this_arg); uint32_tArray ret_arr = { .len = ret_var.datalen, .ptr = MALLOC(ret_var.datalen * sizeof(int32_t), "Native uint32_tArray Bytes") }; - uint32_t *ret_arr_ptr = ret_arr.ptr; + uint32_t *ret_arr_ptr = (uint32_t*)ret_arr.ptr; for (size_t h = 0; h < ret_var.datalen; h++) { LDKEvent *arr_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *arr_conv_7_copy = Event_clone(&ret_var.data[h]); @@ -2489,6 +3169,50 @@ uint32_tArray EventsProvider_1get_1and_1clear_1pending_1events(void* ctx_TODO, u return ret_arr; } +typedef struct LDKAccess_JCalls { + atomic_size_t refcnt; + // TODO: Object pointer o; + // TODO: Some kind of method pointer get_utxo_meth; +} LDKAccess_JCalls; +static void LDKAccess_JCalls_free(void* this_arg) { + LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + // TODO: do any release required for j_calls->o (refcnt-- in java, but may be redundant) + FREE(j_calls); + } +} +LDKCResult_TxOutAccessErrorZ get_utxo_jcall(const void* this_arg, const uint8_t (* genesis_hash)[32], uint64_t short_channel_id) { + LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg; + int8_tArray genesis_hash_arr = { .len = 32, .ptr = MALLOC(32, "Native int8_tArray Bytes") }; + memcpy(genesis_hash_arr.ptr, *genesis_hash, 32); + //TODO: jobject obj = get object we can call against on j_calls->o + LDKCResult_TxOutAccessErrorZ* ret; // TODO: Call get_utxo on j_calls with instance obj, returning a pointer, genesis_hash_arr, short_channel_id); + LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)ret; + FREE((void*)ret); + return ret_conv; +} +static void* LDKAccess_JCalls_clone(const void* this_arg) { + LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); + return (void*) this_arg; +} +static inline LDKAccess LDKAccess_init (void* ctx_TODO, /*TODO: JS Object Reference */void* o) { + LDKAccess_JCalls *calls = MALLOC(sizeof(LDKAccess_JCalls), "LDKAccess_JCalls"); + atomic_init(&calls->refcnt, 1); + //TODO: Assign calls->o from o + + LDKAccess ret = { + .this_arg = (void*) calls, + .get_utxo = get_utxo_jcall, + .free = LDKAccess_JCalls_free, + }; + return ret; +} +long LDKAccess_1new (void* ctx_TODO, /*TODO: JS Object Reference */void* o) { + LDKAccess *res_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess"); + *res_ptr = LDKAccess_init(NULL, o); + return (long)res_ptr; +} uint32_t Access_1get_1utxo(void* ctx_TODO, uint32_t this_arg, int8_tArray genesis_hash, int64_t short_channel_id) { LDKAccess* this_arg_conv = (LDKAccess*)this_arg; unsigned char genesis_hash_arr[32]; @@ -2500,6 +3224,69 @@ uint32_t Access_1get_1utxo(void* ctx_TODO, uint32_t this_arg, int8_tArray genesi return (long)ret_conv; } +typedef struct LDKFilter_JCalls { + atomic_size_t refcnt; + // TODO: Object pointer o; + // TODO: Some kind of method pointer register_tx_meth; + // TODO: Some kind of method pointer register_output_meth; +} LDKFilter_JCalls; +static void LDKFilter_JCalls_free(void* this_arg) { + LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + // TODO: do any release required for j_calls->o (refcnt-- in java, but may be redundant) + FREE(j_calls); + } +} +void register_tx_jcall(const void* this_arg, const uint8_t (* txid)[32], LDKu8slice script_pubkey) { + LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg; + int8_tArray txid_arr = { .len = 32, .ptr = MALLOC(32, "Native int8_tArray Bytes") }; + memcpy(txid_arr.ptr, *txid, 32); + LDKu8slice script_pubkey_var = script_pubkey; + int8_tArray script_pubkey_arr = { .len = script_pubkey_var.datalen, .ptr = MALLOC(script_pubkey_var.datalen, "Native int8_tArray Bytes") }; + memcpy(script_pubkey_arr.ptr, script_pubkey_var.data, script_pubkey_var.datalen); + //TODO: jobject obj = get object we can call against on j_calls->o + return; //TODO: Call register_tx on j_calls with instance obj, txid_arr, script_pubkey_arr); +} +void register_output_jcall(const void* this_arg, const LDKOutPoint * outpoint, LDKu8slice script_pubkey) { + LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg; + LDKOutPoint outpoint_var = *outpoint; + if (outpoint->inner != NULL) + outpoint_var = OutPoint_clone(outpoint); + CHECK((((long)outpoint_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&outpoint_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long outpoint_ref = (long)outpoint_var.inner; + if (outpoint_var.is_owned) { + outpoint_ref |= 1; + } + LDKu8slice script_pubkey_var = script_pubkey; + int8_tArray script_pubkey_arr = { .len = script_pubkey_var.datalen, .ptr = MALLOC(script_pubkey_var.datalen, "Native int8_tArray Bytes") }; + memcpy(script_pubkey_arr.ptr, script_pubkey_var.data, script_pubkey_var.datalen); + //TODO: jobject obj = get object we can call against on j_calls->o + return; //TODO: Call register_output on j_calls with instance obj, outpoint_ref, script_pubkey_arr); +} +static void* LDKFilter_JCalls_clone(const void* this_arg) { + LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); + return (void*) this_arg; +} +static inline LDKFilter LDKFilter_init (void* ctx_TODO, /*TODO: JS Object Reference */void* o) { + LDKFilter_JCalls *calls = MALLOC(sizeof(LDKFilter_JCalls), "LDKFilter_JCalls"); + atomic_init(&calls->refcnt, 1); + //TODO: Assign calls->o from o + + LDKFilter ret = { + .this_arg = (void*) calls, + .register_tx = register_tx_jcall, + .register_output = register_output_jcall, + .free = LDKFilter_JCalls_free, + }; + return ret; +} +long LDKFilter_1new (void* ctx_TODO, /*TODO: JS Object Reference */void* o) { + LDKFilter *res_ptr = MALLOC(sizeof(LDKFilter), "LDKFilter"); + *res_ptr = LDKFilter_init(NULL, o); + return (long)res_ptr; +} void Filter_1register_1tx(void* ctx_TODO, uint32_t this_arg, int8_tArray txid, int8_tArray script_pubkey) { LDKFilter* this_arg_conv = (LDKFilter*)this_arg; unsigned char txid_arr[32]; @@ -2523,6 +3310,97 @@ void Filter_1register_1output(void* ctx_TODO, uint32_t this_arg, uint32_t outpoi (this_arg_conv->register_output)(this_arg_conv->this_arg, &outpoint_conv, script_pubkey_ref); } +typedef struct LDKPersist_JCalls { + atomic_size_t refcnt; + // TODO: Object pointer o; + // TODO: Some kind of method pointer persist_new_channel_meth; + // TODO: Some kind of method pointer update_persisted_channel_meth; +} LDKPersist_JCalls; +static void LDKPersist_JCalls_free(void* this_arg) { + LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + // TODO: do any release required for j_calls->o (refcnt-- in java, but may be redundant) + FREE(j_calls); + } +} +LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_jcall(const void* this_arg, LDKOutPoint id, const LDKChannelMonitor * data) { + LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; + LDKOutPoint id_var = id; + CHECK((((long)id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long id_ref = (long)id_var.inner; + if (id_var.is_owned) { + id_ref |= 1; + } + LDKChannelMonitor data_var = *data; + // Warning: we may need a move here but can't clone! + CHECK((((long)data_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&data_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long data_ref = (long)data_var.inner; + if (data_var.is_owned) { + data_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + LDKCResult_NoneChannelMonitorUpdateErrZ* ret; // TODO: Call persist_new_channel on j_calls with instance obj, returning a pointer, id_ref, data_ref); + LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)ret; + FREE((void*)ret); + return ret_conv; +} +LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_jcall(const void* this_arg, LDKOutPoint id, const LDKChannelMonitorUpdate * update, const LDKChannelMonitor * data) { + LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; + LDKOutPoint id_var = id; + CHECK((((long)id_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&id_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long id_ref = (long)id_var.inner; + if (id_var.is_owned) { + id_ref |= 1; + } + LDKChannelMonitorUpdate update_var = *update; + if (update->inner != NULL) + update_var = ChannelMonitorUpdate_clone(update); + CHECK((((long)update_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&update_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long update_ref = (long)update_var.inner; + if (update_var.is_owned) { + update_ref |= 1; + } + LDKChannelMonitor data_var = *data; + // Warning: we may need a move here but can't clone! + CHECK((((long)data_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&data_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long data_ref = (long)data_var.inner; + if (data_var.is_owned) { + data_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + LDKCResult_NoneChannelMonitorUpdateErrZ* ret; // TODO: Call update_persisted_channel on j_calls with instance obj, returning a pointer, id_ref, update_ref, data_ref); + LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)ret; + FREE((void*)ret); + return ret_conv; +} +static void* LDKPersist_JCalls_clone(const void* this_arg) { + LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); + return (void*) this_arg; +} +static inline LDKPersist LDKPersist_init (void* ctx_TODO, /*TODO: JS Object Reference */void* o) { + LDKPersist_JCalls *calls = MALLOC(sizeof(LDKPersist_JCalls), "LDKPersist_JCalls"); + atomic_init(&calls->refcnt, 1); + //TODO: Assign calls->o from o + + LDKPersist ret = { + .this_arg = (void*) calls, + .persist_new_channel = persist_new_channel_jcall, + .update_persisted_channel = update_persisted_channel_jcall, + .free = LDKPersist_JCalls_free, + }; + return ret; +} +long LDKPersist_1new (void* ctx_TODO, /*TODO: JS Object Reference */void* o) { + LDKPersist *res_ptr = MALLOC(sizeof(LDKPersist), "LDKPersist"); + *res_ptr = LDKPersist_init(NULL, o); + return (long)res_ptr; +} uint32_t Persist_1persist_1new_1channel(void* ctx_TODO, uint32_t this_arg, uint32_t id, uint32_t data) { LDKPersist* this_arg_conv = (LDKPersist*)this_arg; LDKOutPoint id_conv; @@ -2556,6 +3434,389 @@ uint32_t Persist_1update_1persisted_1channel(void* ctx_TODO, uint32_t this_arg, return (long)ret_conv; } +typedef struct LDKChannelMessageHandler_JCalls { + atomic_size_t refcnt; + // TODO: Object pointer o; + LDKMessageSendEventsProvider_JCalls* MessageSendEventsProvider; + // TODO: Some kind of method pointer handle_open_channel_meth; + // TODO: Some kind of method pointer handle_accept_channel_meth; + // TODO: Some kind of method pointer handle_funding_created_meth; + // TODO: Some kind of method pointer handle_funding_signed_meth; + // TODO: Some kind of method pointer handle_funding_locked_meth; + // TODO: Some kind of method pointer handle_shutdown_meth; + // TODO: Some kind of method pointer handle_closing_signed_meth; + // TODO: Some kind of method pointer handle_update_add_htlc_meth; + // TODO: Some kind of method pointer handle_update_fulfill_htlc_meth; + // TODO: Some kind of method pointer handle_update_fail_htlc_meth; + // TODO: Some kind of method pointer handle_update_fail_malformed_htlc_meth; + // TODO: Some kind of method pointer handle_commitment_signed_meth; + // TODO: Some kind of method pointer handle_revoke_and_ack_meth; + // TODO: Some kind of method pointer handle_update_fee_meth; + // TODO: Some kind of method pointer handle_announcement_signatures_meth; + // TODO: Some kind of method pointer peer_disconnected_meth; + // TODO: Some kind of method pointer peer_connected_meth; + // TODO: Some kind of method pointer handle_channel_reestablish_meth; + // TODO: Some kind of method pointer handle_error_meth; +} LDKChannelMessageHandler_JCalls; +static void LDKChannelMessageHandler_JCalls_free(void* this_arg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + // TODO: do any release required for j_calls->o (refcnt-- in java, but may be redundant) + FREE(j_calls); + } +} +void handle_open_channel_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKOpenChannel * msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; + int8_tArray their_node_id_arr = { .len = 33, .ptr = MALLOC(33, "Native int8_tArray Bytes") }; + memcpy(their_node_id_arr.ptr, their_node_id.compressed_form, 33); + LDKInitFeatures their_features_var = their_features; + CHECK((((long)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long their_features_ref = (long)their_features_var.inner; + if (their_features_var.is_owned) { + their_features_ref |= 1; + } + LDKOpenChannel msg_var = *msg; + if (msg->inner != NULL) + msg_var = OpenChannel_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + return; //TODO: Call handle_open_channel on j_calls with instance obj, their_node_id_arr, their_features_ref, msg_ref); +} +void handle_accept_channel_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKAcceptChannel * msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; + int8_tArray their_node_id_arr = { .len = 33, .ptr = MALLOC(33, "Native int8_tArray Bytes") }; + memcpy(their_node_id_arr.ptr, their_node_id.compressed_form, 33); + LDKInitFeatures their_features_var = their_features; + CHECK((((long)their_features_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&their_features_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long their_features_ref = (long)their_features_var.inner; + if (their_features_var.is_owned) { + their_features_ref |= 1; + } + LDKAcceptChannel msg_var = *msg; + if (msg->inner != NULL) + msg_var = AcceptChannel_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + return; //TODO: Call handle_accept_channel on j_calls with instance obj, their_node_id_arr, their_features_ref, msg_ref); +} +void handle_funding_created_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated * msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; + int8_tArray their_node_id_arr = { .len = 33, .ptr = MALLOC(33, "Native int8_tArray Bytes") }; + memcpy(their_node_id_arr.ptr, their_node_id.compressed_form, 33); + LDKFundingCreated msg_var = *msg; + if (msg->inner != NULL) + msg_var = FundingCreated_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + return; //TODO: Call handle_funding_created on j_calls with instance obj, their_node_id_arr, msg_ref); +} +void handle_funding_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned * msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; + int8_tArray their_node_id_arr = { .len = 33, .ptr = MALLOC(33, "Native int8_tArray Bytes") }; + memcpy(their_node_id_arr.ptr, their_node_id.compressed_form, 33); + LDKFundingSigned msg_var = *msg; + if (msg->inner != NULL) + msg_var = FundingSigned_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + return; //TODO: Call handle_funding_signed on j_calls with instance obj, their_node_id_arr, msg_ref); +} +void handle_funding_locked_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingLocked * msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; + int8_tArray their_node_id_arr = { .len = 33, .ptr = MALLOC(33, "Native int8_tArray Bytes") }; + memcpy(their_node_id_arr.ptr, their_node_id.compressed_form, 33); + LDKFundingLocked msg_var = *msg; + if (msg->inner != NULL) + msg_var = FundingLocked_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + return; //TODO: Call handle_funding_locked on j_calls with instance obj, their_node_id_arr, msg_ref); +} +void handle_shutdown_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKShutdown * msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; + int8_tArray their_node_id_arr = { .len = 33, .ptr = MALLOC(33, "Native int8_tArray Bytes") }; + memcpy(their_node_id_arr.ptr, their_node_id.compressed_form, 33); + LDKShutdown msg_var = *msg; + if (msg->inner != NULL) + msg_var = Shutdown_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + return; //TODO: Call handle_shutdown on j_calls with instance obj, their_node_id_arr, msg_ref); +} +void handle_closing_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned * msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; + int8_tArray their_node_id_arr = { .len = 33, .ptr = MALLOC(33, "Native int8_tArray Bytes") }; + memcpy(their_node_id_arr.ptr, their_node_id.compressed_form, 33); + LDKClosingSigned msg_var = *msg; + if (msg->inner != NULL) + msg_var = ClosingSigned_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + return; //TODO: Call handle_closing_signed on j_calls with instance obj, their_node_id_arr, msg_ref); +} +void handle_update_add_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC * msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; + int8_tArray their_node_id_arr = { .len = 33, .ptr = MALLOC(33, "Native int8_tArray Bytes") }; + memcpy(their_node_id_arr.ptr, their_node_id.compressed_form, 33); + LDKUpdateAddHTLC msg_var = *msg; + if (msg->inner != NULL) + msg_var = UpdateAddHTLC_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + return; //TODO: Call handle_update_add_htlc on j_calls with instance obj, their_node_id_arr, msg_ref); +} +void handle_update_fulfill_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC * msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; + int8_tArray their_node_id_arr = { .len = 33, .ptr = MALLOC(33, "Native int8_tArray Bytes") }; + memcpy(their_node_id_arr.ptr, their_node_id.compressed_form, 33); + LDKUpdateFulfillHTLC msg_var = *msg; + if (msg->inner != NULL) + msg_var = UpdateFulfillHTLC_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + return; //TODO: Call handle_update_fulfill_htlc on j_calls with instance obj, their_node_id_arr, msg_ref); +} +void handle_update_fail_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC * msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; + int8_tArray their_node_id_arr = { .len = 33, .ptr = MALLOC(33, "Native int8_tArray Bytes") }; + memcpy(their_node_id_arr.ptr, their_node_id.compressed_form, 33); + LDKUpdateFailHTLC msg_var = *msg; + if (msg->inner != NULL) + msg_var = UpdateFailHTLC_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + return; //TODO: Call handle_update_fail_htlc on j_calls with instance obj, their_node_id_arr, msg_ref); +} +void handle_update_fail_malformed_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC * msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; + int8_tArray their_node_id_arr = { .len = 33, .ptr = MALLOC(33, "Native int8_tArray Bytes") }; + memcpy(their_node_id_arr.ptr, their_node_id.compressed_form, 33); + LDKUpdateFailMalformedHTLC msg_var = *msg; + if (msg->inner != NULL) + msg_var = UpdateFailMalformedHTLC_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + return; //TODO: Call handle_update_fail_malformed_htlc on j_calls with instance obj, their_node_id_arr, msg_ref); +} +void handle_commitment_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned * msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; + int8_tArray their_node_id_arr = { .len = 33, .ptr = MALLOC(33, "Native int8_tArray Bytes") }; + memcpy(their_node_id_arr.ptr, their_node_id.compressed_form, 33); + LDKCommitmentSigned msg_var = *msg; + if (msg->inner != NULL) + msg_var = CommitmentSigned_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + return; //TODO: Call handle_commitment_signed on j_calls with instance obj, their_node_id_arr, msg_ref); +} +void handle_revoke_and_ack_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK * msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; + int8_tArray their_node_id_arr = { .len = 33, .ptr = MALLOC(33, "Native int8_tArray Bytes") }; + memcpy(their_node_id_arr.ptr, their_node_id.compressed_form, 33); + LDKRevokeAndACK msg_var = *msg; + if (msg->inner != NULL) + msg_var = RevokeAndACK_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + return; //TODO: Call handle_revoke_and_ack on j_calls with instance obj, their_node_id_arr, msg_ref); +} +void handle_update_fee_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee * msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; + int8_tArray their_node_id_arr = { .len = 33, .ptr = MALLOC(33, "Native int8_tArray Bytes") }; + memcpy(their_node_id_arr.ptr, their_node_id.compressed_form, 33); + LDKUpdateFee msg_var = *msg; + if (msg->inner != NULL) + msg_var = UpdateFee_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + return; //TODO: Call handle_update_fee on j_calls with instance obj, their_node_id_arr, msg_ref); +} +void handle_announcement_signatures_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures * msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; + int8_tArray their_node_id_arr = { .len = 33, .ptr = MALLOC(33, "Native int8_tArray Bytes") }; + memcpy(their_node_id_arr.ptr, their_node_id.compressed_form, 33); + LDKAnnouncementSignatures msg_var = *msg; + if (msg->inner != NULL) + msg_var = AnnouncementSignatures_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + return; //TODO: Call handle_announcement_signatures on j_calls with instance obj, their_node_id_arr, msg_ref); +} +void peer_disconnected_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; + int8_tArray their_node_id_arr = { .len = 33, .ptr = MALLOC(33, "Native int8_tArray Bytes") }; + memcpy(their_node_id_arr.ptr, their_node_id.compressed_form, 33); + //TODO: jobject obj = get object we can call against on j_calls->o + return; //TODO: Call peer_disconnected on j_calls with instance obj, their_node_id_arr, no_connection_possible); +} +void peer_connected_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; + int8_tArray their_node_id_arr = { .len = 33, .ptr = MALLOC(33, "Native int8_tArray Bytes") }; + memcpy(their_node_id_arr.ptr, their_node_id.compressed_form, 33); + LDKInit msg_var = *msg; + if (msg->inner != NULL) + msg_var = Init_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + return; //TODO: Call peer_connected on j_calls with instance obj, their_node_id_arr, msg_ref); +} +void handle_channel_reestablish_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReestablish * msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; + int8_tArray their_node_id_arr = { .len = 33, .ptr = MALLOC(33, "Native int8_tArray Bytes") }; + memcpy(their_node_id_arr.ptr, their_node_id.compressed_form, 33); + LDKChannelReestablish msg_var = *msg; + if (msg->inner != NULL) + msg_var = ChannelReestablish_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + return; //TODO: Call handle_channel_reestablish on j_calls with instance obj, their_node_id_arr, msg_ref); +} +void handle_error_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage * msg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; + int8_tArray their_node_id_arr = { .len = 33, .ptr = MALLOC(33, "Native int8_tArray Bytes") }; + memcpy(their_node_id_arr.ptr, their_node_id.compressed_form, 33); + LDKErrorMessage msg_var = *msg; + if (msg->inner != NULL) + msg_var = ErrorMessage_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + return; //TODO: Call handle_error on j_calls with instance obj, their_node_id_arr, msg_ref); +} +static void* LDKChannelMessageHandler_JCalls_clone(const void* this_arg) { + LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) 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 (void* ctx_TODO, /*TODO: JS Object Reference */void* o, /*TODO: JS Object Reference */void* MessageSendEventsProvider) { + LDKChannelMessageHandler_JCalls *calls = MALLOC(sizeof(LDKChannelMessageHandler_JCalls), "LDKChannelMessageHandler_JCalls"); + atomic_init(&calls->refcnt, 1); + //TODO: Assign calls->o from o + + LDKChannelMessageHandler ret = { + .this_arg = (void*) calls, + .handle_open_channel = handle_open_channel_jcall, + .handle_accept_channel = handle_accept_channel_jcall, + .handle_funding_created = handle_funding_created_jcall, + .handle_funding_signed = handle_funding_signed_jcall, + .handle_funding_locked = handle_funding_locked_jcall, + .handle_shutdown = handle_shutdown_jcall, + .handle_closing_signed = handle_closing_signed_jcall, + .handle_update_add_htlc = handle_update_add_htlc_jcall, + .handle_update_fulfill_htlc = handle_update_fulfill_htlc_jcall, + .handle_update_fail_htlc = handle_update_fail_htlc_jcall, + .handle_update_fail_malformed_htlc = handle_update_fail_malformed_htlc_jcall, + .handle_commitment_signed = handle_commitment_signed_jcall, + .handle_revoke_and_ack = handle_revoke_and_ack_jcall, + .handle_update_fee = handle_update_fee_jcall, + .handle_announcement_signatures = handle_announcement_signatures_jcall, + .peer_disconnected = peer_disconnected_jcall, + .peer_connected = peer_connected_jcall, + .handle_channel_reestablish = handle_channel_reestablish_jcall, + .handle_error = handle_error_jcall, + .free = LDKChannelMessageHandler_JCalls_free, + .MessageSendEventsProvider = LDKMessageSendEventsProvider_init(NULL, MessageSendEventsProvider), + }; + calls->MessageSendEventsProvider = ret.MessageSendEventsProvider.this_arg; + return ret; +} +long LDKChannelMessageHandler_1new (void* ctx_TODO, /*TODO: JS Object Reference */void* o, /*TODO: JS Object Reference */ void* MessageSendEventsProvider) { + LDKChannelMessageHandler *res_ptr = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler"); + *res_ptr = LDKChannelMessageHandler_init(NULL, o, MessageSendEventsProvider); + return (long)res_ptr; +} void ChannelMessageHandler_1handle_1open_1channel(void* ctx_TODO, uint32_t this_arg, int8_tArray their_node_id, uint32_t their_features, uint32_t msg) { LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg; LDKPublicKey their_node_id_ref; @@ -2770,6 +4031,248 @@ void ChannelMessageHandler_1handle_1error(void* ctx_TODO, uint32_t this_arg, int (this_arg_conv->handle_error)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } +typedef struct LDKRoutingMessageHandler_JCalls { + atomic_size_t refcnt; + // TODO: Object pointer o; + LDKMessageSendEventsProvider_JCalls* MessageSendEventsProvider; + // TODO: Some kind of method pointer handle_node_announcement_meth; + // TODO: Some kind of method pointer handle_channel_announcement_meth; + // TODO: Some kind of method pointer handle_channel_update_meth; + // TODO: Some kind of method pointer handle_htlc_fail_channel_update_meth; + // TODO: Some kind of method pointer get_next_channel_announcements_meth; + // TODO: Some kind of method pointer get_next_node_announcements_meth; + // TODO: Some kind of method pointer sync_routing_table_meth; + // TODO: Some kind of method pointer handle_reply_channel_range_meth; + // TODO: Some kind of method pointer handle_reply_short_channel_ids_end_meth; + // TODO: Some kind of method pointer handle_query_channel_range_meth; + // TODO: Some kind of method pointer handle_query_short_channel_ids_meth; +} LDKRoutingMessageHandler_JCalls; +static void LDKRoutingMessageHandler_JCalls_free(void* this_arg) { + LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + // TODO: do any release required for j_calls->o (refcnt-- in java, but may be redundant) + FREE(j_calls); + } +} +LDKCResult_boolLightningErrorZ handle_node_announcement_jcall(const void* this_arg, const LDKNodeAnnouncement * msg) { + LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; + LDKNodeAnnouncement msg_var = *msg; + if (msg->inner != NULL) + msg_var = NodeAnnouncement_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + LDKCResult_boolLightningErrorZ* ret; // TODO: Call handle_node_announcement on j_calls with instance obj, returning a pointer, msg_ref); + LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)ret; + FREE((void*)ret); + return ret_conv; +} +LDKCResult_boolLightningErrorZ handle_channel_announcement_jcall(const void* this_arg, const LDKChannelAnnouncement * msg) { + LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; + LDKChannelAnnouncement msg_var = *msg; + if (msg->inner != NULL) + msg_var = ChannelAnnouncement_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + LDKCResult_boolLightningErrorZ* ret; // TODO: Call handle_channel_announcement on j_calls with instance obj, returning a pointer, msg_ref); + LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)ret; + FREE((void*)ret); + return ret_conv; +} +LDKCResult_boolLightningErrorZ handle_channel_update_jcall(const void* this_arg, const LDKChannelUpdate * msg) { + LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; + LDKChannelUpdate msg_var = *msg; + if (msg->inner != NULL) + msg_var = ChannelUpdate_clone(msg); + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + LDKCResult_boolLightningErrorZ* ret; // TODO: Call handle_channel_update on j_calls with instance obj, returning a pointer, msg_ref); + LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)ret; + FREE((void*)ret); + return ret_conv; +} +void handle_htlc_fail_channel_update_jcall(const void* this_arg, const LDKHTLCFailChannelUpdate * update) { + LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; + long ret_update = (long)update; + //TODO: jobject obj = get object we can call against on j_calls->o + return; //TODO: Call handle_htlc_fail_channel_update on j_calls with instance obj, ret_update); +} +LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcements_jcall(const void* this_arg, uint64_t starting_point, uint8_t batch_amount) { + LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; + //TODO: jobject obj = get object we can call against on j_calls->o + uint32_tArray arg; // TODO: Call get_next_channel_announcements on j_calls with instance obj, returning an object, starting_point, batch_amount); + LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ arg_constr; + arg_constr.datalen = arg.len; + if (arg_constr.datalen > 0) + arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Elements"); + else + arg_constr.data = NULL; + uint32_t* arg_vals = (uint32_t*) arg.ptr; + for (size_t l = 0; l < arg_constr.datalen; l++) { + uint32_t arr_conv_63 = arg_vals[l]; + LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arr_conv_63_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)arr_conv_63; + FREE((void*)arr_conv_63); + arg_constr.data[l] = arr_conv_63_conv; + } + return arg_constr; +} +LDKCVec_NodeAnnouncementZ get_next_node_announcements_jcall(const void* this_arg, LDKPublicKey starting_point, uint8_t batch_amount) { + LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; + int8_tArray starting_point_arr = { .len = 33, .ptr = MALLOC(33, "Native int8_tArray Bytes") }; + memcpy(starting_point_arr.ptr, starting_point.compressed_form, 33); + //TODO: jobject obj = get object we can call against on j_calls->o + uint32_tArray arg; // TODO: Call get_next_node_announcements on j_calls with instance obj, returning an object, starting_point_arr, batch_amount); + LDKCVec_NodeAnnouncementZ arg_constr; + arg_constr.datalen = arg.len; + if (arg_constr.datalen > 0) + arg_constr.data = MALLOC(arg_constr.datalen * sizeof(LDKNodeAnnouncement), "LDKCVec_NodeAnnouncementZ Elements"); + else + arg_constr.data = NULL; + uint32_t* arg_vals = (uint32_t*) arg.ptr; + for (size_t s = 0; s < arg_constr.datalen; s++) { + uint32_t arr_conv_18 = arg_vals[s]; + LDKNodeAnnouncement arr_conv_18_conv; + arr_conv_18_conv.inner = (void*)(arr_conv_18 & (~1)); + arr_conv_18_conv.is_owned = (arr_conv_18 & 1) || (arr_conv_18 == 0); + if (arr_conv_18_conv.inner != NULL) + arr_conv_18_conv = NodeAnnouncement_clone(&arr_conv_18_conv); + arg_constr.data[s] = arr_conv_18_conv; + } + return arg_constr; +} +void sync_routing_table_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init) { + LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; + int8_tArray their_node_id_arr = { .len = 33, .ptr = MALLOC(33, "Native int8_tArray Bytes") }; + memcpy(their_node_id_arr.ptr, their_node_id.compressed_form, 33); + LDKInit init_var = *init; + if (init->inner != NULL) + init_var = Init_clone(init); + CHECK((((long)init_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&init_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long init_ref = (long)init_var.inner; + if (init_var.is_owned) { + init_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + return; //TODO: Call sync_routing_table on j_calls with instance obj, their_node_id_arr, init_ref); +} +LDKCResult_NoneLightningErrorZ handle_reply_channel_range_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyChannelRange msg) { + LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; + int8_tArray their_node_id_arr = { .len = 33, .ptr = MALLOC(33, "Native int8_tArray Bytes") }; + memcpy(their_node_id_arr.ptr, their_node_id.compressed_form, 33); + LDKReplyChannelRange msg_var = msg; + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + LDKCResult_NoneLightningErrorZ* ret; // TODO: Call handle_reply_channel_range on j_calls with instance obj, returning a pointer, their_node_id_arr, msg_ref); + LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)ret; + FREE((void*)ret); + return ret_conv; +} +LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyShortChannelIdsEnd msg) { + LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; + int8_tArray their_node_id_arr = { .len = 33, .ptr = MALLOC(33, "Native int8_tArray Bytes") }; + memcpy(their_node_id_arr.ptr, their_node_id.compressed_form, 33); + LDKReplyShortChannelIdsEnd msg_var = msg; + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + LDKCResult_NoneLightningErrorZ* ret; // TODO: Call handle_reply_short_channel_ids_end on j_calls with instance obj, returning a pointer, their_node_id_arr, msg_ref); + LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)ret; + FREE((void*)ret); + return ret_conv; +} +LDKCResult_NoneLightningErrorZ handle_query_channel_range_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryChannelRange msg) { + LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; + int8_tArray their_node_id_arr = { .len = 33, .ptr = MALLOC(33, "Native int8_tArray Bytes") }; + memcpy(their_node_id_arr.ptr, their_node_id.compressed_form, 33); + LDKQueryChannelRange msg_var = msg; + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + LDKCResult_NoneLightningErrorZ* ret; // TODO: Call handle_query_channel_range on j_calls with instance obj, returning a pointer, their_node_id_arr, msg_ref); + LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)ret; + FREE((void*)ret); + return ret_conv; +} +LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryShortChannelIds msg) { + LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; + int8_tArray their_node_id_arr = { .len = 33, .ptr = MALLOC(33, "Native int8_tArray Bytes") }; + memcpy(their_node_id_arr.ptr, their_node_id.compressed_form, 33); + LDKQueryShortChannelIds msg_var = msg; + CHECK((((long)msg_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. + CHECK((((long)&msg_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. + long msg_ref = (long)msg_var.inner; + if (msg_var.is_owned) { + msg_ref |= 1; + } + //TODO: jobject obj = get object we can call against on j_calls->o + LDKCResult_NoneLightningErrorZ* ret; // TODO: Call handle_query_short_channel_ids on j_calls with instance obj, returning a pointer, their_node_id_arr, msg_ref); + LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)ret; + FREE((void*)ret); + return ret_conv; +} +static void* LDKRoutingMessageHandler_JCalls_clone(const void* this_arg) { + LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) 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 (void* ctx_TODO, /*TODO: JS Object Reference */void* o, /*TODO: JS Object Reference */void* MessageSendEventsProvider) { + LDKRoutingMessageHandler_JCalls *calls = MALLOC(sizeof(LDKRoutingMessageHandler_JCalls), "LDKRoutingMessageHandler_JCalls"); + atomic_init(&calls->refcnt, 1); + //TODO: Assign calls->o from o + + LDKRoutingMessageHandler ret = { + .this_arg = (void*) calls, + .handle_node_announcement = handle_node_announcement_jcall, + .handle_channel_announcement = handle_channel_announcement_jcall, + .handle_channel_update = handle_channel_update_jcall, + .handle_htlc_fail_channel_update = handle_htlc_fail_channel_update_jcall, + .get_next_channel_announcements = get_next_channel_announcements_jcall, + .get_next_node_announcements = get_next_node_announcements_jcall, + .sync_routing_table = sync_routing_table_jcall, + .handle_reply_channel_range = handle_reply_channel_range_jcall, + .handle_reply_short_channel_ids_end = handle_reply_short_channel_ids_end_jcall, + .handle_query_channel_range = handle_query_channel_range_jcall, + .handle_query_short_channel_ids = handle_query_short_channel_ids_jcall, + .free = LDKRoutingMessageHandler_JCalls_free, + .MessageSendEventsProvider = LDKMessageSendEventsProvider_init(NULL, MessageSendEventsProvider), + }; + calls->MessageSendEventsProvider = ret.MessageSendEventsProvider.this_arg; + return ret; +} +long LDKRoutingMessageHandler_1new (void* ctx_TODO, /*TODO: JS Object Reference */void* o, /*TODO: JS Object Reference */ void* MessageSendEventsProvider) { + LDKRoutingMessageHandler *res_ptr = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler"); + *res_ptr = LDKRoutingMessageHandler_init(NULL, o, MessageSendEventsProvider); + return (long)res_ptr; +} uint32_t RoutingMessageHandler_1handle_1node_1announcement(void* ctx_TODO, uint32_t this_arg, uint32_t msg) { LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; LDKNodeAnnouncement msg_conv; @@ -2810,7 +4313,7 @@ uint32_tArray RoutingMessageHandler_1get_1next_1channel_1announcements(void* ctx LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg; LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_var = (this_arg_conv->get_next_channel_announcements)(this_arg_conv->this_arg, starting_point, batch_amount); uint32_tArray ret_arr = { .len = ret_var.datalen, .ptr = MALLOC(ret_var.datalen * sizeof(int32_t), "Native uint32_tArray Bytes") }; - uint32_t *ret_arr_ptr = ret_arr.ptr; + uint32_t *ret_arr_ptr = (uint32_t*)ret_arr.ptr; for (size_t l = 0; l < ret_var.datalen; l++) { LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* arr_conv_63_ref = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ"); *arr_conv_63_ref = ret_var.data[l]; @@ -2830,7 +4333,7 @@ uint32_tArray RoutingMessageHandler_1get_1next_1node_1announcements(void* ctx_TO memcpy(starting_point_ref.compressed_form, starting_point.ptr, 33); LDKCVec_NodeAnnouncementZ ret_var = (this_arg_conv->get_next_node_announcements)(this_arg_conv->this_arg, starting_point_ref, batch_amount); uint32_tArray ret_arr = { .len = ret_var.datalen, .ptr = MALLOC(ret_var.datalen * sizeof(int32_t), "Native uint32_tArray Bytes") }; - uint32_t *ret_arr_ptr = ret_arr.ptr; + uint32_t *ret_arr_ptr = (uint32_t*)ret_arr.ptr; for (size_t s = 0; s < ret_var.datalen; s++) { LDKNodeAnnouncement arr_conv_18_var = ret_var.data[s]; CHECK((((long)arr_conv_18_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. @@ -2916,12 +4419,78 @@ uint32_t RoutingMessageHandler_1handle_1query_1short_1channel_1ids(void* ctx_TOD return (long)ret_conv; } -int64_t SocketDescriptor_1send_1data(void* ctx_TODO, uint32_t this_arg, int8_tArray data, jboolean resume_read) { +typedef struct LDKSocketDescriptor_JCalls { + atomic_size_t refcnt; + // TODO: Object pointer o; + // TODO: Some kind of method pointer send_data_meth; + // TODO: Some kind of method pointer disconnect_socket_meth; + // TODO: Some kind of method pointer eq_meth; + // TODO: Some kind of method pointer hash_meth; +} LDKSocketDescriptor_JCalls; +static void LDKSocketDescriptor_JCalls_free(void* this_arg) { + LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + // TODO: do any release required for j_calls->o (refcnt-- in java, but may be redundant) + FREE(j_calls); + } +} +uintptr_t send_data_jcall(void* this_arg, LDKu8slice data, bool resume_read) { + LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; + LDKu8slice data_var = data; + int8_tArray data_arr = { .len = data_var.datalen, .ptr = MALLOC(data_var.datalen, "Native int8_tArray Bytes") }; + memcpy(data_arr.ptr, data_var.data, data_var.datalen); + //TODO: jobject obj = get object we can call against on j_calls->o + return 0; //TODO: Call send_data on j_calls with instance obj, returning number, data_arr, resume_read); +} +void disconnect_socket_jcall(void* this_arg) { + LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; + //TODO: jobject obj = get object we can call against on j_calls->o + return; //TODO: Call disconnect_socket on j_calls with instance obj); +} +bool eq_jcall(const void* this_arg, const LDKSocketDescriptor * other_arg) { + LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; + LDKSocketDescriptor *other_arg_clone = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); + *other_arg_clone = SocketDescriptor_clone(other_arg); + //TODO: jobject obj = get object we can call against on j_calls->o + return 0; //TODO: Call eq on j_calls with instance obj, returning boolean, (long)other_arg_clone); +} +uint64_t hash_jcall(const void* this_arg) { + LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; + //TODO: jobject obj = get object we can call against on j_calls->o + return 0; //TODO: Call hash on j_calls with instance obj, returning number); +} +static void* LDKSocketDescriptor_JCalls_clone(const void* this_arg) { + LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); + return (void*) this_arg; +} +static inline LDKSocketDescriptor LDKSocketDescriptor_init (void* ctx_TODO, /*TODO: JS Object Reference */void* o) { + LDKSocketDescriptor_JCalls *calls = MALLOC(sizeof(LDKSocketDescriptor_JCalls), "LDKSocketDescriptor_JCalls"); + atomic_init(&calls->refcnt, 1); + //TODO: Assign calls->o from o + + LDKSocketDescriptor ret = { + .this_arg = (void*) calls, + .send_data = send_data_jcall, + .disconnect_socket = disconnect_socket_jcall, + .eq = eq_jcall, + .hash = hash_jcall, + .clone = LDKSocketDescriptor_JCalls_clone, + .free = LDKSocketDescriptor_JCalls_free, + }; + return ret; +} +long LDKSocketDescriptor_1new (void* ctx_TODO, /*TODO: JS Object Reference */void* o) { + LDKSocketDescriptor *res_ptr = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); + *res_ptr = LDKSocketDescriptor_init(NULL, o); + return (long)res_ptr; +} +intptr_t SocketDescriptor_1send_1data(void* ctx_TODO, uint32_t this_arg, int8_tArray data, jboolean resume_read) { LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg; LDKu8slice data_ref; data_ref.datalen = data.len; data_ref.data = data.ptr; - int64_t ret_val = (this_arg_conv->send_data)(this_arg_conv->this_arg, data_ref, resume_read); + intptr_t ret_val = (this_arg_conv->send_data)(this_arg_conv->this_arg, data_ref, resume_read); return ret_val; } @@ -3008,7 +4577,7 @@ void C2Tuple_1usizeTransactionZ_1free(void* ctx_TODO, uint32_t _res) { C2Tuple_usizeTransactionZ_free(_res_conv); } -uint32_t C2Tuple_1usizeTransactionZ_1new(void* ctx_TODO, int64_t a, int8_tArray b) { +uint32_t C2Tuple_1usizeTransactionZ_1new(void* ctx_TODO, intptr_t a, int8_tArray b) { LDKTransaction b_ref; b_ref.datalen = b.len; b_ref.data = MALLOC(b_ref.datalen, "LDKTransaction Bytes"); @@ -3016,7 +4585,7 @@ uint32_t C2Tuple_1usizeTransactionZ_1new(void* ctx_TODO, int64_t a, int8_tArray b_ref.data_is_owned = true; LDKC2Tuple_usizeTransactionZ* ret_ref = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); *ret_ref = C2Tuple_usizeTransactionZ_new(a, b_ref); - // XXX: We likely need to clone here, but no _clone fn is available for byte[] + // XXX: We likely need to clone here, but no _clone fn is available for Uint8Array return (long)ret_ref; } @@ -3028,11 +4597,11 @@ void CVec_1C2Tuple_1usizeTransactionZZ_1free(void* ctx_TODO, uint32_tArray _res) else _res_constr.data = NULL; uint32_t* _res_vals = (uint32_t*) _res.ptr; - for (size_t y = 0; y < _res_constr.datalen; y++) { - uint32_t arr_conv_24 = _res_vals[y]; - LDKC2Tuple_usizeTransactionZ arr_conv_24_conv = *(LDKC2Tuple_usizeTransactionZ*)arr_conv_24; - FREE((void*)arr_conv_24); - _res_constr.data[y] = arr_conv_24_conv; + for (size_t e = 0; e < _res_constr.datalen; e++) { + uint32_t arr_conv_30 = _res_vals[e]; + LDKC2Tuple_usizeTransactionZ arr_conv_30_conv = *(LDKC2Tuple_usizeTransactionZ*)arr_conv_30; + FREE((void*)arr_conv_30); + _res_constr.data[e] = arr_conv_30_conv; } CVec_C2Tuple_usizeTransactionZZ_free(_res_constr); } @@ -3146,7 +4715,7 @@ uint32_t C2Tuple_1OutPointScriptZ_1new(void* ctx_TODO, uint32_t a, int8_tArray b return (long)ret_ref; } -void CVec_1TransactionZ_1free(void* ctx_TODO, uint32_tArray _res) { +void CVec_1TransactionZ_1free(void* ctx_TODO, ptrArray _res) { LDKCVec_TransactionZ _res_constr; _res_constr.datalen = _res.len; if (_res_constr.datalen > 0) @@ -3154,14 +4723,14 @@ void CVec_1TransactionZ_1free(void* ctx_TODO, uint32_tArray _res) { else _res_constr.data = NULL; int8_tArray* _res_vals = (int8_tArray*) _res.ptr; - for (size_t i = 0; i < _res_constr.datalen; i++) { - int8_tArray arr_conv_8 = _res_vals[i]; - LDKTransaction arr_conv_8_ref; - arr_conv_8_ref.datalen = arr_conv_8.len; - arr_conv_8_ref.data = MALLOC(arr_conv_8_ref.datalen, "LDKTransaction Bytes"); - memcpy(arr_conv_8_ref.data, arr_conv_8.ptr, arr_conv_8_ref.datalen); - arr_conv_8_ref.data_is_owned = true; - _res_constr.data[i] = arr_conv_8_ref; + for (size_t m = 0; m < _res_constr.datalen; m++) { + int8_tArray arr_conv_12 = _res_vals[m]; + LDKTransaction arr_conv_12_ref; + arr_conv_12_ref.datalen = arr_conv_12.len; + arr_conv_12_ref.data = MALLOC(arr_conv_12_ref.datalen, "LDKTransaction Bytes"); + memcpy(arr_conv_12_ref.data, arr_conv_12.ptr, arr_conv_12_ref.datalen); + arr_conv_12_ref.data_is_owned = true; + _res_constr.data[m] = arr_conv_12_ref; } CVec_TransactionZ_free(_res_constr); } @@ -3189,11 +4758,11 @@ void CVec_1C2Tuple_1u32TxOutZZ_1free(void* ctx_TODO, uint32_tArray _res) { else _res_constr.data = NULL; uint32_t* _res_vals = (uint32_t*) _res.ptr; - for (size_t a = 0; a < _res_constr.datalen; a++) { - uint32_t arr_conv_26 = _res_vals[a]; - LDKC2Tuple_u32TxOutZ arr_conv_26_conv = *(LDKC2Tuple_u32TxOutZ*)arr_conv_26; - FREE((void*)arr_conv_26); - _res_constr.data[a] = arr_conv_26_conv; + for (size_t z = 0; z < _res_constr.datalen; z++) { + uint32_t arr_conv_25 = _res_vals[z]; + LDKC2Tuple_u32TxOutZ arr_conv_25_conv = *(LDKC2Tuple_u32TxOutZ*)arr_conv_25; + FREE((void*)arr_conv_25); + _res_constr.data[z] = arr_conv_25_conv; } CVec_C2Tuple_u32TxOutZZ_free(_res_constr); } @@ -3215,16 +4784,16 @@ uint32_t C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZ_1new(void* ctx_TODO, int8_tArra else b_constr.data = NULL; uint32_t* b_vals = (uint32_t*) b.ptr; - for (size_t a = 0; a < b_constr.datalen; a++) { - uint32_t arr_conv_26 = b_vals[a]; - LDKC2Tuple_u32TxOutZ arr_conv_26_conv = *(LDKC2Tuple_u32TxOutZ*)arr_conv_26; - FREE((void*)arr_conv_26); - b_constr.data[a] = arr_conv_26_conv; + for (size_t z = 0; z < b_constr.datalen; z++) { + uint32_t arr_conv_25 = b_vals[z]; + LDKC2Tuple_u32TxOutZ arr_conv_25_conv = *(LDKC2Tuple_u32TxOutZ*)arr_conv_25; + FREE((void*)arr_conv_25); + b_constr.data[z] = arr_conv_25_conv; } LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_ref = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); *ret_ref = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(a_ref, b_constr); ret_ref->a = ThirtyTwoBytes_clone(&ret_ref->a); - // XXX: We likely need to clone here, but no _clone fn is available for TwoTuple[] + // XXX: We likely need to clone here, but no _clone fn is available for TwoTuple[] return (long)ret_ref; } @@ -3236,11 +4805,11 @@ void CVec_1C2Tuple_1TxidCVec_1C2Tuple_1u32TxOutZZZZ_1free(void* ctx_TODO, uint32 else _res_constr.data = NULL; uint32_t* _res_vals = (uint32_t*) _res.ptr; - for (size_t u = 0; u < _res_constr.datalen; u++) { - uint32_t arr_conv_46 = _res_vals[u]; - LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ arr_conv_46_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)arr_conv_46; - FREE((void*)arr_conv_46); - _res_constr.data[u] = arr_conv_46_conv; + for (size_t x = 0; x < _res_constr.datalen; x++) { + uint32_t arr_conv_49 = _res_vals[x]; + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ arr_conv_49_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)arr_conv_49; + FREE((void*)arr_conv_49); + _res_constr.data[x] = arr_conv_49_conv; } CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(_res_constr); } @@ -3326,7 +4895,7 @@ void CResult_1SpendableOutputDescriptorDecodeErrorZ_1free(void* ctx_TODO, uint32 CResult_SpendableOutputDescriptorDecodeErrorZ_free(_res_conv); } -void CVec_1SignatureZ_1free(void* ctx_TODO, uint32_tArray _res) { +void CVec_1SignatureZ_1free(void* ctx_TODO, ptrArray _res) { LDKCVec_SignatureZ _res_constr; _res_constr.datalen = _res.len; if (_res_constr.datalen > 0) @@ -3334,12 +4903,12 @@ void CVec_1SignatureZ_1free(void* ctx_TODO, uint32_tArray _res) { else _res_constr.data = NULL; int8_tArray* _res_vals = (int8_tArray*) _res.ptr; - for (size_t i = 0; i < _res_constr.datalen; i++) { - int8_tArray arr_conv_8 = _res_vals[i]; - LDKSignature arr_conv_8_ref; - CHECK(arr_conv_8.len == 64); - memcpy(arr_conv_8_ref.compact_form, arr_conv_8.ptr, 64); - _res_constr.data[i] = arr_conv_8_ref; + for (size_t m = 0; m < _res_constr.datalen; m++) { + int8_tArray arr_conv_12 = _res_vals[m]; + LDKSignature arr_conv_12_ref; + CHECK(arr_conv_12.len == 64); + memcpy(arr_conv_12_ref.compact_form, arr_conv_12.ptr, 64); + _res_constr.data[m] = arr_conv_12_ref; } CVec_SignatureZ_free(_res_constr); } @@ -3350,7 +4919,7 @@ void C2Tuple_1SignatureCVec_1SignatureZZ_1free(void* ctx_TODO, uint32_t _res) { C2Tuple_SignatureCVec_SignatureZZ_free(_res_conv); } -uint32_t C2Tuple_1SignatureCVec_1SignatureZZ_1new(void* ctx_TODO, int8_tArray a, uint32_tArray b) { +uint32_t C2Tuple_1SignatureCVec_1SignatureZZ_1new(void* ctx_TODO, int8_tArray a, ptrArray b) { LDKSignature a_ref; CHECK(a.len == 64); memcpy(a_ref.compact_form, a.ptr, 64); @@ -3361,17 +4930,17 @@ uint32_t C2Tuple_1SignatureCVec_1SignatureZZ_1new(void* ctx_TODO, int8_tArray a, else b_constr.data = NULL; int8_tArray* b_vals = (int8_tArray*) b.ptr; - for (size_t i = 0; i < b_constr.datalen; i++) { - int8_tArray arr_conv_8 = b_vals[i]; - LDKSignature arr_conv_8_ref; - CHECK(arr_conv_8.len == 64); - memcpy(arr_conv_8_ref.compact_form, arr_conv_8.ptr, 64); - b_constr.data[i] = arr_conv_8_ref; + for (size_t m = 0; m < b_constr.datalen; m++) { + int8_tArray arr_conv_12 = b_vals[m]; + LDKSignature arr_conv_12_ref; + CHECK(arr_conv_12.len == 64); + memcpy(arr_conv_12_ref.compact_form, arr_conv_12.ptr, 64); + b_constr.data[m] = arr_conv_12_ref; } LDKC2Tuple_SignatureCVec_SignatureZZ* ret_ref = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ"); *ret_ref = C2Tuple_SignatureCVec_SignatureZZ_new(a_ref, b_constr); - // XXX: We likely need to clone here, but no _clone fn is available for byte[] - // XXX: We likely need to clone here, but no _clone fn is available for byte[][] + // XXX: We likely need to clone here, but no _clone fn is available for Uint8Array + // XXX: We likely need to clone here, but no _clone fn is available for Uint8Array[] return (long)ret_ref; } @@ -3416,7 +4985,7 @@ void CResult_1SignatureNoneZ_1free(void* ctx_TODO, uint32_t _res) { CResult_SignatureNoneZ_free(_res_conv); } -uint32_t CResult_1CVec_1SignatureZNoneZ_1ok(void* ctx_TODO, uint32_tArray o) { +uint32_t CResult_1CVec_1SignatureZNoneZ_1ok(void* ctx_TODO, ptrArray o) { LDKCVec_SignatureZ o_constr; o_constr.datalen = o.len; if (o_constr.datalen > 0) @@ -3424,12 +4993,12 @@ uint32_t CResult_1CVec_1SignatureZNoneZ_1ok(void* ctx_TODO, uint32_tArray o) { else o_constr.data = NULL; int8_tArray* o_vals = (int8_tArray*) o.ptr; - for (size_t i = 0; i < o_constr.datalen; i++) { - int8_tArray arr_conv_8 = o_vals[i]; - LDKSignature arr_conv_8_ref; - CHECK(arr_conv_8.len == 64); - memcpy(arr_conv_8_ref.compact_form, arr_conv_8.ptr, 64); - o_constr.data[i] = arr_conv_8_ref; + for (size_t m = 0; m < o_constr.datalen; m++) { + int8_tArray arr_conv_12 = o_vals[m]; + LDKSignature arr_conv_12_ref; + CHECK(arr_conv_12.len == 64); + memcpy(arr_conv_12_ref.compact_form, arr_conv_12.ptr, 64); + o_constr.data[m] = arr_conv_12_ref; } LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ"); *ret_conv = CResult_CVec_SignatureZNoneZ_ok(o_constr); @@ -3450,10 +5019,6 @@ void CResult_1CVec_1SignatureZNoneZ_1free(void* ctx_TODO, uint32_t _res) { uint32_t CResult_1ChanKeySignerDecodeErrorZ_1ok(void* ctx_TODO, uint32_t o) { LDKChannelKeys o_conv = *(LDKChannelKeys*)o; - if (o_conv.free == LDKChannelKeys_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKChannelKeys_JCalls_clone(o_conv.this_arg); - } LDKCResult_ChanKeySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChanKeySignerDecodeErrorZ), "LDKCResult_ChanKeySignerDecodeErrorZ"); *ret_conv = CResult_ChanKeySignerDecodeErrorZ_ok(o_conv); return (long)ret_conv; @@ -3715,9 +5280,9 @@ void CVec_1u64Z_1free(void* ctx_TODO, int64_tArray _res) { else _res_constr.data = NULL; int64_t* _res_vals = (int64_t*) _res.ptr; - for (size_t g = 0; g < _res_constr.datalen; g++) { - int64_t arr_conv_6 = _res_vals[g]; - _res_constr.data[g] = arr_conv_6; + for (size_t i = 0; i < _res_constr.datalen; i++) { + int64_t arr_conv_8 = _res_vals[i]; + _res_constr.data[i] = arr_conv_8; } CVec_u64Z_free(_res_constr); } @@ -4254,7 +5819,7 @@ void CResult_1GossipTimestampFilterDecodeErrorZ_1free(void* ctx_TODO, uint32_t _ CResult_GossipTimestampFilterDecodeErrorZ_free(_res_conv); } -void CVec_1PublicKeyZ_1free(void* ctx_TODO, uint32_tArray _res) { +void CVec_1PublicKeyZ_1free(void* ctx_TODO, ptrArray _res) { LDKCVec_PublicKeyZ _res_constr; _res_constr.datalen = _res.len; if (_res_constr.datalen > 0) @@ -4262,12 +5827,12 @@ void CVec_1PublicKeyZ_1free(void* ctx_TODO, uint32_tArray _res) { else _res_constr.data = NULL; int8_tArray* _res_vals = (int8_tArray*) _res.ptr; - for (size_t i = 0; i < _res_constr.datalen; i++) { - int8_tArray arr_conv_8 = _res_vals[i]; - LDKPublicKey arr_conv_8_ref; - CHECK(arr_conv_8.len == 33); - memcpy(arr_conv_8_ref.compressed_form, arr_conv_8.ptr, 33); - _res_constr.data[i] = arr_conv_8_ref; + for (size_t m = 0; m < _res_constr.datalen; m++) { + int8_tArray arr_conv_12 = _res_vals[m]; + LDKPublicKey arr_conv_12_ref; + CHECK(arr_conv_12.len == 33); + memcpy(arr_conv_12_ref.compressed_form, arr_conv_12.ptr, 33); + _res_constr.data[m] = arr_conv_12_ref; } CVec_PublicKeyZ_free(_res_constr); } @@ -4458,7 +6023,7 @@ void CVec_1RouteHopZ_1free(void* ctx_TODO, uint32_tArray _res) { CVec_RouteHopZ_free(_res_constr); } -void CVec_1CVec_1RouteHopZZ_1free(void* ctx_TODO, uint32_tArray _res) { +void CVec_1CVec_1RouteHopZZ_1free(void* ctx_TODO, ptrArray _res) { LDKCVec_CVec_RouteHopZZ _res_constr; _res_constr.datalen = _res.len; if (_res_constr.datalen > 0) @@ -4780,15 +6345,15 @@ void ChannelHandshakeConfig_1set_1minimum_1depth(void* ctx_TODO, uint32_t this_p ChannelHandshakeConfig_set_minimum_depth(&this_ptr_conv, val); } -jshort ChannelHandshakeConfig_1get_1our_1to_1self_1delay(void* ctx_TODO, uint32_t this_ptr) { +int16_t ChannelHandshakeConfig_1get_1our_1to_1self_1delay(void* ctx_TODO, uint32_t this_ptr) { LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = ChannelHandshakeConfig_get_our_to_self_delay(&this_ptr_conv); + int16_t ret_val = ChannelHandshakeConfig_get_our_to_self_delay(&this_ptr_conv); return ret_val; } -void ChannelHandshakeConfig_1set_1our_1to_1self_1delay(void* ctx_TODO, uint32_t this_ptr, jshort val) { +void ChannelHandshakeConfig_1set_1our_1to_1self_1delay(void* ctx_TODO, uint32_t this_ptr, int16_t val) { LDKChannelHandshakeConfig this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; @@ -4810,7 +6375,7 @@ void ChannelHandshakeConfig_1set_1our_1htlc_1minimum_1msat(void* ctx_TODO, uint3 ChannelHandshakeConfig_set_our_htlc_minimum_msat(&this_ptr_conv, val); } -uint32_t ChannelHandshakeConfig_1new(void* ctx_TODO, int32_t minimum_depth_arg, jshort our_to_self_delay_arg, int64_t our_htlc_minimum_msat_arg) { +uint32_t ChannelHandshakeConfig_1new(void* ctx_TODO, int32_t minimum_depth_arg, int16_t our_to_self_delay_arg, int64_t our_htlc_minimum_msat_arg) { LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg); CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -4913,15 +6478,15 @@ void ChannelHandshakeLimits_1set_1max_1channel_1reserve_1satoshis(void* ctx_TODO ChannelHandshakeLimits_set_max_channel_reserve_satoshis(&this_ptr_conv, val); } -jshort ChannelHandshakeLimits_1get_1min_1max_1accepted_1htlcs(void* ctx_TODO, uint32_t this_ptr) { +int16_t ChannelHandshakeLimits_1get_1min_1max_1accepted_1htlcs(void* ctx_TODO, uint32_t this_ptr) { LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = ChannelHandshakeLimits_get_min_max_accepted_htlcs(&this_ptr_conv); + int16_t ret_val = ChannelHandshakeLimits_get_min_max_accepted_htlcs(&this_ptr_conv); return ret_val; } -void ChannelHandshakeLimits_1set_1min_1max_1accepted_1htlcs(void* ctx_TODO, uint32_t this_ptr, jshort val) { +void ChannelHandshakeLimits_1set_1min_1max_1accepted_1htlcs(void* ctx_TODO, uint32_t this_ptr, int16_t val) { LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; @@ -4988,22 +6553,22 @@ void ChannelHandshakeLimits_1set_1force_1announced_1channel_1preference(void* ct ChannelHandshakeLimits_set_force_announced_channel_preference(&this_ptr_conv, val); } -jshort ChannelHandshakeLimits_1get_1their_1to_1self_1delay(void* ctx_TODO, uint32_t this_ptr) { +int16_t ChannelHandshakeLimits_1get_1their_1to_1self_1delay(void* ctx_TODO, uint32_t this_ptr) { LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = ChannelHandshakeLimits_get_their_to_self_delay(&this_ptr_conv); + int16_t ret_val = ChannelHandshakeLimits_get_their_to_self_delay(&this_ptr_conv); return ret_val; } -void ChannelHandshakeLimits_1set_1their_1to_1self_1delay(void* ctx_TODO, uint32_t this_ptr, jshort val) { +void ChannelHandshakeLimits_1set_1their_1to_1self_1delay(void* ctx_TODO, uint32_t this_ptr, int16_t val) { LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; ChannelHandshakeLimits_set_their_to_self_delay(&this_ptr_conv, val); } -uint32_t ChannelHandshakeLimits_1new(void* ctx_TODO, int64_t min_funding_satoshis_arg, int64_t max_htlc_minimum_msat_arg, int64_t min_max_htlc_value_in_flight_msat_arg, int64_t max_channel_reserve_satoshis_arg, jshort min_max_accepted_htlcs_arg, int64_t min_dust_limit_satoshis_arg, int64_t max_dust_limit_satoshis_arg, int32_t max_minimum_depth_arg, jboolean force_announced_channel_preference_arg, jshort their_to_self_delay_arg) { +uint32_t ChannelHandshakeLimits_1new(void* ctx_TODO, int64_t min_funding_satoshis_arg, int64_t max_htlc_minimum_msat_arg, int64_t min_max_htlc_value_in_flight_msat_arg, int64_t max_channel_reserve_satoshis_arg, int16_t min_max_accepted_htlcs_arg, int64_t min_dust_limit_satoshis_arg, int64_t max_dust_limit_satoshis_arg, int32_t max_minimum_depth_arg, jboolean force_announced_channel_preference_arg, int16_t their_to_self_delay_arg) { LDKChannelHandshakeLimits ret_var = 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, min_dust_limit_satoshis_arg, max_dust_limit_satoshis_arg, max_minimum_depth_arg, force_announced_channel_preference_arg, their_to_self_delay_arg); CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -5338,11 +6903,11 @@ void ChainMonitor_1block_1connected(void* ctx_TODO, uint32_t this_arg, int8_tArr else txdata_constr.data = NULL; uint32_t* txdata_vals = (uint32_t*) txdata.ptr; - for (size_t y = 0; y < txdata_constr.datalen; y++) { - uint32_t arr_conv_24 = txdata_vals[y]; - LDKC2Tuple_usizeTransactionZ arr_conv_24_conv = *(LDKC2Tuple_usizeTransactionZ*)arr_conv_24; - FREE((void*)arr_conv_24); - txdata_constr.data[y] = arr_conv_24_conv; + for (size_t e = 0; e < txdata_constr.datalen; e++) { + uint32_t arr_conv_30 = txdata_vals[e]; + LDKC2Tuple_usizeTransactionZ arr_conv_30_conv = *(LDKC2Tuple_usizeTransactionZ*)arr_conv_30; + FREE((void*)arr_conv_30); + txdata_constr.data[e] = arr_conv_30_conv; } ChainMonitor_block_connected(&this_arg_conv, header_ref, txdata_constr, height); } @@ -5361,25 +6926,9 @@ void ChainMonitor_1block_1disconnected(void* ctx_TODO, uint32_t this_arg, int8_t uint32_t ChainMonitor_1new(void* ctx_TODO, uint32_t chain_source, uint32_t broadcaster, uint32_t logger, uint32_t feeest, uint32_t persister) { LDKFilter* chain_source_conv = (LDKFilter*)chain_source; LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)broadcaster; - 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); - } LDKLogger logger_conv = *(LDKLogger*)logger; - 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); - } LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)feeest; - 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); - } LDKPersist persister_conv = *(LDKPersist*)persister; - 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); - } LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv, persister_conv); CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -5602,7 +7151,7 @@ uint32_tArray ChannelMonitor_1get_1and_1clear_1pending_1monitor_1events(void* ct this_arg_conv.is_owned = false; LDKCVec_MonitorEventZ ret_var = ChannelMonitor_get_and_clear_pending_monitor_events(&this_arg_conv); uint32_tArray ret_arr = { .len = ret_var.datalen, .ptr = MALLOC(ret_var.datalen * sizeof(int32_t), "Native uint32_tArray Bytes") }; - uint32_t *ret_arr_ptr = ret_arr.ptr; + uint32_t *ret_arr_ptr = (uint32_t*)ret_arr.ptr; for (size_t o = 0; o < ret_var.datalen; o++) { LDKMonitorEvent arr_conv_14_var = ret_var.data[o]; CHECK((((long)arr_conv_14_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. @@ -5623,7 +7172,7 @@ uint32_tArray ChannelMonitor_1get_1and_1clear_1pending_1events(void* ctx_TODO, u this_arg_conv.is_owned = false; LDKCVec_EventZ ret_var = ChannelMonitor_get_and_clear_pending_events(&this_arg_conv); uint32_tArray ret_arr = { .len = ret_var.datalen, .ptr = MALLOC(ret_var.datalen * sizeof(int32_t), "Native uint32_tArray Bytes") }; - uint32_t *ret_arr_ptr = ret_arr.ptr; + uint32_t *ret_arr_ptr = (uint32_t*)ret_arr.ptr; for (size_t h = 0; h < ret_var.datalen; h++) { LDKEvent *arr_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *arr_conv_7_copy = Event_clone(&ret_var.data[h]); @@ -5634,19 +7183,20 @@ uint32_tArray ChannelMonitor_1get_1and_1clear_1pending_1events(void* ctx_TODO, u return ret_arr; } -uint32_tArray ChannelMonitor_1get_1latest_1holder_1commitment_1txn(void* ctx_TODO, uint32_t this_arg, uint32_t logger) { +ptrArray ChannelMonitor_1get_1latest_1holder_1commitment_1txn(void* ctx_TODO, uint32_t this_arg, uint32_t logger) { LDKChannelMonitor this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; LDKLogger* logger_conv = (LDKLogger*)logger; LDKCVec_TransactionZ ret_var = ChannelMonitor_get_latest_holder_commitment_txn(&this_arg_conv, logger_conv); - uint32_tArray ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); - for (size_t i = 0; i < ret_var.datalen; i++) { - LDKTransaction arr_conv_8_var = ret_var.data[i]; - int8_tArray arr_conv_8_arr = { .len = arr_conv_8_var.datalen, .ptr = MALLOC(arr_conv_8_var.datalen, "Native int8_tArray Bytes") }; - memcpy(arr_conv_8_arr.ptr, arr_conv_8_var.data, arr_conv_8_var.datalen); - Transaction_free(arr_conv_8_var); - (*env)->SetObjectArrayElement(env, ret_arr, i, arr_conv_8_arr); + ptrArray ret_arr = { .len = ret_var.datalen, .ptr = MALLOC(ret_var.datalen * sizeof(int32_t), "Native Object Bytes") }; + int8_tArray *ret_arr_ptr = (int8_tArray*)ret_arr.ptr; + for (size_t m = 0; m < ret_var.datalen; m++) { + LDKTransaction arr_conv_12_var = ret_var.data[m]; + int8_tArray arr_conv_12_arr = { .len = arr_conv_12_var.datalen, .ptr = MALLOC(arr_conv_12_var.datalen, "Native int8_tArray Bytes") }; + memcpy(arr_conv_12_arr.ptr, arr_conv_12_var.data, arr_conv_12_var.datalen); + Transaction_free(arr_conv_12_var); + ret_arr_ptr[m] = arr_conv_12_arr; } FREE(ret_var.data); return ret_arr; @@ -5667,36 +7217,24 @@ uint32_tArray ChannelMonitor_1block_1connected(void* ctx_TODO, uint32_t this_arg else txdata_constr.data = NULL; uint32_t* txdata_vals = (uint32_t*) txdata.ptr; - for (size_t y = 0; y < txdata_constr.datalen; y++) { - uint32_t arr_conv_24 = txdata_vals[y]; - LDKC2Tuple_usizeTransactionZ arr_conv_24_conv = *(LDKC2Tuple_usizeTransactionZ*)arr_conv_24; - FREE((void*)arr_conv_24); - txdata_constr.data[y] = arr_conv_24_conv; + for (size_t e = 0; e < txdata_constr.datalen; e++) { + uint32_t arr_conv_30 = txdata_vals[e]; + LDKC2Tuple_usizeTransactionZ arr_conv_30_conv = *(LDKC2Tuple_usizeTransactionZ*)arr_conv_30; + FREE((void*)arr_conv_30); + txdata_constr.data[e] = arr_conv_30_conv; } LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)broadcaster; - 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); - } LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)fee_estimator; - 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); - } LDKLogger logger_conv = *(LDKLogger*)logger; - 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); - } 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); uint32_tArray ret_arr = { .len = ret_var.datalen, .ptr = MALLOC(ret_var.datalen * sizeof(int32_t), "Native uint32_tArray Bytes") }; - uint32_t *ret_arr_ptr = ret_arr.ptr; - for (size_t u = 0; u < ret_var.datalen; u++) { - LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* arr_conv_46_ref = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); - *arr_conv_46_ref = ret_var.data[u]; - arr_conv_46_ref->a = ThirtyTwoBytes_clone(&arr_conv_46_ref->a); - // XXX: We likely need to clone here, but no _clone fn is available for TwoTuple[] - ret_arr_ptr[u] = (long)arr_conv_46_ref; + uint32_t *ret_arr_ptr = (uint32_t*)ret_arr.ptr; + for (size_t x = 0; x < ret_var.datalen; x++) { + LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* arr_conv_49_ref = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ"); + *arr_conv_49_ref = ret_var.data[x]; + arr_conv_49_ref->a = ThirtyTwoBytes_clone(&arr_conv_49_ref->a); + // XXX: We likely need to clone here, but no _clone fn is available for TwoTuple[] + ret_arr_ptr[x] = (long)arr_conv_49_ref; } FREE(ret_var.data); return ret_arr; @@ -5711,20 +7249,8 @@ void ChannelMonitor_1block_1disconnected(void* ctx_TODO, uint32_t this_arg, int8 memcpy(header_arr, header.ptr, 80); unsigned char (*header_ref)[80] = &header_arr; LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)broadcaster; - 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); - } LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)fee_estimator; - 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); - } LDKLogger logger_conv = *(LDKLogger*)logger; - 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); - } ChannelMonitor_block_disconnected(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv); } @@ -5784,22 +7310,22 @@ void OutPoint_1set_1txid(void* ctx_TODO, uint32_t this_ptr, int8_tArray val) { OutPoint_set_txid(&this_ptr_conv, val_ref); } -jshort OutPoint_1get_1index(void* ctx_TODO, uint32_t this_ptr) { +int16_t OutPoint_1get_1index(void* ctx_TODO, uint32_t this_ptr) { LDKOutPoint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = OutPoint_get_index(&this_ptr_conv); + int16_t ret_val = OutPoint_get_index(&this_ptr_conv); return ret_val; } -void OutPoint_1set_1index(void* ctx_TODO, uint32_t this_ptr, jshort val) { +void OutPoint_1set_1index(void* ctx_TODO, uint32_t this_ptr, int16_t val) { LDKOutPoint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; OutPoint_set_index(&this_ptr_conv, val); } -uint32_t OutPoint_1new(void* ctx_TODO, int8_tArray txid_arg, jshort index_arg) { +uint32_t OutPoint_1new(void* ctx_TODO, int8_tArray txid_arg, int16_t index_arg) { LDKThirtyTwoBytes txid_arg_ref; CHECK(txid_arg.len == 32); memcpy(txid_arg_ref.data, txid_arg.ptr, 32); @@ -6078,19 +7604,19 @@ uint32_t InMemoryChannelKeys_1counterparty_1pubkeys(void* ctx_TODO, uint32_t thi return ret_ref; } -jshort InMemoryChannelKeys_1counterparty_1selected_1contest_1delay(void* ctx_TODO, uint32_t this_arg) { +int16_t InMemoryChannelKeys_1counterparty_1selected_1contest_1delay(void* ctx_TODO, uint32_t this_arg) { LDKInMemoryChannelKeys this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; - jshort ret_val = InMemoryChannelKeys_counterparty_selected_contest_delay(&this_arg_conv); + int16_t ret_val = InMemoryChannelKeys_counterparty_selected_contest_delay(&this_arg_conv); return ret_val; } -jshort InMemoryChannelKeys_1holder_1selected_1contest_1delay(void* ctx_TODO, uint32_t this_arg) { +int16_t InMemoryChannelKeys_1holder_1selected_1contest_1delay(void* ctx_TODO, uint32_t this_arg) { LDKInMemoryChannelKeys this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; - jshort ret_val = InMemoryChannelKeys_holder_selected_contest_delay(&this_arg_conv); + int16_t ret_val = InMemoryChannelKeys_holder_selected_contest_delay(&this_arg_conv); return ret_val; } @@ -6378,33 +7904,13 @@ void PaymentSendFailure_1free(void* ctx_TODO, uint32_t this_ptr) { PaymentSendFailure_free(this_ptr_conv); } -uint32_t ChannelManager_1new(void* ctx_TODO, uint32_t network, uint32_t fee_est, uint32_t chain_monitor, uint32_t tx_broadcaster, uint32_t logger, uint32_t keys_manager, uint32_t config, int64_t current_blockchain_height) { +uint32_t ChannelManager_1new(void* ctx_TODO, uint32_t network, uint32_t fee_est, uint32_t chain_monitor, uint32_t tx_broadcaster, uint32_t logger, uint32_t keys_manager, uint32_t config, intptr_t current_blockchain_height) { LDKNetwork network_conv = LDKNetwork_from_js(network); LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)fee_est; - 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); - } LDKWatch chain_monitor_conv = *(LDKWatch*)chain_monitor; - 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); - } LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)tx_broadcaster; - 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); - } LDKLogger logger_conv = *(LDKLogger*)logger; - 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); - } LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)keys_manager; - 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); - } LDKUserConfig config_conv; config_conv.inner = (void*)(config & (~1)); config_conv.is_owned = (config & 1) || (config == 0); @@ -6443,7 +7949,7 @@ uint32_tArray ChannelManager_1list_1channels(void* ctx_TODO, uint32_t this_arg) this_arg_conv.is_owned = false; LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_channels(&this_arg_conv); uint32_tArray ret_arr = { .len = ret_var.datalen, .ptr = MALLOC(ret_var.datalen * sizeof(int32_t), "Native uint32_tArray Bytes") }; - uint32_t *ret_arr_ptr = ret_arr.ptr; + uint32_t *ret_arr_ptr = (uint32_t*)ret_arr.ptr; for (size_t q = 0; q < ret_var.datalen; q++) { LDKChannelDetails arr_conv_16_var = ret_var.data[q]; CHECK((((long)arr_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. @@ -6464,7 +7970,7 @@ uint32_tArray ChannelManager_1list_1usable_1channels(void* ctx_TODO, uint32_t th this_arg_conv.is_owned = false; LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_usable_channels(&this_arg_conv); uint32_tArray ret_arr = { .len = ret_var.datalen, .ptr = MALLOC(ret_var.datalen * sizeof(int32_t), "Native uint32_tArray Bytes") }; - uint32_t *ret_arr_ptr = ret_arr.ptr; + uint32_t *ret_arr_ptr = (uint32_t*)ret_arr.ptr; for (size_t q = 0; q < ret_var.datalen; q++) { LDKChannelDetails arr_conv_16_var = ret_var.data[q]; CHECK((((long)arr_conv_16_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. @@ -6665,11 +8171,11 @@ void ChannelManager_1block_1connected(void* ctx_TODO, uint32_t this_arg, int8_tA else txdata_constr.data = NULL; uint32_t* txdata_vals = (uint32_t*) txdata.ptr; - for (size_t y = 0; y < txdata_constr.datalen; y++) { - uint32_t arr_conv_24 = txdata_vals[y]; - LDKC2Tuple_usizeTransactionZ arr_conv_24_conv = *(LDKC2Tuple_usizeTransactionZ*)arr_conv_24; - FREE((void*)arr_conv_24); - txdata_constr.data[y] = arr_conv_24_conv; + for (size_t e = 0; e < txdata_constr.datalen; e++) { + uint32_t arr_conv_30 = txdata_vals[e]; + LDKC2Tuple_usizeTransactionZ arr_conv_30_conv = *(LDKC2Tuple_usizeTransactionZ*)arr_conv_30; + FREE((void*)arr_conv_30); + txdata_constr.data[e] = arr_conv_30_conv; } ChannelManager_block_connected(&this_arg_conv, header_ref, txdata_constr, height); } @@ -6725,10 +8231,6 @@ void ChannelManagerReadArgs_1set_1keys_1manager(void* ctx_TODO, uint32_t this_pt this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; LDKKeysInterface val_conv = *(LDKKeysInterface*)val; - 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); - } ChannelManagerReadArgs_set_keys_manager(&this_ptr_conv, val_conv); } @@ -6745,10 +8247,6 @@ void ChannelManagerReadArgs_1set_1fee_1estimator(void* ctx_TODO, uint32_t this_p this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; LDKFeeEstimator val_conv = *(LDKFeeEstimator*)val; - 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); - } ChannelManagerReadArgs_set_fee_estimator(&this_ptr_conv, val_conv); } @@ -6765,10 +8263,6 @@ void ChannelManagerReadArgs_1set_1chain_1monitor(void* ctx_TODO, uint32_t this_p this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; LDKWatch val_conv = *(LDKWatch*)val; - 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); - } ChannelManagerReadArgs_set_chain_monitor(&this_ptr_conv, val_conv); } @@ -6785,10 +8279,6 @@ void ChannelManagerReadArgs_1set_1tx_1broadcaster(void* ctx_TODO, uint32_t this_ this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)val; - 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); - } ChannelManagerReadArgs_set_tx_broadcaster(&this_ptr_conv, val_conv); } @@ -6805,10 +8295,6 @@ void ChannelManagerReadArgs_1set_1logger(void* ctx_TODO, uint32_t this_ptr, uint this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; LDKLogger val_conv = *(LDKLogger*)val; - 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); - } ChannelManagerReadArgs_set_logger(&this_ptr_conv, val_conv); } @@ -6840,30 +8326,10 @@ void ChannelManagerReadArgs_1set_1default_1config(void* ctx_TODO, uint32_t this_ uint32_t ChannelManagerReadArgs_1new(void* ctx_TODO, uint32_t keys_manager, uint32_t fee_estimator, uint32_t chain_monitor, uint32_t tx_broadcaster, uint32_t logger, uint32_t default_config, uint32_tArray channel_monitors) { LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)keys_manager; - 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); - } LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)fee_estimator; - 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); - } LDKWatch chain_monitor_conv = *(LDKWatch*)chain_monitor; - 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); - } LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)tx_broadcaster; - 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); - } LDKLogger logger_conv = *(LDKLogger*)logger; - 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); - } LDKUserConfig default_config_conv; default_config_conv.inner = (void*)(default_config & (~1)); default_config_conv.is_owned = (default_config & 1) || (default_config == 0); @@ -6983,7 +8449,7 @@ jstring ErrorMessage_1get_1data(void* ctx_TODO, uint32_t this_ptr) { char* _buf = MALLOC(_str.len + 1, "str conv buf"); memcpy(_buf, _str.chars, _str.len); _buf[_str.len] = 0; - jstring _conv = (*env)->NewStringUTF(env, _str.chars); + jstring _conv = conv_owned_string(_str.chars); FREE(_buf); return _conv; } @@ -7038,37 +8504,37 @@ uint32_t Ping_1clone(void* ctx_TODO, uint32_t orig) { return ret_ref; } -jshort Ping_1get_1ponglen(void* ctx_TODO, uint32_t this_ptr) { +int16_t Ping_1get_1ponglen(void* ctx_TODO, uint32_t this_ptr) { LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = Ping_get_ponglen(&this_ptr_conv); + int16_t ret_val = Ping_get_ponglen(&this_ptr_conv); return ret_val; } -void Ping_1set_1ponglen(void* ctx_TODO, uint32_t this_ptr, jshort val) { +void Ping_1set_1ponglen(void* ctx_TODO, uint32_t this_ptr, int16_t val) { LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; Ping_set_ponglen(&this_ptr_conv, val); } -jshort Ping_1get_1byteslen(void* ctx_TODO, uint32_t this_ptr) { +int16_t Ping_1get_1byteslen(void* ctx_TODO, uint32_t this_ptr) { LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = Ping_get_byteslen(&this_ptr_conv); + int16_t ret_val = Ping_get_byteslen(&this_ptr_conv); return ret_val; } -void Ping_1set_1byteslen(void* ctx_TODO, uint32_t this_ptr, jshort val) { +void Ping_1set_1byteslen(void* ctx_TODO, uint32_t this_ptr, int16_t val) { LDKPing this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; Ping_set_byteslen(&this_ptr_conv, val); } -uint32_t Ping_1new(void* ctx_TODO, jshort ponglen_arg, jshort byteslen_arg) { +uint32_t Ping_1new(void* ctx_TODO, int16_t ponglen_arg, int16_t byteslen_arg) { LDKPing ret_var = Ping_new(ponglen_arg, byteslen_arg); CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -7100,22 +8566,22 @@ uint32_t Pong_1clone(void* ctx_TODO, uint32_t orig) { return ret_ref; } -jshort Pong_1get_1byteslen(void* ctx_TODO, uint32_t this_ptr) { +int16_t Pong_1get_1byteslen(void* ctx_TODO, uint32_t this_ptr) { LDKPong this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = Pong_get_byteslen(&this_ptr_conv); + int16_t ret_val = Pong_get_byteslen(&this_ptr_conv); return ret_val; } -void Pong_1set_1byteslen(void* ctx_TODO, uint32_t this_ptr, jshort val) { +void Pong_1set_1byteslen(void* ctx_TODO, uint32_t this_ptr, int16_t val) { LDKPong this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; Pong_set_byteslen(&this_ptr_conv, val); } -uint32_t Pong_1new(void* ctx_TODO, jshort byteslen_arg) { +uint32_t Pong_1new(void* ctx_TODO, int16_t byteslen_arg) { LDKPong ret_var = Pong_new(byteslen_arg); CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -7290,30 +8756,30 @@ void OpenChannel_1set_1feerate_1per_1kw(void* ctx_TODO, uint32_t this_ptr, int32 OpenChannel_set_feerate_per_kw(&this_ptr_conv, val); } -jshort OpenChannel_1get_1to_1self_1delay(void* ctx_TODO, uint32_t this_ptr) { +int16_t OpenChannel_1get_1to_1self_1delay(void* ctx_TODO, uint32_t this_ptr) { LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = OpenChannel_get_to_self_delay(&this_ptr_conv); + int16_t ret_val = OpenChannel_get_to_self_delay(&this_ptr_conv); return ret_val; } -void OpenChannel_1set_1to_1self_1delay(void* ctx_TODO, uint32_t this_ptr, jshort val) { +void OpenChannel_1set_1to_1self_1delay(void* ctx_TODO, uint32_t this_ptr, int16_t val) { LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; OpenChannel_set_to_self_delay(&this_ptr_conv, val); } -jshort OpenChannel_1get_1max_1accepted_1htlcs(void* ctx_TODO, uint32_t this_ptr) { +int16_t OpenChannel_1get_1max_1accepted_1htlcs(void* ctx_TODO, uint32_t this_ptr) { LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = OpenChannel_get_max_accepted_htlcs(&this_ptr_conv); + int16_t ret_val = OpenChannel_get_max_accepted_htlcs(&this_ptr_conv); return ret_val; } -void OpenChannel_1set_1max_1accepted_1htlcs(void* ctx_TODO, uint32_t this_ptr, jshort val) { +void OpenChannel_1set_1max_1accepted_1htlcs(void* ctx_TODO, uint32_t this_ptr, int16_t val) { LDKOpenChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; @@ -7564,30 +9030,30 @@ void AcceptChannel_1set_1minimum_1depth(void* ctx_TODO, uint32_t this_ptr, int32 AcceptChannel_set_minimum_depth(&this_ptr_conv, val); } -jshort AcceptChannel_1get_1to_1self_1delay(void* ctx_TODO, uint32_t this_ptr) { +int16_t AcceptChannel_1get_1to_1self_1delay(void* ctx_TODO, uint32_t this_ptr) { LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = AcceptChannel_get_to_self_delay(&this_ptr_conv); + int16_t ret_val = AcceptChannel_get_to_self_delay(&this_ptr_conv); return ret_val; } -void AcceptChannel_1set_1to_1self_1delay(void* ctx_TODO, uint32_t this_ptr, jshort val) { +void AcceptChannel_1set_1to_1self_1delay(void* ctx_TODO, uint32_t this_ptr, int16_t val) { LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; AcceptChannel_set_to_self_delay(&this_ptr_conv, val); } -jshort AcceptChannel_1get_1max_1accepted_1htlcs(void* ctx_TODO, uint32_t this_ptr) { +int16_t AcceptChannel_1get_1max_1accepted_1htlcs(void* ctx_TODO, uint32_t this_ptr) { LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = AcceptChannel_get_max_accepted_htlcs(&this_ptr_conv); + int16_t ret_val = AcceptChannel_get_max_accepted_htlcs(&this_ptr_conv); return ret_val; } -void AcceptChannel_1set_1max_1accepted_1htlcs(void* ctx_TODO, uint32_t this_ptr, jshort val) { +void AcceptChannel_1set_1max_1accepted_1htlcs(void* ctx_TODO, uint32_t this_ptr, int16_t val) { LDKAcceptChannel this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; @@ -7767,15 +9233,15 @@ void FundingCreated_1set_1funding_1txid(void* ctx_TODO, uint32_t this_ptr, int8_ FundingCreated_set_funding_txid(&this_ptr_conv, val_ref); } -jshort FundingCreated_1get_1funding_1output_1index(void* ctx_TODO, uint32_t this_ptr) { +int16_t FundingCreated_1get_1funding_1output_1index(void* ctx_TODO, uint32_t this_ptr) { LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = FundingCreated_get_funding_output_index(&this_ptr_conv); + int16_t ret_val = FundingCreated_get_funding_output_index(&this_ptr_conv); return ret_val; } -void FundingCreated_1set_1funding_1output_1index(void* ctx_TODO, uint32_t this_ptr, jshort val) { +void FundingCreated_1set_1funding_1output_1index(void* ctx_TODO, uint32_t this_ptr, int16_t val) { LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; @@ -7801,7 +9267,7 @@ void FundingCreated_1set_1signature(void* ctx_TODO, uint32_t this_ptr, int8_tArr FundingCreated_set_signature(&this_ptr_conv, val_ref); } -uint32_t FundingCreated_1new(void* ctx_TODO, int8_tArray temporary_channel_id_arg, int8_tArray funding_txid_arg, jshort funding_output_index_arg, int8_tArray signature_arg) { +uint32_t FundingCreated_1new(void* ctx_TODO, int8_tArray temporary_channel_id_arg, int8_tArray funding_txid_arg, int16_t funding_output_index_arg, int8_tArray signature_arg) { LDKThirtyTwoBytes temporary_channel_id_arg_ref; CHECK(temporary_channel_id_arg.len == 32); memcpy(temporary_channel_id_arg_ref.data, temporary_channel_id_arg.ptr, 32); @@ -8448,15 +9914,15 @@ void UpdateFailMalformedHTLC_1set_1htlc_1id(void* ctx_TODO, uint32_t this_ptr, i UpdateFailMalformedHTLC_set_htlc_id(&this_ptr_conv, val); } -jshort UpdateFailMalformedHTLC_1get_1failure_1code(void* ctx_TODO, uint32_t this_ptr) { +int16_t UpdateFailMalformedHTLC_1get_1failure_1code(void* ctx_TODO, uint32_t this_ptr) { LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = UpdateFailMalformedHTLC_get_failure_code(&this_ptr_conv); + int16_t ret_val = UpdateFailMalformedHTLC_get_failure_code(&this_ptr_conv); return ret_val; } -void UpdateFailMalformedHTLC_1set_1failure_1code(void* ctx_TODO, uint32_t this_ptr, jshort val) { +void UpdateFailMalformedHTLC_1set_1failure_1code(void* ctx_TODO, uint32_t this_ptr, int16_t val) { LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; @@ -8522,7 +9988,7 @@ void CommitmentSigned_1set_1signature(void* ctx_TODO, uint32_t this_ptr, int8_tA CommitmentSigned_set_signature(&this_ptr_conv, val_ref); } -void CommitmentSigned_1set_1htlc_1signatures(void* ctx_TODO, uint32_t this_ptr, uint32_tArray val) { +void CommitmentSigned_1set_1htlc_1signatures(void* ctx_TODO, uint32_t this_ptr, ptrArray val) { LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; @@ -8533,17 +9999,17 @@ void CommitmentSigned_1set_1htlc_1signatures(void* ctx_TODO, uint32_t this_ptr, else val_constr.data = NULL; int8_tArray* val_vals = (int8_tArray*) val.ptr; - for (size_t i = 0; i < val_constr.datalen; i++) { - int8_tArray arr_conv_8 = val_vals[i]; - LDKSignature arr_conv_8_ref; - CHECK(arr_conv_8.len == 64); - memcpy(arr_conv_8_ref.compact_form, arr_conv_8.ptr, 64); - val_constr.data[i] = arr_conv_8_ref; + for (size_t m = 0; m < val_constr.datalen; m++) { + int8_tArray arr_conv_12 = val_vals[m]; + LDKSignature arr_conv_12_ref; + CHECK(arr_conv_12.len == 64); + memcpy(arr_conv_12_ref.compact_form, arr_conv_12.ptr, 64); + val_constr.data[m] = arr_conv_12_ref; } CommitmentSigned_set_htlc_signatures(&this_ptr_conv, val_constr); } -uint32_t CommitmentSigned_1new(void* ctx_TODO, int8_tArray channel_id_arg, int8_tArray signature_arg, uint32_tArray htlc_signatures_arg) { +uint32_t CommitmentSigned_1new(void* ctx_TODO, int8_tArray channel_id_arg, int8_tArray signature_arg, ptrArray htlc_signatures_arg) { LDKThirtyTwoBytes channel_id_arg_ref; CHECK(channel_id_arg.len == 32); memcpy(channel_id_arg_ref.data, channel_id_arg.ptr, 32); @@ -8557,12 +10023,12 @@ uint32_t CommitmentSigned_1new(void* ctx_TODO, int8_tArray channel_id_arg, int8_ else htlc_signatures_arg_constr.data = NULL; int8_tArray* htlc_signatures_arg_vals = (int8_tArray*) htlc_signatures_arg.ptr; - for (size_t i = 0; i < htlc_signatures_arg_constr.datalen; i++) { - int8_tArray arr_conv_8 = htlc_signatures_arg_vals[i]; - LDKSignature arr_conv_8_ref; - CHECK(arr_conv_8.len == 64); - memcpy(arr_conv_8_ref.compact_form, arr_conv_8.ptr, 64); - htlc_signatures_arg_constr.data[i] = arr_conv_8_ref; + for (size_t m = 0; m < htlc_signatures_arg_constr.datalen; m++) { + int8_tArray arr_conv_12 = htlc_signatures_arg_vals[m]; + LDKSignature arr_conv_12_ref; + CHECK(arr_conv_12.len == 64); + memcpy(arr_conv_12_ref.compact_form, arr_conv_12.ptr, 64); + htlc_signatures_arg_constr.data[m] = arr_conv_12_ref; } LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_ref, signature_arg_ref, htlc_signatures_arg_constr); CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. @@ -9647,15 +11113,15 @@ void UnsignedChannelUpdate_1set_1flags(void* ctx_TODO, uint32_t this_ptr, int8_t UnsignedChannelUpdate_set_flags(&this_ptr_conv, val); } -jshort UnsignedChannelUpdate_1get_1cltv_1expiry_1delta(void* ctx_TODO, uint32_t this_ptr) { +int16_t UnsignedChannelUpdate_1get_1cltv_1expiry_1delta(void* ctx_TODO, uint32_t this_ptr) { LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = UnsignedChannelUpdate_get_cltv_expiry_delta(&this_ptr_conv); + int16_t ret_val = UnsignedChannelUpdate_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } -void UnsignedChannelUpdate_1set_1cltv_1expiry_1delta(void* ctx_TODO, uint32_t this_ptr, jshort val) { +void UnsignedChannelUpdate_1set_1cltv_1expiry_1delta(void* ctx_TODO, uint32_t this_ptr, int16_t val) { LDKUnsignedChannelUpdate this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; @@ -9972,9 +11438,9 @@ void ReplyChannelRange_1set_1short_1channel_1ids(void* ctx_TODO, uint32_t this_p else val_constr.data = NULL; int64_t* val_vals = (int64_t*) val.ptr; - for (size_t g = 0; g < val_constr.datalen; g++) { - int64_t arr_conv_6 = val_vals[g]; - val_constr.data[g] = arr_conv_6; + for (size_t i = 0; i < val_constr.datalen; i++) { + int64_t arr_conv_8 = val_vals[i]; + val_constr.data[i] = arr_conv_8; } ReplyChannelRange_set_short_channel_ids(&this_ptr_conv, val_constr); } @@ -9990,9 +11456,9 @@ uint32_t ReplyChannelRange_1new(void* ctx_TODO, int8_tArray chain_hash_arg, int3 else short_channel_ids_arg_constr.data = NULL; int64_t* short_channel_ids_arg_vals = (int64_t*) short_channel_ids_arg.ptr; - for (size_t g = 0; g < short_channel_ids_arg_constr.datalen; g++) { - int64_t arr_conv_6 = short_channel_ids_arg_vals[g]; - short_channel_ids_arg_constr.data[g] = arr_conv_6; + for (size_t i = 0; i < short_channel_ids_arg_constr.datalen; i++) { + int64_t arr_conv_8 = short_channel_ids_arg_vals[i]; + short_channel_ids_arg_constr.data[i] = arr_conv_8; } LDKReplyChannelRange ret_var = ReplyChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg, full_information_arg, short_channel_ids_arg_constr); CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. @@ -10055,9 +11521,9 @@ void QueryShortChannelIds_1set_1short_1channel_1ids(void* ctx_TODO, uint32_t thi else val_constr.data = NULL; int64_t* val_vals = (int64_t*) val.ptr; - for (size_t g = 0; g < val_constr.datalen; g++) { - int64_t arr_conv_6 = val_vals[g]; - val_constr.data[g] = arr_conv_6; + for (size_t i = 0; i < val_constr.datalen; i++) { + int64_t arr_conv_8 = val_vals[i]; + val_constr.data[i] = arr_conv_8; } QueryShortChannelIds_set_short_channel_ids(&this_ptr_conv, val_constr); } @@ -10073,9 +11539,9 @@ uint32_t QueryShortChannelIds_1new(void* ctx_TODO, int8_tArray chain_hash_arg, i else short_channel_ids_arg_constr.data = NULL; int64_t* short_channel_ids_arg_vals = (int64_t*) short_channel_ids_arg.ptr; - for (size_t g = 0; g < short_channel_ids_arg_constr.datalen; g++) { - int64_t arr_conv_6 = short_channel_ids_arg_vals[g]; - short_channel_ids_arg_constr.data[g] = arr_conv_6; + for (size_t i = 0; i < short_channel_ids_arg_constr.datalen; i++) { + int64_t arr_conv_8 = short_channel_ids_arg_vals[i]; + short_channel_ids_arg_constr.data[i] = arr_conv_8; } LDKQueryShortChannelIds ret_var = QueryShortChannelIds_new(chain_hash_arg_ref, short_channel_ids_arg_constr); CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. @@ -10269,7 +11735,7 @@ jstring LightningError_1get_1err(void* ctx_TODO, uint32_t this_ptr) { char* _buf = MALLOC(_str.len + 1, "str conv buf"); memcpy(_buf, _str.chars, _str.len); _buf[_str.len] = 0; - jstring _conv = (*env)->NewStringUTF(env, _str.chars); + jstring _conv = conv_owned_string(_str.chars); FREE(_buf); return _conv; } @@ -11327,10 +12793,6 @@ void MessageHandler_1set_1chan_1handler(void* ctx_TODO, uint32_t this_ptr, uint3 this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)val; - 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); - } MessageHandler_set_chan_handler(&this_ptr_conv, val_conv); } @@ -11347,24 +12809,12 @@ void MessageHandler_1set_1route_1handler(void* ctx_TODO, uint32_t this_ptr, uint this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)val; - 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); - } MessageHandler_set_route_handler(&this_ptr_conv, val_conv); } uint32_t MessageHandler_1new(void* ctx_TODO, uint32_t chan_handler_arg, uint32_t route_handler_arg) { LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)chan_handler_arg; - 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); - } LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)route_handler_arg; - 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); - } LDKMessageHandler ret_var = MessageHandler_new(chan_handler_arg_conv, route_handler_arg_conv); CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -11441,10 +12891,6 @@ uint32_t PeerManager_1new(void* ctx_TODO, uint32_t message_handler, int8_tArray memcpy(ephemeral_random_data_arr, ephemeral_random_data.ptr, 32); unsigned char (*ephemeral_random_data_ref)[32] = &ephemeral_random_data_arr; LDKLogger logger_conv = *(LDKLogger*)logger; - 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); - } LDKPeerManager ret_var = PeerManager_new(message_handler_conv, our_node_secret_ref, ephemeral_random_data_ref, logger_conv); CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -11455,16 +12901,17 @@ uint32_t PeerManager_1new(void* ctx_TODO, uint32_t message_handler, int8_tArray return ret_ref; } -uint32_tArray PeerManager_1get_1peer_1node_1ids(void* ctx_TODO, uint32_t this_arg) { +ptrArray PeerManager_1get_1peer_1node_1ids(void* ctx_TODO, uint32_t this_arg) { LDKPeerManager this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; LDKCVec_PublicKeyZ ret_var = PeerManager_get_peer_node_ids(&this_arg_conv); - uint32_tArray ret_arr = (*env)->NewObjectArray(env, ret_var.datalen, arr_of_B_clz, NULL); - for (size_t i = 0; i < ret_var.datalen; i++) { - int8_tArray arr_conv_8_arr = { .len = 33, .ptr = MALLOC(33, "Native int8_tArray Bytes") }; - memcpy(arr_conv_8_arr.ptr, ret_var.data[i].compressed_form, 33); - (*env)->SetObjectArrayElement(env, ret_arr, i, arr_conv_8_arr); + ptrArray ret_arr = { .len = ret_var.datalen, .ptr = MALLOC(ret_var.datalen * sizeof(int32_t), "Native Object Bytes") }; + int8_tArray *ret_arr_ptr = (int8_tArray*)ret_arr.ptr; + for (size_t m = 0; m < ret_var.datalen; m++) { + int8_tArray arr_conv_12_arr = { .len = 33, .ptr = MALLOC(33, "Native int8_tArray Bytes") }; + memcpy(arr_conv_12_arr.ptr, ret_var.data[m].compressed_form, 33); + ret_arr_ptr[m] = arr_conv_12_arr; } FREE(ret_var.data); return ret_arr; @@ -11478,10 +12925,6 @@ uint32_t PeerManager_1new_1outbound_1connection(void* ctx_TODO, uint32_t this_ar CHECK(their_node_id.len == 33); memcpy(their_node_id_ref.compressed_form, their_node_id.ptr, 33); LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)descriptor; - 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); - } 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); return (long)ret_conv; @@ -11492,10 +12935,6 @@ uint32_t PeerManager_1new_1inbound_1connection(void* ctx_TODO, uint32_t this_arg this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)descriptor; - 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); - } LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ"); *ret_conv = PeerManager_new_inbound_connection(&this_arg_conv, descriptor_conv); return (long)ret_conv; @@ -11977,7 +13416,7 @@ uint32_t TxCreationKeys_1from_1channel_1static_1keys(void* ctx_TODO, int8_tArray return (long)ret_conv; } -int8_tArray get_1revokeable_1redeemscript(void* ctx_TODO, int8_tArray revocation_key, jshort contest_delay, int8_tArray broadcaster_delayed_payment_key) { +int8_tArray get_1revokeable_1redeemscript(void* ctx_TODO, int8_tArray revocation_key, int16_t contest_delay, int8_tArray broadcaster_delayed_payment_key) { LDKPublicKey revocation_key_ref; CHECK(revocation_key.len == 33); memcpy(revocation_key_ref.compressed_form, revocation_key.ptr, 33); @@ -12129,7 +13568,7 @@ int8_tArray make_1funding_1redeemscript(void* ctx_TODO, int8_tArray broadcaster, return arg_arr; } -int8_tArray build_1htlc_1transaction(void* ctx_TODO, int8_tArray prev_hash, int32_t feerate_per_kw, jshort contest_delay, uint32_t htlc, int8_tArray broadcaster_delayed_payment_key, int8_tArray revocation_key) { +int8_tArray build_1htlc_1transaction(void* ctx_TODO, int8_tArray prev_hash, int32_t feerate_per_kw, int16_t contest_delay, uint32_t htlc, int8_tArray broadcaster_delayed_payment_key, int8_tArray revocation_key) { unsigned char prev_hash_arr[32]; CHECK(prev_hash.len == 32); memcpy(prev_hash_arr, prev_hash.ptr, 32); @@ -12197,15 +13636,15 @@ void ChannelTransactionParameters_1set_1holder_1pubkeys(void* ctx_TODO, uint32_t ChannelTransactionParameters_set_holder_pubkeys(&this_ptr_conv, val_conv); } -jshort ChannelTransactionParameters_1get_1holder_1selected_1contest_1delay(void* ctx_TODO, uint32_t this_ptr) { +int16_t ChannelTransactionParameters_1get_1holder_1selected_1contest_1delay(void* ctx_TODO, uint32_t this_ptr) { LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = ChannelTransactionParameters_get_holder_selected_contest_delay(&this_ptr_conv); + int16_t ret_val = ChannelTransactionParameters_get_holder_selected_contest_delay(&this_ptr_conv); return ret_val; } -void ChannelTransactionParameters_1set_1holder_1selected_1contest_1delay(void* ctx_TODO, uint32_t this_ptr, jshort val) { +void ChannelTransactionParameters_1set_1holder_1selected_1contest_1delay(void* ctx_TODO, uint32_t this_ptr, int16_t val) { LDKChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; @@ -12279,7 +13718,7 @@ void ChannelTransactionParameters_1set_1funding_1outpoint(void* ctx_TODO, uint32 ChannelTransactionParameters_set_funding_outpoint(&this_ptr_conv, val_conv); } -uint32_t ChannelTransactionParameters_1new(void* ctx_TODO, uint32_t holder_pubkeys_arg, jshort holder_selected_contest_delay_arg, jboolean is_outbound_from_holder_arg, uint32_t counterparty_parameters_arg, uint32_t funding_outpoint_arg) { +uint32_t ChannelTransactionParameters_1new(void* ctx_TODO, uint32_t holder_pubkeys_arg, int16_t holder_selected_contest_delay_arg, jboolean is_outbound_from_holder_arg, uint32_t counterparty_parameters_arg, uint32_t funding_outpoint_arg) { LDKChannelPublicKeys holder_pubkeys_arg_conv; holder_pubkeys_arg_conv.inner = (void*)(holder_pubkeys_arg & (~1)); holder_pubkeys_arg_conv.is_owned = (holder_pubkeys_arg & 1) || (holder_pubkeys_arg == 0); @@ -12352,22 +13791,22 @@ void CounterpartyChannelTransactionParameters_1set_1pubkeys(void* ctx_TODO, uint CounterpartyChannelTransactionParameters_set_pubkeys(&this_ptr_conv, val_conv); } -jshort CounterpartyChannelTransactionParameters_1get_1selected_1contest_1delay(void* ctx_TODO, uint32_t this_ptr) { +int16_t CounterpartyChannelTransactionParameters_1get_1selected_1contest_1delay(void* ctx_TODO, uint32_t this_ptr) { LDKCounterpartyChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = CounterpartyChannelTransactionParameters_get_selected_contest_delay(&this_ptr_conv); + int16_t ret_val = CounterpartyChannelTransactionParameters_get_selected_contest_delay(&this_ptr_conv); return ret_val; } -void CounterpartyChannelTransactionParameters_1set_1selected_1contest_1delay(void* ctx_TODO, uint32_t this_ptr, jshort val) { +void CounterpartyChannelTransactionParameters_1set_1selected_1contest_1delay(void* ctx_TODO, uint32_t this_ptr, int16_t val) { LDKCounterpartyChannelTransactionParameters this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; CounterpartyChannelTransactionParameters_set_selected_contest_delay(&this_ptr_conv, val); } -uint32_t CounterpartyChannelTransactionParameters_1new(void* ctx_TODO, uint32_t pubkeys_arg, jshort selected_contest_delay_arg) { +uint32_t CounterpartyChannelTransactionParameters_1new(void* ctx_TODO, uint32_t pubkeys_arg, int16_t selected_contest_delay_arg) { LDKChannelPublicKeys pubkeys_arg_conv; pubkeys_arg_conv.inner = (void*)(pubkeys_arg & (~1)); pubkeys_arg_conv.is_owned = (pubkeys_arg & 1) || (pubkeys_arg == 0); @@ -12504,11 +13943,11 @@ uint32_t DirectedChannelTransactionParameters_1countersignatory_1pubkeys(void* c return ret_ref; } -jshort DirectedChannelTransactionParameters_1contest_1delay(void* ctx_TODO, uint32_t this_arg) { +int16_t DirectedChannelTransactionParameters_1contest_1delay(void* ctx_TODO, uint32_t this_arg) { LDKDirectedChannelTransactionParameters this_arg_conv; this_arg_conv.inner = (void*)(this_arg & (~1)); this_arg_conv.is_owned = false; - jshort ret_val = DirectedChannelTransactionParameters_contest_delay(&this_arg_conv); + int16_t ret_val = DirectedChannelTransactionParameters_contest_delay(&this_arg_conv); return ret_val; } @@ -12574,7 +14013,7 @@ void HolderCommitmentTransaction_1set_1counterparty_1sig(void* ctx_TODO, uint32_ HolderCommitmentTransaction_set_counterparty_sig(&this_ptr_conv, val_ref); } -void HolderCommitmentTransaction_1set_1counterparty_1htlc_1sigs(void* ctx_TODO, uint32_t this_ptr, uint32_tArray val) { +void HolderCommitmentTransaction_1set_1counterparty_1htlc_1sigs(void* ctx_TODO, uint32_t this_ptr, ptrArray val) { LDKHolderCommitmentTransaction this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; @@ -12585,12 +14024,12 @@ void HolderCommitmentTransaction_1set_1counterparty_1htlc_1sigs(void* ctx_TODO, else val_constr.data = NULL; int8_tArray* val_vals = (int8_tArray*) val.ptr; - for (size_t i = 0; i < val_constr.datalen; i++) { - int8_tArray arr_conv_8 = val_vals[i]; - LDKSignature arr_conv_8_ref; - CHECK(arr_conv_8.len == 64); - memcpy(arr_conv_8_ref.compact_form, arr_conv_8.ptr, 64); - val_constr.data[i] = arr_conv_8_ref; + for (size_t m = 0; m < val_constr.datalen; m++) { + int8_tArray arr_conv_12 = val_vals[m]; + LDKSignature arr_conv_12_ref; + CHECK(arr_conv_12.len == 64); + memcpy(arr_conv_12_ref.compact_form, arr_conv_12.ptr, 64); + val_constr.data[m] = arr_conv_12_ref; } HolderCommitmentTransaction_set_counterparty_htlc_sigs(&this_ptr_conv, val_constr); } @@ -12620,7 +14059,7 @@ uint32_t HolderCommitmentTransaction_1read(void* ctx_TODO, int8_tArray ser) { return ret_ref; } -uint32_t HolderCommitmentTransaction_1new(void* ctx_TODO, uint32_t commitment_tx, int8_tArray counterparty_sig, uint32_tArray counterparty_htlc_sigs, int8_tArray holder_funding_key, int8_tArray counterparty_funding_key) { +uint32_t HolderCommitmentTransaction_1new(void* ctx_TODO, uint32_t commitment_tx, int8_tArray counterparty_sig, ptrArray counterparty_htlc_sigs, int8_tArray holder_funding_key, int8_tArray counterparty_funding_key) { LDKCommitmentTransaction commitment_tx_conv; commitment_tx_conv.inner = (void*)(commitment_tx & (~1)); commitment_tx_conv.is_owned = (commitment_tx & 1) || (commitment_tx == 0); @@ -12636,12 +14075,12 @@ uint32_t HolderCommitmentTransaction_1new(void* ctx_TODO, uint32_t commitment_tx else counterparty_htlc_sigs_constr.data = NULL; int8_tArray* counterparty_htlc_sigs_vals = (int8_tArray*) counterparty_htlc_sigs.ptr; - for (size_t i = 0; i < counterparty_htlc_sigs_constr.datalen; i++) { - int8_tArray arr_conv_8 = counterparty_htlc_sigs_vals[i]; - LDKSignature arr_conv_8_ref; - CHECK(arr_conv_8.len == 64); - memcpy(arr_conv_8_ref.compact_form, arr_conv_8.ptr, 64); - counterparty_htlc_sigs_constr.data[i] = arr_conv_8_ref; + for (size_t m = 0; m < counterparty_htlc_sigs_constr.datalen; m++) { + int8_tArray arr_conv_12 = counterparty_htlc_sigs_vals[m]; + LDKSignature arr_conv_12_ref; + CHECK(arr_conv_12.len == 64); + memcpy(arr_conv_12_ref.compact_form, arr_conv_12.ptr, 64); + counterparty_htlc_sigs_constr.data[m] = arr_conv_12_ref; } LDKPublicKey holder_funding_key_ref; CHECK(holder_funding_key.len == 33); @@ -13174,7 +14613,7 @@ uint32_t Route_1clone(void* ctx_TODO, uint32_t orig) { return ret_ref; } -void Route_1set_1paths(void* ctx_TODO, uint32_t this_ptr, uint32_tArray val) { +void Route_1set_1paths(void* ctx_TODO, uint32_t this_ptr, ptrArray val) { LDKRoute this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; @@ -13208,7 +14647,7 @@ void Route_1set_1paths(void* ctx_TODO, uint32_t this_ptr, uint32_tArray val) { Route_set_paths(&this_ptr_conv, val_constr); } -uint32_t Route_1new(void* ctx_TODO, uint32_tArray paths_arg) { +uint32_t Route_1new(void* ctx_TODO, ptrArray paths_arg) { LDKCVec_CVec_RouteHopZZ paths_arg_constr; paths_arg_constr.datalen = paths_arg.len; if (paths_arg_constr.datalen > 0) @@ -13347,15 +14786,15 @@ void RouteHint_1set_1fees(void* ctx_TODO, uint32_t this_ptr, uint32_t val) { RouteHint_set_fees(&this_ptr_conv, val_conv); } -jshort RouteHint_1get_1cltv_1expiry_1delta(void* ctx_TODO, uint32_t this_ptr) { +int16_t RouteHint_1get_1cltv_1expiry_1delta(void* ctx_TODO, uint32_t this_ptr) { LDKRouteHint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = RouteHint_get_cltv_expiry_delta(&this_ptr_conv); + int16_t ret_val = RouteHint_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } -void RouteHint_1set_1cltv_1expiry_1delta(void* ctx_TODO, uint32_t this_ptr, jshort val) { +void RouteHint_1set_1cltv_1expiry_1delta(void* ctx_TODO, uint32_t this_ptr, int16_t val) { LDKRouteHint this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; @@ -13377,7 +14816,7 @@ void RouteHint_1set_1htlc_1minimum_1msat(void* ctx_TODO, uint32_t this_ptr, int6 RouteHint_set_htlc_minimum_msat(&this_ptr_conv, val); } -uint32_t RouteHint_1new(void* ctx_TODO, int8_tArray src_node_id_arg, int64_t short_channel_id_arg, uint32_t fees_arg, jshort cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg) { +uint32_t RouteHint_1new(void* ctx_TODO, int8_tArray src_node_id_arg, int64_t short_channel_id_arg, uint32_t fees_arg, int16_t cltv_expiry_delta_arg, int64_t htlc_minimum_msat_arg) { LDKPublicKey src_node_id_arg_ref; CHECK(src_node_id_arg.len == 33); memcpy(src_node_id_arg_ref.compressed_form, src_node_id_arg.ptr, 33); @@ -13437,10 +14876,6 @@ uint32_t get_1route(void* ctx_TODO, int8_tArray our_node_id, uint32_t network, i last_hops_constr.data[l] = arr_conv_11_conv; } LDKLogger logger_conv = *(LDKLogger*)logger; - 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); - } LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ"); *ret_conv = get_route(our_node_id_ref, &network_conv, target_ref, &first_hops_constr, last_hops_constr, final_value_msat, final_cltv, logger_conv); FREE(first_hops_constr.data); @@ -13474,10 +14909,6 @@ uint32_t NetGraphMsgHandler_1new(void* ctx_TODO, int8_tArray genesis_hash, uint3 memcpy(genesis_hash_ref.data, genesis_hash.ptr, 32); LDKAccess* chain_access_conv = (LDKAccess*)chain_access; LDKLogger logger_conv = *(LDKLogger*)logger; - 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); - } LDKNetGraphMsgHandler ret_var = NetGraphMsgHandler_new(genesis_hash_ref, chain_access_conv, logger_conv); CHECK((((long)ret_var.inner) & 1) == 0); // We rely on a free low bit, malloc guarantees this. CHECK((((long)&ret_var) & 1) == 0); // We rely on a free low bit, pointer alignment guarantees this. @@ -13491,10 +14922,6 @@ uint32_t NetGraphMsgHandler_1new(void* ctx_TODO, int8_tArray genesis_hash, uint3 uint32_t NetGraphMsgHandler_1from_1net_1graph(void* ctx_TODO, uint32_t chain_access, uint32_t logger, uint32_t network_graph) { LDKAccess* chain_access_conv = (LDKAccess*)chain_access; LDKLogger logger_conv = *(LDKLogger*)logger; - 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); - } LDKNetworkGraph network_graph_conv; network_graph_conv.inner = (void*)(network_graph & (~1)); network_graph_conv.is_owned = (network_graph & 1) || (network_graph == 0); @@ -13592,15 +15019,15 @@ void DirectionalChannelInfo_1set_1enabled(void* ctx_TODO, uint32_t this_ptr, jbo DirectionalChannelInfo_set_enabled(&this_ptr_conv, val); } -jshort DirectionalChannelInfo_1get_1cltv_1expiry_1delta(void* ctx_TODO, uint32_t this_ptr) { +int16_t DirectionalChannelInfo_1get_1cltv_1expiry_1delta(void* ctx_TODO, uint32_t this_ptr) { LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; - jshort ret_val = DirectionalChannelInfo_get_cltv_expiry_delta(&this_ptr_conv); + int16_t ret_val = DirectionalChannelInfo_get_cltv_expiry_delta(&this_ptr_conv); return ret_val; } -void DirectionalChannelInfo_1set_1cltv_1expiry_1delta(void* ctx_TODO, uint32_t this_ptr, jshort val) { +void DirectionalChannelInfo_1set_1cltv_1expiry_1delta(void* ctx_TODO, uint32_t this_ptr, int16_t val) { LDKDirectionalChannelInfo this_ptr_conv; this_ptr_conv.inner = (void*)(this_ptr & (~1)); this_ptr_conv.is_owned = false; @@ -14160,9 +15587,9 @@ void NodeInfo_1set_1channels(void* ctx_TODO, uint32_t this_ptr, int64_tArray val else val_constr.data = NULL; int64_t* val_vals = (int64_t*) val.ptr; - for (size_t g = 0; g < val_constr.datalen; g++) { - int64_t arr_conv_6 = val_vals[g]; - val_constr.data[g] = arr_conv_6; + for (size_t i = 0; i < val_constr.datalen; i++) { + int64_t arr_conv_8 = val_vals[i]; + val_constr.data[i] = arr_conv_8; } NodeInfo_set_channels(&this_ptr_conv, val_constr); } @@ -14226,9 +15653,9 @@ uint32_t NodeInfo_1new(void* ctx_TODO, int64_tArray channels_arg, uint32_t lowes else channels_arg_constr.data = NULL; int64_t* channels_arg_vals = (int64_t*) channels_arg.ptr; - for (size_t g = 0; g < channels_arg_constr.datalen; g++) { - int64_t arr_conv_6 = channels_arg_vals[g]; - channels_arg_constr.data[g] = arr_conv_6; + for (size_t i = 0; i < channels_arg_constr.datalen; i++) { + int64_t arr_conv_8 = channels_arg_vals[i]; + channels_arg_constr.data[i] = arr_conv_8; } LDKRoutingFees lowest_inbound_channel_fees_arg_conv; lowest_inbound_channel_fees_arg_conv.inner = (void*)(lowest_inbound_channel_fees_arg & (~1)); diff --git a/ts/bindings.ts b/ts/bindings.ts index 1bbf6b47..7cd35907 100644 --- a/ts/bindings.ts +++ b/ts/bindings.ts @@ -1,78 +1,94 @@ -package org.ldk.impl; -import org.ldk.enums.*; - -public class bindings { - public static class VecOrSliceDef { - public long dataptr; - public long datalen; - public long stride; - public VecOrSliceDef(long dataptr, long datalen, long stride) { - this.dataptr = dataptr; this.datalen = datalen; this.stride = stride; - } - } - static { - 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); - public static native void free_heap_ptr(long ptr); - public static native byte[] read_bytes(long ptr, long len); - public static native byte[] get_u8_slice_bytes(long slice_ptr); - public static native long bytes_to_u8_vec(byte[] bytes); - public static native long new_txpointer_copy_data(byte[] txdata); - public static native void txpointer_free(long ptr); - public static native byte[] txpointer_get_buffer(long ptr); - public static native long vec_slice_len(long vec); - public static native long new_empty_slice_vec(); - - public static native long LDKCVec_u8Z_new(byte[] elems); - public static native long LDKC2Tuple_u64u64Z_new(long a, long b); - public static native long LDKC2Tuple_u64u64Z_get_a(long ptr); - public static native long LDKC2Tuple_u64u64Z_get_b(long ptr); + +const path = require('path').join(__dirname, 'bindings.wasm'); +const bytes = require('fs').readFileSync(path); +let imports = {}; +// add all exports to dictionary and move down? +// use `module.exports`? +// imports['./bindings.js'] = require('./bindings.js'); + +const wasmModule = new WebAssembly.Module(bytes); +const wasmInstance = new WebAssembly.Instance(wasmModule, imports); +// module.exports = wasmInstance.exports; +const wasm = wasmInstance.exports; + +export class VecOrSliceDef { + public dataptr: number; + public datalen: number; + public stride: number; + public constructor(dataptr: number, datalen: number, stride: number) { + this.dataptr = dataptr; + this.datalen = datalen; + this.stride = stride; + } +} + +/* +TODO: load WASM file +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); +public static native void free_heap_ptr(long ptr); +public static native byte[] read_bytes(long ptr, long len); +public static native byte[] get_u8_slice_bytes(long slice_ptr); +public static native long bytes_to_u8_vec(byte[] bytes); +public static native long new_txpointer_copy_data(byte[] txdata); +public static native void txpointer_free(long ptr); +public static native byte[] txpointer_get_buffer(long ptr); +public static native long vec_slice_len(long vec); +public static native long new_empty_slice_vec(); +*/ + + public static native long LDKCVec_u8Z_new(number[] elems); + public static native long LDKC2Tuple_u64u64Z_new(number a, number b); + public static native number LDKC2Tuple_u64u64Z_get_a(long ptr); + public static native number LDKC2Tuple_u64u64Z_get_b(long ptr); public static class LDKSpendableOutputDescriptor { private LDKSpendableOutputDescriptor() {} export class StaticOutput extends LDKSpendableOutputDescriptor { - public uint32_t outpoint; - public uint32_t output; - StaticOutput(uint32_t outpoint, uint32_t output) { this.outpoint = outpoint; this.output = output; } + public number outpoint; + public number output; + StaticOutput(number outpoint, number output) { this.outpoint = outpoint; this.output = output; } } export class DynamicOutputP2WSH extends LDKSpendableOutputDescriptor { - public uint32_t outpoint; - public byte[] per_commitment_point; - public short to_self_delay; - public uint32_t output; - public uint32_t key_derivation_params; - public byte[] revocation_pubkey; - DynamicOutputP2WSH(uint32_t outpoint, byte[] per_commitment_point, short to_self_delay, uint32_t output, uint32_t key_derivation_params, byte[] revocation_pubkey) { this.outpoint = outpoint; this.per_commitment_point = per_commitment_point; this.to_self_delay = to_self_delay; this.output = output; this.key_derivation_params = key_derivation_params; this.revocation_pubkey = revocation_pubkey; } + public number outpoint; + public Uint8Array per_commitment_point; + public number to_self_delay; + public number output; + public number key_derivation_params; + public Uint8Array revocation_pubkey; + DynamicOutputP2WSH(number outpoint, Uint8Array per_commitment_point, number to_self_delay, number output, number key_derivation_params, Uint8Array revocation_pubkey) { this.outpoint = outpoint; this.per_commitment_point = per_commitment_point; this.to_self_delay = to_self_delay; this.output = output; this.key_derivation_params = key_derivation_params; this.revocation_pubkey = revocation_pubkey; } } export class StaticOutputCounterpartyPayment extends LDKSpendableOutputDescriptor { - public uint32_t outpoint; - public uint32_t output; - public uint32_t key_derivation_params; - StaticOutputCounterpartyPayment(uint32_t outpoint, uint32_t output, uint32_t key_derivation_params) { this.outpoint = outpoint; this.output = output; this.key_derivation_params = key_derivation_params; } + public number outpoint; + public number output; + public number key_derivation_params; + StaticOutputCounterpartyPayment(number outpoint, number output, number key_derivation_params) { this.outpoint = outpoint; this.output = output; this.key_derivation_params = key_derivation_params; } } static native void init(); } static { LDKSpendableOutputDescriptor.init(); } public static native LDKSpendableOutputDescriptor LDKSpendableOutputDescriptor_ref_from_ptr(long ptr); - public static native long LDKCVec_SpendableOutputDescriptorZ_new(uint32_t[] elems); + public static native long LDKCVec_SpendableOutputDescriptorZ_new(number[] elems); public static class LDKErrorAction { private LDKErrorAction() {} export class DisconnectPeer extends LDKErrorAction { - public uint32_t msg; - DisconnectPeer(uint32_t msg) { this.msg = msg; } + public number msg; + DisconnectPeer(number msg) { this.msg = msg; } } export class IgnoreError extends LDKErrorAction { IgnoreError() { } } export class SendErrorMessage extends LDKErrorAction { - public uint32_t msg; - SendErrorMessage(uint32_t msg) { this.msg = msg; } + public number msg; + SendErrorMessage(number msg) { this.msg = msg; } } static native void init(); } @@ -81,18 +97,18 @@ public class bindings { public static class LDKHTLCFailChannelUpdate { private LDKHTLCFailChannelUpdate() {} export class ChannelUpdateMessage extends LDKHTLCFailChannelUpdate { - public uint32_t msg; - ChannelUpdateMessage(uint32_t msg) { this.msg = msg; } + public number msg; + ChannelUpdateMessage(number msg) { this.msg = msg; } } export class ChannelClosed extends LDKHTLCFailChannelUpdate { - public long short_channel_id; + public number short_channel_id; public boolean is_permanent; - ChannelClosed(long short_channel_id, boolean is_permanent) { this.short_channel_id = short_channel_id; this.is_permanent = is_permanent; } + ChannelClosed(number short_channel_id, boolean is_permanent) { this.short_channel_id = short_channel_id; this.is_permanent = is_permanent; } } export class NodeFailure extends LDKHTLCFailChannelUpdate { - public byte[] node_id; + public Uint8Array node_id; public boolean is_permanent; - NodeFailure(byte[] node_id, boolean is_permanent) { this.node_id = node_id; this.is_permanent = is_permanent; } + NodeFailure(Uint8Array node_id, boolean is_permanent) { this.node_id = node_id; this.is_permanent = is_permanent; } } static native void init(); } @@ -101,238 +117,265 @@ public class bindings { public static class LDKMessageSendEvent { private LDKMessageSendEvent() {} export class SendAcceptChannel extends LDKMessageSendEvent { - public byte[] node_id; - public uint32_t msg; - SendAcceptChannel(byte[] node_id, uint32_t msg) { this.node_id = node_id; this.msg = msg; } + public Uint8Array node_id; + public number msg; + SendAcceptChannel(Uint8Array node_id, number msg) { this.node_id = node_id; this.msg = msg; } } export class SendOpenChannel extends LDKMessageSendEvent { - public byte[] node_id; - public uint32_t msg; - SendOpenChannel(byte[] node_id, uint32_t msg) { this.node_id = node_id; this.msg = msg; } + public Uint8Array node_id; + public number msg; + SendOpenChannel(Uint8Array node_id, number msg) { this.node_id = node_id; this.msg = msg; } } export class SendFundingCreated extends LDKMessageSendEvent { - public byte[] node_id; - public uint32_t msg; - SendFundingCreated(byte[] node_id, uint32_t msg) { this.node_id = node_id; this.msg = msg; } + public Uint8Array node_id; + public number msg; + SendFundingCreated(Uint8Array node_id, number msg) { this.node_id = node_id; this.msg = msg; } } export class SendFundingSigned extends LDKMessageSendEvent { - public byte[] node_id; - public uint32_t msg; - SendFundingSigned(byte[] node_id, uint32_t msg) { this.node_id = node_id; this.msg = msg; } + public Uint8Array node_id; + public number msg; + SendFundingSigned(Uint8Array node_id, number msg) { this.node_id = node_id; this.msg = msg; } } export class SendFundingLocked extends LDKMessageSendEvent { - public byte[] node_id; - public uint32_t msg; - SendFundingLocked(byte[] node_id, uint32_t msg) { this.node_id = node_id; this.msg = msg; } + public Uint8Array node_id; + public number msg; + SendFundingLocked(Uint8Array node_id, number msg) { this.node_id = node_id; this.msg = msg; } } export class SendAnnouncementSignatures extends LDKMessageSendEvent { - public byte[] node_id; - public uint32_t msg; - SendAnnouncementSignatures(byte[] node_id, uint32_t msg) { this.node_id = node_id; this.msg = msg; } + public Uint8Array node_id; + public number msg; + SendAnnouncementSignatures(Uint8Array node_id, number msg) { this.node_id = node_id; this.msg = msg; } } export class UpdateHTLCs extends LDKMessageSendEvent { - public byte[] node_id; - public uint32_t updates; - UpdateHTLCs(byte[] node_id, uint32_t updates) { this.node_id = node_id; this.updates = updates; } + public Uint8Array node_id; + public number updates; + UpdateHTLCs(Uint8Array node_id, number updates) { this.node_id = node_id; this.updates = updates; } } export class SendRevokeAndACK extends LDKMessageSendEvent { - public byte[] node_id; - public uint32_t msg; - SendRevokeAndACK(byte[] node_id, uint32_t msg) { this.node_id = node_id; this.msg = msg; } + public Uint8Array node_id; + public number msg; + SendRevokeAndACK(Uint8Array node_id, number msg) { this.node_id = node_id; this.msg = msg; } } export class SendClosingSigned extends LDKMessageSendEvent { - public byte[] node_id; - public uint32_t msg; - SendClosingSigned(byte[] node_id, uint32_t msg) { this.node_id = node_id; this.msg = msg; } + public Uint8Array node_id; + public number msg; + SendClosingSigned(Uint8Array node_id, number msg) { this.node_id = node_id; this.msg = msg; } } export class SendShutdown extends LDKMessageSendEvent { - public byte[] node_id; - public uint32_t msg; - SendShutdown(byte[] node_id, uint32_t msg) { this.node_id = node_id; this.msg = msg; } + public Uint8Array node_id; + public number msg; + SendShutdown(Uint8Array node_id, number msg) { this.node_id = node_id; this.msg = msg; } } export class SendChannelReestablish extends LDKMessageSendEvent { - public byte[] node_id; - public uint32_t msg; - SendChannelReestablish(byte[] node_id, uint32_t msg) { this.node_id = node_id; this.msg = msg; } + public Uint8Array node_id; + public number msg; + SendChannelReestablish(Uint8Array node_id, number msg) { this.node_id = node_id; this.msg = msg; } } export class BroadcastChannelAnnouncement extends LDKMessageSendEvent { - public uint32_t msg; - public uint32_t update_msg; - BroadcastChannelAnnouncement(uint32_t msg, uint32_t update_msg) { this.msg = msg; this.update_msg = update_msg; } + public number msg; + public number update_msg; + BroadcastChannelAnnouncement(number msg, number update_msg) { this.msg = msg; this.update_msg = update_msg; } } export class BroadcastNodeAnnouncement extends LDKMessageSendEvent { - public uint32_t msg; - BroadcastNodeAnnouncement(uint32_t msg) { this.msg = msg; } + public number msg; + BroadcastNodeAnnouncement(number msg) { this.msg = msg; } } export class BroadcastChannelUpdate extends LDKMessageSendEvent { - public uint32_t msg; - BroadcastChannelUpdate(uint32_t msg) { this.msg = msg; } + public number msg; + BroadcastChannelUpdate(number msg) { this.msg = msg; } } export class HandleError extends LDKMessageSendEvent { - public byte[] node_id; - public uint32_t action; - HandleError(byte[] node_id, uint32_t action) { this.node_id = node_id; this.action = action; } + public Uint8Array node_id; + public number action; + HandleError(Uint8Array node_id, number action) { this.node_id = node_id; this.action = action; } } export class PaymentFailureNetworkUpdate extends LDKMessageSendEvent { - public uint32_t update; - PaymentFailureNetworkUpdate(uint32_t update) { this.update = update; } + public number update; + PaymentFailureNetworkUpdate(number update) { this.update = update; } } export class SendChannelRangeQuery extends LDKMessageSendEvent { - public byte[] node_id; - public uint32_t msg; - SendChannelRangeQuery(byte[] node_id, uint32_t msg) { this.node_id = node_id; this.msg = msg; } + public Uint8Array node_id; + public number msg; + SendChannelRangeQuery(Uint8Array node_id, number msg) { this.node_id = node_id; this.msg = msg; } } export class SendShortIdsQuery extends LDKMessageSendEvent { - public byte[] node_id; - public uint32_t msg; - SendShortIdsQuery(byte[] node_id, uint32_t msg) { this.node_id = node_id; this.msg = msg; } + public Uint8Array node_id; + public number msg; + SendShortIdsQuery(Uint8Array node_id, number msg) { this.node_id = node_id; this.msg = msg; } } static native void init(); } static { LDKMessageSendEvent.init(); } public static native LDKMessageSendEvent LDKMessageSendEvent_ref_from_ptr(long ptr); - public static native long LDKCVec_MessageSendEventZ_new(uint32_t[] elems); + public static native long LDKCVec_MessageSendEventZ_new(number[] elems); public static class LDKEvent { private LDKEvent() {} export class FundingGenerationReady extends LDKEvent { - public byte[] temporary_channel_id; - public long channel_value_satoshis; - public byte[] output_script; - public long user_channel_id; - FundingGenerationReady(byte[] temporary_channel_id, long channel_value_satoshis, byte[] output_script, long user_channel_id) { this.temporary_channel_id = temporary_channel_id; this.channel_value_satoshis = channel_value_satoshis; this.output_script = output_script; this.user_channel_id = user_channel_id; } + public Uint8Array temporary_channel_id; + public number channel_value_satoshis; + public Uint8Array output_script; + public number user_channel_id; + FundingGenerationReady(Uint8Array temporary_channel_id, number channel_value_satoshis, Uint8Array output_script, number user_channel_id) { this.temporary_channel_id = temporary_channel_id; this.channel_value_satoshis = channel_value_satoshis; this.output_script = output_script; this.user_channel_id = user_channel_id; } } export class FundingBroadcastSafe extends LDKEvent { - public uint32_t funding_txo; - public long user_channel_id; - FundingBroadcastSafe(uint32_t funding_txo, long user_channel_id) { this.funding_txo = funding_txo; this.user_channel_id = user_channel_id; } + public number funding_txo; + public number user_channel_id; + FundingBroadcastSafe(number funding_txo, number user_channel_id) { this.funding_txo = funding_txo; this.user_channel_id = user_channel_id; } } export class PaymentReceived extends LDKEvent { - public byte[] payment_hash; - public byte[] payment_secret; - public long amt; - PaymentReceived(byte[] payment_hash, byte[] payment_secret, long amt) { this.payment_hash = payment_hash; this.payment_secret = payment_secret; this.amt = amt; } + public Uint8Array payment_hash; + public Uint8Array payment_secret; + public number amt; + PaymentReceived(Uint8Array payment_hash, Uint8Array payment_secret, number amt) { this.payment_hash = payment_hash; this.payment_secret = payment_secret; this.amt = amt; } } export class PaymentSent extends LDKEvent { - public byte[] payment_preimage; - PaymentSent(byte[] payment_preimage) { this.payment_preimage = payment_preimage; } + public Uint8Array payment_preimage; + PaymentSent(Uint8Array payment_preimage) { this.payment_preimage = payment_preimage; } } export class PaymentFailed extends LDKEvent { - public byte[] payment_hash; + public Uint8Array payment_hash; public boolean rejected_by_dest; - PaymentFailed(byte[] payment_hash, boolean rejected_by_dest) { this.payment_hash = payment_hash; this.rejected_by_dest = rejected_by_dest; } + PaymentFailed(Uint8Array payment_hash, boolean rejected_by_dest) { this.payment_hash = payment_hash; this.rejected_by_dest = rejected_by_dest; } } export class PendingHTLCsForwardable extends LDKEvent { - public long time_forwardable; - PendingHTLCsForwardable(long time_forwardable) { this.time_forwardable = time_forwardable; } + public number time_forwardable; + PendingHTLCsForwardable(number time_forwardable) { this.time_forwardable = time_forwardable; } } export class SpendableOutputs extends LDKEvent { - public uint32_t[] outputs; - SpendableOutputs(uint32_t[] outputs) { this.outputs = outputs; } + public number[] outputs; + SpendableOutputs(number[] outputs) { this.outputs = outputs; } } static native void init(); } static { LDKEvent.init(); } public static native LDKEvent LDKEvent_ref_from_ptr(long ptr); - public static native long LDKCVec_EventZ_new(uint32_t[] elems); - public static native long LDKC2Tuple_usizeTransactionZ_new(long a, byte[] b); - public static native long LDKC2Tuple_usizeTransactionZ_get_a(long ptr); - public static native byte[] LDKC2Tuple_usizeTransactionZ_get_b(long ptr); - public static native long LDKCVec_C2Tuple_usizeTransactionZZ_new(uint32_t[] elems); + public static native long LDKCVec_EventZ_new(number[] elems); + public static native long LDKC2Tuple_usizeTransactionZ_new(number a, Uint8Array b); + public static native number LDKC2Tuple_usizeTransactionZ_get_a(long ptr); + public static native Uint8Array LDKC2Tuple_usizeTransactionZ_get_b(long ptr); + public static native long LDKCVec_C2Tuple_usizeTransactionZZ_new(number[] elems); public static native boolean LDKCResult_NoneChannelMonitorUpdateErrZ_result_ok(long arg); public static native void LDKCResult_NoneChannelMonitorUpdateErrZ_get_ok(long arg); public static native LDKChannelMonitorUpdateErr LDKCResult_NoneChannelMonitorUpdateErrZ_get_err(long arg); - public static native long LDKCVec_MonitorEventZ_new(uint32_t[] elems); + public static native long LDKCVec_MonitorEventZ_new(number[] elems); public static native boolean LDKCResult_ChannelMonitorUpdateDecodeErrorZ_result_ok(long arg); - public static native uint32_t LDKCResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(long arg); - public static native uint32_t LDKCResult_ChannelMonitorUpdateDecodeErrorZ_get_err(long arg); + public static native number LDKCResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_ChannelMonitorUpdateDecodeErrorZ_get_err(long arg); public static native boolean LDKCResult_NoneMonitorUpdateErrorZ_result_ok(long arg); public static native void LDKCResult_NoneMonitorUpdateErrorZ_get_ok(long arg); - public static native uint32_t LDKCResult_NoneMonitorUpdateErrorZ_get_err(long arg); - public static native long LDKC2Tuple_OutPointScriptZ_new(uint32_t a, byte[] b); - public static native uint32_t LDKC2Tuple_OutPointScriptZ_get_a(long ptr); - public static native byte[] LDKC2Tuple_OutPointScriptZ_get_b(long ptr); - public static native long LDKC2Tuple_u32TxOutZ_new(int a, uint32_t b); - public static native int LDKC2Tuple_u32TxOutZ_get_a(long ptr); - public static native uint32_t LDKC2Tuple_u32TxOutZ_get_b(long ptr); - public static native long LDKCVec_C2Tuple_u32TxOutZZ_new(uint32_t[] elems); - public static native long LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(byte[] a, uint32_t[] b); - public static native byte[] LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(long ptr); - public static native uint32_t[] LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(long ptr); - public static native long LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_new(uint32_t[] elems); - public static native long LDKC2Tuple_SignatureCVec_SignatureZZ_new(byte[] a, byte[][] b); - public static native byte[] LDKC2Tuple_SignatureCVec_SignatureZZ_get_a(long ptr); - public static native byte[][] LDKC2Tuple_SignatureCVec_SignatureZZ_get_b(long ptr); + public static native number LDKCResult_NoneMonitorUpdateErrorZ_get_err(long arg); + public static native long LDKC2Tuple_OutPointScriptZ_new(number a, Uint8Array b); + public static native number LDKC2Tuple_OutPointScriptZ_get_a(long ptr); + public static native Uint8Array LDKC2Tuple_OutPointScriptZ_get_b(long ptr); + public static native long LDKC2Tuple_u32TxOutZ_new(number a, number b); + public static native number LDKC2Tuple_u32TxOutZ_get_a(long ptr); + public static native number LDKC2Tuple_u32TxOutZ_get_b(long ptr); + public static native long LDKCVec_C2Tuple_u32TxOutZZ_new(number[] elems); + public static native long LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(Uint8Array a, number[] b); + public static native Uint8Array LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(long ptr); + public static native number[] LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(long ptr); + public static native long LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_new(number[] elems); + public static native long LDKC2Tuple_SignatureCVec_SignatureZZ_new(Uint8Array a, Uint8Array[] b); + public static native Uint8Array LDKC2Tuple_SignatureCVec_SignatureZZ_get_a(long ptr); + public static native Uint8Array[] LDKC2Tuple_SignatureCVec_SignatureZZ_get_b(long ptr); public static native boolean LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_result_ok(long arg); - public static native uint32_t LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(long arg); + public static native number LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(long arg); public static native void LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(long arg); public static native boolean LDKCResult_SignatureNoneZ_result_ok(long arg); - public static native byte[] LDKCResult_SignatureNoneZ_get_ok(long arg); + public static native Uint8Array LDKCResult_SignatureNoneZ_get_ok(long arg); public static native void LDKCResult_SignatureNoneZ_get_err(long arg); public static native boolean LDKCResult_CVec_SignatureZNoneZ_result_ok(long arg); - public static native byte[][] LDKCResult_CVec_SignatureZNoneZ_get_ok(long arg); + public static native Uint8Array[] LDKCResult_CVec_SignatureZNoneZ_get_ok(long arg); public static native void LDKCResult_CVec_SignatureZNoneZ_get_err(long arg); + + + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START + + export interface LDKChannelKeys { + get_per_commitment_point (idx: number): Uint8Array; + release_commitment_secret (idx: number): Uint8Array; + key_derivation_params (): number; + sign_counterparty_commitment (commitment_tx: number): number; + sign_holder_commitment (commitment_tx: number): number; + sign_holder_commitment_htlc_transactions (commitment_tx: number): number; + sign_justice_transaction (justice_tx: Uint8Array, input: number, amount: number, per_commitment_key: Uint8Array, htlc: number): number; + sign_counterparty_htlc_transaction (htlc_tx: Uint8Array, input: number, amount: number, per_commitment_point: Uint8Array, htlc: number): number; + sign_closing_transaction (closing_tx: Uint8Array): number; + sign_channel_announcement (msg: number): number; + ready_channel (channel_parameters: number): void; + write (): Uint8Array; + } + + export function LDKChannelKeys_new(impl: LDKChannelKeys, pubkeys: number): number { + throw new Error('unimplemented'); // TODO: bind to WASM + } + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END + + // LDKPublicKey ChannelKeys_get_per_commitment_point LDKChannelKeys* this_arg, uint64_t idx - public static native byte[] ChannelKeys_get_per_commitment_point(uint32_t this_arg, long idx); + public static native Uint8Array ChannelKeys_get_per_commitment_point(number this_arg, number idx); // LDKThirtyTwoBytes ChannelKeys_release_commitment_secret LDKChannelKeys* this_arg, uint64_t idx - public static native byte[] ChannelKeys_release_commitment_secret(uint32_t this_arg, long idx); + public static native Uint8Array ChannelKeys_release_commitment_secret(number this_arg, number idx); // LDKC2Tuple_u64u64Z ChannelKeys_key_derivation_params LDKChannelKeys* this_arg - public static native uint32_t ChannelKeys_key_derivation_params(uint32_t this_arg); + public static native number ChannelKeys_key_derivation_params(number this_arg); // LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ChannelKeys_sign_counterparty_commitment LDKChannelKeys* this_arg, const struct LDKCommitmentTransaction *NONNULL_PTR commitment_tx - public static native uint32_t ChannelKeys_sign_counterparty_commitment(uint32_t this_arg, uint32_t commitment_tx); + public static native number ChannelKeys_sign_counterparty_commitment(number this_arg, number commitment_tx); // LDKCResult_SignatureNoneZ ChannelKeys_sign_holder_commitment LDKChannelKeys* this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx - public static native uint32_t ChannelKeys_sign_holder_commitment(uint32_t this_arg, uint32_t commitment_tx); + public static native number ChannelKeys_sign_holder_commitment(number this_arg, number commitment_tx); // LDKCResult_CVec_SignatureZNoneZ ChannelKeys_sign_holder_commitment_htlc_transactions LDKChannelKeys* this_arg, const struct LDKHolderCommitmentTransaction *NONNULL_PTR commitment_tx - public static native uint32_t ChannelKeys_sign_holder_commitment_htlc_transactions(uint32_t this_arg, uint32_t commitment_tx); + public static native number ChannelKeys_sign_holder_commitment_htlc_transactions(number this_arg, number commitment_tx); // LDKCResult_SignatureNoneZ ChannelKeys_sign_justice_transaction LDKChannelKeys* this_arg, struct LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (*per_commitment_key)[32], const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc - public static native uint32_t ChannelKeys_sign_justice_transaction(uint32_t this_arg, byte[] justice_tx, long input, long amount, byte[] per_commitment_key, uint32_t htlc); + public static native number ChannelKeys_sign_justice_transaction(number this_arg, Uint8Array justice_tx, number input, number amount, Uint8Array per_commitment_key, number htlc); // LDKCResult_SignatureNoneZ ChannelKeys_sign_counterparty_htlc_transaction LDKChannelKeys* this_arg, struct LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, struct LDKPublicKey per_commitment_point, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc - public static native uint32_t ChannelKeys_sign_counterparty_htlc_transaction(uint32_t this_arg, byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, uint32_t htlc); + public static native number ChannelKeys_sign_counterparty_htlc_transaction(number this_arg, Uint8Array htlc_tx, number input, number amount, Uint8Array per_commitment_point, number htlc); // LDKCResult_SignatureNoneZ ChannelKeys_sign_closing_transaction LDKChannelKeys* this_arg, struct LDKTransaction closing_tx - public static native uint32_t ChannelKeys_sign_closing_transaction(uint32_t this_arg, byte[] closing_tx); + public static native number ChannelKeys_sign_closing_transaction(number this_arg, Uint8Array closing_tx); // LDKCResult_SignatureNoneZ ChannelKeys_sign_channel_announcement LDKChannelKeys* this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg - public static native uint32_t ChannelKeys_sign_channel_announcement(uint32_t this_arg, uint32_t msg); + public static native number ChannelKeys_sign_channel_announcement(number this_arg, number msg); // void ChannelKeys_ready_channel LDKChannelKeys* this_arg, const struct LDKChannelTransactionParameters *NONNULL_PTR channel_parameters - public static native void ChannelKeys_ready_channel(uint32_t this_arg, uint32_t channel_parameters); + public static native void ChannelKeys_ready_channel(number this_arg, number channel_parameters); // LDKCVec_u8Z ChannelKeys_write LDKChannelKeys* this_arg - public static native byte[] ChannelKeys_write(uint32_t this_arg); + public static native Uint8Array ChannelKeys_write(number this_arg); // LDKChannelPublicKeys ChannelKeys_get_pubkeys LDKChannelKeys* this_arg - public static native uint32_t ChannelKeys_get_pubkeys(uint32_t this_arg); - public static native long LDKC2Tuple_BlockHashChannelMonitorZ_new(byte[] a, uint32_t b); - public static native byte[] LDKC2Tuple_BlockHashChannelMonitorZ_get_a(long ptr); - public static native uint32_t LDKC2Tuple_BlockHashChannelMonitorZ_get_b(long ptr); + public static native number ChannelKeys_get_pubkeys(number this_arg); + public static native long LDKC2Tuple_BlockHashChannelMonitorZ_new(Uint8Array a, number b); + public static native Uint8Array LDKC2Tuple_BlockHashChannelMonitorZ_get_a(long ptr); + public static native number LDKC2Tuple_BlockHashChannelMonitorZ_get_b(long ptr); public static native boolean LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_result_ok(long arg); - public static native uint32_t LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(long arg); - public static native uint32_t LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(long arg); + public static native number LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(long arg); public static native boolean LDKCResult_SpendableOutputDescriptorDecodeErrorZ_result_ok(long arg); - public static native uint32_t LDKCResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(long arg); - public static native uint32_t LDKCResult_SpendableOutputDescriptorDecodeErrorZ_get_err(long arg); + public static native number LDKCResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_SpendableOutputDescriptorDecodeErrorZ_get_err(long arg); public static native boolean LDKCResult_ChanKeySignerDecodeErrorZ_result_ok(long arg); - public static native uint32_t LDKCResult_ChanKeySignerDecodeErrorZ_get_ok(long arg); - public static native uint32_t LDKCResult_ChanKeySignerDecodeErrorZ_get_err(long arg); + public static native number LDKCResult_ChanKeySignerDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_ChanKeySignerDecodeErrorZ_get_err(long arg); public static native boolean LDKCResult_InMemoryChannelKeysDecodeErrorZ_result_ok(long arg); - public static native uint32_t LDKCResult_InMemoryChannelKeysDecodeErrorZ_get_ok(long arg); - public static native uint32_t LDKCResult_InMemoryChannelKeysDecodeErrorZ_get_err(long arg); + public static native number LDKCResult_InMemoryChannelKeysDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_InMemoryChannelKeysDecodeErrorZ_get_err(long arg); public static native boolean LDKCResult_TxOutAccessErrorZ_result_ok(long arg); - public static native uint32_t LDKCResult_TxOutAccessErrorZ_get_ok(long arg); + public static native number LDKCResult_TxOutAccessErrorZ_get_ok(long arg); public static native LDKAccessError LDKCResult_TxOutAccessErrorZ_get_err(long arg); public static class LDKAPIError { private LDKAPIError() {} export class APIMisuseError extends LDKAPIError { - public byte[] err; - APIMisuseError(byte[] err) { this.err = err; } + public Uint8Array err; + APIMisuseError(Uint8Array err) { this.err = err; } } export class FeeRateTooHigh extends LDKAPIError { - public byte[] err; - public int feerate; - FeeRateTooHigh(byte[] err, int feerate) { this.err = err; this.feerate = feerate; } + public Uint8Array err; + public number feerate; + FeeRateTooHigh(Uint8Array err, number feerate) { this.err = err; this.feerate = feerate; } } export class RouteError extends LDKAPIError { public String err; RouteError(String err) { this.err = err; } } export class ChannelUnavailable extends LDKAPIError { - public byte[] err; - ChannelUnavailable(byte[] err) { this.err = err; } + public Uint8Array err; + ChannelUnavailable(Uint8Array err) { this.err = err; } } export class MonitorUpdateFailed extends LDKAPIError { MonitorUpdateFailed() { } @@ -343,2390 +386,2638 @@ public class bindings { public static native LDKAPIError LDKAPIError_ref_from_ptr(long ptr); public static native boolean LDKCResult_NoneAPIErrorZ_result_ok(long arg); public static native void LDKCResult_NoneAPIErrorZ_get_ok(long arg); - public static native uint32_t LDKCResult_NoneAPIErrorZ_get_err(long arg); - public static native long LDKCVec_ChannelDetailsZ_new(uint32_t[] elems); + public static native number LDKCResult_NoneAPIErrorZ_get_err(long arg); + public static native long LDKCVec_ChannelDetailsZ_new(number[] elems); public static native boolean LDKCResult_NonePaymentSendFailureZ_result_ok(long arg); public static native void LDKCResult_NonePaymentSendFailureZ_get_ok(long arg); - public static native uint32_t LDKCResult_NonePaymentSendFailureZ_get_err(long arg); + public static native number LDKCResult_NonePaymentSendFailureZ_get_err(long arg); public static class LDKNetAddress { private LDKNetAddress() {} export class IPv4 extends LDKNetAddress { - public byte[] addr; - public short port; - IPv4(byte[] addr, short port) { this.addr = addr; this.port = port; } + public Uint8Array addr; + public number port; + IPv4(Uint8Array addr, number port) { this.addr = addr; this.port = port; } } export class IPv6 extends LDKNetAddress { - public byte[] addr; - public short port; - IPv6(byte[] addr, short port) { this.addr = addr; this.port = port; } + public Uint8Array addr; + public number port; + IPv6(Uint8Array addr, number port) { this.addr = addr; this.port = port; } } export class OnionV2 extends LDKNetAddress { - public byte[] addr; - public short port; - OnionV2(byte[] addr, short port) { this.addr = addr; this.port = port; } + public Uint8Array addr; + public number port; + OnionV2(Uint8Array addr, number port) { this.addr = addr; this.port = port; } } export class OnionV3 extends LDKNetAddress { - public byte[] ed25519_pubkey; - public short checksum; - public byte version; - public short port; - OnionV3(byte[] ed25519_pubkey, short checksum, byte version, short port) { this.ed25519_pubkey = ed25519_pubkey; this.checksum = checksum; this.version = version; this.port = port; } + public Uint8Array ed25519_pubkey; + public number checksum; + public number version; + public number port; + OnionV3(Uint8Array ed25519_pubkey, number checksum, number version, number port) { this.ed25519_pubkey = ed25519_pubkey; this.checksum = checksum; this.version = version; this.port = port; } } static native void init(); } static { LDKNetAddress.init(); } public static native LDKNetAddress LDKNetAddress_ref_from_ptr(long ptr); - public static native long LDKCVec_NetAddressZ_new(uint32_t[] elems); - public static native long LDKCVec_ChannelMonitorZ_new(uint32_t[] elems); + public static native long LDKCVec_NetAddressZ_new(number[] elems); + public static native long LDKCVec_ChannelMonitorZ_new(number[] elems); + + + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START + + export interface LDKWatch { + watch_channel (funding_txo: number, monitor: number): number; + update_channel (funding_txo: number, update: number): number; + release_pending_monitor_events (): number[]; + } + + export function LDKWatch_new(impl: LDKWatch): number { + throw new Error('unimplemented'); // TODO: bind to WASM + } + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END + + // LDKCResult_NoneChannelMonitorUpdateErrZ Watch_watch_channel LDKWatch* this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitor monitor - public static native uint32_t Watch_watch_channel(uint32_t this_arg, uint32_t funding_txo, uint32_t monitor); + public static native number Watch_watch_channel(number this_arg, number funding_txo, number monitor); // LDKCResult_NoneChannelMonitorUpdateErrZ Watch_update_channel LDKWatch* this_arg, struct LDKOutPoint funding_txo, struct LDKChannelMonitorUpdate update - public static native uint32_t Watch_update_channel(uint32_t this_arg, uint32_t funding_txo, uint32_t update); + public static native number Watch_update_channel(number this_arg, number funding_txo, number update); // LDKCVec_MonitorEventZ Watch_release_pending_monitor_events LDKWatch* this_arg - public static native uint32_t[] Watch_release_pending_monitor_events(uint32_t this_arg); + public static native number[] Watch_release_pending_monitor_events(number this_arg); + + + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START + + export interface LDKBroadcasterInterface { + broadcast_transaction (tx: Uint8Array): void; + } + + export function LDKBroadcasterInterface_new(impl: LDKBroadcasterInterface): number { + throw new Error('unimplemented'); // TODO: bind to WASM + } + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END + + // void BroadcasterInterface_broadcast_transaction LDKBroadcasterInterface* this_arg, struct LDKTransaction tx - public static native void BroadcasterInterface_broadcast_transaction(uint32_t this_arg, byte[] tx); + public static native void BroadcasterInterface_broadcast_transaction(number this_arg, Uint8Array tx); + + + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START + + export interface LDKKeysInterface { + get_node_secret (): Uint8Array; + get_destination_script (): Uint8Array; + get_shutdown_pubkey (): Uint8Array; + get_channel_keys (inbound: boolean, channel_value_satoshis: number): number; + get_secure_random_bytes (): Uint8Array; + read_chan_signer (reader: Uint8Array): number; + } + + export function LDKKeysInterface_new(impl: LDKKeysInterface): number { + throw new Error('unimplemented'); // TODO: bind to WASM + } + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END + + // LDKSecretKey KeysInterface_get_node_secret LDKKeysInterface* this_arg - public static native byte[] KeysInterface_get_node_secret(uint32_t this_arg); + public static native Uint8Array KeysInterface_get_node_secret(number this_arg); // LDKCVec_u8Z KeysInterface_get_destination_script LDKKeysInterface* this_arg - public static native byte[] KeysInterface_get_destination_script(uint32_t this_arg); + public static native Uint8Array KeysInterface_get_destination_script(number this_arg); // LDKPublicKey KeysInterface_get_shutdown_pubkey LDKKeysInterface* this_arg - public static native byte[] KeysInterface_get_shutdown_pubkey(uint32_t this_arg); + public static native Uint8Array KeysInterface_get_shutdown_pubkey(number this_arg); // LDKChannelKeys KeysInterface_get_channel_keys LDKKeysInterface* this_arg, bool inbound, uint64_t channel_value_satoshis - public static native uint32_t KeysInterface_get_channel_keys(uint32_t this_arg, boolean inbound, long channel_value_satoshis); + public static native number KeysInterface_get_channel_keys(number this_arg, boolean inbound, number channel_value_satoshis); // LDKThirtyTwoBytes KeysInterface_get_secure_random_bytes LDKKeysInterface* this_arg - public static native byte[] KeysInterface_get_secure_random_bytes(uint32_t this_arg); + public static native Uint8Array KeysInterface_get_secure_random_bytes(number this_arg); // LDKCResult_ChanKeySignerDecodeErrorZ KeysInterface_read_chan_signer LDKKeysInterface* this_arg, struct LDKu8slice reader - public static native uint32_t KeysInterface_read_chan_signer(uint32_t this_arg, byte[] reader); + public static native number KeysInterface_read_chan_signer(number this_arg, Uint8Array reader); + + + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START + + export interface LDKFeeEstimator { + get_est_sat_per_1000_weight (confirmation_target: LDKConfirmationTarget): number; + } + + export function LDKFeeEstimator_new(impl: LDKFeeEstimator): number { + throw new Error('unimplemented'); // TODO: bind to WASM + } + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END + + // uint32_t FeeEstimator_get_est_sat_per_1000_weight LDKFeeEstimator* this_arg, enum LDKConfirmationTarget confirmation_target - public static native int FeeEstimator_get_est_sat_per_1000_weight(uint32_t this_arg, LDKConfirmationTarget confirmation_target); - public static native long LDKC2Tuple_BlockHashChannelManagerZ_new(byte[] a, uint32_t b); - public static native byte[] LDKC2Tuple_BlockHashChannelManagerZ_get_a(long ptr); - public static native uint32_t LDKC2Tuple_BlockHashChannelManagerZ_get_b(long ptr); + public static native number FeeEstimator_get_est_sat_per_1000_weight(number this_arg, LDKConfirmationTarget confirmation_target); + + + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START + + export interface LDKLogger { + log (record: String): void; + } + + export function LDKLogger_new(impl: LDKLogger): number { + throw new Error('unimplemented'); // TODO: bind to WASM + } + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END + + + public static native long LDKC2Tuple_BlockHashChannelManagerZ_new(Uint8Array a, number b); + public static native Uint8Array LDKC2Tuple_BlockHashChannelManagerZ_get_a(long ptr); + public static native number LDKC2Tuple_BlockHashChannelManagerZ_get_b(long ptr); public static native boolean LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_result_ok(long arg); - public static native uint32_t LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(long arg); - public static native uint32_t LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(long arg); + public static native number LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(long arg); public static native boolean LDKCResult_NetAddressu8Z_result_ok(long arg); - public static native uint32_t LDKCResult_NetAddressu8Z_get_ok(long arg); - public static native byte LDKCResult_NetAddressu8Z_get_err(long arg); + public static native number LDKCResult_NetAddressu8Z_get_ok(long arg); + public static native number LDKCResult_NetAddressu8Z_get_err(long arg); public static native boolean LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_result_ok(long arg); - public static native uint32_t LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_get_ok(long arg); - public static native uint32_t LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_get_err(long arg); - public static native long LDKCVec_u64Z_new(long[] elems); - public static native long LDKCVec_UpdateAddHTLCZ_new(uint32_t[] elems); - public static native long LDKCVec_UpdateFulfillHTLCZ_new(uint32_t[] elems); - public static native long LDKCVec_UpdateFailHTLCZ_new(uint32_t[] elems); - public static native long LDKCVec_UpdateFailMalformedHTLCZ_new(uint32_t[] elems); + public static native number LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_get_err(long arg); + public static native long LDKCVec_u64Z_new(number[] elems); + public static native long LDKCVec_UpdateAddHTLCZ_new(number[] elems); + public static native long LDKCVec_UpdateFulfillHTLCZ_new(number[] elems); + public static native long LDKCVec_UpdateFailHTLCZ_new(number[] elems); + public static native long LDKCVec_UpdateFailMalformedHTLCZ_new(number[] elems); public static native boolean LDKCResult_boolLightningErrorZ_result_ok(long arg); public static native boolean LDKCResult_boolLightningErrorZ_get_ok(long arg); - public static native uint32_t LDKCResult_boolLightningErrorZ_get_err(long arg); - public static native long LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(uint32_t a, uint32_t b, uint32_t c); - public static native uint32_t LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(long ptr); - public static native uint32_t LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(long ptr); - public static native uint32_t LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(long ptr); - public static native long LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_new(uint32_t[] elems); - public static native long LDKCVec_NodeAnnouncementZ_new(uint32_t[] elems); + public static native number LDKCResult_boolLightningErrorZ_get_err(long arg); + public static native long LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(number a, number b, number c); + public static native number LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(long ptr); + public static native number LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(long ptr); + public static native number LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(long ptr); + public static native long LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_new(number[] elems); + public static native long LDKCVec_NodeAnnouncementZ_new(number[] elems); public static native boolean LDKCResult_NoneLightningErrorZ_result_ok(long arg); public static native void LDKCResult_NoneLightningErrorZ_get_ok(long arg); - public static native uint32_t LDKCResult_NoneLightningErrorZ_get_err(long arg); + public static native number LDKCResult_NoneLightningErrorZ_get_err(long arg); public static native boolean LDKCResult_ChannelReestablishDecodeErrorZ_result_ok(long arg); - public static native uint32_t LDKCResult_ChannelReestablishDecodeErrorZ_get_ok(long arg); - public static native uint32_t LDKCResult_ChannelReestablishDecodeErrorZ_get_err(long arg); + public static native number LDKCResult_ChannelReestablishDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_ChannelReestablishDecodeErrorZ_get_err(long arg); public static native boolean LDKCResult_InitDecodeErrorZ_result_ok(long arg); - public static native uint32_t LDKCResult_InitDecodeErrorZ_get_ok(long arg); - public static native uint32_t LDKCResult_InitDecodeErrorZ_get_err(long arg); + public static native number LDKCResult_InitDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_InitDecodeErrorZ_get_err(long arg); public static native boolean LDKCResult_PingDecodeErrorZ_result_ok(long arg); - public static native uint32_t LDKCResult_PingDecodeErrorZ_get_ok(long arg); - public static native uint32_t LDKCResult_PingDecodeErrorZ_get_err(long arg); + public static native number LDKCResult_PingDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_PingDecodeErrorZ_get_err(long arg); public static native boolean LDKCResult_PongDecodeErrorZ_result_ok(long arg); - public static native uint32_t LDKCResult_PongDecodeErrorZ_get_ok(long arg); - public static native uint32_t LDKCResult_PongDecodeErrorZ_get_err(long arg); + public static native number LDKCResult_PongDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_PongDecodeErrorZ_get_err(long arg); public static native boolean LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_result_ok(long arg); - public static native uint32_t LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(long arg); - public static native uint32_t LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(long arg); + public static native number LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(long arg); public static native boolean LDKCResult_UnsignedChannelUpdateDecodeErrorZ_result_ok(long arg); - public static native uint32_t LDKCResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(long arg); - public static native uint32_t LDKCResult_UnsignedChannelUpdateDecodeErrorZ_get_err(long arg); + public static native number LDKCResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_UnsignedChannelUpdateDecodeErrorZ_get_err(long arg); public static native boolean LDKCResult_ErrorMessageDecodeErrorZ_result_ok(long arg); - public static native uint32_t LDKCResult_ErrorMessageDecodeErrorZ_get_ok(long arg); - public static native uint32_t LDKCResult_ErrorMessageDecodeErrorZ_get_err(long arg); + public static native number LDKCResult_ErrorMessageDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_ErrorMessageDecodeErrorZ_get_err(long arg); public static native boolean LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_result_ok(long arg); - public static native uint32_t LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(long arg); - public static native uint32_t LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(long arg); + public static native number LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(long arg); public static native boolean LDKCResult_QueryShortChannelIdsDecodeErrorZ_result_ok(long arg); - public static native uint32_t LDKCResult_QueryShortChannelIdsDecodeErrorZ_get_ok(long arg); - public static native uint32_t LDKCResult_QueryShortChannelIdsDecodeErrorZ_get_err(long arg); + public static native number LDKCResult_QueryShortChannelIdsDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_QueryShortChannelIdsDecodeErrorZ_get_err(long arg); public static native boolean LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_result_ok(long arg); - public static native uint32_t LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(long arg); - public static native uint32_t LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(long arg); + public static native number LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(long arg); public static native boolean LDKCResult_QueryChannelRangeDecodeErrorZ_result_ok(long arg); - public static native uint32_t LDKCResult_QueryChannelRangeDecodeErrorZ_get_ok(long arg); - public static native uint32_t LDKCResult_QueryChannelRangeDecodeErrorZ_get_err(long arg); + public static native number LDKCResult_QueryChannelRangeDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_QueryChannelRangeDecodeErrorZ_get_err(long arg); public static native boolean LDKCResult_ReplyChannelRangeDecodeErrorZ_result_ok(long arg); - public static native uint32_t LDKCResult_ReplyChannelRangeDecodeErrorZ_get_ok(long arg); - public static native uint32_t LDKCResult_ReplyChannelRangeDecodeErrorZ_get_err(long arg); + public static native number LDKCResult_ReplyChannelRangeDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_ReplyChannelRangeDecodeErrorZ_get_err(long arg); public static native boolean LDKCResult_GossipTimestampFilterDecodeErrorZ_result_ok(long arg); - public static native uint32_t LDKCResult_GossipTimestampFilterDecodeErrorZ_get_ok(long arg); - public static native uint32_t LDKCResult_GossipTimestampFilterDecodeErrorZ_get_err(long arg); + public static native number LDKCResult_GossipTimestampFilterDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_GossipTimestampFilterDecodeErrorZ_get_err(long arg); public static native boolean LDKCResult_CVec_u8ZPeerHandleErrorZ_result_ok(long arg); - public static native byte[] LDKCResult_CVec_u8ZPeerHandleErrorZ_get_ok(long arg); - public static native uint32_t LDKCResult_CVec_u8ZPeerHandleErrorZ_get_err(long arg); + public static native Uint8Array LDKCResult_CVec_u8ZPeerHandleErrorZ_get_ok(long arg); + public static native number LDKCResult_CVec_u8ZPeerHandleErrorZ_get_err(long arg); public static native boolean LDKCResult_NonePeerHandleErrorZ_result_ok(long arg); public static native void LDKCResult_NonePeerHandleErrorZ_get_ok(long arg); - public static native uint32_t LDKCResult_NonePeerHandleErrorZ_get_err(long arg); + public static native number LDKCResult_NonePeerHandleErrorZ_get_err(long arg); public static native boolean LDKCResult_boolPeerHandleErrorZ_result_ok(long arg); public static native boolean LDKCResult_boolPeerHandleErrorZ_get_ok(long arg); - public static native uint32_t LDKCResult_boolPeerHandleErrorZ_get_err(long arg); + public static native number LDKCResult_boolPeerHandleErrorZ_get_err(long arg); public static native boolean LDKCResult_SecretKeySecpErrorZ_result_ok(long arg); - public static native byte[] LDKCResult_SecretKeySecpErrorZ_get_ok(long arg); + public static native Uint8Array LDKCResult_SecretKeySecpErrorZ_get_ok(long arg); public static native LDKSecp256k1Error LDKCResult_SecretKeySecpErrorZ_get_err(long arg); public static native boolean LDKCResult_PublicKeySecpErrorZ_result_ok(long arg); - public static native byte[] LDKCResult_PublicKeySecpErrorZ_get_ok(long arg); + public static native Uint8Array LDKCResult_PublicKeySecpErrorZ_get_ok(long arg); public static native LDKSecp256k1Error LDKCResult_PublicKeySecpErrorZ_get_err(long arg); public static native boolean LDKCResult_TxCreationKeysSecpErrorZ_result_ok(long arg); - public static native uint32_t LDKCResult_TxCreationKeysSecpErrorZ_get_ok(long arg); + public static native number LDKCResult_TxCreationKeysSecpErrorZ_get_ok(long arg); public static native LDKSecp256k1Error LDKCResult_TxCreationKeysSecpErrorZ_get_err(long arg); public static native boolean LDKCResult_TrustedCommitmentTransactionNoneZ_result_ok(long arg); - public static native uint32_t LDKCResult_TrustedCommitmentTransactionNoneZ_get_ok(long arg); + public static native number LDKCResult_TrustedCommitmentTransactionNoneZ_get_ok(long arg); public static native void LDKCResult_TrustedCommitmentTransactionNoneZ_get_err(long arg); - public static native long LDKCVec_RouteHopZ_new(uint32_t[] elems); + public static native long LDKCVec_RouteHopZ_new(number[] elems); public static native boolean LDKCResult_RouteDecodeErrorZ_result_ok(long arg); - public static native uint32_t LDKCResult_RouteDecodeErrorZ_get_ok(long arg); - public static native uint32_t LDKCResult_RouteDecodeErrorZ_get_err(long arg); - public static native long LDKCVec_RouteHintZ_new(uint32_t[] elems); + public static native number LDKCResult_RouteDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_RouteDecodeErrorZ_get_err(long arg); + public static native long LDKCVec_RouteHintZ_new(number[] elems); public static native boolean LDKCResult_RouteLightningErrorZ_result_ok(long arg); - public static native uint32_t LDKCResult_RouteLightningErrorZ_get_ok(long arg); - public static native uint32_t LDKCResult_RouteLightningErrorZ_get_err(long arg); + public static native number LDKCResult_RouteLightningErrorZ_get_ok(long arg); + public static native number LDKCResult_RouteLightningErrorZ_get_err(long arg); public static native boolean LDKCResult_RoutingFeesDecodeErrorZ_result_ok(long arg); - public static native uint32_t LDKCResult_RoutingFeesDecodeErrorZ_get_ok(long arg); - public static native uint32_t LDKCResult_RoutingFeesDecodeErrorZ_get_err(long arg); + public static native number LDKCResult_RoutingFeesDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_RoutingFeesDecodeErrorZ_get_err(long arg); public static native boolean LDKCResult_NodeAnnouncementInfoDecodeErrorZ_result_ok(long arg); - public static native uint32_t LDKCResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(long arg); - public static native uint32_t LDKCResult_NodeAnnouncementInfoDecodeErrorZ_get_err(long arg); + public static native number LDKCResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_NodeAnnouncementInfoDecodeErrorZ_get_err(long arg); public static native boolean LDKCResult_NodeInfoDecodeErrorZ_result_ok(long arg); - public static native uint32_t LDKCResult_NodeInfoDecodeErrorZ_get_ok(long arg); - public static native uint32_t LDKCResult_NodeInfoDecodeErrorZ_get_err(long arg); + public static native number LDKCResult_NodeInfoDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_NodeInfoDecodeErrorZ_get_err(long arg); public static native boolean LDKCResult_NetworkGraphDecodeErrorZ_result_ok(long arg); - public static native uint32_t LDKCResult_NetworkGraphDecodeErrorZ_get_ok(long arg); - public static native uint32_t LDKCResult_NetworkGraphDecodeErrorZ_get_err(long arg); + public static native number LDKCResult_NetworkGraphDecodeErrorZ_get_ok(long arg); + public static native number LDKCResult_NetworkGraphDecodeErrorZ_get_err(long arg); + + + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START + + export interface LDKMessageSendEventsProvider { + get_and_clear_pending_msg_events (): number[]; + } + + export function LDKMessageSendEventsProvider_new(impl: LDKMessageSendEventsProvider): number { + throw new Error('unimplemented'); // TODO: bind to WASM + } + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END + + // LDKCVec_MessageSendEventZ MessageSendEventsProvider_get_and_clear_pending_msg_events LDKMessageSendEventsProvider* this_arg - public static native uint32_t[] MessageSendEventsProvider_get_and_clear_pending_msg_events(uint32_t this_arg); + public static native number[] MessageSendEventsProvider_get_and_clear_pending_msg_events(number this_arg); + + + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START + + export interface LDKEventsProvider { + get_and_clear_pending_events (): number[]; + } + + export function LDKEventsProvider_new(impl: LDKEventsProvider): number { + throw new Error('unimplemented'); // TODO: bind to WASM + } + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END + + // LDKCVec_EventZ EventsProvider_get_and_clear_pending_events LDKEventsProvider* this_arg - public static native uint32_t[] EventsProvider_get_and_clear_pending_events(uint32_t this_arg); + public static native number[] EventsProvider_get_and_clear_pending_events(number this_arg); + + + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START + + export interface LDKAccess { + get_utxo (genesis_hash: Uint8Array, short_channel_id: number): number; + } + + export function LDKAccess_new(impl: LDKAccess): number { + throw new Error('unimplemented'); // TODO: bind to WASM + } + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END + + // LDKCResult_TxOutAccessErrorZ Access_get_utxo LDKAccess* this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id - public static native uint32_t Access_get_utxo(uint32_t this_arg, byte[] genesis_hash, long short_channel_id); + public static native number Access_get_utxo(number this_arg, Uint8Array genesis_hash, number short_channel_id); + + + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START + + export interface LDKFilter { + register_tx (txid: Uint8Array, script_pubkey: Uint8Array): void; + register_output (outpoint: number, script_pubkey: Uint8Array): void; + } + + export function LDKFilter_new(impl: LDKFilter): number { + throw new Error('unimplemented'); // TODO: bind to WASM + } + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END + + // void Filter_register_tx LDKFilter* this_arg, const uint8_t (*txid)[32], struct LDKu8slice script_pubkey - public static native void Filter_register_tx(uint32_t this_arg, byte[] txid, byte[] script_pubkey); + public static native void Filter_register_tx(number this_arg, Uint8Array txid, Uint8Array script_pubkey); // void Filter_register_output LDKFilter* this_arg, const struct LDKOutPoint *NONNULL_PTR outpoint, struct LDKu8slice script_pubkey - public static native void Filter_register_output(uint32_t this_arg, uint32_t outpoint, byte[] script_pubkey); + public static native void Filter_register_output(number this_arg, number outpoint, Uint8Array script_pubkey); + + + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START + + export interface LDKPersist { + persist_new_channel (id: number, data: number): number; + update_persisted_channel (id: number, update: number, data: number): number; + } + + export function LDKPersist_new(impl: LDKPersist): number { + throw new Error('unimplemented'); // TODO: bind to WASM + } + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END + + // LDKCResult_NoneChannelMonitorUpdateErrZ Persist_persist_new_channel LDKPersist* this_arg, struct LDKOutPoint id, const struct LDKChannelMonitor *NONNULL_PTR data - public static native uint32_t Persist_persist_new_channel(uint32_t this_arg, uint32_t id, uint32_t data); + public static native number Persist_persist_new_channel(number this_arg, number id, number data); // LDKCResult_NoneChannelMonitorUpdateErrZ Persist_update_persisted_channel LDKPersist* this_arg, struct LDKOutPoint id, const struct LDKChannelMonitorUpdate *NONNULL_PTR update, const struct LDKChannelMonitor *NONNULL_PTR data - public static native uint32_t Persist_update_persisted_channel(uint32_t this_arg, uint32_t id, uint32_t update, uint32_t data); + public static native number Persist_update_persisted_channel(number this_arg, number id, number update, number data); + + + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START + + export interface LDKChannelMessageHandler { + handle_open_channel (their_node_id: Uint8Array, their_features: number, msg: number): void; + handle_accept_channel (their_node_id: Uint8Array, their_features: number, msg: number): void; + handle_funding_created (their_node_id: Uint8Array, msg: number): void; + handle_funding_signed (their_node_id: Uint8Array, msg: number): void; + handle_funding_locked (their_node_id: Uint8Array, msg: number): void; + handle_shutdown (their_node_id: Uint8Array, msg: number): void; + handle_closing_signed (their_node_id: Uint8Array, msg: number): void; + handle_update_add_htlc (their_node_id: Uint8Array, msg: number): void; + handle_update_fulfill_htlc (their_node_id: Uint8Array, msg: number): void; + handle_update_fail_htlc (their_node_id: Uint8Array, msg: number): void; + handle_update_fail_malformed_htlc (their_node_id: Uint8Array, msg: number): void; + handle_commitment_signed (their_node_id: Uint8Array, msg: number): void; + handle_revoke_and_ack (their_node_id: Uint8Array, msg: number): void; + handle_update_fee (their_node_id: Uint8Array, msg: number): void; + handle_announcement_signatures (their_node_id: Uint8Array, msg: number): void; + peer_disconnected (their_node_id: Uint8Array, no_connection_possible: boolean): void; + peer_connected (their_node_id: Uint8Array, msg: number): void; + handle_channel_reestablish (their_node_id: Uint8Array, msg: number): void; + handle_error (their_node_id: Uint8Array, msg: number): void; + } + + export function LDKChannelMessageHandler_new(impl: LDKChannelMessageHandler, MessageSendEventsProvider: LDKMessageSendEventsProvider): number { + throw new Error('unimplemented'); // TODO: bind to WASM + } + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END + + // void ChannelMessageHandler_handle_open_channel LDKChannelMessageHandler* 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(uint32_t this_arg, byte[] their_node_id, uint32_t their_features, uint32_t msg); + public static native void ChannelMessageHandler_handle_open_channel(number this_arg, Uint8Array their_node_id, number their_features, number msg); // void ChannelMessageHandler_handle_accept_channel LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, struct LDKInitFeatures their_features, const struct LDKAcceptChannel *NONNULL_PTR msg - public static native void ChannelMessageHandler_handle_accept_channel(uint32_t this_arg, byte[] their_node_id, uint32_t their_features, uint32_t msg); + public static native void ChannelMessageHandler_handle_accept_channel(number this_arg, Uint8Array their_node_id, number their_features, number msg); // void ChannelMessageHandler_handle_funding_created LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingCreated *NONNULL_PTR msg - public static native void ChannelMessageHandler_handle_funding_created(uint32_t this_arg, byte[] their_node_id, uint32_t msg); + public static native void ChannelMessageHandler_handle_funding_created(number this_arg, Uint8Array their_node_id, number msg); // void ChannelMessageHandler_handle_funding_signed LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingSigned *NONNULL_PTR msg - public static native void ChannelMessageHandler_handle_funding_signed(uint32_t this_arg, byte[] their_node_id, uint32_t msg); + public static native void ChannelMessageHandler_handle_funding_signed(number this_arg, Uint8Array their_node_id, number msg); // void ChannelMessageHandler_handle_funding_locked LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKFundingLocked *NONNULL_PTR msg - public static native void ChannelMessageHandler_handle_funding_locked(uint32_t this_arg, byte[] their_node_id, uint32_t msg); + public static native void ChannelMessageHandler_handle_funding_locked(number this_arg, Uint8Array their_node_id, number msg); // void ChannelMessageHandler_handle_shutdown LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKShutdown *NONNULL_PTR msg - public static native void ChannelMessageHandler_handle_shutdown(uint32_t this_arg, byte[] their_node_id, uint32_t msg); + public static native void ChannelMessageHandler_handle_shutdown(number this_arg, Uint8Array their_node_id, number msg); // void ChannelMessageHandler_handle_closing_signed LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKClosingSigned *NONNULL_PTR msg - public static native void ChannelMessageHandler_handle_closing_signed(uint32_t this_arg, byte[] their_node_id, uint32_t msg); + public static native void ChannelMessageHandler_handle_closing_signed(number this_arg, Uint8Array their_node_id, number msg); // void ChannelMessageHandler_handle_update_add_htlc LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateAddHTLC *NONNULL_PTR msg - public static native void ChannelMessageHandler_handle_update_add_htlc(uint32_t this_arg, byte[] their_node_id, uint32_t msg); + public static native void ChannelMessageHandler_handle_update_add_htlc(number this_arg, Uint8Array their_node_id, number msg); // void ChannelMessageHandler_handle_update_fulfill_htlc LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFulfillHTLC *NONNULL_PTR msg - public static native void ChannelMessageHandler_handle_update_fulfill_htlc(uint32_t this_arg, byte[] their_node_id, uint32_t msg); + public static native void ChannelMessageHandler_handle_update_fulfill_htlc(number this_arg, Uint8Array their_node_id, number msg); // void ChannelMessageHandler_handle_update_fail_htlc LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailHTLC *NONNULL_PTR msg - public static native void ChannelMessageHandler_handle_update_fail_htlc(uint32_t this_arg, byte[] their_node_id, uint32_t msg); + public static native void ChannelMessageHandler_handle_update_fail_htlc(number this_arg, Uint8Array their_node_id, number msg); // void ChannelMessageHandler_handle_update_fail_malformed_htlc LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR msg - public static native void ChannelMessageHandler_handle_update_fail_malformed_htlc(uint32_t this_arg, byte[] their_node_id, uint32_t msg); + public static native void ChannelMessageHandler_handle_update_fail_malformed_htlc(number this_arg, Uint8Array their_node_id, number msg); // void ChannelMessageHandler_handle_commitment_signed LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKCommitmentSigned *NONNULL_PTR msg - public static native void ChannelMessageHandler_handle_commitment_signed(uint32_t this_arg, byte[] their_node_id, uint32_t msg); + public static native void ChannelMessageHandler_handle_commitment_signed(number this_arg, Uint8Array their_node_id, number msg); // void ChannelMessageHandler_handle_revoke_and_ack LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKRevokeAndACK *NONNULL_PTR msg - public static native void ChannelMessageHandler_handle_revoke_and_ack(uint32_t this_arg, byte[] their_node_id, uint32_t msg); + public static native void ChannelMessageHandler_handle_revoke_and_ack(number this_arg, Uint8Array their_node_id, number msg); // void ChannelMessageHandler_handle_update_fee LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKUpdateFee *NONNULL_PTR msg - public static native void ChannelMessageHandler_handle_update_fee(uint32_t this_arg, byte[] their_node_id, uint32_t msg); + public static native void ChannelMessageHandler_handle_update_fee(number this_arg, Uint8Array their_node_id, number msg); // void ChannelMessageHandler_handle_announcement_signatures LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKAnnouncementSignatures *NONNULL_PTR msg - public static native void ChannelMessageHandler_handle_announcement_signatures(uint32_t this_arg, byte[] their_node_id, uint32_t msg); + public static native void ChannelMessageHandler_handle_announcement_signatures(number this_arg, Uint8Array their_node_id, number msg); // void ChannelMessageHandler_peer_disconnected LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, bool no_connection_possible - public static native void ChannelMessageHandler_peer_disconnected(uint32_t this_arg, byte[] their_node_id, boolean no_connection_possible); + public static native void ChannelMessageHandler_peer_disconnected(number this_arg, Uint8Array their_node_id, boolean no_connection_possible); // void ChannelMessageHandler_peer_connected LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR msg - public static native void ChannelMessageHandler_peer_connected(uint32_t this_arg, byte[] their_node_id, uint32_t msg); + public static native void ChannelMessageHandler_peer_connected(number this_arg, Uint8Array their_node_id, number msg); // void ChannelMessageHandler_handle_channel_reestablish LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKChannelReestablish *NONNULL_PTR msg - public static native void ChannelMessageHandler_handle_channel_reestablish(uint32_t this_arg, byte[] their_node_id, uint32_t msg); + public static native void ChannelMessageHandler_handle_channel_reestablish(number this_arg, Uint8Array their_node_id, number msg); // void ChannelMessageHandler_handle_error LDKChannelMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKErrorMessage *NONNULL_PTR msg - public static native void ChannelMessageHandler_handle_error(uint32_t this_arg, byte[] their_node_id, uint32_t msg); + public static native void ChannelMessageHandler_handle_error(number this_arg, Uint8Array their_node_id, number msg); + + + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START + + export interface LDKRoutingMessageHandler { + handle_node_announcement (msg: number): number; + handle_channel_announcement (msg: number): number; + handle_channel_update (msg: number): number; + handle_htlc_fail_channel_update (update: number): void; + get_next_channel_announcements (starting_point: number, batch_amount: number): number[]; + get_next_node_announcements (starting_point: Uint8Array, batch_amount: number): number[]; + sync_routing_table (their_node_id: Uint8Array, init: number): void; + handle_reply_channel_range (their_node_id: Uint8Array, msg: number): number; + handle_reply_short_channel_ids_end (their_node_id: Uint8Array, msg: number): number; + handle_query_channel_range (their_node_id: Uint8Array, msg: number): number; + handle_query_short_channel_ids (their_node_id: Uint8Array, msg: number): number; + } + + export function LDKRoutingMessageHandler_new(impl: LDKRoutingMessageHandler, MessageSendEventsProvider: LDKMessageSendEventsProvider): number { + throw new Error('unimplemented'); // TODO: bind to WASM + } + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END + + // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_node_announcement LDKRoutingMessageHandler* this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg - public static native uint32_t RoutingMessageHandler_handle_node_announcement(uint32_t this_arg, uint32_t msg); + public static native number RoutingMessageHandler_handle_node_announcement(number this_arg, number msg); // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_channel_announcement LDKRoutingMessageHandler* this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg - public static native uint32_t RoutingMessageHandler_handle_channel_announcement(uint32_t this_arg, uint32_t msg); + public static native number RoutingMessageHandler_handle_channel_announcement(number this_arg, number msg); // LDKCResult_boolLightningErrorZ RoutingMessageHandler_handle_channel_update LDKRoutingMessageHandler* this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg - public static native uint32_t RoutingMessageHandler_handle_channel_update(uint32_t this_arg, uint32_t msg); + public static native number RoutingMessageHandler_handle_channel_update(number this_arg, number msg); // void RoutingMessageHandler_handle_htlc_fail_channel_update LDKRoutingMessageHandler* this_arg, const struct LDKHTLCFailChannelUpdate *NONNULL_PTR update - public static native void RoutingMessageHandler_handle_htlc_fail_channel_update(uint32_t this_arg, uint32_t update); + public static native void RoutingMessageHandler_handle_htlc_fail_channel_update(number this_arg, number update); // LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ RoutingMessageHandler_get_next_channel_announcements LDKRoutingMessageHandler* this_arg, uint64_t starting_point, uint8_t batch_amount - public static native uint32_t[] RoutingMessageHandler_get_next_channel_announcements(uint32_t this_arg, long starting_point, byte batch_amount); + public static native number[] RoutingMessageHandler_get_next_channel_announcements(number this_arg, number starting_point, number batch_amount); // LDKCVec_NodeAnnouncementZ RoutingMessageHandler_get_next_node_announcements LDKRoutingMessageHandler* this_arg, struct LDKPublicKey starting_point, uint8_t batch_amount - public static native uint32_t[] RoutingMessageHandler_get_next_node_announcements(uint32_t this_arg, byte[] starting_point, byte batch_amount); + public static native number[] RoutingMessageHandler_get_next_node_announcements(number this_arg, Uint8Array starting_point, number batch_amount); // void RoutingMessageHandler_sync_routing_table LDKRoutingMessageHandler* this_arg, struct LDKPublicKey their_node_id, const struct LDKInit *NONNULL_PTR init - public static native void RoutingMessageHandler_sync_routing_table(uint32_t this_arg, byte[] their_node_id, uint32_t init); + public static native void RoutingMessageHandler_sync_routing_table(number this_arg, Uint8Array their_node_id, number init); // LDKCResult_NoneLightningErrorZ RoutingMessageHandler_handle_reply_channel_range LDKRoutingMessageHandler* this_arg, struct LDKPublicKey their_node_id, struct LDKReplyChannelRange msg - public static native uint32_t RoutingMessageHandler_handle_reply_channel_range(uint32_t this_arg, byte[] their_node_id, uint32_t msg); + public static native number RoutingMessageHandler_handle_reply_channel_range(number this_arg, Uint8Array their_node_id, number msg); // LDKCResult_NoneLightningErrorZ RoutingMessageHandler_handle_reply_short_channel_ids_end LDKRoutingMessageHandler* this_arg, struct LDKPublicKey their_node_id, struct LDKReplyShortChannelIdsEnd msg - public static native uint32_t RoutingMessageHandler_handle_reply_short_channel_ids_end(uint32_t this_arg, byte[] their_node_id, uint32_t msg); + public static native number RoutingMessageHandler_handle_reply_short_channel_ids_end(number this_arg, Uint8Array their_node_id, number msg); // LDKCResult_NoneLightningErrorZ RoutingMessageHandler_handle_query_channel_range LDKRoutingMessageHandler* this_arg, struct LDKPublicKey their_node_id, struct LDKQueryChannelRange msg - public static native uint32_t RoutingMessageHandler_handle_query_channel_range(uint32_t this_arg, byte[] their_node_id, uint32_t msg); + public static native number RoutingMessageHandler_handle_query_channel_range(number this_arg, Uint8Array their_node_id, number msg); // LDKCResult_NoneLightningErrorZ RoutingMessageHandler_handle_query_short_channel_ids LDKRoutingMessageHandler* this_arg, struct LDKPublicKey their_node_id, struct LDKQueryShortChannelIds msg - public static native uint32_t RoutingMessageHandler_handle_query_short_channel_ids(uint32_t this_arg, byte[] their_node_id, uint32_t msg); + public static native number RoutingMessageHandler_handle_query_short_channel_ids(number this_arg, Uint8Array their_node_id, number msg); + + + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: START + + export interface LDKSocketDescriptor { + send_data (data: Uint8Array, resume_read: boolean): number; + disconnect_socket (): void; + eq (other_arg: number): boolean; + hash (): number; + } + + export function LDKSocketDescriptor_new(impl: LDKSocketDescriptor): number { + throw new Error('unimplemented'); // TODO: bind to WASM + } + +// OUT_TYPESCRIPT_BINDINGS :: MAP_TRAIT :: END + + // uintptr_t SocketDescriptor_send_data LDKSocketDescriptor* this_arg, struct LDKu8slice data, bool resume_read - public static native long SocketDescriptor_send_data(uint32_t this_arg, byte[] data, boolean resume_read); + public static native number SocketDescriptor_send_data(number this_arg, Uint8Array data, boolean resume_read); // void SocketDescriptor_disconnect_socket LDKSocketDescriptor* this_arg - public static native void SocketDescriptor_disconnect_socket(uint32_t this_arg); + public static native void SocketDescriptor_disconnect_socket(number this_arg); // uint64_t SocketDescriptor_hash LDKSocketDescriptor* this_arg - public static native long SocketDescriptor_hash(uint32_t this_arg); + public static native number SocketDescriptor_hash(number this_arg); // void Transaction_free(struct LDKTransaction _res); - public static native void Transaction_free(byte[] _res); + public static native void Transaction_free(Uint8Array _res); // void TxOut_free(struct LDKTxOut _res); - public static native void TxOut_free(uint32_t _res); + public static native void TxOut_free(number _res); // void CVec_SpendableOutputDescriptorZ_free(struct LDKCVec_SpendableOutputDescriptorZ _res); - public static native void CVec_SpendableOutputDescriptorZ_free(uint32_t[] _res); + public static native void CVec_SpendableOutputDescriptorZ_free(number[] _res); // void CVec_MessageSendEventZ_free(struct LDKCVec_MessageSendEventZ _res); - public static native void CVec_MessageSendEventZ_free(uint32_t[] _res); + public static native void CVec_MessageSendEventZ_free(number[] _res); // void CVec_EventZ_free(struct LDKCVec_EventZ _res); - public static native void CVec_EventZ_free(uint32_t[] _res); + public static native void CVec_EventZ_free(number[] _res); // void C2Tuple_usizeTransactionZ_free(struct LDKC2Tuple_usizeTransactionZ _res); - public static native void C2Tuple_usizeTransactionZ_free(uint32_t _res); + public static native void C2Tuple_usizeTransactionZ_free(number _res); // struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_new(uintptr_t a, struct LDKTransaction b); - public static native uint32_t C2Tuple_usizeTransactionZ_new(long a, byte[] b); + public static native number C2Tuple_usizeTransactionZ_new(number a, Uint8Array b); // void CVec_C2Tuple_usizeTransactionZZ_free(struct LDKCVec_C2Tuple_usizeTransactionZZ _res); - public static native void CVec_C2Tuple_usizeTransactionZZ_free(uint32_t[] _res); + public static native void CVec_C2Tuple_usizeTransactionZZ_free(number[] _res); // struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_ok(void); - public static native uint32_t CResult_NoneChannelMonitorUpdateErrZ_ok(); + public static native number CResult_NoneChannelMonitorUpdateErrZ_ok(); // struct LDKCResult_NoneChannelMonitorUpdateErrZ CResult_NoneChannelMonitorUpdateErrZ_err(enum LDKChannelMonitorUpdateErr e); - public static native uint32_t CResult_NoneChannelMonitorUpdateErrZ_err(LDKChannelMonitorUpdateErr e); + public static native number CResult_NoneChannelMonitorUpdateErrZ_err(LDKChannelMonitorUpdateErr e); // void CResult_NoneChannelMonitorUpdateErrZ_free(struct LDKCResult_NoneChannelMonitorUpdateErrZ _res); - public static native void CResult_NoneChannelMonitorUpdateErrZ_free(uint32_t _res); + public static native void CResult_NoneChannelMonitorUpdateErrZ_free(number _res); // void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res); - public static native void CVec_MonitorEventZ_free(uint32_t[] _res); + public static native void CVec_MonitorEventZ_free(number[] _res); // struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_ok(struct LDKChannelMonitorUpdate o); - public static native uint32_t CResult_ChannelMonitorUpdateDecodeErrorZ_ok(uint32_t o); + public static native number CResult_ChannelMonitorUpdateDecodeErrorZ_ok(number o); // struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ CResult_ChannelMonitorUpdateDecodeErrorZ_err(struct LDKDecodeError e); - public static native uint32_t CResult_ChannelMonitorUpdateDecodeErrorZ_err(uint32_t e); + public static native number CResult_ChannelMonitorUpdateDecodeErrorZ_err(number e); // void CResult_ChannelMonitorUpdateDecodeErrorZ_free(struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res); - public static native void CResult_ChannelMonitorUpdateDecodeErrorZ_free(uint32_t _res); + public static native void CResult_ChannelMonitorUpdateDecodeErrorZ_free(number _res); // struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_ok(void); - public static native uint32_t CResult_NoneMonitorUpdateErrorZ_ok(); + public static native number CResult_NoneMonitorUpdateErrorZ_ok(); // struct LDKCResult_NoneMonitorUpdateErrorZ CResult_NoneMonitorUpdateErrorZ_err(struct LDKMonitorUpdateError e); - public static native uint32_t CResult_NoneMonitorUpdateErrorZ_err(uint32_t e); + public static native number CResult_NoneMonitorUpdateErrorZ_err(number e); // void CResult_NoneMonitorUpdateErrorZ_free(struct LDKCResult_NoneMonitorUpdateErrorZ _res); - public static native void CResult_NoneMonitorUpdateErrorZ_free(uint32_t _res); + public static native void CResult_NoneMonitorUpdateErrorZ_free(number _res); // void C2Tuple_OutPointScriptZ_free(struct LDKC2Tuple_OutPointScriptZ _res); - public static native void C2Tuple_OutPointScriptZ_free(uint32_t _res); + public static native void C2Tuple_OutPointScriptZ_free(number _res); // struct LDKC2Tuple_OutPointScriptZ C2Tuple_OutPointScriptZ_new(struct LDKOutPoint a, struct LDKCVec_u8Z b); - public static native uint32_t C2Tuple_OutPointScriptZ_new(uint32_t a, byte[] b); + public static native number C2Tuple_OutPointScriptZ_new(number a, Uint8Array b); // void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res); - public static native void CVec_TransactionZ_free(byte[][] _res); + public static native void CVec_TransactionZ_free(Uint8Array[] _res); // void C2Tuple_u32TxOutZ_free(struct LDKC2Tuple_u32TxOutZ _res); - public static native void C2Tuple_u32TxOutZ_free(uint32_t _res); + public static native void C2Tuple_u32TxOutZ_free(number _res); // struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_new(uint32_t a, struct LDKTxOut b); - public static native uint32_t C2Tuple_u32TxOutZ_new(int a, uint32_t b); + public static native number C2Tuple_u32TxOutZ_new(number a, number b); // void CVec_C2Tuple_u32TxOutZZ_free(struct LDKCVec_C2Tuple_u32TxOutZZ _res); - public static native void CVec_C2Tuple_u32TxOutZZ_free(uint32_t[] _res); + public static native void CVec_C2Tuple_u32TxOutZZ_free(number[] _res); // void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res); - public static native void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(uint32_t _res); + public static native void C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(number _res); // struct LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(struct LDKThirtyTwoBytes a, struct LDKCVec_C2Tuple_u32TxOutZZ b); - public static native uint32_t C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(byte[] a, uint32_t[] b); + public static native number C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(Uint8Array a, number[] b); // void CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ _res); - public static native void CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(uint32_t[] _res); + public static native void CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(number[] _res); // void C2Tuple_BlockHashChannelMonitorZ_free(struct LDKC2Tuple_BlockHashChannelMonitorZ _res); - public static native void C2Tuple_BlockHashChannelMonitorZ_free(uint32_t _res); + public static native void C2Tuple_BlockHashChannelMonitorZ_free(number _res); // struct LDKC2Tuple_BlockHashChannelMonitorZ C2Tuple_BlockHashChannelMonitorZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelMonitor b); - public static native uint32_t C2Tuple_BlockHashChannelMonitorZ_new(byte[] a, uint32_t b); + public static native number C2Tuple_BlockHashChannelMonitorZ_new(Uint8Array a, number b); // struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelMonitorZ o); - public static native uint32_t CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(uint32_t o); + public static native number CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(number o); // struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(struct LDKDecodeError e); - public static native uint32_t CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(uint32_t e); + public static native number CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(number e); // void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res); - public static native void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(uint32_t _res); + public static native void CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(number _res); // void C2Tuple_u64u64Z_free(struct LDKC2Tuple_u64u64Z _res); - public static native void C2Tuple_u64u64Z_free(uint32_t _res); + public static native void C2Tuple_u64u64Z_free(number _res); // struct LDKC2Tuple_u64u64Z C2Tuple_u64u64Z_new(uint64_t a, uint64_t b); - public static native uint32_t C2Tuple_u64u64Z_new(long a, long b); + public static native number C2Tuple_u64u64Z_new(number a, number b); // struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_ok(struct LDKSpendableOutputDescriptor o); - public static native uint32_t CResult_SpendableOutputDescriptorDecodeErrorZ_ok(uint32_t o); + public static native number CResult_SpendableOutputDescriptorDecodeErrorZ_ok(number o); // struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ CResult_SpendableOutputDescriptorDecodeErrorZ_err(struct LDKDecodeError e); - public static native uint32_t CResult_SpendableOutputDescriptorDecodeErrorZ_err(uint32_t e); + public static native number CResult_SpendableOutputDescriptorDecodeErrorZ_err(number e); // void CResult_SpendableOutputDescriptorDecodeErrorZ_free(struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res); - public static native void CResult_SpendableOutputDescriptorDecodeErrorZ_free(uint32_t _res); + public static native void CResult_SpendableOutputDescriptorDecodeErrorZ_free(number _res); // void CVec_SignatureZ_free(struct LDKCVec_SignatureZ _res); - public static native void CVec_SignatureZ_free(byte[][] _res); + public static native void CVec_SignatureZ_free(Uint8Array[] _res); // void C2Tuple_SignatureCVec_SignatureZZ_free(struct LDKC2Tuple_SignatureCVec_SignatureZZ _res); - public static native void C2Tuple_SignatureCVec_SignatureZZ_free(uint32_t _res); + public static native void C2Tuple_SignatureCVec_SignatureZZ_free(number _res); // struct LDKC2Tuple_SignatureCVec_SignatureZZ C2Tuple_SignatureCVec_SignatureZZ_new(struct LDKSignature a, struct LDKCVec_SignatureZ b); - public static native uint32_t C2Tuple_SignatureCVec_SignatureZZ_new(byte[] a, byte[][] b); + public static native number C2Tuple_SignatureCVec_SignatureZZ_new(Uint8Array a, Uint8Array[] b); // struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(struct LDKC2Tuple_SignatureCVec_SignatureZZ o); - public static native uint32_t CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(uint32_t o); + public static native number CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(number o); // struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(void); - public static native uint32_t CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(); + public static native number CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err(); // void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(struct LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res); - public static native void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(uint32_t _res); + public static native void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(number _res); // struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_ok(struct LDKSignature o); - public static native uint32_t CResult_SignatureNoneZ_ok(byte[] o); + public static native number CResult_SignatureNoneZ_ok(Uint8Array o); // struct LDKCResult_SignatureNoneZ CResult_SignatureNoneZ_err(void); - public static native uint32_t CResult_SignatureNoneZ_err(); + public static native number CResult_SignatureNoneZ_err(); // void CResult_SignatureNoneZ_free(struct LDKCResult_SignatureNoneZ _res); - public static native void CResult_SignatureNoneZ_free(uint32_t _res); + public static native void CResult_SignatureNoneZ_free(number _res); // struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_ok(struct LDKCVec_SignatureZ o); - public static native uint32_t CResult_CVec_SignatureZNoneZ_ok(byte[][] o); + public static native number CResult_CVec_SignatureZNoneZ_ok(Uint8Array[] o); // struct LDKCResult_CVec_SignatureZNoneZ CResult_CVec_SignatureZNoneZ_err(void); - public static native uint32_t CResult_CVec_SignatureZNoneZ_err(); + public static native number CResult_CVec_SignatureZNoneZ_err(); // void CResult_CVec_SignatureZNoneZ_free(struct LDKCResult_CVec_SignatureZNoneZ _res); - public static native void CResult_CVec_SignatureZNoneZ_free(uint32_t _res); + public static native void CResult_CVec_SignatureZNoneZ_free(number _res); // struct LDKCResult_ChanKeySignerDecodeErrorZ CResult_ChanKeySignerDecodeErrorZ_ok(struct LDKChannelKeys o); - public static native uint32_t CResult_ChanKeySignerDecodeErrorZ_ok(uint32_t o); + public static native number CResult_ChanKeySignerDecodeErrorZ_ok(number o); // struct LDKCResult_ChanKeySignerDecodeErrorZ CResult_ChanKeySignerDecodeErrorZ_err(struct LDKDecodeError e); - public static native uint32_t CResult_ChanKeySignerDecodeErrorZ_err(uint32_t e); + public static native number CResult_ChanKeySignerDecodeErrorZ_err(number e); // void CResult_ChanKeySignerDecodeErrorZ_free(struct LDKCResult_ChanKeySignerDecodeErrorZ _res); - public static native void CResult_ChanKeySignerDecodeErrorZ_free(uint32_t _res); + public static native void CResult_ChanKeySignerDecodeErrorZ_free(number _res); // struct LDKCResult_InMemoryChannelKeysDecodeErrorZ CResult_InMemoryChannelKeysDecodeErrorZ_ok(struct LDKInMemoryChannelKeys o); - public static native uint32_t CResult_InMemoryChannelKeysDecodeErrorZ_ok(uint32_t o); + public static native number CResult_InMemoryChannelKeysDecodeErrorZ_ok(number o); // struct LDKCResult_InMemoryChannelKeysDecodeErrorZ CResult_InMemoryChannelKeysDecodeErrorZ_err(struct LDKDecodeError e); - public static native uint32_t CResult_InMemoryChannelKeysDecodeErrorZ_err(uint32_t e); + public static native number CResult_InMemoryChannelKeysDecodeErrorZ_err(number e); // void CResult_InMemoryChannelKeysDecodeErrorZ_free(struct LDKCResult_InMemoryChannelKeysDecodeErrorZ _res); - public static native void CResult_InMemoryChannelKeysDecodeErrorZ_free(uint32_t _res); + public static native void CResult_InMemoryChannelKeysDecodeErrorZ_free(number _res); // struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_ok(struct LDKTxOut o); - public static native uint32_t CResult_TxOutAccessErrorZ_ok(uint32_t o); + public static native number CResult_TxOutAccessErrorZ_ok(number o); // struct LDKCResult_TxOutAccessErrorZ CResult_TxOutAccessErrorZ_err(enum LDKAccessError e); - public static native uint32_t CResult_TxOutAccessErrorZ_err(LDKAccessError e); + public static native number CResult_TxOutAccessErrorZ_err(LDKAccessError e); // void CResult_TxOutAccessErrorZ_free(struct LDKCResult_TxOutAccessErrorZ _res); - public static native void CResult_TxOutAccessErrorZ_free(uint32_t _res); + public static native void CResult_TxOutAccessErrorZ_free(number _res); // struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_ok(void); - public static native uint32_t CResult_NoneAPIErrorZ_ok(); + public static native number CResult_NoneAPIErrorZ_ok(); // struct LDKCResult_NoneAPIErrorZ CResult_NoneAPIErrorZ_err(struct LDKAPIError e); - public static native uint32_t CResult_NoneAPIErrorZ_err(uint32_t e); + public static native number CResult_NoneAPIErrorZ_err(number e); // void CResult_NoneAPIErrorZ_free(struct LDKCResult_NoneAPIErrorZ _res); - public static native void CResult_NoneAPIErrorZ_free(uint32_t _res); + public static native void CResult_NoneAPIErrorZ_free(number _res); // void CVec_ChannelDetailsZ_free(struct LDKCVec_ChannelDetailsZ _res); - public static native void CVec_ChannelDetailsZ_free(uint32_t[] _res); + public static native void CVec_ChannelDetailsZ_free(number[] _res); // struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void); - public static native uint32_t CResult_NonePaymentSendFailureZ_ok(); + public static native number CResult_NonePaymentSendFailureZ_ok(); // struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_err(struct LDKPaymentSendFailure e); - public static native uint32_t CResult_NonePaymentSendFailureZ_err(uint32_t e); + public static native number CResult_NonePaymentSendFailureZ_err(number e); // void CResult_NonePaymentSendFailureZ_free(struct LDKCResult_NonePaymentSendFailureZ _res); - public static native void CResult_NonePaymentSendFailureZ_free(uint32_t _res); + public static native void CResult_NonePaymentSendFailureZ_free(number _res); // void CVec_NetAddressZ_free(struct LDKCVec_NetAddressZ _res); - public static native void CVec_NetAddressZ_free(uint32_t[] _res); + public static native void CVec_NetAddressZ_free(number[] _res); // void CVec_ChannelMonitorZ_free(struct LDKCVec_ChannelMonitorZ _res); - public static native void CVec_ChannelMonitorZ_free(uint32_t[] _res); + public static native void CVec_ChannelMonitorZ_free(number[] _res); // void C2Tuple_BlockHashChannelManagerZ_free(struct LDKC2Tuple_BlockHashChannelManagerZ _res); - public static native void C2Tuple_BlockHashChannelManagerZ_free(uint32_t _res); + public static native void C2Tuple_BlockHashChannelManagerZ_free(number _res); // struct LDKC2Tuple_BlockHashChannelManagerZ C2Tuple_BlockHashChannelManagerZ_new(struct LDKThirtyTwoBytes a, struct LDKChannelManager b); - public static native uint32_t C2Tuple_BlockHashChannelManagerZ_new(byte[] a, uint32_t b); + public static native number C2Tuple_BlockHashChannelManagerZ_new(Uint8Array a, number b); // struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(struct LDKC2Tuple_BlockHashChannelManagerZ o); - public static native uint32_t CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(uint32_t o); + public static native number CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(number o); // struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(struct LDKDecodeError e); - public static native uint32_t CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(uint32_t e); + public static native number CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(number e); // void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res); - public static native void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(uint32_t _res); + public static native void CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(number _res); // struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_ok(struct LDKNetAddress o); - public static native uint32_t CResult_NetAddressu8Z_ok(uint32_t o); + public static native number CResult_NetAddressu8Z_ok(number o); // struct LDKCResult_NetAddressu8Z CResult_NetAddressu8Z_err(uint8_t e); - public static native uint32_t CResult_NetAddressu8Z_err(byte e); + public static native number CResult_NetAddressu8Z_err(number e); // void CResult_NetAddressu8Z_free(struct LDKCResult_NetAddressu8Z _res); - public static native void CResult_NetAddressu8Z_free(uint32_t _res); + public static native void CResult_NetAddressu8Z_free(number _res); // struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(struct LDKCResult_NetAddressu8Z o); - public static native uint32_t CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(uint32_t o); + public static native number CResult_CResult_NetAddressu8ZDecodeErrorZ_ok(number o); // struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ CResult_CResult_NetAddressu8ZDecodeErrorZ_err(struct LDKDecodeError e); - public static native uint32_t CResult_CResult_NetAddressu8ZDecodeErrorZ_err(uint32_t e); + public static native number CResult_CResult_NetAddressu8ZDecodeErrorZ_err(number e); // void CResult_CResult_NetAddressu8ZDecodeErrorZ_free(struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ _res); - public static native void CResult_CResult_NetAddressu8ZDecodeErrorZ_free(uint32_t _res); + public static native void CResult_CResult_NetAddressu8ZDecodeErrorZ_free(number _res); // void CVec_u64Z_free(struct LDKCVec_u64Z _res); - public static native void CVec_u64Z_free(long[] _res); + public static native void CVec_u64Z_free(number[] _res); // void CVec_UpdateAddHTLCZ_free(struct LDKCVec_UpdateAddHTLCZ _res); - public static native void CVec_UpdateAddHTLCZ_free(uint32_t[] _res); + public static native void CVec_UpdateAddHTLCZ_free(number[] _res); // void CVec_UpdateFulfillHTLCZ_free(struct LDKCVec_UpdateFulfillHTLCZ _res); - public static native void CVec_UpdateFulfillHTLCZ_free(uint32_t[] _res); + public static native void CVec_UpdateFulfillHTLCZ_free(number[] _res); // void CVec_UpdateFailHTLCZ_free(struct LDKCVec_UpdateFailHTLCZ _res); - public static native void CVec_UpdateFailHTLCZ_free(uint32_t[] _res); + public static native void CVec_UpdateFailHTLCZ_free(number[] _res); // void CVec_UpdateFailMalformedHTLCZ_free(struct LDKCVec_UpdateFailMalformedHTLCZ _res); - public static native void CVec_UpdateFailMalformedHTLCZ_free(uint32_t[] _res); + public static native void CVec_UpdateFailMalformedHTLCZ_free(number[] _res); // struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_ok(bool o); - public static native uint32_t CResult_boolLightningErrorZ_ok(boolean o); + public static native number CResult_boolLightningErrorZ_ok(boolean o); // struct LDKCResult_boolLightningErrorZ CResult_boolLightningErrorZ_err(struct LDKLightningError e); - public static native uint32_t CResult_boolLightningErrorZ_err(uint32_t e); + public static native number CResult_boolLightningErrorZ_err(number e); // void CResult_boolLightningErrorZ_free(struct LDKCResult_boolLightningErrorZ _res); - public static native void CResult_boolLightningErrorZ_free(uint32_t _res); + public static native void CResult_boolLightningErrorZ_free(number _res); // void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res); - public static native void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(uint32_t _res); + public static native void C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(number _res); // struct LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(struct LDKChannelAnnouncement a, struct LDKChannelUpdate b, struct LDKChannelUpdate c); - public static native uint32_t C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(uint32_t a, uint32_t b, uint32_t c); + public static native number C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(number a, number b, number c); // void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(struct LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res); - public static native void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(uint32_t[] _res); + public static native void CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(number[] _res); // void CVec_NodeAnnouncementZ_free(struct LDKCVec_NodeAnnouncementZ _res); - public static native void CVec_NodeAnnouncementZ_free(uint32_t[] _res); + public static native void CVec_NodeAnnouncementZ_free(number[] _res); // struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_ok(void); - public static native uint32_t CResult_NoneLightningErrorZ_ok(); + public static native number CResult_NoneLightningErrorZ_ok(); // struct LDKCResult_NoneLightningErrorZ CResult_NoneLightningErrorZ_err(struct LDKLightningError e); - public static native uint32_t CResult_NoneLightningErrorZ_err(uint32_t e); + public static native number CResult_NoneLightningErrorZ_err(number e); // void CResult_NoneLightningErrorZ_free(struct LDKCResult_NoneLightningErrorZ _res); - public static native void CResult_NoneLightningErrorZ_free(uint32_t _res); + public static native void CResult_NoneLightningErrorZ_free(number _res); // struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_ok(struct LDKChannelReestablish o); - public static native uint32_t CResult_ChannelReestablishDecodeErrorZ_ok(uint32_t o); + public static native number CResult_ChannelReestablishDecodeErrorZ_ok(number o); // struct LDKCResult_ChannelReestablishDecodeErrorZ CResult_ChannelReestablishDecodeErrorZ_err(struct LDKDecodeError e); - public static native uint32_t CResult_ChannelReestablishDecodeErrorZ_err(uint32_t e); + public static native number CResult_ChannelReestablishDecodeErrorZ_err(number e); // void CResult_ChannelReestablishDecodeErrorZ_free(struct LDKCResult_ChannelReestablishDecodeErrorZ _res); - public static native void CResult_ChannelReestablishDecodeErrorZ_free(uint32_t _res); + public static native void CResult_ChannelReestablishDecodeErrorZ_free(number _res); // struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_ok(struct LDKInit o); - public static native uint32_t CResult_InitDecodeErrorZ_ok(uint32_t o); + public static native number CResult_InitDecodeErrorZ_ok(number o); // struct LDKCResult_InitDecodeErrorZ CResult_InitDecodeErrorZ_err(struct LDKDecodeError e); - public static native uint32_t CResult_InitDecodeErrorZ_err(uint32_t e); + public static native number CResult_InitDecodeErrorZ_err(number e); // void CResult_InitDecodeErrorZ_free(struct LDKCResult_InitDecodeErrorZ _res); - public static native void CResult_InitDecodeErrorZ_free(uint32_t _res); + public static native void CResult_InitDecodeErrorZ_free(number _res); // struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_ok(struct LDKPing o); - public static native uint32_t CResult_PingDecodeErrorZ_ok(uint32_t o); + public static native number CResult_PingDecodeErrorZ_ok(number o); // struct LDKCResult_PingDecodeErrorZ CResult_PingDecodeErrorZ_err(struct LDKDecodeError e); - public static native uint32_t CResult_PingDecodeErrorZ_err(uint32_t e); + public static native number CResult_PingDecodeErrorZ_err(number e); // void CResult_PingDecodeErrorZ_free(struct LDKCResult_PingDecodeErrorZ _res); - public static native void CResult_PingDecodeErrorZ_free(uint32_t _res); + public static native void CResult_PingDecodeErrorZ_free(number _res); // struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_ok(struct LDKPong o); - public static native uint32_t CResult_PongDecodeErrorZ_ok(uint32_t o); + public static native number CResult_PongDecodeErrorZ_ok(number o); // struct LDKCResult_PongDecodeErrorZ CResult_PongDecodeErrorZ_err(struct LDKDecodeError e); - public static native uint32_t CResult_PongDecodeErrorZ_err(uint32_t e); + public static native number CResult_PongDecodeErrorZ_err(number e); // void CResult_PongDecodeErrorZ_free(struct LDKCResult_PongDecodeErrorZ _res); - public static native void CResult_PongDecodeErrorZ_free(uint32_t _res); + public static native void CResult_PongDecodeErrorZ_free(number _res); // struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(struct LDKUnsignedChannelAnnouncement o); - public static native uint32_t CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(uint32_t o); + public static native number CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(number o); // struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(struct LDKDecodeError e); - public static native uint32_t CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(uint32_t e); + public static native number CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(number e); // void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res); - public static native void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(uint32_t _res); + public static native void CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(number _res); // struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_ok(struct LDKUnsignedChannelUpdate o); - public static native uint32_t CResult_UnsignedChannelUpdateDecodeErrorZ_ok(uint32_t o); + public static native number CResult_UnsignedChannelUpdateDecodeErrorZ_ok(number o); // struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ CResult_UnsignedChannelUpdateDecodeErrorZ_err(struct LDKDecodeError e); - public static native uint32_t CResult_UnsignedChannelUpdateDecodeErrorZ_err(uint32_t e); + public static native number CResult_UnsignedChannelUpdateDecodeErrorZ_err(number e); // void CResult_UnsignedChannelUpdateDecodeErrorZ_free(struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res); - public static native void CResult_UnsignedChannelUpdateDecodeErrorZ_free(uint32_t _res); + public static native void CResult_UnsignedChannelUpdateDecodeErrorZ_free(number _res); // struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_ok(struct LDKErrorMessage o); - public static native uint32_t CResult_ErrorMessageDecodeErrorZ_ok(uint32_t o); + public static native number CResult_ErrorMessageDecodeErrorZ_ok(number o); // struct LDKCResult_ErrorMessageDecodeErrorZ CResult_ErrorMessageDecodeErrorZ_err(struct LDKDecodeError e); - public static native uint32_t CResult_ErrorMessageDecodeErrorZ_err(uint32_t e); + public static native number CResult_ErrorMessageDecodeErrorZ_err(number e); // void CResult_ErrorMessageDecodeErrorZ_free(struct LDKCResult_ErrorMessageDecodeErrorZ _res); - public static native void CResult_ErrorMessageDecodeErrorZ_free(uint32_t _res); + public static native void CResult_ErrorMessageDecodeErrorZ_free(number _res); // struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(struct LDKUnsignedNodeAnnouncement o); - public static native uint32_t CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(uint32_t o); + public static native number CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(number o); // struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(struct LDKDecodeError e); - public static native uint32_t CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(uint32_t e); + public static native number CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(number e); // void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res); - public static native void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(uint32_t _res); + public static native void CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(number _res); // struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_ok(struct LDKQueryShortChannelIds o); - public static native uint32_t CResult_QueryShortChannelIdsDecodeErrorZ_ok(uint32_t o); + public static native number CResult_QueryShortChannelIdsDecodeErrorZ_ok(number o); // struct LDKCResult_QueryShortChannelIdsDecodeErrorZ CResult_QueryShortChannelIdsDecodeErrorZ_err(struct LDKDecodeError e); - public static native uint32_t CResult_QueryShortChannelIdsDecodeErrorZ_err(uint32_t e); + public static native number CResult_QueryShortChannelIdsDecodeErrorZ_err(number e); // void CResult_QueryShortChannelIdsDecodeErrorZ_free(struct LDKCResult_QueryShortChannelIdsDecodeErrorZ _res); - public static native void CResult_QueryShortChannelIdsDecodeErrorZ_free(uint32_t _res); + public static native void CResult_QueryShortChannelIdsDecodeErrorZ_free(number _res); // struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(struct LDKReplyShortChannelIdsEnd o); - public static native uint32_t CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(uint32_t o); + public static native number CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(number o); // struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(struct LDKDecodeError e); - public static native uint32_t CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(uint32_t e); + public static native number CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(number e); // void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res); - public static native void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(uint32_t _res); + public static native void CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(number _res); // struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_ok(struct LDKQueryChannelRange o); - public static native uint32_t CResult_QueryChannelRangeDecodeErrorZ_ok(uint32_t o); + public static native number CResult_QueryChannelRangeDecodeErrorZ_ok(number o); // struct LDKCResult_QueryChannelRangeDecodeErrorZ CResult_QueryChannelRangeDecodeErrorZ_err(struct LDKDecodeError e); - public static native uint32_t CResult_QueryChannelRangeDecodeErrorZ_err(uint32_t e); + public static native number CResult_QueryChannelRangeDecodeErrorZ_err(number e); // void CResult_QueryChannelRangeDecodeErrorZ_free(struct LDKCResult_QueryChannelRangeDecodeErrorZ _res); - public static native void CResult_QueryChannelRangeDecodeErrorZ_free(uint32_t _res); + public static native void CResult_QueryChannelRangeDecodeErrorZ_free(number _res); // struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_ok(struct LDKReplyChannelRange o); - public static native uint32_t CResult_ReplyChannelRangeDecodeErrorZ_ok(uint32_t o); + public static native number CResult_ReplyChannelRangeDecodeErrorZ_ok(number o); // struct LDKCResult_ReplyChannelRangeDecodeErrorZ CResult_ReplyChannelRangeDecodeErrorZ_err(struct LDKDecodeError e); - public static native uint32_t CResult_ReplyChannelRangeDecodeErrorZ_err(uint32_t e); + public static native number CResult_ReplyChannelRangeDecodeErrorZ_err(number e); // void CResult_ReplyChannelRangeDecodeErrorZ_free(struct LDKCResult_ReplyChannelRangeDecodeErrorZ _res); - public static native void CResult_ReplyChannelRangeDecodeErrorZ_free(uint32_t _res); + public static native void CResult_ReplyChannelRangeDecodeErrorZ_free(number _res); // struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_ok(struct LDKGossipTimestampFilter o); - public static native uint32_t CResult_GossipTimestampFilterDecodeErrorZ_ok(uint32_t o); + public static native number CResult_GossipTimestampFilterDecodeErrorZ_ok(number o); // struct LDKCResult_GossipTimestampFilterDecodeErrorZ CResult_GossipTimestampFilterDecodeErrorZ_err(struct LDKDecodeError e); - public static native uint32_t CResult_GossipTimestampFilterDecodeErrorZ_err(uint32_t e); + public static native number CResult_GossipTimestampFilterDecodeErrorZ_err(number e); // void CResult_GossipTimestampFilterDecodeErrorZ_free(struct LDKCResult_GossipTimestampFilterDecodeErrorZ _res); - public static native void CResult_GossipTimestampFilterDecodeErrorZ_free(uint32_t _res); + public static native void CResult_GossipTimestampFilterDecodeErrorZ_free(number _res); // void CVec_PublicKeyZ_free(struct LDKCVec_PublicKeyZ _res); - public static native void CVec_PublicKeyZ_free(byte[][] _res); + public static native void CVec_PublicKeyZ_free(Uint8Array[] _res); // void CVec_u8Z_free(struct LDKCVec_u8Z _res); - public static native void CVec_u8Z_free(byte[] _res); + public static native void CVec_u8Z_free(Uint8Array _res); // struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o); - public static native uint32_t CResult_CVec_u8ZPeerHandleErrorZ_ok(byte[] o); + public static native number CResult_CVec_u8ZPeerHandleErrorZ_ok(Uint8Array o); // struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e); - public static native uint32_t CResult_CVec_u8ZPeerHandleErrorZ_err(uint32_t e); + public static native number CResult_CVec_u8ZPeerHandleErrorZ_err(number e); // void CResult_CVec_u8ZPeerHandleErrorZ_free(struct LDKCResult_CVec_u8ZPeerHandleErrorZ _res); - public static native void CResult_CVec_u8ZPeerHandleErrorZ_free(uint32_t _res); + public static native void CResult_CVec_u8ZPeerHandleErrorZ_free(number _res); // struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_ok(void); - public static native uint32_t CResult_NonePeerHandleErrorZ_ok(); + public static native number CResult_NonePeerHandleErrorZ_ok(); // struct LDKCResult_NonePeerHandleErrorZ CResult_NonePeerHandleErrorZ_err(struct LDKPeerHandleError e); - public static native uint32_t CResult_NonePeerHandleErrorZ_err(uint32_t e); + public static native number CResult_NonePeerHandleErrorZ_err(number e); // void CResult_NonePeerHandleErrorZ_free(struct LDKCResult_NonePeerHandleErrorZ _res); - public static native void CResult_NonePeerHandleErrorZ_free(uint32_t _res); + public static native void CResult_NonePeerHandleErrorZ_free(number _res); // struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_ok(bool o); - public static native uint32_t CResult_boolPeerHandleErrorZ_ok(boolean o); + public static native number CResult_boolPeerHandleErrorZ_ok(boolean o); // struct LDKCResult_boolPeerHandleErrorZ CResult_boolPeerHandleErrorZ_err(struct LDKPeerHandleError e); - public static native uint32_t CResult_boolPeerHandleErrorZ_err(uint32_t e); + public static native number CResult_boolPeerHandleErrorZ_err(number e); // void CResult_boolPeerHandleErrorZ_free(struct LDKCResult_boolPeerHandleErrorZ _res); - public static native void CResult_boolPeerHandleErrorZ_free(uint32_t _res); + public static native void CResult_boolPeerHandleErrorZ_free(number _res); // struct LDKCResult_SecretKeySecpErrorZ CResult_SecretKeySecpErrorZ_ok(struct LDKSecretKey o); - public static native uint32_t CResult_SecretKeySecpErrorZ_ok(byte[] o); + public static native number CResult_SecretKeySecpErrorZ_ok(Uint8Array o); // struct LDKCResult_SecretKeySecpErrorZ CResult_SecretKeySecpErrorZ_err(enum LDKSecp256k1Error e); - public static native uint32_t CResult_SecretKeySecpErrorZ_err(LDKSecp256k1Error e); + public static native number CResult_SecretKeySecpErrorZ_err(LDKSecp256k1Error e); // void CResult_SecretKeySecpErrorZ_free(struct LDKCResult_SecretKeySecpErrorZ _res); - public static native void CResult_SecretKeySecpErrorZ_free(uint32_t _res); + public static native void CResult_SecretKeySecpErrorZ_free(number _res); // struct LDKCResult_PublicKeySecpErrorZ CResult_PublicKeySecpErrorZ_ok(struct LDKPublicKey o); - public static native uint32_t CResult_PublicKeySecpErrorZ_ok(byte[] o); + public static native number CResult_PublicKeySecpErrorZ_ok(Uint8Array o); // struct LDKCResult_PublicKeySecpErrorZ CResult_PublicKeySecpErrorZ_err(enum LDKSecp256k1Error e); - public static native uint32_t CResult_PublicKeySecpErrorZ_err(LDKSecp256k1Error e); + public static native number CResult_PublicKeySecpErrorZ_err(LDKSecp256k1Error e); // void CResult_PublicKeySecpErrorZ_free(struct LDKCResult_PublicKeySecpErrorZ _res); - public static native void CResult_PublicKeySecpErrorZ_free(uint32_t _res); + public static native void CResult_PublicKeySecpErrorZ_free(number _res); // struct LDKCResult_TxCreationKeysSecpErrorZ CResult_TxCreationKeysSecpErrorZ_ok(struct LDKTxCreationKeys o); - public static native uint32_t CResult_TxCreationKeysSecpErrorZ_ok(uint32_t o); + public static native number CResult_TxCreationKeysSecpErrorZ_ok(number o); // struct LDKCResult_TxCreationKeysSecpErrorZ CResult_TxCreationKeysSecpErrorZ_err(enum LDKSecp256k1Error e); - public static native uint32_t CResult_TxCreationKeysSecpErrorZ_err(LDKSecp256k1Error e); + public static native number CResult_TxCreationKeysSecpErrorZ_err(LDKSecp256k1Error e); // void CResult_TxCreationKeysSecpErrorZ_free(struct LDKCResult_TxCreationKeysSecpErrorZ _res); - public static native void CResult_TxCreationKeysSecpErrorZ_free(uint32_t _res); + public static native void CResult_TxCreationKeysSecpErrorZ_free(number _res); // struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_ok(struct LDKTrustedCommitmentTransaction o); - public static native uint32_t CResult_TrustedCommitmentTransactionNoneZ_ok(uint32_t o); + public static native number CResult_TrustedCommitmentTransactionNoneZ_ok(number o); // struct LDKCResult_TrustedCommitmentTransactionNoneZ CResult_TrustedCommitmentTransactionNoneZ_err(void); - public static native uint32_t CResult_TrustedCommitmentTransactionNoneZ_err(); + public static native number CResult_TrustedCommitmentTransactionNoneZ_err(); // void CResult_TrustedCommitmentTransactionNoneZ_free(struct LDKCResult_TrustedCommitmentTransactionNoneZ _res); - public static native void CResult_TrustedCommitmentTransactionNoneZ_free(uint32_t _res); + public static native void CResult_TrustedCommitmentTransactionNoneZ_free(number _res); // void CVec_RouteHopZ_free(struct LDKCVec_RouteHopZ _res); - public static native void CVec_RouteHopZ_free(uint32_t[] _res); + public static native void CVec_RouteHopZ_free(number[] _res); // void CVec_CVec_RouteHopZZ_free(struct LDKCVec_CVec_RouteHopZZ _res); - public static native void CVec_CVec_RouteHopZZ_free(uint32_t[][] _res); + public static native void CVec_CVec_RouteHopZZ_free(number[][] _res); // struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_ok(struct LDKRoute o); - public static native uint32_t CResult_RouteDecodeErrorZ_ok(uint32_t o); + public static native number CResult_RouteDecodeErrorZ_ok(number o); // struct LDKCResult_RouteDecodeErrorZ CResult_RouteDecodeErrorZ_err(struct LDKDecodeError e); - public static native uint32_t CResult_RouteDecodeErrorZ_err(uint32_t e); + public static native number CResult_RouteDecodeErrorZ_err(number e); // void CResult_RouteDecodeErrorZ_free(struct LDKCResult_RouteDecodeErrorZ _res); - public static native void CResult_RouteDecodeErrorZ_free(uint32_t _res); + public static native void CResult_RouteDecodeErrorZ_free(number _res); // void CVec_RouteHintZ_free(struct LDKCVec_RouteHintZ _res); - public static native void CVec_RouteHintZ_free(uint32_t[] _res); + public static native void CVec_RouteHintZ_free(number[] _res); // struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_ok(struct LDKRoute o); - public static native uint32_t CResult_RouteLightningErrorZ_ok(uint32_t o); + public static native number CResult_RouteLightningErrorZ_ok(number o); // struct LDKCResult_RouteLightningErrorZ CResult_RouteLightningErrorZ_err(struct LDKLightningError e); - public static native uint32_t CResult_RouteLightningErrorZ_err(uint32_t e); + public static native number CResult_RouteLightningErrorZ_err(number e); // void CResult_RouteLightningErrorZ_free(struct LDKCResult_RouteLightningErrorZ _res); - public static native void CResult_RouteLightningErrorZ_free(uint32_t _res); + public static native void CResult_RouteLightningErrorZ_free(number _res); // struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_ok(struct LDKRoutingFees o); - public static native uint32_t CResult_RoutingFeesDecodeErrorZ_ok(uint32_t o); + public static native number CResult_RoutingFeesDecodeErrorZ_ok(number o); // struct LDKCResult_RoutingFeesDecodeErrorZ CResult_RoutingFeesDecodeErrorZ_err(struct LDKDecodeError e); - public static native uint32_t CResult_RoutingFeesDecodeErrorZ_err(uint32_t e); + public static native number CResult_RoutingFeesDecodeErrorZ_err(number e); // void CResult_RoutingFeesDecodeErrorZ_free(struct LDKCResult_RoutingFeesDecodeErrorZ _res); - public static native void CResult_RoutingFeesDecodeErrorZ_free(uint32_t _res); + public static native void CResult_RoutingFeesDecodeErrorZ_free(number _res); // struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_ok(struct LDKNodeAnnouncementInfo o); - public static native uint32_t CResult_NodeAnnouncementInfoDecodeErrorZ_ok(uint32_t o); + public static native number CResult_NodeAnnouncementInfoDecodeErrorZ_ok(number o); // struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ CResult_NodeAnnouncementInfoDecodeErrorZ_err(struct LDKDecodeError e); - public static native uint32_t CResult_NodeAnnouncementInfoDecodeErrorZ_err(uint32_t e); + public static native number CResult_NodeAnnouncementInfoDecodeErrorZ_err(number e); // void CResult_NodeAnnouncementInfoDecodeErrorZ_free(struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res); - public static native void CResult_NodeAnnouncementInfoDecodeErrorZ_free(uint32_t _res); + public static native void CResult_NodeAnnouncementInfoDecodeErrorZ_free(number _res); // struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_ok(struct LDKNodeInfo o); - public static native uint32_t CResult_NodeInfoDecodeErrorZ_ok(uint32_t o); + public static native number CResult_NodeInfoDecodeErrorZ_ok(number o); // struct LDKCResult_NodeInfoDecodeErrorZ CResult_NodeInfoDecodeErrorZ_err(struct LDKDecodeError e); - public static native uint32_t CResult_NodeInfoDecodeErrorZ_err(uint32_t e); + public static native number CResult_NodeInfoDecodeErrorZ_err(number e); // void CResult_NodeInfoDecodeErrorZ_free(struct LDKCResult_NodeInfoDecodeErrorZ _res); - public static native void CResult_NodeInfoDecodeErrorZ_free(uint32_t _res); + public static native void CResult_NodeInfoDecodeErrorZ_free(number _res); // struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_ok(struct LDKNetworkGraph o); - public static native uint32_t CResult_NetworkGraphDecodeErrorZ_ok(uint32_t o); + public static native number CResult_NetworkGraphDecodeErrorZ_ok(number o); // struct LDKCResult_NetworkGraphDecodeErrorZ CResult_NetworkGraphDecodeErrorZ_err(struct LDKDecodeError e); - public static native uint32_t CResult_NetworkGraphDecodeErrorZ_err(uint32_t e); + public static native number CResult_NetworkGraphDecodeErrorZ_err(number e); // void CResult_NetworkGraphDecodeErrorZ_free(struct LDKCResult_NetworkGraphDecodeErrorZ _res); - public static native void CResult_NetworkGraphDecodeErrorZ_free(uint32_t _res); + public static native void CResult_NetworkGraphDecodeErrorZ_free(number _res); // void Event_free(struct LDKEvent this_ptr); - public static native void Event_free(uint32_t this_ptr); + public static native void Event_free(number this_ptr); // struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig); - public static native uint32_t Event_clone(uint32_t orig); + public static native number Event_clone(number orig); // struct LDKCVec_u8Z Event_write(const struct LDKEvent *NONNULL_PTR obj); - public static native byte[] Event_write(uint32_t obj); + public static native Uint8Array Event_write(number obj); // void MessageSendEvent_free(struct LDKMessageSendEvent this_ptr); - public static native void MessageSendEvent_free(uint32_t this_ptr); + public static native void MessageSendEvent_free(number this_ptr); // struct LDKMessageSendEvent MessageSendEvent_clone(const struct LDKMessageSendEvent *NONNULL_PTR orig); - public static native uint32_t MessageSendEvent_clone(uint32_t orig); + public static native number MessageSendEvent_clone(number orig); // void MessageSendEventsProvider_free(struct LDKMessageSendEventsProvider this_ptr); - public static native void MessageSendEventsProvider_free(uint32_t this_ptr); + public static native void MessageSendEventsProvider_free(number this_ptr); // void EventsProvider_free(struct LDKEventsProvider this_ptr); - public static native void EventsProvider_free(uint32_t this_ptr); + public static native void EventsProvider_free(number this_ptr); // void APIError_free(struct LDKAPIError this_ptr); - public static native void APIError_free(uint32_t this_ptr); + public static native void APIError_free(number this_ptr); // struct LDKAPIError APIError_clone(const struct LDKAPIError *NONNULL_PTR orig); - public static native uint32_t APIError_clone(uint32_t orig); + public static native number APIError_clone(number orig); // enum LDKLevel Level_clone(const enum LDKLevel *NONNULL_PTR orig); - public static native LDKLevel Level_clone(uint32_t orig); + public static native LDKLevel Level_clone(number orig); // MUST_USE_RES enum LDKLevel Level_max(void); public static native LDKLevel Level_max(); // void Logger_free(struct LDKLogger this_ptr); - public static native void Logger_free(uint32_t this_ptr); + public static native void Logger_free(number this_ptr); // void ChannelHandshakeConfig_free(struct LDKChannelHandshakeConfig this_ptr); - public static native void ChannelHandshakeConfig_free(uint32_t this_ptr); + public static native void ChannelHandshakeConfig_free(number this_ptr); // struct LDKChannelHandshakeConfig ChannelHandshakeConfig_clone(const struct LDKChannelHandshakeConfig *NONNULL_PTR orig); - public static native uint32_t ChannelHandshakeConfig_clone(uint32_t orig); + public static native number ChannelHandshakeConfig_clone(number orig); // uint32_t ChannelHandshakeConfig_get_minimum_depth(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr); - public static native int ChannelHandshakeConfig_get_minimum_depth(uint32_t this_ptr); + public static native number ChannelHandshakeConfig_get_minimum_depth(number this_ptr); // void ChannelHandshakeConfig_set_minimum_depth(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint32_t val); - public static native void ChannelHandshakeConfig_set_minimum_depth(uint32_t this_ptr, int val); + public static native void ChannelHandshakeConfig_set_minimum_depth(number this_ptr, number val); // uint16_t ChannelHandshakeConfig_get_our_to_self_delay(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr); - public static native short ChannelHandshakeConfig_get_our_to_self_delay(uint32_t this_ptr); + public static native number ChannelHandshakeConfig_get_our_to_self_delay(number this_ptr); // void ChannelHandshakeConfig_set_our_to_self_delay(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint16_t val); - public static native void ChannelHandshakeConfig_set_our_to_self_delay(uint32_t this_ptr, short val); + public static native void ChannelHandshakeConfig_set_our_to_self_delay(number this_ptr, number val); // uint64_t ChannelHandshakeConfig_get_our_htlc_minimum_msat(const struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr); - public static native long ChannelHandshakeConfig_get_our_htlc_minimum_msat(uint32_t this_ptr); + public static native number ChannelHandshakeConfig_get_our_htlc_minimum_msat(number this_ptr); // void ChannelHandshakeConfig_set_our_htlc_minimum_msat(struct LDKChannelHandshakeConfig *NONNULL_PTR this_ptr, uint64_t val); - public static native void ChannelHandshakeConfig_set_our_htlc_minimum_msat(uint32_t this_ptr, long val); + public static native void ChannelHandshakeConfig_set_our_htlc_minimum_msat(number this_ptr, number val); // MUST_USE_RES struct 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 uint32_t ChannelHandshakeConfig_new(int minimum_depth_arg, short our_to_self_delay_arg, long our_htlc_minimum_msat_arg); + public static native number ChannelHandshakeConfig_new(number minimum_depth_arg, number our_to_self_delay_arg, number our_htlc_minimum_msat_arg); // MUST_USE_RES struct LDKChannelHandshakeConfig ChannelHandshakeConfig_default(void); - public static native uint32_t ChannelHandshakeConfig_default(); + public static native number ChannelHandshakeConfig_default(); // void ChannelHandshakeLimits_free(struct LDKChannelHandshakeLimits this_ptr); - public static native void ChannelHandshakeLimits_free(uint32_t this_ptr); + public static native void ChannelHandshakeLimits_free(number this_ptr); // struct LDKChannelHandshakeLimits ChannelHandshakeLimits_clone(const struct LDKChannelHandshakeLimits *NONNULL_PTR orig); - public static native uint32_t ChannelHandshakeLimits_clone(uint32_t orig); + public static native number ChannelHandshakeLimits_clone(number orig); // uint64_t ChannelHandshakeLimits_get_min_funding_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); - public static native long ChannelHandshakeLimits_get_min_funding_satoshis(uint32_t this_ptr); + public static native number ChannelHandshakeLimits_get_min_funding_satoshis(number this_ptr); // void ChannelHandshakeLimits_set_min_funding_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val); - public static native void ChannelHandshakeLimits_set_min_funding_satoshis(uint32_t this_ptr, long val); + public static native void ChannelHandshakeLimits_set_min_funding_satoshis(number this_ptr, number val); // uint64_t ChannelHandshakeLimits_get_max_htlc_minimum_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); - public static native long ChannelHandshakeLimits_get_max_htlc_minimum_msat(uint32_t this_ptr); + public static native number ChannelHandshakeLimits_get_max_htlc_minimum_msat(number this_ptr); // void ChannelHandshakeLimits_set_max_htlc_minimum_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val); - public static native void ChannelHandshakeLimits_set_max_htlc_minimum_msat(uint32_t this_ptr, long val); + public static native void ChannelHandshakeLimits_set_max_htlc_minimum_msat(number this_ptr, number val); // uint64_t ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); - public static native long ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(uint32_t this_ptr); + public static native number ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(number this_ptr); // void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val); - public static native void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(uint32_t this_ptr, long val); + public static native void ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(number this_ptr, number val); // uint64_t ChannelHandshakeLimits_get_max_channel_reserve_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); - public static native long ChannelHandshakeLimits_get_max_channel_reserve_satoshis(uint32_t this_ptr); + public static native number ChannelHandshakeLimits_get_max_channel_reserve_satoshis(number this_ptr); // void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val); - public static native void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(uint32_t this_ptr, long val); + public static native void ChannelHandshakeLimits_set_max_channel_reserve_satoshis(number this_ptr, number val); // uint16_t ChannelHandshakeLimits_get_min_max_accepted_htlcs(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); - public static native short ChannelHandshakeLimits_get_min_max_accepted_htlcs(uint32_t this_ptr); + public static native number ChannelHandshakeLimits_get_min_max_accepted_htlcs(number this_ptr); // void ChannelHandshakeLimits_set_min_max_accepted_htlcs(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val); - public static native void ChannelHandshakeLimits_set_min_max_accepted_htlcs(uint32_t this_ptr, short val); + public static native void ChannelHandshakeLimits_set_min_max_accepted_htlcs(number this_ptr, number val); // uint64_t ChannelHandshakeLimits_get_min_dust_limit_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); - public static native long ChannelHandshakeLimits_get_min_dust_limit_satoshis(uint32_t this_ptr); + public static native number ChannelHandshakeLimits_get_min_dust_limit_satoshis(number this_ptr); // void ChannelHandshakeLimits_set_min_dust_limit_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val); - public static native void ChannelHandshakeLimits_set_min_dust_limit_satoshis(uint32_t this_ptr, long val); + public static native void ChannelHandshakeLimits_set_min_dust_limit_satoshis(number this_ptr, number val); // uint64_t ChannelHandshakeLimits_get_max_dust_limit_satoshis(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); - public static native long ChannelHandshakeLimits_get_max_dust_limit_satoshis(uint32_t this_ptr); + public static native number ChannelHandshakeLimits_get_max_dust_limit_satoshis(number this_ptr); // void ChannelHandshakeLimits_set_max_dust_limit_satoshis(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint64_t val); - public static native void ChannelHandshakeLimits_set_max_dust_limit_satoshis(uint32_t this_ptr, long val); + public static native void ChannelHandshakeLimits_set_max_dust_limit_satoshis(number this_ptr, number val); // uint32_t ChannelHandshakeLimits_get_max_minimum_depth(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); - public static native int ChannelHandshakeLimits_get_max_minimum_depth(uint32_t this_ptr); + public static native number ChannelHandshakeLimits_get_max_minimum_depth(number this_ptr); // void ChannelHandshakeLimits_set_max_minimum_depth(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint32_t val); - public static native void ChannelHandshakeLimits_set_max_minimum_depth(uint32_t this_ptr, int val); + public static native void ChannelHandshakeLimits_set_max_minimum_depth(number this_ptr, number val); // bool ChannelHandshakeLimits_get_force_announced_channel_preference(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); - public static native boolean ChannelHandshakeLimits_get_force_announced_channel_preference(uint32_t this_ptr); + public static native boolean ChannelHandshakeLimits_get_force_announced_channel_preference(number this_ptr); // void ChannelHandshakeLimits_set_force_announced_channel_preference(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, bool val); - public static native void ChannelHandshakeLimits_set_force_announced_channel_preference(uint32_t this_ptr, boolean val); + public static native void ChannelHandshakeLimits_set_force_announced_channel_preference(number this_ptr, boolean val); // uint16_t ChannelHandshakeLimits_get_their_to_self_delay(const struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr); - public static native short ChannelHandshakeLimits_get_their_to_self_delay(uint32_t this_ptr); + public static native number ChannelHandshakeLimits_get_their_to_self_delay(number this_ptr); // void ChannelHandshakeLimits_set_their_to_self_delay(struct LDKChannelHandshakeLimits *NONNULL_PTR this_ptr, uint16_t val); - public static native void ChannelHandshakeLimits_set_their_to_self_delay(uint32_t this_ptr, short val); + public static native void ChannelHandshakeLimits_set_their_to_self_delay(number this_ptr, number val); // MUST_USE_RES struct 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 uint32_t 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); + public static native number ChannelHandshakeLimits_new(number min_funding_satoshis_arg, number max_htlc_minimum_msat_arg, number min_max_htlc_value_in_flight_msat_arg, number max_channel_reserve_satoshis_arg, number min_max_accepted_htlcs_arg, number min_dust_limit_satoshis_arg, number max_dust_limit_satoshis_arg, number max_minimum_depth_arg, boolean force_announced_channel_preference_arg, number their_to_self_delay_arg); // MUST_USE_RES struct LDKChannelHandshakeLimits ChannelHandshakeLimits_default(void); - public static native uint32_t ChannelHandshakeLimits_default(); + public static native number ChannelHandshakeLimits_default(); // void ChannelConfig_free(struct LDKChannelConfig this_ptr); - public static native void ChannelConfig_free(uint32_t this_ptr); + public static native void ChannelConfig_free(number this_ptr); // struct LDKChannelConfig ChannelConfig_clone(const struct LDKChannelConfig *NONNULL_PTR orig); - public static native uint32_t ChannelConfig_clone(uint32_t orig); + public static native number ChannelConfig_clone(number orig); // uint32_t ChannelConfig_get_fee_proportional_millionths(const struct LDKChannelConfig *NONNULL_PTR this_ptr); - public static native int ChannelConfig_get_fee_proportional_millionths(uint32_t this_ptr); + public static native number ChannelConfig_get_fee_proportional_millionths(number this_ptr); // void ChannelConfig_set_fee_proportional_millionths(struct LDKChannelConfig *NONNULL_PTR this_ptr, uint32_t val); - public static native void ChannelConfig_set_fee_proportional_millionths(uint32_t this_ptr, int val); + public static native void ChannelConfig_set_fee_proportional_millionths(number this_ptr, number val); // bool ChannelConfig_get_announced_channel(const struct LDKChannelConfig *NONNULL_PTR this_ptr); - public static native boolean ChannelConfig_get_announced_channel(uint32_t this_ptr); + public static native boolean ChannelConfig_get_announced_channel(number this_ptr); // void ChannelConfig_set_announced_channel(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val); - public static native void ChannelConfig_set_announced_channel(uint32_t this_ptr, boolean val); + public static native void ChannelConfig_set_announced_channel(number this_ptr, boolean val); // bool ChannelConfig_get_commit_upfront_shutdown_pubkey(const struct LDKChannelConfig *NONNULL_PTR this_ptr); - public static native boolean ChannelConfig_get_commit_upfront_shutdown_pubkey(uint32_t this_ptr); + public static native boolean ChannelConfig_get_commit_upfront_shutdown_pubkey(number this_ptr); // void ChannelConfig_set_commit_upfront_shutdown_pubkey(struct LDKChannelConfig *NONNULL_PTR this_ptr, bool val); - public static native void ChannelConfig_set_commit_upfront_shutdown_pubkey(uint32_t this_ptr, boolean val); + public static native void ChannelConfig_set_commit_upfront_shutdown_pubkey(number this_ptr, boolean val); // MUST_USE_RES struct LDKChannelConfig ChannelConfig_new(uint32_t fee_proportional_millionths_arg, bool announced_channel_arg, bool commit_upfront_shutdown_pubkey_arg); - public static native uint32_t ChannelConfig_new(int fee_proportional_millionths_arg, boolean announced_channel_arg, boolean commit_upfront_shutdown_pubkey_arg); + public static native number ChannelConfig_new(number fee_proportional_millionths_arg, boolean announced_channel_arg, boolean commit_upfront_shutdown_pubkey_arg); // MUST_USE_RES struct LDKChannelConfig ChannelConfig_default(void); - public static native uint32_t ChannelConfig_default(); + public static native number ChannelConfig_default(); // struct LDKCVec_u8Z ChannelConfig_write(const struct LDKChannelConfig *NONNULL_PTR obj); - public static native byte[] ChannelConfig_write(uint32_t obj); + public static native Uint8Array ChannelConfig_write(number obj); // struct LDKChannelConfig ChannelConfig_read(struct LDKu8slice ser); - public static native uint32_t ChannelConfig_read(byte[] ser); + public static native number ChannelConfig_read(Uint8Array ser); // void UserConfig_free(struct LDKUserConfig this_ptr); - public static native void UserConfig_free(uint32_t this_ptr); + public static native void UserConfig_free(number this_ptr); // struct LDKUserConfig UserConfig_clone(const struct LDKUserConfig *NONNULL_PTR orig); - public static native uint32_t UserConfig_clone(uint32_t orig); + public static native number UserConfig_clone(number orig); // struct LDKChannelHandshakeConfig UserConfig_get_own_channel_config(const struct LDKUserConfig *NONNULL_PTR this_ptr); - public static native uint32_t UserConfig_get_own_channel_config(uint32_t this_ptr); + public static native number UserConfig_get_own_channel_config(number this_ptr); // void UserConfig_set_own_channel_config(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeConfig val); - public static native void UserConfig_set_own_channel_config(uint32_t this_ptr, uint32_t val); + public static native void UserConfig_set_own_channel_config(number this_ptr, number val); // struct LDKChannelHandshakeLimits UserConfig_get_peer_channel_config_limits(const struct LDKUserConfig *NONNULL_PTR this_ptr); - public static native uint32_t UserConfig_get_peer_channel_config_limits(uint32_t this_ptr); + public static native number UserConfig_get_peer_channel_config_limits(number this_ptr); // void UserConfig_set_peer_channel_config_limits(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelHandshakeLimits val); - public static native void UserConfig_set_peer_channel_config_limits(uint32_t this_ptr, uint32_t val); + public static native void UserConfig_set_peer_channel_config_limits(number this_ptr, number val); // struct LDKChannelConfig UserConfig_get_channel_options(const struct LDKUserConfig *NONNULL_PTR this_ptr); - public static native uint32_t UserConfig_get_channel_options(uint32_t this_ptr); + public static native number UserConfig_get_channel_options(number this_ptr); // void UserConfig_set_channel_options(struct LDKUserConfig *NONNULL_PTR this_ptr, struct LDKChannelConfig val); - public static native void UserConfig_set_channel_options(uint32_t this_ptr, uint32_t val); + public static native void UserConfig_set_channel_options(number this_ptr, number val); // MUST_USE_RES struct LDKUserConfig UserConfig_new(struct LDKChannelHandshakeConfig own_channel_config_arg, struct LDKChannelHandshakeLimits peer_channel_config_limits_arg, struct LDKChannelConfig channel_options_arg); - public static native uint32_t UserConfig_new(uint32_t own_channel_config_arg, uint32_t peer_channel_config_limits_arg, uint32_t channel_options_arg); + public static native number UserConfig_new(number own_channel_config_arg, number peer_channel_config_limits_arg, number channel_options_arg); // MUST_USE_RES struct LDKUserConfig UserConfig_default(void); - public static native uint32_t UserConfig_default(); + public static native number UserConfig_default(); // enum LDKAccessError AccessError_clone(const enum LDKAccessError *NONNULL_PTR orig); - public static native LDKAccessError AccessError_clone(uint32_t orig); + public static native LDKAccessError AccessError_clone(number orig); // void Access_free(struct LDKAccess this_ptr); - public static native void Access_free(uint32_t this_ptr); + public static native void Access_free(number this_ptr); // void Watch_free(struct LDKWatch this_ptr); - public static native void Watch_free(uint32_t this_ptr); + public static native void Watch_free(number this_ptr); // void Filter_free(struct LDKFilter this_ptr); - public static native void Filter_free(uint32_t this_ptr); + public static native void Filter_free(number this_ptr); // void BroadcasterInterface_free(struct LDKBroadcasterInterface this_ptr); - public static native void BroadcasterInterface_free(uint32_t this_ptr); + public static native void BroadcasterInterface_free(number this_ptr); // enum LDKConfirmationTarget ConfirmationTarget_clone(const enum LDKConfirmationTarget *NONNULL_PTR orig); - public static native LDKConfirmationTarget ConfirmationTarget_clone(uint32_t orig); + public static native LDKConfirmationTarget ConfirmationTarget_clone(number orig); // void FeeEstimator_free(struct LDKFeeEstimator this_ptr); - public static native void FeeEstimator_free(uint32_t this_ptr); + public static native void FeeEstimator_free(number this_ptr); // void ChainMonitor_free(struct LDKChainMonitor this_ptr); - public static native void ChainMonitor_free(uint32_t this_ptr); + public static native void ChainMonitor_free(number this_ptr); // void ChainMonitor_block_connected(const struct LDKChainMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height); - public static native void ChainMonitor_block_connected(uint32_t this_arg, byte[] header, uint32_t[] txdata, int height); + public static native void ChainMonitor_block_connected(number this_arg, Uint8Array header, number[] txdata, number height); // void ChainMonitor_block_disconnected(const struct LDKChainMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t disconnected_height); - public static native void ChainMonitor_block_disconnected(uint32_t this_arg, byte[] header, int disconnected_height); + public static native void ChainMonitor_block_disconnected(number this_arg, Uint8Array header, number disconnected_height); // MUST_USE_RES struct LDKChainMonitor ChainMonitor_new(struct LDKFilter *chain_source, struct LDKBroadcasterInterface broadcaster, struct LDKLogger logger, struct LDKFeeEstimator feeest, struct LDKPersist persister); - public static native uint32_t ChainMonitor_new(uint32_t chain_source, uint32_t broadcaster, uint32_t logger, uint32_t feeest, uint32_t persister); + public static native number ChainMonitor_new(number chain_source, number broadcaster, number logger, number feeest, number persister); // struct LDKWatch ChainMonitor_as_Watch(const struct LDKChainMonitor *NONNULL_PTR this_arg); - public static native uint32_t ChainMonitor_as_Watch(uint32_t this_arg); + public static native number ChainMonitor_as_Watch(number this_arg); // struct LDKEventsProvider ChainMonitor_as_EventsProvider(const struct LDKChainMonitor *NONNULL_PTR this_arg); - public static native uint32_t ChainMonitor_as_EventsProvider(uint32_t this_arg); + public static native number ChainMonitor_as_EventsProvider(number this_arg); // void ChannelMonitorUpdate_free(struct LDKChannelMonitorUpdate this_ptr); - public static native void ChannelMonitorUpdate_free(uint32_t this_ptr); + public static native void ChannelMonitorUpdate_free(number this_ptr); // struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig); - public static native uint32_t ChannelMonitorUpdate_clone(uint32_t orig); + public static native number ChannelMonitorUpdate_clone(number orig); // uint64_t ChannelMonitorUpdate_get_update_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr); - public static native long ChannelMonitorUpdate_get_update_id(uint32_t this_ptr); + public static native number ChannelMonitorUpdate_get_update_id(number this_ptr); // void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val); - public static native void ChannelMonitorUpdate_set_update_id(uint32_t this_ptr, long val); + public static native void ChannelMonitorUpdate_set_update_id(number this_ptr, number val); // struct LDKCVec_u8Z ChannelMonitorUpdate_write(const struct LDKChannelMonitorUpdate *NONNULL_PTR obj); - public static native byte[] ChannelMonitorUpdate_write(uint32_t obj); + public static native Uint8Array ChannelMonitorUpdate_write(number obj); // struct LDKCResult_ChannelMonitorUpdateDecodeErrorZ ChannelMonitorUpdate_read(struct LDKu8slice ser); - public static native uint32_t ChannelMonitorUpdate_read(byte[] ser); + public static native number ChannelMonitorUpdate_read(Uint8Array ser); // enum LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(const enum LDKChannelMonitorUpdateErr *NONNULL_PTR orig); - public static native LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(uint32_t orig); + public static native LDKChannelMonitorUpdateErr ChannelMonitorUpdateErr_clone(number orig); // void MonitorUpdateError_free(struct LDKMonitorUpdateError this_ptr); - public static native void MonitorUpdateError_free(uint32_t this_ptr); + public static native void MonitorUpdateError_free(number this_ptr); // void MonitorEvent_free(struct LDKMonitorEvent this_ptr); - public static native void MonitorEvent_free(uint32_t this_ptr); + public static native void MonitorEvent_free(number this_ptr); // struct LDKMonitorEvent MonitorEvent_clone(const struct LDKMonitorEvent *NONNULL_PTR orig); - public static native uint32_t MonitorEvent_clone(uint32_t orig); + public static native number MonitorEvent_clone(number orig); // void HTLCUpdate_free(struct LDKHTLCUpdate this_ptr); - public static native void HTLCUpdate_free(uint32_t this_ptr); + public static native void HTLCUpdate_free(number this_ptr); // struct LDKHTLCUpdate HTLCUpdate_clone(const struct LDKHTLCUpdate *NONNULL_PTR orig); - public static native uint32_t HTLCUpdate_clone(uint32_t orig); + public static native number HTLCUpdate_clone(number orig); // struct LDKCVec_u8Z HTLCUpdate_write(const struct LDKHTLCUpdate *NONNULL_PTR obj); - public static native byte[] HTLCUpdate_write(uint32_t obj); + public static native Uint8Array HTLCUpdate_write(number obj); // struct LDKHTLCUpdate HTLCUpdate_read(struct LDKu8slice ser); - public static native uint32_t HTLCUpdate_read(byte[] ser); + public static native number HTLCUpdate_read(Uint8Array ser); // void ChannelMonitor_free(struct LDKChannelMonitor this_ptr); - public static native void ChannelMonitor_free(uint32_t this_ptr); + public static native void ChannelMonitor_free(number this_ptr); // struct LDKCVec_u8Z ChannelMonitor_write(const struct LDKChannelMonitor *NONNULL_PTR obj); - public static native byte[] ChannelMonitor_write(uint32_t obj); + public static native Uint8Array ChannelMonitor_write(number obj); // MUST_USE_RES struct LDKCResult_NoneMonitorUpdateErrorZ ChannelMonitor_update_monitor(struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKChannelMonitorUpdate *NONNULL_PTR updates, const struct LDKBroadcasterInterface *NONNULL_PTR broadcaster, const struct LDKFeeEstimator *NONNULL_PTR fee_estimator, const struct LDKLogger *NONNULL_PTR logger); - public static native uint32_t ChannelMonitor_update_monitor(uint32_t this_arg, uint32_t updates, uint32_t broadcaster, uint32_t fee_estimator, uint32_t logger); + public static native number ChannelMonitor_update_monitor(number this_arg, number updates, number broadcaster, number fee_estimator, number logger); // MUST_USE_RES uint64_t ChannelMonitor_get_latest_update_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg); - public static native long ChannelMonitor_get_latest_update_id(uint32_t this_arg); + public static native number ChannelMonitor_get_latest_update_id(number this_arg); // MUST_USE_RES struct LDKC2Tuple_OutPointScriptZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg); - public static native uint32_t ChannelMonitor_get_funding_txo(uint32_t this_arg); + public static native number ChannelMonitor_get_funding_txo(number this_arg); // MUST_USE_RES struct LDKCVec_MonitorEventZ ChannelMonitor_get_and_clear_pending_monitor_events(struct LDKChannelMonitor *NONNULL_PTR this_arg); - public static native uint32_t[] ChannelMonitor_get_and_clear_pending_monitor_events(uint32_t this_arg); + public static native number[] ChannelMonitor_get_and_clear_pending_monitor_events(number this_arg); // MUST_USE_RES struct LDKCVec_EventZ ChannelMonitor_get_and_clear_pending_events(struct LDKChannelMonitor *NONNULL_PTR this_arg); - public static native uint32_t[] ChannelMonitor_get_and_clear_pending_events(uint32_t this_arg); + public static native number[] ChannelMonitor_get_and_clear_pending_events(number this_arg); // MUST_USE_RES struct LDKCVec_TransactionZ ChannelMonitor_get_latest_holder_commitment_txn(struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKLogger *NONNULL_PTR logger); - public static native byte[][] ChannelMonitor_get_latest_holder_commitment_txn(uint32_t this_arg, uint32_t logger); + public static native Uint8Array[] ChannelMonitor_get_latest_holder_commitment_txn(number this_arg, number logger); // MUST_USE_RES struct LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ChannelMonitor_block_connected(struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger); - public static native uint32_t[] ChannelMonitor_block_connected(uint32_t this_arg, byte[] header, uint32_t[] txdata, int height, uint32_t broadcaster, uint32_t fee_estimator, uint32_t logger); + public static native number[] ChannelMonitor_block_connected(number this_arg, Uint8Array header, number[] txdata, number height, number broadcaster, number fee_estimator, number logger); // void ChannelMonitor_block_disconnected(struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKLogger logger); - public static native void ChannelMonitor_block_disconnected(uint32_t this_arg, byte[] header, int height, uint32_t broadcaster, uint32_t fee_estimator, uint32_t logger); + public static native void ChannelMonitor_block_disconnected(number this_arg, Uint8Array header, number height, number broadcaster, number fee_estimator, number logger); // void Persist_free(struct LDKPersist this_ptr); - public static native void Persist_free(uint32_t this_ptr); + public static native void Persist_free(number this_ptr); // struct LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ C2Tuple_BlockHashChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKKeysInterface *NONNULL_PTR arg); - public static native uint32_t C2Tuple_BlockHashChannelMonitorZ_read(byte[] ser, uint32_t arg); + public static native number C2Tuple_BlockHashChannelMonitorZ_read(Uint8Array ser, number arg); // void OutPoint_free(struct LDKOutPoint this_ptr); - public static native void OutPoint_free(uint32_t this_ptr); + public static native void OutPoint_free(number this_ptr); // struct LDKOutPoint OutPoint_clone(const struct LDKOutPoint *NONNULL_PTR orig); - public static native uint32_t OutPoint_clone(uint32_t orig); + public static native number OutPoint_clone(number orig); // const uint8_t (*OutPoint_get_txid(const struct LDKOutPoint *NONNULL_PTR this_ptr))[32]; - public static native byte[] OutPoint_get_txid(uint32_t this_ptr); + public static native Uint8Array OutPoint_get_txid(number this_ptr); // void OutPoint_set_txid(struct LDKOutPoint *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void OutPoint_set_txid(uint32_t this_ptr, byte[] val); + public static native void OutPoint_set_txid(number this_ptr, Uint8Array val); // uint16_t OutPoint_get_index(const struct LDKOutPoint *NONNULL_PTR this_ptr); - public static native short OutPoint_get_index(uint32_t this_ptr); + public static native number OutPoint_get_index(number this_ptr); // void OutPoint_set_index(struct LDKOutPoint *NONNULL_PTR this_ptr, uint16_t val); - public static native void OutPoint_set_index(uint32_t this_ptr, short val); + public static native void OutPoint_set_index(number this_ptr, number val); // MUST_USE_RES struct LDKOutPoint OutPoint_new(struct LDKThirtyTwoBytes txid_arg, uint16_t index_arg); - public static native uint32_t OutPoint_new(byte[] txid_arg, short index_arg); + public static native number OutPoint_new(Uint8Array txid_arg, number index_arg); // MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg); - public static native byte[] OutPoint_to_channel_id(uint32_t this_arg); + public static native Uint8Array OutPoint_to_channel_id(number this_arg); // struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj); - public static native byte[] OutPoint_write(uint32_t obj); + public static native Uint8Array OutPoint_write(number obj); // struct LDKOutPoint OutPoint_read(struct LDKu8slice ser); - public static native uint32_t OutPoint_read(byte[] ser); + public static native number OutPoint_read(Uint8Array ser); // void SpendableOutputDescriptor_free(struct LDKSpendableOutputDescriptor this_ptr); - public static native void SpendableOutputDescriptor_free(uint32_t this_ptr); + public static native void SpendableOutputDescriptor_free(number this_ptr); // struct LDKSpendableOutputDescriptor SpendableOutputDescriptor_clone(const struct LDKSpendableOutputDescriptor *NONNULL_PTR orig); - public static native uint32_t SpendableOutputDescriptor_clone(uint32_t orig); + public static native number SpendableOutputDescriptor_clone(number orig); // struct LDKCVec_u8Z SpendableOutputDescriptor_write(const struct LDKSpendableOutputDescriptor *NONNULL_PTR obj); - public static native byte[] SpendableOutputDescriptor_write(uint32_t obj); + public static native Uint8Array SpendableOutputDescriptor_write(number obj); // struct LDKCResult_SpendableOutputDescriptorDecodeErrorZ SpendableOutputDescriptor_read(struct LDKu8slice ser); - public static native uint32_t SpendableOutputDescriptor_read(byte[] ser); + public static native number SpendableOutputDescriptor_read(Uint8Array ser); // struct LDKChannelKeys ChannelKeys_clone(const struct LDKChannelKeys *NONNULL_PTR orig); - public static native uint32_t ChannelKeys_clone(uint32_t orig); + public static native number ChannelKeys_clone(number orig); // void ChannelKeys_free(struct LDKChannelKeys this_ptr); - public static native void ChannelKeys_free(uint32_t this_ptr); + public static native void ChannelKeys_free(number this_ptr); // void KeysInterface_free(struct LDKKeysInterface this_ptr); - public static native void KeysInterface_free(uint32_t this_ptr); + public static native void KeysInterface_free(number this_ptr); // void InMemoryChannelKeys_free(struct LDKInMemoryChannelKeys this_ptr); - public static native void InMemoryChannelKeys_free(uint32_t this_ptr); + public static native void InMemoryChannelKeys_free(number this_ptr); // struct LDKInMemoryChannelKeys InMemoryChannelKeys_clone(const struct LDKInMemoryChannelKeys *NONNULL_PTR orig); - public static native uint32_t InMemoryChannelKeys_clone(uint32_t orig); + public static native number InMemoryChannelKeys_clone(number orig); // const uint8_t (*InMemoryChannelKeys_get_funding_key(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32]; - public static native byte[] InMemoryChannelKeys_get_funding_key(uint32_t this_ptr); + public static native Uint8Array InMemoryChannelKeys_get_funding_key(number this_ptr); // void InMemoryChannelKeys_set_funding_key(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKSecretKey val); - public static native void InMemoryChannelKeys_set_funding_key(uint32_t this_ptr, byte[] val); + public static native void InMemoryChannelKeys_set_funding_key(number this_ptr, Uint8Array val); // const uint8_t (*InMemoryChannelKeys_get_revocation_base_key(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32]; - public static native byte[] InMemoryChannelKeys_get_revocation_base_key(uint32_t this_ptr); + public static native Uint8Array InMemoryChannelKeys_get_revocation_base_key(number this_ptr); // void InMemoryChannelKeys_set_revocation_base_key(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKSecretKey val); - public static native void InMemoryChannelKeys_set_revocation_base_key(uint32_t this_ptr, byte[] val); + public static native void InMemoryChannelKeys_set_revocation_base_key(number this_ptr, Uint8Array val); // const uint8_t (*InMemoryChannelKeys_get_payment_key(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32]; - public static native byte[] InMemoryChannelKeys_get_payment_key(uint32_t this_ptr); + public static native Uint8Array InMemoryChannelKeys_get_payment_key(number this_ptr); // void InMemoryChannelKeys_set_payment_key(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKSecretKey val); - public static native void InMemoryChannelKeys_set_payment_key(uint32_t this_ptr, byte[] val); + public static native void InMemoryChannelKeys_set_payment_key(number this_ptr, Uint8Array val); // const uint8_t (*InMemoryChannelKeys_get_delayed_payment_base_key(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32]; - public static native byte[] InMemoryChannelKeys_get_delayed_payment_base_key(uint32_t this_ptr); + public static native Uint8Array InMemoryChannelKeys_get_delayed_payment_base_key(number this_ptr); // void InMemoryChannelKeys_set_delayed_payment_base_key(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKSecretKey val); - public static native void InMemoryChannelKeys_set_delayed_payment_base_key(uint32_t this_ptr, byte[] val); + public static native void InMemoryChannelKeys_set_delayed_payment_base_key(number this_ptr, Uint8Array val); // const uint8_t (*InMemoryChannelKeys_get_htlc_base_key(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32]; - public static native byte[] InMemoryChannelKeys_get_htlc_base_key(uint32_t this_ptr); + public static native Uint8Array InMemoryChannelKeys_get_htlc_base_key(number this_ptr); // void InMemoryChannelKeys_set_htlc_base_key(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKSecretKey val); - public static native void InMemoryChannelKeys_set_htlc_base_key(uint32_t this_ptr, byte[] val); + public static native void InMemoryChannelKeys_set_htlc_base_key(number this_ptr, Uint8Array val); // const uint8_t (*InMemoryChannelKeys_get_commitment_seed(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr))[32]; - public static native byte[] InMemoryChannelKeys_get_commitment_seed(uint32_t this_ptr); + public static native Uint8Array InMemoryChannelKeys_get_commitment_seed(number this_ptr); // void InMemoryChannelKeys_set_commitment_seed(struct LDKInMemoryChannelKeys *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void InMemoryChannelKeys_set_commitment_seed(uint32_t this_ptr, byte[] val); + public static native void InMemoryChannelKeys_set_commitment_seed(number this_ptr, Uint8Array val); // MUST_USE_RES struct LDKInMemoryChannelKeys InMemoryChannelKeys_new(struct LDKSecretKey funding_key, struct LDKSecretKey revocation_base_key, struct LDKSecretKey payment_key, struct LDKSecretKey delayed_payment_base_key, struct LDKSecretKey htlc_base_key, struct LDKThirtyTwoBytes commitment_seed, uint64_t channel_value_satoshis, struct LDKC2Tuple_u64u64Z key_derivation_params); - public static native uint32_t InMemoryChannelKeys_new(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, uint32_t key_derivation_params); + public static native number InMemoryChannelKeys_new(Uint8Array funding_key, Uint8Array revocation_base_key, Uint8Array payment_key, Uint8Array delayed_payment_base_key, Uint8Array htlc_base_key, Uint8Array commitment_seed, number channel_value_satoshis, number key_derivation_params); // MUST_USE_RES struct LDKChannelPublicKeys InMemoryChannelKeys_counterparty_pubkeys(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg); - public static native uint32_t InMemoryChannelKeys_counterparty_pubkeys(uint32_t this_arg); + public static native number InMemoryChannelKeys_counterparty_pubkeys(number this_arg); // MUST_USE_RES uint16_t InMemoryChannelKeys_counterparty_selected_contest_delay(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg); - public static native short InMemoryChannelKeys_counterparty_selected_contest_delay(uint32_t this_arg); + public static native number InMemoryChannelKeys_counterparty_selected_contest_delay(number this_arg); // MUST_USE_RES uint16_t InMemoryChannelKeys_holder_selected_contest_delay(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg); - public static native short InMemoryChannelKeys_holder_selected_contest_delay(uint32_t this_arg); + public static native number InMemoryChannelKeys_holder_selected_contest_delay(number this_arg); // MUST_USE_RES bool InMemoryChannelKeys_is_outbound(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg); - public static native boolean InMemoryChannelKeys_is_outbound(uint32_t this_arg); + public static native boolean InMemoryChannelKeys_is_outbound(number this_arg); // MUST_USE_RES struct LDKOutPoint InMemoryChannelKeys_funding_outpoint(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg); - public static native uint32_t InMemoryChannelKeys_funding_outpoint(uint32_t this_arg); + public static native number InMemoryChannelKeys_funding_outpoint(number this_arg); // MUST_USE_RES struct LDKChannelTransactionParameters InMemoryChannelKeys_get_channel_parameters(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg); - public static native uint32_t InMemoryChannelKeys_get_channel_parameters(uint32_t this_arg); + public static native number InMemoryChannelKeys_get_channel_parameters(number this_arg); // struct LDKChannelKeys InMemoryChannelKeys_as_ChannelKeys(const struct LDKInMemoryChannelKeys *NONNULL_PTR this_arg); - public static native uint32_t InMemoryChannelKeys_as_ChannelKeys(uint32_t this_arg); + public static native number InMemoryChannelKeys_as_ChannelKeys(number this_arg); // struct LDKCVec_u8Z InMemoryChannelKeys_write(const struct LDKInMemoryChannelKeys *NONNULL_PTR obj); - public static native byte[] InMemoryChannelKeys_write(uint32_t obj); + public static native Uint8Array InMemoryChannelKeys_write(number obj); // struct LDKCResult_InMemoryChannelKeysDecodeErrorZ InMemoryChannelKeys_read(struct LDKu8slice ser); - public static native uint32_t InMemoryChannelKeys_read(byte[] ser); + public static native number InMemoryChannelKeys_read(Uint8Array ser); // void KeysManager_free(struct LDKKeysManager this_ptr); - public static native void KeysManager_free(uint32_t this_ptr); + public static native void KeysManager_free(number this_ptr); // MUST_USE_RES struct LDKKeysManager KeysManager_new(const uint8_t (*seed)[32], enum LDKNetwork network, uint64_t starting_time_secs, uint32_t starting_time_nanos); - public static native uint32_t KeysManager_new(byte[] seed, LDKNetwork network, long starting_time_secs, int starting_time_nanos); + public static native number KeysManager_new(Uint8Array seed, LDKNetwork network, number starting_time_secs, number starting_time_nanos); // MUST_USE_RES struct LDKInMemoryChannelKeys KeysManager_derive_channel_keys(const struct LDKKeysManager *NONNULL_PTR this_arg, uint64_t channel_value_satoshis, uint64_t params_1, uint64_t params_2); - public static native uint32_t KeysManager_derive_channel_keys(uint32_t this_arg, long channel_value_satoshis, long params_1, long params_2); + public static native number KeysManager_derive_channel_keys(number this_arg, number channel_value_satoshis, number params_1, number params_2); // struct LDKKeysInterface KeysManager_as_KeysInterface(const struct LDKKeysManager *NONNULL_PTR this_arg); - public static native uint32_t KeysManager_as_KeysInterface(uint32_t this_arg); + public static native number KeysManager_as_KeysInterface(number this_arg); // void ChannelManager_free(struct LDKChannelManager this_ptr); - public static native void ChannelManager_free(uint32_t this_ptr); + public static native void ChannelManager_free(number this_ptr); // void ChannelDetails_free(struct LDKChannelDetails this_ptr); - public static native void ChannelDetails_free(uint32_t this_ptr); + public static native void ChannelDetails_free(number this_ptr); // struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig); - public static native uint32_t ChannelDetails_clone(uint32_t orig); + public static native number ChannelDetails_clone(number orig); // const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32]; - public static native byte[] ChannelDetails_get_channel_id(uint32_t this_ptr); + public static native Uint8Array ChannelDetails_get_channel_id(number this_ptr); // void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void ChannelDetails_set_channel_id(uint32_t this_ptr, byte[] val); + public static native void ChannelDetails_set_channel_id(number this_ptr, Uint8Array val); // struct LDKPublicKey ChannelDetails_get_remote_network_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - public static native byte[] ChannelDetails_get_remote_network_id(uint32_t this_ptr); + public static native Uint8Array ChannelDetails_get_remote_network_id(number this_ptr); // void ChannelDetails_set_remote_network_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void ChannelDetails_set_remote_network_id(uint32_t this_ptr, byte[] val); + public static native void ChannelDetails_set_remote_network_id(number this_ptr, Uint8Array val); // struct LDKInitFeatures ChannelDetails_get_counterparty_features(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - public static native uint32_t ChannelDetails_get_counterparty_features(uint32_t this_ptr); + public static native number ChannelDetails_get_counterparty_features(number this_ptr); // void ChannelDetails_set_counterparty_features(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKInitFeatures val); - public static native void ChannelDetails_set_counterparty_features(uint32_t this_ptr, uint32_t val); + public static native void ChannelDetails_set_counterparty_features(number this_ptr, number val); // uint64_t ChannelDetails_get_channel_value_satoshis(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - public static native long ChannelDetails_get_channel_value_satoshis(uint32_t this_ptr); + public static native number ChannelDetails_get_channel_value_satoshis(number this_ptr); // void ChannelDetails_set_channel_value_satoshis(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); - public static native void ChannelDetails_set_channel_value_satoshis(uint32_t this_ptr, long val); + public static native void ChannelDetails_set_channel_value_satoshis(number this_ptr, number val); // uint64_t ChannelDetails_get_user_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - public static native long ChannelDetails_get_user_id(uint32_t this_ptr); + public static native number ChannelDetails_get_user_id(number this_ptr); // void ChannelDetails_set_user_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); - public static native void ChannelDetails_set_user_id(uint32_t this_ptr, long val); + public static native void ChannelDetails_set_user_id(number this_ptr, number val); // uint64_t ChannelDetails_get_outbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - public static native long ChannelDetails_get_outbound_capacity_msat(uint32_t this_ptr); + public static native number ChannelDetails_get_outbound_capacity_msat(number this_ptr); // void ChannelDetails_set_outbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); - public static native void ChannelDetails_set_outbound_capacity_msat(uint32_t this_ptr, long val); + public static native void ChannelDetails_set_outbound_capacity_msat(number this_ptr, number val); // uint64_t ChannelDetails_get_inbound_capacity_msat(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - public static native long ChannelDetails_get_inbound_capacity_msat(uint32_t this_ptr); + public static native number ChannelDetails_get_inbound_capacity_msat(number this_ptr); // void ChannelDetails_set_inbound_capacity_msat(struct LDKChannelDetails *NONNULL_PTR this_ptr, uint64_t val); - public static native void ChannelDetails_set_inbound_capacity_msat(uint32_t this_ptr, long val); + public static native void ChannelDetails_set_inbound_capacity_msat(number this_ptr, number val); // bool ChannelDetails_get_is_live(const struct LDKChannelDetails *NONNULL_PTR this_ptr); - public static native boolean ChannelDetails_get_is_live(uint32_t this_ptr); + public static native boolean ChannelDetails_get_is_live(number this_ptr); // void ChannelDetails_set_is_live(struct LDKChannelDetails *NONNULL_PTR this_ptr, bool val); - public static native void ChannelDetails_set_is_live(uint32_t this_ptr, boolean val); + public static native void ChannelDetails_set_is_live(number this_ptr, boolean val); // void PaymentSendFailure_free(struct LDKPaymentSendFailure this_ptr); - public static native void PaymentSendFailure_free(uint32_t this_ptr); + public static native void PaymentSendFailure_free(number this_ptr); // MUST_USE_RES struct LDKChannelManager ChannelManager_new(enum LDKNetwork network, struct LDKFeeEstimator fee_est, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKLogger logger, struct LDKKeysInterface keys_manager, struct LDKUserConfig config, uintptr_t current_blockchain_height); - public static native uint32_t ChannelManager_new(LDKNetwork network, uint32_t fee_est, uint32_t chain_monitor, uint32_t tx_broadcaster, uint32_t logger, uint32_t keys_manager, uint32_t config, long current_blockchain_height); + public static native number ChannelManager_new(LDKNetwork network, number fee_est, number chain_monitor, number tx_broadcaster, number logger, number keys_manager, number config, number current_blockchain_height); // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_create_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey their_network_key, uint64_t channel_value_satoshis, uint64_t push_msat, uint64_t user_id, struct LDKUserConfig override_config); - public static native uint32_t ChannelManager_create_channel(uint32_t this_arg, byte[] their_network_key, long channel_value_satoshis, long push_msat, long user_id, uint32_t override_config); + public static native number ChannelManager_create_channel(number this_arg, Uint8Array their_network_key, number channel_value_satoshis, number push_msat, number user_id, number override_config); // MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg); - public static native uint32_t[] ChannelManager_list_channels(uint32_t this_arg); + public static native number[] ChannelManager_list_channels(number this_arg); // MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_usable_channels(const struct LDKChannelManager *NONNULL_PTR this_arg); - public static native uint32_t[] ChannelManager_list_usable_channels(uint32_t this_arg); + public static native number[] ChannelManager_list_usable_channels(number this_arg); // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]); - public static native uint32_t ChannelManager_close_channel(uint32_t this_arg, byte[] channel_id); + public static native number ChannelManager_close_channel(number this_arg, Uint8Array channel_id); // void ChannelManager_force_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32]); - public static native void ChannelManager_force_close_channel(uint32_t this_arg, byte[] channel_id); + public static native void ChannelManager_force_close_channel(number this_arg, Uint8Array channel_id); // void ChannelManager_force_close_all_channels(const struct LDKChannelManager *NONNULL_PTR this_arg); - public static native void ChannelManager_force_close_all_channels(uint32_t this_arg); + public static native void ChannelManager_force_close_all_channels(number this_arg); // MUST_USE_RES struct LDKCResult_NonePaymentSendFailureZ ChannelManager_send_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRoute *NONNULL_PTR route, struct LDKThirtyTwoBytes payment_hash, struct LDKThirtyTwoBytes payment_secret); - public static native uint32_t ChannelManager_send_payment(uint32_t this_arg, uint32_t route, byte[] payment_hash, byte[] payment_secret); + public static native number ChannelManager_send_payment(number this_arg, number route, Uint8Array payment_hash, Uint8Array payment_secret); // void ChannelManager_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], struct LDKOutPoint funding_txo); - public static native void ChannelManager_funding_transaction_generated(uint32_t this_arg, byte[] temporary_channel_id, uint32_t funding_txo); + public static native void ChannelManager_funding_transaction_generated(number this_arg, Uint8Array temporary_channel_id, number funding_txo); // void ChannelManager_broadcast_node_announcement(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThreeBytes rgb, struct LDKThirtyTwoBytes alias, struct LDKCVec_NetAddressZ addresses); - public static native void ChannelManager_broadcast_node_announcement(uint32_t this_arg, byte[] rgb, byte[] alias, uint32_t[] addresses); + public static native void ChannelManager_broadcast_node_announcement(number this_arg, Uint8Array rgb, Uint8Array alias, number[] addresses); // void ChannelManager_process_pending_htlc_forwards(const struct LDKChannelManager *NONNULL_PTR this_arg); - public static native void ChannelManager_process_pending_htlc_forwards(uint32_t this_arg); + public static native void ChannelManager_process_pending_htlc_forwards(number this_arg); // void ChannelManager_timer_chan_freshness_every_min(const struct LDKChannelManager *NONNULL_PTR this_arg); - public static native void ChannelManager_timer_chan_freshness_every_min(uint32_t this_arg); + public static native void ChannelManager_timer_chan_freshness_every_min(number this_arg); // MUST_USE_RES bool ChannelManager_fail_htlc_backwards(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*payment_hash)[32], struct LDKThirtyTwoBytes payment_secret); - public static native boolean ChannelManager_fail_htlc_backwards(uint32_t this_arg, byte[] payment_hash, byte[] payment_secret); + public static native boolean ChannelManager_fail_htlc_backwards(number this_arg, Uint8Array payment_hash, Uint8Array payment_secret); // MUST_USE_RES bool ChannelManager_claim_funds(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes payment_preimage, struct LDKThirtyTwoBytes payment_secret, uint64_t expected_amount); - public static native boolean ChannelManager_claim_funds(uint32_t this_arg, byte[] payment_preimage, byte[] payment_secret, long expected_amount); + public static native boolean ChannelManager_claim_funds(number this_arg, Uint8Array payment_preimage, Uint8Array payment_secret, number expected_amount); // MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg); - public static native byte[] ChannelManager_get_our_node_id(uint32_t this_arg); + public static native Uint8Array ChannelManager_get_our_node_id(number this_arg); // void ChannelManager_channel_monitor_updated(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKOutPoint *NONNULL_PTR funding_txo, uint64_t highest_applied_update_id); - public static native void ChannelManager_channel_monitor_updated(uint32_t this_arg, uint32_t funding_txo, long highest_applied_update_id); + public static native void ChannelManager_channel_monitor_updated(number this_arg, number funding_txo, number highest_applied_update_id); // struct LDKMessageSendEventsProvider ChannelManager_as_MessageSendEventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg); - public static native uint32_t ChannelManager_as_MessageSendEventsProvider(uint32_t this_arg); + public static native number ChannelManager_as_MessageSendEventsProvider(number this_arg); // struct LDKEventsProvider ChannelManager_as_EventsProvider(const struct LDKChannelManager *NONNULL_PTR this_arg); - public static native uint32_t ChannelManager_as_EventsProvider(uint32_t this_arg); + public static native number ChannelManager_as_EventsProvider(number this_arg); // void ChannelManager_block_connected(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height); - public static native void ChannelManager_block_connected(uint32_t this_arg, byte[] header, uint32_t[] txdata, int height); + public static native void ChannelManager_block_connected(number this_arg, Uint8Array header, number[] txdata, number height); // void ChannelManager_block_disconnected(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*header)[80]); - public static native void ChannelManager_block_disconnected(uint32_t this_arg, byte[] header); + public static native void ChannelManager_block_disconnected(number this_arg, Uint8Array header); // struct LDKChannelMessageHandler ChannelManager_as_ChannelMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg); - public static native uint32_t ChannelManager_as_ChannelMessageHandler(uint32_t this_arg); + public static native number ChannelManager_as_ChannelMessageHandler(number this_arg); // struct LDKCVec_u8Z ChannelManager_write(const struct LDKChannelManager *NONNULL_PTR obj); - public static native byte[] ChannelManager_write(uint32_t obj); + public static native Uint8Array ChannelManager_write(number obj); // void ChannelManagerReadArgs_free(struct LDKChannelManagerReadArgs this_ptr); - public static native void ChannelManagerReadArgs_free(uint32_t this_ptr); + public static native void ChannelManagerReadArgs_free(number this_ptr); // const struct LDKKeysInterface *ChannelManagerReadArgs_get_keys_manager(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr); - public static native uint32_t ChannelManagerReadArgs_get_keys_manager(uint32_t this_ptr); + public static native number ChannelManagerReadArgs_get_keys_manager(number this_ptr); // void ChannelManagerReadArgs_set_keys_manager(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKKeysInterface val); - public static native void ChannelManagerReadArgs_set_keys_manager(uint32_t this_ptr, uint32_t val); + public static native void ChannelManagerReadArgs_set_keys_manager(number this_ptr, number val); // const struct LDKFeeEstimator *ChannelManagerReadArgs_get_fee_estimator(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr); - public static native uint32_t ChannelManagerReadArgs_get_fee_estimator(uint32_t this_ptr); + public static native number ChannelManagerReadArgs_get_fee_estimator(number this_ptr); // void ChannelManagerReadArgs_set_fee_estimator(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKFeeEstimator val); - public static native void ChannelManagerReadArgs_set_fee_estimator(uint32_t this_ptr, uint32_t val); + public static native void ChannelManagerReadArgs_set_fee_estimator(number this_ptr, number val); // const struct LDKWatch *ChannelManagerReadArgs_get_chain_monitor(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr); - public static native uint32_t ChannelManagerReadArgs_get_chain_monitor(uint32_t this_ptr); + public static native number ChannelManagerReadArgs_get_chain_monitor(number this_ptr); // void ChannelManagerReadArgs_set_chain_monitor(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKWatch val); - public static native void ChannelManagerReadArgs_set_chain_monitor(uint32_t this_ptr, uint32_t val); + public static native void ChannelManagerReadArgs_set_chain_monitor(number this_ptr, number val); // const struct LDKBroadcasterInterface *ChannelManagerReadArgs_get_tx_broadcaster(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr); - public static native uint32_t ChannelManagerReadArgs_get_tx_broadcaster(uint32_t this_ptr); + public static native number ChannelManagerReadArgs_get_tx_broadcaster(number this_ptr); // void ChannelManagerReadArgs_set_tx_broadcaster(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKBroadcasterInterface val); - public static native void ChannelManagerReadArgs_set_tx_broadcaster(uint32_t this_ptr, uint32_t val); + public static native void ChannelManagerReadArgs_set_tx_broadcaster(number this_ptr, number val); // const struct LDKLogger *ChannelManagerReadArgs_get_logger(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr); - public static native uint32_t ChannelManagerReadArgs_get_logger(uint32_t this_ptr); + public static native number ChannelManagerReadArgs_get_logger(number this_ptr); // void ChannelManagerReadArgs_set_logger(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKLogger val); - public static native void ChannelManagerReadArgs_set_logger(uint32_t this_ptr, uint32_t val); + public static native void ChannelManagerReadArgs_set_logger(number this_ptr, number val); // struct LDKUserConfig ChannelManagerReadArgs_get_default_config(const struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr); - public static native uint32_t ChannelManagerReadArgs_get_default_config(uint32_t this_ptr); + public static native number ChannelManagerReadArgs_get_default_config(number this_ptr); // void ChannelManagerReadArgs_set_default_config(struct LDKChannelManagerReadArgs *NONNULL_PTR this_ptr, struct LDKUserConfig val); - public static native void ChannelManagerReadArgs_set_default_config(uint32_t this_ptr, uint32_t val); + public static native void ChannelManagerReadArgs_set_default_config(number this_ptr, number val); // MUST_USE_RES struct LDKChannelManagerReadArgs ChannelManagerReadArgs_new(struct LDKKeysInterface keys_manager, struct LDKFeeEstimator fee_estimator, struct LDKWatch chain_monitor, struct LDKBroadcasterInterface tx_broadcaster, struct LDKLogger logger, struct LDKUserConfig default_config, struct LDKCVec_ChannelMonitorZ channel_monitors); - public static native uint32_t ChannelManagerReadArgs_new(uint32_t keys_manager, uint32_t fee_estimator, uint32_t chain_monitor, uint32_t tx_broadcaster, uint32_t logger, uint32_t default_config, uint32_t[] channel_monitors); + public static native number ChannelManagerReadArgs_new(number keys_manager, number fee_estimator, number chain_monitor, number tx_broadcaster, number logger, number default_config, number[] channel_monitors); // struct LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ C2Tuple_BlockHashChannelManagerZ_read(struct LDKu8slice ser, struct LDKChannelManagerReadArgs arg); - public static native uint32_t C2Tuple_BlockHashChannelManagerZ_read(byte[] ser, uint32_t arg); + public static native number C2Tuple_BlockHashChannelManagerZ_read(Uint8Array ser, number arg); // void DecodeError_free(struct LDKDecodeError this_ptr); - public static native void DecodeError_free(uint32_t this_ptr); + public static native void DecodeError_free(number this_ptr); // void Init_free(struct LDKInit this_ptr); - public static native void Init_free(uint32_t this_ptr); + public static native void Init_free(number this_ptr); // struct LDKInit Init_clone(const struct LDKInit *NONNULL_PTR orig); - public static native uint32_t Init_clone(uint32_t orig); + public static native number Init_clone(number orig); // void ErrorMessage_free(struct LDKErrorMessage this_ptr); - public static native void ErrorMessage_free(uint32_t this_ptr); + public static native void ErrorMessage_free(number this_ptr); // struct LDKErrorMessage ErrorMessage_clone(const struct LDKErrorMessage *NONNULL_PTR orig); - public static native uint32_t ErrorMessage_clone(uint32_t orig); + public static native number ErrorMessage_clone(number orig); // const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32]; - public static native byte[] ErrorMessage_get_channel_id(uint32_t this_ptr); + public static native Uint8Array ErrorMessage_get_channel_id(number this_ptr); // void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void ErrorMessage_set_channel_id(uint32_t this_ptr, byte[] val); + public static native void ErrorMessage_set_channel_id(number this_ptr, Uint8Array val); // struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr); - public static native String ErrorMessage_get_data(uint32_t this_ptr); + public static native String ErrorMessage_get_data(number this_ptr); // void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val); - public static native void ErrorMessage_set_data(uint32_t this_ptr, byte[] val); + public static native void ErrorMessage_set_data(number this_ptr, Uint8Array val); // MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z data_arg); - public static native uint32_t ErrorMessage_new(byte[] channel_id_arg, byte[] data_arg); + public static native number ErrorMessage_new(Uint8Array channel_id_arg, Uint8Array data_arg); // void Ping_free(struct LDKPing this_ptr); - public static native void Ping_free(uint32_t this_ptr); + public static native void Ping_free(number this_ptr); // struct LDKPing Ping_clone(const struct LDKPing *NONNULL_PTR orig); - public static native uint32_t Ping_clone(uint32_t orig); + public static native number Ping_clone(number orig); // uint16_t Ping_get_ponglen(const struct LDKPing *NONNULL_PTR this_ptr); - public static native short Ping_get_ponglen(uint32_t this_ptr); + public static native number Ping_get_ponglen(number this_ptr); // void Ping_set_ponglen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val); - public static native void Ping_set_ponglen(uint32_t this_ptr, short val); + public static native void Ping_set_ponglen(number this_ptr, number val); // uint16_t Ping_get_byteslen(const struct LDKPing *NONNULL_PTR this_ptr); - public static native short Ping_get_byteslen(uint32_t this_ptr); + public static native number Ping_get_byteslen(number this_ptr); // void Ping_set_byteslen(struct LDKPing *NONNULL_PTR this_ptr, uint16_t val); - public static native void Ping_set_byteslen(uint32_t this_ptr, short val); + public static native void Ping_set_byteslen(number this_ptr, number val); // MUST_USE_RES struct LDKPing Ping_new(uint16_t ponglen_arg, uint16_t byteslen_arg); - public static native uint32_t Ping_new(short ponglen_arg, short byteslen_arg); + public static native number Ping_new(number ponglen_arg, number byteslen_arg); // void Pong_free(struct LDKPong this_ptr); - public static native void Pong_free(uint32_t this_ptr); + public static native void Pong_free(number this_ptr); // struct LDKPong Pong_clone(const struct LDKPong *NONNULL_PTR orig); - public static native uint32_t Pong_clone(uint32_t orig); + public static native number Pong_clone(number orig); // uint16_t Pong_get_byteslen(const struct LDKPong *NONNULL_PTR this_ptr); - public static native short Pong_get_byteslen(uint32_t this_ptr); + public static native number Pong_get_byteslen(number this_ptr); // void Pong_set_byteslen(struct LDKPong *NONNULL_PTR this_ptr, uint16_t val); - public static native void Pong_set_byteslen(uint32_t this_ptr, short val); + public static native void Pong_set_byteslen(number this_ptr, number val); // MUST_USE_RES struct LDKPong Pong_new(uint16_t byteslen_arg); - public static native uint32_t Pong_new(short byteslen_arg); + public static native number Pong_new(number byteslen_arg); // void OpenChannel_free(struct LDKOpenChannel this_ptr); - public static native void OpenChannel_free(uint32_t this_ptr); + public static native void OpenChannel_free(number this_ptr); // struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig); - public static native uint32_t OpenChannel_clone(uint32_t orig); + public static native number OpenChannel_clone(number orig); // const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32]; - public static native byte[] OpenChannel_get_chain_hash(uint32_t this_ptr); + public static native Uint8Array OpenChannel_get_chain_hash(number this_ptr); // void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void OpenChannel_set_chain_hash(uint32_t this_ptr, byte[] val); + public static native void OpenChannel_set_chain_hash(number this_ptr, Uint8Array val); // const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32]; - public static native byte[] OpenChannel_get_temporary_channel_id(uint32_t this_ptr); + public static native Uint8Array OpenChannel_get_temporary_channel_id(number this_ptr); // void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void OpenChannel_set_temporary_channel_id(uint32_t this_ptr, byte[] val); + public static native void OpenChannel_set_temporary_channel_id(number this_ptr, Uint8Array val); // uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr); - public static native long OpenChannel_get_funding_satoshis(uint32_t this_ptr); + public static native number OpenChannel_get_funding_satoshis(number this_ptr); // void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val); - public static native void OpenChannel_set_funding_satoshis(uint32_t this_ptr, long val); + public static native void OpenChannel_set_funding_satoshis(number this_ptr, number val); // uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr); - public static native long OpenChannel_get_push_msat(uint32_t this_ptr); + public static native number OpenChannel_get_push_msat(number this_ptr); // void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val); - public static native void OpenChannel_set_push_msat(uint32_t this_ptr, long val); + public static native void OpenChannel_set_push_msat(number this_ptr, number val); // uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr); - public static native long OpenChannel_get_dust_limit_satoshis(uint32_t this_ptr); + public static native number OpenChannel_get_dust_limit_satoshis(number this_ptr); // void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val); - public static native void OpenChannel_set_dust_limit_satoshis(uint32_t this_ptr, long val); + public static native void OpenChannel_set_dust_limit_satoshis(number this_ptr, number val); // uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr); - public static native long OpenChannel_get_max_htlc_value_in_flight_msat(uint32_t this_ptr); + public static native number OpenChannel_get_max_htlc_value_in_flight_msat(number this_ptr); // void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val); - public static native void OpenChannel_set_max_htlc_value_in_flight_msat(uint32_t this_ptr, long val); + public static native void OpenChannel_set_max_htlc_value_in_flight_msat(number this_ptr, number val); // uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr); - public static native long OpenChannel_get_channel_reserve_satoshis(uint32_t this_ptr); + public static native number OpenChannel_get_channel_reserve_satoshis(number this_ptr); // void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val); - public static native void OpenChannel_set_channel_reserve_satoshis(uint32_t this_ptr, long val); + public static native void OpenChannel_set_channel_reserve_satoshis(number this_ptr, number val); // uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr); - public static native long OpenChannel_get_htlc_minimum_msat(uint32_t this_ptr); + public static native number OpenChannel_get_htlc_minimum_msat(number this_ptr); // void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val); - public static native void OpenChannel_set_htlc_minimum_msat(uint32_t this_ptr, long val); + public static native void OpenChannel_set_htlc_minimum_msat(number this_ptr, number val); // uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr); - public static native int OpenChannel_get_feerate_per_kw(uint32_t this_ptr); + public static native number OpenChannel_get_feerate_per_kw(number this_ptr); // void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val); - public static native void OpenChannel_set_feerate_per_kw(uint32_t this_ptr, int val); + public static native void OpenChannel_set_feerate_per_kw(number this_ptr, number val); // uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr); - public static native short OpenChannel_get_to_self_delay(uint32_t this_ptr); + public static native number OpenChannel_get_to_self_delay(number this_ptr); // void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val); - public static native void OpenChannel_set_to_self_delay(uint32_t this_ptr, short val); + public static native void OpenChannel_set_to_self_delay(number this_ptr, number val); // uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr); - public static native short OpenChannel_get_max_accepted_htlcs(uint32_t this_ptr); + public static native number OpenChannel_get_max_accepted_htlcs(number this_ptr); // void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val); - public static native void OpenChannel_set_max_accepted_htlcs(uint32_t this_ptr, short val); + public static native void OpenChannel_set_max_accepted_htlcs(number this_ptr, number val); // struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr); - public static native byte[] OpenChannel_get_funding_pubkey(uint32_t this_ptr); + public static native Uint8Array OpenChannel_get_funding_pubkey(number this_ptr); // void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void OpenChannel_set_funding_pubkey(uint32_t this_ptr, byte[] val); + public static native void OpenChannel_set_funding_pubkey(number this_ptr, Uint8Array val); // struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr); - public static native byte[] OpenChannel_get_revocation_basepoint(uint32_t this_ptr); + public static native Uint8Array OpenChannel_get_revocation_basepoint(number this_ptr); // void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void OpenChannel_set_revocation_basepoint(uint32_t this_ptr, byte[] val); + public static native void OpenChannel_set_revocation_basepoint(number this_ptr, Uint8Array val); // struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr); - public static native byte[] OpenChannel_get_payment_point(uint32_t this_ptr); + public static native Uint8Array OpenChannel_get_payment_point(number this_ptr); // void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void OpenChannel_set_payment_point(uint32_t this_ptr, byte[] val); + public static native void OpenChannel_set_payment_point(number this_ptr, Uint8Array val); // struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr); - public static native byte[] OpenChannel_get_delayed_payment_basepoint(uint32_t this_ptr); + public static native Uint8Array OpenChannel_get_delayed_payment_basepoint(number this_ptr); // void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void OpenChannel_set_delayed_payment_basepoint(uint32_t this_ptr, byte[] val); + public static native void OpenChannel_set_delayed_payment_basepoint(number this_ptr, Uint8Array val); // struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr); - public static native byte[] OpenChannel_get_htlc_basepoint(uint32_t this_ptr); + public static native Uint8Array OpenChannel_get_htlc_basepoint(number this_ptr); // void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void OpenChannel_set_htlc_basepoint(uint32_t this_ptr, byte[] val); + public static native void OpenChannel_set_htlc_basepoint(number this_ptr, Uint8Array val); // struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr); - public static native byte[] OpenChannel_get_first_per_commitment_point(uint32_t this_ptr); + public static native Uint8Array OpenChannel_get_first_per_commitment_point(number this_ptr); // void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void OpenChannel_set_first_per_commitment_point(uint32_t this_ptr, byte[] val); + public static native void OpenChannel_set_first_per_commitment_point(number this_ptr, Uint8Array val); // uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr); - public static native byte OpenChannel_get_channel_flags(uint32_t this_ptr); + public static native number OpenChannel_get_channel_flags(number this_ptr); // void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val); - public static native void OpenChannel_set_channel_flags(uint32_t this_ptr, byte val); + public static native void OpenChannel_set_channel_flags(number this_ptr, number val); // void AcceptChannel_free(struct LDKAcceptChannel this_ptr); - public static native void AcceptChannel_free(uint32_t this_ptr); + public static native void AcceptChannel_free(number this_ptr); // struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig); - public static native uint32_t AcceptChannel_clone(uint32_t orig); + public static native number AcceptChannel_clone(number orig); // const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32]; - public static native byte[] AcceptChannel_get_temporary_channel_id(uint32_t this_ptr); + public static native Uint8Array AcceptChannel_get_temporary_channel_id(number this_ptr); // void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void AcceptChannel_set_temporary_channel_id(uint32_t this_ptr, byte[] val); + public static native void AcceptChannel_set_temporary_channel_id(number this_ptr, Uint8Array val); // uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); - public static native long AcceptChannel_get_dust_limit_satoshis(uint32_t this_ptr); + public static native number AcceptChannel_get_dust_limit_satoshis(number this_ptr); // void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val); - public static native void AcceptChannel_set_dust_limit_satoshis(uint32_t this_ptr, long val); + public static native void AcceptChannel_set_dust_limit_satoshis(number this_ptr, number val); // uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); - public static native long AcceptChannel_get_max_htlc_value_in_flight_msat(uint32_t this_ptr); + public static native number AcceptChannel_get_max_htlc_value_in_flight_msat(number this_ptr); // void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val); - public static native void AcceptChannel_set_max_htlc_value_in_flight_msat(uint32_t this_ptr, long val); + public static native void AcceptChannel_set_max_htlc_value_in_flight_msat(number this_ptr, number val); // uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); - public static native long AcceptChannel_get_channel_reserve_satoshis(uint32_t this_ptr); + public static native number AcceptChannel_get_channel_reserve_satoshis(number this_ptr); // void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val); - public static native void AcceptChannel_set_channel_reserve_satoshis(uint32_t this_ptr, long val); + public static native void AcceptChannel_set_channel_reserve_satoshis(number this_ptr, number val); // uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); - public static native long AcceptChannel_get_htlc_minimum_msat(uint32_t this_ptr); + public static native number AcceptChannel_get_htlc_minimum_msat(number this_ptr); // void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val); - public static native void AcceptChannel_set_htlc_minimum_msat(uint32_t this_ptr, long val); + public static native void AcceptChannel_set_htlc_minimum_msat(number this_ptr, number val); // uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); - public static native int AcceptChannel_get_minimum_depth(uint32_t this_ptr); + public static native number AcceptChannel_get_minimum_depth(number this_ptr); // void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val); - public static native void AcceptChannel_set_minimum_depth(uint32_t this_ptr, int val); + public static native void AcceptChannel_set_minimum_depth(number this_ptr, number val); // uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); - public static native short AcceptChannel_get_to_self_delay(uint32_t this_ptr); + public static native number AcceptChannel_get_to_self_delay(number this_ptr); // void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val); - public static native void AcceptChannel_set_to_self_delay(uint32_t this_ptr, short val); + public static native void AcceptChannel_set_to_self_delay(number this_ptr, number val); // uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); - public static native short AcceptChannel_get_max_accepted_htlcs(uint32_t this_ptr); + public static native number AcceptChannel_get_max_accepted_htlcs(number this_ptr); // void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val); - public static native void AcceptChannel_set_max_accepted_htlcs(uint32_t this_ptr, short val); + public static native void AcceptChannel_set_max_accepted_htlcs(number this_ptr, number val); // struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); - public static native byte[] AcceptChannel_get_funding_pubkey(uint32_t this_ptr); + public static native Uint8Array AcceptChannel_get_funding_pubkey(number this_ptr); // void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void AcceptChannel_set_funding_pubkey(uint32_t this_ptr, byte[] val); + public static native void AcceptChannel_set_funding_pubkey(number this_ptr, Uint8Array val); // struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); - public static native byte[] AcceptChannel_get_revocation_basepoint(uint32_t this_ptr); + public static native Uint8Array AcceptChannel_get_revocation_basepoint(number this_ptr); // void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void AcceptChannel_set_revocation_basepoint(uint32_t this_ptr, byte[] val); + public static native void AcceptChannel_set_revocation_basepoint(number this_ptr, Uint8Array val); // struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); - public static native byte[] AcceptChannel_get_payment_point(uint32_t this_ptr); + public static native Uint8Array AcceptChannel_get_payment_point(number this_ptr); // void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void AcceptChannel_set_payment_point(uint32_t this_ptr, byte[] val); + public static native void AcceptChannel_set_payment_point(number this_ptr, Uint8Array val); // struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); - public static native byte[] AcceptChannel_get_delayed_payment_basepoint(uint32_t this_ptr); + public static native Uint8Array AcceptChannel_get_delayed_payment_basepoint(number this_ptr); // void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void AcceptChannel_set_delayed_payment_basepoint(uint32_t this_ptr, byte[] val); + public static native void AcceptChannel_set_delayed_payment_basepoint(number this_ptr, Uint8Array val); // struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); - public static native byte[] AcceptChannel_get_htlc_basepoint(uint32_t this_ptr); + public static native Uint8Array AcceptChannel_get_htlc_basepoint(number this_ptr); // void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void AcceptChannel_set_htlc_basepoint(uint32_t this_ptr, byte[] val); + public static native void AcceptChannel_set_htlc_basepoint(number this_ptr, Uint8Array val); // struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); - public static native byte[] AcceptChannel_get_first_per_commitment_point(uint32_t this_ptr); + public static native Uint8Array AcceptChannel_get_first_per_commitment_point(number this_ptr); // void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void AcceptChannel_set_first_per_commitment_point(uint32_t this_ptr, byte[] val); + public static native void AcceptChannel_set_first_per_commitment_point(number this_ptr, Uint8Array val); // void FundingCreated_free(struct LDKFundingCreated this_ptr); - public static native void FundingCreated_free(uint32_t this_ptr); + public static native void FundingCreated_free(number this_ptr); // struct LDKFundingCreated FundingCreated_clone(const struct LDKFundingCreated *NONNULL_PTR orig); - public static native uint32_t FundingCreated_clone(uint32_t orig); + public static native number FundingCreated_clone(number orig); // const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32]; - public static native byte[] FundingCreated_get_temporary_channel_id(uint32_t this_ptr); + public static native Uint8Array FundingCreated_get_temporary_channel_id(number this_ptr); // void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void FundingCreated_set_temporary_channel_id(uint32_t this_ptr, byte[] val); + public static native void FundingCreated_set_temporary_channel_id(number this_ptr, Uint8Array val); // const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32]; - public static native byte[] FundingCreated_get_funding_txid(uint32_t this_ptr); + public static native Uint8Array FundingCreated_get_funding_txid(number this_ptr); // void FundingCreated_set_funding_txid(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void FundingCreated_set_funding_txid(uint32_t this_ptr, byte[] val); + public static native void FundingCreated_set_funding_txid(number this_ptr, Uint8Array val); // uint16_t FundingCreated_get_funding_output_index(const struct LDKFundingCreated *NONNULL_PTR this_ptr); - public static native short FundingCreated_get_funding_output_index(uint32_t this_ptr); + public static native number FundingCreated_get_funding_output_index(number this_ptr); // void FundingCreated_set_funding_output_index(struct LDKFundingCreated *NONNULL_PTR this_ptr, uint16_t val); - public static native void FundingCreated_set_funding_output_index(uint32_t this_ptr, short val); + public static native void FundingCreated_set_funding_output_index(number this_ptr, number val); // struct LDKSignature FundingCreated_get_signature(const struct LDKFundingCreated *NONNULL_PTR this_ptr); - public static native byte[] FundingCreated_get_signature(uint32_t this_ptr); + public static native Uint8Array FundingCreated_get_signature(number this_ptr); // void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKSignature val); - public static native void FundingCreated_set_signature(uint32_t this_ptr, byte[] val); + public static native void FundingCreated_set_signature(number this_ptr, Uint8Array val); // MUST_USE_RES struct LDKFundingCreated FundingCreated_new(struct LDKThirtyTwoBytes temporary_channel_id_arg, struct LDKThirtyTwoBytes funding_txid_arg, uint16_t funding_output_index_arg, struct LDKSignature signature_arg); - public static native uint32_t FundingCreated_new(byte[] temporary_channel_id_arg, byte[] funding_txid_arg, short funding_output_index_arg, byte[] signature_arg); + public static native number FundingCreated_new(Uint8Array temporary_channel_id_arg, Uint8Array funding_txid_arg, number funding_output_index_arg, Uint8Array signature_arg); // void FundingSigned_free(struct LDKFundingSigned this_ptr); - public static native void FundingSigned_free(uint32_t this_ptr); + public static native void FundingSigned_free(number this_ptr); // struct LDKFundingSigned FundingSigned_clone(const struct LDKFundingSigned *NONNULL_PTR orig); - public static native uint32_t FundingSigned_clone(uint32_t orig); + public static native number FundingSigned_clone(number orig); // const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32]; - public static native byte[] FundingSigned_get_channel_id(uint32_t this_ptr); + public static native Uint8Array FundingSigned_get_channel_id(number this_ptr); // void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void FundingSigned_set_channel_id(uint32_t this_ptr, byte[] val); + public static native void FundingSigned_set_channel_id(number this_ptr, Uint8Array val); // struct LDKSignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr); - public static native byte[] FundingSigned_get_signature(uint32_t this_ptr); + public static native Uint8Array FundingSigned_get_signature(number this_ptr); // void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKSignature val); - public static native void FundingSigned_set_signature(uint32_t this_ptr, byte[] val); + public static native void FundingSigned_set_signature(number this_ptr, Uint8Array val); // MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg); - public static native uint32_t FundingSigned_new(byte[] channel_id_arg, byte[] signature_arg); + public static native number FundingSigned_new(Uint8Array channel_id_arg, Uint8Array signature_arg); // void FundingLocked_free(struct LDKFundingLocked this_ptr); - public static native void FundingLocked_free(uint32_t this_ptr); + public static native void FundingLocked_free(number this_ptr); // struct LDKFundingLocked FundingLocked_clone(const struct LDKFundingLocked *NONNULL_PTR orig); - public static native uint32_t FundingLocked_clone(uint32_t orig); + public static native number FundingLocked_clone(number orig); // const uint8_t (*FundingLocked_get_channel_id(const struct LDKFundingLocked *NONNULL_PTR this_ptr))[32]; - public static native byte[] FundingLocked_get_channel_id(uint32_t this_ptr); + public static native Uint8Array FundingLocked_get_channel_id(number this_ptr); // void FundingLocked_set_channel_id(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void FundingLocked_set_channel_id(uint32_t this_ptr, byte[] val); + public static native void FundingLocked_set_channel_id(number this_ptr, Uint8Array val); // struct LDKPublicKey FundingLocked_get_next_per_commitment_point(const struct LDKFundingLocked *NONNULL_PTR this_ptr); - public static native byte[] FundingLocked_get_next_per_commitment_point(uint32_t this_ptr); + public static native Uint8Array FundingLocked_get_next_per_commitment_point(number this_ptr); // void FundingLocked_set_next_per_commitment_point(struct LDKFundingLocked *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void FundingLocked_set_next_per_commitment_point(uint32_t this_ptr, byte[] val); + public static native void FundingLocked_set_next_per_commitment_point(number this_ptr, Uint8Array val); // MUST_USE_RES struct LDKFundingLocked FundingLocked_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg); - public static native uint32_t FundingLocked_new(byte[] channel_id_arg, byte[] next_per_commitment_point_arg); + public static native number FundingLocked_new(Uint8Array channel_id_arg, Uint8Array next_per_commitment_point_arg); // void Shutdown_free(struct LDKShutdown this_ptr); - public static native void Shutdown_free(uint32_t this_ptr); + public static native void Shutdown_free(number this_ptr); // struct LDKShutdown Shutdown_clone(const struct LDKShutdown *NONNULL_PTR orig); - public static native uint32_t Shutdown_clone(uint32_t orig); + public static native number Shutdown_clone(number orig); // const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32]; - public static native byte[] Shutdown_get_channel_id(uint32_t this_ptr); + public static native Uint8Array Shutdown_get_channel_id(number this_ptr); // void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void Shutdown_set_channel_id(uint32_t this_ptr, byte[] val); + public static native void Shutdown_set_channel_id(number this_ptr, Uint8Array val); // struct LDKu8slice Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr); - public static native byte[] Shutdown_get_scriptpubkey(uint32_t this_ptr); + public static native Uint8Array Shutdown_get_scriptpubkey(number this_ptr); // void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val); - public static native void Shutdown_set_scriptpubkey(uint32_t this_ptr, byte[] val); + public static native void Shutdown_set_scriptpubkey(number this_ptr, Uint8Array val); // MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg); - public static native uint32_t Shutdown_new(byte[] channel_id_arg, byte[] scriptpubkey_arg); + public static native number Shutdown_new(Uint8Array channel_id_arg, Uint8Array scriptpubkey_arg); // void ClosingSigned_free(struct LDKClosingSigned this_ptr); - public static native void ClosingSigned_free(uint32_t this_ptr); + public static native void ClosingSigned_free(number this_ptr); // struct LDKClosingSigned ClosingSigned_clone(const struct LDKClosingSigned *NONNULL_PTR orig); - public static native uint32_t ClosingSigned_clone(uint32_t orig); + public static native number ClosingSigned_clone(number orig); // const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32]; - public static native byte[] ClosingSigned_get_channel_id(uint32_t this_ptr); + public static native Uint8Array ClosingSigned_get_channel_id(number this_ptr); // void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void ClosingSigned_set_channel_id(uint32_t this_ptr, byte[] val); + public static native void ClosingSigned_set_channel_id(number this_ptr, Uint8Array val); // uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr); - public static native long ClosingSigned_get_fee_satoshis(uint32_t this_ptr); + public static native number ClosingSigned_get_fee_satoshis(number this_ptr); // void ClosingSigned_set_fee_satoshis(struct LDKClosingSigned *NONNULL_PTR this_ptr, uint64_t val); - public static native void ClosingSigned_set_fee_satoshis(uint32_t this_ptr, long val); + public static native void ClosingSigned_set_fee_satoshis(number this_ptr, number val); // struct LDKSignature ClosingSigned_get_signature(const struct LDKClosingSigned *NONNULL_PTR this_ptr); - public static native byte[] ClosingSigned_get_signature(uint32_t this_ptr); + public static native Uint8Array ClosingSigned_get_signature(number this_ptr); // void ClosingSigned_set_signature(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKSignature val); - public static native void ClosingSigned_set_signature(uint32_t this_ptr, byte[] val); + public static native void ClosingSigned_set_signature(number this_ptr, Uint8Array val); // MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKSignature signature_arg); - public static native uint32_t ClosingSigned_new(byte[] channel_id_arg, long fee_satoshis_arg, byte[] signature_arg); + public static native number ClosingSigned_new(Uint8Array channel_id_arg, number fee_satoshis_arg, Uint8Array signature_arg); // void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_ptr); - public static native void UpdateAddHTLC_free(uint32_t this_ptr); + public static native void UpdateAddHTLC_free(number this_ptr); // struct LDKUpdateAddHTLC UpdateAddHTLC_clone(const struct LDKUpdateAddHTLC *NONNULL_PTR orig); - public static native uint32_t UpdateAddHTLC_clone(uint32_t orig); + public static native number UpdateAddHTLC_clone(number orig); // const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32]; - public static native byte[] UpdateAddHTLC_get_channel_id(uint32_t this_ptr); + public static native Uint8Array UpdateAddHTLC_get_channel_id(number this_ptr); // void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void UpdateAddHTLC_set_channel_id(uint32_t this_ptr, byte[] val); + public static native void UpdateAddHTLC_set_channel_id(number this_ptr, Uint8Array val); // uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr); - public static native long UpdateAddHTLC_get_htlc_id(uint32_t this_ptr); + public static native number UpdateAddHTLC_get_htlc_id(number this_ptr); // void UpdateAddHTLC_set_htlc_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val); - public static native void UpdateAddHTLC_set_htlc_id(uint32_t this_ptr, long val); + public static native void UpdateAddHTLC_set_htlc_id(number this_ptr, number val); // uint64_t UpdateAddHTLC_get_amount_msat(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr); - public static native long UpdateAddHTLC_get_amount_msat(uint32_t this_ptr); + public static native number UpdateAddHTLC_get_amount_msat(number this_ptr); // void UpdateAddHTLC_set_amount_msat(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint64_t val); - public static native void UpdateAddHTLC_set_amount_msat(uint32_t this_ptr, long val); + public static native void UpdateAddHTLC_set_amount_msat(number this_ptr, number val); // const uint8_t (*UpdateAddHTLC_get_payment_hash(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32]; - public static native byte[] UpdateAddHTLC_get_payment_hash(uint32_t this_ptr); + public static native Uint8Array UpdateAddHTLC_get_payment_hash(number this_ptr); // void UpdateAddHTLC_set_payment_hash(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void UpdateAddHTLC_set_payment_hash(uint32_t this_ptr, byte[] val); + public static native void UpdateAddHTLC_set_payment_hash(number this_ptr, Uint8Array val); // uint32_t UpdateAddHTLC_get_cltv_expiry(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr); - public static native int UpdateAddHTLC_get_cltv_expiry(uint32_t this_ptr); + public static native number UpdateAddHTLC_get_cltv_expiry(number this_ptr); // void UpdateAddHTLC_set_cltv_expiry(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, uint32_t val); - public static native void UpdateAddHTLC_set_cltv_expiry(uint32_t this_ptr, int val); + public static native void UpdateAddHTLC_set_cltv_expiry(number this_ptr, number val); // void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_ptr); - public static native void UpdateFulfillHTLC_free(uint32_t this_ptr); + public static native void UpdateFulfillHTLC_free(number this_ptr); // struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_clone(const struct LDKUpdateFulfillHTLC *NONNULL_PTR orig); - public static native uint32_t UpdateFulfillHTLC_clone(uint32_t orig); + public static native number UpdateFulfillHTLC_clone(number orig); // const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32]; - public static native byte[] UpdateFulfillHTLC_get_channel_id(uint32_t this_ptr); + public static native Uint8Array UpdateFulfillHTLC_get_channel_id(number this_ptr); // void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void UpdateFulfillHTLC_set_channel_id(uint32_t this_ptr, byte[] val); + public static native void UpdateFulfillHTLC_set_channel_id(number this_ptr, Uint8Array val); // uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr); - public static native long UpdateFulfillHTLC_get_htlc_id(uint32_t this_ptr); + public static native number UpdateFulfillHTLC_get_htlc_id(number this_ptr); // void UpdateFulfillHTLC_set_htlc_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, uint64_t val); - public static native void UpdateFulfillHTLC_set_htlc_id(uint32_t this_ptr, long val); + public static native void UpdateFulfillHTLC_set_htlc_id(number this_ptr, number val); // const uint8_t (*UpdateFulfillHTLC_get_payment_preimage(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32]; - public static native byte[] UpdateFulfillHTLC_get_payment_preimage(uint32_t this_ptr); + public static native Uint8Array UpdateFulfillHTLC_get_payment_preimage(number this_ptr); // void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void UpdateFulfillHTLC_set_payment_preimage(uint32_t this_ptr, byte[] val); + public static native void UpdateFulfillHTLC_set_payment_preimage(number this_ptr, Uint8Array val); // MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg); - public static native uint32_t UpdateFulfillHTLC_new(byte[] channel_id_arg, long htlc_id_arg, byte[] payment_preimage_arg); + public static native number UpdateFulfillHTLC_new(Uint8Array channel_id_arg, number htlc_id_arg, Uint8Array payment_preimage_arg); // void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_ptr); - public static native void UpdateFailHTLC_free(uint32_t this_ptr); + public static native void UpdateFailHTLC_free(number this_ptr); // struct LDKUpdateFailHTLC UpdateFailHTLC_clone(const struct LDKUpdateFailHTLC *NONNULL_PTR orig); - public static native uint32_t UpdateFailHTLC_clone(uint32_t orig); + public static native number UpdateFailHTLC_clone(number orig); // const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32]; - public static native byte[] UpdateFailHTLC_get_channel_id(uint32_t this_ptr); + public static native Uint8Array UpdateFailHTLC_get_channel_id(number this_ptr); // void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void UpdateFailHTLC_set_channel_id(uint32_t this_ptr, byte[] val); + public static native void UpdateFailHTLC_set_channel_id(number this_ptr, Uint8Array val); // uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr); - public static native long UpdateFailHTLC_get_htlc_id(uint32_t this_ptr); + public static native number UpdateFailHTLC_get_htlc_id(number this_ptr); // void UpdateFailHTLC_set_htlc_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, uint64_t val); - public static native void UpdateFailHTLC_set_htlc_id(uint32_t this_ptr, long val); + public static native void UpdateFailHTLC_set_htlc_id(number this_ptr, number val); // void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_ptr); - public static native void UpdateFailMalformedHTLC_free(uint32_t this_ptr); + public static native void UpdateFailMalformedHTLC_free(number this_ptr); // struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_clone(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR orig); - public static native uint32_t UpdateFailMalformedHTLC_clone(uint32_t orig); + public static native number UpdateFailMalformedHTLC_clone(number orig); // const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32]; - public static native byte[] UpdateFailMalformedHTLC_get_channel_id(uint32_t this_ptr); + public static native Uint8Array UpdateFailMalformedHTLC_get_channel_id(number this_ptr); // void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void UpdateFailMalformedHTLC_set_channel_id(uint32_t this_ptr, byte[] val); + public static native void UpdateFailMalformedHTLC_set_channel_id(number this_ptr, Uint8Array val); // uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr); - public static native long UpdateFailMalformedHTLC_get_htlc_id(uint32_t this_ptr); + public static native number UpdateFailMalformedHTLC_get_htlc_id(number this_ptr); // void UpdateFailMalformedHTLC_set_htlc_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint64_t val); - public static native void UpdateFailMalformedHTLC_set_htlc_id(uint32_t this_ptr, long val); + public static native void UpdateFailMalformedHTLC_set_htlc_id(number this_ptr, number val); // uint16_t UpdateFailMalformedHTLC_get_failure_code(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr); - public static native short UpdateFailMalformedHTLC_get_failure_code(uint32_t this_ptr); + public static native number UpdateFailMalformedHTLC_get_failure_code(number this_ptr); // void UpdateFailMalformedHTLC_set_failure_code(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, uint16_t val); - public static native void UpdateFailMalformedHTLC_set_failure_code(uint32_t this_ptr, short val); + public static native void UpdateFailMalformedHTLC_set_failure_code(number this_ptr, number val); // void CommitmentSigned_free(struct LDKCommitmentSigned this_ptr); - public static native void CommitmentSigned_free(uint32_t this_ptr); + public static native void CommitmentSigned_free(number this_ptr); // struct LDKCommitmentSigned CommitmentSigned_clone(const struct LDKCommitmentSigned *NONNULL_PTR orig); - public static native uint32_t CommitmentSigned_clone(uint32_t orig); + public static native number CommitmentSigned_clone(number orig); // const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32]; - public static native byte[] CommitmentSigned_get_channel_id(uint32_t this_ptr); + public static native Uint8Array CommitmentSigned_get_channel_id(number this_ptr); // void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void CommitmentSigned_set_channel_id(uint32_t this_ptr, byte[] val); + public static native void CommitmentSigned_set_channel_id(number this_ptr, Uint8Array val); // struct LDKSignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr); - public static native byte[] CommitmentSigned_get_signature(uint32_t this_ptr); + public static native Uint8Array CommitmentSigned_get_signature(number this_ptr); // void CommitmentSigned_set_signature(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKSignature val); - public static native void CommitmentSigned_set_signature(uint32_t this_ptr, byte[] val); + public static native void CommitmentSigned_set_signature(number this_ptr, Uint8Array val); // void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val); - public static native void CommitmentSigned_set_htlc_signatures(uint32_t this_ptr, byte[][] val); + public static native void CommitmentSigned_set_htlc_signatures(number this_ptr, Uint8Array[] val); // MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKSignature signature_arg, struct LDKCVec_SignatureZ htlc_signatures_arg); - public static native uint32_t CommitmentSigned_new(byte[] channel_id_arg, byte[] signature_arg, byte[][] htlc_signatures_arg); + public static native number CommitmentSigned_new(Uint8Array channel_id_arg, Uint8Array signature_arg, Uint8Array[] htlc_signatures_arg); // void RevokeAndACK_free(struct LDKRevokeAndACK this_ptr); - public static native void RevokeAndACK_free(uint32_t this_ptr); + public static native void RevokeAndACK_free(number this_ptr); // struct LDKRevokeAndACK RevokeAndACK_clone(const struct LDKRevokeAndACK *NONNULL_PTR orig); - public static native uint32_t RevokeAndACK_clone(uint32_t orig); + public static native number RevokeAndACK_clone(number orig); // const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32]; - public static native byte[] RevokeAndACK_get_channel_id(uint32_t this_ptr); + public static native Uint8Array RevokeAndACK_get_channel_id(number this_ptr); // void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void RevokeAndACK_set_channel_id(uint32_t this_ptr, byte[] val); + public static native void RevokeAndACK_set_channel_id(number this_ptr, Uint8Array val); // const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32]; - public static native byte[] RevokeAndACK_get_per_commitment_secret(uint32_t this_ptr); + public static native Uint8Array RevokeAndACK_get_per_commitment_secret(number this_ptr); // void RevokeAndACK_set_per_commitment_secret(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void RevokeAndACK_set_per_commitment_secret(uint32_t this_ptr, byte[] val); + public static native void RevokeAndACK_set_per_commitment_secret(number this_ptr, Uint8Array val); // struct LDKPublicKey RevokeAndACK_get_next_per_commitment_point(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr); - public static native byte[] RevokeAndACK_get_next_per_commitment_point(uint32_t this_ptr); + public static native Uint8Array RevokeAndACK_get_next_per_commitment_point(number this_ptr); // void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void RevokeAndACK_set_next_per_commitment_point(uint32_t this_ptr, byte[] val); + public static native void RevokeAndACK_set_next_per_commitment_point(number this_ptr, Uint8Array val); // MUST_USE_RES struct LDKRevokeAndACK RevokeAndACK_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKThirtyTwoBytes per_commitment_secret_arg, struct LDKPublicKey next_per_commitment_point_arg); - public static native uint32_t RevokeAndACK_new(byte[] channel_id_arg, byte[] per_commitment_secret_arg, byte[] next_per_commitment_point_arg); + public static native number RevokeAndACK_new(Uint8Array channel_id_arg, Uint8Array per_commitment_secret_arg, Uint8Array next_per_commitment_point_arg); // void UpdateFee_free(struct LDKUpdateFee this_ptr); - public static native void UpdateFee_free(uint32_t this_ptr); + public static native void UpdateFee_free(number this_ptr); // struct LDKUpdateFee UpdateFee_clone(const struct LDKUpdateFee *NONNULL_PTR orig); - public static native uint32_t UpdateFee_clone(uint32_t orig); + public static native number UpdateFee_clone(number orig); // const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32]; - public static native byte[] UpdateFee_get_channel_id(uint32_t this_ptr); + public static native Uint8Array UpdateFee_get_channel_id(number this_ptr); // void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void UpdateFee_set_channel_id(uint32_t this_ptr, byte[] val); + public static native void UpdateFee_set_channel_id(number this_ptr, Uint8Array val); // uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr); - public static native int UpdateFee_get_feerate_per_kw(uint32_t this_ptr); + public static native number UpdateFee_get_feerate_per_kw(number this_ptr); // void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val); - public static native void UpdateFee_set_feerate_per_kw(uint32_t this_ptr, int val); + public static native void UpdateFee_set_feerate_per_kw(number this_ptr, number val); // MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg); - public static native uint32_t UpdateFee_new(byte[] channel_id_arg, int feerate_per_kw_arg); + public static native number UpdateFee_new(Uint8Array channel_id_arg, number feerate_per_kw_arg); // void DataLossProtect_free(struct LDKDataLossProtect this_ptr); - public static native void DataLossProtect_free(uint32_t this_ptr); + public static native void DataLossProtect_free(number this_ptr); // struct LDKDataLossProtect DataLossProtect_clone(const struct LDKDataLossProtect *NONNULL_PTR orig); - public static native uint32_t DataLossProtect_clone(uint32_t orig); + public static native number DataLossProtect_clone(number orig); // const uint8_t (*DataLossProtect_get_your_last_per_commitment_secret(const struct LDKDataLossProtect *NONNULL_PTR this_ptr))[32]; - public static native byte[] DataLossProtect_get_your_last_per_commitment_secret(uint32_t this_ptr); + public static native Uint8Array DataLossProtect_get_your_last_per_commitment_secret(number this_ptr); // void DataLossProtect_set_your_last_per_commitment_secret(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void DataLossProtect_set_your_last_per_commitment_secret(uint32_t this_ptr, byte[] val); + public static native void DataLossProtect_set_your_last_per_commitment_secret(number this_ptr, Uint8Array val); // struct LDKPublicKey DataLossProtect_get_my_current_per_commitment_point(const struct LDKDataLossProtect *NONNULL_PTR this_ptr); - public static native byte[] DataLossProtect_get_my_current_per_commitment_point(uint32_t this_ptr); + public static native Uint8Array DataLossProtect_get_my_current_per_commitment_point(number this_ptr); // void DataLossProtect_set_my_current_per_commitment_point(struct LDKDataLossProtect *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void DataLossProtect_set_my_current_per_commitment_point(uint32_t this_ptr, byte[] val); + public static native void DataLossProtect_set_my_current_per_commitment_point(number this_ptr, Uint8Array val); // MUST_USE_RES struct LDKDataLossProtect DataLossProtect_new(struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg); - public static native uint32_t DataLossProtect_new(byte[] your_last_per_commitment_secret_arg, byte[] my_current_per_commitment_point_arg); + public static native number DataLossProtect_new(Uint8Array your_last_per_commitment_secret_arg, Uint8Array my_current_per_commitment_point_arg); // void ChannelReestablish_free(struct LDKChannelReestablish this_ptr); - public static native void ChannelReestablish_free(uint32_t this_ptr); + public static native void ChannelReestablish_free(number this_ptr); // struct LDKChannelReestablish ChannelReestablish_clone(const struct LDKChannelReestablish *NONNULL_PTR orig); - public static native uint32_t ChannelReestablish_clone(uint32_t orig); + public static native number ChannelReestablish_clone(number orig); // const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32]; - public static native byte[] ChannelReestablish_get_channel_id(uint32_t this_ptr); + public static native Uint8Array ChannelReestablish_get_channel_id(number this_ptr); // void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void ChannelReestablish_set_channel_id(uint32_t this_ptr, byte[] val); + public static native void ChannelReestablish_set_channel_id(number this_ptr, Uint8Array val); // uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr); - public static native long ChannelReestablish_get_next_local_commitment_number(uint32_t this_ptr); + public static native number ChannelReestablish_get_next_local_commitment_number(number this_ptr); // void ChannelReestablish_set_next_local_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val); - public static native void ChannelReestablish_set_next_local_commitment_number(uint32_t this_ptr, long val); + public static native void ChannelReestablish_set_next_local_commitment_number(number this_ptr, number val); // uint64_t ChannelReestablish_get_next_remote_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr); - public static native long ChannelReestablish_get_next_remote_commitment_number(uint32_t this_ptr); + public static native number ChannelReestablish_get_next_remote_commitment_number(number this_ptr); // void ChannelReestablish_set_next_remote_commitment_number(struct LDKChannelReestablish *NONNULL_PTR this_ptr, uint64_t val); - public static native void ChannelReestablish_set_next_remote_commitment_number(uint32_t this_ptr, long val); + public static native void ChannelReestablish_set_next_remote_commitment_number(number this_ptr, number val); // void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_ptr); - public static native void AnnouncementSignatures_free(uint32_t this_ptr); + public static native void AnnouncementSignatures_free(number this_ptr); // struct LDKAnnouncementSignatures AnnouncementSignatures_clone(const struct LDKAnnouncementSignatures *NONNULL_PTR orig); - public static native uint32_t AnnouncementSignatures_clone(uint32_t orig); + public static native number AnnouncementSignatures_clone(number orig); // const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32]; - public static native byte[] AnnouncementSignatures_get_channel_id(uint32_t this_ptr); + public static native Uint8Array AnnouncementSignatures_get_channel_id(number this_ptr); // void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void AnnouncementSignatures_set_channel_id(uint32_t this_ptr, byte[] val); + public static native void AnnouncementSignatures_set_channel_id(number this_ptr, Uint8Array val); // uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr); - public static native long AnnouncementSignatures_get_short_channel_id(uint32_t this_ptr); + public static native number AnnouncementSignatures_get_short_channel_id(number this_ptr); // void AnnouncementSignatures_set_short_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, uint64_t val); - public static native void AnnouncementSignatures_set_short_channel_id(uint32_t this_ptr, long val); + public static native void AnnouncementSignatures_set_short_channel_id(number this_ptr, number val); // struct LDKSignature AnnouncementSignatures_get_node_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr); - public static native byte[] AnnouncementSignatures_get_node_signature(uint32_t this_ptr); + public static native Uint8Array AnnouncementSignatures_get_node_signature(number this_ptr); // void AnnouncementSignatures_set_node_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val); - public static native void AnnouncementSignatures_set_node_signature(uint32_t this_ptr, byte[] val); + public static native void AnnouncementSignatures_set_node_signature(number this_ptr, Uint8Array val); // struct LDKSignature AnnouncementSignatures_get_bitcoin_signature(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr); - public static native byte[] AnnouncementSignatures_get_bitcoin_signature(uint32_t this_ptr); + public static native Uint8Array AnnouncementSignatures_get_bitcoin_signature(number this_ptr); // void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKSignature val); - public static native void AnnouncementSignatures_set_bitcoin_signature(uint32_t this_ptr, byte[] val); + public static native void AnnouncementSignatures_set_bitcoin_signature(number this_ptr, Uint8Array val); // MUST_USE_RES struct LDKAnnouncementSignatures AnnouncementSignatures_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t short_channel_id_arg, struct LDKSignature node_signature_arg, struct LDKSignature bitcoin_signature_arg); - public static native uint32_t AnnouncementSignatures_new(byte[] channel_id_arg, long short_channel_id_arg, byte[] node_signature_arg, byte[] bitcoin_signature_arg); + public static native number AnnouncementSignatures_new(Uint8Array channel_id_arg, number short_channel_id_arg, Uint8Array node_signature_arg, Uint8Array bitcoin_signature_arg); // void NetAddress_free(struct LDKNetAddress this_ptr); - public static native void NetAddress_free(uint32_t this_ptr); + public static native void NetAddress_free(number this_ptr); // struct LDKNetAddress NetAddress_clone(const struct LDKNetAddress *NONNULL_PTR orig); - public static native uint32_t NetAddress_clone(uint32_t orig); + public static native number NetAddress_clone(number orig); // struct LDKCVec_u8Z NetAddress_write(const struct LDKNetAddress *NONNULL_PTR obj); - public static native byte[] NetAddress_write(uint32_t obj); + public static native Uint8Array NetAddress_write(number obj); // struct LDKCResult_CResult_NetAddressu8ZDecodeErrorZ Result_read(struct LDKu8slice ser); - public static native uint32_t Result_read(byte[] ser); + public static native number Result_read(Uint8Array ser); // void UnsignedNodeAnnouncement_free(struct LDKUnsignedNodeAnnouncement this_ptr); - public static native void UnsignedNodeAnnouncement_free(uint32_t this_ptr); + public static native void UnsignedNodeAnnouncement_free(number this_ptr); // struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig); - public static native uint32_t UnsignedNodeAnnouncement_clone(uint32_t orig); + public static native number UnsignedNodeAnnouncement_clone(number orig); // struct LDKNodeFeatures UnsignedNodeAnnouncement_get_features(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr); - public static native uint32_t UnsignedNodeAnnouncement_get_features(uint32_t this_ptr); + public static native number UnsignedNodeAnnouncement_get_features(number this_ptr); // void UnsignedNodeAnnouncement_set_features(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKNodeFeatures val); - public static native void UnsignedNodeAnnouncement_set_features(uint32_t this_ptr, uint32_t val); + public static native void UnsignedNodeAnnouncement_set_features(number this_ptr, number val); // uint32_t UnsignedNodeAnnouncement_get_timestamp(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr); - public static native int UnsignedNodeAnnouncement_get_timestamp(uint32_t this_ptr); + public static native number UnsignedNodeAnnouncement_get_timestamp(number this_ptr); // void UnsignedNodeAnnouncement_set_timestamp(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, uint32_t val); - public static native void UnsignedNodeAnnouncement_set_timestamp(uint32_t this_ptr, int val); + public static native void UnsignedNodeAnnouncement_set_timestamp(number this_ptr, number val); // struct LDKPublicKey UnsignedNodeAnnouncement_get_node_id(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr); - public static native byte[] UnsignedNodeAnnouncement_get_node_id(uint32_t this_ptr); + public static native Uint8Array UnsignedNodeAnnouncement_get_node_id(number this_ptr); // void UnsignedNodeAnnouncement_set_node_id(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void UnsignedNodeAnnouncement_set_node_id(uint32_t this_ptr, byte[] val); + public static native void UnsignedNodeAnnouncement_set_node_id(number this_ptr, Uint8Array val); // const uint8_t (*UnsignedNodeAnnouncement_get_rgb(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[3]; - public static native byte[] UnsignedNodeAnnouncement_get_rgb(uint32_t this_ptr); + public static native Uint8Array UnsignedNodeAnnouncement_get_rgb(number this_ptr); // void UnsignedNodeAnnouncement_set_rgb(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThreeBytes val); - public static native void UnsignedNodeAnnouncement_set_rgb(uint32_t this_ptr, byte[] val); + public static native void UnsignedNodeAnnouncement_set_rgb(number this_ptr, Uint8Array val); // const uint8_t (*UnsignedNodeAnnouncement_get_alias(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr))[32]; - public static native byte[] UnsignedNodeAnnouncement_get_alias(uint32_t this_ptr); + public static native Uint8Array UnsignedNodeAnnouncement_get_alias(number this_ptr); // void UnsignedNodeAnnouncement_set_alias(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void UnsignedNodeAnnouncement_set_alias(uint32_t this_ptr, byte[] val); + public static native void UnsignedNodeAnnouncement_set_alias(number this_ptr, Uint8Array val); // void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val); - public static native void UnsignedNodeAnnouncement_set_addresses(uint32_t this_ptr, uint32_t[] val); + public static native void UnsignedNodeAnnouncement_set_addresses(number this_ptr, number[] val); // void NodeAnnouncement_free(struct LDKNodeAnnouncement this_ptr); - public static native void NodeAnnouncement_free(uint32_t this_ptr); + public static native void NodeAnnouncement_free(number this_ptr); // struct LDKNodeAnnouncement NodeAnnouncement_clone(const struct LDKNodeAnnouncement *NONNULL_PTR orig); - public static native uint32_t NodeAnnouncement_clone(uint32_t orig); + public static native number NodeAnnouncement_clone(number orig); // struct LDKSignature NodeAnnouncement_get_signature(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr); - public static native byte[] NodeAnnouncement_get_signature(uint32_t this_ptr); + public static native Uint8Array NodeAnnouncement_get_signature(number this_ptr); // void NodeAnnouncement_set_signature(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val); - public static native void NodeAnnouncement_set_signature(uint32_t this_ptr, byte[] val); + public static native void NodeAnnouncement_set_signature(number this_ptr, Uint8Array val); // struct LDKUnsignedNodeAnnouncement NodeAnnouncement_get_contents(const struct LDKNodeAnnouncement *NONNULL_PTR this_ptr); - public static native uint32_t NodeAnnouncement_get_contents(uint32_t this_ptr); + public static native number NodeAnnouncement_get_contents(number this_ptr); // void NodeAnnouncement_set_contents(struct LDKNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedNodeAnnouncement val); - public static native void NodeAnnouncement_set_contents(uint32_t this_ptr, uint32_t val); + public static native void NodeAnnouncement_set_contents(number this_ptr, number val); // MUST_USE_RES struct LDKNodeAnnouncement NodeAnnouncement_new(struct LDKSignature signature_arg, struct LDKUnsignedNodeAnnouncement contents_arg); - public static native uint32_t NodeAnnouncement_new(byte[] signature_arg, uint32_t contents_arg); + public static native number NodeAnnouncement_new(Uint8Array signature_arg, number contents_arg); // void UnsignedChannelAnnouncement_free(struct LDKUnsignedChannelAnnouncement this_ptr); - public static native void UnsignedChannelAnnouncement_free(uint32_t this_ptr); + public static native void UnsignedChannelAnnouncement_free(number this_ptr); // struct LDKUnsignedChannelAnnouncement UnsignedChannelAnnouncement_clone(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR orig); - public static native uint32_t UnsignedChannelAnnouncement_clone(uint32_t orig); + public static native number UnsignedChannelAnnouncement_clone(number orig); // struct LDKChannelFeatures UnsignedChannelAnnouncement_get_features(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr); - public static native uint32_t UnsignedChannelAnnouncement_get_features(uint32_t this_ptr); + public static native number UnsignedChannelAnnouncement_get_features(number this_ptr); // void UnsignedChannelAnnouncement_set_features(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKChannelFeatures val); - public static native void UnsignedChannelAnnouncement_set_features(uint32_t this_ptr, uint32_t val); + public static native void UnsignedChannelAnnouncement_set_features(number this_ptr, number val); // const uint8_t (*UnsignedChannelAnnouncement_get_chain_hash(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr))[32]; - public static native byte[] UnsignedChannelAnnouncement_get_chain_hash(uint32_t this_ptr); + public static native Uint8Array UnsignedChannelAnnouncement_get_chain_hash(number this_ptr); // void UnsignedChannelAnnouncement_set_chain_hash(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void UnsignedChannelAnnouncement_set_chain_hash(uint32_t this_ptr, byte[] val); + public static native void UnsignedChannelAnnouncement_set_chain_hash(number this_ptr, Uint8Array val); // uint64_t UnsignedChannelAnnouncement_get_short_channel_id(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr); - public static native long UnsignedChannelAnnouncement_get_short_channel_id(uint32_t this_ptr); + public static native number UnsignedChannelAnnouncement_get_short_channel_id(number this_ptr); // void UnsignedChannelAnnouncement_set_short_channel_id(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, uint64_t val); - public static native void UnsignedChannelAnnouncement_set_short_channel_id(uint32_t this_ptr, long val); + public static native void UnsignedChannelAnnouncement_set_short_channel_id(number this_ptr, number val); // struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr); - public static native byte[] UnsignedChannelAnnouncement_get_node_id_1(uint32_t this_ptr); + public static native Uint8Array UnsignedChannelAnnouncement_get_node_id_1(number this_ptr); // void UnsignedChannelAnnouncement_set_node_id_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void UnsignedChannelAnnouncement_set_node_id_1(uint32_t this_ptr, byte[] val); + public static native void UnsignedChannelAnnouncement_set_node_id_1(number this_ptr, Uint8Array val); // struct LDKPublicKey UnsignedChannelAnnouncement_get_node_id_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr); - public static native byte[] UnsignedChannelAnnouncement_get_node_id_2(uint32_t this_ptr); + public static native Uint8Array UnsignedChannelAnnouncement_get_node_id_2(number this_ptr); // void UnsignedChannelAnnouncement_set_node_id_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void UnsignedChannelAnnouncement_set_node_id_2(uint32_t this_ptr, byte[] val); + public static native void UnsignedChannelAnnouncement_set_node_id_2(number this_ptr, Uint8Array val); // struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_1(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr); - public static native byte[] UnsignedChannelAnnouncement_get_bitcoin_key_1(uint32_t this_ptr); + public static native Uint8Array UnsignedChannelAnnouncement_get_bitcoin_key_1(number this_ptr); // void UnsignedChannelAnnouncement_set_bitcoin_key_1(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void UnsignedChannelAnnouncement_set_bitcoin_key_1(uint32_t this_ptr, byte[] val); + public static native void UnsignedChannelAnnouncement_set_bitcoin_key_1(number this_ptr, Uint8Array val); // struct LDKPublicKey UnsignedChannelAnnouncement_get_bitcoin_key_2(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr); - public static native byte[] UnsignedChannelAnnouncement_get_bitcoin_key_2(uint32_t this_ptr); + public static native Uint8Array UnsignedChannelAnnouncement_get_bitcoin_key_2(number this_ptr); // void UnsignedChannelAnnouncement_set_bitcoin_key_2(struct LDKUnsignedChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void UnsignedChannelAnnouncement_set_bitcoin_key_2(uint32_t this_ptr, byte[] val); + public static native void UnsignedChannelAnnouncement_set_bitcoin_key_2(number this_ptr, Uint8Array val); // void ChannelAnnouncement_free(struct LDKChannelAnnouncement this_ptr); - public static native void ChannelAnnouncement_free(uint32_t this_ptr); + public static native void ChannelAnnouncement_free(number this_ptr); // struct LDKChannelAnnouncement ChannelAnnouncement_clone(const struct LDKChannelAnnouncement *NONNULL_PTR orig); - public static native uint32_t ChannelAnnouncement_clone(uint32_t orig); + public static native number ChannelAnnouncement_clone(number orig); // struct LDKSignature ChannelAnnouncement_get_node_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr); - public static native byte[] ChannelAnnouncement_get_node_signature_1(uint32_t this_ptr); + public static native Uint8Array ChannelAnnouncement_get_node_signature_1(number this_ptr); // void ChannelAnnouncement_set_node_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val); - public static native void ChannelAnnouncement_set_node_signature_1(uint32_t this_ptr, byte[] val); + public static native void ChannelAnnouncement_set_node_signature_1(number this_ptr, Uint8Array val); // struct LDKSignature ChannelAnnouncement_get_node_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr); - public static native byte[] ChannelAnnouncement_get_node_signature_2(uint32_t this_ptr); + public static native Uint8Array ChannelAnnouncement_get_node_signature_2(number this_ptr); // void ChannelAnnouncement_set_node_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val); - public static native void ChannelAnnouncement_set_node_signature_2(uint32_t this_ptr, byte[] val); + public static native void ChannelAnnouncement_set_node_signature_2(number this_ptr, Uint8Array val); // struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_1(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr); - public static native byte[] ChannelAnnouncement_get_bitcoin_signature_1(uint32_t this_ptr); + public static native Uint8Array ChannelAnnouncement_get_bitcoin_signature_1(number this_ptr); // void ChannelAnnouncement_set_bitcoin_signature_1(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val); - public static native void ChannelAnnouncement_set_bitcoin_signature_1(uint32_t this_ptr, byte[] val); + public static native void ChannelAnnouncement_set_bitcoin_signature_1(number this_ptr, Uint8Array val); // struct LDKSignature ChannelAnnouncement_get_bitcoin_signature_2(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr); - public static native byte[] ChannelAnnouncement_get_bitcoin_signature_2(uint32_t this_ptr); + public static native Uint8Array ChannelAnnouncement_get_bitcoin_signature_2(number this_ptr); // void ChannelAnnouncement_set_bitcoin_signature_2(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKSignature val); - public static native void ChannelAnnouncement_set_bitcoin_signature_2(uint32_t this_ptr, byte[] val); + public static native void ChannelAnnouncement_set_bitcoin_signature_2(number this_ptr, Uint8Array val); // struct LDKUnsignedChannelAnnouncement ChannelAnnouncement_get_contents(const struct LDKChannelAnnouncement *NONNULL_PTR this_ptr); - public static native uint32_t ChannelAnnouncement_get_contents(uint32_t this_ptr); + public static native number ChannelAnnouncement_get_contents(number this_ptr); // void ChannelAnnouncement_set_contents(struct LDKChannelAnnouncement *NONNULL_PTR this_ptr, struct LDKUnsignedChannelAnnouncement val); - public static native void ChannelAnnouncement_set_contents(uint32_t this_ptr, uint32_t val); + public static native void ChannelAnnouncement_set_contents(number this_ptr, number val); // MUST_USE_RES struct LDKChannelAnnouncement ChannelAnnouncement_new(struct LDKSignature node_signature_1_arg, struct LDKSignature node_signature_2_arg, struct LDKSignature bitcoin_signature_1_arg, struct LDKSignature bitcoin_signature_2_arg, struct LDKUnsignedChannelAnnouncement contents_arg); - public static native uint32_t ChannelAnnouncement_new(byte[] node_signature_1_arg, byte[] node_signature_2_arg, byte[] bitcoin_signature_1_arg, byte[] bitcoin_signature_2_arg, uint32_t contents_arg); + public static native number ChannelAnnouncement_new(Uint8Array node_signature_1_arg, Uint8Array node_signature_2_arg, Uint8Array bitcoin_signature_1_arg, Uint8Array bitcoin_signature_2_arg, number contents_arg); // void UnsignedChannelUpdate_free(struct LDKUnsignedChannelUpdate this_ptr); - public static native void UnsignedChannelUpdate_free(uint32_t this_ptr); + public static native void UnsignedChannelUpdate_free(number this_ptr); // struct LDKUnsignedChannelUpdate UnsignedChannelUpdate_clone(const struct LDKUnsignedChannelUpdate *NONNULL_PTR orig); - public static native uint32_t UnsignedChannelUpdate_clone(uint32_t orig); + public static native number UnsignedChannelUpdate_clone(number orig); // const uint8_t (*UnsignedChannelUpdate_get_chain_hash(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr))[32]; - public static native byte[] UnsignedChannelUpdate_get_chain_hash(uint32_t this_ptr); + public static native Uint8Array UnsignedChannelUpdate_get_chain_hash(number this_ptr); // void UnsignedChannelUpdate_set_chain_hash(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void UnsignedChannelUpdate_set_chain_hash(uint32_t this_ptr, byte[] val); + public static native void UnsignedChannelUpdate_set_chain_hash(number this_ptr, Uint8Array val); // uint64_t UnsignedChannelUpdate_get_short_channel_id(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr); - public static native long UnsignedChannelUpdate_get_short_channel_id(uint32_t this_ptr); + public static native number UnsignedChannelUpdate_get_short_channel_id(number this_ptr); // void UnsignedChannelUpdate_set_short_channel_id(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val); - public static native void UnsignedChannelUpdate_set_short_channel_id(uint32_t this_ptr, long val); + public static native void UnsignedChannelUpdate_set_short_channel_id(number this_ptr, number val); // uint32_t UnsignedChannelUpdate_get_timestamp(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr); - public static native int UnsignedChannelUpdate_get_timestamp(uint32_t this_ptr); + public static native number UnsignedChannelUpdate_get_timestamp(number this_ptr); // void UnsignedChannelUpdate_set_timestamp(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val); - public static native void UnsignedChannelUpdate_set_timestamp(uint32_t this_ptr, int val); + public static native void UnsignedChannelUpdate_set_timestamp(number this_ptr, number val); // uint8_t UnsignedChannelUpdate_get_flags(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr); - public static native byte UnsignedChannelUpdate_get_flags(uint32_t this_ptr); + public static native number UnsignedChannelUpdate_get_flags(number this_ptr); // void UnsignedChannelUpdate_set_flags(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint8_t val); - public static native void UnsignedChannelUpdate_set_flags(uint32_t this_ptr, byte val); + public static native void UnsignedChannelUpdate_set_flags(number this_ptr, number val); // uint16_t UnsignedChannelUpdate_get_cltv_expiry_delta(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr); - public static native short UnsignedChannelUpdate_get_cltv_expiry_delta(uint32_t this_ptr); + public static native number UnsignedChannelUpdate_get_cltv_expiry_delta(number this_ptr); // void UnsignedChannelUpdate_set_cltv_expiry_delta(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint16_t val); - public static native void UnsignedChannelUpdate_set_cltv_expiry_delta(uint32_t this_ptr, short val); + public static native void UnsignedChannelUpdate_set_cltv_expiry_delta(number this_ptr, number val); // uint64_t UnsignedChannelUpdate_get_htlc_minimum_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr); - public static native long UnsignedChannelUpdate_get_htlc_minimum_msat(uint32_t this_ptr); + public static native number UnsignedChannelUpdate_get_htlc_minimum_msat(number this_ptr); // void UnsignedChannelUpdate_set_htlc_minimum_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint64_t val); - public static native void UnsignedChannelUpdate_set_htlc_minimum_msat(uint32_t this_ptr, long val); + public static native void UnsignedChannelUpdate_set_htlc_minimum_msat(number this_ptr, number val); // uint32_t UnsignedChannelUpdate_get_fee_base_msat(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr); - public static native int UnsignedChannelUpdate_get_fee_base_msat(uint32_t this_ptr); + public static native number UnsignedChannelUpdate_get_fee_base_msat(number this_ptr); // void UnsignedChannelUpdate_set_fee_base_msat(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val); - public static native void UnsignedChannelUpdate_set_fee_base_msat(uint32_t this_ptr, int val); + public static native void UnsignedChannelUpdate_set_fee_base_msat(number this_ptr, number val); // uint32_t UnsignedChannelUpdate_get_fee_proportional_millionths(const struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr); - public static native int UnsignedChannelUpdate_get_fee_proportional_millionths(uint32_t this_ptr); + public static native number UnsignedChannelUpdate_get_fee_proportional_millionths(number this_ptr); // void UnsignedChannelUpdate_set_fee_proportional_millionths(struct LDKUnsignedChannelUpdate *NONNULL_PTR this_ptr, uint32_t val); - public static native void UnsignedChannelUpdate_set_fee_proportional_millionths(uint32_t this_ptr, int val); + public static native void UnsignedChannelUpdate_set_fee_proportional_millionths(number this_ptr, number val); // void ChannelUpdate_free(struct LDKChannelUpdate this_ptr); - public static native void ChannelUpdate_free(uint32_t this_ptr); + public static native void ChannelUpdate_free(number this_ptr); // struct LDKChannelUpdate ChannelUpdate_clone(const struct LDKChannelUpdate *NONNULL_PTR orig); - public static native uint32_t ChannelUpdate_clone(uint32_t orig); + public static native number ChannelUpdate_clone(number orig); // struct LDKSignature ChannelUpdate_get_signature(const struct LDKChannelUpdate *NONNULL_PTR this_ptr); - public static native byte[] ChannelUpdate_get_signature(uint32_t this_ptr); + public static native Uint8Array ChannelUpdate_get_signature(number this_ptr); // void ChannelUpdate_set_signature(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKSignature val); - public static native void ChannelUpdate_set_signature(uint32_t this_ptr, byte[] val); + public static native void ChannelUpdate_set_signature(number this_ptr, Uint8Array val); // struct LDKUnsignedChannelUpdate ChannelUpdate_get_contents(const struct LDKChannelUpdate *NONNULL_PTR this_ptr); - public static native uint32_t ChannelUpdate_get_contents(uint32_t this_ptr); + public static native number ChannelUpdate_get_contents(number this_ptr); // void ChannelUpdate_set_contents(struct LDKChannelUpdate *NONNULL_PTR this_ptr, struct LDKUnsignedChannelUpdate val); - public static native void ChannelUpdate_set_contents(uint32_t this_ptr, uint32_t val); + public static native void ChannelUpdate_set_contents(number this_ptr, number val); // MUST_USE_RES struct LDKChannelUpdate ChannelUpdate_new(struct LDKSignature signature_arg, struct LDKUnsignedChannelUpdate contents_arg); - public static native uint32_t ChannelUpdate_new(byte[] signature_arg, uint32_t contents_arg); + public static native number ChannelUpdate_new(Uint8Array signature_arg, number contents_arg); // void QueryChannelRange_free(struct LDKQueryChannelRange this_ptr); - public static native void QueryChannelRange_free(uint32_t this_ptr); + public static native void QueryChannelRange_free(number this_ptr); // struct LDKQueryChannelRange QueryChannelRange_clone(const struct LDKQueryChannelRange *NONNULL_PTR orig); - public static native uint32_t QueryChannelRange_clone(uint32_t orig); + public static native number QueryChannelRange_clone(number orig); // const uint8_t (*QueryChannelRange_get_chain_hash(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr))[32]; - public static native byte[] QueryChannelRange_get_chain_hash(uint32_t this_ptr); + public static native Uint8Array QueryChannelRange_get_chain_hash(number this_ptr); // void QueryChannelRange_set_chain_hash(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void QueryChannelRange_set_chain_hash(uint32_t this_ptr, byte[] val); + public static native void QueryChannelRange_set_chain_hash(number this_ptr, Uint8Array val); // uint32_t QueryChannelRange_get_first_blocknum(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr); - public static native int QueryChannelRange_get_first_blocknum(uint32_t this_ptr); + public static native number QueryChannelRange_get_first_blocknum(number this_ptr); // void QueryChannelRange_set_first_blocknum(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val); - public static native void QueryChannelRange_set_first_blocknum(uint32_t this_ptr, int val); + public static native void QueryChannelRange_set_first_blocknum(number this_ptr, number val); // uint32_t QueryChannelRange_get_number_of_blocks(const struct LDKQueryChannelRange *NONNULL_PTR this_ptr); - public static native int QueryChannelRange_get_number_of_blocks(uint32_t this_ptr); + public static native number QueryChannelRange_get_number_of_blocks(number this_ptr); // void QueryChannelRange_set_number_of_blocks(struct LDKQueryChannelRange *NONNULL_PTR this_ptr, uint32_t val); - public static native void QueryChannelRange_set_number_of_blocks(uint32_t this_ptr, int val); + public static native void QueryChannelRange_set_number_of_blocks(number this_ptr, number val); // MUST_USE_RES struct LDKQueryChannelRange QueryChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg); - public static native uint32_t QueryChannelRange_new(byte[] chain_hash_arg, int first_blocknum_arg, int number_of_blocks_arg); + public static native number QueryChannelRange_new(Uint8Array chain_hash_arg, number first_blocknum_arg, number number_of_blocks_arg); // void ReplyChannelRange_free(struct LDKReplyChannelRange this_ptr); - public static native void ReplyChannelRange_free(uint32_t this_ptr); + public static native void ReplyChannelRange_free(number this_ptr); // struct LDKReplyChannelRange ReplyChannelRange_clone(const struct LDKReplyChannelRange *NONNULL_PTR orig); - public static native uint32_t ReplyChannelRange_clone(uint32_t orig); + public static native number ReplyChannelRange_clone(number orig); // const uint8_t (*ReplyChannelRange_get_chain_hash(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr))[32]; - public static native byte[] ReplyChannelRange_get_chain_hash(uint32_t this_ptr); + public static native Uint8Array ReplyChannelRange_get_chain_hash(number this_ptr); // void ReplyChannelRange_set_chain_hash(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void ReplyChannelRange_set_chain_hash(uint32_t this_ptr, byte[] val); + public static native void ReplyChannelRange_set_chain_hash(number this_ptr, Uint8Array val); // uint32_t ReplyChannelRange_get_first_blocknum(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr); - public static native int ReplyChannelRange_get_first_blocknum(uint32_t this_ptr); + public static native number ReplyChannelRange_get_first_blocknum(number this_ptr); // void ReplyChannelRange_set_first_blocknum(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val); - public static native void ReplyChannelRange_set_first_blocknum(uint32_t this_ptr, int val); + public static native void ReplyChannelRange_set_first_blocknum(number this_ptr, number val); // uint32_t ReplyChannelRange_get_number_of_blocks(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr); - public static native int ReplyChannelRange_get_number_of_blocks(uint32_t this_ptr); + public static native number ReplyChannelRange_get_number_of_blocks(number this_ptr); // void ReplyChannelRange_set_number_of_blocks(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, uint32_t val); - public static native void ReplyChannelRange_set_number_of_blocks(uint32_t this_ptr, int val); + public static native void ReplyChannelRange_set_number_of_blocks(number this_ptr, number val); // bool ReplyChannelRange_get_full_information(const struct LDKReplyChannelRange *NONNULL_PTR this_ptr); - public static native boolean ReplyChannelRange_get_full_information(uint32_t this_ptr); + public static native boolean ReplyChannelRange_get_full_information(number this_ptr); // void ReplyChannelRange_set_full_information(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, bool val); - public static native void ReplyChannelRange_set_full_information(uint32_t this_ptr, boolean val); + public static native void ReplyChannelRange_set_full_information(number this_ptr, boolean val); // void ReplyChannelRange_set_short_channel_ids(struct LDKReplyChannelRange *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val); - public static native void ReplyChannelRange_set_short_channel_ids(uint32_t this_ptr, long[] val); + public static native void ReplyChannelRange_set_short_channel_ids(number this_ptr, number[] val); // MUST_USE_RES struct LDKReplyChannelRange ReplyChannelRange_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_blocknum_arg, uint32_t number_of_blocks_arg, bool full_information_arg, struct LDKCVec_u64Z short_channel_ids_arg); - public static native uint32_t ReplyChannelRange_new(byte[] chain_hash_arg, int first_blocknum_arg, int number_of_blocks_arg, boolean full_information_arg, long[] short_channel_ids_arg); + public static native number ReplyChannelRange_new(Uint8Array chain_hash_arg, number first_blocknum_arg, number number_of_blocks_arg, boolean full_information_arg, number[] short_channel_ids_arg); // void QueryShortChannelIds_free(struct LDKQueryShortChannelIds this_ptr); - public static native void QueryShortChannelIds_free(uint32_t this_ptr); + public static native void QueryShortChannelIds_free(number this_ptr); // struct LDKQueryShortChannelIds QueryShortChannelIds_clone(const struct LDKQueryShortChannelIds *NONNULL_PTR orig); - public static native uint32_t QueryShortChannelIds_clone(uint32_t orig); + public static native number QueryShortChannelIds_clone(number orig); // const uint8_t (*QueryShortChannelIds_get_chain_hash(const struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr))[32]; - public static native byte[] QueryShortChannelIds_get_chain_hash(uint32_t this_ptr); + public static native Uint8Array QueryShortChannelIds_get_chain_hash(number this_ptr); // void QueryShortChannelIds_set_chain_hash(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void QueryShortChannelIds_set_chain_hash(uint32_t this_ptr, byte[] val); + public static native void QueryShortChannelIds_set_chain_hash(number this_ptr, Uint8Array val); // void QueryShortChannelIds_set_short_channel_ids(struct LDKQueryShortChannelIds *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val); - public static native void QueryShortChannelIds_set_short_channel_ids(uint32_t this_ptr, long[] val); + public static native void QueryShortChannelIds_set_short_channel_ids(number this_ptr, number[] val); // MUST_USE_RES struct LDKQueryShortChannelIds QueryShortChannelIds_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKCVec_u64Z short_channel_ids_arg); - public static native uint32_t QueryShortChannelIds_new(byte[] chain_hash_arg, long[] short_channel_ids_arg); + public static native number QueryShortChannelIds_new(Uint8Array chain_hash_arg, number[] short_channel_ids_arg); // void ReplyShortChannelIdsEnd_free(struct LDKReplyShortChannelIdsEnd this_ptr); - public static native void ReplyShortChannelIdsEnd_free(uint32_t this_ptr); + public static native void ReplyShortChannelIdsEnd_free(number this_ptr); // struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_clone(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR orig); - public static native uint32_t ReplyShortChannelIdsEnd_clone(uint32_t orig); + public static native number ReplyShortChannelIdsEnd_clone(number orig); // const uint8_t (*ReplyShortChannelIdsEnd_get_chain_hash(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr))[32]; - public static native byte[] ReplyShortChannelIdsEnd_get_chain_hash(uint32_t this_ptr); + public static native Uint8Array ReplyShortChannelIdsEnd_get_chain_hash(number this_ptr); // void ReplyShortChannelIdsEnd_set_chain_hash(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void ReplyShortChannelIdsEnd_set_chain_hash(uint32_t this_ptr, byte[] val); + public static native void ReplyShortChannelIdsEnd_set_chain_hash(number this_ptr, Uint8Array val); // bool ReplyShortChannelIdsEnd_get_full_information(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr); - public static native boolean ReplyShortChannelIdsEnd_get_full_information(uint32_t this_ptr); + public static native boolean ReplyShortChannelIdsEnd_get_full_information(number this_ptr); // void ReplyShortChannelIdsEnd_set_full_information(struct LDKReplyShortChannelIdsEnd *NONNULL_PTR this_ptr, bool val); - public static native void ReplyShortChannelIdsEnd_set_full_information(uint32_t this_ptr, boolean val); + public static native void ReplyShortChannelIdsEnd_set_full_information(number this_ptr, boolean val); // MUST_USE_RES struct LDKReplyShortChannelIdsEnd ReplyShortChannelIdsEnd_new(struct LDKThirtyTwoBytes chain_hash_arg, bool full_information_arg); - public static native uint32_t ReplyShortChannelIdsEnd_new(byte[] chain_hash_arg, boolean full_information_arg); + public static native number ReplyShortChannelIdsEnd_new(Uint8Array chain_hash_arg, boolean full_information_arg); // void GossipTimestampFilter_free(struct LDKGossipTimestampFilter this_ptr); - public static native void GossipTimestampFilter_free(uint32_t this_ptr); + public static native void GossipTimestampFilter_free(number this_ptr); // struct LDKGossipTimestampFilter GossipTimestampFilter_clone(const struct LDKGossipTimestampFilter *NONNULL_PTR orig); - public static native uint32_t GossipTimestampFilter_clone(uint32_t orig); + public static native number GossipTimestampFilter_clone(number orig); // const uint8_t (*GossipTimestampFilter_get_chain_hash(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr))[32]; - public static native byte[] GossipTimestampFilter_get_chain_hash(uint32_t this_ptr); + public static native Uint8Array GossipTimestampFilter_get_chain_hash(number this_ptr); // void GossipTimestampFilter_set_chain_hash(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void GossipTimestampFilter_set_chain_hash(uint32_t this_ptr, byte[] val); + public static native void GossipTimestampFilter_set_chain_hash(number this_ptr, Uint8Array val); // uint32_t GossipTimestampFilter_get_first_timestamp(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr); - public static native int GossipTimestampFilter_get_first_timestamp(uint32_t this_ptr); + public static native number GossipTimestampFilter_get_first_timestamp(number this_ptr); // void GossipTimestampFilter_set_first_timestamp(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val); - public static native void GossipTimestampFilter_set_first_timestamp(uint32_t this_ptr, int val); + public static native void GossipTimestampFilter_set_first_timestamp(number this_ptr, number val); // uint32_t GossipTimestampFilter_get_timestamp_range(const struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr); - public static native int GossipTimestampFilter_get_timestamp_range(uint32_t this_ptr); + public static native number GossipTimestampFilter_get_timestamp_range(number this_ptr); // void GossipTimestampFilter_set_timestamp_range(struct LDKGossipTimestampFilter *NONNULL_PTR this_ptr, uint32_t val); - public static native void GossipTimestampFilter_set_timestamp_range(uint32_t this_ptr, int val); + public static native void GossipTimestampFilter_set_timestamp_range(number this_ptr, number val); // MUST_USE_RES struct LDKGossipTimestampFilter GossipTimestampFilter_new(struct LDKThirtyTwoBytes chain_hash_arg, uint32_t first_timestamp_arg, uint32_t timestamp_range_arg); - public static native uint32_t GossipTimestampFilter_new(byte[] chain_hash_arg, int first_timestamp_arg, int timestamp_range_arg); + public static native number GossipTimestampFilter_new(Uint8Array chain_hash_arg, number first_timestamp_arg, number timestamp_range_arg); // void ErrorAction_free(struct LDKErrorAction this_ptr); - public static native void ErrorAction_free(uint32_t this_ptr); + public static native void ErrorAction_free(number this_ptr); // struct LDKErrorAction ErrorAction_clone(const struct LDKErrorAction *NONNULL_PTR orig); - public static native uint32_t ErrorAction_clone(uint32_t orig); + public static native number ErrorAction_clone(number orig); // void LightningError_free(struct LDKLightningError this_ptr); - public static native void LightningError_free(uint32_t this_ptr); + public static native void LightningError_free(number this_ptr); // struct LDKStr LightningError_get_err(const struct LDKLightningError *NONNULL_PTR this_ptr); - public static native String LightningError_get_err(uint32_t this_ptr); + public static native String LightningError_get_err(number this_ptr); // void LightningError_set_err(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val); - public static native void LightningError_set_err(uint32_t this_ptr, byte[] val); + public static native void LightningError_set_err(number this_ptr, Uint8Array val); // struct LDKErrorAction LightningError_get_action(const struct LDKLightningError *NONNULL_PTR this_ptr); - public static native uint32_t LightningError_get_action(uint32_t this_ptr); + public static native number LightningError_get_action(number this_ptr); // void LightningError_set_action(struct LDKLightningError *NONNULL_PTR this_ptr, struct LDKErrorAction val); - public static native void LightningError_set_action(uint32_t this_ptr, uint32_t val); + public static native void LightningError_set_action(number this_ptr, number val); // MUST_USE_RES struct LDKLightningError LightningError_new(struct LDKCVec_u8Z err_arg, struct LDKErrorAction action_arg); - public static native uint32_t LightningError_new(byte[] err_arg, uint32_t action_arg); + public static native number LightningError_new(Uint8Array err_arg, number action_arg); // void CommitmentUpdate_free(struct LDKCommitmentUpdate this_ptr); - public static native void CommitmentUpdate_free(uint32_t this_ptr); + public static native void CommitmentUpdate_free(number this_ptr); // struct LDKCommitmentUpdate CommitmentUpdate_clone(const struct LDKCommitmentUpdate *NONNULL_PTR orig); - public static native uint32_t CommitmentUpdate_clone(uint32_t orig); + public static native number CommitmentUpdate_clone(number orig); // void CommitmentUpdate_set_update_add_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateAddHTLCZ val); - public static native void CommitmentUpdate_set_update_add_htlcs(uint32_t this_ptr, uint32_t[] val); + public static native void CommitmentUpdate_set_update_add_htlcs(number this_ptr, number[] val); // void CommitmentUpdate_set_update_fulfill_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFulfillHTLCZ val); - public static native void CommitmentUpdate_set_update_fulfill_htlcs(uint32_t this_ptr, uint32_t[] val); + public static native void CommitmentUpdate_set_update_fulfill_htlcs(number this_ptr, number[] val); // void CommitmentUpdate_set_update_fail_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailHTLCZ val); - public static native void CommitmentUpdate_set_update_fail_htlcs(uint32_t this_ptr, uint32_t[] val); + public static native void CommitmentUpdate_set_update_fail_htlcs(number this_ptr, number[] val); // void CommitmentUpdate_set_update_fail_malformed_htlcs(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCVec_UpdateFailMalformedHTLCZ val); - public static native void CommitmentUpdate_set_update_fail_malformed_htlcs(uint32_t this_ptr, uint32_t[] val); + public static native void CommitmentUpdate_set_update_fail_malformed_htlcs(number this_ptr, number[] val); // struct LDKUpdateFee CommitmentUpdate_get_update_fee(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr); - public static native uint32_t CommitmentUpdate_get_update_fee(uint32_t this_ptr); + public static native number CommitmentUpdate_get_update_fee(number this_ptr); // void CommitmentUpdate_set_update_fee(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKUpdateFee val); - public static native void CommitmentUpdate_set_update_fee(uint32_t this_ptr, uint32_t val); + public static native void CommitmentUpdate_set_update_fee(number this_ptr, number val); // struct LDKCommitmentSigned CommitmentUpdate_get_commitment_signed(const struct LDKCommitmentUpdate *NONNULL_PTR this_ptr); - public static native uint32_t CommitmentUpdate_get_commitment_signed(uint32_t this_ptr); + public static native number CommitmentUpdate_get_commitment_signed(number this_ptr); // void CommitmentUpdate_set_commitment_signed(struct LDKCommitmentUpdate *NONNULL_PTR this_ptr, struct LDKCommitmentSigned val); - public static native void CommitmentUpdate_set_commitment_signed(uint32_t this_ptr, uint32_t val); + public static native void CommitmentUpdate_set_commitment_signed(number this_ptr, number val); // MUST_USE_RES struct LDKCommitmentUpdate CommitmentUpdate_new(struct LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg, struct LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg, struct LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg, struct LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg, struct LDKUpdateFee update_fee_arg, struct LDKCommitmentSigned commitment_signed_arg); - public static native uint32_t CommitmentUpdate_new(uint32_t[] update_add_htlcs_arg, uint32_t[] update_fulfill_htlcs_arg, uint32_t[] update_fail_htlcs_arg, uint32_t[] update_fail_malformed_htlcs_arg, uint32_t update_fee_arg, uint32_t commitment_signed_arg); + public static native number CommitmentUpdate_new(number[] update_add_htlcs_arg, number[] update_fulfill_htlcs_arg, number[] update_fail_htlcs_arg, number[] update_fail_malformed_htlcs_arg, number update_fee_arg, number commitment_signed_arg); // void HTLCFailChannelUpdate_free(struct LDKHTLCFailChannelUpdate this_ptr); - public static native void HTLCFailChannelUpdate_free(uint32_t this_ptr); + public static native void HTLCFailChannelUpdate_free(number this_ptr); // struct LDKHTLCFailChannelUpdate HTLCFailChannelUpdate_clone(const struct LDKHTLCFailChannelUpdate *NONNULL_PTR orig); - public static native uint32_t HTLCFailChannelUpdate_clone(uint32_t orig); + public static native number HTLCFailChannelUpdate_clone(number orig); // void ChannelMessageHandler_free(struct LDKChannelMessageHandler this_ptr); - public static native void ChannelMessageHandler_free(uint32_t this_ptr); + public static native void ChannelMessageHandler_free(number this_ptr); // void RoutingMessageHandler_free(struct LDKRoutingMessageHandler this_ptr); - public static native void RoutingMessageHandler_free(uint32_t this_ptr); + public static native void RoutingMessageHandler_free(number this_ptr); // struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj); - public static native byte[] AcceptChannel_write(uint32_t obj); + public static native Uint8Array AcceptChannel_write(number obj); // struct LDKAcceptChannel AcceptChannel_read(struct LDKu8slice ser); - public static native uint32_t AcceptChannel_read(byte[] ser); + public static native number AcceptChannel_read(Uint8Array ser); // struct LDKCVec_u8Z AnnouncementSignatures_write(const struct LDKAnnouncementSignatures *NONNULL_PTR obj); - public static native byte[] AnnouncementSignatures_write(uint32_t obj); + public static native Uint8Array AnnouncementSignatures_write(number obj); // struct LDKAnnouncementSignatures AnnouncementSignatures_read(struct LDKu8slice ser); - public static native uint32_t AnnouncementSignatures_read(byte[] ser); + public static native number AnnouncementSignatures_read(Uint8Array ser); // struct LDKCVec_u8Z ChannelReestablish_write(const struct LDKChannelReestablish *NONNULL_PTR obj); - public static native byte[] ChannelReestablish_write(uint32_t obj); + public static native Uint8Array ChannelReestablish_write(number obj); // struct LDKCResult_ChannelReestablishDecodeErrorZ ChannelReestablish_read(struct LDKu8slice ser); - public static native uint32_t ChannelReestablish_read(byte[] ser); + public static native number ChannelReestablish_read(Uint8Array ser); // struct LDKCVec_u8Z ClosingSigned_write(const struct LDKClosingSigned *NONNULL_PTR obj); - public static native byte[] ClosingSigned_write(uint32_t obj); + public static native Uint8Array ClosingSigned_write(number obj); // struct LDKClosingSigned ClosingSigned_read(struct LDKu8slice ser); - public static native uint32_t ClosingSigned_read(byte[] ser); + public static native number ClosingSigned_read(Uint8Array ser); // struct LDKCVec_u8Z CommitmentSigned_write(const struct LDKCommitmentSigned *NONNULL_PTR obj); - public static native byte[] CommitmentSigned_write(uint32_t obj); + public static native Uint8Array CommitmentSigned_write(number obj); // struct LDKCommitmentSigned CommitmentSigned_read(struct LDKu8slice ser); - public static native uint32_t CommitmentSigned_read(byte[] ser); + public static native number CommitmentSigned_read(Uint8Array ser); // struct LDKCVec_u8Z FundingCreated_write(const struct LDKFundingCreated *NONNULL_PTR obj); - public static native byte[] FundingCreated_write(uint32_t obj); + public static native Uint8Array FundingCreated_write(number obj); // struct LDKFundingCreated FundingCreated_read(struct LDKu8slice ser); - public static native uint32_t FundingCreated_read(byte[] ser); + public static native number FundingCreated_read(Uint8Array ser); // struct LDKCVec_u8Z FundingSigned_write(const struct LDKFundingSigned *NONNULL_PTR obj); - public static native byte[] FundingSigned_write(uint32_t obj); + public static native Uint8Array FundingSigned_write(number obj); // struct LDKFundingSigned FundingSigned_read(struct LDKu8slice ser); - public static native uint32_t FundingSigned_read(byte[] ser); + public static native number FundingSigned_read(Uint8Array ser); // struct LDKCVec_u8Z FundingLocked_write(const struct LDKFundingLocked *NONNULL_PTR obj); - public static native byte[] FundingLocked_write(uint32_t obj); + public static native Uint8Array FundingLocked_write(number obj); // struct LDKFundingLocked FundingLocked_read(struct LDKu8slice ser); - public static native uint32_t FundingLocked_read(byte[] ser); + public static native number FundingLocked_read(Uint8Array ser); // struct LDKCVec_u8Z Init_write(const struct LDKInit *NONNULL_PTR obj); - public static native byte[] Init_write(uint32_t obj); + public static native Uint8Array Init_write(number obj); // struct LDKCResult_InitDecodeErrorZ Init_read(struct LDKu8slice ser); - public static native uint32_t Init_read(byte[] ser); + public static native number Init_read(Uint8Array ser); // struct LDKCVec_u8Z OpenChannel_write(const struct LDKOpenChannel *NONNULL_PTR obj); - public static native byte[] OpenChannel_write(uint32_t obj); + public static native Uint8Array OpenChannel_write(number obj); // struct LDKOpenChannel OpenChannel_read(struct LDKu8slice ser); - public static native uint32_t OpenChannel_read(byte[] ser); + public static native number OpenChannel_read(Uint8Array ser); // struct LDKCVec_u8Z RevokeAndACK_write(const struct LDKRevokeAndACK *NONNULL_PTR obj); - public static native byte[] RevokeAndACK_write(uint32_t obj); + public static native Uint8Array RevokeAndACK_write(number obj); // struct LDKRevokeAndACK RevokeAndACK_read(struct LDKu8slice ser); - public static native uint32_t RevokeAndACK_read(byte[] ser); + public static native number RevokeAndACK_read(Uint8Array ser); // struct LDKCVec_u8Z Shutdown_write(const struct LDKShutdown *NONNULL_PTR obj); - public static native byte[] Shutdown_write(uint32_t obj); + public static native Uint8Array Shutdown_write(number obj); // struct LDKShutdown Shutdown_read(struct LDKu8slice ser); - public static native uint32_t Shutdown_read(byte[] ser); + public static native number Shutdown_read(Uint8Array ser); // struct LDKCVec_u8Z UpdateFailHTLC_write(const struct LDKUpdateFailHTLC *NONNULL_PTR obj); - public static native byte[] UpdateFailHTLC_write(uint32_t obj); + public static native Uint8Array UpdateFailHTLC_write(number obj); // struct LDKUpdateFailHTLC UpdateFailHTLC_read(struct LDKu8slice ser); - public static native uint32_t UpdateFailHTLC_read(byte[] ser); + public static native number UpdateFailHTLC_read(Uint8Array ser); // struct LDKCVec_u8Z UpdateFailMalformedHTLC_write(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR obj); - public static native byte[] UpdateFailMalformedHTLC_write(uint32_t obj); + public static native Uint8Array UpdateFailMalformedHTLC_write(number obj); // struct LDKUpdateFailMalformedHTLC UpdateFailMalformedHTLC_read(struct LDKu8slice ser); - public static native uint32_t UpdateFailMalformedHTLC_read(byte[] ser); + public static native number UpdateFailMalformedHTLC_read(Uint8Array ser); // struct LDKCVec_u8Z UpdateFee_write(const struct LDKUpdateFee *NONNULL_PTR obj); - public static native byte[] UpdateFee_write(uint32_t obj); + public static native Uint8Array UpdateFee_write(number obj); // struct LDKUpdateFee UpdateFee_read(struct LDKu8slice ser); - public static native uint32_t UpdateFee_read(byte[] ser); + public static native number UpdateFee_read(Uint8Array ser); // struct LDKCVec_u8Z UpdateFulfillHTLC_write(const struct LDKUpdateFulfillHTLC *NONNULL_PTR obj); - public static native byte[] UpdateFulfillHTLC_write(uint32_t obj); + public static native Uint8Array UpdateFulfillHTLC_write(number obj); // struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_read(struct LDKu8slice ser); - public static native uint32_t UpdateFulfillHTLC_read(byte[] ser); + public static native number UpdateFulfillHTLC_read(Uint8Array ser); // struct LDKCVec_u8Z UpdateAddHTLC_write(const struct LDKUpdateAddHTLC *NONNULL_PTR obj); - public static native byte[] UpdateAddHTLC_write(uint32_t obj); + public static native Uint8Array UpdateAddHTLC_write(number obj); // struct LDKUpdateAddHTLC UpdateAddHTLC_read(struct LDKu8slice ser); - public static native uint32_t UpdateAddHTLC_read(byte[] ser); + public static native number UpdateAddHTLC_read(Uint8Array ser); // struct LDKCVec_u8Z Ping_write(const struct LDKPing *NONNULL_PTR obj); - public static native byte[] Ping_write(uint32_t obj); + public static native Uint8Array Ping_write(number obj); // struct LDKCResult_PingDecodeErrorZ Ping_read(struct LDKu8slice ser); - public static native uint32_t Ping_read(byte[] ser); + public static native number Ping_read(Uint8Array ser); // struct LDKCVec_u8Z Pong_write(const struct LDKPong *NONNULL_PTR obj); - public static native byte[] Pong_write(uint32_t obj); + public static native Uint8Array Pong_write(number obj); // struct LDKCResult_PongDecodeErrorZ Pong_read(struct LDKu8slice ser); - public static native uint32_t Pong_read(byte[] ser); + public static native number Pong_read(Uint8Array ser); // struct LDKCVec_u8Z UnsignedChannelAnnouncement_write(const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR obj); - public static native byte[] UnsignedChannelAnnouncement_write(uint32_t obj); + public static native Uint8Array UnsignedChannelAnnouncement_write(number obj); // struct LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ UnsignedChannelAnnouncement_read(struct LDKu8slice ser); - public static native uint32_t UnsignedChannelAnnouncement_read(byte[] ser); + public static native number UnsignedChannelAnnouncement_read(Uint8Array ser); // struct LDKCVec_u8Z ChannelAnnouncement_write(const struct LDKChannelAnnouncement *NONNULL_PTR obj); - public static native byte[] ChannelAnnouncement_write(uint32_t obj); + public static native Uint8Array ChannelAnnouncement_write(number obj); // struct LDKChannelAnnouncement ChannelAnnouncement_read(struct LDKu8slice ser); - public static native uint32_t ChannelAnnouncement_read(byte[] ser); + public static native number ChannelAnnouncement_read(Uint8Array ser); // struct LDKCVec_u8Z UnsignedChannelUpdate_write(const struct LDKUnsignedChannelUpdate *NONNULL_PTR obj); - public static native byte[] UnsignedChannelUpdate_write(uint32_t obj); + public static native Uint8Array UnsignedChannelUpdate_write(number obj); // struct LDKCResult_UnsignedChannelUpdateDecodeErrorZ UnsignedChannelUpdate_read(struct LDKu8slice ser); - public static native uint32_t UnsignedChannelUpdate_read(byte[] ser); + public static native number UnsignedChannelUpdate_read(Uint8Array ser); // struct LDKCVec_u8Z ChannelUpdate_write(const struct LDKChannelUpdate *NONNULL_PTR obj); - public static native byte[] ChannelUpdate_write(uint32_t obj); + public static native Uint8Array ChannelUpdate_write(number obj); // struct LDKChannelUpdate ChannelUpdate_read(struct LDKu8slice ser); - public static native uint32_t ChannelUpdate_read(byte[] ser); + public static native number ChannelUpdate_read(Uint8Array ser); // struct LDKCVec_u8Z ErrorMessage_write(const struct LDKErrorMessage *NONNULL_PTR obj); - public static native byte[] ErrorMessage_write(uint32_t obj); + public static native Uint8Array ErrorMessage_write(number obj); // struct LDKCResult_ErrorMessageDecodeErrorZ ErrorMessage_read(struct LDKu8slice ser); - public static native uint32_t ErrorMessage_read(byte[] ser); + public static native number ErrorMessage_read(Uint8Array ser); // struct LDKCVec_u8Z UnsignedNodeAnnouncement_write(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR obj); - public static native byte[] UnsignedNodeAnnouncement_write(uint32_t obj); + public static native Uint8Array UnsignedNodeAnnouncement_write(number obj); // struct LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ UnsignedNodeAnnouncement_read(struct LDKu8slice ser); - public static native uint32_t UnsignedNodeAnnouncement_read(byte[] ser); + public static native number UnsignedNodeAnnouncement_read(Uint8Array ser); // struct LDKCVec_u8Z NodeAnnouncement_write(const struct LDKNodeAnnouncement *NONNULL_PTR obj); - public static native byte[] NodeAnnouncement_write(uint32_t obj); + public static native Uint8Array NodeAnnouncement_write(number obj); // struct LDKNodeAnnouncement NodeAnnouncement_read(struct LDKu8slice ser); - public static native uint32_t NodeAnnouncement_read(byte[] ser); + public static native number NodeAnnouncement_read(Uint8Array ser); // struct LDKCResult_QueryShortChannelIdsDecodeErrorZ QueryShortChannelIds_read(struct LDKu8slice ser); - public static native uint32_t QueryShortChannelIds_read(byte[] ser); + public static native number QueryShortChannelIds_read(Uint8Array ser); // struct LDKCVec_u8Z QueryShortChannelIds_write(const struct LDKQueryShortChannelIds *NONNULL_PTR obj); - public static native byte[] QueryShortChannelIds_write(uint32_t obj); + public static native Uint8Array QueryShortChannelIds_write(number obj); // struct LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ ReplyShortChannelIdsEnd_read(struct LDKu8slice ser); - public static native uint32_t ReplyShortChannelIdsEnd_read(byte[] ser); + public static native number ReplyShortChannelIdsEnd_read(Uint8Array ser); // struct LDKCVec_u8Z ReplyShortChannelIdsEnd_write(const struct LDKReplyShortChannelIdsEnd *NONNULL_PTR obj); - public static native byte[] ReplyShortChannelIdsEnd_write(uint32_t obj); + public static native Uint8Array ReplyShortChannelIdsEnd_write(number obj); // struct LDKCResult_QueryChannelRangeDecodeErrorZ QueryChannelRange_read(struct LDKu8slice ser); - public static native uint32_t QueryChannelRange_read(byte[] ser); + public static native number QueryChannelRange_read(Uint8Array ser); // struct LDKCVec_u8Z QueryChannelRange_write(const struct LDKQueryChannelRange *NONNULL_PTR obj); - public static native byte[] QueryChannelRange_write(uint32_t obj); + public static native Uint8Array QueryChannelRange_write(number obj); // struct LDKCResult_ReplyChannelRangeDecodeErrorZ ReplyChannelRange_read(struct LDKu8slice ser); - public static native uint32_t ReplyChannelRange_read(byte[] ser); + public static native number ReplyChannelRange_read(Uint8Array ser); // struct LDKCVec_u8Z ReplyChannelRange_write(const struct LDKReplyChannelRange *NONNULL_PTR obj); - public static native byte[] ReplyChannelRange_write(uint32_t obj); + public static native Uint8Array ReplyChannelRange_write(number obj); // struct LDKCResult_GossipTimestampFilterDecodeErrorZ GossipTimestampFilter_read(struct LDKu8slice ser); - public static native uint32_t GossipTimestampFilter_read(byte[] ser); + public static native number GossipTimestampFilter_read(Uint8Array ser); // struct LDKCVec_u8Z GossipTimestampFilter_write(const struct LDKGossipTimestampFilter *NONNULL_PTR obj); - public static native byte[] GossipTimestampFilter_write(uint32_t obj); + public static native Uint8Array GossipTimestampFilter_write(number obj); // void MessageHandler_free(struct LDKMessageHandler this_ptr); - public static native void MessageHandler_free(uint32_t this_ptr); + public static native void MessageHandler_free(number this_ptr); // const struct LDKChannelMessageHandler *MessageHandler_get_chan_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr); - public static native uint32_t MessageHandler_get_chan_handler(uint32_t this_ptr); + public static native number MessageHandler_get_chan_handler(number this_ptr); // void MessageHandler_set_chan_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKChannelMessageHandler val); - public static native void MessageHandler_set_chan_handler(uint32_t this_ptr, uint32_t val); + public static native void MessageHandler_set_chan_handler(number this_ptr, number val); // const struct LDKRoutingMessageHandler *MessageHandler_get_route_handler(const struct LDKMessageHandler *NONNULL_PTR this_ptr); - public static native uint32_t MessageHandler_get_route_handler(uint32_t this_ptr); + public static native number MessageHandler_get_route_handler(number this_ptr); // void MessageHandler_set_route_handler(struct LDKMessageHandler *NONNULL_PTR this_ptr, struct LDKRoutingMessageHandler val); - public static native void MessageHandler_set_route_handler(uint32_t this_ptr, uint32_t val); + public static native void MessageHandler_set_route_handler(number this_ptr, number val); // MUST_USE_RES struct LDKMessageHandler MessageHandler_new(struct LDKChannelMessageHandler chan_handler_arg, struct LDKRoutingMessageHandler route_handler_arg); - public static native uint32_t MessageHandler_new(uint32_t chan_handler_arg, uint32_t route_handler_arg); + public static native number MessageHandler_new(number chan_handler_arg, number route_handler_arg); // struct LDKSocketDescriptor SocketDescriptor_clone(const struct LDKSocketDescriptor *NONNULL_PTR orig); - public static native uint32_t SocketDescriptor_clone(uint32_t orig); + public static native number SocketDescriptor_clone(number orig); // void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr); - public static native void SocketDescriptor_free(uint32_t this_ptr); + public static native void SocketDescriptor_free(number this_ptr); // void PeerHandleError_free(struct LDKPeerHandleError this_ptr); - public static native void PeerHandleError_free(uint32_t this_ptr); + public static native void PeerHandleError_free(number this_ptr); // bool PeerHandleError_get_no_connection_possible(const struct LDKPeerHandleError *NONNULL_PTR this_ptr); - public static native boolean PeerHandleError_get_no_connection_possible(uint32_t this_ptr); + public static native boolean PeerHandleError_get_no_connection_possible(number this_ptr); // void PeerHandleError_set_no_connection_possible(struct LDKPeerHandleError *NONNULL_PTR this_ptr, bool val); - public static native void PeerHandleError_set_no_connection_possible(uint32_t this_ptr, boolean val); + public static native void PeerHandleError_set_no_connection_possible(number this_ptr, boolean val); // MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(bool no_connection_possible_arg); - public static native uint32_t PeerHandleError_new(boolean no_connection_possible_arg); + public static native number PeerHandleError_new(boolean no_connection_possible_arg); // void PeerManager_free(struct LDKPeerManager this_ptr); - public static native void PeerManager_free(uint32_t this_ptr); + public static native void PeerManager_free(number this_ptr); // MUST_USE_RES struct LDKPeerManager PeerManager_new(struct LDKMessageHandler message_handler, struct LDKSecretKey our_node_secret, const uint8_t (*ephemeral_random_data)[32], struct LDKLogger logger); - public static native uint32_t PeerManager_new(uint32_t message_handler, byte[] our_node_secret, byte[] ephemeral_random_data, uint32_t logger); + public static native number PeerManager_new(number message_handler, Uint8Array our_node_secret, Uint8Array ephemeral_random_data, number logger); // MUST_USE_RES struct LDKCVec_PublicKeyZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg); - public static native byte[][] PeerManager_get_peer_node_ids(uint32_t this_arg); + public static native Uint8Array[] PeerManager_get_peer_node_ids(number this_arg); // MUST_USE_RES struct LDKCResult_CVec_u8ZPeerHandleErrorZ PeerManager_new_outbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKSocketDescriptor descriptor); - public static native uint32_t PeerManager_new_outbound_connection(uint32_t this_arg, byte[] their_node_id, uint32_t descriptor); + public static native number PeerManager_new_outbound_connection(number this_arg, Uint8Array their_node_id, number descriptor); // MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor descriptor); - public static native uint32_t PeerManager_new_inbound_connection(uint32_t this_arg, uint32_t descriptor); + public static native number PeerManager_new_inbound_connection(number this_arg, number descriptor); // MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_write_buffer_space_avail(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR descriptor); - public static native uint32_t PeerManager_write_buffer_space_avail(uint32_t this_arg, uint32_t descriptor); + public static native number PeerManager_write_buffer_space_avail(number this_arg, number descriptor); // MUST_USE_RES struct LDKCResult_boolPeerHandleErrorZ PeerManager_read_event(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor *NONNULL_PTR peer_descriptor, struct LDKu8slice data); - public static native uint32_t PeerManager_read_event(uint32_t this_arg, uint32_t peer_descriptor, byte[] data); + public static native number PeerManager_read_event(number this_arg, number peer_descriptor, Uint8Array data); // void PeerManager_process_events(const struct LDKPeerManager *NONNULL_PTR this_arg); - public static native void PeerManager_process_events(uint32_t this_arg); + public static native void PeerManager_process_events(number this_arg); // void PeerManager_socket_disconnected(const struct LDKPeerManager *NONNULL_PTR this_arg, const struct LDKSocketDescriptor *NONNULL_PTR descriptor); - public static native void PeerManager_socket_disconnected(uint32_t this_arg, uint32_t descriptor); + public static native void PeerManager_socket_disconnected(number this_arg, number descriptor); // void PeerManager_timer_tick_occured(const struct LDKPeerManager *NONNULL_PTR this_arg); - public static native void PeerManager_timer_tick_occured(uint32_t this_arg); + public static native void PeerManager_timer_tick_occured(number this_arg); // struct LDKThirtyTwoBytes build_commitment_secret(const uint8_t (*commitment_seed)[32], uint64_t idx); - public static native byte[] build_commitment_secret(byte[] commitment_seed, long idx); + public static native Uint8Array build_commitment_secret(Uint8Array commitment_seed, number idx); // struct LDKCResult_SecretKeySecpErrorZ derive_private_key(struct LDKPublicKey per_commitment_point, const uint8_t (*base_secret)[32]); - public static native uint32_t derive_private_key(byte[] per_commitment_point, byte[] base_secret); + public static native number derive_private_key(Uint8Array per_commitment_point, Uint8Array base_secret); // struct LDKCResult_PublicKeySecpErrorZ derive_public_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey base_point); - public static native uint32_t derive_public_key(byte[] per_commitment_point, byte[] base_point); + public static native number derive_public_key(Uint8Array per_commitment_point, Uint8Array base_point); // struct LDKCResult_SecretKeySecpErrorZ derive_private_revocation_key(const uint8_t (*per_commitment_secret)[32], const uint8_t (*countersignatory_revocation_base_secret)[32]); - public static native uint32_t derive_private_revocation_key(byte[] per_commitment_secret, byte[] countersignatory_revocation_base_secret); + public static native number derive_private_revocation_key(Uint8Array per_commitment_secret, Uint8Array countersignatory_revocation_base_secret); // struct LDKCResult_PublicKeySecpErrorZ derive_public_revocation_key(struct LDKPublicKey per_commitment_point, struct LDKPublicKey countersignatory_revocation_base_point); - public static native uint32_t derive_public_revocation_key(byte[] per_commitment_point, byte[] countersignatory_revocation_base_point); + public static native number derive_public_revocation_key(Uint8Array per_commitment_point, Uint8Array countersignatory_revocation_base_point); // void TxCreationKeys_free(struct LDKTxCreationKeys this_ptr); - public static native void TxCreationKeys_free(uint32_t this_ptr); + public static native void TxCreationKeys_free(number this_ptr); // struct LDKTxCreationKeys TxCreationKeys_clone(const struct LDKTxCreationKeys *NONNULL_PTR orig); - public static native uint32_t TxCreationKeys_clone(uint32_t orig); + public static native number TxCreationKeys_clone(number orig); // struct LDKPublicKey TxCreationKeys_get_per_commitment_point(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr); - public static native byte[] TxCreationKeys_get_per_commitment_point(uint32_t this_ptr); + public static native Uint8Array TxCreationKeys_get_per_commitment_point(number this_ptr); // void TxCreationKeys_set_per_commitment_point(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void TxCreationKeys_set_per_commitment_point(uint32_t this_ptr, byte[] val); + public static native void TxCreationKeys_set_per_commitment_point(number this_ptr, Uint8Array val); // struct LDKPublicKey TxCreationKeys_get_revocation_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr); - public static native byte[] TxCreationKeys_get_revocation_key(uint32_t this_ptr); + public static native Uint8Array TxCreationKeys_get_revocation_key(number this_ptr); // void TxCreationKeys_set_revocation_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void TxCreationKeys_set_revocation_key(uint32_t this_ptr, byte[] val); + public static native void TxCreationKeys_set_revocation_key(number this_ptr, Uint8Array val); // struct LDKPublicKey TxCreationKeys_get_broadcaster_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr); - public static native byte[] TxCreationKeys_get_broadcaster_htlc_key(uint32_t this_ptr); + public static native Uint8Array TxCreationKeys_get_broadcaster_htlc_key(number this_ptr); // void TxCreationKeys_set_broadcaster_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void TxCreationKeys_set_broadcaster_htlc_key(uint32_t this_ptr, byte[] val); + public static native void TxCreationKeys_set_broadcaster_htlc_key(number this_ptr, Uint8Array val); // struct LDKPublicKey TxCreationKeys_get_countersignatory_htlc_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr); - public static native byte[] TxCreationKeys_get_countersignatory_htlc_key(uint32_t this_ptr); + public static native Uint8Array TxCreationKeys_get_countersignatory_htlc_key(number this_ptr); // void TxCreationKeys_set_countersignatory_htlc_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void TxCreationKeys_set_countersignatory_htlc_key(uint32_t this_ptr, byte[] val); + public static native void TxCreationKeys_set_countersignatory_htlc_key(number this_ptr, Uint8Array val); // struct LDKPublicKey TxCreationKeys_get_broadcaster_delayed_payment_key(const struct LDKTxCreationKeys *NONNULL_PTR this_ptr); - public static native byte[] TxCreationKeys_get_broadcaster_delayed_payment_key(uint32_t this_ptr); + public static native Uint8Array TxCreationKeys_get_broadcaster_delayed_payment_key(number this_ptr); // void TxCreationKeys_set_broadcaster_delayed_payment_key(struct LDKTxCreationKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void TxCreationKeys_set_broadcaster_delayed_payment_key(uint32_t this_ptr, byte[] val); + public static native void TxCreationKeys_set_broadcaster_delayed_payment_key(number this_ptr, Uint8Array val); // MUST_USE_RES struct LDKTxCreationKeys TxCreationKeys_new(struct LDKPublicKey per_commitment_point_arg, struct LDKPublicKey revocation_key_arg, struct LDKPublicKey broadcaster_htlc_key_arg, struct LDKPublicKey countersignatory_htlc_key_arg, struct LDKPublicKey broadcaster_delayed_payment_key_arg); - public static native uint32_t TxCreationKeys_new(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); + public static native number TxCreationKeys_new(Uint8Array per_commitment_point_arg, Uint8Array revocation_key_arg, Uint8Array broadcaster_htlc_key_arg, Uint8Array countersignatory_htlc_key_arg, Uint8Array broadcaster_delayed_payment_key_arg); // struct LDKCVec_u8Z TxCreationKeys_write(const struct LDKTxCreationKeys *NONNULL_PTR obj); - public static native byte[] TxCreationKeys_write(uint32_t obj); + public static native Uint8Array TxCreationKeys_write(number obj); // struct LDKTxCreationKeys TxCreationKeys_read(struct LDKu8slice ser); - public static native uint32_t TxCreationKeys_read(byte[] ser); + public static native number TxCreationKeys_read(Uint8Array ser); // void ChannelPublicKeys_free(struct LDKChannelPublicKeys this_ptr); - public static native void ChannelPublicKeys_free(uint32_t this_ptr); + public static native void ChannelPublicKeys_free(number this_ptr); // struct LDKChannelPublicKeys ChannelPublicKeys_clone(const struct LDKChannelPublicKeys *NONNULL_PTR orig); - public static native uint32_t ChannelPublicKeys_clone(uint32_t orig); + public static native number ChannelPublicKeys_clone(number orig); // struct LDKPublicKey ChannelPublicKeys_get_funding_pubkey(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr); - public static native byte[] ChannelPublicKeys_get_funding_pubkey(uint32_t this_ptr); + public static native Uint8Array ChannelPublicKeys_get_funding_pubkey(number this_ptr); // void ChannelPublicKeys_set_funding_pubkey(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void ChannelPublicKeys_set_funding_pubkey(uint32_t this_ptr, byte[] val); + public static native void ChannelPublicKeys_set_funding_pubkey(number this_ptr, Uint8Array val); // struct LDKPublicKey ChannelPublicKeys_get_revocation_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr); - public static native byte[] ChannelPublicKeys_get_revocation_basepoint(uint32_t this_ptr); + public static native Uint8Array ChannelPublicKeys_get_revocation_basepoint(number this_ptr); // void ChannelPublicKeys_set_revocation_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void ChannelPublicKeys_set_revocation_basepoint(uint32_t this_ptr, byte[] val); + public static native void ChannelPublicKeys_set_revocation_basepoint(number this_ptr, Uint8Array val); // struct LDKPublicKey ChannelPublicKeys_get_payment_point(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr); - public static native byte[] ChannelPublicKeys_get_payment_point(uint32_t this_ptr); + public static native Uint8Array ChannelPublicKeys_get_payment_point(number this_ptr); // void ChannelPublicKeys_set_payment_point(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void ChannelPublicKeys_set_payment_point(uint32_t this_ptr, byte[] val); + public static native void ChannelPublicKeys_set_payment_point(number this_ptr, Uint8Array val); // struct LDKPublicKey ChannelPublicKeys_get_delayed_payment_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr); - public static native byte[] ChannelPublicKeys_get_delayed_payment_basepoint(uint32_t this_ptr); + public static native Uint8Array ChannelPublicKeys_get_delayed_payment_basepoint(number this_ptr); // void ChannelPublicKeys_set_delayed_payment_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void ChannelPublicKeys_set_delayed_payment_basepoint(uint32_t this_ptr, byte[] val); + public static native void ChannelPublicKeys_set_delayed_payment_basepoint(number this_ptr, Uint8Array val); // struct LDKPublicKey ChannelPublicKeys_get_htlc_basepoint(const struct LDKChannelPublicKeys *NONNULL_PTR this_ptr); - public static native byte[] ChannelPublicKeys_get_htlc_basepoint(uint32_t this_ptr); + public static native Uint8Array ChannelPublicKeys_get_htlc_basepoint(number this_ptr); // void ChannelPublicKeys_set_htlc_basepoint(struct LDKChannelPublicKeys *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void ChannelPublicKeys_set_htlc_basepoint(uint32_t this_ptr, byte[] val); + public static native void ChannelPublicKeys_set_htlc_basepoint(number this_ptr, Uint8Array val); // MUST_USE_RES struct LDKChannelPublicKeys ChannelPublicKeys_new(struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_point_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg); - public static native uint32_t ChannelPublicKeys_new(byte[] funding_pubkey_arg, byte[] revocation_basepoint_arg, byte[] payment_point_arg, byte[] delayed_payment_basepoint_arg, byte[] htlc_basepoint_arg); + public static native number ChannelPublicKeys_new(Uint8Array funding_pubkey_arg, Uint8Array revocation_basepoint_arg, Uint8Array payment_point_arg, Uint8Array delayed_payment_basepoint_arg, Uint8Array htlc_basepoint_arg); // struct LDKCVec_u8Z ChannelPublicKeys_write(const struct LDKChannelPublicKeys *NONNULL_PTR obj); - public static native byte[] ChannelPublicKeys_write(uint32_t obj); + public static native Uint8Array ChannelPublicKeys_write(number obj); // struct LDKChannelPublicKeys ChannelPublicKeys_read(struct LDKu8slice ser); - public static native uint32_t ChannelPublicKeys_read(byte[] ser); + public static native number ChannelPublicKeys_read(Uint8Array ser); // MUST_USE_RES struct LDKCResult_TxCreationKeysSecpErrorZ TxCreationKeys_derive_new(struct LDKPublicKey per_commitment_point, struct LDKPublicKey broadcaster_delayed_payment_base, struct LDKPublicKey broadcaster_htlc_base, struct LDKPublicKey countersignatory_revocation_base, struct LDKPublicKey countersignatory_htlc_base); - public static native uint32_t TxCreationKeys_derive_new(byte[] per_commitment_point, byte[] broadcaster_delayed_payment_base, byte[] broadcaster_htlc_base, byte[] countersignatory_revocation_base, byte[] countersignatory_htlc_base); + public static native number TxCreationKeys_derive_new(Uint8Array per_commitment_point, Uint8Array broadcaster_delayed_payment_base, Uint8Array broadcaster_htlc_base, Uint8Array countersignatory_revocation_base, Uint8Array countersignatory_htlc_base); // MUST_USE_RES struct LDKCResult_TxCreationKeysSecpErrorZ TxCreationKeys_from_channel_static_keys(struct LDKPublicKey per_commitment_point, const struct LDKChannelPublicKeys *NONNULL_PTR broadcaster_keys, const struct LDKChannelPublicKeys *NONNULL_PTR countersignatory_keys); - public static native uint32_t TxCreationKeys_from_channel_static_keys(byte[] per_commitment_point, uint32_t broadcaster_keys, uint32_t countersignatory_keys); + public static native number TxCreationKeys_from_channel_static_keys(Uint8Array per_commitment_point, number broadcaster_keys, number countersignatory_keys); // struct LDKCVec_u8Z get_revokeable_redeemscript(struct LDKPublicKey revocation_key, uint16_t contest_delay, struct LDKPublicKey broadcaster_delayed_payment_key); - public static native byte[] get_revokeable_redeemscript(byte[] revocation_key, short contest_delay, byte[] broadcaster_delayed_payment_key); + public static native Uint8Array get_revokeable_redeemscript(Uint8Array revocation_key, number contest_delay, Uint8Array broadcaster_delayed_payment_key); // void HTLCOutputInCommitment_free(struct LDKHTLCOutputInCommitment this_ptr); - public static native void HTLCOutputInCommitment_free(uint32_t this_ptr); + public static native void HTLCOutputInCommitment_free(number this_ptr); // struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_clone(const struct LDKHTLCOutputInCommitment *NONNULL_PTR orig); - public static native uint32_t HTLCOutputInCommitment_clone(uint32_t orig); + public static native number HTLCOutputInCommitment_clone(number orig); // bool HTLCOutputInCommitment_get_offered(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr); - public static native boolean HTLCOutputInCommitment_get_offered(uint32_t this_ptr); + public static native boolean HTLCOutputInCommitment_get_offered(number this_ptr); // void HTLCOutputInCommitment_set_offered(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, bool val); - public static native void HTLCOutputInCommitment_set_offered(uint32_t this_ptr, boolean val); + public static native void HTLCOutputInCommitment_set_offered(number this_ptr, boolean val); // uint64_t HTLCOutputInCommitment_get_amount_msat(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr); - public static native long HTLCOutputInCommitment_get_amount_msat(uint32_t this_ptr); + public static native number HTLCOutputInCommitment_get_amount_msat(number this_ptr); // void HTLCOutputInCommitment_set_amount_msat(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint64_t val); - public static native void HTLCOutputInCommitment_set_amount_msat(uint32_t this_ptr, long val); + public static native void HTLCOutputInCommitment_set_amount_msat(number this_ptr, number val); // uint32_t HTLCOutputInCommitment_get_cltv_expiry(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr); - public static native int HTLCOutputInCommitment_get_cltv_expiry(uint32_t this_ptr); + public static native number HTLCOutputInCommitment_get_cltv_expiry(number this_ptr); // void HTLCOutputInCommitment_set_cltv_expiry(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, uint32_t val); - public static native void HTLCOutputInCommitment_set_cltv_expiry(uint32_t this_ptr, int val); + public static native void HTLCOutputInCommitment_set_cltv_expiry(number this_ptr, number val); // const uint8_t (*HTLCOutputInCommitment_get_payment_hash(const struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr))[32]; - public static native byte[] HTLCOutputInCommitment_get_payment_hash(uint32_t this_ptr); + public static native Uint8Array HTLCOutputInCommitment_get_payment_hash(number this_ptr); // void HTLCOutputInCommitment_set_payment_hash(struct LDKHTLCOutputInCommitment *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void HTLCOutputInCommitment_set_payment_hash(uint32_t this_ptr, byte[] val); + public static native void HTLCOutputInCommitment_set_payment_hash(number this_ptr, Uint8Array val); // struct LDKCVec_u8Z HTLCOutputInCommitment_write(const struct LDKHTLCOutputInCommitment *NONNULL_PTR obj); - public static native byte[] HTLCOutputInCommitment_write(uint32_t obj); + public static native Uint8Array HTLCOutputInCommitment_write(number obj); // struct LDKHTLCOutputInCommitment HTLCOutputInCommitment_read(struct LDKu8slice ser); - public static native uint32_t HTLCOutputInCommitment_read(byte[] ser); + public static native number HTLCOutputInCommitment_read(Uint8Array ser); // struct LDKCVec_u8Z get_htlc_redeemscript(const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, const struct LDKTxCreationKeys *NONNULL_PTR keys); - public static native byte[] get_htlc_redeemscript(uint32_t htlc, uint32_t keys); + public static native Uint8Array get_htlc_redeemscript(number htlc, number keys); // struct LDKCVec_u8Z make_funding_redeemscript(struct LDKPublicKey broadcaster, struct LDKPublicKey countersignatory); - public static native byte[] make_funding_redeemscript(byte[] broadcaster, byte[] countersignatory); + public static native Uint8Array make_funding_redeemscript(Uint8Array broadcaster, Uint8Array countersignatory); // struct LDKTransaction build_htlc_transaction(const uint8_t (*prev_hash)[32], uint32_t feerate_per_kw, uint16_t contest_delay, const struct LDKHTLCOutputInCommitment *NONNULL_PTR htlc, struct LDKPublicKey broadcaster_delayed_payment_key, struct LDKPublicKey revocation_key); - public static native byte[] build_htlc_transaction(byte[] prev_hash, int feerate_per_kw, short contest_delay, uint32_t htlc, byte[] broadcaster_delayed_payment_key, byte[] revocation_key); + public static native Uint8Array build_htlc_transaction(Uint8Array prev_hash, number feerate_per_kw, number contest_delay, number htlc, Uint8Array broadcaster_delayed_payment_key, Uint8Array revocation_key); // void ChannelTransactionParameters_free(struct LDKChannelTransactionParameters this_ptr); - public static native void ChannelTransactionParameters_free(uint32_t this_ptr); + public static native void ChannelTransactionParameters_free(number this_ptr); // struct LDKChannelTransactionParameters ChannelTransactionParameters_clone(const struct LDKChannelTransactionParameters *NONNULL_PTR orig); - public static native uint32_t ChannelTransactionParameters_clone(uint32_t orig); + public static native number ChannelTransactionParameters_clone(number orig); // struct LDKChannelPublicKeys ChannelTransactionParameters_get_holder_pubkeys(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr); - public static native uint32_t ChannelTransactionParameters_get_holder_pubkeys(uint32_t this_ptr); + public static native number ChannelTransactionParameters_get_holder_pubkeys(number this_ptr); // void ChannelTransactionParameters_set_holder_pubkeys(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val); - public static native void ChannelTransactionParameters_set_holder_pubkeys(uint32_t this_ptr, uint32_t val); + public static native void ChannelTransactionParameters_set_holder_pubkeys(number this_ptr, number val); // uint16_t ChannelTransactionParameters_get_holder_selected_contest_delay(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr); - public static native short ChannelTransactionParameters_get_holder_selected_contest_delay(uint32_t this_ptr); + public static native number ChannelTransactionParameters_get_holder_selected_contest_delay(number this_ptr); // void ChannelTransactionParameters_set_holder_selected_contest_delay(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val); - public static native void ChannelTransactionParameters_set_holder_selected_contest_delay(uint32_t this_ptr, short val); + public static native void ChannelTransactionParameters_set_holder_selected_contest_delay(number this_ptr, number val); // bool ChannelTransactionParameters_get_is_outbound_from_holder(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr); - public static native boolean ChannelTransactionParameters_get_is_outbound_from_holder(uint32_t this_ptr); + public static native boolean ChannelTransactionParameters_get_is_outbound_from_holder(number this_ptr); // void ChannelTransactionParameters_set_is_outbound_from_holder(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, bool val); - public static native void ChannelTransactionParameters_set_is_outbound_from_holder(uint32_t this_ptr, boolean val); + public static native void ChannelTransactionParameters_set_is_outbound_from_holder(number this_ptr, boolean val); // struct LDKCounterpartyChannelTransactionParameters ChannelTransactionParameters_get_counterparty_parameters(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr); - public static native uint32_t ChannelTransactionParameters_get_counterparty_parameters(uint32_t this_ptr); + public static native number ChannelTransactionParameters_get_counterparty_parameters(number this_ptr); // void ChannelTransactionParameters_set_counterparty_parameters(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKCounterpartyChannelTransactionParameters val); - public static native void ChannelTransactionParameters_set_counterparty_parameters(uint32_t this_ptr, uint32_t val); + public static native void ChannelTransactionParameters_set_counterparty_parameters(number this_ptr, number val); // struct LDKOutPoint ChannelTransactionParameters_get_funding_outpoint(const struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr); - public static native uint32_t ChannelTransactionParameters_get_funding_outpoint(uint32_t this_ptr); + public static native number ChannelTransactionParameters_get_funding_outpoint(number this_ptr); // void ChannelTransactionParameters_set_funding_outpoint(struct LDKChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKOutPoint val); - public static native void ChannelTransactionParameters_set_funding_outpoint(uint32_t this_ptr, uint32_t val); + public static native void ChannelTransactionParameters_set_funding_outpoint(number this_ptr, number val); // MUST_USE_RES struct LDKChannelTransactionParameters ChannelTransactionParameters_new(struct LDKChannelPublicKeys holder_pubkeys_arg, uint16_t holder_selected_contest_delay_arg, bool is_outbound_from_holder_arg, struct LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg, struct LDKOutPoint funding_outpoint_arg); - public static native uint32_t ChannelTransactionParameters_new(uint32_t holder_pubkeys_arg, short holder_selected_contest_delay_arg, boolean is_outbound_from_holder_arg, uint32_t counterparty_parameters_arg, uint32_t funding_outpoint_arg); + public static native number ChannelTransactionParameters_new(number holder_pubkeys_arg, number holder_selected_contest_delay_arg, boolean is_outbound_from_holder_arg, number counterparty_parameters_arg, number funding_outpoint_arg); // void CounterpartyChannelTransactionParameters_free(struct LDKCounterpartyChannelTransactionParameters this_ptr); - public static native void CounterpartyChannelTransactionParameters_free(uint32_t this_ptr); + public static native void CounterpartyChannelTransactionParameters_free(number this_ptr); // struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_clone(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR orig); - public static native uint32_t CounterpartyChannelTransactionParameters_clone(uint32_t orig); + public static native number CounterpartyChannelTransactionParameters_clone(number orig); // struct LDKChannelPublicKeys CounterpartyChannelTransactionParameters_get_pubkeys(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr); - public static native uint32_t CounterpartyChannelTransactionParameters_get_pubkeys(uint32_t this_ptr); + public static native number CounterpartyChannelTransactionParameters_get_pubkeys(number this_ptr); // void CounterpartyChannelTransactionParameters_set_pubkeys(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, struct LDKChannelPublicKeys val); - public static native void CounterpartyChannelTransactionParameters_set_pubkeys(uint32_t this_ptr, uint32_t val); + public static native void CounterpartyChannelTransactionParameters_set_pubkeys(number this_ptr, number val); // uint16_t CounterpartyChannelTransactionParameters_get_selected_contest_delay(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr); - public static native short CounterpartyChannelTransactionParameters_get_selected_contest_delay(uint32_t this_ptr); + public static native number CounterpartyChannelTransactionParameters_get_selected_contest_delay(number this_ptr); // void CounterpartyChannelTransactionParameters_set_selected_contest_delay(struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR this_ptr, uint16_t val); - public static native void CounterpartyChannelTransactionParameters_set_selected_contest_delay(uint32_t this_ptr, short val); + public static native void CounterpartyChannelTransactionParameters_set_selected_contest_delay(number this_ptr, number val); // MUST_USE_RES struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_new(struct LDKChannelPublicKeys pubkeys_arg, uint16_t selected_contest_delay_arg); - public static native uint32_t CounterpartyChannelTransactionParameters_new(uint32_t pubkeys_arg, short selected_contest_delay_arg); + public static native number CounterpartyChannelTransactionParameters_new(number pubkeys_arg, number selected_contest_delay_arg); // MUST_USE_RES bool ChannelTransactionParameters_is_populated(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg); - public static native boolean ChannelTransactionParameters_is_populated(uint32_t this_arg); + public static native boolean ChannelTransactionParameters_is_populated(number this_arg); // MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_holder_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg); - public static native uint32_t ChannelTransactionParameters_as_holder_broadcastable(uint32_t this_arg); + public static native number ChannelTransactionParameters_as_holder_broadcastable(number this_arg); // MUST_USE_RES struct LDKDirectedChannelTransactionParameters ChannelTransactionParameters_as_counterparty_broadcastable(const struct LDKChannelTransactionParameters *NONNULL_PTR this_arg); - public static native uint32_t ChannelTransactionParameters_as_counterparty_broadcastable(uint32_t this_arg); + public static native number ChannelTransactionParameters_as_counterparty_broadcastable(number this_arg); // struct LDKCVec_u8Z CounterpartyChannelTransactionParameters_write(const struct LDKCounterpartyChannelTransactionParameters *NONNULL_PTR obj); - public static native byte[] CounterpartyChannelTransactionParameters_write(uint32_t obj); + public static native Uint8Array CounterpartyChannelTransactionParameters_write(number obj); // struct LDKCounterpartyChannelTransactionParameters CounterpartyChannelTransactionParameters_read(struct LDKu8slice ser); - public static native uint32_t CounterpartyChannelTransactionParameters_read(byte[] ser); + public static native number CounterpartyChannelTransactionParameters_read(Uint8Array ser); // struct LDKCVec_u8Z ChannelTransactionParameters_write(const struct LDKChannelTransactionParameters *NONNULL_PTR obj); - public static native byte[] ChannelTransactionParameters_write(uint32_t obj); + public static native Uint8Array ChannelTransactionParameters_write(number obj); // struct LDKChannelTransactionParameters ChannelTransactionParameters_read(struct LDKu8slice ser); - public static native uint32_t ChannelTransactionParameters_read(byte[] ser); + public static native number ChannelTransactionParameters_read(Uint8Array ser); // void DirectedChannelTransactionParameters_free(struct LDKDirectedChannelTransactionParameters this_ptr); - public static native void DirectedChannelTransactionParameters_free(uint32_t this_ptr); + public static native void DirectedChannelTransactionParameters_free(number this_ptr); // MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_broadcaster_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg); - public static native uint32_t DirectedChannelTransactionParameters_broadcaster_pubkeys(uint32_t this_arg); + public static native number DirectedChannelTransactionParameters_broadcaster_pubkeys(number this_arg); // MUST_USE_RES struct LDKChannelPublicKeys DirectedChannelTransactionParameters_countersignatory_pubkeys(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg); - public static native uint32_t DirectedChannelTransactionParameters_countersignatory_pubkeys(uint32_t this_arg); + public static native number DirectedChannelTransactionParameters_countersignatory_pubkeys(number this_arg); // MUST_USE_RES uint16_t DirectedChannelTransactionParameters_contest_delay(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg); - public static native short DirectedChannelTransactionParameters_contest_delay(uint32_t this_arg); + public static native number DirectedChannelTransactionParameters_contest_delay(number this_arg); // MUST_USE_RES bool DirectedChannelTransactionParameters_is_outbound(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg); - public static native boolean DirectedChannelTransactionParameters_is_outbound(uint32_t this_arg); + public static native boolean DirectedChannelTransactionParameters_is_outbound(number this_arg); // MUST_USE_RES struct LDKOutPoint DirectedChannelTransactionParameters_funding_outpoint(const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR this_arg); - public static native uint32_t DirectedChannelTransactionParameters_funding_outpoint(uint32_t this_arg); + public static native number DirectedChannelTransactionParameters_funding_outpoint(number this_arg); // void HolderCommitmentTransaction_free(struct LDKHolderCommitmentTransaction this_ptr); - public static native void HolderCommitmentTransaction_free(uint32_t this_ptr); + public static native void HolderCommitmentTransaction_free(number this_ptr); // struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_clone(const struct LDKHolderCommitmentTransaction *NONNULL_PTR orig); - public static native uint32_t HolderCommitmentTransaction_clone(uint32_t orig); + public static native number HolderCommitmentTransaction_clone(number orig); // struct LDKSignature HolderCommitmentTransaction_get_counterparty_sig(const struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr); - public static native byte[] HolderCommitmentTransaction_get_counterparty_sig(uint32_t this_ptr); + public static native Uint8Array HolderCommitmentTransaction_get_counterparty_sig(number this_ptr); // void HolderCommitmentTransaction_set_counterparty_sig(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKSignature val); - public static native void HolderCommitmentTransaction_set_counterparty_sig(uint32_t this_ptr, byte[] val); + public static native void HolderCommitmentTransaction_set_counterparty_sig(number this_ptr, Uint8Array val); // void HolderCommitmentTransaction_set_counterparty_htlc_sigs(struct LDKHolderCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKCVec_SignatureZ val); - public static native void HolderCommitmentTransaction_set_counterparty_htlc_sigs(uint32_t this_ptr, byte[][] val); + public static native void HolderCommitmentTransaction_set_counterparty_htlc_sigs(number this_ptr, Uint8Array[] val); // struct LDKCVec_u8Z HolderCommitmentTransaction_write(const struct LDKHolderCommitmentTransaction *NONNULL_PTR obj); - public static native byte[] HolderCommitmentTransaction_write(uint32_t obj); + public static native Uint8Array HolderCommitmentTransaction_write(number obj); // struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_read(struct LDKu8slice ser); - public static native uint32_t HolderCommitmentTransaction_read(byte[] ser); + public static native number HolderCommitmentTransaction_read(Uint8Array ser); // MUST_USE_RES struct LDKHolderCommitmentTransaction HolderCommitmentTransaction_new(struct LDKCommitmentTransaction commitment_tx, struct LDKSignature counterparty_sig, struct LDKCVec_SignatureZ counterparty_htlc_sigs, struct LDKPublicKey holder_funding_key, struct LDKPublicKey counterparty_funding_key); - public static native uint32_t HolderCommitmentTransaction_new(uint32_t commitment_tx, byte[] counterparty_sig, byte[][] counterparty_htlc_sigs, byte[] holder_funding_key, byte[] counterparty_funding_key); + public static native number HolderCommitmentTransaction_new(number commitment_tx, Uint8Array counterparty_sig, Uint8Array[] counterparty_htlc_sigs, Uint8Array holder_funding_key, Uint8Array counterparty_funding_key); // void BuiltCommitmentTransaction_free(struct LDKBuiltCommitmentTransaction this_ptr); - public static native void BuiltCommitmentTransaction_free(uint32_t this_ptr); + public static native void BuiltCommitmentTransaction_free(number this_ptr); // struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_clone(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR orig); - public static native uint32_t BuiltCommitmentTransaction_clone(uint32_t orig); + public static native number BuiltCommitmentTransaction_clone(number orig); // struct LDKTransaction BuiltCommitmentTransaction_get_transaction(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr); - public static native byte[] BuiltCommitmentTransaction_get_transaction(uint32_t this_ptr); + public static native Uint8Array BuiltCommitmentTransaction_get_transaction(number this_ptr); // void BuiltCommitmentTransaction_set_transaction(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKTransaction val); - public static native void BuiltCommitmentTransaction_set_transaction(uint32_t this_ptr, byte[] val); + public static native void BuiltCommitmentTransaction_set_transaction(number this_ptr, Uint8Array val); // const uint8_t (*BuiltCommitmentTransaction_get_txid(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr))[32]; - public static native byte[] BuiltCommitmentTransaction_get_txid(uint32_t this_ptr); + public static native Uint8Array BuiltCommitmentTransaction_get_txid(number this_ptr); // void BuiltCommitmentTransaction_set_txid(struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void BuiltCommitmentTransaction_set_txid(uint32_t this_ptr, byte[] val); + public static native void BuiltCommitmentTransaction_set_txid(number this_ptr, Uint8Array val); // MUST_USE_RES struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_new(struct LDKTransaction transaction_arg, struct LDKThirtyTwoBytes txid_arg); - public static native uint32_t BuiltCommitmentTransaction_new(byte[] transaction_arg, byte[] txid_arg); + public static native number BuiltCommitmentTransaction_new(Uint8Array transaction_arg, Uint8Array txid_arg); // struct LDKCVec_u8Z BuiltCommitmentTransaction_write(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR obj); - public static native byte[] BuiltCommitmentTransaction_write(uint32_t obj); + public static native Uint8Array BuiltCommitmentTransaction_write(number obj); // struct LDKBuiltCommitmentTransaction BuiltCommitmentTransaction_read(struct LDKu8slice ser); - public static native uint32_t BuiltCommitmentTransaction_read(byte[] ser); + public static native number BuiltCommitmentTransaction_read(Uint8Array ser); // MUST_USE_RES struct LDKThirtyTwoBytes BuiltCommitmentTransaction_get_sighash_all(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_arg, struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis); - public static native byte[] BuiltCommitmentTransaction_get_sighash_all(uint32_t this_arg, byte[] funding_redeemscript, long channel_value_satoshis); + public static native Uint8Array BuiltCommitmentTransaction_get_sighash_all(number this_arg, Uint8Array funding_redeemscript, number channel_value_satoshis); // MUST_USE_RES struct LDKSignature BuiltCommitmentTransaction_sign(const struct LDKBuiltCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*funding_key)[32], struct LDKu8slice funding_redeemscript, uint64_t channel_value_satoshis); - public static native byte[] BuiltCommitmentTransaction_sign(uint32_t this_arg, byte[] funding_key, byte[] funding_redeemscript, long channel_value_satoshis); + public static native Uint8Array BuiltCommitmentTransaction_sign(number this_arg, Uint8Array funding_key, Uint8Array funding_redeemscript, number channel_value_satoshis); // void CommitmentTransaction_free(struct LDKCommitmentTransaction this_ptr); - public static native void CommitmentTransaction_free(uint32_t this_ptr); + public static native void CommitmentTransaction_free(number this_ptr); // struct LDKCommitmentTransaction CommitmentTransaction_clone(const struct LDKCommitmentTransaction *NONNULL_PTR orig); - public static native uint32_t CommitmentTransaction_clone(uint32_t orig); + public static native number CommitmentTransaction_clone(number orig); // struct LDKCVec_u8Z CommitmentTransaction_write(const struct LDKCommitmentTransaction *NONNULL_PTR obj); - public static native byte[] CommitmentTransaction_write(uint32_t obj); + public static native Uint8Array CommitmentTransaction_write(number obj); // struct LDKCommitmentTransaction CommitmentTransaction_read(struct LDKu8slice ser); - public static native uint32_t CommitmentTransaction_read(byte[] ser); + public static native number CommitmentTransaction_read(Uint8Array ser); // MUST_USE_RES uint64_t CommitmentTransaction_commitment_number(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg); - public static native long CommitmentTransaction_commitment_number(uint32_t this_arg); + public static native number CommitmentTransaction_commitment_number(number this_arg); // MUST_USE_RES uint64_t CommitmentTransaction_to_broadcaster_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg); - public static native long CommitmentTransaction_to_broadcaster_value_sat(uint32_t this_arg); + public static native number CommitmentTransaction_to_broadcaster_value_sat(number this_arg); // MUST_USE_RES uint64_t CommitmentTransaction_to_countersignatory_value_sat(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg); - public static native long CommitmentTransaction_to_countersignatory_value_sat(uint32_t this_arg); + public static native number CommitmentTransaction_to_countersignatory_value_sat(number this_arg); // MUST_USE_RES uint32_t CommitmentTransaction_feerate_per_kw(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg); - public static native int CommitmentTransaction_feerate_per_kw(uint32_t this_arg); + public static native number CommitmentTransaction_feerate_per_kw(number this_arg); // MUST_USE_RES struct LDKTrustedCommitmentTransaction CommitmentTransaction_trust(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg); - public static native uint32_t CommitmentTransaction_trust(uint32_t this_arg); + public static native number CommitmentTransaction_trust(number this_arg); // MUST_USE_RES struct LDKCResult_TrustedCommitmentTransactionNoneZ CommitmentTransaction_verify(const struct LDKCommitmentTransaction *NONNULL_PTR this_arg, const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR channel_parameters, const struct LDKChannelPublicKeys *NONNULL_PTR broadcaster_keys, const struct LDKChannelPublicKeys *NONNULL_PTR countersignatory_keys); - public static native uint32_t CommitmentTransaction_verify(uint32_t this_arg, uint32_t channel_parameters, uint32_t broadcaster_keys, uint32_t countersignatory_keys); + public static native number CommitmentTransaction_verify(number this_arg, number channel_parameters, number broadcaster_keys, number countersignatory_keys); // void TrustedCommitmentTransaction_free(struct LDKTrustedCommitmentTransaction this_ptr); - public static native void TrustedCommitmentTransaction_free(uint32_t this_ptr); + public static native void TrustedCommitmentTransaction_free(number this_ptr); // MUST_USE_RES struct LDKThirtyTwoBytes TrustedCommitmentTransaction_txid(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg); - public static native byte[] TrustedCommitmentTransaction_txid(uint32_t this_arg); + public static native Uint8Array TrustedCommitmentTransaction_txid(number this_arg); // MUST_USE_RES struct LDKBuiltCommitmentTransaction TrustedCommitmentTransaction_built_transaction(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg); - public static native uint32_t TrustedCommitmentTransaction_built_transaction(uint32_t this_arg); + public static native number TrustedCommitmentTransaction_built_transaction(number this_arg); // MUST_USE_RES struct LDKTxCreationKeys TrustedCommitmentTransaction_keys(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg); - public static native uint32_t TrustedCommitmentTransaction_keys(uint32_t this_arg); + public static native number TrustedCommitmentTransaction_keys(number this_arg); // MUST_USE_RES struct LDKCResult_CVec_SignatureZNoneZ TrustedCommitmentTransaction_get_htlc_sigs(const struct LDKTrustedCommitmentTransaction *NONNULL_PTR this_arg, const uint8_t (*htlc_base_key)[32], const struct LDKDirectedChannelTransactionParameters *NONNULL_PTR channel_parameters); - public static native uint32_t TrustedCommitmentTransaction_get_htlc_sigs(uint32_t this_arg, byte[] htlc_base_key, uint32_t channel_parameters); + public static native number TrustedCommitmentTransaction_get_htlc_sigs(number this_arg, Uint8Array htlc_base_key, number channel_parameters); // uint64_t get_commitment_transaction_number_obscure_factor(struct LDKPublicKey broadcaster_payment_basepoint, struct LDKPublicKey countersignatory_payment_basepoint, bool outbound_from_broadcaster); - public static native long get_commitment_transaction_number_obscure_factor(byte[] broadcaster_payment_basepoint, byte[] countersignatory_payment_basepoint, boolean outbound_from_broadcaster); + public static native number get_commitment_transaction_number_obscure_factor(Uint8Array broadcaster_payment_basepoint, Uint8Array countersignatory_payment_basepoint, boolean outbound_from_broadcaster); // void InitFeatures_free(struct LDKInitFeatures this_ptr); - public static native void InitFeatures_free(uint32_t this_ptr); + public static native void InitFeatures_free(number this_ptr); // void NodeFeatures_free(struct LDKNodeFeatures this_ptr); - public static native void NodeFeatures_free(uint32_t this_ptr); + public static native void NodeFeatures_free(number this_ptr); // void ChannelFeatures_free(struct LDKChannelFeatures this_ptr); - public static native void ChannelFeatures_free(uint32_t this_ptr); + public static native void ChannelFeatures_free(number this_ptr); // void RouteHop_free(struct LDKRouteHop this_ptr); - public static native void RouteHop_free(uint32_t this_ptr); + public static native void RouteHop_free(number this_ptr); // struct LDKRouteHop RouteHop_clone(const struct LDKRouteHop *NONNULL_PTR orig); - public static native uint32_t RouteHop_clone(uint32_t orig); + public static native number RouteHop_clone(number orig); // struct LDKPublicKey RouteHop_get_pubkey(const struct LDKRouteHop *NONNULL_PTR this_ptr); - public static native byte[] RouteHop_get_pubkey(uint32_t this_ptr); + public static native Uint8Array RouteHop_get_pubkey(number this_ptr); // void RouteHop_set_pubkey(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void RouteHop_set_pubkey(uint32_t this_ptr, byte[] val); + public static native void RouteHop_set_pubkey(number this_ptr, Uint8Array val); // struct LDKNodeFeatures RouteHop_get_node_features(const struct LDKRouteHop *NONNULL_PTR this_ptr); - public static native uint32_t RouteHop_get_node_features(uint32_t this_ptr); + public static native number RouteHop_get_node_features(number this_ptr); // void RouteHop_set_node_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKNodeFeatures val); - public static native void RouteHop_set_node_features(uint32_t this_ptr, uint32_t val); + public static native void RouteHop_set_node_features(number this_ptr, number val); // uint64_t RouteHop_get_short_channel_id(const struct LDKRouteHop *NONNULL_PTR this_ptr); - public static native long RouteHop_get_short_channel_id(uint32_t this_ptr); + public static native number RouteHop_get_short_channel_id(number this_ptr); // void RouteHop_set_short_channel_id(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val); - public static native void RouteHop_set_short_channel_id(uint32_t this_ptr, long val); + public static native void RouteHop_set_short_channel_id(number this_ptr, number val); // struct LDKChannelFeatures RouteHop_get_channel_features(const struct LDKRouteHop *NONNULL_PTR this_ptr); - public static native uint32_t RouteHop_get_channel_features(uint32_t this_ptr); + public static native number RouteHop_get_channel_features(number this_ptr); // void RouteHop_set_channel_features(struct LDKRouteHop *NONNULL_PTR this_ptr, struct LDKChannelFeatures val); - public static native void RouteHop_set_channel_features(uint32_t this_ptr, uint32_t val); + public static native void RouteHop_set_channel_features(number this_ptr, number val); // uint64_t RouteHop_get_fee_msat(const struct LDKRouteHop *NONNULL_PTR this_ptr); - public static native long RouteHop_get_fee_msat(uint32_t this_ptr); + public static native number RouteHop_get_fee_msat(number this_ptr); // void RouteHop_set_fee_msat(struct LDKRouteHop *NONNULL_PTR this_ptr, uint64_t val); - public static native void RouteHop_set_fee_msat(uint32_t this_ptr, long val); + public static native void RouteHop_set_fee_msat(number this_ptr, number val); // uint32_t RouteHop_get_cltv_expiry_delta(const struct LDKRouteHop *NONNULL_PTR this_ptr); - public static native int RouteHop_get_cltv_expiry_delta(uint32_t this_ptr); + public static native number RouteHop_get_cltv_expiry_delta(number this_ptr); // void RouteHop_set_cltv_expiry_delta(struct LDKRouteHop *NONNULL_PTR this_ptr, uint32_t val); - public static native void RouteHop_set_cltv_expiry_delta(uint32_t this_ptr, int val); + public static native void RouteHop_set_cltv_expiry_delta(number this_ptr, number val); // MUST_USE_RES struct LDKRouteHop RouteHop_new(struct LDKPublicKey pubkey_arg, struct LDKNodeFeatures node_features_arg, uint64_t short_channel_id_arg, struct LDKChannelFeatures channel_features_arg, uint64_t fee_msat_arg, uint32_t cltv_expiry_delta_arg); - public static native uint32_t RouteHop_new(byte[] pubkey_arg, uint32_t node_features_arg, long short_channel_id_arg, uint32_t channel_features_arg, long fee_msat_arg, int cltv_expiry_delta_arg); + public static native number RouteHop_new(Uint8Array pubkey_arg, number node_features_arg, number short_channel_id_arg, number channel_features_arg, number fee_msat_arg, number cltv_expiry_delta_arg); // void Route_free(struct LDKRoute this_ptr); - public static native void Route_free(uint32_t this_ptr); + public static native void Route_free(number this_ptr); // struct LDKRoute Route_clone(const struct LDKRoute *NONNULL_PTR orig); - public static native uint32_t Route_clone(uint32_t orig); + public static native number Route_clone(number orig); // void Route_set_paths(struct LDKRoute *NONNULL_PTR this_ptr, struct LDKCVec_CVec_RouteHopZZ val); - public static native void Route_set_paths(uint32_t this_ptr, uint32_t[][] val); + public static native void Route_set_paths(number this_ptr, number[][] val); // MUST_USE_RES struct LDKRoute Route_new(struct LDKCVec_CVec_RouteHopZZ paths_arg); - public static native uint32_t Route_new(uint32_t[][] paths_arg); + public static native number Route_new(number[][] paths_arg); // struct LDKCVec_u8Z Route_write(const struct LDKRoute *NONNULL_PTR obj); - public static native byte[] Route_write(uint32_t obj); + public static native Uint8Array Route_write(number obj); // struct LDKCResult_RouteDecodeErrorZ Route_read(struct LDKu8slice ser); - public static native uint32_t Route_read(byte[] ser); + public static native number Route_read(Uint8Array ser); // void RouteHint_free(struct LDKRouteHint this_ptr); - public static native void RouteHint_free(uint32_t this_ptr); + public static native void RouteHint_free(number this_ptr); // struct LDKRouteHint RouteHint_clone(const struct LDKRouteHint *NONNULL_PTR orig); - public static native uint32_t RouteHint_clone(uint32_t orig); + public static native number RouteHint_clone(number orig); // struct LDKPublicKey RouteHint_get_src_node_id(const struct LDKRouteHint *NONNULL_PTR this_ptr); - public static native byte[] RouteHint_get_src_node_id(uint32_t this_ptr); + public static native Uint8Array RouteHint_get_src_node_id(number this_ptr); // void RouteHint_set_src_node_id(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void RouteHint_set_src_node_id(uint32_t this_ptr, byte[] val); + public static native void RouteHint_set_src_node_id(number this_ptr, Uint8Array val); // uint64_t RouteHint_get_short_channel_id(const struct LDKRouteHint *NONNULL_PTR this_ptr); - public static native long RouteHint_get_short_channel_id(uint32_t this_ptr); + public static native number RouteHint_get_short_channel_id(number this_ptr); // void RouteHint_set_short_channel_id(struct LDKRouteHint *NONNULL_PTR this_ptr, uint64_t val); - public static native void RouteHint_set_short_channel_id(uint32_t this_ptr, long val); + public static native void RouteHint_set_short_channel_id(number this_ptr, number val); // struct LDKRoutingFees RouteHint_get_fees(const struct LDKRouteHint *NONNULL_PTR this_ptr); - public static native uint32_t RouteHint_get_fees(uint32_t this_ptr); + public static native number RouteHint_get_fees(number this_ptr); // void RouteHint_set_fees(struct LDKRouteHint *NONNULL_PTR this_ptr, struct LDKRoutingFees val); - public static native void RouteHint_set_fees(uint32_t this_ptr, uint32_t val); + public static native void RouteHint_set_fees(number this_ptr, number val); // uint16_t RouteHint_get_cltv_expiry_delta(const struct LDKRouteHint *NONNULL_PTR this_ptr); - public static native short RouteHint_get_cltv_expiry_delta(uint32_t this_ptr); + public static native number RouteHint_get_cltv_expiry_delta(number this_ptr); // void RouteHint_set_cltv_expiry_delta(struct LDKRouteHint *NONNULL_PTR this_ptr, uint16_t val); - public static native void RouteHint_set_cltv_expiry_delta(uint32_t this_ptr, short val); + public static native void RouteHint_set_cltv_expiry_delta(number this_ptr, number val); // uint64_t RouteHint_get_htlc_minimum_msat(const struct LDKRouteHint *NONNULL_PTR this_ptr); - public static native long RouteHint_get_htlc_minimum_msat(uint32_t this_ptr); + public static native number RouteHint_get_htlc_minimum_msat(number this_ptr); // void RouteHint_set_htlc_minimum_msat(struct LDKRouteHint *NONNULL_PTR this_ptr, uint64_t val); - public static native void RouteHint_set_htlc_minimum_msat(uint32_t this_ptr, long val); + public static native void RouteHint_set_htlc_minimum_msat(number this_ptr, number val); // MUST_USE_RES struct LDKRouteHint RouteHint_new(struct LDKPublicKey src_node_id_arg, uint64_t short_channel_id_arg, struct LDKRoutingFees fees_arg, uint16_t cltv_expiry_delta_arg, uint64_t htlc_minimum_msat_arg); - public static native uint32_t RouteHint_new(byte[] src_node_id_arg, long short_channel_id_arg, uint32_t fees_arg, short cltv_expiry_delta_arg, long htlc_minimum_msat_arg); + public static native number RouteHint_new(Uint8Array src_node_id_arg, number short_channel_id_arg, number fees_arg, number cltv_expiry_delta_arg, number htlc_minimum_msat_arg); // struct LDKCResult_RouteLightningErrorZ get_route(struct LDKPublicKey our_node_id, const struct LDKNetworkGraph *NONNULL_PTR network, struct LDKPublicKey target, struct LDKCVec_ChannelDetailsZ *first_hops, struct LDKCVec_RouteHintZ last_hops, uint64_t final_value_msat, uint32_t final_cltv, struct LDKLogger logger); - public static native uint32_t get_route(byte[] our_node_id, uint32_t network, byte[] target, uint32_t[] first_hops, uint32_t[] last_hops, long final_value_msat, int final_cltv, uint32_t logger); + public static native number get_route(Uint8Array our_node_id, number network, Uint8Array target, number[] first_hops, number[] last_hops, number final_value_msat, number final_cltv, number logger); // void NetworkGraph_free(struct LDKNetworkGraph this_ptr); - public static native void NetworkGraph_free(uint32_t this_ptr); + public static native void NetworkGraph_free(number this_ptr); // void LockedNetworkGraph_free(struct LDKLockedNetworkGraph this_ptr); - public static native void LockedNetworkGraph_free(uint32_t this_ptr); + public static native void LockedNetworkGraph_free(number this_ptr); // void NetGraphMsgHandler_free(struct LDKNetGraphMsgHandler this_ptr); - public static native void NetGraphMsgHandler_free(uint32_t this_ptr); + public static native void NetGraphMsgHandler_free(number this_ptr); // MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_new(struct LDKThirtyTwoBytes genesis_hash, struct LDKAccess *chain_access, struct LDKLogger logger); - public static native uint32_t NetGraphMsgHandler_new(byte[] genesis_hash, uint32_t chain_access, uint32_t logger); + public static native number NetGraphMsgHandler_new(Uint8Array genesis_hash, number chain_access, number logger); // MUST_USE_RES struct LDKNetGraphMsgHandler NetGraphMsgHandler_from_net_graph(struct LDKAccess *chain_access, struct LDKLogger logger, struct LDKNetworkGraph network_graph); - public static native uint32_t NetGraphMsgHandler_from_net_graph(uint32_t chain_access, uint32_t logger, uint32_t network_graph); + public static native number NetGraphMsgHandler_from_net_graph(number chain_access, number logger, number network_graph); // MUST_USE_RES struct LDKLockedNetworkGraph NetGraphMsgHandler_read_locked_graph(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg); - public static native uint32_t NetGraphMsgHandler_read_locked_graph(uint32_t this_arg); + public static native number NetGraphMsgHandler_read_locked_graph(number this_arg); // MUST_USE_RES struct LDKNetworkGraph LockedNetworkGraph_graph(const struct LDKLockedNetworkGraph *NONNULL_PTR this_arg); - public static native uint32_t LockedNetworkGraph_graph(uint32_t this_arg); + public static native number LockedNetworkGraph_graph(number this_arg); // struct LDKRoutingMessageHandler NetGraphMsgHandler_as_RoutingMessageHandler(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg); - public static native uint32_t NetGraphMsgHandler_as_RoutingMessageHandler(uint32_t this_arg); + public static native number NetGraphMsgHandler_as_RoutingMessageHandler(number this_arg); // struct LDKMessageSendEventsProvider NetGraphMsgHandler_as_MessageSendEventsProvider(const struct LDKNetGraphMsgHandler *NONNULL_PTR this_arg); - public static native uint32_t NetGraphMsgHandler_as_MessageSendEventsProvider(uint32_t this_arg); + public static native number NetGraphMsgHandler_as_MessageSendEventsProvider(number this_arg); // void DirectionalChannelInfo_free(struct LDKDirectionalChannelInfo this_ptr); - public static native void DirectionalChannelInfo_free(uint32_t this_ptr); + public static native void DirectionalChannelInfo_free(number this_ptr); // uint32_t DirectionalChannelInfo_get_last_update(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr); - public static native int DirectionalChannelInfo_get_last_update(uint32_t this_ptr); + public static native number DirectionalChannelInfo_get_last_update(number this_ptr); // void DirectionalChannelInfo_set_last_update(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint32_t val); - public static native void DirectionalChannelInfo_set_last_update(uint32_t this_ptr, int val); + public static native void DirectionalChannelInfo_set_last_update(number this_ptr, number val); // bool DirectionalChannelInfo_get_enabled(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr); - public static native boolean DirectionalChannelInfo_get_enabled(uint32_t this_ptr); + public static native boolean DirectionalChannelInfo_get_enabled(number this_ptr); // void DirectionalChannelInfo_set_enabled(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, bool val); - public static native void DirectionalChannelInfo_set_enabled(uint32_t this_ptr, boolean val); + public static native void DirectionalChannelInfo_set_enabled(number this_ptr, boolean val); // uint16_t DirectionalChannelInfo_get_cltv_expiry_delta(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr); - public static native short DirectionalChannelInfo_get_cltv_expiry_delta(uint32_t this_ptr); + public static native number DirectionalChannelInfo_get_cltv_expiry_delta(number this_ptr); // void DirectionalChannelInfo_set_cltv_expiry_delta(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint16_t val); - public static native void DirectionalChannelInfo_set_cltv_expiry_delta(uint32_t this_ptr, short val); + public static native void DirectionalChannelInfo_set_cltv_expiry_delta(number this_ptr, number val); // uint64_t DirectionalChannelInfo_get_htlc_minimum_msat(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr); - public static native long DirectionalChannelInfo_get_htlc_minimum_msat(uint32_t this_ptr); + public static native number DirectionalChannelInfo_get_htlc_minimum_msat(number this_ptr); // void DirectionalChannelInfo_set_htlc_minimum_msat(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, uint64_t val); - public static native void DirectionalChannelInfo_set_htlc_minimum_msat(uint32_t this_ptr, long val); + public static native void DirectionalChannelInfo_set_htlc_minimum_msat(number this_ptr, number val); // struct LDKRoutingFees DirectionalChannelInfo_get_fees(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr); - public static native uint32_t DirectionalChannelInfo_get_fees(uint32_t this_ptr); + public static native number DirectionalChannelInfo_get_fees(number this_ptr); // void DirectionalChannelInfo_set_fees(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val); - public static native void DirectionalChannelInfo_set_fees(uint32_t this_ptr, uint32_t val); + public static native void DirectionalChannelInfo_set_fees(number this_ptr, number val); // struct LDKChannelUpdate DirectionalChannelInfo_get_last_update_message(const struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr); - public static native uint32_t DirectionalChannelInfo_get_last_update_message(uint32_t this_ptr); + public static native number DirectionalChannelInfo_get_last_update_message(number this_ptr); // void DirectionalChannelInfo_set_last_update_message(struct LDKDirectionalChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelUpdate val); - public static native void DirectionalChannelInfo_set_last_update_message(uint32_t this_ptr, uint32_t val); + public static native void DirectionalChannelInfo_set_last_update_message(number this_ptr, number val); // struct LDKCVec_u8Z DirectionalChannelInfo_write(const struct LDKDirectionalChannelInfo *NONNULL_PTR obj); - public static native byte[] DirectionalChannelInfo_write(uint32_t obj); + public static native Uint8Array DirectionalChannelInfo_write(number obj); // struct LDKDirectionalChannelInfo DirectionalChannelInfo_read(struct LDKu8slice ser); - public static native uint32_t DirectionalChannelInfo_read(byte[] ser); + public static native number DirectionalChannelInfo_read(Uint8Array ser); // void ChannelInfo_free(struct LDKChannelInfo this_ptr); - public static native void ChannelInfo_free(uint32_t this_ptr); + public static native void ChannelInfo_free(number this_ptr); // struct LDKChannelFeatures ChannelInfo_get_features(const struct LDKChannelInfo *NONNULL_PTR this_ptr); - public static native uint32_t ChannelInfo_get_features(uint32_t this_ptr); + public static native number ChannelInfo_get_features(number this_ptr); // void ChannelInfo_set_features(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelFeatures val); - public static native void ChannelInfo_set_features(uint32_t this_ptr, uint32_t val); + public static native void ChannelInfo_set_features(number this_ptr, number val); // struct LDKPublicKey ChannelInfo_get_node_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr); - public static native byte[] ChannelInfo_get_node_one(uint32_t this_ptr); + public static native Uint8Array ChannelInfo_get_node_one(number this_ptr); // void ChannelInfo_set_node_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void ChannelInfo_set_node_one(uint32_t this_ptr, byte[] val); + public static native void ChannelInfo_set_node_one(number this_ptr, Uint8Array val); // struct LDKDirectionalChannelInfo ChannelInfo_get_one_to_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr); - public static native uint32_t ChannelInfo_get_one_to_two(uint32_t this_ptr); + public static native number ChannelInfo_get_one_to_two(number this_ptr); // void ChannelInfo_set_one_to_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val); - public static native void ChannelInfo_set_one_to_two(uint32_t this_ptr, uint32_t val); + public static native void ChannelInfo_set_one_to_two(number this_ptr, number val); // struct LDKPublicKey ChannelInfo_get_node_two(const struct LDKChannelInfo *NONNULL_PTR this_ptr); - public static native byte[] ChannelInfo_get_node_two(uint32_t this_ptr); + public static native Uint8Array ChannelInfo_get_node_two(number this_ptr); // void ChannelInfo_set_node_two(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKPublicKey val); - public static native void ChannelInfo_set_node_two(uint32_t this_ptr, byte[] val); + public static native void ChannelInfo_set_node_two(number this_ptr, Uint8Array val); // struct LDKDirectionalChannelInfo ChannelInfo_get_two_to_one(const struct LDKChannelInfo *NONNULL_PTR this_ptr); - public static native uint32_t ChannelInfo_get_two_to_one(uint32_t this_ptr); + public static native number ChannelInfo_get_two_to_one(number this_ptr); // void ChannelInfo_set_two_to_one(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKDirectionalChannelInfo val); - public static native void ChannelInfo_set_two_to_one(uint32_t this_ptr, uint32_t val); + public static native void ChannelInfo_set_two_to_one(number this_ptr, number val); // struct LDKChannelAnnouncement ChannelInfo_get_announcement_message(const struct LDKChannelInfo *NONNULL_PTR this_ptr); - public static native uint32_t ChannelInfo_get_announcement_message(uint32_t this_ptr); + public static native number ChannelInfo_get_announcement_message(number this_ptr); // void ChannelInfo_set_announcement_message(struct LDKChannelInfo *NONNULL_PTR this_ptr, struct LDKChannelAnnouncement val); - public static native void ChannelInfo_set_announcement_message(uint32_t this_ptr, uint32_t val); + public static native void ChannelInfo_set_announcement_message(number this_ptr, number val); // struct LDKCVec_u8Z ChannelInfo_write(const struct LDKChannelInfo *NONNULL_PTR obj); - public static native byte[] ChannelInfo_write(uint32_t obj); + public static native Uint8Array ChannelInfo_write(number obj); // struct LDKChannelInfo ChannelInfo_read(struct LDKu8slice ser); - public static native uint32_t ChannelInfo_read(byte[] ser); + public static native number ChannelInfo_read(Uint8Array ser); // void RoutingFees_free(struct LDKRoutingFees this_ptr); - public static native void RoutingFees_free(uint32_t this_ptr); + public static native void RoutingFees_free(number this_ptr); // struct LDKRoutingFees RoutingFees_clone(const struct LDKRoutingFees *NONNULL_PTR orig); - public static native uint32_t RoutingFees_clone(uint32_t orig); + public static native number RoutingFees_clone(number orig); // uint32_t RoutingFees_get_base_msat(const struct LDKRoutingFees *NONNULL_PTR this_ptr); - public static native int RoutingFees_get_base_msat(uint32_t this_ptr); + public static native number RoutingFees_get_base_msat(number this_ptr); // void RoutingFees_set_base_msat(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val); - public static native void RoutingFees_set_base_msat(uint32_t this_ptr, int val); + public static native void RoutingFees_set_base_msat(number this_ptr, number val); // uint32_t RoutingFees_get_proportional_millionths(const struct LDKRoutingFees *NONNULL_PTR this_ptr); - public static native int RoutingFees_get_proportional_millionths(uint32_t this_ptr); + public static native number RoutingFees_get_proportional_millionths(number this_ptr); // void RoutingFees_set_proportional_millionths(struct LDKRoutingFees *NONNULL_PTR this_ptr, uint32_t val); - public static native void RoutingFees_set_proportional_millionths(uint32_t this_ptr, int val); + public static native void RoutingFees_set_proportional_millionths(number this_ptr, number val); // MUST_USE_RES struct LDKRoutingFees RoutingFees_new(uint32_t base_msat_arg, uint32_t proportional_millionths_arg); - public static native uint32_t RoutingFees_new(int base_msat_arg, int proportional_millionths_arg); + public static native number RoutingFees_new(number base_msat_arg, number proportional_millionths_arg); // struct LDKCResult_RoutingFeesDecodeErrorZ RoutingFees_read(struct LDKu8slice ser); - public static native uint32_t RoutingFees_read(byte[] ser); + public static native number RoutingFees_read(Uint8Array ser); // struct LDKCVec_u8Z RoutingFees_write(const struct LDKRoutingFees *NONNULL_PTR obj); - public static native byte[] RoutingFees_write(uint32_t obj); + public static native Uint8Array RoutingFees_write(number obj); // void NodeAnnouncementInfo_free(struct LDKNodeAnnouncementInfo this_ptr); - public static native void NodeAnnouncementInfo_free(uint32_t this_ptr); + public static native void NodeAnnouncementInfo_free(number this_ptr); // struct LDKNodeFeatures NodeAnnouncementInfo_get_features(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr); - public static native uint32_t NodeAnnouncementInfo_get_features(uint32_t this_ptr); + public static native number NodeAnnouncementInfo_get_features(number this_ptr); // void NodeAnnouncementInfo_set_features(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeFeatures val); - public static native void NodeAnnouncementInfo_set_features(uint32_t this_ptr, uint32_t val); + public static native void NodeAnnouncementInfo_set_features(number this_ptr, number val); // uint32_t NodeAnnouncementInfo_get_last_update(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr); - public static native int NodeAnnouncementInfo_get_last_update(uint32_t this_ptr); + public static native number NodeAnnouncementInfo_get_last_update(number this_ptr); // void NodeAnnouncementInfo_set_last_update(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, uint32_t val); - public static native void NodeAnnouncementInfo_set_last_update(uint32_t this_ptr, int val); + public static native void NodeAnnouncementInfo_set_last_update(number this_ptr, number val); // const uint8_t (*NodeAnnouncementInfo_get_rgb(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[3]; - public static native byte[] NodeAnnouncementInfo_get_rgb(uint32_t this_ptr); + public static native Uint8Array NodeAnnouncementInfo_get_rgb(number this_ptr); // void NodeAnnouncementInfo_set_rgb(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThreeBytes val); - public static native void NodeAnnouncementInfo_set_rgb(uint32_t this_ptr, byte[] val); + public static native void NodeAnnouncementInfo_set_rgb(number this_ptr, Uint8Array val); // const uint8_t (*NodeAnnouncementInfo_get_alias(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr))[32]; - public static native byte[] NodeAnnouncementInfo_get_alias(uint32_t this_ptr); + public static native Uint8Array NodeAnnouncementInfo_get_alias(number this_ptr); // void NodeAnnouncementInfo_set_alias(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - public static native void NodeAnnouncementInfo_set_alias(uint32_t this_ptr, byte[] val); + public static native void NodeAnnouncementInfo_set_alias(number this_ptr, Uint8Array val); // void NodeAnnouncementInfo_set_addresses(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKCVec_NetAddressZ val); - public static native void NodeAnnouncementInfo_set_addresses(uint32_t this_ptr, uint32_t[] val); + public static native void NodeAnnouncementInfo_set_addresses(number this_ptr, number[] val); // struct LDKNodeAnnouncement NodeAnnouncementInfo_get_announcement_message(const struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr); - public static native uint32_t NodeAnnouncementInfo_get_announcement_message(uint32_t this_ptr); + public static native number NodeAnnouncementInfo_get_announcement_message(number this_ptr); // void NodeAnnouncementInfo_set_announcement_message(struct LDKNodeAnnouncementInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncement val); - public static native void NodeAnnouncementInfo_set_announcement_message(uint32_t this_ptr, uint32_t val); + public static native void NodeAnnouncementInfo_set_announcement_message(number this_ptr, number val); // MUST_USE_RES struct LDKNodeAnnouncementInfo NodeAnnouncementInfo_new(struct LDKNodeFeatures features_arg, uint32_t last_update_arg, struct LDKThreeBytes rgb_arg, struct LDKThirtyTwoBytes alias_arg, struct LDKCVec_NetAddressZ addresses_arg, struct LDKNodeAnnouncement announcement_message_arg); - public static native uint32_t NodeAnnouncementInfo_new(uint32_t features_arg, int last_update_arg, byte[] rgb_arg, byte[] alias_arg, uint32_t[] addresses_arg, uint32_t announcement_message_arg); + public static native number NodeAnnouncementInfo_new(number features_arg, number last_update_arg, Uint8Array rgb_arg, Uint8Array alias_arg, number[] addresses_arg, number announcement_message_arg); // struct LDKCVec_u8Z NodeAnnouncementInfo_write(const struct LDKNodeAnnouncementInfo *NONNULL_PTR obj); - public static native byte[] NodeAnnouncementInfo_write(uint32_t obj); + public static native Uint8Array NodeAnnouncementInfo_write(number obj); // struct LDKCResult_NodeAnnouncementInfoDecodeErrorZ NodeAnnouncementInfo_read(struct LDKu8slice ser); - public static native uint32_t NodeAnnouncementInfo_read(byte[] ser); + public static native number NodeAnnouncementInfo_read(Uint8Array ser); // void NodeInfo_free(struct LDKNodeInfo this_ptr); - public static native void NodeInfo_free(uint32_t this_ptr); + public static native void NodeInfo_free(number this_ptr); // void NodeInfo_set_channels(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKCVec_u64Z val); - public static native void NodeInfo_set_channels(uint32_t this_ptr, long[] val); + public static native void NodeInfo_set_channels(number this_ptr, number[] val); // struct LDKRoutingFees NodeInfo_get_lowest_inbound_channel_fees(const struct LDKNodeInfo *NONNULL_PTR this_ptr); - public static native uint32_t NodeInfo_get_lowest_inbound_channel_fees(uint32_t this_ptr); + public static native number NodeInfo_get_lowest_inbound_channel_fees(number this_ptr); // void NodeInfo_set_lowest_inbound_channel_fees(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKRoutingFees val); - public static native void NodeInfo_set_lowest_inbound_channel_fees(uint32_t this_ptr, uint32_t val); + public static native void NodeInfo_set_lowest_inbound_channel_fees(number this_ptr, number val); // struct LDKNodeAnnouncementInfo NodeInfo_get_announcement_info(const struct LDKNodeInfo *NONNULL_PTR this_ptr); - public static native uint32_t NodeInfo_get_announcement_info(uint32_t this_ptr); + public static native number NodeInfo_get_announcement_info(number this_ptr); // void NodeInfo_set_announcement_info(struct LDKNodeInfo *NONNULL_PTR this_ptr, struct LDKNodeAnnouncementInfo val); - public static native void NodeInfo_set_announcement_info(uint32_t this_ptr, uint32_t val); + public static native void NodeInfo_set_announcement_info(number this_ptr, number val); // MUST_USE_RES struct LDKNodeInfo NodeInfo_new(struct LDKCVec_u64Z channels_arg, struct LDKRoutingFees lowest_inbound_channel_fees_arg, struct LDKNodeAnnouncementInfo announcement_info_arg); - public static native uint32_t NodeInfo_new(long[] channels_arg, uint32_t lowest_inbound_channel_fees_arg, uint32_t announcement_info_arg); + public static native number NodeInfo_new(number[] channels_arg, number lowest_inbound_channel_fees_arg, number announcement_info_arg); // struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj); - public static native byte[] NodeInfo_write(uint32_t obj); + public static native Uint8Array NodeInfo_write(number obj); // struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser); - public static native uint32_t NodeInfo_read(byte[] ser); + public static native number NodeInfo_read(Uint8Array ser); // struct LDKCVec_u8Z NetworkGraph_write(const struct LDKNetworkGraph *NONNULL_PTR obj); - public static native byte[] NetworkGraph_write(uint32_t obj); + public static native Uint8Array NetworkGraph_write(number obj); // struct LDKCResult_NetworkGraphDecodeErrorZ NetworkGraph_read(struct LDKu8slice ser); - public static native uint32_t NetworkGraph_read(byte[] ser); + public static native number NetworkGraph_read(Uint8Array ser); // MUST_USE_RES struct LDKNetworkGraph NetworkGraph_new(struct LDKThirtyTwoBytes genesis_hash); - public static native uint32_t NetworkGraph_new(byte[] genesis_hash); + public static native number NetworkGraph_new(Uint8Array genesis_hash); // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKNodeAnnouncement *NONNULL_PTR msg); - public static native uint32_t NetworkGraph_update_node_from_announcement(uint32_t this_arg, uint32_t msg); + public static native number NetworkGraph_update_node_from_announcement(number this_arg, number msg); // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_node_from_unsigned_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR msg); - public static native uint32_t NetworkGraph_update_node_from_unsigned_announcement(uint32_t this_arg, uint32_t msg); + public static native number NetworkGraph_update_node_from_unsigned_announcement(number this_arg, number msg); // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelAnnouncement *NONNULL_PTR msg, struct LDKAccess *chain_access); - public static native uint32_t NetworkGraph_update_channel_from_announcement(uint32_t this_arg, uint32_t msg, uint32_t chain_access); + public static native number NetworkGraph_update_channel_from_announcement(number this_arg, number msg, number chain_access); // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_from_unsigned_announcement(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelAnnouncement *NONNULL_PTR msg, struct LDKAccess *chain_access); - public static native uint32_t NetworkGraph_update_channel_from_unsigned_announcement(uint32_t this_arg, uint32_t msg, uint32_t chain_access); + public static native number NetworkGraph_update_channel_from_unsigned_announcement(number this_arg, number msg, number chain_access); // void NetworkGraph_close_channel_from_update(struct LDKNetworkGraph *NONNULL_PTR this_arg, uint64_t short_channel_id, bool is_permanent); - public static native void NetworkGraph_close_channel_from_update(uint32_t this_arg, long short_channel_id, boolean is_permanent); + public static native void NetworkGraph_close_channel_from_update(number this_arg, number short_channel_id, boolean is_permanent); // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKChannelUpdate *NONNULL_PTR msg); - public static native uint32_t NetworkGraph_update_channel(uint32_t this_arg, uint32_t msg); + public static native number NetworkGraph_update_channel(number this_arg, number msg); // MUST_USE_RES struct LDKCResult_NoneLightningErrorZ NetworkGraph_update_channel_unsigned(struct LDKNetworkGraph *NONNULL_PTR this_arg, const struct LDKUnsignedChannelUpdate *NONNULL_PTR msg); - public static native uint32_t NetworkGraph_update_channel_unsigned(uint32_t this_arg, uint32_t msg); + public static native number NetworkGraph_update_channel_unsigned(number this_arg, number msg); } diff --git a/ts/enums/LDKAccessError.ts b/ts/enums/LDKAccessError.ts index e568679c..782e2e35 100644 --- a/ts/enums/LDKAccessError.ts +++ b/ts/enums/LDKAccessError.ts @@ -4,4 +4,3 @@ LDKAccessError_UnknownTx, } - \ No newline at end of file diff --git a/ts/enums/LDKChannelMonitorUpdateErr.ts b/ts/enums/LDKChannelMonitorUpdateErr.ts index 66c88c3d..c21a545d 100644 --- a/ts/enums/LDKChannelMonitorUpdateErr.ts +++ b/ts/enums/LDKChannelMonitorUpdateErr.ts @@ -4,4 +4,3 @@ LDKChannelMonitorUpdateErr_PermanentFailure, } - \ No newline at end of file diff --git a/ts/enums/LDKConfirmationTarget.ts b/ts/enums/LDKConfirmationTarget.ts index 1c256930..8eda181f 100644 --- a/ts/enums/LDKConfirmationTarget.ts +++ b/ts/enums/LDKConfirmationTarget.ts @@ -5,4 +5,3 @@ LDKConfirmationTarget_HighPriority, } - \ No newline at end of file diff --git a/ts/enums/LDKLevel.ts b/ts/enums/LDKLevel.ts index 48c44416..59658d2e 100644 --- a/ts/enums/LDKLevel.ts +++ b/ts/enums/LDKLevel.ts @@ -8,4 +8,3 @@ LDKLevel_Trace, } - \ No newline at end of file diff --git a/ts/enums/LDKNetwork.ts b/ts/enums/LDKNetwork.ts index 105e7850..fed72559 100644 --- a/ts/enums/LDKNetwork.ts +++ b/ts/enums/LDKNetwork.ts @@ -5,4 +5,3 @@ LDKNetwork_Regtest, } - \ No newline at end of file diff --git a/ts/enums/LDKSecp256k1Error.ts b/ts/enums/LDKSecp256k1Error.ts index 3466a0b6..62670097 100644 --- a/ts/enums/LDKSecp256k1Error.ts +++ b/ts/enums/LDKSecp256k1Error.ts @@ -11,4 +11,3 @@ LDKSecp256k1Error_CallbackPanicked, } - \ No newline at end of file diff --git a/ts/structs/APIError.ts b/ts/structs/APIError.ts index f55aa784..5904b6c5 100644 --- a/ts/structs/APIError.ts +++ b/ts/structs/APIError.ts @@ -30,15 +30,15 @@ export default class APIError extends CommonBase { } export class APIMisuseError extends APIError { - public err: byte[]; + public err: Uint8Array; private constructor(ptr: number, obj: bindings.LDKAPIError.APIMisuseError) { super(null, ptr); this.err = obj.err; } } export class FeeRateTooHigh extends APIError { - public err: byte[]; - public feerate: int; + public err: Uint8Array; + public feerate: number; private constructor(ptr: number, obj: bindings.LDKAPIError.FeeRateTooHigh) { super(null, ptr); this.err = obj.err; @@ -53,7 +53,7 @@ export class RouteError extends APIError { } } export class ChannelUnavailable extends APIError { - public err: byte[]; + public err: Uint8Array; private constructor(ptr: number, obj: bindings.LDKAPIError.ChannelUnavailable) { super(null, ptr); this.err = obj.err; diff --git a/ts/structs/AcceptChannel.ts b/ts/structs/AcceptChannel.ts index 454c5a6a..bcd54516 100644 --- a/ts/structs/AcceptChannel.ts +++ b/ts/structs/AcceptChannel.ts @@ -1,155 +1,163 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class AcceptChannel extends CommonBase { - AcceptChannel(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.AcceptChannel_free(ptr); } - } + + export default class AcceptChannel extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.AcceptChannel_free(this.ptr); + } + } public AcceptChannel clone() { - uint32_t ret = bindings.AcceptChannel_clone(this.ptr); - AcceptChannel ret_hu_conv = new AcceptChannel(null, ret); + number ret = bindings.AcceptChannel_clone(this.ptr); + const ret_hu_conv: AcceptChannel = new AcceptChannel(null, ret); return ret_hu_conv; } - public byte[] get_temporary_channel_id() { - byte[] ret = bindings.AcceptChannel_get_temporary_channel_id(this.ptr); + public Uint8Array get_temporary_channel_id() { + Uint8Array ret = bindings.AcceptChannel_get_temporary_channel_id(this.ptr); return ret; } - public void set_temporary_channel_id(byte[] val) { + public void set_temporary_channel_id(Uint8Array val) { bindings.AcceptChannel_set_temporary_channel_id(this.ptr, val); } - public long get_dust_limit_satoshis() { - long ret = bindings.AcceptChannel_get_dust_limit_satoshis(this.ptr); + public number get_dust_limit_satoshis() { + number ret = bindings.AcceptChannel_get_dust_limit_satoshis(this.ptr); return ret; } - public void set_dust_limit_satoshis(long val) { + public void set_dust_limit_satoshis(number val) { bindings.AcceptChannel_set_dust_limit_satoshis(this.ptr, val); } - public long get_max_htlc_value_in_flight_msat() { - long ret = bindings.AcceptChannel_get_max_htlc_value_in_flight_msat(this.ptr); + public number get_max_htlc_value_in_flight_msat() { + number ret = bindings.AcceptChannel_get_max_htlc_value_in_flight_msat(this.ptr); return ret; } - public void set_max_htlc_value_in_flight_msat(long val) { + public void set_max_htlc_value_in_flight_msat(number val) { bindings.AcceptChannel_set_max_htlc_value_in_flight_msat(this.ptr, val); } - public long get_channel_reserve_satoshis() { - long ret = bindings.AcceptChannel_get_channel_reserve_satoshis(this.ptr); + public number get_channel_reserve_satoshis() { + number ret = bindings.AcceptChannel_get_channel_reserve_satoshis(this.ptr); return ret; } - public void set_channel_reserve_satoshis(long val) { + public void set_channel_reserve_satoshis(number val) { bindings.AcceptChannel_set_channel_reserve_satoshis(this.ptr, val); } - public long get_htlc_minimum_msat() { - long ret = bindings.AcceptChannel_get_htlc_minimum_msat(this.ptr); + public number get_htlc_minimum_msat() { + number ret = bindings.AcceptChannel_get_htlc_minimum_msat(this.ptr); return ret; } - public void set_htlc_minimum_msat(long val) { + public void set_htlc_minimum_msat(number val) { bindings.AcceptChannel_set_htlc_minimum_msat(this.ptr, val); } - public int get_minimum_depth() { - int ret = bindings.AcceptChannel_get_minimum_depth(this.ptr); + public number get_minimum_depth() { + number ret = bindings.AcceptChannel_get_minimum_depth(this.ptr); return ret; } - public void set_minimum_depth(int val) { + public void set_minimum_depth(number val) { bindings.AcceptChannel_set_minimum_depth(this.ptr, val); } - public short get_to_self_delay() { - short ret = bindings.AcceptChannel_get_to_self_delay(this.ptr); + public number get_to_self_delay() { + number ret = bindings.AcceptChannel_get_to_self_delay(this.ptr); return ret; } - public void set_to_self_delay(short val) { + public void set_to_self_delay(number val) { bindings.AcceptChannel_set_to_self_delay(this.ptr, val); } - public short get_max_accepted_htlcs() { - short ret = bindings.AcceptChannel_get_max_accepted_htlcs(this.ptr); + public number get_max_accepted_htlcs() { + number ret = bindings.AcceptChannel_get_max_accepted_htlcs(this.ptr); return ret; } - public void set_max_accepted_htlcs(short val) { + public void set_max_accepted_htlcs(number val) { bindings.AcceptChannel_set_max_accepted_htlcs(this.ptr, val); } - public byte[] get_funding_pubkey() { - byte[] ret = bindings.AcceptChannel_get_funding_pubkey(this.ptr); + public Uint8Array get_funding_pubkey() { + Uint8Array ret = bindings.AcceptChannel_get_funding_pubkey(this.ptr); return ret; } - public void set_funding_pubkey(byte[] val) { + public void set_funding_pubkey(Uint8Array val) { bindings.AcceptChannel_set_funding_pubkey(this.ptr, val); } - public byte[] get_revocation_basepoint() { - byte[] ret = bindings.AcceptChannel_get_revocation_basepoint(this.ptr); + public Uint8Array get_revocation_basepoint() { + Uint8Array ret = bindings.AcceptChannel_get_revocation_basepoint(this.ptr); return ret; } - public void set_revocation_basepoint(byte[] val) { + public void set_revocation_basepoint(Uint8Array val) { bindings.AcceptChannel_set_revocation_basepoint(this.ptr, val); } - public byte[] get_payment_point() { - byte[] ret = bindings.AcceptChannel_get_payment_point(this.ptr); + public Uint8Array get_payment_point() { + Uint8Array ret = bindings.AcceptChannel_get_payment_point(this.ptr); return ret; } - public void set_payment_point(byte[] val) { + public void set_payment_point(Uint8Array val) { bindings.AcceptChannel_set_payment_point(this.ptr, val); } - public byte[] get_delayed_payment_basepoint() { - byte[] ret = bindings.AcceptChannel_get_delayed_payment_basepoint(this.ptr); + public Uint8Array get_delayed_payment_basepoint() { + Uint8Array ret = bindings.AcceptChannel_get_delayed_payment_basepoint(this.ptr); return ret; } - public void set_delayed_payment_basepoint(byte[] val) { + public void set_delayed_payment_basepoint(Uint8Array val) { bindings.AcceptChannel_set_delayed_payment_basepoint(this.ptr, val); } - public byte[] get_htlc_basepoint() { - byte[] ret = bindings.AcceptChannel_get_htlc_basepoint(this.ptr); + public Uint8Array get_htlc_basepoint() { + Uint8Array ret = bindings.AcceptChannel_get_htlc_basepoint(this.ptr); return ret; } - public void set_htlc_basepoint(byte[] val) { + public void set_htlc_basepoint(Uint8Array val) { bindings.AcceptChannel_set_htlc_basepoint(this.ptr, val); } - public byte[] get_first_per_commitment_point() { - byte[] ret = bindings.AcceptChannel_get_first_per_commitment_point(this.ptr); + public Uint8Array get_first_per_commitment_point() { + Uint8Array ret = bindings.AcceptChannel_get_first_per_commitment_point(this.ptr); return ret; } - public void set_first_per_commitment_point(byte[] val) { + public void set_first_per_commitment_point(Uint8Array val) { bindings.AcceptChannel_set_first_per_commitment_point(this.ptr, val); } - public byte[] write() { - byte[] ret = bindings.AcceptChannel_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.AcceptChannel_write(this.ptr); return ret; } - public static AcceptChannel constructor_read(byte[] ser) { - uint32_t ret = bindings.AcceptChannel_read(ser); - AcceptChannel ret_hu_conv = new AcceptChannel(null, ret); + public static AcceptChannel constructor_read(Uint8Array ser) { + number ret = bindings.AcceptChannel_read(ser); + const ret_hu_conv: AcceptChannel = new AcceptChannel(null, ret); return ret_hu_conv; } diff --git a/ts/structs/Access.ts b/ts/structs/Access.ts index 1a9e5c26..416f2a14 100644 --- a/ts/structs/Access.ts +++ b/ts/structs/Access.ts @@ -1,5 +1,59 @@ - public Result_TxOutAccessErrorZ get_utxo(byte[] genesis_hash, long short_channel_id) { - uint32_t ret = bindings.Access_get_utxo(this.ptr, genesis_hash, short_channel_id); + + +import CommonBase from './CommonBase'; +import * as bindings from '../bindings' // TODO: figure out location + + + + export class Access extends CommonBase { + + bindings_instance?: bindings.LDKAccess; + + constructor(ptr?: number, arg?: bindings.LDKAccess) { + if (Number.isFinite(ptr)) { + super(ptr); + this.bindings_instance = null; + } else { + // TODO: private constructor instantiation + super(bindings.LDKAccess_new(arg)); + this.ptrs_to.push(arg); + + } + } + + protected finalize() { + if (this.ptr != 0) { + bindings.Access_free(this.ptr); + } + super.finalize(); + } + + static new_impl(arg: AccessInterface): Access { + const impl_holder: LDKAccessHolder = new LDKAccessHolder(); + let structImplementation = { + // todo: in-line interface filling + get_utxo (genesis_hash: Uint8Array, short_channel_id: number): number { + Result_TxOutAccessErrorZ ret = arg.get_utxo(genesis_hash, short_channel_id); + result: number = ret != null ? ret.ptr : 0; + return result; + }, + + + }; + impl_holder.held = new Access (null, structImplementation); + } + } + + export interface AccessInterface { + get_utxo(genesis_hash: Uint8Array, short_channel_id: number): Result_TxOutAccessErrorZ; + + } + + class LDKAccessHolder { + held: Access; + } + public Result_TxOutAccessErrorZ get_utxo(Uint8Array genesis_hash, number short_channel_id) { + number ret = bindings.Access_get_utxo(this.ptr, genesis_hash, short_channel_id); Result_TxOutAccessErrorZ ret_hu_conv = Result_TxOutAccessErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/ts/structs/AnnouncementSignatures.ts b/ts/structs/AnnouncementSignatures.ts index b4378321..bf41f671 100644 --- a/ts/structs/AnnouncementSignatures.ts +++ b/ts/structs/AnnouncementSignatures.ts @@ -1,71 +1,79 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class AnnouncementSignatures extends CommonBase { - AnnouncementSignatures(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.AnnouncementSignatures_free(ptr); } - } + + export default class AnnouncementSignatures extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.AnnouncementSignatures_free(this.ptr); + } + } public AnnouncementSignatures clone() { - uint32_t ret = bindings.AnnouncementSignatures_clone(this.ptr); - AnnouncementSignatures ret_hu_conv = new AnnouncementSignatures(null, ret); + number ret = bindings.AnnouncementSignatures_clone(this.ptr); + const ret_hu_conv: AnnouncementSignatures = new AnnouncementSignatures(null, ret); return ret_hu_conv; } - public byte[] get_channel_id() { - byte[] ret = bindings.AnnouncementSignatures_get_channel_id(this.ptr); + public Uint8Array get_channel_id() { + Uint8Array ret = bindings.AnnouncementSignatures_get_channel_id(this.ptr); return ret; } - public void set_channel_id(byte[] val) { + public void set_channel_id(Uint8Array val) { bindings.AnnouncementSignatures_set_channel_id(this.ptr, val); } - public long get_short_channel_id() { - long ret = bindings.AnnouncementSignatures_get_short_channel_id(this.ptr); + public number get_short_channel_id() { + number ret = bindings.AnnouncementSignatures_get_short_channel_id(this.ptr); return ret; } - public void set_short_channel_id(long val) { + public void set_short_channel_id(number val) { bindings.AnnouncementSignatures_set_short_channel_id(this.ptr, val); } - public byte[] get_node_signature() { - byte[] ret = bindings.AnnouncementSignatures_get_node_signature(this.ptr); + public Uint8Array get_node_signature() { + Uint8Array ret = bindings.AnnouncementSignatures_get_node_signature(this.ptr); return ret; } - public void set_node_signature(byte[] val) { + public void set_node_signature(Uint8Array val) { bindings.AnnouncementSignatures_set_node_signature(this.ptr, val); } - public byte[] get_bitcoin_signature() { - byte[] ret = bindings.AnnouncementSignatures_get_bitcoin_signature(this.ptr); + public Uint8Array get_bitcoin_signature() { + Uint8Array ret = bindings.AnnouncementSignatures_get_bitcoin_signature(this.ptr); return ret; } - public void set_bitcoin_signature(byte[] val) { + public void set_bitcoin_signature(Uint8Array val) { bindings.AnnouncementSignatures_set_bitcoin_signature(this.ptr, val); } - public static AnnouncementSignatures constructor_new(byte[] channel_id_arg, long short_channel_id_arg, byte[] node_signature_arg, byte[] bitcoin_signature_arg) { - uint32_t ret = bindings.AnnouncementSignatures_new(channel_id_arg, short_channel_id_arg, node_signature_arg, bitcoin_signature_arg); - AnnouncementSignatures ret_hu_conv = new AnnouncementSignatures(null, ret); + public static AnnouncementSignatures constructor_new(Uint8Array channel_id_arg, number short_channel_id_arg, Uint8Array node_signature_arg, Uint8Array bitcoin_signature_arg) { + number ret = bindings.AnnouncementSignatures_new(channel_id_arg, short_channel_id_arg, node_signature_arg, bitcoin_signature_arg); + const ret_hu_conv: AnnouncementSignatures = new AnnouncementSignatures(null, ret); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.AnnouncementSignatures_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.AnnouncementSignatures_write(this.ptr); return ret; } - public static AnnouncementSignatures constructor_read(byte[] ser) { - uint32_t ret = bindings.AnnouncementSignatures_read(ser); - AnnouncementSignatures ret_hu_conv = new AnnouncementSignatures(null, ret); + public static AnnouncementSignatures constructor_read(Uint8Array ser) { + number ret = bindings.AnnouncementSignatures_read(ser); + const ret_hu_conv: AnnouncementSignatures = new AnnouncementSignatures(null, ret); return ret_hu_conv; } diff --git a/ts/structs/BroadcasterInterface.ts b/ts/structs/BroadcasterInterface.ts index a6f074ba..2fbda737 100644 --- a/ts/structs/BroadcasterInterface.ts +++ b/ts/structs/BroadcasterInterface.ts @@ -1,4 +1,56 @@ - public void broadcast_transaction(byte[] tx) { + + +import CommonBase from './CommonBase'; +import * as bindings from '../bindings' // TODO: figure out location + + + + export class BroadcasterInterface extends CommonBase { + + bindings_instance?: bindings.LDKBroadcasterInterface; + + constructor(ptr?: number, arg?: bindings.LDKBroadcasterInterface) { + if (Number.isFinite(ptr)) { + super(ptr); + this.bindings_instance = null; + } else { + // TODO: private constructor instantiation + super(bindings.LDKBroadcasterInterface_new(arg)); + this.ptrs_to.push(arg); + + } + } + + protected finalize() { + if (this.ptr != 0) { + bindings.BroadcasterInterface_free(this.ptr); + } + super.finalize(); + } + + static new_impl(arg: BroadcasterInterfaceInterface): BroadcasterInterface { + const impl_holder: LDKBroadcasterInterfaceHolder = new LDKBroadcasterInterfaceHolder(); + let structImplementation = { + // todo: in-line interface filling + broadcast_transaction (tx: Uint8Array): void { + arg.broadcast_transaction(tx); + }, + + + }; + impl_holder.held = new BroadcasterInterface (null, structImplementation); + } + } + + export interface BroadcasterInterfaceInterface { + broadcast_transaction(tx: Uint8Array): void; + + } + + class LDKBroadcasterInterfaceHolder { + held: BroadcasterInterface; + } + public void broadcast_transaction(Uint8Array tx) { bindings.BroadcasterInterface_broadcast_transaction(this.ptr, tx); } diff --git a/ts/structs/BuiltCommitmentTransaction.ts b/ts/structs/BuiltCommitmentTransaction.ts index 5de69c01..cbd67595 100644 --- a/ts/structs/BuiltCommitmentTransaction.ts +++ b/ts/structs/BuiltCommitmentTransaction.ts @@ -1,63 +1,71 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class BuiltCommitmentTransaction extends CommonBase { - BuiltCommitmentTransaction(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.BuiltCommitmentTransaction_free(ptr); } - } + + export default class BuiltCommitmentTransaction extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.BuiltCommitmentTransaction_free(this.ptr); + } + } public BuiltCommitmentTransaction clone() { - uint32_t ret = bindings.BuiltCommitmentTransaction_clone(this.ptr); - BuiltCommitmentTransaction ret_hu_conv = new BuiltCommitmentTransaction(null, ret); + number ret = bindings.BuiltCommitmentTransaction_clone(this.ptr); + const ret_hu_conv: BuiltCommitmentTransaction = new BuiltCommitmentTransaction(null, ret); return ret_hu_conv; } - public byte[] get_transaction() { - byte[] ret = bindings.BuiltCommitmentTransaction_get_transaction(this.ptr); + public Uint8Array get_transaction() { + Uint8Array ret = bindings.BuiltCommitmentTransaction_get_transaction(this.ptr); return ret; } - public void set_transaction(byte[] val) { + public void set_transaction(Uint8Array val) { bindings.BuiltCommitmentTransaction_set_transaction(this.ptr, val); } - public byte[] get_txid() { - byte[] ret = bindings.BuiltCommitmentTransaction_get_txid(this.ptr); + public Uint8Array get_txid() { + Uint8Array ret = bindings.BuiltCommitmentTransaction_get_txid(this.ptr); return ret; } - public void set_txid(byte[] val) { + public void set_txid(Uint8Array val) { bindings.BuiltCommitmentTransaction_set_txid(this.ptr, val); } - public static BuiltCommitmentTransaction constructor_new(byte[] transaction_arg, byte[] txid_arg) { - uint32_t ret = bindings.BuiltCommitmentTransaction_new(transaction_arg, txid_arg); - BuiltCommitmentTransaction ret_hu_conv = new BuiltCommitmentTransaction(null, ret); + public static BuiltCommitmentTransaction constructor_new(Uint8Array transaction_arg, Uint8Array txid_arg) { + number ret = bindings.BuiltCommitmentTransaction_new(transaction_arg, txid_arg); + const ret_hu_conv: BuiltCommitmentTransaction = new BuiltCommitmentTransaction(null, ret); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.BuiltCommitmentTransaction_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.BuiltCommitmentTransaction_write(this.ptr); return ret; } - public static BuiltCommitmentTransaction constructor_read(byte[] ser) { - uint32_t ret = bindings.BuiltCommitmentTransaction_read(ser); - BuiltCommitmentTransaction ret_hu_conv = new BuiltCommitmentTransaction(null, ret); + public static BuiltCommitmentTransaction constructor_read(Uint8Array ser) { + number ret = bindings.BuiltCommitmentTransaction_read(ser); + const ret_hu_conv: BuiltCommitmentTransaction = new BuiltCommitmentTransaction(null, ret); return ret_hu_conv; } - public byte[] get_sighash_all(byte[] funding_redeemscript, long channel_value_satoshis) { - byte[] ret = bindings.BuiltCommitmentTransaction_get_sighash_all(this.ptr, funding_redeemscript, channel_value_satoshis); + public Uint8Array get_sighash_all(Uint8Array funding_redeemscript, number channel_value_satoshis) { + Uint8Array ret = bindings.BuiltCommitmentTransaction_get_sighash_all(this.ptr, funding_redeemscript, channel_value_satoshis); return ret; } - public byte[] sign(byte[] funding_key, byte[] funding_redeemscript, long channel_value_satoshis) { - byte[] ret = bindings.BuiltCommitmentTransaction_sign(this.ptr, funding_key, funding_redeemscript, channel_value_satoshis); + public Uint8Array sign(Uint8Array funding_key, Uint8Array funding_redeemscript, number channel_value_satoshis) { + Uint8Array ret = bindings.BuiltCommitmentTransaction_sign(this.ptr, funding_key, funding_redeemscript, channel_value_satoshis); return ret; } diff --git a/ts/structs/ChainMonitor.ts b/ts/structs/ChainMonitor.ts index 41be56f9..6cbc4621 100644 --- a/ts/structs/ChainMonitor.ts +++ b/ts/structs/ChainMonitor.ts @@ -1,27 +1,35 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class ChainMonitor extends CommonBase { - ChainMonitor(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.ChainMonitor_free(ptr); } - } - public void block_connected(byte[] header, TwoTuple[] txdata, int height) { - bindings.ChainMonitor_block_connected(this.ptr, header, (uint32_t[])Arrays.stream(txdata).map(arr_conv_24 -> bindings.C2Tuple_usizeTransactionZ_new(arr_conv_24.a, arr_conv_24.b)).toArray(), height); - /* TODO 2 TwoTuple */; + + export default class ChainMonitor extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.ChainMonitor_free(this.ptr); + } + } + public void block_connected(Uint8Array header, TwoTuple[] txdata, number height) { + bindings.ChainMonitor_block_connected(this.ptr, header, (number[])Arrays.stream(txdata).map(arr_conv_30 -> bindings.C2Tuple_usizeTransactionZ_new(arr_conv_30.a, arr_conv_30.b)).toArray(), height); + /* TODO 2 TwoTuple */; } - public void block_disconnected(byte[] header, int disconnected_height) { + public void block_disconnected(Uint8Array header, number disconnected_height) { bindings.ChainMonitor_block_disconnected(this.ptr, header, disconnected_height); } public static ChainMonitor constructor_new(Filter chain_source, BroadcasterInterface broadcaster, Logger logger, FeeEstimator feeest, Persist persister) { - uint32_t 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); - ChainMonitor ret_hu_conv = new ChainMonitor(null, ret); + number 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); + const ret_hu_conv: ChainMonitor = new ChainMonitor(null, ret); ret_hu_conv.ptrs_to.add(chain_source); ret_hu_conv.ptrs_to.add(broadcaster); ret_hu_conv.ptrs_to.add(logger); @@ -31,14 +39,14 @@ public class ChainMonitor extends CommonBase { } public Watch as_Watch() { - uint32_t ret = bindings.ChainMonitor_as_Watch(this.ptr); + number ret = bindings.ChainMonitor_as_Watch(this.ptr); Watch ret_hu_conv = new Watch(null, ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } public EventsProvider as_EventsProvider() { - uint32_t ret = bindings.ChainMonitor_as_EventsProvider(this.ptr); + number ret = bindings.ChainMonitor_as_EventsProvider(this.ptr); EventsProvider ret_hu_conv = new EventsProvider(null, ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; diff --git a/ts/structs/ChannelAnnouncement.ts b/ts/structs/ChannelAnnouncement.ts index 14b27f44..9dc8d745 100644 --- a/ts/structs/ChannelAnnouncement.ts +++ b/ts/structs/ChannelAnnouncement.ts @@ -1,60 +1,68 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class ChannelAnnouncement extends CommonBase { - ChannelAnnouncement(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.ChannelAnnouncement_free(ptr); } - } + + export default class ChannelAnnouncement extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.ChannelAnnouncement_free(this.ptr); + } + } public ChannelAnnouncement clone() { - uint32_t ret = bindings.ChannelAnnouncement_clone(this.ptr); - ChannelAnnouncement ret_hu_conv = new ChannelAnnouncement(null, ret); + number ret = bindings.ChannelAnnouncement_clone(this.ptr); + const ret_hu_conv: ChannelAnnouncement = new ChannelAnnouncement(null, ret); return ret_hu_conv; } - public byte[] get_node_signature_1() { - byte[] ret = bindings.ChannelAnnouncement_get_node_signature_1(this.ptr); + public Uint8Array get_node_signature_1() { + Uint8Array ret = bindings.ChannelAnnouncement_get_node_signature_1(this.ptr); return ret; } - public void set_node_signature_1(byte[] val) { + public void set_node_signature_1(Uint8Array val) { bindings.ChannelAnnouncement_set_node_signature_1(this.ptr, val); } - public byte[] get_node_signature_2() { - byte[] ret = bindings.ChannelAnnouncement_get_node_signature_2(this.ptr); + public Uint8Array get_node_signature_2() { + Uint8Array ret = bindings.ChannelAnnouncement_get_node_signature_2(this.ptr); return ret; } - public void set_node_signature_2(byte[] val) { + public void set_node_signature_2(Uint8Array val) { bindings.ChannelAnnouncement_set_node_signature_2(this.ptr, val); } - public byte[] get_bitcoin_signature_1() { - byte[] ret = bindings.ChannelAnnouncement_get_bitcoin_signature_1(this.ptr); + public Uint8Array get_bitcoin_signature_1() { + Uint8Array ret = bindings.ChannelAnnouncement_get_bitcoin_signature_1(this.ptr); return ret; } - public void set_bitcoin_signature_1(byte[] val) { + public void set_bitcoin_signature_1(Uint8Array val) { bindings.ChannelAnnouncement_set_bitcoin_signature_1(this.ptr, val); } - public byte[] get_bitcoin_signature_2() { - byte[] ret = bindings.ChannelAnnouncement_get_bitcoin_signature_2(this.ptr); + public Uint8Array get_bitcoin_signature_2() { + Uint8Array ret = bindings.ChannelAnnouncement_get_bitcoin_signature_2(this.ptr); return ret; } - public void set_bitcoin_signature_2(byte[] val) { + public void set_bitcoin_signature_2(Uint8Array val) { bindings.ChannelAnnouncement_set_bitcoin_signature_2(this.ptr, val); } public UnsignedChannelAnnouncement get_contents() { - uint32_t ret = bindings.ChannelAnnouncement_get_contents(this.ptr); - UnsignedChannelAnnouncement ret_hu_conv = new UnsignedChannelAnnouncement(null, ret); + number ret = bindings.ChannelAnnouncement_get_contents(this.ptr); + const ret_hu_conv: UnsignedChannelAnnouncement = new UnsignedChannelAnnouncement(null, ret); return ret_hu_conv; } @@ -63,21 +71,21 @@ public class ChannelAnnouncement extends CommonBase { this.ptrs_to.add(val); } - public static ChannelAnnouncement constructor_new(byte[] node_signature_1_arg, byte[] node_signature_2_arg, byte[] bitcoin_signature_1_arg, byte[] bitcoin_signature_2_arg, UnsignedChannelAnnouncement contents_arg) { - uint32_t 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); - ChannelAnnouncement ret_hu_conv = new ChannelAnnouncement(null, ret); + public static ChannelAnnouncement constructor_new(Uint8Array node_signature_1_arg, Uint8Array node_signature_2_arg, Uint8Array bitcoin_signature_1_arg, Uint8Array bitcoin_signature_2_arg, UnsignedChannelAnnouncement contents_arg) { + number 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); + const ret_hu_conv: ChannelAnnouncement = new ChannelAnnouncement(null, ret); ret_hu_conv.ptrs_to.add(contents_arg); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.ChannelAnnouncement_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.ChannelAnnouncement_write(this.ptr); return ret; } - public static ChannelAnnouncement constructor_read(byte[] ser) { - uint32_t ret = bindings.ChannelAnnouncement_read(ser); - ChannelAnnouncement ret_hu_conv = new ChannelAnnouncement(null, ret); + public static ChannelAnnouncement constructor_read(Uint8Array ser) { + number ret = bindings.ChannelAnnouncement_read(ser); + const ret_hu_conv: ChannelAnnouncement = new ChannelAnnouncement(null, ret); return ret_hu_conv; } diff --git a/ts/structs/ChannelConfig.ts b/ts/structs/ChannelConfig.ts index 8f83a76e..3f07d5c9 100644 --- a/ts/structs/ChannelConfig.ts +++ b/ts/structs/ChannelConfig.ts @@ -1,27 +1,35 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class ChannelConfig extends CommonBase { - ChannelConfig(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.ChannelConfig_free(ptr); } - } + + export default class ChannelConfig extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.ChannelConfig_free(this.ptr); + } + } public ChannelConfig clone() { - uint32_t ret = bindings.ChannelConfig_clone(this.ptr); - ChannelConfig ret_hu_conv = new ChannelConfig(null, ret); + number ret = bindings.ChannelConfig_clone(this.ptr); + const ret_hu_conv: ChannelConfig = new ChannelConfig(null, ret); return ret_hu_conv; } - public int get_fee_proportional_millionths() { - int ret = bindings.ChannelConfig_get_fee_proportional_millionths(this.ptr); + public number get_fee_proportional_millionths() { + number ret = bindings.ChannelConfig_get_fee_proportional_millionths(this.ptr); return ret; } - public void set_fee_proportional_millionths(int val) { + public void set_fee_proportional_millionths(number val) { bindings.ChannelConfig_set_fee_proportional_millionths(this.ptr, val); } @@ -43,26 +51,26 @@ public class ChannelConfig extends CommonBase { bindings.ChannelConfig_set_commit_upfront_shutdown_pubkey(this.ptr, val); } - public static ChannelConfig constructor_new(int fee_proportional_millionths_arg, boolean announced_channel_arg, boolean commit_upfront_shutdown_pubkey_arg) { - uint32_t ret = bindings.ChannelConfig_new(fee_proportional_millionths_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg); - ChannelConfig ret_hu_conv = new ChannelConfig(null, ret); + public static ChannelConfig constructor_new(number fee_proportional_millionths_arg, boolean announced_channel_arg, boolean commit_upfront_shutdown_pubkey_arg) { + number ret = bindings.ChannelConfig_new(fee_proportional_millionths_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg); + const ret_hu_conv: ChannelConfig = new ChannelConfig(null, ret); return ret_hu_conv; } public static ChannelConfig constructor_default() { - uint32_t ret = bindings.ChannelConfig_default(); - ChannelConfig ret_hu_conv = new ChannelConfig(null, ret); + number ret = bindings.ChannelConfig_default(); + const ret_hu_conv: ChannelConfig = new ChannelConfig(null, ret); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.ChannelConfig_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.ChannelConfig_write(this.ptr); return ret; } - public static ChannelConfig constructor_read(byte[] ser) { - uint32_t ret = bindings.ChannelConfig_read(ser); - ChannelConfig ret_hu_conv = new ChannelConfig(null, ret); + public static ChannelConfig constructor_read(Uint8Array ser) { + number ret = bindings.ChannelConfig_read(ser); + const ret_hu_conv: ChannelConfig = new ChannelConfig(null, ret); return ret_hu_conv; } diff --git a/ts/structs/ChannelDetails.ts b/ts/structs/ChannelDetails.ts index 834430ec..3643d2a1 100644 --- a/ts/structs/ChannelDetails.ts +++ b/ts/structs/ChannelDetails.ts @@ -1,42 +1,50 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class ChannelDetails extends CommonBase { - ChannelDetails(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.ChannelDetails_free(ptr); } - } + + export default class ChannelDetails extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.ChannelDetails_free(this.ptr); + } + } public ChannelDetails clone() { - uint32_t ret = bindings.ChannelDetails_clone(this.ptr); - ChannelDetails ret_hu_conv = new ChannelDetails(null, ret); + number ret = bindings.ChannelDetails_clone(this.ptr); + const ret_hu_conv: ChannelDetails = new ChannelDetails(null, ret); return ret_hu_conv; } - public byte[] get_channel_id() { - byte[] ret = bindings.ChannelDetails_get_channel_id(this.ptr); + public Uint8Array get_channel_id() { + Uint8Array ret = bindings.ChannelDetails_get_channel_id(this.ptr); return ret; } - public void set_channel_id(byte[] val) { + public void set_channel_id(Uint8Array val) { bindings.ChannelDetails_set_channel_id(this.ptr, val); } - public byte[] get_remote_network_id() { - byte[] ret = bindings.ChannelDetails_get_remote_network_id(this.ptr); + public Uint8Array get_remote_network_id() { + Uint8Array ret = bindings.ChannelDetails_get_remote_network_id(this.ptr); return ret; } - public void set_remote_network_id(byte[] val) { + public void set_remote_network_id(Uint8Array val) { bindings.ChannelDetails_set_remote_network_id(this.ptr, val); } public InitFeatures get_counterparty_features() { - uint32_t ret = bindings.ChannelDetails_get_counterparty_features(this.ptr); - InitFeatures ret_hu_conv = new InitFeatures(null, ret); + number ret = bindings.ChannelDetails_get_counterparty_features(this.ptr); + const ret_hu_conv: InitFeatures = new InitFeatures(null, ret); return ret_hu_conv; } @@ -45,39 +53,39 @@ public class ChannelDetails extends CommonBase { this.ptrs_to.add(val); } - public long get_channel_value_satoshis() { - long ret = bindings.ChannelDetails_get_channel_value_satoshis(this.ptr); + public number get_channel_value_satoshis() { + number ret = bindings.ChannelDetails_get_channel_value_satoshis(this.ptr); return ret; } - public void set_channel_value_satoshis(long val) { + public void set_channel_value_satoshis(number val) { bindings.ChannelDetails_set_channel_value_satoshis(this.ptr, val); } - public long get_user_id() { - long ret = bindings.ChannelDetails_get_user_id(this.ptr); + public number get_user_id() { + number ret = bindings.ChannelDetails_get_user_id(this.ptr); return ret; } - public void set_user_id(long val) { + public void set_user_id(number val) { bindings.ChannelDetails_set_user_id(this.ptr, val); } - public long get_outbound_capacity_msat() { - long ret = bindings.ChannelDetails_get_outbound_capacity_msat(this.ptr); + public number get_outbound_capacity_msat() { + number ret = bindings.ChannelDetails_get_outbound_capacity_msat(this.ptr); return ret; } - public void set_outbound_capacity_msat(long val) { + public void set_outbound_capacity_msat(number val) { bindings.ChannelDetails_set_outbound_capacity_msat(this.ptr, val); } - public long get_inbound_capacity_msat() { - long ret = bindings.ChannelDetails_get_inbound_capacity_msat(this.ptr); + public number get_inbound_capacity_msat() { + number ret = bindings.ChannelDetails_get_inbound_capacity_msat(this.ptr); return ret; } - public void set_inbound_capacity_msat(long val) { + public void set_inbound_capacity_msat(number val) { bindings.ChannelDetails_set_inbound_capacity_msat(this.ptr, val); } diff --git a/ts/structs/ChannelFeatures.ts b/ts/structs/ChannelFeatures.ts index 46d2b861..c0be3bba 100644 --- a/ts/structs/ChannelFeatures.ts +++ b/ts/structs/ChannelFeatures.ts @@ -1,13 +1,21 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class ChannelFeatures extends CommonBase { - ChannelFeatures(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.ChannelFeatures_free(ptr); } - } + + export default class ChannelFeatures extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.ChannelFeatures_free(this.ptr); + } + } } diff --git a/ts/structs/ChannelHandshakeConfig.ts b/ts/structs/ChannelHandshakeConfig.ts index f37c057f..96cb4d85 100644 --- a/ts/structs/ChannelHandshakeConfig.ts +++ b/ts/structs/ChannelHandshakeConfig.ts @@ -1,57 +1,65 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class ChannelHandshakeConfig extends CommonBase { - ChannelHandshakeConfig(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.ChannelHandshakeConfig_free(ptr); } - } + + export default class ChannelHandshakeConfig extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.ChannelHandshakeConfig_free(this.ptr); + } + } public ChannelHandshakeConfig clone() { - uint32_t ret = bindings.ChannelHandshakeConfig_clone(this.ptr); - ChannelHandshakeConfig ret_hu_conv = new ChannelHandshakeConfig(null, ret); + number ret = bindings.ChannelHandshakeConfig_clone(this.ptr); + const ret_hu_conv: ChannelHandshakeConfig = new ChannelHandshakeConfig(null, ret); return ret_hu_conv; } - public int get_minimum_depth() { - int ret = bindings.ChannelHandshakeConfig_get_minimum_depth(this.ptr); + public number get_minimum_depth() { + number ret = bindings.ChannelHandshakeConfig_get_minimum_depth(this.ptr); return ret; } - public void set_minimum_depth(int val) { + public void set_minimum_depth(number val) { bindings.ChannelHandshakeConfig_set_minimum_depth(this.ptr, val); } - public short get_our_to_self_delay() { - short ret = bindings.ChannelHandshakeConfig_get_our_to_self_delay(this.ptr); + public number get_our_to_self_delay() { + number ret = bindings.ChannelHandshakeConfig_get_our_to_self_delay(this.ptr); return ret; } - public void set_our_to_self_delay(short val) { + public void set_our_to_self_delay(number val) { bindings.ChannelHandshakeConfig_set_our_to_self_delay(this.ptr, val); } - public long get_our_htlc_minimum_msat() { - long ret = bindings.ChannelHandshakeConfig_get_our_htlc_minimum_msat(this.ptr); + public number get_our_htlc_minimum_msat() { + number ret = bindings.ChannelHandshakeConfig_get_our_htlc_minimum_msat(this.ptr); return ret; } - public void set_our_htlc_minimum_msat(long val) { + public void set_our_htlc_minimum_msat(number val) { bindings.ChannelHandshakeConfig_set_our_htlc_minimum_msat(this.ptr, val); } - public static ChannelHandshakeConfig constructor_new(int minimum_depth_arg, short our_to_self_delay_arg, long our_htlc_minimum_msat_arg) { - uint32_t ret = bindings.ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg); - ChannelHandshakeConfig ret_hu_conv = new ChannelHandshakeConfig(null, ret); + public static ChannelHandshakeConfig constructor_new(number minimum_depth_arg, number our_to_self_delay_arg, number our_htlc_minimum_msat_arg) { + number ret = bindings.ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg); + const ret_hu_conv: ChannelHandshakeConfig = new ChannelHandshakeConfig(null, ret); return ret_hu_conv; } public static ChannelHandshakeConfig constructor_default() { - uint32_t ret = bindings.ChannelHandshakeConfig_default(); - ChannelHandshakeConfig ret_hu_conv = new ChannelHandshakeConfig(null, ret); + number ret = bindings.ChannelHandshakeConfig_default(); + const ret_hu_conv: ChannelHandshakeConfig = new ChannelHandshakeConfig(null, ret); return ret_hu_conv; } diff --git a/ts/structs/ChannelHandshakeLimits.ts b/ts/structs/ChannelHandshakeLimits.ts index 894b7346..c65a6294 100644 --- a/ts/structs/ChannelHandshakeLimits.ts +++ b/ts/structs/ChannelHandshakeLimits.ts @@ -1,90 +1,98 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class ChannelHandshakeLimits extends CommonBase { - ChannelHandshakeLimits(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.ChannelHandshakeLimits_free(ptr); } - } + + export default class ChannelHandshakeLimits extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.ChannelHandshakeLimits_free(this.ptr); + } + } public ChannelHandshakeLimits clone() { - uint32_t ret = bindings.ChannelHandshakeLimits_clone(this.ptr); - ChannelHandshakeLimits ret_hu_conv = new ChannelHandshakeLimits(null, ret); + number ret = bindings.ChannelHandshakeLimits_clone(this.ptr); + const ret_hu_conv: ChannelHandshakeLimits = new ChannelHandshakeLimits(null, ret); return ret_hu_conv; } - public long get_min_funding_satoshis() { - long ret = bindings.ChannelHandshakeLimits_get_min_funding_satoshis(this.ptr); + public number get_min_funding_satoshis() { + number ret = bindings.ChannelHandshakeLimits_get_min_funding_satoshis(this.ptr); return ret; } - public void set_min_funding_satoshis(long val) { + public void set_min_funding_satoshis(number val) { bindings.ChannelHandshakeLimits_set_min_funding_satoshis(this.ptr, val); } - public long get_max_htlc_minimum_msat() { - long ret = bindings.ChannelHandshakeLimits_get_max_htlc_minimum_msat(this.ptr); + public number get_max_htlc_minimum_msat() { + number ret = bindings.ChannelHandshakeLimits_get_max_htlc_minimum_msat(this.ptr); return ret; } - public void set_max_htlc_minimum_msat(long val) { + public void set_max_htlc_minimum_msat(number val) { bindings.ChannelHandshakeLimits_set_max_htlc_minimum_msat(this.ptr, val); } - public long get_min_max_htlc_value_in_flight_msat() { - long ret = bindings.ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(this.ptr); + public number get_min_max_htlc_value_in_flight_msat() { + number ret = bindings.ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(this.ptr); return ret; } - public void set_min_max_htlc_value_in_flight_msat(long val) { + public void set_min_max_htlc_value_in_flight_msat(number val) { bindings.ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(this.ptr, val); } - public long get_max_channel_reserve_satoshis() { - long ret = bindings.ChannelHandshakeLimits_get_max_channel_reserve_satoshis(this.ptr); + public number get_max_channel_reserve_satoshis() { + number ret = bindings.ChannelHandshakeLimits_get_max_channel_reserve_satoshis(this.ptr); return ret; } - public void set_max_channel_reserve_satoshis(long val) { + public void set_max_channel_reserve_satoshis(number val) { bindings.ChannelHandshakeLimits_set_max_channel_reserve_satoshis(this.ptr, val); } - public short get_min_max_accepted_htlcs() { - short ret = bindings.ChannelHandshakeLimits_get_min_max_accepted_htlcs(this.ptr); + public number get_min_max_accepted_htlcs() { + number ret = bindings.ChannelHandshakeLimits_get_min_max_accepted_htlcs(this.ptr); return ret; } - public void set_min_max_accepted_htlcs(short val) { + public void set_min_max_accepted_htlcs(number val) { bindings.ChannelHandshakeLimits_set_min_max_accepted_htlcs(this.ptr, val); } - public long get_min_dust_limit_satoshis() { - long ret = bindings.ChannelHandshakeLimits_get_min_dust_limit_satoshis(this.ptr); + public number get_min_dust_limit_satoshis() { + number ret = bindings.ChannelHandshakeLimits_get_min_dust_limit_satoshis(this.ptr); return ret; } - public void set_min_dust_limit_satoshis(long val) { + public void set_min_dust_limit_satoshis(number val) { bindings.ChannelHandshakeLimits_set_min_dust_limit_satoshis(this.ptr, val); } - public long get_max_dust_limit_satoshis() { - long ret = bindings.ChannelHandshakeLimits_get_max_dust_limit_satoshis(this.ptr); + public number get_max_dust_limit_satoshis() { + number ret = bindings.ChannelHandshakeLimits_get_max_dust_limit_satoshis(this.ptr); return ret; } - public void set_max_dust_limit_satoshis(long val) { + public void set_max_dust_limit_satoshis(number val) { bindings.ChannelHandshakeLimits_set_max_dust_limit_satoshis(this.ptr, val); } - public int get_max_minimum_depth() { - int ret = bindings.ChannelHandshakeLimits_get_max_minimum_depth(this.ptr); + public number get_max_minimum_depth() { + number ret = bindings.ChannelHandshakeLimits_get_max_minimum_depth(this.ptr); return ret; } - public void set_max_minimum_depth(int val) { + public void set_max_minimum_depth(number val) { bindings.ChannelHandshakeLimits_set_max_minimum_depth(this.ptr, val); } @@ -97,24 +105,24 @@ public class ChannelHandshakeLimits extends CommonBase { bindings.ChannelHandshakeLimits_set_force_announced_channel_preference(this.ptr, val); } - public short get_their_to_self_delay() { - short ret = bindings.ChannelHandshakeLimits_get_their_to_self_delay(this.ptr); + public number get_their_to_self_delay() { + number ret = bindings.ChannelHandshakeLimits_get_their_to_self_delay(this.ptr); return ret; } - public void set_their_to_self_delay(short val) { + public void set_their_to_self_delay(number val) { bindings.ChannelHandshakeLimits_set_their_to_self_delay(this.ptr, val); } - public static ChannelHandshakeLimits constructor_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) { - uint32_t 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, min_dust_limit_satoshis_arg, max_dust_limit_satoshis_arg, max_minimum_depth_arg, force_announced_channel_preference_arg, their_to_self_delay_arg); - ChannelHandshakeLimits ret_hu_conv = new ChannelHandshakeLimits(null, ret); + public static ChannelHandshakeLimits constructor_new(number min_funding_satoshis_arg, number max_htlc_minimum_msat_arg, number min_max_htlc_value_in_flight_msat_arg, number max_channel_reserve_satoshis_arg, number min_max_accepted_htlcs_arg, number min_dust_limit_satoshis_arg, number max_dust_limit_satoshis_arg, number max_minimum_depth_arg, boolean force_announced_channel_preference_arg, number their_to_self_delay_arg) { + number 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, min_dust_limit_satoshis_arg, max_dust_limit_satoshis_arg, max_minimum_depth_arg, force_announced_channel_preference_arg, their_to_self_delay_arg); + const ret_hu_conv: ChannelHandshakeLimits = new ChannelHandshakeLimits(null, ret); return ret_hu_conv; } public static ChannelHandshakeLimits constructor_default() { - uint32_t ret = bindings.ChannelHandshakeLimits_default(); - ChannelHandshakeLimits ret_hu_conv = new ChannelHandshakeLimits(null, ret); + number ret = bindings.ChannelHandshakeLimits_default(); + const ret_hu_conv: ChannelHandshakeLimits = new ChannelHandshakeLimits(null, ret); return ret_hu_conv; } diff --git a/ts/structs/ChannelInfo.ts b/ts/structs/ChannelInfo.ts index 4aaf250b..cbbdfba1 100644 --- a/ts/structs/ChannelInfo.ts +++ b/ts/structs/ChannelInfo.ts @@ -1,18 +1,26 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class ChannelInfo extends CommonBase { - ChannelInfo(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.ChannelInfo_free(ptr); } - } + + export default class ChannelInfo extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.ChannelInfo_free(this.ptr); + } + } public ChannelFeatures get_features() { - uint32_t ret = bindings.ChannelInfo_get_features(this.ptr); - ChannelFeatures ret_hu_conv = new ChannelFeatures(null, ret); + number ret = bindings.ChannelInfo_get_features(this.ptr); + const ret_hu_conv: ChannelFeatures = new ChannelFeatures(null, ret); return ret_hu_conv; } @@ -21,18 +29,18 @@ public class ChannelInfo extends CommonBase { this.ptrs_to.add(val); } - public byte[] get_node_one() { - byte[] ret = bindings.ChannelInfo_get_node_one(this.ptr); + public Uint8Array get_node_one() { + Uint8Array ret = bindings.ChannelInfo_get_node_one(this.ptr); return ret; } - public void set_node_one(byte[] val) { + public void set_node_one(Uint8Array val) { bindings.ChannelInfo_set_node_one(this.ptr, val); } public DirectionalChannelInfo get_one_to_two() { - uint32_t ret = bindings.ChannelInfo_get_one_to_two(this.ptr); - DirectionalChannelInfo ret_hu_conv = new DirectionalChannelInfo(null, ret); + number ret = bindings.ChannelInfo_get_one_to_two(this.ptr); + const ret_hu_conv: DirectionalChannelInfo = new DirectionalChannelInfo(null, ret); return ret_hu_conv; } @@ -41,18 +49,18 @@ public class ChannelInfo extends CommonBase { this.ptrs_to.add(val); } - public byte[] get_node_two() { - byte[] ret = bindings.ChannelInfo_get_node_two(this.ptr); + public Uint8Array get_node_two() { + Uint8Array ret = bindings.ChannelInfo_get_node_two(this.ptr); return ret; } - public void set_node_two(byte[] val) { + public void set_node_two(Uint8Array val) { bindings.ChannelInfo_set_node_two(this.ptr, val); } public DirectionalChannelInfo get_two_to_one() { - uint32_t ret = bindings.ChannelInfo_get_two_to_one(this.ptr); - DirectionalChannelInfo ret_hu_conv = new DirectionalChannelInfo(null, ret); + number ret = bindings.ChannelInfo_get_two_to_one(this.ptr); + const ret_hu_conv: DirectionalChannelInfo = new DirectionalChannelInfo(null, ret); return ret_hu_conv; } @@ -62,8 +70,8 @@ public class ChannelInfo extends CommonBase { } public ChannelAnnouncement get_announcement_message() { - uint32_t ret = bindings.ChannelInfo_get_announcement_message(this.ptr); - ChannelAnnouncement ret_hu_conv = new ChannelAnnouncement(null, ret); + number ret = bindings.ChannelInfo_get_announcement_message(this.ptr); + const ret_hu_conv: ChannelAnnouncement = new ChannelAnnouncement(null, ret); return ret_hu_conv; } @@ -72,14 +80,14 @@ public class ChannelInfo extends CommonBase { this.ptrs_to.add(val); } - public byte[] write() { - byte[] ret = bindings.ChannelInfo_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.ChannelInfo_write(this.ptr); return ret; } - public static ChannelInfo constructor_read(byte[] ser) { - uint32_t ret = bindings.ChannelInfo_read(ser); - ChannelInfo ret_hu_conv = new ChannelInfo(null, ret); + public static ChannelInfo constructor_read(Uint8Array ser) { + number ret = bindings.ChannelInfo_read(ser); + const ret_hu_conv: ChannelInfo = new ChannelInfo(null, ret); return ret_hu_conv; } diff --git a/ts/structs/ChannelKeys.ts b/ts/structs/ChannelKeys.ts index 600fe24f..746ff660 100644 --- a/ts/structs/ChannelKeys.ts +++ b/ts/structs/ChannelKeys.ts @@ -1,64 +1,198 @@ - public byte[] get_per_commitment_point(long idx) { - byte[] ret = bindings.ChannelKeys_get_per_commitment_point(this.ptr, idx); + + +import CommonBase from './CommonBase'; +import * as bindings from '../bindings' // TODO: figure out location + + + + export class ChannelKeys extends CommonBase { + + bindings_instance?: bindings.LDKChannelKeys; + + constructor(ptr?: number, arg?: bindings.LDKChannelKeys, pubkeys?: ChannelPublicKeys) { + if (Number.isFinite(ptr)) { + super(ptr); + this.bindings_instance = null; + } else { + // TODO: private constructor instantiation + super(bindings.LDKChannelKeys_new(arg, pubkeys == null ? 0 : pubkeys.ptr & ~1)); + this.ptrs_to.push(arg); + this.ptrs_to.add(pubkeys); + + } + } + + protected finalize() { + if (this.ptr != 0) { + bindings.ChannelKeys_free(this.ptr); + } + super.finalize(); + } + + static new_impl(arg: ChannelKeysInterface, pubkeys: ChannelPublicKeys): ChannelKeys { + const impl_holder: LDKChannelKeysHolder = new LDKChannelKeysHolder(); + let structImplementation = { + // todo: in-line interface filling + get_per_commitment_point (idx: number): Uint8Array { + Uint8Array ret = arg.get_per_commitment_point(idx); + return ret; + }, + + release_commitment_secret (idx: number): Uint8Array { + Uint8Array ret = arg.release_commitment_secret(idx); + return ret; + }, + + key_derivation_params (): number { + TwoTuple ret = arg.key_derivation_params(); + result: number = bindings.C2Tuple_u64u64Z_new(ret.a, ret.b); + return result; + }, + + sign_counterparty_commitment (commitment_tx: number): number { + const commitment_tx_hu_conv: CommitmentTransaction = new CommitmentTransaction(null, commitment_tx); + Result_C2Tuple_SignatureCVec_SignatureZZNoneZ ret = arg.sign_counterparty_commitment(commitment_tx_hu_conv); + result: number = ret != null ? ret.ptr : 0; + return result; + }, + + sign_holder_commitment (commitment_tx: number): number { + const commitment_tx_hu_conv: HolderCommitmentTransaction = new HolderCommitmentTransaction(null, commitment_tx); + Result_SignatureNoneZ ret = arg.sign_holder_commitment(commitment_tx_hu_conv); + result: number = ret != null ? ret.ptr : 0; + return result; + }, + + sign_holder_commitment_htlc_transactions (commitment_tx: number): number { + const commitment_tx_hu_conv: HolderCommitmentTransaction = new HolderCommitmentTransaction(null, commitment_tx); + Result_CVec_SignatureZNoneZ ret = arg.sign_holder_commitment_htlc_transactions(commitment_tx_hu_conv); + result: number = ret != null ? ret.ptr : 0; + return result; + }, + + sign_justice_transaction (justice_tx: Uint8Array, input: number, amount: number, per_commitment_key: Uint8Array, htlc: number): number { + const htlc_hu_conv: HTLCOutputInCommitment = new HTLCOutputInCommitment(null, htlc); + Result_SignatureNoneZ ret = arg.sign_justice_transaction(justice_tx, input, amount, per_commitment_key, htlc_hu_conv); + result: number = ret != null ? ret.ptr : 0; + return result; + }, + + sign_counterparty_htlc_transaction (htlc_tx: Uint8Array, input: number, amount: number, per_commitment_point: Uint8Array, htlc: number): number { + const htlc_hu_conv: HTLCOutputInCommitment = new HTLCOutputInCommitment(null, htlc); + Result_SignatureNoneZ ret = arg.sign_counterparty_htlc_transaction(htlc_tx, input, amount, per_commitment_point, htlc_hu_conv); + result: number = ret != null ? ret.ptr : 0; + return result; + }, + + sign_closing_transaction (closing_tx: Uint8Array): number { + Result_SignatureNoneZ ret = arg.sign_closing_transaction(closing_tx); + result: number = ret != null ? ret.ptr : 0; + return result; + }, + + sign_channel_announcement (msg: number): number { + const msg_hu_conv: UnsignedChannelAnnouncement = new UnsignedChannelAnnouncement(null, msg); + Result_SignatureNoneZ ret = arg.sign_channel_announcement(msg_hu_conv); + result: number = ret != null ? ret.ptr : 0; + return result; + }, + + ready_channel (channel_parameters: number): void { + const channel_parameters_hu_conv: ChannelTransactionParameters = new ChannelTransactionParameters(null, channel_parameters); + arg.ready_channel(channel_parameters_hu_conv); + }, + + write (): Uint8Array { + Uint8Array ret = arg.write(); + return ret; + }, + + + }; + impl_holder.held = new ChannelKeys (null, structImplementation, pubkeys); + } + } + + export interface ChannelKeysInterface { + get_per_commitment_point(idx: number): Uint8Array; + release_commitment_secret(idx: number): Uint8Array; + key_derivation_params(): TwoTuple; + sign_counterparty_commitment(commitment_tx: CommitmentTransaction): Result_C2Tuple_SignatureCVec_SignatureZZNoneZ; + sign_holder_commitment(commitment_tx: HolderCommitmentTransaction): Result_SignatureNoneZ; + sign_holder_commitment_htlc_transactions(commitment_tx: HolderCommitmentTransaction): Result_CVec_SignatureZNoneZ; + sign_justice_transaction(justice_tx: Uint8Array, input: number, amount: number, per_commitment_key: Uint8Array, htlc: HTLCOutputInCommitment): Result_SignatureNoneZ; + sign_counterparty_htlc_transaction(htlc_tx: Uint8Array, input: number, amount: number, per_commitment_point: Uint8Array, htlc: HTLCOutputInCommitment): Result_SignatureNoneZ; + sign_closing_transaction(closing_tx: Uint8Array): Result_SignatureNoneZ; + sign_channel_announcement(msg: UnsignedChannelAnnouncement): Result_SignatureNoneZ; + ready_channel(channel_parameters: ChannelTransactionParameters): void; + write(): Uint8Array; + + } + + class LDKChannelKeysHolder { + held: ChannelKeys; + } + public Uint8Array get_per_commitment_point(number idx) { + Uint8Array ret = bindings.ChannelKeys_get_per_commitment_point(this.ptr, idx); return ret; } - public byte[] release_commitment_secret(long idx) { - byte[] ret = bindings.ChannelKeys_release_commitment_secret(this.ptr, idx); + public Uint8Array release_commitment_secret(number idx) { + Uint8Array ret = bindings.ChannelKeys_release_commitment_secret(this.ptr, idx); return ret; } - public TwoTuple key_derivation_params() { - uint32_t ret = bindings.ChannelKeys_key_derivation_params(this.ptr); - long ret_a = bindings.LDKC2Tuple_u64u64Z_get_a(ret); - long ret_b = bindings.LDKC2Tuple_u64u64Z_get_b(ret); - TwoTuple ret_conv = new TwoTuple(ret_a, ret_b); + public TwoTuple key_derivation_params() { + number ret = bindings.ChannelKeys_key_derivation_params(this.ptr); + number ret_a = bindings.LDKC2Tuple_u64u64Z_get_a(ret); + number ret_b = bindings.LDKC2Tuple_u64u64Z_get_b(ret); + TwoTuple ret_conv = new TwoTuple(ret_a, ret_b); return ret_conv; } public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment(CommitmentTransaction commitment_tx) { - uint32_t ret = bindings.ChannelKeys_sign_counterparty_commitment(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr & ~1); + number ret = bindings.ChannelKeys_sign_counterparty_commitment(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr & ~1); 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; } public Result_SignatureNoneZ sign_holder_commitment(HolderCommitmentTransaction commitment_tx) { - uint32_t ret = bindings.ChannelKeys_sign_holder_commitment(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr & ~1); + number ret = bindings.ChannelKeys_sign_holder_commitment(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr & ~1); Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); this.ptrs_to.add(commitment_tx); return ret_hu_conv; } public Result_CVec_SignatureZNoneZ sign_holder_commitment_htlc_transactions(HolderCommitmentTransaction commitment_tx) { - uint32_t ret = bindings.ChannelKeys_sign_holder_commitment_htlc_transactions(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr & ~1); + number ret = bindings.ChannelKeys_sign_holder_commitment_htlc_transactions(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr & ~1); Result_CVec_SignatureZNoneZ ret_hu_conv = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret); this.ptrs_to.add(commitment_tx); return ret_hu_conv; } - public Result_SignatureNoneZ sign_justice_transaction(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, HTLCOutputInCommitment htlc) { - uint32_t ret = bindings.ChannelKeys_sign_justice_transaction(this.ptr, justice_tx, input, amount, per_commitment_key, htlc == null ? 0 : htlc.ptr & ~1); + public Result_SignatureNoneZ sign_justice_transaction(Uint8Array justice_tx, number input, number amount, Uint8Array per_commitment_key, HTLCOutputInCommitment htlc) { + number ret = bindings.ChannelKeys_sign_justice_transaction(this.ptr, justice_tx, input, amount, per_commitment_key, htlc == null ? 0 : htlc.ptr & ~1); Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); this.ptrs_to.add(htlc); return ret_hu_conv; } - public Result_SignatureNoneZ sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, HTLCOutputInCommitment htlc) { - uint32_t ret = bindings.ChannelKeys_sign_counterparty_htlc_transaction(this.ptr, htlc_tx, input, amount, per_commitment_point, htlc == null ? 0 : htlc.ptr & ~1); + public Result_SignatureNoneZ sign_counterparty_htlc_transaction(Uint8Array htlc_tx, number input, number amount, Uint8Array per_commitment_point, HTLCOutputInCommitment htlc) { + number ret = bindings.ChannelKeys_sign_counterparty_htlc_transaction(this.ptr, htlc_tx, input, amount, per_commitment_point, htlc == null ? 0 : htlc.ptr & ~1); Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); this.ptrs_to.add(htlc); return ret_hu_conv; } - public Result_SignatureNoneZ sign_closing_transaction(byte[] closing_tx) { - uint32_t ret = bindings.ChannelKeys_sign_closing_transaction(this.ptr, closing_tx); + public Result_SignatureNoneZ sign_closing_transaction(Uint8Array closing_tx) { + number ret = bindings.ChannelKeys_sign_closing_transaction(this.ptr, closing_tx); Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); return ret_hu_conv; } public Result_SignatureNoneZ sign_channel_announcement(UnsignedChannelAnnouncement msg) { - uint32_t ret = bindings.ChannelKeys_sign_channel_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1); + number ret = bindings.ChannelKeys_sign_channel_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1); Result_SignatureNoneZ ret_hu_conv = Result_SignatureNoneZ.constr_from_ptr(ret); this.ptrs_to.add(msg); return ret_hu_conv; @@ -69,19 +203,19 @@ this.ptrs_to.add(channel_parameters); } - public byte[] write() { - byte[] ret = bindings.ChannelKeys_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.ChannelKeys_write(this.ptr); return ret; } public ChannelPublicKeys get_pubkeys() { - uint32_t ret = bindings.ChannelKeys_get_pubkeys(this.ptr); - ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret); + number ret = bindings.ChannelKeys_get_pubkeys(this.ptr); + const ret_hu_conv: ChannelPublicKeys = new ChannelPublicKeys(null, ret); return ret_hu_conv; } public ChannelKeys clone() { - uint32_t ret = bindings.ChannelKeys_clone(this.ptr); + number ret = bindings.ChannelKeys_clone(this.ptr); ChannelKeys ret_hu_conv = new ChannelKeys(null, ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; diff --git a/ts/structs/ChannelManager.ts b/ts/structs/ChannelManager.ts index 2908997b..226c9c9e 100644 --- a/ts/structs/ChannelManager.ts +++ b/ts/structs/ChannelManager.ts @@ -1,18 +1,26 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class ChannelManager extends CommonBase { - ChannelManager(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.ChannelManager_free(ptr); } - } - public static ChannelManager constructor_new(LDKNetwork network, FeeEstimator fee_est, Watch chain_monitor, BroadcasterInterface tx_broadcaster, Logger logger, KeysInterface keys_manager, UserConfig config, long current_blockchain_height) { - uint32_t ret = bindings.ChannelManager_new(network, 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, current_blockchain_height); - ChannelManager ret_hu_conv = new ChannelManager(null, ret); + + export default class ChannelManager extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.ChannelManager_free(this.ptr); + } + } + public static ChannelManager constructor_new(LDKNetwork network, FeeEstimator fee_est, Watch chain_monitor, BroadcasterInterface tx_broadcaster, Logger logger, KeysInterface keys_manager, UserConfig config, number current_blockchain_height) { + number ret = bindings.ChannelManager_new(network, 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, current_blockchain_height); + const ret_hu_conv: ChannelManager = new ChannelManager(null, ret); ret_hu_conv.ptrs_to.add(fee_est); ret_hu_conv.ptrs_to.add(chain_monitor); ret_hu_conv.ptrs_to.add(tx_broadcaster); @@ -22,42 +30,42 @@ public class ChannelManager extends CommonBase { return ret_hu_conv; } - public Result_NoneAPIErrorZ create_channel(byte[] their_network_key, long channel_value_satoshis, long push_msat, long user_id, UserConfig override_config) { - uint32_t 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); + public Result_NoneAPIErrorZ create_channel(Uint8Array their_network_key, number channel_value_satoshis, number push_msat, number user_id, UserConfig override_config) { + number 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); Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); this.ptrs_to.add(override_config); return ret_hu_conv; } public ChannelDetails[] list_channels() { - uint32_t[] ret = bindings.ChannelManager_list_channels(this.ptr); + number[] ret = bindings.ChannelManager_list_channels(this.ptr); ChannelDetails[] arr_conv_16_arr = new ChannelDetails[ret.length]; for (int q = 0; q < ret.length; q++) { - uint32_t arr_conv_16 = ret[q]; - ChannelDetails arr_conv_16_hu_conv = new ChannelDetails(null, arr_conv_16); + number arr_conv_16 = ret[q]; + const arr_conv_16_hu_conv: ChannelDetails = new ChannelDetails(null, arr_conv_16); arr_conv_16_arr[q] = arr_conv_16_hu_conv; } return arr_conv_16_arr; } public ChannelDetails[] list_usable_channels() { - uint32_t[] ret = bindings.ChannelManager_list_usable_channels(this.ptr); + number[] ret = bindings.ChannelManager_list_usable_channels(this.ptr); ChannelDetails[] arr_conv_16_arr = new ChannelDetails[ret.length]; for (int q = 0; q < ret.length; q++) { - uint32_t arr_conv_16 = ret[q]; - ChannelDetails arr_conv_16_hu_conv = new ChannelDetails(null, arr_conv_16); + number arr_conv_16 = ret[q]; + const arr_conv_16_hu_conv: ChannelDetails = new ChannelDetails(null, arr_conv_16); arr_conv_16_arr[q] = arr_conv_16_hu_conv; } return arr_conv_16_arr; } - public Result_NoneAPIErrorZ close_channel(byte[] channel_id) { - uint32_t ret = bindings.ChannelManager_close_channel(this.ptr, channel_id); + public Result_NoneAPIErrorZ close_channel(Uint8Array channel_id) { + number ret = bindings.ChannelManager_close_channel(this.ptr, channel_id); Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); return ret_hu_conv; } - public void force_close_channel(byte[] channel_id) { + public void force_close_channel(Uint8Array channel_id) { bindings.ChannelManager_force_close_channel(this.ptr, channel_id); } @@ -65,20 +73,20 @@ public class ChannelManager extends CommonBase { bindings.ChannelManager_force_close_all_channels(this.ptr); } - public Result_NonePaymentSendFailureZ send_payment(Route route, byte[] payment_hash, byte[] payment_secret) { - uint32_t ret = bindings.ChannelManager_send_payment(this.ptr, route == null ? 0 : route.ptr & ~1, payment_hash, payment_secret); + public Result_NonePaymentSendFailureZ send_payment(Route route, Uint8Array payment_hash, Uint8Array payment_secret) { + number ret = bindings.ChannelManager_send_payment(this.ptr, route == null ? 0 : route.ptr & ~1, payment_hash, payment_secret); Result_NonePaymentSendFailureZ ret_hu_conv = Result_NonePaymentSendFailureZ.constr_from_ptr(ret); this.ptrs_to.add(route); return ret_hu_conv; } - public void funding_transaction_generated(byte[] temporary_channel_id, OutPoint funding_txo) { + public void funding_transaction_generated(Uint8Array temporary_channel_id, OutPoint funding_txo) { bindings.ChannelManager_funding_transaction_generated(this.ptr, temporary_channel_id, funding_txo == null ? 0 : funding_txo.ptr & ~1); this.ptrs_to.add(funding_txo); } - public void broadcast_node_announcement(byte[] rgb, byte[] alias, NetAddress[] addresses) { - bindings.ChannelManager_broadcast_node_announcement(this.ptr, rgb, alias, (uint32_t[])Arrays.stream(addresses).map(arr_conv_12 -> arr_conv_12.ptr).toArray()); + public void broadcast_node_announcement(Uint8Array rgb, Uint8Array alias, NetAddress[] addresses) { + bindings.ChannelManager_broadcast_node_announcement(this.ptr, rgb, alias, (number[])Arrays.stream(addresses).map(arr_conv_12 -> arr_conv_12.ptr).toArray()); /* TODO 2 NetAddress */; } @@ -90,58 +98,58 @@ public class ChannelManager extends CommonBase { bindings.ChannelManager_timer_chan_freshness_every_min(this.ptr); } - public boolean fail_htlc_backwards(byte[] payment_hash, byte[] payment_secret) { + public boolean fail_htlc_backwards(Uint8Array payment_hash, Uint8Array payment_secret) { boolean ret = bindings.ChannelManager_fail_htlc_backwards(this.ptr, payment_hash, payment_secret); return ret; } - public boolean claim_funds(byte[] payment_preimage, byte[] payment_secret, long expected_amount) { + public boolean claim_funds(Uint8Array payment_preimage, Uint8Array payment_secret, number expected_amount) { boolean ret = bindings.ChannelManager_claim_funds(this.ptr, payment_preimage, payment_secret, expected_amount); return ret; } - public byte[] get_our_node_id() { - byte[] ret = bindings.ChannelManager_get_our_node_id(this.ptr); + public Uint8Array get_our_node_id() { + Uint8Array ret = bindings.ChannelManager_get_our_node_id(this.ptr); return ret; } - public void channel_monitor_updated(OutPoint funding_txo, long highest_applied_update_id) { + public void channel_monitor_updated(OutPoint funding_txo, number highest_applied_update_id) { bindings.ChannelManager_channel_monitor_updated(this.ptr, funding_txo == null ? 0 : funding_txo.ptr & ~1, highest_applied_update_id); this.ptrs_to.add(funding_txo); } public MessageSendEventsProvider as_MessageSendEventsProvider() { - uint32_t ret = bindings.ChannelManager_as_MessageSendEventsProvider(this.ptr); + number ret = bindings.ChannelManager_as_MessageSendEventsProvider(this.ptr); MessageSendEventsProvider ret_hu_conv = new MessageSendEventsProvider(null, ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } public EventsProvider as_EventsProvider() { - uint32_t ret = bindings.ChannelManager_as_EventsProvider(this.ptr); + number ret = bindings.ChannelManager_as_EventsProvider(this.ptr); EventsProvider ret_hu_conv = new EventsProvider(null, ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } - public void block_connected(byte[] header, TwoTuple[] txdata, int height) { - bindings.ChannelManager_block_connected(this.ptr, header, (uint32_t[])Arrays.stream(txdata).map(arr_conv_24 -> bindings.C2Tuple_usizeTransactionZ_new(arr_conv_24.a, arr_conv_24.b)).toArray(), height); - /* TODO 2 TwoTuple */; + public void block_connected(Uint8Array header, TwoTuple[] txdata, number height) { + bindings.ChannelManager_block_connected(this.ptr, header, (number[])Arrays.stream(txdata).map(arr_conv_30 -> bindings.C2Tuple_usizeTransactionZ_new(arr_conv_30.a, arr_conv_30.b)).toArray(), height); + /* TODO 2 TwoTuple */; } - public void block_disconnected(byte[] header) { + public void block_disconnected(Uint8Array header) { bindings.ChannelManager_block_disconnected(this.ptr, header); } public ChannelMessageHandler as_ChannelMessageHandler() { - uint32_t ret = bindings.ChannelManager_as_ChannelMessageHandler(this.ptr); + number ret = bindings.ChannelManager_as_ChannelMessageHandler(this.ptr); ChannelMessageHandler ret_hu_conv = new ChannelMessageHandler(null, ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.ChannelManager_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.ChannelManager_write(this.ptr); return ret; } diff --git a/ts/structs/ChannelManagerReadArgs.ts b/ts/structs/ChannelManagerReadArgs.ts index b80f282e..d270a462 100644 --- a/ts/structs/ChannelManagerReadArgs.ts +++ b/ts/structs/ChannelManagerReadArgs.ts @@ -1,17 +1,25 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class ChannelManagerReadArgs extends CommonBase { - ChannelManagerReadArgs(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.ChannelManagerReadArgs_free(ptr); } - } + + export default class ChannelManagerReadArgs extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.ChannelManagerReadArgs_free(this.ptr); + } + } public KeysInterface get_keys_manager() { - uint32_t ret = bindings.ChannelManagerReadArgs_get_keys_manager(this.ptr); + number ret = bindings.ChannelManagerReadArgs_get_keys_manager(this.ptr); KeysInterface ret_hu_conv = new KeysInterface(null, ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; @@ -23,7 +31,7 @@ public class ChannelManagerReadArgs extends CommonBase { } public FeeEstimator get_fee_estimator() { - uint32_t ret = bindings.ChannelManagerReadArgs_get_fee_estimator(this.ptr); + number ret = bindings.ChannelManagerReadArgs_get_fee_estimator(this.ptr); FeeEstimator ret_hu_conv = new FeeEstimator(null, ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; @@ -35,7 +43,7 @@ public class ChannelManagerReadArgs extends CommonBase { } public Watch get_chain_monitor() { - uint32_t ret = bindings.ChannelManagerReadArgs_get_chain_monitor(this.ptr); + number ret = bindings.ChannelManagerReadArgs_get_chain_monitor(this.ptr); Watch ret_hu_conv = new Watch(null, ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; @@ -47,7 +55,7 @@ public class ChannelManagerReadArgs extends CommonBase { } public BroadcasterInterface get_tx_broadcaster() { - uint32_t ret = bindings.ChannelManagerReadArgs_get_tx_broadcaster(this.ptr); + number ret = bindings.ChannelManagerReadArgs_get_tx_broadcaster(this.ptr); BroadcasterInterface ret_hu_conv = new BroadcasterInterface(null, ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; @@ -59,7 +67,7 @@ public class ChannelManagerReadArgs extends CommonBase { } public Logger get_logger() { - uint32_t ret = bindings.ChannelManagerReadArgs_get_logger(this.ptr); + number ret = bindings.ChannelManagerReadArgs_get_logger(this.ptr); Logger ret_hu_conv = new Logger(null, ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; @@ -71,8 +79,8 @@ public class ChannelManagerReadArgs extends CommonBase { } public UserConfig get_default_config() { - uint32_t ret = bindings.ChannelManagerReadArgs_get_default_config(this.ptr); - UserConfig ret_hu_conv = new UserConfig(null, ret); + number ret = bindings.ChannelManagerReadArgs_get_default_config(this.ptr); + const ret_hu_conv: UserConfig = new UserConfig(null, ret); return ret_hu_conv; } @@ -82,8 +90,8 @@ public class ChannelManagerReadArgs extends CommonBase { } 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) { - uint32_t 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, (uint32_t[])Arrays.stream(channel_monitors).map(arr_conv_16 -> arr_conv_16 == null ? 0 : arr_conv_16.ptr & ~1).toArray()); - ChannelManagerReadArgs ret_hu_conv = new ChannelManagerReadArgs(null, ret); + 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, (number[])Arrays.stream(channel_monitors).map(arr_conv_16 -> arr_conv_16 == null ? 0 : arr_conv_16.ptr & ~1).toArray()); + const ret_hu_conv: ChannelManagerReadArgs = new ChannelManagerReadArgs(null, ret); ret_hu_conv.ptrs_to.add(keys_manager); ret_hu_conv.ptrs_to.add(fee_estimator); ret_hu_conv.ptrs_to.add(chain_monitor); diff --git a/ts/structs/ChannelMessageHandler.ts b/ts/structs/ChannelMessageHandler.ts index 71e1a613..52144c80 100644 --- a/ts/structs/ChannelMessageHandler.ts +++ b/ts/structs/ChannelMessageHandler.ts @@ -1,95 +1,258 @@ - public void handle_open_channel(byte[] their_node_id, InitFeatures their_features, OpenChannel msg) { + + +import CommonBase from './CommonBase'; +import * as bindings from '../bindings' // TODO: figure out location + + + + export class ChannelMessageHandler extends CommonBase { + + bindings_instance?: bindings.LDKChannelMessageHandler; + + constructor(ptr?: number, arg?: bindings.LDKChannelMessageHandler, messageSendEventsProvider?: bindings.LDKMessageSendEventsProvider) { + if (Number.isFinite(ptr)) { + super(ptr); + this.bindings_instance = null; + } else { + // TODO: private constructor instantiation + super(bindings.LDKChannelMessageHandler_new(arg, messageSendEventsProvider)); + this.ptrs_to.push(arg); + this.ptrs_to.push(messageSendEventsProvider); + + } + } + + protected finalize() { + if (this.ptr != 0) { + bindings.ChannelMessageHandler_free(this.ptr); + } + super.finalize(); + } + + static new_impl(arg: ChannelMessageHandlerInterface, messageSendEventsProvider_impl: MessageSendEventsProvider.MessageSendEventsProviderInterface): ChannelMessageHandler { + const impl_holder: LDKChannelMessageHandlerHolder = new LDKChannelMessageHandlerHolder(); + let structImplementation = { + // todo: in-line interface filling + handle_open_channel (their_node_id: Uint8Array, their_features: number, msg: number): void { + const their_features_hu_conv: InitFeatures = new InitFeatures(null, their_features); + const msg_hu_conv: OpenChannel = new OpenChannel(null, msg); + arg.handle_open_channel(their_node_id, their_features_hu_conv, msg_hu_conv); + }, + + handle_accept_channel (their_node_id: Uint8Array, their_features: number, msg: number): void { + const their_features_hu_conv: InitFeatures = new InitFeatures(null, their_features); + const msg_hu_conv: AcceptChannel = new AcceptChannel(null, msg); + arg.handle_accept_channel(their_node_id, their_features_hu_conv, msg_hu_conv); + }, + + handle_funding_created (their_node_id: Uint8Array, msg: number): void { + const msg_hu_conv: FundingCreated = new FundingCreated(null, msg); + arg.handle_funding_created(their_node_id, msg_hu_conv); + }, + + handle_funding_signed (their_node_id: Uint8Array, msg: number): void { + const msg_hu_conv: FundingSigned = new FundingSigned(null, msg); + arg.handle_funding_signed(their_node_id, msg_hu_conv); + }, + + handle_funding_locked (their_node_id: Uint8Array, msg: number): void { + const msg_hu_conv: FundingLocked = new FundingLocked(null, msg); + arg.handle_funding_locked(their_node_id, msg_hu_conv); + }, + + handle_shutdown (their_node_id: Uint8Array, msg: number): void { + const msg_hu_conv: Shutdown = new Shutdown(null, msg); + arg.handle_shutdown(their_node_id, msg_hu_conv); + }, + + handle_closing_signed (their_node_id: Uint8Array, msg: number): void { + const msg_hu_conv: ClosingSigned = new ClosingSigned(null, msg); + arg.handle_closing_signed(their_node_id, msg_hu_conv); + }, + + handle_update_add_htlc (their_node_id: Uint8Array, msg: number): void { + const msg_hu_conv: UpdateAddHTLC = new UpdateAddHTLC(null, msg); + arg.handle_update_add_htlc(their_node_id, msg_hu_conv); + }, + + handle_update_fulfill_htlc (their_node_id: Uint8Array, msg: number): void { + const msg_hu_conv: UpdateFulfillHTLC = new UpdateFulfillHTLC(null, msg); + arg.handle_update_fulfill_htlc(their_node_id, msg_hu_conv); + }, + + handle_update_fail_htlc (their_node_id: Uint8Array, msg: number): void { + const msg_hu_conv: UpdateFailHTLC = new UpdateFailHTLC(null, msg); + arg.handle_update_fail_htlc(their_node_id, msg_hu_conv); + }, + + handle_update_fail_malformed_htlc (their_node_id: Uint8Array, msg: number): void { + const msg_hu_conv: UpdateFailMalformedHTLC = new UpdateFailMalformedHTLC(null, msg); + arg.handle_update_fail_malformed_htlc(their_node_id, msg_hu_conv); + }, + + handle_commitment_signed (their_node_id: Uint8Array, msg: number): void { + const msg_hu_conv: CommitmentSigned = new CommitmentSigned(null, msg); + arg.handle_commitment_signed(their_node_id, msg_hu_conv); + }, + + handle_revoke_and_ack (their_node_id: Uint8Array, msg: number): void { + const msg_hu_conv: RevokeAndACK = new RevokeAndACK(null, msg); + arg.handle_revoke_and_ack(their_node_id, msg_hu_conv); + }, + + handle_update_fee (their_node_id: Uint8Array, msg: number): void { + const msg_hu_conv: UpdateFee = new UpdateFee(null, msg); + arg.handle_update_fee(their_node_id, msg_hu_conv); + }, + + handle_announcement_signatures (their_node_id: Uint8Array, msg: number): void { + const msg_hu_conv: AnnouncementSignatures = new AnnouncementSignatures(null, msg); + arg.handle_announcement_signatures(their_node_id, msg_hu_conv); + }, + + peer_disconnected (their_node_id: Uint8Array, no_connection_possible: boolean): void { + arg.peer_disconnected(their_node_id, no_connection_possible); + }, + + peer_connected (their_node_id: Uint8Array, msg: number): void { + const msg_hu_conv: Init = new Init(null, msg); + arg.peer_connected(their_node_id, msg_hu_conv); + }, + + handle_channel_reestablish (their_node_id: Uint8Array, msg: number): void { + const msg_hu_conv: ChannelReestablish = new ChannelReestablish(null, msg); + arg.handle_channel_reestablish(their_node_id, msg_hu_conv); + }, + + handle_error (their_node_id: Uint8Array, msg: number): void { + const msg_hu_conv: ErrorMessage = new ErrorMessage(null, msg); + arg.handle_error(their_node_id, msg_hu_conv); + }, + + + }; + impl_holder.held = new ChannelMessageHandler (null, structImplementation, MessageSendEventsProvider.new_impl(MessageSendEventsProvider_impl).bindings_instance); + } + } + + export interface ChannelMessageHandlerInterface { + handle_open_channel(their_node_id: Uint8Array, their_features: InitFeatures, msg: OpenChannel): void; + handle_accept_channel(their_node_id: Uint8Array, their_features: InitFeatures, msg: AcceptChannel): void; + handle_funding_created(their_node_id: Uint8Array, msg: FundingCreated): void; + handle_funding_signed(their_node_id: Uint8Array, msg: FundingSigned): void; + handle_funding_locked(their_node_id: Uint8Array, msg: FundingLocked): void; + handle_shutdown(their_node_id: Uint8Array, msg: Shutdown): void; + handle_closing_signed(their_node_id: Uint8Array, msg: ClosingSigned): void; + handle_update_add_htlc(their_node_id: Uint8Array, msg: UpdateAddHTLC): void; + handle_update_fulfill_htlc(their_node_id: Uint8Array, msg: UpdateFulfillHTLC): void; + handle_update_fail_htlc(their_node_id: Uint8Array, msg: UpdateFailHTLC): void; + handle_update_fail_malformed_htlc(their_node_id: Uint8Array, msg: UpdateFailMalformedHTLC): void; + handle_commitment_signed(their_node_id: Uint8Array, msg: CommitmentSigned): void; + handle_revoke_and_ack(their_node_id: Uint8Array, msg: RevokeAndACK): void; + handle_update_fee(their_node_id: Uint8Array, msg: UpdateFee): void; + handle_announcement_signatures(their_node_id: Uint8Array, msg: AnnouncementSignatures): void; + peer_disconnected(their_node_id: Uint8Array, no_connection_possible: boolean): void; + peer_connected(their_node_id: Uint8Array, msg: Init): void; + handle_channel_reestablish(their_node_id: Uint8Array, msg: ChannelReestablish): void; + handle_error(their_node_id: Uint8Array, msg: ErrorMessage): void; + + } + + class LDKChannelMessageHandlerHolder { + held: ChannelMessageHandler; + } + public void handle_open_channel(Uint8Array their_node_id, InitFeatures their_features, OpenChannel msg) { bindings.ChannelMessageHandler_handle_open_channel(this.ptr, their_node_id, their_features == null ? 0 : their_features.ptr & ~1, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(their_features); this.ptrs_to.add(msg); } - public void handle_accept_channel(byte[] their_node_id, InitFeatures their_features, AcceptChannel msg) { + public void handle_accept_channel(Uint8Array their_node_id, InitFeatures their_features, AcceptChannel msg) { bindings.ChannelMessageHandler_handle_accept_channel(this.ptr, their_node_id, their_features == null ? 0 : their_features.ptr & ~1, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(their_features); this.ptrs_to.add(msg); } - public void handle_funding_created(byte[] their_node_id, FundingCreated msg) { + public void handle_funding_created(Uint8Array their_node_id, FundingCreated msg) { bindings.ChannelMessageHandler_handle_funding_created(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } - public void handle_funding_signed(byte[] their_node_id, FundingSigned msg) { + public void handle_funding_signed(Uint8Array their_node_id, FundingSigned msg) { bindings.ChannelMessageHandler_handle_funding_signed(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } - public void handle_funding_locked(byte[] their_node_id, FundingLocked msg) { + public void handle_funding_locked(Uint8Array their_node_id, FundingLocked msg) { bindings.ChannelMessageHandler_handle_funding_locked(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } - public void handle_shutdown(byte[] their_node_id, Shutdown msg) { + public void handle_shutdown(Uint8Array their_node_id, Shutdown msg) { bindings.ChannelMessageHandler_handle_shutdown(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } - public void handle_closing_signed(byte[] their_node_id, ClosingSigned msg) { + public void handle_closing_signed(Uint8Array their_node_id, ClosingSigned msg) { bindings.ChannelMessageHandler_handle_closing_signed(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } - public void handle_update_add_htlc(byte[] their_node_id, UpdateAddHTLC msg) { + public void handle_update_add_htlc(Uint8Array their_node_id, UpdateAddHTLC msg) { bindings.ChannelMessageHandler_handle_update_add_htlc(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } - public void handle_update_fulfill_htlc(byte[] their_node_id, UpdateFulfillHTLC msg) { + public void handle_update_fulfill_htlc(Uint8Array their_node_id, UpdateFulfillHTLC msg) { bindings.ChannelMessageHandler_handle_update_fulfill_htlc(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } - public void handle_update_fail_htlc(byte[] their_node_id, UpdateFailHTLC msg) { + public void handle_update_fail_htlc(Uint8Array their_node_id, UpdateFailHTLC msg) { bindings.ChannelMessageHandler_handle_update_fail_htlc(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } - public void handle_update_fail_malformed_htlc(byte[] their_node_id, UpdateFailMalformedHTLC msg) { + public void handle_update_fail_malformed_htlc(Uint8Array their_node_id, UpdateFailMalformedHTLC msg) { bindings.ChannelMessageHandler_handle_update_fail_malformed_htlc(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } - public void handle_commitment_signed(byte[] their_node_id, CommitmentSigned msg) { + public void handle_commitment_signed(Uint8Array their_node_id, CommitmentSigned msg) { bindings.ChannelMessageHandler_handle_commitment_signed(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } - public void handle_revoke_and_ack(byte[] their_node_id, RevokeAndACK msg) { + public void handle_revoke_and_ack(Uint8Array their_node_id, RevokeAndACK msg) { bindings.ChannelMessageHandler_handle_revoke_and_ack(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } - public void handle_update_fee(byte[] their_node_id, UpdateFee msg) { + public void handle_update_fee(Uint8Array their_node_id, UpdateFee msg) { bindings.ChannelMessageHandler_handle_update_fee(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } - public void handle_announcement_signatures(byte[] their_node_id, AnnouncementSignatures msg) { + public void handle_announcement_signatures(Uint8Array their_node_id, AnnouncementSignatures msg) { bindings.ChannelMessageHandler_handle_announcement_signatures(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } - public void peer_disconnected(byte[] their_node_id, boolean no_connection_possible) { + public void peer_disconnected(Uint8Array their_node_id, boolean no_connection_possible) { bindings.ChannelMessageHandler_peer_disconnected(this.ptr, their_node_id, no_connection_possible); } - public void peer_connected(byte[] their_node_id, Init msg) { + public void peer_connected(Uint8Array their_node_id, Init msg) { bindings.ChannelMessageHandler_peer_connected(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } - public void handle_channel_reestablish(byte[] their_node_id, ChannelReestablish msg) { + public void handle_channel_reestablish(Uint8Array their_node_id, ChannelReestablish msg) { bindings.ChannelMessageHandler_handle_channel_reestablish(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } - public void handle_error(byte[] their_node_id, ErrorMessage msg) { + public void handle_error(Uint8Array their_node_id, ErrorMessage msg) { bindings.ChannelMessageHandler_handle_error(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); this.ptrs_to.add(msg); } diff --git a/ts/structs/ChannelMonitor.ts b/ts/structs/ChannelMonitor.ts index da425566..9c3bc931 100644 --- a/ts/structs/ChannelMonitor.ts +++ b/ts/structs/ChannelMonitor.ts @@ -1,22 +1,30 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class ChannelMonitor extends CommonBase { - ChannelMonitor(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.ChannelMonitor_free(ptr); } - } - public byte[] write() { - byte[] ret = bindings.ChannelMonitor_write(this.ptr); + + export default class ChannelMonitor extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.ChannelMonitor_free(this.ptr); + } + } + public Uint8Array write() { + Uint8Array ret = bindings.ChannelMonitor_write(this.ptr); return ret; } public Result_NoneMonitorUpdateErrorZ update_monitor(ChannelMonitorUpdate updates, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) { - uint32_t 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); + number 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); Result_NoneMonitorUpdateErrorZ ret_hu_conv = Result_NoneMonitorUpdateErrorZ.constr_from_ptr(ret); this.ptrs_to.add(updates); this.ptrs_to.add(broadcaster); @@ -25,36 +33,36 @@ public class ChannelMonitor extends CommonBase { return ret_hu_conv; } - public long get_latest_update_id() { - long ret = bindings.ChannelMonitor_get_latest_update_id(this.ptr); + public number get_latest_update_id() { + number ret = bindings.ChannelMonitor_get_latest_update_id(this.ptr); return ret; } - public TwoTuple get_funding_txo() { - uint32_t ret = bindings.ChannelMonitor_get_funding_txo(this.ptr); - uint32_t ret_a = bindings.LDKC2Tuple_OutPointScriptZ_get_a(ret); - OutPoint ret_a_hu_conv = new OutPoint(null, ret_a);; - byte[] ret_b = bindings.LDKC2Tuple_OutPointScriptZ_get_b(ret); - TwoTuple ret_conv = new TwoTuple(ret_a_hu_conv, ret_b); + public TwoTuple get_funding_txo() { + number ret = bindings.ChannelMonitor_get_funding_txo(this.ptr); + number ret_a = bindings.LDKC2Tuple_OutPointScriptZ_get_a(ret); + const ret_a_hu_conv: OutPoint = new OutPoint(null, ret_a);; + Uint8Array ret_b = bindings.LDKC2Tuple_OutPointScriptZ_get_b(ret); + TwoTuple ret_conv = new TwoTuple(ret_a_hu_conv, ret_b); return ret_conv; } public MonitorEvent[] get_and_clear_pending_monitor_events() { - uint32_t[] ret = bindings.ChannelMonitor_get_and_clear_pending_monitor_events(this.ptr); + number[] ret = bindings.ChannelMonitor_get_and_clear_pending_monitor_events(this.ptr); MonitorEvent[] arr_conv_14_arr = new MonitorEvent[ret.length]; for (int o = 0; o < ret.length; o++) { - uint32_t arr_conv_14 = ret[o]; - MonitorEvent arr_conv_14_hu_conv = new MonitorEvent(null, arr_conv_14); + number arr_conv_14 = ret[o]; + const arr_conv_14_hu_conv: MonitorEvent = new MonitorEvent(null, arr_conv_14); arr_conv_14_arr[o] = arr_conv_14_hu_conv; } return arr_conv_14_arr; } public Event[] get_and_clear_pending_events() { - uint32_t[] ret = bindings.ChannelMonitor_get_and_clear_pending_events(this.ptr); + number[] ret = bindings.ChannelMonitor_get_and_clear_pending_events(this.ptr); Event[] arr_conv_7_arr = new Event[ret.length]; for (int h = 0; h < ret.length; h++) { - uint32_t arr_conv_7 = ret[h]; + number arr_conv_7 = ret[h]; Event arr_conv_7_hu_conv = Event.constr_from_ptr(arr_conv_7); arr_conv_7_hu_conv.ptrs_to.add(this); arr_conv_7_arr[h] = arr_conv_7_hu_conv; @@ -62,39 +70,39 @@ public class ChannelMonitor extends CommonBase { return arr_conv_7_arr; } - public byte[][] get_latest_holder_commitment_txn(Logger logger) { - byte[][] ret = bindings.ChannelMonitor_get_latest_holder_commitment_txn(this.ptr, logger == null ? 0 : logger.ptr); + public Uint8Array[] get_latest_holder_commitment_txn(Logger logger) { + Uint8Array[] ret = bindings.ChannelMonitor_get_latest_holder_commitment_txn(this.ptr, logger == null ? 0 : logger.ptr); this.ptrs_to.add(logger); return ret; } - public TwoTuple[]>[] block_connected(byte[] header, TwoTuple[] txdata, int height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) { - uint32_t[] ret = bindings.ChannelMonitor_block_connected(this.ptr, header, (uint32_t[])Arrays.stream(txdata).map(arr_conv_24 -> bindings.C2Tuple_usizeTransactionZ_new(arr_conv_24.a, arr_conv_24.b)).toArray(), height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); - TwoTuple[]>[] arr_conv_46_arr = new TwoTuple[ret.length]; - for (int u = 0; u < ret.length; u++) { - uint32_t arr_conv_46 = ret[u]; - byte[] arr_conv_46_a = bindings.LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(arr_conv_46); - uint32_t[] arr_conv_46_b = bindings.LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(arr_conv_46); - TwoTuple[] arr_conv_26_arr = new TwoTuple[arr_conv_46_b.length]; - for (int a = 0; a < arr_conv_46_b.length; a++) { - uint32_t arr_conv_26 = arr_conv_46_b[a]; - int arr_conv_26_a = bindings.LDKC2Tuple_u32TxOutZ_get_a(arr_conv_26); - uint32_t arr_conv_26_b = bindings.LDKC2Tuple_u32TxOutZ_get_b(arr_conv_26); - TxOut arr_conv_26_b_conv = new TxOut(null, arr_conv_26_b);; - TwoTuple arr_conv_26_conv = new TwoTuple(arr_conv_26_a, arr_conv_26_b_conv); - arr_conv_26_arr[a] = arr_conv_26_conv; + public TwoTuple[]>[] block_connected(Uint8Array header, TwoTuple[] txdata, number height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) { + number[] ret = bindings.ChannelMonitor_block_connected(this.ptr, header, (number[])Arrays.stream(txdata).map(arr_conv_30 -> bindings.C2Tuple_usizeTransactionZ_new(arr_conv_30.a, arr_conv_30.b)).toArray(), height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); + TwoTuple[]>[] arr_conv_49_arr = new TwoTuple[ret.length]; + for (int x = 0; x < ret.length; x++) { + number arr_conv_49 = ret[x]; + Uint8Array arr_conv_49_a = bindings.LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(arr_conv_49); + number[] arr_conv_49_b = bindings.LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(arr_conv_49); + TwoTuple[] arr_conv_25_arr = new TwoTuple[arr_conv_49_b.length]; + for (int z = 0; z < arr_conv_49_b.length; z++) { + number arr_conv_25 = arr_conv_49_b[z]; + number arr_conv_25_a = bindings.LDKC2Tuple_u32TxOutZ_get_a(arr_conv_25); + number arr_conv_25_b = bindings.LDKC2Tuple_u32TxOutZ_get_b(arr_conv_25); + TxOut arr_conv_25_b_conv = new TxOut(null, arr_conv_25_b);; + TwoTuple arr_conv_25_conv = new TwoTuple(arr_conv_25_a, arr_conv_25_b_conv); + arr_conv_25_arr[z] = arr_conv_25_conv; }; - TwoTuple[]> arr_conv_46_conv = new TwoTuple[]>(arr_conv_46_a, arr_conv_26_arr); - arr_conv_46_arr[u] = arr_conv_46_conv; + TwoTuple[]> arr_conv_49_conv = new TwoTuple[]>(arr_conv_49_a, arr_conv_25_arr); + arr_conv_49_arr[x] = arr_conv_49_conv; } - /* TODO 2 TwoTuple */; + /* TODO 2 TwoTuple */; this.ptrs_to.add(broadcaster); this.ptrs_to.add(fee_estimator); this.ptrs_to.add(logger); - return arr_conv_46_arr; + return arr_conv_49_arr; } - public void block_disconnected(byte[] header, int height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) { + public void block_disconnected(Uint8Array header, number height, BroadcasterInterface broadcaster, FeeEstimator fee_estimator, Logger logger) { bindings.ChannelMonitor_block_disconnected(this.ptr, header, height, broadcaster == null ? 0 : broadcaster.ptr, fee_estimator == null ? 0 : fee_estimator.ptr, logger == null ? 0 : logger.ptr); this.ptrs_to.add(broadcaster); this.ptrs_to.add(fee_estimator); diff --git a/ts/structs/ChannelMonitorUpdate.ts b/ts/structs/ChannelMonitorUpdate.ts index 43a55d37..a5ef1d14 100644 --- a/ts/structs/ChannelMonitorUpdate.ts +++ b/ts/structs/ChannelMonitorUpdate.ts @@ -1,37 +1,45 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class ChannelMonitorUpdate extends CommonBase { - ChannelMonitorUpdate(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.ChannelMonitorUpdate_free(ptr); } - } + + export default class ChannelMonitorUpdate extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.ChannelMonitorUpdate_free(this.ptr); + } + } public ChannelMonitorUpdate clone() { - uint32_t ret = bindings.ChannelMonitorUpdate_clone(this.ptr); - ChannelMonitorUpdate ret_hu_conv = new ChannelMonitorUpdate(null, ret); + number ret = bindings.ChannelMonitorUpdate_clone(this.ptr); + const ret_hu_conv: ChannelMonitorUpdate = new ChannelMonitorUpdate(null, ret); return ret_hu_conv; } - public long get_update_id() { - long ret = bindings.ChannelMonitorUpdate_get_update_id(this.ptr); + public number get_update_id() { + number ret = bindings.ChannelMonitorUpdate_get_update_id(this.ptr); return ret; } - public void set_update_id(long val) { + public void set_update_id(number val) { bindings.ChannelMonitorUpdate_set_update_id(this.ptr, val); } - public byte[] write() { - byte[] ret = bindings.ChannelMonitorUpdate_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.ChannelMonitorUpdate_write(this.ptr); return ret; } - public static Result_ChannelMonitorUpdateDecodeErrorZ constructor_read(byte[] ser) { - uint32_t ret = bindings.ChannelMonitorUpdate_read(ser); + public static Result_ChannelMonitorUpdateDecodeErrorZ constructor_read(Uint8Array ser) { + number ret = bindings.ChannelMonitorUpdate_read(ser); Result_ChannelMonitorUpdateDecodeErrorZ ret_hu_conv = Result_ChannelMonitorUpdateDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/ts/structs/ChannelPublicKeys.ts b/ts/structs/ChannelPublicKeys.ts index a802aaa1..911a7ac2 100644 --- a/ts/structs/ChannelPublicKeys.ts +++ b/ts/structs/ChannelPublicKeys.ts @@ -1,80 +1,88 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class ChannelPublicKeys extends CommonBase { - ChannelPublicKeys(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.ChannelPublicKeys_free(ptr); } - } + + export default class ChannelPublicKeys extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.ChannelPublicKeys_free(this.ptr); + } + } public ChannelPublicKeys clone() { - uint32_t ret = bindings.ChannelPublicKeys_clone(this.ptr); - ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret); + number ret = bindings.ChannelPublicKeys_clone(this.ptr); + const ret_hu_conv: ChannelPublicKeys = new ChannelPublicKeys(null, ret); return ret_hu_conv; } - public byte[] get_funding_pubkey() { - byte[] ret = bindings.ChannelPublicKeys_get_funding_pubkey(this.ptr); + public Uint8Array get_funding_pubkey() { + Uint8Array ret = bindings.ChannelPublicKeys_get_funding_pubkey(this.ptr); return ret; } - public void set_funding_pubkey(byte[] val) { + public void set_funding_pubkey(Uint8Array val) { bindings.ChannelPublicKeys_set_funding_pubkey(this.ptr, val); } - public byte[] get_revocation_basepoint() { - byte[] ret = bindings.ChannelPublicKeys_get_revocation_basepoint(this.ptr); + public Uint8Array get_revocation_basepoint() { + Uint8Array ret = bindings.ChannelPublicKeys_get_revocation_basepoint(this.ptr); return ret; } - public void set_revocation_basepoint(byte[] val) { + public void set_revocation_basepoint(Uint8Array val) { bindings.ChannelPublicKeys_set_revocation_basepoint(this.ptr, val); } - public byte[] get_payment_point() { - byte[] ret = bindings.ChannelPublicKeys_get_payment_point(this.ptr); + public Uint8Array get_payment_point() { + Uint8Array ret = bindings.ChannelPublicKeys_get_payment_point(this.ptr); return ret; } - public void set_payment_point(byte[] val) { + public void set_payment_point(Uint8Array val) { bindings.ChannelPublicKeys_set_payment_point(this.ptr, val); } - public byte[] get_delayed_payment_basepoint() { - byte[] ret = bindings.ChannelPublicKeys_get_delayed_payment_basepoint(this.ptr); + public Uint8Array get_delayed_payment_basepoint() { + Uint8Array ret = bindings.ChannelPublicKeys_get_delayed_payment_basepoint(this.ptr); return ret; } - public void set_delayed_payment_basepoint(byte[] val) { + public void set_delayed_payment_basepoint(Uint8Array val) { bindings.ChannelPublicKeys_set_delayed_payment_basepoint(this.ptr, val); } - public byte[] get_htlc_basepoint() { - byte[] ret = bindings.ChannelPublicKeys_get_htlc_basepoint(this.ptr); + public Uint8Array get_htlc_basepoint() { + Uint8Array ret = bindings.ChannelPublicKeys_get_htlc_basepoint(this.ptr); return ret; } - public void set_htlc_basepoint(byte[] val) { + public void set_htlc_basepoint(Uint8Array val) { bindings.ChannelPublicKeys_set_htlc_basepoint(this.ptr, val); } - public static ChannelPublicKeys constructor_new(byte[] funding_pubkey_arg, byte[] revocation_basepoint_arg, byte[] payment_point_arg, byte[] delayed_payment_basepoint_arg, byte[] htlc_basepoint_arg) { - uint32_t ret = bindings.ChannelPublicKeys_new(funding_pubkey_arg, revocation_basepoint_arg, payment_point_arg, delayed_payment_basepoint_arg, htlc_basepoint_arg); - ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret); + public static ChannelPublicKeys constructor_new(Uint8Array funding_pubkey_arg, Uint8Array revocation_basepoint_arg, Uint8Array payment_point_arg, Uint8Array delayed_payment_basepoint_arg, Uint8Array htlc_basepoint_arg) { + number ret = bindings.ChannelPublicKeys_new(funding_pubkey_arg, revocation_basepoint_arg, payment_point_arg, delayed_payment_basepoint_arg, htlc_basepoint_arg); + const ret_hu_conv: ChannelPublicKeys = new ChannelPublicKeys(null, ret); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.ChannelPublicKeys_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.ChannelPublicKeys_write(this.ptr); return ret; } - public static ChannelPublicKeys constructor_read(byte[] ser) { - uint32_t ret = bindings.ChannelPublicKeys_read(ser); - ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret); + public static ChannelPublicKeys constructor_read(Uint8Array ser) { + number ret = bindings.ChannelPublicKeys_read(ser); + const ret_hu_conv: ChannelPublicKeys = new ChannelPublicKeys(null, ret); return ret_hu_conv; } diff --git a/ts/structs/ChannelReestablish.ts b/ts/structs/ChannelReestablish.ts index c4a0a13d..2394cb2d 100644 --- a/ts/structs/ChannelReestablish.ts +++ b/ts/structs/ChannelReestablish.ts @@ -1,55 +1,63 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class ChannelReestablish extends CommonBase { - ChannelReestablish(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.ChannelReestablish_free(ptr); } - } + + export default class ChannelReestablish extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.ChannelReestablish_free(this.ptr); + } + } public ChannelReestablish clone() { - uint32_t ret = bindings.ChannelReestablish_clone(this.ptr); - ChannelReestablish ret_hu_conv = new ChannelReestablish(null, ret); + number ret = bindings.ChannelReestablish_clone(this.ptr); + const ret_hu_conv: ChannelReestablish = new ChannelReestablish(null, ret); return ret_hu_conv; } - public byte[] get_channel_id() { - byte[] ret = bindings.ChannelReestablish_get_channel_id(this.ptr); + public Uint8Array get_channel_id() { + Uint8Array ret = bindings.ChannelReestablish_get_channel_id(this.ptr); return ret; } - public void set_channel_id(byte[] val) { + public void set_channel_id(Uint8Array val) { bindings.ChannelReestablish_set_channel_id(this.ptr, val); } - public long get_next_local_commitment_number() { - long ret = bindings.ChannelReestablish_get_next_local_commitment_number(this.ptr); + public number get_next_local_commitment_number() { + number ret = bindings.ChannelReestablish_get_next_local_commitment_number(this.ptr); return ret; } - public void set_next_local_commitment_number(long val) { + public void set_next_local_commitment_number(number val) { bindings.ChannelReestablish_set_next_local_commitment_number(this.ptr, val); } - public long get_next_remote_commitment_number() { - long ret = bindings.ChannelReestablish_get_next_remote_commitment_number(this.ptr); + public number get_next_remote_commitment_number() { + number ret = bindings.ChannelReestablish_get_next_remote_commitment_number(this.ptr); return ret; } - public void set_next_remote_commitment_number(long val) { + public void set_next_remote_commitment_number(number val) { bindings.ChannelReestablish_set_next_remote_commitment_number(this.ptr, val); } - public byte[] write() { - byte[] ret = bindings.ChannelReestablish_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.ChannelReestablish_write(this.ptr); return ret; } - public static Result_ChannelReestablishDecodeErrorZ constructor_read(byte[] ser) { - uint32_t ret = bindings.ChannelReestablish_read(ser); + public static Result_ChannelReestablishDecodeErrorZ constructor_read(Uint8Array ser) { + number ret = bindings.ChannelReestablish_read(ser); Result_ChannelReestablishDecodeErrorZ ret_hu_conv = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/ts/structs/ChannelTransactionParameters.ts b/ts/structs/ChannelTransactionParameters.ts index 45cf099a..3d6e367f 100644 --- a/ts/structs/ChannelTransactionParameters.ts +++ b/ts/structs/ChannelTransactionParameters.ts @@ -1,24 +1,32 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class ChannelTransactionParameters extends CommonBase { - ChannelTransactionParameters(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.ChannelTransactionParameters_free(ptr); } - } + + export default class ChannelTransactionParameters extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.ChannelTransactionParameters_free(this.ptr); + } + } public ChannelTransactionParameters clone() { - uint32_t ret = bindings.ChannelTransactionParameters_clone(this.ptr); - ChannelTransactionParameters ret_hu_conv = new ChannelTransactionParameters(null, ret); + number ret = bindings.ChannelTransactionParameters_clone(this.ptr); + const ret_hu_conv: ChannelTransactionParameters = new ChannelTransactionParameters(null, ret); return ret_hu_conv; } public ChannelPublicKeys get_holder_pubkeys() { - uint32_t ret = bindings.ChannelTransactionParameters_get_holder_pubkeys(this.ptr); - ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret); + number ret = bindings.ChannelTransactionParameters_get_holder_pubkeys(this.ptr); + const ret_hu_conv: ChannelPublicKeys = new ChannelPublicKeys(null, ret); return ret_hu_conv; } @@ -27,12 +35,12 @@ public class ChannelTransactionParameters extends CommonBase { this.ptrs_to.add(val); } - public short get_holder_selected_contest_delay() { - short ret = bindings.ChannelTransactionParameters_get_holder_selected_contest_delay(this.ptr); + public number get_holder_selected_contest_delay() { + number ret = bindings.ChannelTransactionParameters_get_holder_selected_contest_delay(this.ptr); return ret; } - public void set_holder_selected_contest_delay(short val) { + public void set_holder_selected_contest_delay(number val) { bindings.ChannelTransactionParameters_set_holder_selected_contest_delay(this.ptr, val); } @@ -46,8 +54,8 @@ public class ChannelTransactionParameters extends CommonBase { } public CounterpartyChannelTransactionParameters get_counterparty_parameters() { - uint32_t ret = bindings.ChannelTransactionParameters_get_counterparty_parameters(this.ptr); - CounterpartyChannelTransactionParameters ret_hu_conv = new CounterpartyChannelTransactionParameters(null, ret); + number ret = bindings.ChannelTransactionParameters_get_counterparty_parameters(this.ptr); + const ret_hu_conv: CounterpartyChannelTransactionParameters = new CounterpartyChannelTransactionParameters(null, ret); return ret_hu_conv; } @@ -57,8 +65,8 @@ public class ChannelTransactionParameters extends CommonBase { } public OutPoint get_funding_outpoint() { - uint32_t ret = bindings.ChannelTransactionParameters_get_funding_outpoint(this.ptr); - OutPoint ret_hu_conv = new OutPoint(null, ret); + number ret = bindings.ChannelTransactionParameters_get_funding_outpoint(this.ptr); + const ret_hu_conv: OutPoint = new OutPoint(null, ret); return ret_hu_conv; } @@ -67,9 +75,9 @@ public class ChannelTransactionParameters extends CommonBase { this.ptrs_to.add(val); } - public static ChannelTransactionParameters constructor_new(ChannelPublicKeys holder_pubkeys_arg, short holder_selected_contest_delay_arg, boolean is_outbound_from_holder_arg, CounterpartyChannelTransactionParameters counterparty_parameters_arg, OutPoint funding_outpoint_arg) { - uint32_t 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); - ChannelTransactionParameters ret_hu_conv = new ChannelTransactionParameters(null, ret); + public static ChannelTransactionParameters constructor_new(ChannelPublicKeys holder_pubkeys_arg, number holder_selected_contest_delay_arg, boolean is_outbound_from_holder_arg, CounterpartyChannelTransactionParameters counterparty_parameters_arg, OutPoint funding_outpoint_arg) { + number 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); + const ret_hu_conv: ChannelTransactionParameters = new ChannelTransactionParameters(null, ret); ret_hu_conv.ptrs_to.add(holder_pubkeys_arg); ret_hu_conv.ptrs_to.add(counterparty_parameters_arg); ret_hu_conv.ptrs_to.add(funding_outpoint_arg); @@ -82,25 +90,25 @@ public class ChannelTransactionParameters extends CommonBase { } public DirectedChannelTransactionParameters as_holder_broadcastable() { - uint32_t ret = bindings.ChannelTransactionParameters_as_holder_broadcastable(this.ptr); - DirectedChannelTransactionParameters ret_hu_conv = new DirectedChannelTransactionParameters(null, ret); + number ret = bindings.ChannelTransactionParameters_as_holder_broadcastable(this.ptr); + const ret_hu_conv: DirectedChannelTransactionParameters = new DirectedChannelTransactionParameters(null, ret); return ret_hu_conv; } public DirectedChannelTransactionParameters as_counterparty_broadcastable() { - uint32_t ret = bindings.ChannelTransactionParameters_as_counterparty_broadcastable(this.ptr); - DirectedChannelTransactionParameters ret_hu_conv = new DirectedChannelTransactionParameters(null, ret); + number ret = bindings.ChannelTransactionParameters_as_counterparty_broadcastable(this.ptr); + const ret_hu_conv: DirectedChannelTransactionParameters = new DirectedChannelTransactionParameters(null, ret); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.ChannelTransactionParameters_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.ChannelTransactionParameters_write(this.ptr); return ret; } - public static ChannelTransactionParameters constructor_read(byte[] ser) { - uint32_t ret = bindings.ChannelTransactionParameters_read(ser); - ChannelTransactionParameters ret_hu_conv = new ChannelTransactionParameters(null, ret); + public static ChannelTransactionParameters constructor_read(Uint8Array ser) { + number ret = bindings.ChannelTransactionParameters_read(ser); + const ret_hu_conv: ChannelTransactionParameters = new ChannelTransactionParameters(null, ret); return ret_hu_conv; } diff --git a/ts/structs/ChannelUpdate.ts b/ts/structs/ChannelUpdate.ts index c16675d5..9a8244da 100644 --- a/ts/structs/ChannelUpdate.ts +++ b/ts/structs/ChannelUpdate.ts @@ -1,33 +1,41 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class ChannelUpdate extends CommonBase { - ChannelUpdate(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.ChannelUpdate_free(ptr); } - } + + export default class ChannelUpdate extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.ChannelUpdate_free(this.ptr); + } + } public ChannelUpdate clone() { - uint32_t ret = bindings.ChannelUpdate_clone(this.ptr); - ChannelUpdate ret_hu_conv = new ChannelUpdate(null, ret); + number ret = bindings.ChannelUpdate_clone(this.ptr); + const ret_hu_conv: ChannelUpdate = new ChannelUpdate(null, ret); return ret_hu_conv; } - public byte[] get_signature() { - byte[] ret = bindings.ChannelUpdate_get_signature(this.ptr); + public Uint8Array get_signature() { + Uint8Array ret = bindings.ChannelUpdate_get_signature(this.ptr); return ret; } - public void set_signature(byte[] val) { + public void set_signature(Uint8Array val) { bindings.ChannelUpdate_set_signature(this.ptr, val); } public UnsignedChannelUpdate get_contents() { - uint32_t ret = bindings.ChannelUpdate_get_contents(this.ptr); - UnsignedChannelUpdate ret_hu_conv = new UnsignedChannelUpdate(null, ret); + number ret = bindings.ChannelUpdate_get_contents(this.ptr); + const ret_hu_conv: UnsignedChannelUpdate = new UnsignedChannelUpdate(null, ret); return ret_hu_conv; } @@ -36,21 +44,21 @@ public class ChannelUpdate extends CommonBase { this.ptrs_to.add(val); } - public static ChannelUpdate constructor_new(byte[] signature_arg, UnsignedChannelUpdate contents_arg) { - uint32_t ret = bindings.ChannelUpdate_new(signature_arg, contents_arg == null ? 0 : contents_arg.ptr & ~1); - ChannelUpdate ret_hu_conv = new ChannelUpdate(null, ret); + public static ChannelUpdate constructor_new(Uint8Array signature_arg, UnsignedChannelUpdate contents_arg) { + number ret = bindings.ChannelUpdate_new(signature_arg, contents_arg == null ? 0 : contents_arg.ptr & ~1); + const ret_hu_conv: ChannelUpdate = new ChannelUpdate(null, ret); ret_hu_conv.ptrs_to.add(contents_arg); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.ChannelUpdate_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.ChannelUpdate_write(this.ptr); return ret; } - public static ChannelUpdate constructor_read(byte[] ser) { - uint32_t ret = bindings.ChannelUpdate_read(ser); - ChannelUpdate ret_hu_conv = new ChannelUpdate(null, ret); + public static ChannelUpdate constructor_read(Uint8Array ser) { + number ret = bindings.ChannelUpdate_read(ser); + const ret_hu_conv: ChannelUpdate = new ChannelUpdate(null, ret); return ret_hu_conv; } diff --git a/ts/structs/ClosingSigned.ts b/ts/structs/ClosingSigned.ts index 122b4965..41714dd0 100644 --- a/ts/structs/ClosingSigned.ts +++ b/ts/structs/ClosingSigned.ts @@ -1,62 +1,70 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class ClosingSigned extends CommonBase { - ClosingSigned(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.ClosingSigned_free(ptr); } - } + + export default class ClosingSigned extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.ClosingSigned_free(this.ptr); + } + } public ClosingSigned clone() { - uint32_t ret = bindings.ClosingSigned_clone(this.ptr); - ClosingSigned ret_hu_conv = new ClosingSigned(null, ret); + number ret = bindings.ClosingSigned_clone(this.ptr); + const ret_hu_conv: ClosingSigned = new ClosingSigned(null, ret); return ret_hu_conv; } - public byte[] get_channel_id() { - byte[] ret = bindings.ClosingSigned_get_channel_id(this.ptr); + public Uint8Array get_channel_id() { + Uint8Array ret = bindings.ClosingSigned_get_channel_id(this.ptr); return ret; } - public void set_channel_id(byte[] val) { + public void set_channel_id(Uint8Array val) { bindings.ClosingSigned_set_channel_id(this.ptr, val); } - public long get_fee_satoshis() { - long ret = bindings.ClosingSigned_get_fee_satoshis(this.ptr); + public number get_fee_satoshis() { + number ret = bindings.ClosingSigned_get_fee_satoshis(this.ptr); return ret; } - public void set_fee_satoshis(long val) { + public void set_fee_satoshis(number val) { bindings.ClosingSigned_set_fee_satoshis(this.ptr, val); } - public byte[] get_signature() { - byte[] ret = bindings.ClosingSigned_get_signature(this.ptr); + public Uint8Array get_signature() { + Uint8Array ret = bindings.ClosingSigned_get_signature(this.ptr); return ret; } - public void set_signature(byte[] val) { + public void set_signature(Uint8Array val) { bindings.ClosingSigned_set_signature(this.ptr, val); } - public static ClosingSigned constructor_new(byte[] channel_id_arg, long fee_satoshis_arg, byte[] signature_arg) { - uint32_t ret = bindings.ClosingSigned_new(channel_id_arg, fee_satoshis_arg, signature_arg); - ClosingSigned ret_hu_conv = new ClosingSigned(null, ret); + public static ClosingSigned constructor_new(Uint8Array channel_id_arg, number fee_satoshis_arg, Uint8Array signature_arg) { + number ret = bindings.ClosingSigned_new(channel_id_arg, fee_satoshis_arg, signature_arg); + const ret_hu_conv: ClosingSigned = new ClosingSigned(null, ret); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.ClosingSigned_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.ClosingSigned_write(this.ptr); return ret; } - public static ClosingSigned constructor_read(byte[] ser) { - uint32_t ret = bindings.ClosingSigned_read(ser); - ClosingSigned ret_hu_conv = new ClosingSigned(null, ret); + public static ClosingSigned constructor_read(Uint8Array ser) { + number ret = bindings.ClosingSigned_read(ser); + const ret_hu_conv: ClosingSigned = new ClosingSigned(null, ret); return ret_hu_conv; } diff --git a/ts/structs/CommitmentSigned.ts b/ts/structs/CommitmentSigned.ts index c62d04f8..6997cf7c 100644 --- a/ts/structs/CommitmentSigned.ts +++ b/ts/structs/CommitmentSigned.ts @@ -1,57 +1,65 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class CommitmentSigned extends CommonBase { - CommitmentSigned(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.CommitmentSigned_free(ptr); } - } + + export default class CommitmentSigned extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.CommitmentSigned_free(this.ptr); + } + } public CommitmentSigned clone() { - uint32_t ret = bindings.CommitmentSigned_clone(this.ptr); - CommitmentSigned ret_hu_conv = new CommitmentSigned(null, ret); + number ret = bindings.CommitmentSigned_clone(this.ptr); + const ret_hu_conv: CommitmentSigned = new CommitmentSigned(null, ret); return ret_hu_conv; } - public byte[] get_channel_id() { - byte[] ret = bindings.CommitmentSigned_get_channel_id(this.ptr); + public Uint8Array get_channel_id() { + Uint8Array ret = bindings.CommitmentSigned_get_channel_id(this.ptr); return ret; } - public void set_channel_id(byte[] val) { + public void set_channel_id(Uint8Array val) { bindings.CommitmentSigned_set_channel_id(this.ptr, val); } - public byte[] get_signature() { - byte[] ret = bindings.CommitmentSigned_get_signature(this.ptr); + public Uint8Array get_signature() { + Uint8Array ret = bindings.CommitmentSigned_get_signature(this.ptr); return ret; } - public void set_signature(byte[] val) { + public void set_signature(Uint8Array val) { bindings.CommitmentSigned_set_signature(this.ptr, val); } - public void set_htlc_signatures(byte[][] val) { + public void set_htlc_signatures(Uint8Array[] val) { bindings.CommitmentSigned_set_htlc_signatures(this.ptr, val); } - public static CommitmentSigned constructor_new(byte[] channel_id_arg, byte[] signature_arg, byte[][] htlc_signatures_arg) { - uint32_t ret = bindings.CommitmentSigned_new(channel_id_arg, signature_arg, htlc_signatures_arg); - CommitmentSigned ret_hu_conv = new CommitmentSigned(null, ret); + public static CommitmentSigned constructor_new(Uint8Array channel_id_arg, Uint8Array signature_arg, Uint8Array[] htlc_signatures_arg) { + number ret = bindings.CommitmentSigned_new(channel_id_arg, signature_arg, htlc_signatures_arg); + const ret_hu_conv: CommitmentSigned = new CommitmentSigned(null, ret); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.CommitmentSigned_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.CommitmentSigned_write(this.ptr); return ret; } - public static CommitmentSigned constructor_read(byte[] ser) { - uint32_t ret = bindings.CommitmentSigned_read(ser); - CommitmentSigned ret_hu_conv = new CommitmentSigned(null, ret); + public static CommitmentSigned constructor_read(Uint8Array ser) { + number ret = bindings.CommitmentSigned_read(ser); + const ret_hu_conv: CommitmentSigned = new CommitmentSigned(null, ret); return ret_hu_conv; } diff --git a/ts/structs/CommitmentTransaction.ts b/ts/structs/CommitmentTransaction.ts index e2a4891a..d265267c 100644 --- a/ts/structs/CommitmentTransaction.ts +++ b/ts/structs/CommitmentTransaction.ts @@ -1,60 +1,68 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class CommitmentTransaction extends CommonBase { - CommitmentTransaction(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.CommitmentTransaction_free(ptr); } - } + + export default class CommitmentTransaction extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.CommitmentTransaction_free(this.ptr); + } + } public CommitmentTransaction clone() { - uint32_t ret = bindings.CommitmentTransaction_clone(this.ptr); - CommitmentTransaction ret_hu_conv = new CommitmentTransaction(null, ret); + number ret = bindings.CommitmentTransaction_clone(this.ptr); + const ret_hu_conv: CommitmentTransaction = new CommitmentTransaction(null, ret); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.CommitmentTransaction_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.CommitmentTransaction_write(this.ptr); return ret; } - public static CommitmentTransaction constructor_read(byte[] ser) { - uint32_t ret = bindings.CommitmentTransaction_read(ser); - CommitmentTransaction ret_hu_conv = new CommitmentTransaction(null, ret); + public static CommitmentTransaction constructor_read(Uint8Array ser) { + number ret = bindings.CommitmentTransaction_read(ser); + const ret_hu_conv: CommitmentTransaction = new CommitmentTransaction(null, ret); return ret_hu_conv; } - public long commitment_number() { - long ret = bindings.CommitmentTransaction_commitment_number(this.ptr); + public number commitment_number() { + number ret = bindings.CommitmentTransaction_commitment_number(this.ptr); return ret; } - public long to_broadcaster_value_sat() { - long ret = bindings.CommitmentTransaction_to_broadcaster_value_sat(this.ptr); + public number to_broadcaster_value_sat() { + number ret = bindings.CommitmentTransaction_to_broadcaster_value_sat(this.ptr); return ret; } - public long to_countersignatory_value_sat() { - long ret = bindings.CommitmentTransaction_to_countersignatory_value_sat(this.ptr); + public number to_countersignatory_value_sat() { + number ret = bindings.CommitmentTransaction_to_countersignatory_value_sat(this.ptr); return ret; } - public int feerate_per_kw() { - int ret = bindings.CommitmentTransaction_feerate_per_kw(this.ptr); + public number feerate_per_kw() { + number ret = bindings.CommitmentTransaction_feerate_per_kw(this.ptr); return ret; } public TrustedCommitmentTransaction trust() { - uint32_t ret = bindings.CommitmentTransaction_trust(this.ptr); - TrustedCommitmentTransaction ret_hu_conv = new TrustedCommitmentTransaction(null, ret); + number ret = bindings.CommitmentTransaction_trust(this.ptr); + const ret_hu_conv: TrustedCommitmentTransaction = new TrustedCommitmentTransaction(null, ret); return ret_hu_conv; } public Result_TrustedCommitmentTransactionNoneZ verify(DirectedChannelTransactionParameters channel_parameters, ChannelPublicKeys broadcaster_keys, ChannelPublicKeys countersignatory_keys) { - uint32_t 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); + number 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); Result_TrustedCommitmentTransactionNoneZ ret_hu_conv = Result_TrustedCommitmentTransactionNoneZ.constr_from_ptr(ret); this.ptrs_to.add(channel_parameters); this.ptrs_to.add(broadcaster_keys); diff --git a/ts/structs/CommitmentUpdate.ts b/ts/structs/CommitmentUpdate.ts index 381a6d37..0a11f39e 100644 --- a/ts/structs/CommitmentUpdate.ts +++ b/ts/structs/CommitmentUpdate.ts @@ -1,44 +1,52 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class CommitmentUpdate extends CommonBase { - CommitmentUpdate(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.CommitmentUpdate_free(ptr); } - } + + export default class CommitmentUpdate extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.CommitmentUpdate_free(this.ptr); + } + } public CommitmentUpdate clone() { - uint32_t ret = bindings.CommitmentUpdate_clone(this.ptr); - CommitmentUpdate ret_hu_conv = new CommitmentUpdate(null, ret); + number ret = bindings.CommitmentUpdate_clone(this.ptr); + const ret_hu_conv: CommitmentUpdate = new CommitmentUpdate(null, ret); return ret_hu_conv; } public void set_update_add_htlcs(UpdateAddHTLC[] val) { - bindings.CommitmentUpdate_set_update_add_htlcs(this.ptr, (uint32_t[])Arrays.stream(val).map(arr_conv_15 -> arr_conv_15 == null ? 0 : arr_conv_15.ptr & ~1).toArray()); + bindings.CommitmentUpdate_set_update_add_htlcs(this.ptr, (number[])Arrays.stream(val).map(arr_conv_15 -> arr_conv_15 == null ? 0 : arr_conv_15.ptr & ~1).toArray()); /* TODO 2 UpdateAddHTLC */; } public void set_update_fulfill_htlcs(UpdateFulfillHTLC[] val) { - bindings.CommitmentUpdate_set_update_fulfill_htlcs(this.ptr, (uint32_t[])Arrays.stream(val).map(arr_conv_19 -> arr_conv_19 == null ? 0 : arr_conv_19.ptr & ~1).toArray()); + bindings.CommitmentUpdate_set_update_fulfill_htlcs(this.ptr, (number[])Arrays.stream(val).map(arr_conv_19 -> arr_conv_19 == null ? 0 : arr_conv_19.ptr & ~1).toArray()); /* TODO 2 UpdateFulfillHTLC */; } public void set_update_fail_htlcs(UpdateFailHTLC[] val) { - bindings.CommitmentUpdate_set_update_fail_htlcs(this.ptr, (uint32_t[])Arrays.stream(val).map(arr_conv_16 -> arr_conv_16 == null ? 0 : arr_conv_16.ptr & ~1).toArray()); + bindings.CommitmentUpdate_set_update_fail_htlcs(this.ptr, (number[])Arrays.stream(val).map(arr_conv_16 -> arr_conv_16 == null ? 0 : arr_conv_16.ptr & ~1).toArray()); /* TODO 2 UpdateFailHTLC */; } public void set_update_fail_malformed_htlcs(UpdateFailMalformedHTLC[] val) { - bindings.CommitmentUpdate_set_update_fail_malformed_htlcs(this.ptr, (uint32_t[])Arrays.stream(val).map(arr_conv_25 -> arr_conv_25 == null ? 0 : arr_conv_25.ptr & ~1).toArray()); + bindings.CommitmentUpdate_set_update_fail_malformed_htlcs(this.ptr, (number[])Arrays.stream(val).map(arr_conv_25 -> arr_conv_25 == null ? 0 : arr_conv_25.ptr & ~1).toArray()); /* TODO 2 UpdateFailMalformedHTLC */; } public UpdateFee get_update_fee() { - uint32_t ret = bindings.CommitmentUpdate_get_update_fee(this.ptr); - UpdateFee ret_hu_conv = new UpdateFee(null, ret); + number ret = bindings.CommitmentUpdate_get_update_fee(this.ptr); + const ret_hu_conv: UpdateFee = new UpdateFee(null, ret); return ret_hu_conv; } @@ -48,8 +56,8 @@ public class CommitmentUpdate extends CommonBase { } public CommitmentSigned get_commitment_signed() { - uint32_t ret = bindings.CommitmentUpdate_get_commitment_signed(this.ptr); - CommitmentSigned ret_hu_conv = new CommitmentSigned(null, ret); + number ret = bindings.CommitmentUpdate_get_commitment_signed(this.ptr); + const ret_hu_conv: CommitmentSigned = new CommitmentSigned(null, ret); return ret_hu_conv; } @@ -59,8 +67,8 @@ public class CommitmentUpdate extends CommonBase { } 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) { - uint32_t ret = bindings.CommitmentUpdate_new((uint32_t[])Arrays.stream(update_add_htlcs_arg).map(arr_conv_15 -> arr_conv_15 == null ? 0 : arr_conv_15.ptr & ~1).toArray(), (uint32_t[])Arrays.stream(update_fulfill_htlcs_arg).map(arr_conv_19 -> arr_conv_19 == null ? 0 : arr_conv_19.ptr & ~1).toArray(), (uint32_t[])Arrays.stream(update_fail_htlcs_arg).map(arr_conv_16 -> arr_conv_16 == null ? 0 : arr_conv_16.ptr & ~1).toArray(), (uint32_t[])Arrays.stream(update_fail_malformed_htlcs_arg).map(arr_conv_25 -> arr_conv_25 == null ? 0 : arr_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); - CommitmentUpdate ret_hu_conv = new CommitmentUpdate(null, ret); + number ret = bindings.CommitmentUpdate_new((number[])Arrays.stream(update_add_htlcs_arg).map(arr_conv_15 -> arr_conv_15 == null ? 0 : arr_conv_15.ptr & ~1).toArray(), (number[])Arrays.stream(update_fulfill_htlcs_arg).map(arr_conv_19 -> arr_conv_19 == null ? 0 : arr_conv_19.ptr & ~1).toArray(), (number[])Arrays.stream(update_fail_htlcs_arg).map(arr_conv_16 -> arr_conv_16 == null ? 0 : arr_conv_16.ptr & ~1).toArray(), (number[])Arrays.stream(update_fail_malformed_htlcs_arg).map(arr_conv_25 -> arr_conv_25 == null ? 0 : arr_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); + const ret_hu_conv: CommitmentUpdate = new CommitmentUpdate(null, ret); /* TODO 2 UpdateAddHTLC */; /* TODO 2 UpdateFulfillHTLC */; /* TODO 2 UpdateFailHTLC */; diff --git a/ts/structs/CommonBase.ts b/ts/structs/CommonBase.ts index e216b7ae..2f7a0f01 100644 --- a/ts/structs/CommonBase.ts +++ b/ts/structs/CommonBase.ts @@ -1,8 +1,10 @@ export default class CommonBase { ptr: number; - ptrs_to: object[] = new Array(); // new LinkedList(); TODO: build linked list implementation + ptrs_to: object[] = []; // new LinkedList(); TODO: build linked list implementation protected constructor(ptr: number) { this.ptr = ptr; } public _test_only_get_ptr(): number { return this.ptr; } + protected finalize() { + // TODO: finalize myself + } } - \ No newline at end of file diff --git a/ts/structs/CounterpartyChannelTransactionParameters.ts b/ts/structs/CounterpartyChannelTransactionParameters.ts index 827aadbe..55dcf04d 100644 --- a/ts/structs/CounterpartyChannelTransactionParameters.ts +++ b/ts/structs/CounterpartyChannelTransactionParameters.ts @@ -1,24 +1,32 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class CounterpartyChannelTransactionParameters extends CommonBase { - CounterpartyChannelTransactionParameters(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.CounterpartyChannelTransactionParameters_free(ptr); } - } + + export default class CounterpartyChannelTransactionParameters extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.CounterpartyChannelTransactionParameters_free(this.ptr); + } + } public CounterpartyChannelTransactionParameters clone() { - uint32_t ret = bindings.CounterpartyChannelTransactionParameters_clone(this.ptr); - CounterpartyChannelTransactionParameters ret_hu_conv = new CounterpartyChannelTransactionParameters(null, ret); + number ret = bindings.CounterpartyChannelTransactionParameters_clone(this.ptr); + const ret_hu_conv: CounterpartyChannelTransactionParameters = new CounterpartyChannelTransactionParameters(null, ret); return ret_hu_conv; } public ChannelPublicKeys get_pubkeys() { - uint32_t ret = bindings.CounterpartyChannelTransactionParameters_get_pubkeys(this.ptr); - ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret); + number ret = bindings.CounterpartyChannelTransactionParameters_get_pubkeys(this.ptr); + const ret_hu_conv: ChannelPublicKeys = new ChannelPublicKeys(null, ret); return ret_hu_conv; } @@ -27,30 +35,30 @@ public class CounterpartyChannelTransactionParameters extends CommonBase { this.ptrs_to.add(val); } - public short get_selected_contest_delay() { - short ret = bindings.CounterpartyChannelTransactionParameters_get_selected_contest_delay(this.ptr); + public number get_selected_contest_delay() { + number ret = bindings.CounterpartyChannelTransactionParameters_get_selected_contest_delay(this.ptr); return ret; } - public void set_selected_contest_delay(short val) { + public void set_selected_contest_delay(number val) { bindings.CounterpartyChannelTransactionParameters_set_selected_contest_delay(this.ptr, val); } - public static CounterpartyChannelTransactionParameters constructor_new(ChannelPublicKeys pubkeys_arg, short selected_contest_delay_arg) { - uint32_t ret = bindings.CounterpartyChannelTransactionParameters_new(pubkeys_arg == null ? 0 : pubkeys_arg.ptr & ~1, selected_contest_delay_arg); - CounterpartyChannelTransactionParameters ret_hu_conv = new CounterpartyChannelTransactionParameters(null, ret); + public static CounterpartyChannelTransactionParameters constructor_new(ChannelPublicKeys pubkeys_arg, number selected_contest_delay_arg) { + number ret = bindings.CounterpartyChannelTransactionParameters_new(pubkeys_arg == null ? 0 : pubkeys_arg.ptr & ~1, selected_contest_delay_arg); + const ret_hu_conv: CounterpartyChannelTransactionParameters = new CounterpartyChannelTransactionParameters(null, ret); ret_hu_conv.ptrs_to.add(pubkeys_arg); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.CounterpartyChannelTransactionParameters_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.CounterpartyChannelTransactionParameters_write(this.ptr); return ret; } - public static CounterpartyChannelTransactionParameters constructor_read(byte[] ser) { - uint32_t ret = bindings.CounterpartyChannelTransactionParameters_read(ser); - CounterpartyChannelTransactionParameters ret_hu_conv = new CounterpartyChannelTransactionParameters(null, ret); + public static CounterpartyChannelTransactionParameters constructor_read(Uint8Array ser) { + number ret = bindings.CounterpartyChannelTransactionParameters_read(ser); + const ret_hu_conv: CounterpartyChannelTransactionParameters = new CounterpartyChannelTransactionParameters(null, ret); return ret_hu_conv; } diff --git a/ts/structs/DataLossProtect.ts b/ts/structs/DataLossProtect.ts index 4b38a8b1..7e1183a1 100644 --- a/ts/structs/DataLossProtect.ts +++ b/ts/structs/DataLossProtect.ts @@ -1,42 +1,50 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class DataLossProtect extends CommonBase { - DataLossProtect(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.DataLossProtect_free(ptr); } - } + + export default class DataLossProtect extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.DataLossProtect_free(this.ptr); + } + } public DataLossProtect clone() { - uint32_t ret = bindings.DataLossProtect_clone(this.ptr); - DataLossProtect ret_hu_conv = new DataLossProtect(null, ret); + number ret = bindings.DataLossProtect_clone(this.ptr); + const ret_hu_conv: DataLossProtect = new DataLossProtect(null, ret); return ret_hu_conv; } - public byte[] get_your_last_per_commitment_secret() { - byte[] ret = bindings.DataLossProtect_get_your_last_per_commitment_secret(this.ptr); + public Uint8Array get_your_last_per_commitment_secret() { + Uint8Array ret = bindings.DataLossProtect_get_your_last_per_commitment_secret(this.ptr); return ret; } - public void set_your_last_per_commitment_secret(byte[] val) { + public void set_your_last_per_commitment_secret(Uint8Array val) { bindings.DataLossProtect_set_your_last_per_commitment_secret(this.ptr, val); } - public byte[] get_my_current_per_commitment_point() { - byte[] ret = bindings.DataLossProtect_get_my_current_per_commitment_point(this.ptr); + public Uint8Array get_my_current_per_commitment_point() { + Uint8Array ret = bindings.DataLossProtect_get_my_current_per_commitment_point(this.ptr); return ret; } - public void set_my_current_per_commitment_point(byte[] val) { + public void set_my_current_per_commitment_point(Uint8Array val) { bindings.DataLossProtect_set_my_current_per_commitment_point(this.ptr, val); } - public static DataLossProtect constructor_new(byte[] your_last_per_commitment_secret_arg, byte[] my_current_per_commitment_point_arg) { - uint32_t ret = bindings.DataLossProtect_new(your_last_per_commitment_secret_arg, my_current_per_commitment_point_arg); - DataLossProtect ret_hu_conv = new DataLossProtect(null, ret); + public static DataLossProtect constructor_new(Uint8Array your_last_per_commitment_secret_arg, Uint8Array my_current_per_commitment_point_arg) { + number ret = bindings.DataLossProtect_new(your_last_per_commitment_secret_arg, my_current_per_commitment_point_arg); + const ret_hu_conv: DataLossProtect = new DataLossProtect(null, ret); return ret_hu_conv; } diff --git a/ts/structs/DecodeError.ts b/ts/structs/DecodeError.ts index 399dbb15..fc3278b4 100644 --- a/ts/structs/DecodeError.ts +++ b/ts/structs/DecodeError.ts @@ -1,13 +1,21 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class DecodeError extends CommonBase { - DecodeError(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.DecodeError_free(ptr); } - } + + export default class DecodeError extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.DecodeError_free(this.ptr); + } + } } diff --git a/ts/structs/DirectedChannelTransactionParameters.ts b/ts/structs/DirectedChannelTransactionParameters.ts index d507ac60..cc57f1ec 100644 --- a/ts/structs/DirectedChannelTransactionParameters.ts +++ b/ts/structs/DirectedChannelTransactionParameters.ts @@ -1,29 +1,37 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class DirectedChannelTransactionParameters extends CommonBase { - DirectedChannelTransactionParameters(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.DirectedChannelTransactionParameters_free(ptr); } - } + + export default class DirectedChannelTransactionParameters extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.DirectedChannelTransactionParameters_free(this.ptr); + } + } public ChannelPublicKeys broadcaster_pubkeys() { - uint32_t ret = bindings.DirectedChannelTransactionParameters_broadcaster_pubkeys(this.ptr); - ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret); + number ret = bindings.DirectedChannelTransactionParameters_broadcaster_pubkeys(this.ptr); + const ret_hu_conv: ChannelPublicKeys = new ChannelPublicKeys(null, ret); return ret_hu_conv; } public ChannelPublicKeys countersignatory_pubkeys() { - uint32_t ret = bindings.DirectedChannelTransactionParameters_countersignatory_pubkeys(this.ptr); - ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret); + number ret = bindings.DirectedChannelTransactionParameters_countersignatory_pubkeys(this.ptr); + const ret_hu_conv: ChannelPublicKeys = new ChannelPublicKeys(null, ret); return ret_hu_conv; } - public short contest_delay() { - short ret = bindings.DirectedChannelTransactionParameters_contest_delay(this.ptr); + public number contest_delay() { + number ret = bindings.DirectedChannelTransactionParameters_contest_delay(this.ptr); return ret; } @@ -33,8 +41,8 @@ public class DirectedChannelTransactionParameters extends CommonBase { } public OutPoint funding_outpoint() { - uint32_t ret = bindings.DirectedChannelTransactionParameters_funding_outpoint(this.ptr); - OutPoint ret_hu_conv = new OutPoint(null, ret); + number ret = bindings.DirectedChannelTransactionParameters_funding_outpoint(this.ptr); + const ret_hu_conv: OutPoint = new OutPoint(null, ret); return ret_hu_conv; } diff --git a/ts/structs/DirectionalChannelInfo.ts b/ts/structs/DirectionalChannelInfo.ts index a1aaa346..4f80064e 100644 --- a/ts/structs/DirectionalChannelInfo.ts +++ b/ts/structs/DirectionalChannelInfo.ts @@ -1,21 +1,29 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class DirectionalChannelInfo extends CommonBase { - DirectionalChannelInfo(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.DirectionalChannelInfo_free(ptr); } - } - public int get_last_update() { - int ret = bindings.DirectionalChannelInfo_get_last_update(this.ptr); + + export default class DirectionalChannelInfo extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.DirectionalChannelInfo_free(this.ptr); + } + } + public number get_last_update() { + number ret = bindings.DirectionalChannelInfo_get_last_update(this.ptr); return ret; } - public void set_last_update(int val) { + public void set_last_update(number val) { bindings.DirectionalChannelInfo_set_last_update(this.ptr, val); } @@ -28,27 +36,27 @@ public class DirectionalChannelInfo extends CommonBase { bindings.DirectionalChannelInfo_set_enabled(this.ptr, val); } - public short get_cltv_expiry_delta() { - short ret = bindings.DirectionalChannelInfo_get_cltv_expiry_delta(this.ptr); + public number get_cltv_expiry_delta() { + number ret = bindings.DirectionalChannelInfo_get_cltv_expiry_delta(this.ptr); return ret; } - public void set_cltv_expiry_delta(short val) { + public void set_cltv_expiry_delta(number val) { bindings.DirectionalChannelInfo_set_cltv_expiry_delta(this.ptr, val); } - public long get_htlc_minimum_msat() { - long ret = bindings.DirectionalChannelInfo_get_htlc_minimum_msat(this.ptr); + public number get_htlc_minimum_msat() { + number ret = bindings.DirectionalChannelInfo_get_htlc_minimum_msat(this.ptr); return ret; } - public void set_htlc_minimum_msat(long val) { + public void set_htlc_minimum_msat(number val) { bindings.DirectionalChannelInfo_set_htlc_minimum_msat(this.ptr, val); } public RoutingFees get_fees() { - uint32_t ret = bindings.DirectionalChannelInfo_get_fees(this.ptr); - RoutingFees ret_hu_conv = new RoutingFees(null, ret); + number ret = bindings.DirectionalChannelInfo_get_fees(this.ptr); + const ret_hu_conv: RoutingFees = new RoutingFees(null, ret); return ret_hu_conv; } @@ -58,8 +66,8 @@ public class DirectionalChannelInfo extends CommonBase { } public ChannelUpdate get_last_update_message() { - uint32_t ret = bindings.DirectionalChannelInfo_get_last_update_message(this.ptr); - ChannelUpdate ret_hu_conv = new ChannelUpdate(null, ret); + number ret = bindings.DirectionalChannelInfo_get_last_update_message(this.ptr); + const ret_hu_conv: ChannelUpdate = new ChannelUpdate(null, ret); return ret_hu_conv; } @@ -68,14 +76,14 @@ public class DirectionalChannelInfo extends CommonBase { this.ptrs_to.add(val); } - public byte[] write() { - byte[] ret = bindings.DirectionalChannelInfo_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.DirectionalChannelInfo_write(this.ptr); return ret; } - public static DirectionalChannelInfo constructor_read(byte[] ser) { - uint32_t ret = bindings.DirectionalChannelInfo_read(ser); - DirectionalChannelInfo ret_hu_conv = new DirectionalChannelInfo(null, ret); + public static DirectionalChannelInfo constructor_read(Uint8Array ser) { + number ret = bindings.DirectionalChannelInfo_read(ser); + const ret_hu_conv: DirectionalChannelInfo = new DirectionalChannelInfo(null, ret); return ret_hu_conv; } diff --git a/ts/structs/ErrorAction.ts b/ts/structs/ErrorAction.ts index 9c3a7574..cbdfa17e 100644 --- a/ts/structs/ErrorAction.ts +++ b/ts/structs/ErrorAction.ts @@ -27,8 +27,8 @@ export class DisconnectPeer extends ErrorAction { public msg: ErrorMessage; private constructor(ptr: number, obj: bindings.LDKErrorAction.DisconnectPeer) { super(null, ptr); - const msg: uint32_t = obj.msg; - ErrorMessage msg_hu_conv = new ErrorMessage(null, msg); + const msg: number = obj.msg; + const msg_hu_conv: ErrorMessage = new ErrorMessage(null, msg); this.msg = msg_hu_conv; } } @@ -41,8 +41,8 @@ export class SendErrorMessage extends ErrorAction { public msg: ErrorMessage; private constructor(ptr: number, obj: bindings.LDKErrorAction.SendErrorMessage) { super(null, ptr); - const msg: uint32_t = obj.msg; - ErrorMessage msg_hu_conv = new ErrorMessage(null, msg); + const msg: number = obj.msg; + const msg_hu_conv: ErrorMessage = new ErrorMessage(null, msg); this.msg = msg_hu_conv; } } diff --git a/ts/structs/ErrorMessage.ts b/ts/structs/ErrorMessage.ts index 992af3a1..6551cc06 100644 --- a/ts/structs/ErrorMessage.ts +++ b/ts/structs/ErrorMessage.ts @@ -1,27 +1,35 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class ErrorMessage extends CommonBase { - ErrorMessage(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.ErrorMessage_free(ptr); } - } + + export default class ErrorMessage extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.ErrorMessage_free(this.ptr); + } + } public ErrorMessage clone() { - uint32_t ret = bindings.ErrorMessage_clone(this.ptr); - ErrorMessage ret_hu_conv = new ErrorMessage(null, ret); + number ret = bindings.ErrorMessage_clone(this.ptr); + const ret_hu_conv: ErrorMessage = new ErrorMessage(null, ret); return ret_hu_conv; } - public byte[] get_channel_id() { - byte[] ret = bindings.ErrorMessage_get_channel_id(this.ptr); + public Uint8Array get_channel_id() { + Uint8Array ret = bindings.ErrorMessage_get_channel_id(this.ptr); return ret; } - public void set_channel_id(byte[] val) { + public void set_channel_id(Uint8Array val) { bindings.ErrorMessage_set_channel_id(this.ptr, val); } @@ -30,23 +38,23 @@ public class ErrorMessage extends CommonBase { return ret; } - public void set_data(byte[] val) { + public void set_data(Uint8Array val) { bindings.ErrorMessage_set_data(this.ptr, val); } - public static ErrorMessage constructor_new(byte[] channel_id_arg, byte[] data_arg) { - uint32_t ret = bindings.ErrorMessage_new(channel_id_arg, data_arg); - ErrorMessage ret_hu_conv = new ErrorMessage(null, ret); + public static ErrorMessage constructor_new(Uint8Array channel_id_arg, Uint8Array data_arg) { + number ret = bindings.ErrorMessage_new(channel_id_arg, data_arg); + const ret_hu_conv: ErrorMessage = new ErrorMessage(null, ret); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.ErrorMessage_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.ErrorMessage_write(this.ptr); return ret; } - public static Result_ErrorMessageDecodeErrorZ constructor_read(byte[] ser) { - uint32_t ret = bindings.ErrorMessage_read(ser); + public static Result_ErrorMessageDecodeErrorZ constructor_read(Uint8Array ser) { + number ret = bindings.ErrorMessage_read(ser); Result_ErrorMessageDecodeErrorZ ret_hu_conv = Result_ErrorMessageDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/ts/structs/Event.ts b/ts/structs/Event.ts index bddf17ba..fdf0a8c2 100644 --- a/ts/structs/Event.ts +++ b/ts/structs/Event.ts @@ -36,10 +36,10 @@ export default class Event extends CommonBase { } export class FundingGenerationReady extends Event { - public temporary_channel_id: byte[]; - public channel_value_satoshis: long; - public output_script: byte[]; - public user_channel_id: long; + public temporary_channel_id: Uint8Array; + public channel_value_satoshis: number; + public output_script: Uint8Array; + public user_channel_id: number; private constructor(ptr: number, obj: bindings.LDKEvent.FundingGenerationReady) { super(null, ptr); this.temporary_channel_id = obj.temporary_channel_id; @@ -50,19 +50,19 @@ export class FundingGenerationReady extends Event { } export class FundingBroadcastSafe extends Event { public funding_txo: OutPoint; - public user_channel_id: long; + public user_channel_id: number; private constructor(ptr: number, obj: bindings.LDKEvent.FundingBroadcastSafe) { super(null, ptr); - const funding_txo: uint32_t = obj.funding_txo; - OutPoint funding_txo_hu_conv = new OutPoint(null, funding_txo); + const funding_txo: number = obj.funding_txo; + const funding_txo_hu_conv: OutPoint = new OutPoint(null, funding_txo); this.funding_txo = funding_txo_hu_conv; this.user_channel_id = obj.user_channel_id; } } export class PaymentReceived extends Event { - public payment_hash: byte[]; - public payment_secret: byte[]; - public amt: long; + public payment_hash: Uint8Array; + public payment_secret: Uint8Array; + public amt: number; private constructor(ptr: number, obj: bindings.LDKEvent.PaymentReceived) { super(null, ptr); this.payment_hash = obj.payment_hash; @@ -71,14 +71,14 @@ export class PaymentReceived extends Event { } } export class PaymentSent extends Event { - public payment_preimage: byte[]; + public payment_preimage: Uint8Array; private constructor(ptr: number, obj: bindings.LDKEvent.PaymentSent) { super(null, ptr); this.payment_preimage = obj.payment_preimage; } } export class PaymentFailed extends Event { - public payment_hash: byte[]; + public payment_hash: Uint8Array; public rejected_by_dest: boolean; private constructor(ptr: number, obj: bindings.LDKEvent.PaymentFailed) { super(null, ptr); @@ -87,7 +87,7 @@ export class PaymentFailed extends Event { } } export class PendingHTLCsForwardable extends Event { - public time_forwardable: long; + public time_forwardable: number; private constructor(ptr: number, obj: bindings.LDKEvent.PendingHTLCsForwardable) { super(null, ptr); this.time_forwardable = obj.time_forwardable; @@ -97,10 +97,10 @@ export class SpendableOutputs extends Event { public outputs: SpendableOutputDescriptor[]; private constructor(ptr: number, obj: bindings.LDKEvent.SpendableOutputs) { super(null, ptr); - const outputs: uint32_t[] = obj.outputs; + const outputs: number[] = obj.outputs; SpendableOutputDescriptor[] arr_conv_27_arr = new SpendableOutputDescriptor[outputs.length]; for (int b = 0; b < outputs.length; b++) { - uint32_t arr_conv_27 = outputs[b]; + number arr_conv_27 = outputs[b]; SpendableOutputDescriptor arr_conv_27_hu_conv = SpendableOutputDescriptor.constr_from_ptr(arr_conv_27); arr_conv_27_hu_conv.ptrs_to.add(this); arr_conv_27_arr[b] = arr_conv_27_hu_conv; diff --git a/ts/structs/EventsProvider.ts b/ts/structs/EventsProvider.ts index 5c7b48f4..111c2a5b 100644 --- a/ts/structs/EventsProvider.ts +++ b/ts/structs/EventsProvider.ts @@ -1,8 +1,63 @@ + + +import CommonBase from './CommonBase'; +import * as bindings from '../bindings' // TODO: figure out location + + + + export class EventsProvider extends CommonBase { + + bindings_instance?: bindings.LDKEventsProvider; + + constructor(ptr?: number, arg?: bindings.LDKEventsProvider) { + if (Number.isFinite(ptr)) { + super(ptr); + this.bindings_instance = null; + } else { + // TODO: private constructor instantiation + super(bindings.LDKEventsProvider_new(arg)); + this.ptrs_to.push(arg); + + } + } + + protected finalize() { + if (this.ptr != 0) { + bindings.EventsProvider_free(this.ptr); + } + super.finalize(); + } + + static new_impl(arg: EventsProviderInterface): EventsProvider { + const impl_holder: LDKEventsProviderHolder = new LDKEventsProviderHolder(); + let structImplementation = { + // todo: in-line interface filling + get_and_clear_pending_events (): number[] { + Event[] ret = arg.get_and_clear_pending_events(); + result: number[] = (number[])Arrays.stream(ret).map(arr_conv_7 -> arr_conv_7.ptr).toArray(); + /* TODO 2 Event */; + return result; + }, + + + }; + impl_holder.held = new EventsProvider (null, structImplementation); + } + } + + export interface EventsProviderInterface { + get_and_clear_pending_events(): Event[]; + + } + + class LDKEventsProviderHolder { + held: EventsProvider; + } public Event[] get_and_clear_pending_events() { - uint32_t[] ret = bindings.EventsProvider_get_and_clear_pending_events(this.ptr); + number[] ret = bindings.EventsProvider_get_and_clear_pending_events(this.ptr); Event[] arr_conv_7_arr = new Event[ret.length]; for (int h = 0; h < ret.length; h++) { - uint32_t arr_conv_7 = ret[h]; + number arr_conv_7 = ret[h]; Event arr_conv_7_hu_conv = Event.constr_from_ptr(arr_conv_7); arr_conv_7_hu_conv.ptrs_to.add(this); arr_conv_7_arr[h] = arr_conv_7_hu_conv; diff --git a/ts/structs/FeeEstimator.ts b/ts/structs/FeeEstimator.ts index b392ee7d..2bcefda5 100644 --- a/ts/structs/FeeEstimator.ts +++ b/ts/structs/FeeEstimator.ts @@ -1,5 +1,58 @@ - public int get_est_sat_per_1000_weight(LDKConfirmationTarget confirmation_target) { - int ret = bindings.FeeEstimator_get_est_sat_per_1000_weight(this.ptr, confirmation_target); + + +import CommonBase from './CommonBase'; +import * as bindings from '../bindings' // TODO: figure out location + + + + export class FeeEstimator extends CommonBase { + + bindings_instance?: bindings.LDKFeeEstimator; + + constructor(ptr?: number, arg?: bindings.LDKFeeEstimator) { + if (Number.isFinite(ptr)) { + super(ptr); + this.bindings_instance = null; + } else { + // TODO: private constructor instantiation + super(bindings.LDKFeeEstimator_new(arg)); + this.ptrs_to.push(arg); + + } + } + + protected finalize() { + if (this.ptr != 0) { + bindings.FeeEstimator_free(this.ptr); + } + super.finalize(); + } + + static new_impl(arg: FeeEstimatorInterface): FeeEstimator { + const impl_holder: LDKFeeEstimatorHolder = new LDKFeeEstimatorHolder(); + let structImplementation = { + // todo: in-line interface filling + get_est_sat_per_1000_weight (confirmation_target: LDKConfirmationTarget): number { + number ret = arg.get_est_sat_per_1000_weight(confirmation_target); + return ret; + }, + + + }; + impl_holder.held = new FeeEstimator (null, structImplementation); + } + } + + export interface FeeEstimatorInterface { + get_est_sat_per_1000_weight(confirmation_target: LDKConfirmationTarget): number; + + } + + class LDKFeeEstimatorHolder { + held: FeeEstimator; + } + public number get_est_sat_per_1000_weight(LDKConfirmationTarget confirmation_target) { + number ret = bindings.FeeEstimator_get_est_sat_per_1000_weight(this.ptr, confirmation_target); return ret; } diff --git a/ts/structs/Filter.ts b/ts/structs/Filter.ts index 1e83264a..fa7bceb1 100644 --- a/ts/structs/Filter.ts +++ b/ts/structs/Filter.ts @@ -1,8 +1,66 @@ - public void register_tx(byte[] txid, byte[] script_pubkey) { + + +import CommonBase from './CommonBase'; +import * as bindings from '../bindings' // TODO: figure out location + + + + export class Filter extends CommonBase { + + bindings_instance?: bindings.LDKFilter; + + constructor(ptr?: number, arg?: bindings.LDKFilter) { + if (Number.isFinite(ptr)) { + super(ptr); + this.bindings_instance = null; + } else { + // TODO: private constructor instantiation + super(bindings.LDKFilter_new(arg)); + this.ptrs_to.push(arg); + + } + } + + protected finalize() { + if (this.ptr != 0) { + bindings.Filter_free(this.ptr); + } + super.finalize(); + } + + static new_impl(arg: FilterInterface): Filter { + const impl_holder: LDKFilterHolder = new LDKFilterHolder(); + let structImplementation = { + // todo: in-line interface filling + register_tx (txid: Uint8Array, script_pubkey: Uint8Array): void { + arg.register_tx(txid, script_pubkey); + }, + + register_output (outpoint: number, script_pubkey: Uint8Array): void { + const outpoint_hu_conv: OutPoint = new OutPoint(null, outpoint); + arg.register_output(outpoint_hu_conv, script_pubkey); + }, + + + }; + impl_holder.held = new Filter (null, structImplementation); + } + } + + export interface FilterInterface { + register_tx(txid: Uint8Array, script_pubkey: Uint8Array): void; + register_output(outpoint: OutPoint, script_pubkey: Uint8Array): void; + + } + + class LDKFilterHolder { + held: Filter; + } + public void register_tx(Uint8Array txid, Uint8Array script_pubkey) { bindings.Filter_register_tx(this.ptr, txid, script_pubkey); } - public void register_output(OutPoint outpoint, byte[] script_pubkey) { + public void register_output(OutPoint outpoint, Uint8Array script_pubkey) { bindings.Filter_register_output(this.ptr, outpoint == null ? 0 : outpoint.ptr & ~1, script_pubkey); this.ptrs_to.add(outpoint); } diff --git a/ts/structs/FundingCreated.ts b/ts/structs/FundingCreated.ts index fa68b8d3..8be1473c 100644 --- a/ts/structs/FundingCreated.ts +++ b/ts/structs/FundingCreated.ts @@ -1,71 +1,79 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class FundingCreated extends CommonBase { - FundingCreated(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.FundingCreated_free(ptr); } - } + + export default class FundingCreated extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.FundingCreated_free(this.ptr); + } + } public FundingCreated clone() { - uint32_t ret = bindings.FundingCreated_clone(this.ptr); - FundingCreated ret_hu_conv = new FundingCreated(null, ret); + number ret = bindings.FundingCreated_clone(this.ptr); + const ret_hu_conv: FundingCreated = new FundingCreated(null, ret); return ret_hu_conv; } - public byte[] get_temporary_channel_id() { - byte[] ret = bindings.FundingCreated_get_temporary_channel_id(this.ptr); + public Uint8Array get_temporary_channel_id() { + Uint8Array ret = bindings.FundingCreated_get_temporary_channel_id(this.ptr); return ret; } - public void set_temporary_channel_id(byte[] val) { + public void set_temporary_channel_id(Uint8Array val) { bindings.FundingCreated_set_temporary_channel_id(this.ptr, val); } - public byte[] get_funding_txid() { - byte[] ret = bindings.FundingCreated_get_funding_txid(this.ptr); + public Uint8Array get_funding_txid() { + Uint8Array ret = bindings.FundingCreated_get_funding_txid(this.ptr); return ret; } - public void set_funding_txid(byte[] val) { + public void set_funding_txid(Uint8Array val) { bindings.FundingCreated_set_funding_txid(this.ptr, val); } - public short get_funding_output_index() { - short ret = bindings.FundingCreated_get_funding_output_index(this.ptr); + public number get_funding_output_index() { + number ret = bindings.FundingCreated_get_funding_output_index(this.ptr); return ret; } - public void set_funding_output_index(short val) { + public void set_funding_output_index(number val) { bindings.FundingCreated_set_funding_output_index(this.ptr, val); } - public byte[] get_signature() { - byte[] ret = bindings.FundingCreated_get_signature(this.ptr); + public Uint8Array get_signature() { + Uint8Array ret = bindings.FundingCreated_get_signature(this.ptr); return ret; } - public void set_signature(byte[] val) { + public void set_signature(Uint8Array val) { bindings.FundingCreated_set_signature(this.ptr, val); } - public static FundingCreated constructor_new(byte[] temporary_channel_id_arg, byte[] funding_txid_arg, short funding_output_index_arg, byte[] signature_arg) { - uint32_t ret = bindings.FundingCreated_new(temporary_channel_id_arg, funding_txid_arg, funding_output_index_arg, signature_arg); - FundingCreated ret_hu_conv = new FundingCreated(null, ret); + public static FundingCreated constructor_new(Uint8Array temporary_channel_id_arg, Uint8Array funding_txid_arg, number funding_output_index_arg, Uint8Array signature_arg) { + number ret = bindings.FundingCreated_new(temporary_channel_id_arg, funding_txid_arg, funding_output_index_arg, signature_arg); + const ret_hu_conv: FundingCreated = new FundingCreated(null, ret); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.FundingCreated_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.FundingCreated_write(this.ptr); return ret; } - public static FundingCreated constructor_read(byte[] ser) { - uint32_t ret = bindings.FundingCreated_read(ser); - FundingCreated ret_hu_conv = new FundingCreated(null, ret); + public static FundingCreated constructor_read(Uint8Array ser) { + number ret = bindings.FundingCreated_read(ser); + const ret_hu_conv: FundingCreated = new FundingCreated(null, ret); return ret_hu_conv; } diff --git a/ts/structs/FundingLocked.ts b/ts/structs/FundingLocked.ts index aded6a50..80725c1b 100644 --- a/ts/structs/FundingLocked.ts +++ b/ts/structs/FundingLocked.ts @@ -1,53 +1,61 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class FundingLocked extends CommonBase { - FundingLocked(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.FundingLocked_free(ptr); } - } + + export default class FundingLocked extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.FundingLocked_free(this.ptr); + } + } public FundingLocked clone() { - uint32_t ret = bindings.FundingLocked_clone(this.ptr); - FundingLocked ret_hu_conv = new FundingLocked(null, ret); + number ret = bindings.FundingLocked_clone(this.ptr); + const ret_hu_conv: FundingLocked = new FundingLocked(null, ret); return ret_hu_conv; } - public byte[] get_channel_id() { - byte[] ret = bindings.FundingLocked_get_channel_id(this.ptr); + public Uint8Array get_channel_id() { + Uint8Array ret = bindings.FundingLocked_get_channel_id(this.ptr); return ret; } - public void set_channel_id(byte[] val) { + public void set_channel_id(Uint8Array val) { bindings.FundingLocked_set_channel_id(this.ptr, val); } - public byte[] get_next_per_commitment_point() { - byte[] ret = bindings.FundingLocked_get_next_per_commitment_point(this.ptr); + public Uint8Array get_next_per_commitment_point() { + Uint8Array ret = bindings.FundingLocked_get_next_per_commitment_point(this.ptr); return ret; } - public void set_next_per_commitment_point(byte[] val) { + public void set_next_per_commitment_point(Uint8Array val) { bindings.FundingLocked_set_next_per_commitment_point(this.ptr, val); } - public static FundingLocked constructor_new(byte[] channel_id_arg, byte[] next_per_commitment_point_arg) { - uint32_t ret = bindings.FundingLocked_new(channel_id_arg, next_per_commitment_point_arg); - FundingLocked ret_hu_conv = new FundingLocked(null, ret); + public static FundingLocked constructor_new(Uint8Array channel_id_arg, Uint8Array next_per_commitment_point_arg) { + number ret = bindings.FundingLocked_new(channel_id_arg, next_per_commitment_point_arg); + const ret_hu_conv: FundingLocked = new FundingLocked(null, ret); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.FundingLocked_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.FundingLocked_write(this.ptr); return ret; } - public static FundingLocked constructor_read(byte[] ser) { - uint32_t ret = bindings.FundingLocked_read(ser); - FundingLocked ret_hu_conv = new FundingLocked(null, ret); + public static FundingLocked constructor_read(Uint8Array ser) { + number ret = bindings.FundingLocked_read(ser); + const ret_hu_conv: FundingLocked = new FundingLocked(null, ret); return ret_hu_conv; } diff --git a/ts/structs/FundingSigned.ts b/ts/structs/FundingSigned.ts index 2308fe23..3a1a0731 100644 --- a/ts/structs/FundingSigned.ts +++ b/ts/structs/FundingSigned.ts @@ -1,53 +1,61 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class FundingSigned extends CommonBase { - FundingSigned(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.FundingSigned_free(ptr); } - } + + export default class FundingSigned extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.FundingSigned_free(this.ptr); + } + } public FundingSigned clone() { - uint32_t ret = bindings.FundingSigned_clone(this.ptr); - FundingSigned ret_hu_conv = new FundingSigned(null, ret); + number ret = bindings.FundingSigned_clone(this.ptr); + const ret_hu_conv: FundingSigned = new FundingSigned(null, ret); return ret_hu_conv; } - public byte[] get_channel_id() { - byte[] ret = bindings.FundingSigned_get_channel_id(this.ptr); + public Uint8Array get_channel_id() { + Uint8Array ret = bindings.FundingSigned_get_channel_id(this.ptr); return ret; } - public void set_channel_id(byte[] val) { + public void set_channel_id(Uint8Array val) { bindings.FundingSigned_set_channel_id(this.ptr, val); } - public byte[] get_signature() { - byte[] ret = bindings.FundingSigned_get_signature(this.ptr); + public Uint8Array get_signature() { + Uint8Array ret = bindings.FundingSigned_get_signature(this.ptr); return ret; } - public void set_signature(byte[] val) { + public void set_signature(Uint8Array val) { bindings.FundingSigned_set_signature(this.ptr, val); } - public static FundingSigned constructor_new(byte[] channel_id_arg, byte[] signature_arg) { - uint32_t ret = bindings.FundingSigned_new(channel_id_arg, signature_arg); - FundingSigned ret_hu_conv = new FundingSigned(null, ret); + public static FundingSigned constructor_new(Uint8Array channel_id_arg, Uint8Array signature_arg) { + number ret = bindings.FundingSigned_new(channel_id_arg, signature_arg); + const ret_hu_conv: FundingSigned = new FundingSigned(null, ret); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.FundingSigned_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.FundingSigned_write(this.ptr); return ret; } - public static FundingSigned constructor_read(byte[] ser) { - uint32_t ret = bindings.FundingSigned_read(ser); - FundingSigned ret_hu_conv = new FundingSigned(null, ret); + public static FundingSigned constructor_read(Uint8Array ser) { + number ret = bindings.FundingSigned_read(ser); + const ret_hu_conv: FundingSigned = new FundingSigned(null, ret); return ret_hu_conv; } diff --git a/ts/structs/GossipTimestampFilter.ts b/ts/structs/GossipTimestampFilter.ts index dc37eda7..012af416 100644 --- a/ts/structs/GossipTimestampFilter.ts +++ b/ts/structs/GossipTimestampFilter.ts @@ -1,62 +1,70 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class GossipTimestampFilter extends CommonBase { - GossipTimestampFilter(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.GossipTimestampFilter_free(ptr); } - } + + export default class GossipTimestampFilter extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.GossipTimestampFilter_free(this.ptr); + } + } public GossipTimestampFilter clone() { - uint32_t ret = bindings.GossipTimestampFilter_clone(this.ptr); - GossipTimestampFilter ret_hu_conv = new GossipTimestampFilter(null, ret); + number ret = bindings.GossipTimestampFilter_clone(this.ptr); + const ret_hu_conv: GossipTimestampFilter = new GossipTimestampFilter(null, ret); return ret_hu_conv; } - public byte[] get_chain_hash() { - byte[] ret = bindings.GossipTimestampFilter_get_chain_hash(this.ptr); + public Uint8Array get_chain_hash() { + Uint8Array ret = bindings.GossipTimestampFilter_get_chain_hash(this.ptr); return ret; } - public void set_chain_hash(byte[] val) { + public void set_chain_hash(Uint8Array val) { bindings.GossipTimestampFilter_set_chain_hash(this.ptr, val); } - public int get_first_timestamp() { - int ret = bindings.GossipTimestampFilter_get_first_timestamp(this.ptr); + public number get_first_timestamp() { + number ret = bindings.GossipTimestampFilter_get_first_timestamp(this.ptr); return ret; } - public void set_first_timestamp(int val) { + public void set_first_timestamp(number val) { bindings.GossipTimestampFilter_set_first_timestamp(this.ptr, val); } - public int get_timestamp_range() { - int ret = bindings.GossipTimestampFilter_get_timestamp_range(this.ptr); + public number get_timestamp_range() { + number ret = bindings.GossipTimestampFilter_get_timestamp_range(this.ptr); return ret; } - public void set_timestamp_range(int val) { + public void set_timestamp_range(number val) { bindings.GossipTimestampFilter_set_timestamp_range(this.ptr, val); } - public static GossipTimestampFilter constructor_new(byte[] chain_hash_arg, int first_timestamp_arg, int timestamp_range_arg) { - uint32_t ret = bindings.GossipTimestampFilter_new(chain_hash_arg, first_timestamp_arg, timestamp_range_arg); - GossipTimestampFilter ret_hu_conv = new GossipTimestampFilter(null, ret); + public static GossipTimestampFilter constructor_new(Uint8Array chain_hash_arg, number first_timestamp_arg, number timestamp_range_arg) { + number ret = bindings.GossipTimestampFilter_new(chain_hash_arg, first_timestamp_arg, timestamp_range_arg); + const ret_hu_conv: GossipTimestampFilter = new GossipTimestampFilter(null, ret); return ret_hu_conv; } - public static Result_GossipTimestampFilterDecodeErrorZ constructor_read(byte[] ser) { - uint32_t ret = bindings.GossipTimestampFilter_read(ser); + public static Result_GossipTimestampFilterDecodeErrorZ constructor_read(Uint8Array ser) { + number ret = bindings.GossipTimestampFilter_read(ser); Result_GossipTimestampFilterDecodeErrorZ ret_hu_conv = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.GossipTimestampFilter_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.GossipTimestampFilter_write(this.ptr); return ret; } diff --git a/ts/structs/HTLCFailChannelUpdate.ts b/ts/structs/HTLCFailChannelUpdate.ts index e2813c2a..2d33a138 100644 --- a/ts/structs/HTLCFailChannelUpdate.ts +++ b/ts/structs/HTLCFailChannelUpdate.ts @@ -27,13 +27,13 @@ export class ChannelUpdateMessage extends HTLCFailChannelUpdate { public msg: ChannelUpdate; private constructor(ptr: number, obj: bindings.LDKHTLCFailChannelUpdate.ChannelUpdateMessage) { super(null, ptr); - const msg: uint32_t = obj.msg; - ChannelUpdate msg_hu_conv = new ChannelUpdate(null, msg); + const msg: number = obj.msg; + const msg_hu_conv: ChannelUpdate = new ChannelUpdate(null, msg); this.msg = msg_hu_conv; } } export class ChannelClosed extends HTLCFailChannelUpdate { - public short_channel_id: long; + public short_channel_id: number; public is_permanent: boolean; private constructor(ptr: number, obj: bindings.LDKHTLCFailChannelUpdate.ChannelClosed) { super(null, ptr); @@ -42,7 +42,7 @@ export class ChannelClosed extends HTLCFailChannelUpdate { } } export class NodeFailure extends HTLCFailChannelUpdate { - public node_id: byte[]; + public node_id: Uint8Array; public is_permanent: boolean; private constructor(ptr: number, obj: bindings.LDKHTLCFailChannelUpdate.NodeFailure) { super(null, ptr); diff --git a/ts/structs/HTLCOutputInCommitment.ts b/ts/structs/HTLCOutputInCommitment.ts index cee9cf8e..938d16f8 100644 --- a/ts/structs/HTLCOutputInCommitment.ts +++ b/ts/structs/HTLCOutputInCommitment.ts @@ -1,18 +1,26 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class HTLCOutputInCommitment extends CommonBase { - HTLCOutputInCommitment(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.HTLCOutputInCommitment_free(ptr); } - } + + export default class HTLCOutputInCommitment extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.HTLCOutputInCommitment_free(this.ptr); + } + } public HTLCOutputInCommitment clone() { - uint32_t ret = bindings.HTLCOutputInCommitment_clone(this.ptr); - HTLCOutputInCommitment ret_hu_conv = new HTLCOutputInCommitment(null, ret); + number ret = bindings.HTLCOutputInCommitment_clone(this.ptr); + const ret_hu_conv: HTLCOutputInCommitment = new HTLCOutputInCommitment(null, ret); return ret_hu_conv; } @@ -25,41 +33,41 @@ public class HTLCOutputInCommitment extends CommonBase { bindings.HTLCOutputInCommitment_set_offered(this.ptr, val); } - public long get_amount_msat() { - long ret = bindings.HTLCOutputInCommitment_get_amount_msat(this.ptr); + public number get_amount_msat() { + number ret = bindings.HTLCOutputInCommitment_get_amount_msat(this.ptr); return ret; } - public void set_amount_msat(long val) { + public void set_amount_msat(number val) { bindings.HTLCOutputInCommitment_set_amount_msat(this.ptr, val); } - public int get_cltv_expiry() { - int ret = bindings.HTLCOutputInCommitment_get_cltv_expiry(this.ptr); + public number get_cltv_expiry() { + number ret = bindings.HTLCOutputInCommitment_get_cltv_expiry(this.ptr); return ret; } - public void set_cltv_expiry(int val) { + public void set_cltv_expiry(number val) { bindings.HTLCOutputInCommitment_set_cltv_expiry(this.ptr, val); } - public byte[] get_payment_hash() { - byte[] ret = bindings.HTLCOutputInCommitment_get_payment_hash(this.ptr); + public Uint8Array get_payment_hash() { + Uint8Array ret = bindings.HTLCOutputInCommitment_get_payment_hash(this.ptr); return ret; } - public void set_payment_hash(byte[] val) { + public void set_payment_hash(Uint8Array val) { bindings.HTLCOutputInCommitment_set_payment_hash(this.ptr, val); } - public byte[] write() { - byte[] ret = bindings.HTLCOutputInCommitment_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.HTLCOutputInCommitment_write(this.ptr); return ret; } - public static HTLCOutputInCommitment constructor_read(byte[] ser) { - uint32_t ret = bindings.HTLCOutputInCommitment_read(ser); - HTLCOutputInCommitment ret_hu_conv = new HTLCOutputInCommitment(null, ret); + public static HTLCOutputInCommitment constructor_read(Uint8Array ser) { + number ret = bindings.HTLCOutputInCommitment_read(ser); + const ret_hu_conv: HTLCOutputInCommitment = new HTLCOutputInCommitment(null, ret); return ret_hu_conv; } diff --git a/ts/structs/HTLCUpdate.ts b/ts/structs/HTLCUpdate.ts index deb3d0f1..52dd102e 100644 --- a/ts/structs/HTLCUpdate.ts +++ b/ts/structs/HTLCUpdate.ts @@ -1,29 +1,37 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class HTLCUpdate extends CommonBase { - HTLCUpdate(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.HTLCUpdate_free(ptr); } - } + + export default class HTLCUpdate extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.HTLCUpdate_free(this.ptr); + } + } public HTLCUpdate clone() { - uint32_t ret = bindings.HTLCUpdate_clone(this.ptr); - HTLCUpdate ret_hu_conv = new HTLCUpdate(null, ret); + number ret = bindings.HTLCUpdate_clone(this.ptr); + const ret_hu_conv: HTLCUpdate = new HTLCUpdate(null, ret); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.HTLCUpdate_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.HTLCUpdate_write(this.ptr); return ret; } - public static HTLCUpdate constructor_read(byte[] ser) { - uint32_t ret = bindings.HTLCUpdate_read(ser); - HTLCUpdate ret_hu_conv = new HTLCUpdate(null, ret); + public static HTLCUpdate constructor_read(Uint8Array ser) { + number ret = bindings.HTLCUpdate_read(ser); + const ret_hu_conv: HTLCUpdate = new HTLCUpdate(null, ret); return ret_hu_conv; } diff --git a/ts/structs/HolderCommitmentTransaction.ts b/ts/structs/HolderCommitmentTransaction.ts index 576fda2b..ad485a4c 100644 --- a/ts/structs/HolderCommitmentTransaction.ts +++ b/ts/structs/HolderCommitmentTransaction.ts @@ -1,48 +1,56 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class HolderCommitmentTransaction extends CommonBase { - HolderCommitmentTransaction(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.HolderCommitmentTransaction_free(ptr); } - } + + export default class HolderCommitmentTransaction extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.HolderCommitmentTransaction_free(this.ptr); + } + } public HolderCommitmentTransaction clone() { - uint32_t ret = bindings.HolderCommitmentTransaction_clone(this.ptr); - HolderCommitmentTransaction ret_hu_conv = new HolderCommitmentTransaction(null, ret); + number ret = bindings.HolderCommitmentTransaction_clone(this.ptr); + const ret_hu_conv: HolderCommitmentTransaction = new HolderCommitmentTransaction(null, ret); return ret_hu_conv; } - public byte[] get_counterparty_sig() { - byte[] ret = bindings.HolderCommitmentTransaction_get_counterparty_sig(this.ptr); + public Uint8Array get_counterparty_sig() { + Uint8Array ret = bindings.HolderCommitmentTransaction_get_counterparty_sig(this.ptr); return ret; } - public void set_counterparty_sig(byte[] val) { + public void set_counterparty_sig(Uint8Array val) { bindings.HolderCommitmentTransaction_set_counterparty_sig(this.ptr, val); } - public void set_counterparty_htlc_sigs(byte[][] val) { + public void set_counterparty_htlc_sigs(Uint8Array[] val) { bindings.HolderCommitmentTransaction_set_counterparty_htlc_sigs(this.ptr, val); } - public byte[] write() { - byte[] ret = bindings.HolderCommitmentTransaction_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.HolderCommitmentTransaction_write(this.ptr); return ret; } - public static HolderCommitmentTransaction constructor_read(byte[] ser) { - uint32_t ret = bindings.HolderCommitmentTransaction_read(ser); - HolderCommitmentTransaction ret_hu_conv = new HolderCommitmentTransaction(null, ret); + public static HolderCommitmentTransaction constructor_read(Uint8Array ser) { + number ret = bindings.HolderCommitmentTransaction_read(ser); + const ret_hu_conv: HolderCommitmentTransaction = new HolderCommitmentTransaction(null, ret); return ret_hu_conv; } - public static HolderCommitmentTransaction constructor_new(CommitmentTransaction commitment_tx, byte[] counterparty_sig, byte[][] counterparty_htlc_sigs, byte[] holder_funding_key, byte[] counterparty_funding_key) { - uint32_t ret = bindings.HolderCommitmentTransaction_new(commitment_tx == null ? 0 : commitment_tx.ptr & ~1, counterparty_sig, counterparty_htlc_sigs, holder_funding_key, counterparty_funding_key); - HolderCommitmentTransaction ret_hu_conv = new HolderCommitmentTransaction(null, ret); + public static HolderCommitmentTransaction constructor_new(CommitmentTransaction commitment_tx, Uint8Array counterparty_sig, Uint8Array[] counterparty_htlc_sigs, Uint8Array holder_funding_key, Uint8Array counterparty_funding_key) { + number ret = bindings.HolderCommitmentTransaction_new(commitment_tx == null ? 0 : commitment_tx.ptr & ~1, counterparty_sig, counterparty_htlc_sigs, holder_funding_key, counterparty_funding_key); + const ret_hu_conv: HolderCommitmentTransaction = new HolderCommitmentTransaction(null, ret); ret_hu_conv.ptrs_to.add(commitment_tx); return ret_hu_conv; } diff --git a/ts/structs/InMemoryChannelKeys.ts b/ts/structs/InMemoryChannelKeys.ts index d3517b54..4e4e375f 100644 --- a/ts/structs/InMemoryChannelKeys.ts +++ b/ts/structs/InMemoryChannelKeys.ts @@ -1,94 +1,102 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class InMemoryChannelKeys extends CommonBase { - InMemoryChannelKeys(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.InMemoryChannelKeys_free(ptr); } - } + + export default class InMemoryChannelKeys extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.InMemoryChannelKeys_free(this.ptr); + } + } public InMemoryChannelKeys clone() { - uint32_t ret = bindings.InMemoryChannelKeys_clone(this.ptr); - InMemoryChannelKeys ret_hu_conv = new InMemoryChannelKeys(null, ret); + number ret = bindings.InMemoryChannelKeys_clone(this.ptr); + const ret_hu_conv: InMemoryChannelKeys = new InMemoryChannelKeys(null, ret); return ret_hu_conv; } - public byte[] get_funding_key() { - byte[] ret = bindings.InMemoryChannelKeys_get_funding_key(this.ptr); + public Uint8Array get_funding_key() { + Uint8Array ret = bindings.InMemoryChannelKeys_get_funding_key(this.ptr); return ret; } - public void set_funding_key(byte[] val) { + public void set_funding_key(Uint8Array val) { bindings.InMemoryChannelKeys_set_funding_key(this.ptr, val); } - public byte[] get_revocation_base_key() { - byte[] ret = bindings.InMemoryChannelKeys_get_revocation_base_key(this.ptr); + public Uint8Array get_revocation_base_key() { + Uint8Array ret = bindings.InMemoryChannelKeys_get_revocation_base_key(this.ptr); return ret; } - public void set_revocation_base_key(byte[] val) { + public void set_revocation_base_key(Uint8Array val) { bindings.InMemoryChannelKeys_set_revocation_base_key(this.ptr, val); } - public byte[] get_payment_key() { - byte[] ret = bindings.InMemoryChannelKeys_get_payment_key(this.ptr); + public Uint8Array get_payment_key() { + Uint8Array ret = bindings.InMemoryChannelKeys_get_payment_key(this.ptr); return ret; } - public void set_payment_key(byte[] val) { + public void set_payment_key(Uint8Array val) { bindings.InMemoryChannelKeys_set_payment_key(this.ptr, val); } - public byte[] get_delayed_payment_base_key() { - byte[] ret = bindings.InMemoryChannelKeys_get_delayed_payment_base_key(this.ptr); + public Uint8Array get_delayed_payment_base_key() { + Uint8Array ret = bindings.InMemoryChannelKeys_get_delayed_payment_base_key(this.ptr); return ret; } - public void set_delayed_payment_base_key(byte[] val) { + public void set_delayed_payment_base_key(Uint8Array val) { bindings.InMemoryChannelKeys_set_delayed_payment_base_key(this.ptr, val); } - public byte[] get_htlc_base_key() { - byte[] ret = bindings.InMemoryChannelKeys_get_htlc_base_key(this.ptr); + public Uint8Array get_htlc_base_key() { + Uint8Array ret = bindings.InMemoryChannelKeys_get_htlc_base_key(this.ptr); return ret; } - public void set_htlc_base_key(byte[] val) { + public void set_htlc_base_key(Uint8Array val) { bindings.InMemoryChannelKeys_set_htlc_base_key(this.ptr, val); } - public byte[] get_commitment_seed() { - byte[] ret = bindings.InMemoryChannelKeys_get_commitment_seed(this.ptr); + public Uint8Array get_commitment_seed() { + Uint8Array ret = bindings.InMemoryChannelKeys_get_commitment_seed(this.ptr); return ret; } - public void set_commitment_seed(byte[] val) { + public void set_commitment_seed(Uint8Array val) { bindings.InMemoryChannelKeys_set_commitment_seed(this.ptr, val); } - public static InMemoryChannelKeys constructor_new(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, TwoTuple key_derivation_params) { - uint32_t ret = bindings.InMemoryChannelKeys_new(funding_key, revocation_base_key, payment_key, delayed_payment_base_key, htlc_base_key, commitment_seed, channel_value_satoshis, bindings.C2Tuple_u64u64Z_new(key_derivation_params.a, key_derivation_params.b)); - InMemoryChannelKeys ret_hu_conv = new InMemoryChannelKeys(null, ret); + public static InMemoryChannelKeys constructor_new(Uint8Array funding_key, Uint8Array revocation_base_key, Uint8Array payment_key, Uint8Array delayed_payment_base_key, Uint8Array htlc_base_key, Uint8Array commitment_seed, number channel_value_satoshis, TwoTuple key_derivation_params) { + number ret = bindings.InMemoryChannelKeys_new(funding_key, revocation_base_key, payment_key, delayed_payment_base_key, htlc_base_key, commitment_seed, channel_value_satoshis, bindings.C2Tuple_u64u64Z_new(key_derivation_params.a, key_derivation_params.b)); + const ret_hu_conv: InMemoryChannelKeys = new InMemoryChannelKeys(null, ret); return ret_hu_conv; } public ChannelPublicKeys counterparty_pubkeys() { - uint32_t ret = bindings.InMemoryChannelKeys_counterparty_pubkeys(this.ptr); - ChannelPublicKeys ret_hu_conv = new ChannelPublicKeys(null, ret); + number ret = bindings.InMemoryChannelKeys_counterparty_pubkeys(this.ptr); + const ret_hu_conv: ChannelPublicKeys = new ChannelPublicKeys(null, ret); return ret_hu_conv; } - public short counterparty_selected_contest_delay() { - short ret = bindings.InMemoryChannelKeys_counterparty_selected_contest_delay(this.ptr); + public number counterparty_selected_contest_delay() { + number ret = bindings.InMemoryChannelKeys_counterparty_selected_contest_delay(this.ptr); return ret; } - public short holder_selected_contest_delay() { - short ret = bindings.InMemoryChannelKeys_holder_selected_contest_delay(this.ptr); + public number holder_selected_contest_delay() { + number ret = bindings.InMemoryChannelKeys_holder_selected_contest_delay(this.ptr); return ret; } @@ -98,31 +106,31 @@ public class InMemoryChannelKeys extends CommonBase { } public OutPoint funding_outpoint() { - uint32_t ret = bindings.InMemoryChannelKeys_funding_outpoint(this.ptr); - OutPoint ret_hu_conv = new OutPoint(null, ret); + number ret = bindings.InMemoryChannelKeys_funding_outpoint(this.ptr); + const ret_hu_conv: OutPoint = new OutPoint(null, ret); return ret_hu_conv; } public ChannelTransactionParameters get_channel_parameters() { - uint32_t ret = bindings.InMemoryChannelKeys_get_channel_parameters(this.ptr); - ChannelTransactionParameters ret_hu_conv = new ChannelTransactionParameters(null, ret); + number ret = bindings.InMemoryChannelKeys_get_channel_parameters(this.ptr); + const ret_hu_conv: ChannelTransactionParameters = new ChannelTransactionParameters(null, ret); return ret_hu_conv; } public ChannelKeys as_ChannelKeys() { - uint32_t ret = bindings.InMemoryChannelKeys_as_ChannelKeys(this.ptr); + number ret = bindings.InMemoryChannelKeys_as_ChannelKeys(this.ptr); ChannelKeys ret_hu_conv = new ChannelKeys(null, ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.InMemoryChannelKeys_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.InMemoryChannelKeys_write(this.ptr); return ret; } - public static Result_InMemoryChannelKeysDecodeErrorZ constructor_read(byte[] ser) { - uint32_t ret = bindings.InMemoryChannelKeys_read(ser); + public static Result_InMemoryChannelKeysDecodeErrorZ constructor_read(Uint8Array ser) { + number ret = bindings.InMemoryChannelKeys_read(ser); Result_InMemoryChannelKeysDecodeErrorZ ret_hu_conv = Result_InMemoryChannelKeysDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/ts/structs/Init.ts b/ts/structs/Init.ts index b1cca231..69918e57 100644 --- a/ts/structs/Init.ts +++ b/ts/structs/Init.ts @@ -1,28 +1,36 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class Init extends CommonBase { - Init(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.Init_free(ptr); } - } + + export default class Init extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.Init_free(this.ptr); + } + } public Init clone() { - uint32_t ret = bindings.Init_clone(this.ptr); - Init ret_hu_conv = new Init(null, ret); + number ret = bindings.Init_clone(this.ptr); + const ret_hu_conv: Init = new Init(null, ret); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.Init_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.Init_write(this.ptr); return ret; } - public static Result_InitDecodeErrorZ constructor_read(byte[] ser) { - uint32_t ret = bindings.Init_read(ser); + public static Result_InitDecodeErrorZ constructor_read(Uint8Array ser) { + number ret = bindings.Init_read(ser); Result_InitDecodeErrorZ ret_hu_conv = Result_InitDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/ts/structs/InitFeatures.ts b/ts/structs/InitFeatures.ts index 2987b614..e38641d2 100644 --- a/ts/structs/InitFeatures.ts +++ b/ts/structs/InitFeatures.ts @@ -1,13 +1,21 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class InitFeatures extends CommonBase { - InitFeatures(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.InitFeatures_free(ptr); } - } + + export default class InitFeatures extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.InitFeatures_free(this.ptr); + } + } } diff --git a/ts/structs/KeysInterface.ts b/ts/structs/KeysInterface.ts index eebd78e0..c51f0b8b 100644 --- a/ts/structs/KeysInterface.ts +++ b/ts/structs/KeysInterface.ts @@ -1,32 +1,118 @@ - public byte[] get_node_secret() { - byte[] ret = bindings.KeysInterface_get_node_secret(this.ptr); + + +import CommonBase from './CommonBase'; +import * as bindings from '../bindings' // TODO: figure out location + + + + export class KeysInterface extends CommonBase { + + bindings_instance?: bindings.LDKKeysInterface; + + constructor(ptr?: number, arg?: bindings.LDKKeysInterface) { + if (Number.isFinite(ptr)) { + super(ptr); + this.bindings_instance = null; + } else { + // TODO: private constructor instantiation + super(bindings.LDKKeysInterface_new(arg)); + this.ptrs_to.push(arg); + + } + } + + protected finalize() { + if (this.ptr != 0) { + bindings.KeysInterface_free(this.ptr); + } + super.finalize(); + } + + static new_impl(arg: KeysInterfaceInterface): KeysInterface { + const impl_holder: LDKKeysInterfaceHolder = new LDKKeysInterfaceHolder(); + let structImplementation = { + // todo: in-line interface filling + get_node_secret (): Uint8Array { + Uint8Array ret = arg.get_node_secret(); + return ret; + }, + + get_destination_script (): Uint8Array { + Uint8Array ret = arg.get_destination_script(); + return ret; + }, + + get_shutdown_pubkey (): Uint8Array { + Uint8Array ret = arg.get_shutdown_pubkey(); + return ret; + }, + + get_channel_keys (inbound: boolean, channel_value_satoshis: number): number { + ChannelKeys ret = arg.get_channel_keys(inbound, channel_value_satoshis); + result: number = ret == null ? 0 : ret.ptr; + impl_holder.held.ptrs_to.add(ret); + return result; + }, + + get_secure_random_bytes (): Uint8Array { + Uint8Array ret = arg.get_secure_random_bytes(); + return ret; + }, + + read_chan_signer (reader: Uint8Array): number { + Result_ChanKeySignerDecodeErrorZ ret = arg.read_chan_signer(reader); + result: number = ret != null ? ret.ptr : 0; + return result; + }, + + + }; + impl_holder.held = new KeysInterface (null, structImplementation); + } + } + + export interface KeysInterfaceInterface { + get_node_secret(): Uint8Array; + get_destination_script(): Uint8Array; + get_shutdown_pubkey(): Uint8Array; + get_channel_keys(inbound: boolean, channel_value_satoshis: number): ChannelKeys; + get_secure_random_bytes(): Uint8Array; + read_chan_signer(reader: Uint8Array): Result_ChanKeySignerDecodeErrorZ; + + } + + class LDKKeysInterfaceHolder { + held: KeysInterface; + } + public Uint8Array get_node_secret() { + Uint8Array ret = bindings.KeysInterface_get_node_secret(this.ptr); return ret; } - public byte[] get_destination_script() { - byte[] ret = bindings.KeysInterface_get_destination_script(this.ptr); + public Uint8Array get_destination_script() { + Uint8Array ret = bindings.KeysInterface_get_destination_script(this.ptr); return ret; } - public byte[] get_shutdown_pubkey() { - byte[] ret = bindings.KeysInterface_get_shutdown_pubkey(this.ptr); + public Uint8Array get_shutdown_pubkey() { + Uint8Array ret = bindings.KeysInterface_get_shutdown_pubkey(this.ptr); return ret; } - public ChannelKeys get_channel_keys(boolean inbound, long channel_value_satoshis) { - uint32_t ret = bindings.KeysInterface_get_channel_keys(this.ptr, inbound, channel_value_satoshis); + public ChannelKeys get_channel_keys(boolean inbound, number channel_value_satoshis) { + number ret = bindings.KeysInterface_get_channel_keys(this.ptr, inbound, channel_value_satoshis); ChannelKeys ret_hu_conv = new ChannelKeys(null, ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } - public byte[] get_secure_random_bytes() { - byte[] ret = bindings.KeysInterface_get_secure_random_bytes(this.ptr); + public Uint8Array get_secure_random_bytes() { + Uint8Array ret = bindings.KeysInterface_get_secure_random_bytes(this.ptr); return ret; } - public Result_ChanKeySignerDecodeErrorZ read_chan_signer(byte[] reader) { - uint32_t ret = bindings.KeysInterface_read_chan_signer(this.ptr, reader); + public Result_ChanKeySignerDecodeErrorZ read_chan_signer(Uint8Array reader) { + number ret = bindings.KeysInterface_read_chan_signer(this.ptr, reader); Result_ChanKeySignerDecodeErrorZ ret_hu_conv = Result_ChanKeySignerDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/ts/structs/KeysManager.ts b/ts/structs/KeysManager.ts index 028b16c9..6eefcc50 100644 --- a/ts/structs/KeysManager.ts +++ b/ts/structs/KeysManager.ts @@ -1,29 +1,37 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class KeysManager extends CommonBase { - KeysManager(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.KeysManager_free(ptr); } - } - public static KeysManager constructor_new(byte[] seed, LDKNetwork network, long starting_time_secs, int starting_time_nanos) { - uint32_t ret = bindings.KeysManager_new(seed, network, starting_time_secs, starting_time_nanos); - KeysManager ret_hu_conv = new KeysManager(null, ret); + + export default class KeysManager extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.KeysManager_free(this.ptr); + } + } + public static KeysManager constructor_new(Uint8Array seed, LDKNetwork network, number starting_time_secs, number starting_time_nanos) { + number ret = bindings.KeysManager_new(seed, network, starting_time_secs, starting_time_nanos); + const ret_hu_conv: KeysManager = new KeysManager(null, ret); return ret_hu_conv; } - public InMemoryChannelKeys derive_channel_keys(long channel_value_satoshis, long params_1, long params_2) { - uint32_t ret = bindings.KeysManager_derive_channel_keys(this.ptr, channel_value_satoshis, params_1, params_2); - InMemoryChannelKeys ret_hu_conv = new InMemoryChannelKeys(null, ret); + public InMemoryChannelKeys derive_channel_keys(number channel_value_satoshis, number params_1, number params_2) { + number ret = bindings.KeysManager_derive_channel_keys(this.ptr, channel_value_satoshis, params_1, params_2); + const ret_hu_conv: InMemoryChannelKeys = new InMemoryChannelKeys(null, ret); return ret_hu_conv; } public KeysInterface as_KeysInterface() { - uint32_t ret = bindings.KeysManager_as_KeysInterface(this.ptr); + number ret = bindings.KeysManager_as_KeysInterface(this.ptr); KeysInterface ret_hu_conv = new KeysInterface(null, ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; diff --git a/ts/structs/LightningError.ts b/ts/structs/LightningError.ts index eb434a32..57bf1809 100644 --- a/ts/structs/LightningError.ts +++ b/ts/structs/LightningError.ts @@ -1,26 +1,34 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class LightningError extends CommonBase { - LightningError(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.LightningError_free(ptr); } - } + + export default class LightningError extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.LightningError_free(this.ptr); + } + } public String get_err() { String ret = bindings.LightningError_get_err(this.ptr); return ret; } - public void set_err(byte[] val) { + public void set_err(Uint8Array val) { bindings.LightningError_set_err(this.ptr, val); } public ErrorAction get_action() { - uint32_t ret = bindings.LightningError_get_action(this.ptr); + number ret = bindings.LightningError_get_action(this.ptr); ErrorAction ret_hu_conv = ErrorAction.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; @@ -30,9 +38,9 @@ public class LightningError extends CommonBase { bindings.LightningError_set_action(this.ptr, val.ptr); } - public static LightningError constructor_new(byte[] err_arg, ErrorAction action_arg) { - uint32_t ret = bindings.LightningError_new(err_arg, action_arg.ptr); - LightningError ret_hu_conv = new LightningError(null, ret); + public static LightningError constructor_new(Uint8Array err_arg, ErrorAction action_arg) { + number ret = bindings.LightningError_new(err_arg, action_arg.ptr); + const ret_hu_conv: LightningError = new LightningError(null, ret); return ret_hu_conv; } diff --git a/ts/structs/LockedNetworkGraph.ts b/ts/structs/LockedNetworkGraph.ts index 8445929f..7928dc0e 100644 --- a/ts/structs/LockedNetworkGraph.ts +++ b/ts/structs/LockedNetworkGraph.ts @@ -1,16 +1,25 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class LockedNetworkGraph extends CommonBase implements AutoCloseable { - LockedNetworkGraph(Object _dummy, long ptr) { super(ptr); } - @Override public void close() { - if (ptr != 0) { bindings.LockedNetworkGraph_free(ptr); } - } + + export default class LockedNetworkGraph extends CommonBase implements AutoCloseable { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + public close() { + + if (this.ptr != 0) { + bindings.LockedNetworkGraph_free(this.ptr); + } + } public NetworkGraph graph() { - uint32_t ret = bindings.LockedNetworkGraph_graph(this.ptr); - NetworkGraph ret_hu_conv = new NetworkGraph(null, ret); + number ret = bindings.LockedNetworkGraph_graph(this.ptr); + const ret_hu_conv: NetworkGraph = new NetworkGraph(null, ret); return ret_hu_conv; } diff --git a/ts/structs/Logger.ts b/ts/structs/Logger.ts index 5c34318c..e70ca9bc 100644 --- a/ts/structs/Logger.ts +++ b/ts/structs/Logger.ts @@ -1 +1,53 @@ + + +import CommonBase from './CommonBase'; +import * as bindings from '../bindings' // TODO: figure out location + + + + export class Logger extends CommonBase { + + bindings_instance?: bindings.LDKLogger; + + constructor(ptr?: number, arg?: bindings.LDKLogger) { + if (Number.isFinite(ptr)) { + super(ptr); + this.bindings_instance = null; + } else { + // TODO: private constructor instantiation + super(bindings.LDKLogger_new(arg)); + this.ptrs_to.push(arg); + + } + } + + protected finalize() { + if (this.ptr != 0) { + bindings.Logger_free(this.ptr); + } + super.finalize(); + } + + static new_impl(arg: LoggerInterface): Logger { + const impl_holder: LDKLoggerHolder = new LDKLoggerHolder(); + let structImplementation = { + // todo: in-line interface filling + log (record: String): void { + arg.log(record); + }, + + + }; + impl_holder.held = new Logger (null, structImplementation); + } + } + + export interface LoggerInterface { + log(record: String): void; + + } + + class LDKLoggerHolder { + held: Logger; + } } diff --git a/ts/structs/MessageHandler.ts b/ts/structs/MessageHandler.ts index 78768dfd..3f69fec3 100644 --- a/ts/structs/MessageHandler.ts +++ b/ts/structs/MessageHandler.ts @@ -1,17 +1,25 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class MessageHandler extends CommonBase { - MessageHandler(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.MessageHandler_free(ptr); } - } + + export default class MessageHandler extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.MessageHandler_free(this.ptr); + } + } public ChannelMessageHandler get_chan_handler() { - uint32_t ret = bindings.MessageHandler_get_chan_handler(this.ptr); + number ret = bindings.MessageHandler_get_chan_handler(this.ptr); ChannelMessageHandler ret_hu_conv = new ChannelMessageHandler(null, ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; @@ -23,7 +31,7 @@ public class MessageHandler extends CommonBase { } public RoutingMessageHandler get_route_handler() { - uint32_t ret = bindings.MessageHandler_get_route_handler(this.ptr); + number ret = bindings.MessageHandler_get_route_handler(this.ptr); RoutingMessageHandler ret_hu_conv = new RoutingMessageHandler(null, ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; @@ -35,8 +43,8 @@ public class MessageHandler extends CommonBase { } public static MessageHandler constructor_new(ChannelMessageHandler chan_handler_arg, RoutingMessageHandler route_handler_arg) { - uint32_t ret = bindings.MessageHandler_new(chan_handler_arg == null ? 0 : chan_handler_arg.ptr, route_handler_arg == null ? 0 : route_handler_arg.ptr); - MessageHandler ret_hu_conv = new MessageHandler(null, ret); + number ret = bindings.MessageHandler_new(chan_handler_arg == null ? 0 : chan_handler_arg.ptr, route_handler_arg == null ? 0 : route_handler_arg.ptr); + const ret_hu_conv: MessageHandler = new MessageHandler(null, ret); ret_hu_conv.ptrs_to.add(chan_handler_arg); ret_hu_conv.ptrs_to.add(route_handler_arg); return ret_hu_conv; diff --git a/ts/structs/MessageSendEvent.ts b/ts/structs/MessageSendEvent.ts index 920df647..cab57130 100644 --- a/ts/structs/MessageSendEvent.ts +++ b/ts/structs/MessageSendEvent.ts @@ -69,123 +69,123 @@ export default class MessageSendEvent extends CommonBase { } export class SendAcceptChannel extends MessageSendEvent { - public node_id: byte[]; + public node_id: Uint8Array; public msg: AcceptChannel; private constructor(ptr: number, obj: bindings.LDKMessageSendEvent.SendAcceptChannel) { super(null, ptr); this.node_id = obj.node_id; - const msg: uint32_t = obj.msg; - AcceptChannel msg_hu_conv = new AcceptChannel(null, msg); + const msg: number = obj.msg; + const msg_hu_conv: AcceptChannel = new AcceptChannel(null, msg); this.msg = msg_hu_conv; } } export class SendOpenChannel extends MessageSendEvent { - public node_id: byte[]; + public node_id: Uint8Array; public msg: OpenChannel; private constructor(ptr: number, obj: bindings.LDKMessageSendEvent.SendOpenChannel) { super(null, ptr); this.node_id = obj.node_id; - const msg: uint32_t = obj.msg; - OpenChannel msg_hu_conv = new OpenChannel(null, msg); + const msg: number = obj.msg; + const msg_hu_conv: OpenChannel = new OpenChannel(null, msg); this.msg = msg_hu_conv; } } export class SendFundingCreated extends MessageSendEvent { - public node_id: byte[]; + public node_id: Uint8Array; public msg: FundingCreated; private constructor(ptr: number, obj: bindings.LDKMessageSendEvent.SendFundingCreated) { super(null, ptr); this.node_id = obj.node_id; - const msg: uint32_t = obj.msg; - FundingCreated msg_hu_conv = new FundingCreated(null, msg); + const msg: number = obj.msg; + const msg_hu_conv: FundingCreated = new FundingCreated(null, msg); this.msg = msg_hu_conv; } } export class SendFundingSigned extends MessageSendEvent { - public node_id: byte[]; + public node_id: Uint8Array; public msg: FundingSigned; private constructor(ptr: number, obj: bindings.LDKMessageSendEvent.SendFundingSigned) { super(null, ptr); this.node_id = obj.node_id; - const msg: uint32_t = obj.msg; - FundingSigned msg_hu_conv = new FundingSigned(null, msg); + const msg: number = obj.msg; + const msg_hu_conv: FundingSigned = new FundingSigned(null, msg); this.msg = msg_hu_conv; } } export class SendFundingLocked extends MessageSendEvent { - public node_id: byte[]; + public node_id: Uint8Array; public msg: FundingLocked; private constructor(ptr: number, obj: bindings.LDKMessageSendEvent.SendFundingLocked) { super(null, ptr); this.node_id = obj.node_id; - const msg: uint32_t = obj.msg; - FundingLocked msg_hu_conv = new FundingLocked(null, msg); + const msg: number = obj.msg; + const msg_hu_conv: FundingLocked = new FundingLocked(null, msg); this.msg = msg_hu_conv; } } export class SendAnnouncementSignatures extends MessageSendEvent { - public node_id: byte[]; + public node_id: Uint8Array; public msg: AnnouncementSignatures; private constructor(ptr: number, obj: bindings.LDKMessageSendEvent.SendAnnouncementSignatures) { super(null, ptr); this.node_id = obj.node_id; - const msg: uint32_t = obj.msg; - AnnouncementSignatures msg_hu_conv = new AnnouncementSignatures(null, msg); + const msg: number = obj.msg; + const msg_hu_conv: AnnouncementSignatures = new AnnouncementSignatures(null, msg); this.msg = msg_hu_conv; } } export class UpdateHTLCs extends MessageSendEvent { - public node_id: byte[]; + public node_id: Uint8Array; public updates: CommitmentUpdate; private constructor(ptr: number, obj: bindings.LDKMessageSendEvent.UpdateHTLCs) { super(null, ptr); this.node_id = obj.node_id; - const updates: uint32_t = obj.updates; - CommitmentUpdate updates_hu_conv = new CommitmentUpdate(null, updates); + const updates: number = obj.updates; + const updates_hu_conv: CommitmentUpdate = new CommitmentUpdate(null, updates); this.updates = updates_hu_conv; } } export class SendRevokeAndACK extends MessageSendEvent { - public node_id: byte[]; + public node_id: Uint8Array; public msg: RevokeAndACK; private constructor(ptr: number, obj: bindings.LDKMessageSendEvent.SendRevokeAndACK) { super(null, ptr); this.node_id = obj.node_id; - const msg: uint32_t = obj.msg; - RevokeAndACK msg_hu_conv = new RevokeAndACK(null, msg); + const msg: number = obj.msg; + const msg_hu_conv: RevokeAndACK = new RevokeAndACK(null, msg); this.msg = msg_hu_conv; } } export class SendClosingSigned extends MessageSendEvent { - public node_id: byte[]; + public node_id: Uint8Array; public msg: ClosingSigned; private constructor(ptr: number, obj: bindings.LDKMessageSendEvent.SendClosingSigned) { super(null, ptr); this.node_id = obj.node_id; - const msg: uint32_t = obj.msg; - ClosingSigned msg_hu_conv = new ClosingSigned(null, msg); + const msg: number = obj.msg; + const msg_hu_conv: ClosingSigned = new ClosingSigned(null, msg); this.msg = msg_hu_conv; } } export class SendShutdown extends MessageSendEvent { - public node_id: byte[]; + public node_id: Uint8Array; public msg: Shutdown; private constructor(ptr: number, obj: bindings.LDKMessageSendEvent.SendShutdown) { super(null, ptr); this.node_id = obj.node_id; - const msg: uint32_t = obj.msg; - Shutdown msg_hu_conv = new Shutdown(null, msg); + const msg: number = obj.msg; + const msg_hu_conv: Shutdown = new Shutdown(null, msg); this.msg = msg_hu_conv; } } export class SendChannelReestablish extends MessageSendEvent { - public node_id: byte[]; + public node_id: Uint8Array; public msg: ChannelReestablish; private constructor(ptr: number, obj: bindings.LDKMessageSendEvent.SendChannelReestablish) { super(null, ptr); this.node_id = obj.node_id; - const msg: uint32_t = obj.msg; - ChannelReestablish msg_hu_conv = new ChannelReestablish(null, msg); + const msg: number = obj.msg; + const msg_hu_conv: ChannelReestablish = new ChannelReestablish(null, msg); this.msg = msg_hu_conv; } } @@ -194,11 +194,11 @@ export class BroadcastChannelAnnouncement extends MessageSendEvent { public update_msg: ChannelUpdate; private constructor(ptr: number, obj: bindings.LDKMessageSendEvent.BroadcastChannelAnnouncement) { super(null, ptr); - const msg: uint32_t = obj.msg; - ChannelAnnouncement msg_hu_conv = new ChannelAnnouncement(null, msg); + const msg: number = obj.msg; + const msg_hu_conv: ChannelAnnouncement = new ChannelAnnouncement(null, msg); this.msg = msg_hu_conv; - const update_msg: uint32_t = obj.update_msg; - ChannelUpdate update_msg_hu_conv = new ChannelUpdate(null, update_msg); + const update_msg: number = obj.update_msg; + const update_msg_hu_conv: ChannelUpdate = new ChannelUpdate(null, update_msg); this.update_msg = update_msg_hu_conv; } } @@ -206,8 +206,8 @@ export class BroadcastNodeAnnouncement extends MessageSendEvent { public msg: NodeAnnouncement; private constructor(ptr: number, obj: bindings.LDKMessageSendEvent.BroadcastNodeAnnouncement) { super(null, ptr); - const msg: uint32_t = obj.msg; - NodeAnnouncement msg_hu_conv = new NodeAnnouncement(null, msg); + const msg: number = obj.msg; + const msg_hu_conv: NodeAnnouncement = new NodeAnnouncement(null, msg); this.msg = msg_hu_conv; } } @@ -215,18 +215,18 @@ export class BroadcastChannelUpdate extends MessageSendEvent { public msg: ChannelUpdate; private constructor(ptr: number, obj: bindings.LDKMessageSendEvent.BroadcastChannelUpdate) { super(null, ptr); - const msg: uint32_t = obj.msg; - ChannelUpdate msg_hu_conv = new ChannelUpdate(null, msg); + const msg: number = obj.msg; + const msg_hu_conv: ChannelUpdate = new ChannelUpdate(null, msg); this.msg = msg_hu_conv; } } export class HandleError extends MessageSendEvent { - public node_id: byte[]; + public node_id: Uint8Array; public action: ErrorAction; private constructor(ptr: number, obj: bindings.LDKMessageSendEvent.HandleError) { super(null, ptr); this.node_id = obj.node_id; - const action: uint32_t = obj.action; + const action: number = obj.action; ErrorAction action_hu_conv = ErrorAction.constr_from_ptr(action); action_hu_conv.ptrs_to.add(this); this.action = action_hu_conv; @@ -236,31 +236,31 @@ export class PaymentFailureNetworkUpdate extends MessageSendEvent { public update: HTLCFailChannelUpdate; private constructor(ptr: number, obj: bindings.LDKMessageSendEvent.PaymentFailureNetworkUpdate) { super(null, ptr); - const update: uint32_t = obj.update; + const update: number = obj.update; HTLCFailChannelUpdate update_hu_conv = HTLCFailChannelUpdate.constr_from_ptr(update); update_hu_conv.ptrs_to.add(this); this.update = update_hu_conv; } } export class SendChannelRangeQuery extends MessageSendEvent { - public node_id: byte[]; + public node_id: Uint8Array; public msg: QueryChannelRange; private constructor(ptr: number, obj: bindings.LDKMessageSendEvent.SendChannelRangeQuery) { super(null, ptr); this.node_id = obj.node_id; - const msg: uint32_t = obj.msg; - QueryChannelRange msg_hu_conv = new QueryChannelRange(null, msg); + const msg: number = obj.msg; + const msg_hu_conv: QueryChannelRange = new QueryChannelRange(null, msg); this.msg = msg_hu_conv; } } export class SendShortIdsQuery extends MessageSendEvent { - public node_id: byte[]; + public node_id: Uint8Array; public msg: QueryShortChannelIds; private constructor(ptr: number, obj: bindings.LDKMessageSendEvent.SendShortIdsQuery) { super(null, ptr); this.node_id = obj.node_id; - const msg: uint32_t = obj.msg; - QueryShortChannelIds msg_hu_conv = new QueryShortChannelIds(null, msg); + const msg: number = obj.msg; + const msg_hu_conv: QueryShortChannelIds = new QueryShortChannelIds(null, msg); this.msg = msg_hu_conv; } } diff --git a/ts/structs/MessageSendEventsProvider.ts b/ts/structs/MessageSendEventsProvider.ts index 844e5cad..3c05318c 100644 --- a/ts/structs/MessageSendEventsProvider.ts +++ b/ts/structs/MessageSendEventsProvider.ts @@ -1,8 +1,63 @@ + + +import CommonBase from './CommonBase'; +import * as bindings from '../bindings' // TODO: figure out location + + + + export class MessageSendEventsProvider extends CommonBase { + + bindings_instance?: bindings.LDKMessageSendEventsProvider; + + constructor(ptr?: number, arg?: bindings.LDKMessageSendEventsProvider) { + if (Number.isFinite(ptr)) { + super(ptr); + this.bindings_instance = null; + } else { + // TODO: private constructor instantiation + super(bindings.LDKMessageSendEventsProvider_new(arg)); + this.ptrs_to.push(arg); + + } + } + + protected finalize() { + if (this.ptr != 0) { + bindings.MessageSendEventsProvider_free(this.ptr); + } + super.finalize(); + } + + static new_impl(arg: MessageSendEventsProviderInterface): MessageSendEventsProvider { + const impl_holder: LDKMessageSendEventsProviderHolder = new LDKMessageSendEventsProviderHolder(); + let structImplementation = { + // todo: in-line interface filling + get_and_clear_pending_msg_events (): number[] { + MessageSendEvent[] ret = arg.get_and_clear_pending_msg_events(); + result: number[] = (number[])Arrays.stream(ret).map(arr_conv_18 -> arr_conv_18.ptr).toArray(); + /* TODO 2 MessageSendEvent */; + return result; + }, + + + }; + impl_holder.held = new MessageSendEventsProvider (null, structImplementation); + } + } + + export interface MessageSendEventsProviderInterface { + get_and_clear_pending_msg_events(): MessageSendEvent[]; + + } + + class LDKMessageSendEventsProviderHolder { + held: MessageSendEventsProvider; + } public MessageSendEvent[] get_and_clear_pending_msg_events() { - uint32_t[] ret = bindings.MessageSendEventsProvider_get_and_clear_pending_msg_events(this.ptr); + number[] ret = bindings.MessageSendEventsProvider_get_and_clear_pending_msg_events(this.ptr); MessageSendEvent[] arr_conv_18_arr = new MessageSendEvent[ret.length]; for (int s = 0; s < ret.length; s++) { - uint32_t arr_conv_18 = ret[s]; + number arr_conv_18 = ret[s]; MessageSendEvent arr_conv_18_hu_conv = MessageSendEvent.constr_from_ptr(arr_conv_18); arr_conv_18_hu_conv.ptrs_to.add(this); arr_conv_18_arr[s] = arr_conv_18_hu_conv; diff --git a/ts/structs/MonitorEvent.ts b/ts/structs/MonitorEvent.ts index 9123817c..2f654628 100644 --- a/ts/structs/MonitorEvent.ts +++ b/ts/structs/MonitorEvent.ts @@ -1,18 +1,26 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class MonitorEvent extends CommonBase { - MonitorEvent(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.MonitorEvent_free(ptr); } - } + + export default class MonitorEvent extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.MonitorEvent_free(this.ptr); + } + } public MonitorEvent clone() { - uint32_t ret = bindings.MonitorEvent_clone(this.ptr); - MonitorEvent ret_hu_conv = new MonitorEvent(null, ret); + number ret = bindings.MonitorEvent_clone(this.ptr); + const ret_hu_conv: MonitorEvent = new MonitorEvent(null, ret); return ret_hu_conv; } diff --git a/ts/structs/MonitorUpdateError.ts b/ts/structs/MonitorUpdateError.ts index 448e9ea0..8d379521 100644 --- a/ts/structs/MonitorUpdateError.ts +++ b/ts/structs/MonitorUpdateError.ts @@ -1,13 +1,21 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class MonitorUpdateError extends CommonBase { - MonitorUpdateError(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.MonitorUpdateError_free(ptr); } - } + + export default class MonitorUpdateError extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.MonitorUpdateError_free(this.ptr); + } + } } diff --git a/ts/structs/NetAddress.ts b/ts/structs/NetAddress.ts index 7292b184..3de3d2ef 100644 --- a/ts/structs/NetAddress.ts +++ b/ts/structs/NetAddress.ts @@ -27,8 +27,8 @@ export default class NetAddress extends CommonBase { } export class IPv4 extends NetAddress { - public addr: byte[]; - public port: short; + public addr: Uint8Array; + public port: number; private constructor(ptr: number, obj: bindings.LDKNetAddress.IPv4) { super(null, ptr); this.addr = obj.addr; @@ -36,8 +36,8 @@ export class IPv4 extends NetAddress { } } export class IPv6 extends NetAddress { - public addr: byte[]; - public port: short; + public addr: Uint8Array; + public port: number; private constructor(ptr: number, obj: bindings.LDKNetAddress.IPv6) { super(null, ptr); this.addr = obj.addr; @@ -45,8 +45,8 @@ export class IPv6 extends NetAddress { } } export class OnionV2 extends NetAddress { - public addr: byte[]; - public port: short; + public addr: Uint8Array; + public port: number; private constructor(ptr: number, obj: bindings.LDKNetAddress.OnionV2) { super(null, ptr); this.addr = obj.addr; @@ -54,10 +54,10 @@ export class OnionV2 extends NetAddress { } } export class OnionV3 extends NetAddress { - public ed25519_pubkey: byte[]; - public checksum: short; - public version: byte; - public port: short; + public ed25519_pubkey: Uint8Array; + public checksum: number; + public version: number; + public port: number; private constructor(ptr: number, obj: bindings.LDKNetAddress.OnionV3) { super(null, ptr); this.ed25519_pubkey = obj.ed25519_pubkey; diff --git a/ts/structs/NetGraphMsgHandler.ts b/ts/structs/NetGraphMsgHandler.ts index 6c1961d6..082de30a 100644 --- a/ts/structs/NetGraphMsgHandler.ts +++ b/ts/structs/NetGraphMsgHandler.ts @@ -1,46 +1,54 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class NetGraphMsgHandler extends CommonBase { - NetGraphMsgHandler(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.NetGraphMsgHandler_free(ptr); } - } - public static NetGraphMsgHandler constructor_new(byte[] genesis_hash, Access chain_access, Logger logger) { - uint32_t ret = bindings.NetGraphMsgHandler_new(genesis_hash, chain_access == null ? 0 : chain_access.ptr, logger == null ? 0 : logger.ptr); - NetGraphMsgHandler ret_hu_conv = new NetGraphMsgHandler(null, ret); + + export default class NetGraphMsgHandler extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.NetGraphMsgHandler_free(this.ptr); + } + } + public static NetGraphMsgHandler constructor_new(Uint8Array genesis_hash, Access chain_access, Logger logger) { + number ret = bindings.NetGraphMsgHandler_new(genesis_hash, chain_access == null ? 0 : chain_access.ptr, logger == null ? 0 : logger.ptr); + const ret_hu_conv: NetGraphMsgHandler = new NetGraphMsgHandler(null, ret); ret_hu_conv.ptrs_to.add(chain_access); ret_hu_conv.ptrs_to.add(logger); return ret_hu_conv; } - public static NetGraphMsgHandler constructor_from_net_graph(Access chain_access, Logger logger, byte[] network_graph_genesis_hash) { - uint32_t ret = bindings.NetGraphMsgHandler_from_net_graph(chain_access == null ? 0 : chain_access.ptr, logger == null ? 0 : logger.ptr, bindings.NetworkGraph_new(network_graph_genesis_hash)); - NetGraphMsgHandler ret_hu_conv = new NetGraphMsgHandler(null, ret); + public static NetGraphMsgHandler constructor_from_net_graph(Access chain_access, Logger logger, Uint8Array network_graph_genesis_hash) { + number ret = bindings.NetGraphMsgHandler_from_net_graph(chain_access == null ? 0 : chain_access.ptr, logger == null ? 0 : logger.ptr, bindings.NetworkGraph_new(network_graph_genesis_hash)); + const ret_hu_conv: NetGraphMsgHandler = new NetGraphMsgHandler(null, ret); ret_hu_conv.ptrs_to.add(chain_access); ret_hu_conv.ptrs_to.add(logger); return ret_hu_conv; } public LockedNetworkGraph read_locked_graph() { - uint32_t ret = bindings.NetGraphMsgHandler_read_locked_graph(this.ptr); - LockedNetworkGraph ret_hu_conv = new LockedNetworkGraph(null, ret); + number ret = bindings.NetGraphMsgHandler_read_locked_graph(this.ptr); + const ret_hu_conv: LockedNetworkGraph = new LockedNetworkGraph(null, ret); return ret_hu_conv; } public RoutingMessageHandler as_RoutingMessageHandler() { - uint32_t ret = bindings.NetGraphMsgHandler_as_RoutingMessageHandler(this.ptr); + number ret = bindings.NetGraphMsgHandler_as_RoutingMessageHandler(this.ptr); RoutingMessageHandler ret_hu_conv = new RoutingMessageHandler(null, ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; } public MessageSendEventsProvider as_MessageSendEventsProvider() { - uint32_t ret = bindings.NetGraphMsgHandler_as_MessageSendEventsProvider(this.ptr); + number ret = bindings.NetGraphMsgHandler_as_MessageSendEventsProvider(this.ptr); MessageSendEventsProvider ret_hu_conv = new MessageSendEventsProvider(null, ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; diff --git a/ts/structs/NetworkGraph.ts b/ts/structs/NetworkGraph.ts index 9f13f87c..9729f331 100644 --- a/ts/structs/NetworkGraph.ts +++ b/ts/structs/NetworkGraph.ts @@ -1,48 +1,56 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class NetworkGraph extends CommonBase { - NetworkGraph(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.NetworkGraph_free(ptr); } - } - public byte[] write() { - byte[] ret = bindings.NetworkGraph_write(this.ptr); + + export default class NetworkGraph extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.NetworkGraph_free(this.ptr); + } + } + public Uint8Array write() { + Uint8Array ret = bindings.NetworkGraph_write(this.ptr); return ret; } - public static Result_NetworkGraphDecodeErrorZ constructor_read(byte[] ser) { - uint32_t ret = bindings.NetworkGraph_read(ser); + public static Result_NetworkGraphDecodeErrorZ constructor_read(Uint8Array ser) { + number ret = bindings.NetworkGraph_read(ser); Result_NetworkGraphDecodeErrorZ ret_hu_conv = Result_NetworkGraphDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } - public static NetworkGraph constructor_new(byte[] genesis_hash) { - uint32_t ret = bindings.NetworkGraph_new(genesis_hash); - NetworkGraph ret_hu_conv = new NetworkGraph(null, ret); + public static NetworkGraph constructor_new(Uint8Array genesis_hash) { + number ret = bindings.NetworkGraph_new(genesis_hash); + const ret_hu_conv: NetworkGraph = new NetworkGraph(null, ret); return ret_hu_conv; } public Result_NoneLightningErrorZ update_node_from_announcement(NodeAnnouncement msg) { - uint32_t ret = bindings.NetworkGraph_update_node_from_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1); + number ret = bindings.NetworkGraph_update_node_from_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1); Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); this.ptrs_to.add(msg); return ret_hu_conv; } public Result_NoneLightningErrorZ update_node_from_unsigned_announcement(UnsignedNodeAnnouncement msg) { - uint32_t ret = bindings.NetworkGraph_update_node_from_unsigned_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1); + number ret = bindings.NetworkGraph_update_node_from_unsigned_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1); Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); this.ptrs_to.add(msg); return ret_hu_conv; } public Result_NoneLightningErrorZ update_channel_from_announcement(ChannelAnnouncement msg, Access chain_access) { - uint32_t ret = bindings.NetworkGraph_update_channel_from_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1, chain_access == null ? 0 : chain_access.ptr); + number ret = bindings.NetworkGraph_update_channel_from_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1, chain_access == null ? 0 : chain_access.ptr); Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); this.ptrs_to.add(msg); this.ptrs_to.add(chain_access); @@ -50,26 +58,26 @@ public class NetworkGraph extends CommonBase { } public Result_NoneLightningErrorZ update_channel_from_unsigned_announcement(UnsignedChannelAnnouncement msg, Access chain_access) { - uint32_t ret = bindings.NetworkGraph_update_channel_from_unsigned_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1, chain_access == null ? 0 : chain_access.ptr); + number ret = bindings.NetworkGraph_update_channel_from_unsigned_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1, chain_access == null ? 0 : chain_access.ptr); Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); this.ptrs_to.add(msg); this.ptrs_to.add(chain_access); return ret_hu_conv; } - public void close_channel_from_update(long short_channel_id, boolean is_permanent) { + public void close_channel_from_update(number short_channel_id, boolean is_permanent) { bindings.NetworkGraph_close_channel_from_update(this.ptr, short_channel_id, is_permanent); } public Result_NoneLightningErrorZ update_channel(ChannelUpdate msg) { - uint32_t ret = bindings.NetworkGraph_update_channel(this.ptr, msg == null ? 0 : msg.ptr & ~1); + number ret = bindings.NetworkGraph_update_channel(this.ptr, msg == null ? 0 : msg.ptr & ~1); Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); this.ptrs_to.add(msg); return ret_hu_conv; } public Result_NoneLightningErrorZ update_channel_unsigned(UnsignedChannelUpdate msg) { - uint32_t ret = bindings.NetworkGraph_update_channel_unsigned(this.ptr, msg == null ? 0 : msg.ptr & ~1); + number ret = bindings.NetworkGraph_update_channel_unsigned(this.ptr, msg == null ? 0 : msg.ptr & ~1); Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); this.ptrs_to.add(msg); return ret_hu_conv; diff --git a/ts/structs/NodeAnnouncement.ts b/ts/structs/NodeAnnouncement.ts index 15f60f6a..952f2bdf 100644 --- a/ts/structs/NodeAnnouncement.ts +++ b/ts/structs/NodeAnnouncement.ts @@ -1,33 +1,41 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class NodeAnnouncement extends CommonBase { - NodeAnnouncement(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.NodeAnnouncement_free(ptr); } - } + + export default class NodeAnnouncement extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.NodeAnnouncement_free(this.ptr); + } + } public NodeAnnouncement clone() { - uint32_t ret = bindings.NodeAnnouncement_clone(this.ptr); - NodeAnnouncement ret_hu_conv = new NodeAnnouncement(null, ret); + number ret = bindings.NodeAnnouncement_clone(this.ptr); + const ret_hu_conv: NodeAnnouncement = new NodeAnnouncement(null, ret); return ret_hu_conv; } - public byte[] get_signature() { - byte[] ret = bindings.NodeAnnouncement_get_signature(this.ptr); + public Uint8Array get_signature() { + Uint8Array ret = bindings.NodeAnnouncement_get_signature(this.ptr); return ret; } - public void set_signature(byte[] val) { + public void set_signature(Uint8Array val) { bindings.NodeAnnouncement_set_signature(this.ptr, val); } public UnsignedNodeAnnouncement get_contents() { - uint32_t ret = bindings.NodeAnnouncement_get_contents(this.ptr); - UnsignedNodeAnnouncement ret_hu_conv = new UnsignedNodeAnnouncement(null, ret); + number ret = bindings.NodeAnnouncement_get_contents(this.ptr); + const ret_hu_conv: UnsignedNodeAnnouncement = new UnsignedNodeAnnouncement(null, ret); return ret_hu_conv; } @@ -36,21 +44,21 @@ public class NodeAnnouncement extends CommonBase { this.ptrs_to.add(val); } - public static NodeAnnouncement constructor_new(byte[] signature_arg, UnsignedNodeAnnouncement contents_arg) { - uint32_t ret = bindings.NodeAnnouncement_new(signature_arg, contents_arg == null ? 0 : contents_arg.ptr & ~1); - NodeAnnouncement ret_hu_conv = new NodeAnnouncement(null, ret); + public static NodeAnnouncement constructor_new(Uint8Array signature_arg, UnsignedNodeAnnouncement contents_arg) { + number ret = bindings.NodeAnnouncement_new(signature_arg, contents_arg == null ? 0 : contents_arg.ptr & ~1); + const ret_hu_conv: NodeAnnouncement = new NodeAnnouncement(null, ret); ret_hu_conv.ptrs_to.add(contents_arg); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.NodeAnnouncement_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.NodeAnnouncement_write(this.ptr); return ret; } - public static NodeAnnouncement constructor_read(byte[] ser) { - uint32_t ret = bindings.NodeAnnouncement_read(ser); - NodeAnnouncement ret_hu_conv = new NodeAnnouncement(null, ret); + public static NodeAnnouncement constructor_read(Uint8Array ser) { + number ret = bindings.NodeAnnouncement_read(ser); + const ret_hu_conv: NodeAnnouncement = new NodeAnnouncement(null, ret); return ret_hu_conv; } diff --git a/ts/structs/NodeAnnouncementInfo.ts b/ts/structs/NodeAnnouncementInfo.ts index 2be83ad2..587f098f 100644 --- a/ts/structs/NodeAnnouncementInfo.ts +++ b/ts/structs/NodeAnnouncementInfo.ts @@ -1,18 +1,26 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class NodeAnnouncementInfo extends CommonBase { - NodeAnnouncementInfo(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.NodeAnnouncementInfo_free(ptr); } - } + + export default class NodeAnnouncementInfo extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.NodeAnnouncementInfo_free(this.ptr); + } + } public NodeFeatures get_features() { - uint32_t ret = bindings.NodeAnnouncementInfo_get_features(this.ptr); - NodeFeatures ret_hu_conv = new NodeFeatures(null, ret); + number ret = bindings.NodeAnnouncementInfo_get_features(this.ptr); + const ret_hu_conv: NodeFeatures = new NodeFeatures(null, ret); return ret_hu_conv; } @@ -21,41 +29,41 @@ public class NodeAnnouncementInfo extends CommonBase { this.ptrs_to.add(val); } - public int get_last_update() { - int ret = bindings.NodeAnnouncementInfo_get_last_update(this.ptr); + public number get_last_update() { + number ret = bindings.NodeAnnouncementInfo_get_last_update(this.ptr); return ret; } - public void set_last_update(int val) { + public void set_last_update(number val) { bindings.NodeAnnouncementInfo_set_last_update(this.ptr, val); } - public byte[] get_rgb() { - byte[] ret = bindings.NodeAnnouncementInfo_get_rgb(this.ptr); + public Uint8Array get_rgb() { + Uint8Array ret = bindings.NodeAnnouncementInfo_get_rgb(this.ptr); return ret; } - public void set_rgb(byte[] val) { + public void set_rgb(Uint8Array val) { bindings.NodeAnnouncementInfo_set_rgb(this.ptr, val); } - public byte[] get_alias() { - byte[] ret = bindings.NodeAnnouncementInfo_get_alias(this.ptr); + public Uint8Array get_alias() { + Uint8Array ret = bindings.NodeAnnouncementInfo_get_alias(this.ptr); return ret; } - public void set_alias(byte[] val) { + public void set_alias(Uint8Array val) { bindings.NodeAnnouncementInfo_set_alias(this.ptr, val); } public void set_addresses(NetAddress[] val) { - bindings.NodeAnnouncementInfo_set_addresses(this.ptr, (uint32_t[])Arrays.stream(val).map(arr_conv_12 -> arr_conv_12.ptr).toArray()); + bindings.NodeAnnouncementInfo_set_addresses(this.ptr, (number[])Arrays.stream(val).map(arr_conv_12 -> arr_conv_12.ptr).toArray()); /* TODO 2 NetAddress */; } public NodeAnnouncement get_announcement_message() { - uint32_t ret = bindings.NodeAnnouncementInfo_get_announcement_message(this.ptr); - NodeAnnouncement ret_hu_conv = new NodeAnnouncement(null, ret); + number ret = bindings.NodeAnnouncementInfo_get_announcement_message(this.ptr); + const ret_hu_conv: NodeAnnouncement = new NodeAnnouncement(null, ret); return ret_hu_conv; } @@ -64,22 +72,22 @@ public class NodeAnnouncementInfo extends CommonBase { this.ptrs_to.add(val); } - public static NodeAnnouncementInfo constructor_new(NodeFeatures features_arg, int last_update_arg, byte[] rgb_arg, byte[] alias_arg, NetAddress[] addresses_arg, NodeAnnouncement announcement_message_arg) { - uint32_t ret = bindings.NodeAnnouncementInfo_new(features_arg == null ? 0 : features_arg.ptr & ~1, last_update_arg, rgb_arg, alias_arg, (uint32_t[])Arrays.stream(addresses_arg).map(arr_conv_12 -> arr_conv_12.ptr).toArray(), announcement_message_arg == null ? 0 : announcement_message_arg.ptr & ~1); - NodeAnnouncementInfo ret_hu_conv = new NodeAnnouncementInfo(null, ret); + 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, (number[])Arrays.stream(addresses_arg).map(arr_conv_12 -> arr_conv_12.ptr).toArray(), 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(features_arg); /* TODO 2 NetAddress */; ret_hu_conv.ptrs_to.add(announcement_message_arg); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.NodeAnnouncementInfo_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.NodeAnnouncementInfo_write(this.ptr); return ret; } - public static Result_NodeAnnouncementInfoDecodeErrorZ constructor_read(byte[] ser) { - uint32_t ret = bindings.NodeAnnouncementInfo_read(ser); + public static Result_NodeAnnouncementInfoDecodeErrorZ constructor_read(Uint8Array ser) { + number ret = bindings.NodeAnnouncementInfo_read(ser); Result_NodeAnnouncementInfoDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/ts/structs/NodeFeatures.ts b/ts/structs/NodeFeatures.ts index 2b588757..d091079f 100644 --- a/ts/structs/NodeFeatures.ts +++ b/ts/structs/NodeFeatures.ts @@ -1,13 +1,21 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class NodeFeatures extends CommonBase { - NodeFeatures(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.NodeFeatures_free(ptr); } - } + + export default class NodeFeatures extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.NodeFeatures_free(this.ptr); + } + } } diff --git a/ts/structs/NodeInfo.ts b/ts/structs/NodeInfo.ts index adc6b131..dd830a6d 100644 --- a/ts/structs/NodeInfo.ts +++ b/ts/structs/NodeInfo.ts @@ -1,22 +1,30 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class NodeInfo extends CommonBase { - NodeInfo(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.NodeInfo_free(ptr); } - } - public void set_channels(long[] val) { + + export default class NodeInfo extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.NodeInfo_free(this.ptr); + } + } + public void set_channels(number[] val) { bindings.NodeInfo_set_channels(this.ptr, val); } public RoutingFees get_lowest_inbound_channel_fees() { - uint32_t ret = bindings.NodeInfo_get_lowest_inbound_channel_fees(this.ptr); - RoutingFees ret_hu_conv = new RoutingFees(null, ret); + number ret = bindings.NodeInfo_get_lowest_inbound_channel_fees(this.ptr); + const ret_hu_conv: RoutingFees = new RoutingFees(null, ret); return ret_hu_conv; } @@ -26,18 +34,18 @@ public class NodeInfo extends CommonBase { } public NodeAnnouncementInfo get_announcement_info() { - uint32_t ret = bindings.NodeInfo_get_announcement_info(this.ptr); - NodeAnnouncementInfo ret_hu_conv = new NodeAnnouncementInfo(null, ret); + number ret = bindings.NodeInfo_get_announcement_info(this.ptr); + const ret_hu_conv: NodeAnnouncementInfo = new NodeAnnouncementInfo(null, ret); return ret_hu_conv; } - public void set_announcement_info(NodeFeatures val_features_arg, int val_last_update_arg, byte[] val_rgb_arg, byte[] val_alias_arg, NetAddress[] val_addresses_arg, NodeAnnouncement val_announcement_message_arg) { - bindings.NodeInfo_set_announcement_info(this.ptr, bindings.NodeAnnouncementInfo_new(val_features_arg == null ? 0 : val_features_arg.ptr & ~1, val_last_update_arg, val_rgb_arg, val_alias_arg, (uint32_t[])Arrays.stream(val_addresses_arg).map(arr_conv_12 -> arr_conv_12.ptr).toArray(), val_announcement_message_arg == null ? 0 : val_announcement_message_arg.ptr & ~1)); + public void set_announcement_info(NodeFeatures val_features_arg, number val_last_update_arg, Uint8Array val_rgb_arg, Uint8Array val_alias_arg, NetAddress[] val_addresses_arg, NodeAnnouncement val_announcement_message_arg) { + bindings.NodeInfo_set_announcement_info(this.ptr, bindings.NodeAnnouncementInfo_new(val_features_arg == null ? 0 : val_features_arg.ptr & ~1, val_last_update_arg, val_rgb_arg, val_alias_arg, (number[])Arrays.stream(val_addresses_arg).map(arr_conv_12 -> arr_conv_12.ptr).toArray(), val_announcement_message_arg == null ? 0 : val_announcement_message_arg.ptr & ~1)); } - public static NodeInfo constructor_new(long[] channels_arg, RoutingFees lowest_inbound_channel_fees_arg, NodeFeatures announcement_info_arg_features_arg, int announcement_info_arg_last_update_arg, byte[] announcement_info_arg_rgb_arg, byte[] announcement_info_arg_alias_arg, NetAddress[] announcement_info_arg_addresses_arg, NodeAnnouncement announcement_info_arg_announcement_message_arg) { - uint32_t ret = bindings.NodeInfo_new(channels_arg, lowest_inbound_channel_fees_arg == null ? 0 : lowest_inbound_channel_fees_arg.ptr & ~1, bindings.NodeAnnouncementInfo_new(announcement_info_arg_features_arg == null ? 0 : announcement_info_arg_features_arg.ptr & ~1, announcement_info_arg_last_update_arg, announcement_info_arg_rgb_arg, announcement_info_arg_alias_arg, (uint32_t[])Arrays.stream(announcement_info_arg_addresses_arg).map(arr_conv_12 -> arr_conv_12.ptr).toArray(), announcement_info_arg_announcement_message_arg == null ? 0 : announcement_info_arg_announcement_message_arg.ptr & ~1)); - NodeInfo ret_hu_conv = new NodeInfo(null, ret); + public static NodeInfo constructor_new(number[] channels_arg, RoutingFees lowest_inbound_channel_fees_arg, NodeFeatures announcement_info_arg_features_arg, number announcement_info_arg_last_update_arg, Uint8Array announcement_info_arg_rgb_arg, Uint8Array announcement_info_arg_alias_arg, NetAddress[] announcement_info_arg_addresses_arg, NodeAnnouncement announcement_info_arg_announcement_message_arg) { + number ret = bindings.NodeInfo_new(channels_arg, lowest_inbound_channel_fees_arg == null ? 0 : lowest_inbound_channel_fees_arg.ptr & ~1, bindings.NodeAnnouncementInfo_new(announcement_info_arg_features_arg == null ? 0 : announcement_info_arg_features_arg.ptr & ~1, announcement_info_arg_last_update_arg, announcement_info_arg_rgb_arg, announcement_info_arg_alias_arg, (number[])Arrays.stream(announcement_info_arg_addresses_arg).map(arr_conv_12 -> arr_conv_12.ptr).toArray(), announcement_info_arg_announcement_message_arg == null ? 0 : announcement_info_arg_announcement_message_arg.ptr & ~1)); + const ret_hu_conv: NodeInfo = new NodeInfo(null, ret); ret_hu_conv.ptrs_to.add(lowest_inbound_channel_fees_arg); ret_hu_conv.ptrs_to.add(announcement_info_arg_features_arg); /* TODO 2 NetAddress */; @@ -45,13 +53,13 @@ public class NodeInfo extends CommonBase { return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.NodeInfo_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.NodeInfo_write(this.ptr); return ret; } - public static Result_NodeInfoDecodeErrorZ constructor_read(byte[] ser) { - uint32_t ret = bindings.NodeInfo_read(ser); + public static Result_NodeInfoDecodeErrorZ constructor_read(Uint8Array ser) { + number ret = bindings.NodeInfo_read(ser); Result_NodeInfoDecodeErrorZ ret_hu_conv = Result_NodeInfoDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/ts/structs/OpenChannel.ts b/ts/structs/OpenChannel.ts index 48ed63c1..6c6f0c14 100644 --- a/ts/structs/OpenChannel.ts +++ b/ts/structs/OpenChannel.ts @@ -1,191 +1,199 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class OpenChannel extends CommonBase { - OpenChannel(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.OpenChannel_free(ptr); } - } + + export default class OpenChannel extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.OpenChannel_free(this.ptr); + } + } public OpenChannel clone() { - uint32_t ret = bindings.OpenChannel_clone(this.ptr); - OpenChannel ret_hu_conv = new OpenChannel(null, ret); + number ret = bindings.OpenChannel_clone(this.ptr); + const ret_hu_conv: OpenChannel = new OpenChannel(null, ret); return ret_hu_conv; } - public byte[] get_chain_hash() { - byte[] ret = bindings.OpenChannel_get_chain_hash(this.ptr); + public Uint8Array get_chain_hash() { + Uint8Array ret = bindings.OpenChannel_get_chain_hash(this.ptr); return ret; } - public void set_chain_hash(byte[] val) { + public void set_chain_hash(Uint8Array val) { bindings.OpenChannel_set_chain_hash(this.ptr, val); } - public byte[] get_temporary_channel_id() { - byte[] ret = bindings.OpenChannel_get_temporary_channel_id(this.ptr); + public Uint8Array get_temporary_channel_id() { + Uint8Array ret = bindings.OpenChannel_get_temporary_channel_id(this.ptr); return ret; } - public void set_temporary_channel_id(byte[] val) { + public void set_temporary_channel_id(Uint8Array val) { bindings.OpenChannel_set_temporary_channel_id(this.ptr, val); } - public long get_funding_satoshis() { - long ret = bindings.OpenChannel_get_funding_satoshis(this.ptr); + public number get_funding_satoshis() { + number ret = bindings.OpenChannel_get_funding_satoshis(this.ptr); return ret; } - public void set_funding_satoshis(long val) { + public void set_funding_satoshis(number val) { bindings.OpenChannel_set_funding_satoshis(this.ptr, val); } - public long get_push_msat() { - long ret = bindings.OpenChannel_get_push_msat(this.ptr); + public number get_push_msat() { + number ret = bindings.OpenChannel_get_push_msat(this.ptr); return ret; } - public void set_push_msat(long val) { + public void set_push_msat(number val) { bindings.OpenChannel_set_push_msat(this.ptr, val); } - public long get_dust_limit_satoshis() { - long ret = bindings.OpenChannel_get_dust_limit_satoshis(this.ptr); + public number get_dust_limit_satoshis() { + number ret = bindings.OpenChannel_get_dust_limit_satoshis(this.ptr); return ret; } - public void set_dust_limit_satoshis(long val) { + public void set_dust_limit_satoshis(number val) { bindings.OpenChannel_set_dust_limit_satoshis(this.ptr, val); } - public long get_max_htlc_value_in_flight_msat() { - long ret = bindings.OpenChannel_get_max_htlc_value_in_flight_msat(this.ptr); + public number get_max_htlc_value_in_flight_msat() { + number ret = bindings.OpenChannel_get_max_htlc_value_in_flight_msat(this.ptr); return ret; } - public void set_max_htlc_value_in_flight_msat(long val) { + public void set_max_htlc_value_in_flight_msat(number val) { bindings.OpenChannel_set_max_htlc_value_in_flight_msat(this.ptr, val); } - public long get_channel_reserve_satoshis() { - long ret = bindings.OpenChannel_get_channel_reserve_satoshis(this.ptr); + public number get_channel_reserve_satoshis() { + number ret = bindings.OpenChannel_get_channel_reserve_satoshis(this.ptr); return ret; } - public void set_channel_reserve_satoshis(long val) { + public void set_channel_reserve_satoshis(number val) { bindings.OpenChannel_set_channel_reserve_satoshis(this.ptr, val); } - public long get_htlc_minimum_msat() { - long ret = bindings.OpenChannel_get_htlc_minimum_msat(this.ptr); + public number get_htlc_minimum_msat() { + number ret = bindings.OpenChannel_get_htlc_minimum_msat(this.ptr); return ret; } - public void set_htlc_minimum_msat(long val) { + public void set_htlc_minimum_msat(number val) { bindings.OpenChannel_set_htlc_minimum_msat(this.ptr, val); } - public int get_feerate_per_kw() { - int ret = bindings.OpenChannel_get_feerate_per_kw(this.ptr); + public number get_feerate_per_kw() { + number ret = bindings.OpenChannel_get_feerate_per_kw(this.ptr); return ret; } - public void set_feerate_per_kw(int val) { + public void set_feerate_per_kw(number val) { bindings.OpenChannel_set_feerate_per_kw(this.ptr, val); } - public short get_to_self_delay() { - short ret = bindings.OpenChannel_get_to_self_delay(this.ptr); + public number get_to_self_delay() { + number ret = bindings.OpenChannel_get_to_self_delay(this.ptr); return ret; } - public void set_to_self_delay(short val) { + public void set_to_self_delay(number val) { bindings.OpenChannel_set_to_self_delay(this.ptr, val); } - public short get_max_accepted_htlcs() { - short ret = bindings.OpenChannel_get_max_accepted_htlcs(this.ptr); + public number get_max_accepted_htlcs() { + number ret = bindings.OpenChannel_get_max_accepted_htlcs(this.ptr); return ret; } - public void set_max_accepted_htlcs(short val) { + public void set_max_accepted_htlcs(number val) { bindings.OpenChannel_set_max_accepted_htlcs(this.ptr, val); } - public byte[] get_funding_pubkey() { - byte[] ret = bindings.OpenChannel_get_funding_pubkey(this.ptr); + public Uint8Array get_funding_pubkey() { + Uint8Array ret = bindings.OpenChannel_get_funding_pubkey(this.ptr); return ret; } - public void set_funding_pubkey(byte[] val) { + public void set_funding_pubkey(Uint8Array val) { bindings.OpenChannel_set_funding_pubkey(this.ptr, val); } - public byte[] get_revocation_basepoint() { - byte[] ret = bindings.OpenChannel_get_revocation_basepoint(this.ptr); + public Uint8Array get_revocation_basepoint() { + Uint8Array ret = bindings.OpenChannel_get_revocation_basepoint(this.ptr); return ret; } - public void set_revocation_basepoint(byte[] val) { + public void set_revocation_basepoint(Uint8Array val) { bindings.OpenChannel_set_revocation_basepoint(this.ptr, val); } - public byte[] get_payment_point() { - byte[] ret = bindings.OpenChannel_get_payment_point(this.ptr); + public Uint8Array get_payment_point() { + Uint8Array ret = bindings.OpenChannel_get_payment_point(this.ptr); return ret; } - public void set_payment_point(byte[] val) { + public void set_payment_point(Uint8Array val) { bindings.OpenChannel_set_payment_point(this.ptr, val); } - public byte[] get_delayed_payment_basepoint() { - byte[] ret = bindings.OpenChannel_get_delayed_payment_basepoint(this.ptr); + public Uint8Array get_delayed_payment_basepoint() { + Uint8Array ret = bindings.OpenChannel_get_delayed_payment_basepoint(this.ptr); return ret; } - public void set_delayed_payment_basepoint(byte[] val) { + public void set_delayed_payment_basepoint(Uint8Array val) { bindings.OpenChannel_set_delayed_payment_basepoint(this.ptr, val); } - public byte[] get_htlc_basepoint() { - byte[] ret = bindings.OpenChannel_get_htlc_basepoint(this.ptr); + public Uint8Array get_htlc_basepoint() { + Uint8Array ret = bindings.OpenChannel_get_htlc_basepoint(this.ptr); return ret; } - public void set_htlc_basepoint(byte[] val) { + public void set_htlc_basepoint(Uint8Array val) { bindings.OpenChannel_set_htlc_basepoint(this.ptr, val); } - public byte[] get_first_per_commitment_point() { - byte[] ret = bindings.OpenChannel_get_first_per_commitment_point(this.ptr); + public Uint8Array get_first_per_commitment_point() { + Uint8Array ret = bindings.OpenChannel_get_first_per_commitment_point(this.ptr); return ret; } - public void set_first_per_commitment_point(byte[] val) { + public void set_first_per_commitment_point(Uint8Array val) { bindings.OpenChannel_set_first_per_commitment_point(this.ptr, val); } - public byte get_channel_flags() { - byte ret = bindings.OpenChannel_get_channel_flags(this.ptr); + public number get_channel_flags() { + number ret = bindings.OpenChannel_get_channel_flags(this.ptr); return ret; } - public void set_channel_flags(byte val) { + public void set_channel_flags(number val) { bindings.OpenChannel_set_channel_flags(this.ptr, val); } - public byte[] write() { - byte[] ret = bindings.OpenChannel_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.OpenChannel_write(this.ptr); return ret; } - public static OpenChannel constructor_read(byte[] ser) { - uint32_t ret = bindings.OpenChannel_read(ser); - OpenChannel ret_hu_conv = new OpenChannel(null, ret); + public static OpenChannel constructor_read(Uint8Array ser) { + number ret = bindings.OpenChannel_read(ser); + const ret_hu_conv: OpenChannel = new OpenChannel(null, ret); return ret_hu_conv; } diff --git a/ts/structs/OutPoint.ts b/ts/structs/OutPoint.ts index 2f0d32b4..1ceb657f 100644 --- a/ts/structs/OutPoint.ts +++ b/ts/structs/OutPoint.ts @@ -1,58 +1,66 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class OutPoint extends CommonBase { - OutPoint(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.OutPoint_free(ptr); } - } + + export default class OutPoint extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.OutPoint_free(this.ptr); + } + } public OutPoint clone() { - uint32_t ret = bindings.OutPoint_clone(this.ptr); - OutPoint ret_hu_conv = new OutPoint(null, ret); + number ret = bindings.OutPoint_clone(this.ptr); + const ret_hu_conv: OutPoint = new OutPoint(null, ret); return ret_hu_conv; } - public byte[] get_txid() { - byte[] ret = bindings.OutPoint_get_txid(this.ptr); + public Uint8Array get_txid() { + Uint8Array ret = bindings.OutPoint_get_txid(this.ptr); return ret; } - public void set_txid(byte[] val) { + public void set_txid(Uint8Array val) { bindings.OutPoint_set_txid(this.ptr, val); } - public short get_index() { - short ret = bindings.OutPoint_get_index(this.ptr); + public number get_index() { + number ret = bindings.OutPoint_get_index(this.ptr); return ret; } - public void set_index(short val) { + public void set_index(number val) { bindings.OutPoint_set_index(this.ptr, val); } - public static OutPoint constructor_new(byte[] txid_arg, short index_arg) { - uint32_t ret = bindings.OutPoint_new(txid_arg, index_arg); - OutPoint ret_hu_conv = new OutPoint(null, ret); + public static OutPoint constructor_new(Uint8Array txid_arg, number index_arg) { + number ret = bindings.OutPoint_new(txid_arg, index_arg); + const ret_hu_conv: OutPoint = new OutPoint(null, ret); return ret_hu_conv; } - public byte[] to_channel_id() { - byte[] ret = bindings.OutPoint_to_channel_id(this.ptr); + public Uint8Array to_channel_id() { + Uint8Array ret = bindings.OutPoint_to_channel_id(this.ptr); return ret; } - public byte[] write() { - byte[] ret = bindings.OutPoint_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.OutPoint_write(this.ptr); return ret; } - public static OutPoint constructor_read(byte[] ser) { - uint32_t ret = bindings.OutPoint_read(ser); - OutPoint ret_hu_conv = new OutPoint(null, ret); + public static OutPoint constructor_read(Uint8Array ser) { + number ret = bindings.OutPoint_read(ser); + const ret_hu_conv: OutPoint = new OutPoint(null, ret); return ret_hu_conv; } diff --git a/ts/structs/PaymentSendFailure.ts b/ts/structs/PaymentSendFailure.ts index ddaccb9d..04ea895d 100644 --- a/ts/structs/PaymentSendFailure.ts +++ b/ts/structs/PaymentSendFailure.ts @@ -1,13 +1,21 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class PaymentSendFailure extends CommonBase { - PaymentSendFailure(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.PaymentSendFailure_free(ptr); } - } + + export default class PaymentSendFailure extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.PaymentSendFailure_free(this.ptr); + } + } } diff --git a/ts/structs/PeerHandleError.ts b/ts/structs/PeerHandleError.ts index 3b3a33c6..f0b82ef8 100644 --- a/ts/structs/PeerHandleError.ts +++ b/ts/structs/PeerHandleError.ts @@ -1,15 +1,23 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class PeerHandleError extends CommonBase { - PeerHandleError(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.PeerHandleError_free(ptr); } - } + + export default class PeerHandleError extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.PeerHandleError_free(this.ptr); + } + } public boolean get_no_connection_possible() { boolean ret = bindings.PeerHandleError_get_no_connection_possible(this.ptr); return ret; @@ -20,8 +28,8 @@ public class PeerHandleError extends CommonBase { } public static PeerHandleError constructor_new(boolean no_connection_possible_arg) { - uint32_t ret = bindings.PeerHandleError_new(no_connection_possible_arg); - PeerHandleError ret_hu_conv = new PeerHandleError(null, ret); + number ret = bindings.PeerHandleError_new(no_connection_possible_arg); + const ret_hu_conv: PeerHandleError = new PeerHandleError(null, ret); return ret_hu_conv; } diff --git a/ts/structs/PeerManager.ts b/ts/structs/PeerManager.ts index 6d127c3b..3fa85fc5 100644 --- a/ts/structs/PeerManager.ts +++ b/ts/structs/PeerManager.ts @@ -1,52 +1,60 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class PeerManager extends CommonBase { - PeerManager(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.PeerManager_free(ptr); } - } - public static PeerManager constructor_new(ChannelMessageHandler message_handler_chan_handler_arg, RoutingMessageHandler message_handler_route_handler_arg, byte[] our_node_secret, byte[] ephemeral_random_data, Logger logger) { - uint32_t 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); - PeerManager ret_hu_conv = new PeerManager(null, ret); + + export default class PeerManager extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.PeerManager_free(this.ptr); + } + } + public static PeerManager constructor_new(ChannelMessageHandler message_handler_chan_handler_arg, RoutingMessageHandler message_handler_route_handler_arg, Uint8Array our_node_secret, Uint8Array ephemeral_random_data, Logger logger) { + number 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); + const ret_hu_conv: PeerManager = new PeerManager(null, ret); ret_hu_conv.ptrs_to.add(message_handler_chan_handler_arg); ret_hu_conv.ptrs_to.add(message_handler_route_handler_arg); ret_hu_conv.ptrs_to.add(logger); return ret_hu_conv; } - public byte[][] get_peer_node_ids() { - byte[][] ret = bindings.PeerManager_get_peer_node_ids(this.ptr); + public Uint8Array[] get_peer_node_ids() { + Uint8Array[] ret = bindings.PeerManager_get_peer_node_ids(this.ptr); return ret; } - public Result_CVec_u8ZPeerHandleErrorZ new_outbound_connection(byte[] their_node_id, SocketDescriptor descriptor) { - uint32_t ret = bindings.PeerManager_new_outbound_connection(this.ptr, their_node_id, descriptor == null ? 0 : descriptor.ptr); + public Result_CVec_u8ZPeerHandleErrorZ new_outbound_connection(Uint8Array their_node_id, SocketDescriptor descriptor) { + number ret = bindings.PeerManager_new_outbound_connection(this.ptr, their_node_id, descriptor == null ? 0 : descriptor.ptr); Result_CVec_u8ZPeerHandleErrorZ ret_hu_conv = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret); this.ptrs_to.add(descriptor); return ret_hu_conv; } public Result_NonePeerHandleErrorZ new_inbound_connection(SocketDescriptor descriptor) { - uint32_t ret = bindings.PeerManager_new_inbound_connection(this.ptr, descriptor == null ? 0 : descriptor.ptr); + number ret = bindings.PeerManager_new_inbound_connection(this.ptr, descriptor == null ? 0 : descriptor.ptr); Result_NonePeerHandleErrorZ ret_hu_conv = Result_NonePeerHandleErrorZ.constr_from_ptr(ret); this.ptrs_to.add(descriptor); return ret_hu_conv; } public Result_NonePeerHandleErrorZ write_buffer_space_avail(SocketDescriptor descriptor) { - uint32_t ret = bindings.PeerManager_write_buffer_space_avail(this.ptr, descriptor == null ? 0 : descriptor.ptr); + number ret = bindings.PeerManager_write_buffer_space_avail(this.ptr, descriptor == null ? 0 : descriptor.ptr); Result_NonePeerHandleErrorZ ret_hu_conv = Result_NonePeerHandleErrorZ.constr_from_ptr(ret); this.ptrs_to.add(descriptor); return ret_hu_conv; } - public Result_boolPeerHandleErrorZ read_event(SocketDescriptor peer_descriptor, byte[] data) { - uint32_t ret = bindings.PeerManager_read_event(this.ptr, peer_descriptor == null ? 0 : peer_descriptor.ptr, data); + public Result_boolPeerHandleErrorZ read_event(SocketDescriptor peer_descriptor, Uint8Array data) { + number ret = bindings.PeerManager_read_event(this.ptr, peer_descriptor == null ? 0 : peer_descriptor.ptr, data); Result_boolPeerHandleErrorZ ret_hu_conv = Result_boolPeerHandleErrorZ.constr_from_ptr(ret); this.ptrs_to.add(peer_descriptor); return ret_hu_conv; diff --git a/ts/structs/Persist.ts b/ts/structs/Persist.ts index f55f4cf5..16ebedc5 100644 --- a/ts/structs/Persist.ts +++ b/ts/structs/Persist.ts @@ -1,5 +1,71 @@ + + +import CommonBase from './CommonBase'; +import * as bindings from '../bindings' // TODO: figure out location + + + + export class Persist extends CommonBase { + + bindings_instance?: bindings.LDKPersist; + + constructor(ptr?: number, arg?: bindings.LDKPersist) { + if (Number.isFinite(ptr)) { + super(ptr); + this.bindings_instance = null; + } else { + // TODO: private constructor instantiation + super(bindings.LDKPersist_new(arg)); + this.ptrs_to.push(arg); + + } + } + + protected finalize() { + if (this.ptr != 0) { + bindings.Persist_free(this.ptr); + } + super.finalize(); + } + + static new_impl(arg: PersistInterface): Persist { + const impl_holder: LDKPersistHolder = new LDKPersistHolder(); + let structImplementation = { + // todo: in-line interface filling + persist_new_channel (id: number, data: number): number { + const id_hu_conv: OutPoint = new OutPoint(null, id); + const data_hu_conv: ChannelMonitor = new ChannelMonitor(null, data); + Result_NoneChannelMonitorUpdateErrZ ret = arg.persist_new_channel(id_hu_conv, data_hu_conv); + result: number = ret != null ? ret.ptr : 0; + return result; + }, + + update_persisted_channel (id: number, update: number, data: number): number { + const id_hu_conv: OutPoint = new OutPoint(null, id); + const update_hu_conv: ChannelMonitorUpdate = new ChannelMonitorUpdate(null, update); + const data_hu_conv: ChannelMonitor = new ChannelMonitor(null, data); + Result_NoneChannelMonitorUpdateErrZ ret = arg.update_persisted_channel(id_hu_conv, update_hu_conv, data_hu_conv); + result: number = ret != null ? ret.ptr : 0; + return result; + }, + + + }; + impl_holder.held = new Persist (null, structImplementation); + } + } + + export interface PersistInterface { + persist_new_channel(id: OutPoint, data: ChannelMonitor): Result_NoneChannelMonitorUpdateErrZ; + update_persisted_channel(id: OutPoint, update: ChannelMonitorUpdate, data: ChannelMonitor): Result_NoneChannelMonitorUpdateErrZ; + + } + + class LDKPersistHolder { + held: Persist; + } public Result_NoneChannelMonitorUpdateErrZ persist_new_channel(OutPoint id, ChannelMonitor data) { - uint32_t ret = bindings.Persist_persist_new_channel(this.ptr, id == null ? 0 : id.ptr & ~1, data == null ? 0 : data.ptr & ~1); + number ret = bindings.Persist_persist_new_channel(this.ptr, id == null ? 0 : id.ptr & ~1, data == null ? 0 : data.ptr & ~1); Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret); this.ptrs_to.add(id); this.ptrs_to.add(data); @@ -7,7 +73,7 @@ } public Result_NoneChannelMonitorUpdateErrZ update_persisted_channel(OutPoint id, ChannelMonitorUpdate update, ChannelMonitor data) { - uint32_t 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); + number 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); Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret); this.ptrs_to.add(id); this.ptrs_to.add(update); diff --git a/ts/structs/Ping.ts b/ts/structs/Ping.ts index 5eb815a6..d915f29e 100644 --- a/ts/structs/Ping.ts +++ b/ts/structs/Ping.ts @@ -1,52 +1,60 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class Ping extends CommonBase { - Ping(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.Ping_free(ptr); } - } + + export default class Ping extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.Ping_free(this.ptr); + } + } public Ping clone() { - uint32_t ret = bindings.Ping_clone(this.ptr); - Ping ret_hu_conv = new Ping(null, ret); + number ret = bindings.Ping_clone(this.ptr); + const ret_hu_conv: Ping = new Ping(null, ret); return ret_hu_conv; } - public short get_ponglen() { - short ret = bindings.Ping_get_ponglen(this.ptr); + public number get_ponglen() { + number ret = bindings.Ping_get_ponglen(this.ptr); return ret; } - public void set_ponglen(short val) { + public void set_ponglen(number val) { bindings.Ping_set_ponglen(this.ptr, val); } - public short get_byteslen() { - short ret = bindings.Ping_get_byteslen(this.ptr); + public number get_byteslen() { + number ret = bindings.Ping_get_byteslen(this.ptr); return ret; } - public void set_byteslen(short val) { + public void set_byteslen(number val) { bindings.Ping_set_byteslen(this.ptr, val); } - public static Ping constructor_new(short ponglen_arg, short byteslen_arg) { - uint32_t ret = bindings.Ping_new(ponglen_arg, byteslen_arg); - Ping ret_hu_conv = new Ping(null, ret); + public static Ping constructor_new(number ponglen_arg, number byteslen_arg) { + number ret = bindings.Ping_new(ponglen_arg, byteslen_arg); + const ret_hu_conv: Ping = new Ping(null, ret); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.Ping_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.Ping_write(this.ptr); return ret; } - public static Result_PingDecodeErrorZ constructor_read(byte[] ser) { - uint32_t ret = bindings.Ping_read(ser); + public static Result_PingDecodeErrorZ constructor_read(Uint8Array ser) { + number ret = bindings.Ping_read(ser); Result_PingDecodeErrorZ ret_hu_conv = Result_PingDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/ts/structs/Pong.ts b/ts/structs/Pong.ts index 30d57ecb..3305de2a 100644 --- a/ts/structs/Pong.ts +++ b/ts/structs/Pong.ts @@ -1,43 +1,51 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class Pong extends CommonBase { - Pong(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.Pong_free(ptr); } - } + + export default class Pong extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.Pong_free(this.ptr); + } + } public Pong clone() { - uint32_t ret = bindings.Pong_clone(this.ptr); - Pong ret_hu_conv = new Pong(null, ret); + number ret = bindings.Pong_clone(this.ptr); + const ret_hu_conv: Pong = new Pong(null, ret); return ret_hu_conv; } - public short get_byteslen() { - short ret = bindings.Pong_get_byteslen(this.ptr); + public number get_byteslen() { + number ret = bindings.Pong_get_byteslen(this.ptr); return ret; } - public void set_byteslen(short val) { + public void set_byteslen(number val) { bindings.Pong_set_byteslen(this.ptr, val); } - public static Pong constructor_new(short byteslen_arg) { - uint32_t ret = bindings.Pong_new(byteslen_arg); - Pong ret_hu_conv = new Pong(null, ret); + public static Pong constructor_new(number byteslen_arg) { + number ret = bindings.Pong_new(byteslen_arg); + const ret_hu_conv: Pong = new Pong(null, ret); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.Pong_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.Pong_write(this.ptr); return ret; } - public static Result_PongDecodeErrorZ constructor_read(byte[] ser) { - uint32_t ret = bindings.Pong_read(ser); + public static Result_PongDecodeErrorZ constructor_read(Uint8Array ser) { + number ret = bindings.Pong_read(ser); Result_PongDecodeErrorZ ret_hu_conv = Result_PongDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/ts/structs/QueryChannelRange.ts b/ts/structs/QueryChannelRange.ts index 4fd9a8d1..8b7cbea7 100644 --- a/ts/structs/QueryChannelRange.ts +++ b/ts/structs/QueryChannelRange.ts @@ -1,62 +1,70 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class QueryChannelRange extends CommonBase { - QueryChannelRange(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.QueryChannelRange_free(ptr); } - } + + export default class QueryChannelRange extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.QueryChannelRange_free(this.ptr); + } + } public QueryChannelRange clone() { - uint32_t ret = bindings.QueryChannelRange_clone(this.ptr); - QueryChannelRange ret_hu_conv = new QueryChannelRange(null, ret); + number ret = bindings.QueryChannelRange_clone(this.ptr); + const ret_hu_conv: QueryChannelRange = new QueryChannelRange(null, ret); return ret_hu_conv; } - public byte[] get_chain_hash() { - byte[] ret = bindings.QueryChannelRange_get_chain_hash(this.ptr); + public Uint8Array get_chain_hash() { + Uint8Array ret = bindings.QueryChannelRange_get_chain_hash(this.ptr); return ret; } - public void set_chain_hash(byte[] val) { + public void set_chain_hash(Uint8Array val) { bindings.QueryChannelRange_set_chain_hash(this.ptr, val); } - public int get_first_blocknum() { - int ret = bindings.QueryChannelRange_get_first_blocknum(this.ptr); + public number get_first_blocknum() { + number ret = bindings.QueryChannelRange_get_first_blocknum(this.ptr); return ret; } - public void set_first_blocknum(int val) { + public void set_first_blocknum(number val) { bindings.QueryChannelRange_set_first_blocknum(this.ptr, val); } - public int get_number_of_blocks() { - int ret = bindings.QueryChannelRange_get_number_of_blocks(this.ptr); + public number get_number_of_blocks() { + number ret = bindings.QueryChannelRange_get_number_of_blocks(this.ptr); return ret; } - public void set_number_of_blocks(int val) { + public void set_number_of_blocks(number val) { bindings.QueryChannelRange_set_number_of_blocks(this.ptr, val); } - public static QueryChannelRange constructor_new(byte[] chain_hash_arg, int first_blocknum_arg, int number_of_blocks_arg) { - uint32_t ret = bindings.QueryChannelRange_new(chain_hash_arg, first_blocknum_arg, number_of_blocks_arg); - QueryChannelRange ret_hu_conv = new QueryChannelRange(null, ret); + public static QueryChannelRange constructor_new(Uint8Array chain_hash_arg, number first_blocknum_arg, number number_of_blocks_arg) { + number ret = bindings.QueryChannelRange_new(chain_hash_arg, first_blocknum_arg, number_of_blocks_arg); + const ret_hu_conv: QueryChannelRange = new QueryChannelRange(null, ret); return ret_hu_conv; } - public static Result_QueryChannelRangeDecodeErrorZ constructor_read(byte[] ser) { - uint32_t ret = bindings.QueryChannelRange_read(ser); + public static Result_QueryChannelRangeDecodeErrorZ constructor_read(Uint8Array ser) { + number ret = bindings.QueryChannelRange_read(ser); Result_QueryChannelRangeDecodeErrorZ ret_hu_conv = Result_QueryChannelRangeDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.QueryChannelRange_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.QueryChannelRange_write(this.ptr); return ret; } diff --git a/ts/structs/QueryShortChannelIds.ts b/ts/structs/QueryShortChannelIds.ts index 84fdd104..3c2efc5b 100644 --- a/ts/structs/QueryShortChannelIds.ts +++ b/ts/structs/QueryShortChannelIds.ts @@ -1,48 +1,56 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class QueryShortChannelIds extends CommonBase { - QueryShortChannelIds(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.QueryShortChannelIds_free(ptr); } - } + + export default class QueryShortChannelIds extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.QueryShortChannelIds_free(this.ptr); + } + } public QueryShortChannelIds clone() { - uint32_t ret = bindings.QueryShortChannelIds_clone(this.ptr); - QueryShortChannelIds ret_hu_conv = new QueryShortChannelIds(null, ret); + number ret = bindings.QueryShortChannelIds_clone(this.ptr); + const ret_hu_conv: QueryShortChannelIds = new QueryShortChannelIds(null, ret); return ret_hu_conv; } - public byte[] get_chain_hash() { - byte[] ret = bindings.QueryShortChannelIds_get_chain_hash(this.ptr); + public Uint8Array get_chain_hash() { + Uint8Array ret = bindings.QueryShortChannelIds_get_chain_hash(this.ptr); return ret; } - public void set_chain_hash(byte[] val) { + public void set_chain_hash(Uint8Array val) { bindings.QueryShortChannelIds_set_chain_hash(this.ptr, val); } - public void set_short_channel_ids(long[] val) { + public void set_short_channel_ids(number[] val) { bindings.QueryShortChannelIds_set_short_channel_ids(this.ptr, val); } - public static QueryShortChannelIds constructor_new(byte[] chain_hash_arg, long[] short_channel_ids_arg) { - uint32_t ret = bindings.QueryShortChannelIds_new(chain_hash_arg, short_channel_ids_arg); - QueryShortChannelIds ret_hu_conv = new QueryShortChannelIds(null, ret); + public static QueryShortChannelIds constructor_new(Uint8Array chain_hash_arg, number[] short_channel_ids_arg) { + number ret = bindings.QueryShortChannelIds_new(chain_hash_arg, short_channel_ids_arg); + const ret_hu_conv: QueryShortChannelIds = new QueryShortChannelIds(null, ret); return ret_hu_conv; } - public static Result_QueryShortChannelIdsDecodeErrorZ constructor_read(byte[] ser) { - uint32_t ret = bindings.QueryShortChannelIds_read(ser); + public static Result_QueryShortChannelIdsDecodeErrorZ constructor_read(Uint8Array ser) { + number ret = bindings.QueryShortChannelIds_read(ser); Result_QueryShortChannelIdsDecodeErrorZ ret_hu_conv = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.QueryShortChannelIds_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.QueryShortChannelIds_write(this.ptr); return ret; } diff --git a/ts/structs/ReplyChannelRange.ts b/ts/structs/ReplyChannelRange.ts index d4d0b678..21a6e01a 100644 --- a/ts/structs/ReplyChannelRange.ts +++ b/ts/structs/ReplyChannelRange.ts @@ -1,45 +1,53 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class ReplyChannelRange extends CommonBase { - ReplyChannelRange(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.ReplyChannelRange_free(ptr); } - } + + export default class ReplyChannelRange extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.ReplyChannelRange_free(this.ptr); + } + } public ReplyChannelRange clone() { - uint32_t ret = bindings.ReplyChannelRange_clone(this.ptr); - ReplyChannelRange ret_hu_conv = new ReplyChannelRange(null, ret); + number ret = bindings.ReplyChannelRange_clone(this.ptr); + const ret_hu_conv: ReplyChannelRange = new ReplyChannelRange(null, ret); return ret_hu_conv; } - public byte[] get_chain_hash() { - byte[] ret = bindings.ReplyChannelRange_get_chain_hash(this.ptr); + public Uint8Array get_chain_hash() { + Uint8Array ret = bindings.ReplyChannelRange_get_chain_hash(this.ptr); return ret; } - public void set_chain_hash(byte[] val) { + public void set_chain_hash(Uint8Array val) { bindings.ReplyChannelRange_set_chain_hash(this.ptr, val); } - public int get_first_blocknum() { - int ret = bindings.ReplyChannelRange_get_first_blocknum(this.ptr); + public number get_first_blocknum() { + number ret = bindings.ReplyChannelRange_get_first_blocknum(this.ptr); return ret; } - public void set_first_blocknum(int val) { + public void set_first_blocknum(number val) { bindings.ReplyChannelRange_set_first_blocknum(this.ptr, val); } - public int get_number_of_blocks() { - int ret = bindings.ReplyChannelRange_get_number_of_blocks(this.ptr); + public number get_number_of_blocks() { + number ret = bindings.ReplyChannelRange_get_number_of_blocks(this.ptr); return ret; } - public void set_number_of_blocks(int val) { + public void set_number_of_blocks(number val) { bindings.ReplyChannelRange_set_number_of_blocks(this.ptr, val); } @@ -52,24 +60,24 @@ public class ReplyChannelRange extends CommonBase { bindings.ReplyChannelRange_set_full_information(this.ptr, val); } - public void set_short_channel_ids(long[] val) { + public void set_short_channel_ids(number[] val) { bindings.ReplyChannelRange_set_short_channel_ids(this.ptr, val); } - public static ReplyChannelRange constructor_new(byte[] chain_hash_arg, int first_blocknum_arg, int number_of_blocks_arg, boolean full_information_arg, long[] short_channel_ids_arg) { - uint32_t ret = bindings.ReplyChannelRange_new(chain_hash_arg, first_blocknum_arg, number_of_blocks_arg, full_information_arg, short_channel_ids_arg); - ReplyChannelRange ret_hu_conv = new ReplyChannelRange(null, ret); + public static ReplyChannelRange constructor_new(Uint8Array chain_hash_arg, number first_blocknum_arg, number number_of_blocks_arg, boolean full_information_arg, number[] short_channel_ids_arg) { + number ret = bindings.ReplyChannelRange_new(chain_hash_arg, first_blocknum_arg, number_of_blocks_arg, full_information_arg, short_channel_ids_arg); + const ret_hu_conv: ReplyChannelRange = new ReplyChannelRange(null, ret); return ret_hu_conv; } - public static Result_ReplyChannelRangeDecodeErrorZ constructor_read(byte[] ser) { - uint32_t ret = bindings.ReplyChannelRange_read(ser); + public static Result_ReplyChannelRangeDecodeErrorZ constructor_read(Uint8Array ser) { + number ret = bindings.ReplyChannelRange_read(ser); Result_ReplyChannelRangeDecodeErrorZ ret_hu_conv = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.ReplyChannelRange_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.ReplyChannelRange_write(this.ptr); return ret; } diff --git a/ts/structs/ReplyShortChannelIdsEnd.ts b/ts/structs/ReplyShortChannelIdsEnd.ts index cd60c20d..9ab50fea 100644 --- a/ts/structs/ReplyShortChannelIdsEnd.ts +++ b/ts/structs/ReplyShortChannelIdsEnd.ts @@ -1,27 +1,35 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class ReplyShortChannelIdsEnd extends CommonBase { - ReplyShortChannelIdsEnd(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.ReplyShortChannelIdsEnd_free(ptr); } - } + + export default class ReplyShortChannelIdsEnd extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.ReplyShortChannelIdsEnd_free(this.ptr); + } + } public ReplyShortChannelIdsEnd clone() { - uint32_t ret = bindings.ReplyShortChannelIdsEnd_clone(this.ptr); - ReplyShortChannelIdsEnd ret_hu_conv = new ReplyShortChannelIdsEnd(null, ret); + number ret = bindings.ReplyShortChannelIdsEnd_clone(this.ptr); + const ret_hu_conv: ReplyShortChannelIdsEnd = new ReplyShortChannelIdsEnd(null, ret); return ret_hu_conv; } - public byte[] get_chain_hash() { - byte[] ret = bindings.ReplyShortChannelIdsEnd_get_chain_hash(this.ptr); + public Uint8Array get_chain_hash() { + Uint8Array ret = bindings.ReplyShortChannelIdsEnd_get_chain_hash(this.ptr); return ret; } - public void set_chain_hash(byte[] val) { + public void set_chain_hash(Uint8Array val) { bindings.ReplyShortChannelIdsEnd_set_chain_hash(this.ptr, val); } @@ -34,20 +42,20 @@ public class ReplyShortChannelIdsEnd extends CommonBase { bindings.ReplyShortChannelIdsEnd_set_full_information(this.ptr, val); } - public static ReplyShortChannelIdsEnd constructor_new(byte[] chain_hash_arg, boolean full_information_arg) { - uint32_t ret = bindings.ReplyShortChannelIdsEnd_new(chain_hash_arg, full_information_arg); - ReplyShortChannelIdsEnd ret_hu_conv = new ReplyShortChannelIdsEnd(null, ret); + public static ReplyShortChannelIdsEnd constructor_new(Uint8Array chain_hash_arg, boolean full_information_arg) { + number ret = bindings.ReplyShortChannelIdsEnd_new(chain_hash_arg, full_information_arg); + const ret_hu_conv: ReplyShortChannelIdsEnd = new ReplyShortChannelIdsEnd(null, ret); return ret_hu_conv; } - public static Result_ReplyShortChannelIdsEndDecodeErrorZ constructor_read(byte[] ser) { - uint32_t ret = bindings.ReplyShortChannelIdsEnd_read(ser); + public static Result_ReplyShortChannelIdsEndDecodeErrorZ constructor_read(Uint8Array ser) { + number ret = bindings.ReplyShortChannelIdsEnd_read(ser); Result_ReplyShortChannelIdsEndDecodeErrorZ ret_hu_conv = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.ReplyShortChannelIdsEnd_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.ReplyShortChannelIdsEnd_write(this.ptr); return ret; } diff --git a/ts/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.ts b/ts/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.ts index f6138965..e9feca6e 100644 --- a/ts/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.ts +++ b/ts/structs/Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.ts @@ -16,17 +16,17 @@ public class Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ extends CommonB } } public static final class Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_OK extends Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ { - public final TwoTuple res; + public final TwoTuple res; private Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t res = bindings.LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(ptr); - byte[] res_a = bindings.LDKC2Tuple_BlockHashChannelManagerZ_get_a(res); - uint32_t res_b = bindings.LDKC2Tuple_BlockHashChannelManagerZ_get_b(res); - ChannelManager res_b_hu_conv = new ChannelManager(null, res_b);; - TwoTuple res_conv = new TwoTuple(res_a, res_b_hu_conv); + number res = bindings.LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(ptr); + Uint8Array res_a = bindings.LDKC2Tuple_BlockHashChannelManagerZ_get_a(res); + number res_b = bindings.LDKC2Tuple_BlockHashChannelManagerZ_get_b(res); + const res_b_hu_conv: ChannelManager = new ChannelManager(null, res_b);; + TwoTuple res_conv = new TwoTuple(res_a, res_b_hu_conv); this.res = res_conv; } - public Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_OK(TwoTuple res) { + public Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_OK(TwoTuple res) { this(null, bindings.CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(bindings.C2Tuple_BlockHashChannelManagerZ_new(res.a, res.b == null ? 0 : res.b.ptr & ~1/*XXX: this.ptrs_to.add(res_b)*/))); } } @@ -35,8 +35,8 @@ public class Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ extends CommonB public final DecodeError err; private Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t err = bindings.LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = new DecodeError(null, err); + number err = bindings.LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(ptr); + const err_hu_conv: DecodeError = new DecodeError(null, err); this.err = err_hu_conv; } public Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_Err(DecodeError err) { diff --git a/ts/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.ts b/ts/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.ts index 68d725f2..f5e3a80e 100644 --- a/ts/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.ts +++ b/ts/structs/Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ.ts @@ -16,17 +16,17 @@ public class Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ extends CommonB } } public static final class Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_OK extends Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ { - public final TwoTuple res; + public final TwoTuple res; private Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t res = bindings.LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(ptr); - byte[] res_a = bindings.LDKC2Tuple_BlockHashChannelMonitorZ_get_a(res); - uint32_t res_b = bindings.LDKC2Tuple_BlockHashChannelMonitorZ_get_b(res); - ChannelMonitor res_b_hu_conv = new ChannelMonitor(null, res_b);; - TwoTuple res_conv = new TwoTuple(res_a, res_b_hu_conv); + number res = bindings.LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(ptr); + Uint8Array res_a = bindings.LDKC2Tuple_BlockHashChannelMonitorZ_get_a(res); + number res_b = bindings.LDKC2Tuple_BlockHashChannelMonitorZ_get_b(res); + const res_b_hu_conv: ChannelMonitor = new ChannelMonitor(null, res_b);; + TwoTuple res_conv = new TwoTuple(res_a, res_b_hu_conv); this.res = res_conv; } - public Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_OK(TwoTuple res) { + public Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_OK(TwoTuple res) { this(null, bindings.CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(bindings.C2Tuple_BlockHashChannelMonitorZ_new(res.a, res.b == null ? 0 : res.b.ptr & ~1/*XXX: this.ptrs_to.add(res_b)*/))); } } @@ -35,8 +35,8 @@ public class Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ extends CommonB public final DecodeError err; private Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t err = bindings.LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = new DecodeError(null, err); + number err = bindings.LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(ptr); + const err_hu_conv: DecodeError = new DecodeError(null, err); this.err = err_hu_conv; } public Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_Err(DecodeError err) { diff --git a/ts/structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.ts b/ts/structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.ts index 8e6481f4..eb356463 100644 --- a/ts/structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.ts +++ b/ts/structs/Result_C2Tuple_SignatureCVec_SignatureZZNoneZ.ts @@ -16,16 +16,16 @@ public class Result_C2Tuple_SignatureCVec_SignatureZZNoneZ extends CommonBase { } } public static final class Result_C2Tuple_SignatureCVec_SignatureZZNoneZ_OK extends Result_C2Tuple_SignatureCVec_SignatureZZNoneZ { - public final TwoTuple res; + public final TwoTuple res; private Result_C2Tuple_SignatureCVec_SignatureZZNoneZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t res = bindings.LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(ptr); - byte[] res_a = bindings.LDKC2Tuple_SignatureCVec_SignatureZZ_get_a(res); - byte[][] res_b = bindings.LDKC2Tuple_SignatureCVec_SignatureZZ_get_b(res); - TwoTuple res_conv = new TwoTuple(res_a, res_b); + number res = bindings.LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(ptr); + Uint8Array res_a = bindings.LDKC2Tuple_SignatureCVec_SignatureZZ_get_a(res); + Uint8Array[] res_b = bindings.LDKC2Tuple_SignatureCVec_SignatureZZ_get_b(res); + TwoTuple res_conv = new TwoTuple(res_a, res_b); this.res = res_conv; } - public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ_OK(TwoTuple res) { + public Result_C2Tuple_SignatureCVec_SignatureZZNoneZ_OK(TwoTuple res) { this(null, bindings.CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(bindings.C2Tuple_SignatureCVec_SignatureZZ_new(res.a, res.b))); } } diff --git a/ts/structs/Result_CResult_NetAddressu8ZDecodeErrorZ.ts b/ts/structs/Result_CResult_NetAddressu8ZDecodeErrorZ.ts index d7e55738..950cd10d 100644 --- a/ts/structs/Result_CResult_NetAddressu8ZDecodeErrorZ.ts +++ b/ts/structs/Result_CResult_NetAddressu8ZDecodeErrorZ.ts @@ -19,7 +19,7 @@ public class Result_CResult_NetAddressu8ZDecodeErrorZ extends CommonBase { public final Result_NetAddressu8Z res; private Result_CResult_NetAddressu8ZDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t res = bindings.LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_get_ok(ptr); + number res = bindings.LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_get_ok(ptr); Result_NetAddressu8Z res_hu_conv = Result_NetAddressu8Z.constr_from_ptr(res); this.res = res_hu_conv; } @@ -32,8 +32,8 @@ public class Result_CResult_NetAddressu8ZDecodeErrorZ extends CommonBase { public final DecodeError err; private Result_CResult_NetAddressu8ZDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t err = bindings.LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = new DecodeError(null, err); + number err = bindings.LDKCResult_CResult_NetAddressu8ZDecodeErrorZ_get_err(ptr); + const err_hu_conv: DecodeError = new DecodeError(null, err); this.err = err_hu_conv; } public Result_CResult_NetAddressu8ZDecodeErrorZ_Err(DecodeError err) { diff --git a/ts/structs/Result_CVec_SignatureZNoneZ.ts b/ts/structs/Result_CVec_SignatureZNoneZ.ts index cc3c82bb..4bbae609 100644 --- a/ts/structs/Result_CVec_SignatureZNoneZ.ts +++ b/ts/structs/Result_CVec_SignatureZNoneZ.ts @@ -16,12 +16,12 @@ public class Result_CVec_SignatureZNoneZ extends CommonBase { } } public static final class Result_CVec_SignatureZNoneZ_OK extends Result_CVec_SignatureZNoneZ { - public final byte[][] res; + public final Uint8Array[] res; private Result_CVec_SignatureZNoneZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); this.res = bindings.LDKCResult_CVec_SignatureZNoneZ_get_ok(ptr); } - public Result_CVec_SignatureZNoneZ_OK(byte[][] res) { + public Result_CVec_SignatureZNoneZ_OK(Uint8Array[] res) { this(null, bindings.CResult_CVec_SignatureZNoneZ_ok(res)); } } diff --git a/ts/structs/Result_CVec_u8ZPeerHandleErrorZ.ts b/ts/structs/Result_CVec_u8ZPeerHandleErrorZ.ts index c0d1f1f0..daa927a5 100644 --- a/ts/structs/Result_CVec_u8ZPeerHandleErrorZ.ts +++ b/ts/structs/Result_CVec_u8ZPeerHandleErrorZ.ts @@ -16,12 +16,12 @@ public class Result_CVec_u8ZPeerHandleErrorZ extends CommonBase { } } public static final class Result_CVec_u8ZPeerHandleErrorZ_OK extends Result_CVec_u8ZPeerHandleErrorZ { - public final byte[] res; + public final Uint8Array res; private Result_CVec_u8ZPeerHandleErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); this.res = bindings.LDKCResult_CVec_u8ZPeerHandleErrorZ_get_ok(ptr); } - public Result_CVec_u8ZPeerHandleErrorZ_OK(byte[] res) { + public Result_CVec_u8ZPeerHandleErrorZ_OK(Uint8Array res) { this(null, bindings.CResult_CVec_u8ZPeerHandleErrorZ_ok(res)); } } @@ -30,8 +30,8 @@ public class Result_CVec_u8ZPeerHandleErrorZ extends CommonBase { public final PeerHandleError err; private Result_CVec_u8ZPeerHandleErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t err = bindings.LDKCResult_CVec_u8ZPeerHandleErrorZ_get_err(ptr); - PeerHandleError err_hu_conv = new PeerHandleError(null, err); + number err = bindings.LDKCResult_CVec_u8ZPeerHandleErrorZ_get_err(ptr); + const err_hu_conv: PeerHandleError = new PeerHandleError(null, err); this.err = err_hu_conv; } public Result_CVec_u8ZPeerHandleErrorZ_Err(PeerHandleError err) { diff --git a/ts/structs/Result_ChanKeySignerDecodeErrorZ.ts b/ts/structs/Result_ChanKeySignerDecodeErrorZ.ts index 65d514b1..51a192cf 100644 --- a/ts/structs/Result_ChanKeySignerDecodeErrorZ.ts +++ b/ts/structs/Result_ChanKeySignerDecodeErrorZ.ts @@ -19,7 +19,7 @@ public class Result_ChanKeySignerDecodeErrorZ extends CommonBase { public final ChannelKeys res; private Result_ChanKeySignerDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t res = bindings.LDKCResult_ChanKeySignerDecodeErrorZ_get_ok(ptr); + number res = bindings.LDKCResult_ChanKeySignerDecodeErrorZ_get_ok(ptr); ChannelKeys ret_hu_conv = new ChannelKeys(null, res); ret_hu_conv.ptrs_to.add(this); this.res = ret_hu_conv; @@ -34,8 +34,8 @@ public class Result_ChanKeySignerDecodeErrorZ extends CommonBase { public final DecodeError err; private Result_ChanKeySignerDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t err = bindings.LDKCResult_ChanKeySignerDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = new DecodeError(null, err); + number err = bindings.LDKCResult_ChanKeySignerDecodeErrorZ_get_err(ptr); + const err_hu_conv: DecodeError = new DecodeError(null, err); this.err = err_hu_conv; } public Result_ChanKeySignerDecodeErrorZ_Err(DecodeError err) { diff --git a/ts/structs/Result_ChannelMonitorUpdateDecodeErrorZ.ts b/ts/structs/Result_ChannelMonitorUpdateDecodeErrorZ.ts index 39e7d9c6..bb164245 100644 --- a/ts/structs/Result_ChannelMonitorUpdateDecodeErrorZ.ts +++ b/ts/structs/Result_ChannelMonitorUpdateDecodeErrorZ.ts @@ -19,8 +19,8 @@ public class Result_ChannelMonitorUpdateDecodeErrorZ extends CommonBase { public final ChannelMonitorUpdate res; private Result_ChannelMonitorUpdateDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t res = bindings.LDKCResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(ptr); - ChannelMonitorUpdate res_hu_conv = new ChannelMonitorUpdate(null, res); + number res = bindings.LDKCResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(ptr); + const res_hu_conv: ChannelMonitorUpdate = new ChannelMonitorUpdate(null, res); this.res = res_hu_conv; } public Result_ChannelMonitorUpdateDecodeErrorZ_OK(ChannelMonitorUpdate res) { @@ -33,8 +33,8 @@ public class Result_ChannelMonitorUpdateDecodeErrorZ extends CommonBase { public final DecodeError err; private Result_ChannelMonitorUpdateDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t err = bindings.LDKCResult_ChannelMonitorUpdateDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = new DecodeError(null, err); + number err = bindings.LDKCResult_ChannelMonitorUpdateDecodeErrorZ_get_err(ptr); + const err_hu_conv: DecodeError = new DecodeError(null, err); this.err = err_hu_conv; } public Result_ChannelMonitorUpdateDecodeErrorZ_Err(DecodeError err) { diff --git a/ts/structs/Result_ChannelReestablishDecodeErrorZ.ts b/ts/structs/Result_ChannelReestablishDecodeErrorZ.ts index e47da506..1abe894f 100644 --- a/ts/structs/Result_ChannelReestablishDecodeErrorZ.ts +++ b/ts/structs/Result_ChannelReestablishDecodeErrorZ.ts @@ -19,8 +19,8 @@ public class Result_ChannelReestablishDecodeErrorZ extends CommonBase { public final ChannelReestablish res; private Result_ChannelReestablishDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t res = bindings.LDKCResult_ChannelReestablishDecodeErrorZ_get_ok(ptr); - ChannelReestablish res_hu_conv = new ChannelReestablish(null, res); + number res = bindings.LDKCResult_ChannelReestablishDecodeErrorZ_get_ok(ptr); + const res_hu_conv: ChannelReestablish = new ChannelReestablish(null, res); this.res = res_hu_conv; } public Result_ChannelReestablishDecodeErrorZ_OK(ChannelReestablish res) { @@ -33,8 +33,8 @@ public class Result_ChannelReestablishDecodeErrorZ extends CommonBase { public final DecodeError err; private Result_ChannelReestablishDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t err = bindings.LDKCResult_ChannelReestablishDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = new DecodeError(null, err); + number err = bindings.LDKCResult_ChannelReestablishDecodeErrorZ_get_err(ptr); + const err_hu_conv: DecodeError = new DecodeError(null, err); this.err = err_hu_conv; } public Result_ChannelReestablishDecodeErrorZ_Err(DecodeError err) { diff --git a/ts/structs/Result_ErrorMessageDecodeErrorZ.ts b/ts/structs/Result_ErrorMessageDecodeErrorZ.ts index 1d081cd1..12b75fe0 100644 --- a/ts/structs/Result_ErrorMessageDecodeErrorZ.ts +++ b/ts/structs/Result_ErrorMessageDecodeErrorZ.ts @@ -19,8 +19,8 @@ public class Result_ErrorMessageDecodeErrorZ extends CommonBase { public final ErrorMessage res; private Result_ErrorMessageDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t res = bindings.LDKCResult_ErrorMessageDecodeErrorZ_get_ok(ptr); - ErrorMessage res_hu_conv = new ErrorMessage(null, res); + number res = bindings.LDKCResult_ErrorMessageDecodeErrorZ_get_ok(ptr); + const res_hu_conv: ErrorMessage = new ErrorMessage(null, res); this.res = res_hu_conv; } public Result_ErrorMessageDecodeErrorZ_OK(ErrorMessage res) { @@ -33,8 +33,8 @@ public class Result_ErrorMessageDecodeErrorZ extends CommonBase { public final DecodeError err; private Result_ErrorMessageDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t err = bindings.LDKCResult_ErrorMessageDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = new DecodeError(null, err); + number err = bindings.LDKCResult_ErrorMessageDecodeErrorZ_get_err(ptr); + const err_hu_conv: DecodeError = new DecodeError(null, err); this.err = err_hu_conv; } public Result_ErrorMessageDecodeErrorZ_Err(DecodeError err) { diff --git a/ts/structs/Result_GossipTimestampFilterDecodeErrorZ.ts b/ts/structs/Result_GossipTimestampFilterDecodeErrorZ.ts index 909bc15d..a3972e68 100644 --- a/ts/structs/Result_GossipTimestampFilterDecodeErrorZ.ts +++ b/ts/structs/Result_GossipTimestampFilterDecodeErrorZ.ts @@ -19,8 +19,8 @@ public class Result_GossipTimestampFilterDecodeErrorZ extends CommonBase { public final GossipTimestampFilter res; private Result_GossipTimestampFilterDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t res = bindings.LDKCResult_GossipTimestampFilterDecodeErrorZ_get_ok(ptr); - GossipTimestampFilter res_hu_conv = new GossipTimestampFilter(null, res); + number res = bindings.LDKCResult_GossipTimestampFilterDecodeErrorZ_get_ok(ptr); + const res_hu_conv: GossipTimestampFilter = new GossipTimestampFilter(null, res); this.res = res_hu_conv; } public Result_GossipTimestampFilterDecodeErrorZ_OK(GossipTimestampFilter res) { @@ -33,8 +33,8 @@ public class Result_GossipTimestampFilterDecodeErrorZ extends CommonBase { public final DecodeError err; private Result_GossipTimestampFilterDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t err = bindings.LDKCResult_GossipTimestampFilterDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = new DecodeError(null, err); + number err = bindings.LDKCResult_GossipTimestampFilterDecodeErrorZ_get_err(ptr); + const err_hu_conv: DecodeError = new DecodeError(null, err); this.err = err_hu_conv; } public Result_GossipTimestampFilterDecodeErrorZ_Err(DecodeError err) { diff --git a/ts/structs/Result_InMemoryChannelKeysDecodeErrorZ.ts b/ts/structs/Result_InMemoryChannelKeysDecodeErrorZ.ts index 0dde403d..41c34a7a 100644 --- a/ts/structs/Result_InMemoryChannelKeysDecodeErrorZ.ts +++ b/ts/structs/Result_InMemoryChannelKeysDecodeErrorZ.ts @@ -19,8 +19,8 @@ public class Result_InMemoryChannelKeysDecodeErrorZ extends CommonBase { public final InMemoryChannelKeys res; private Result_InMemoryChannelKeysDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t res = bindings.LDKCResult_InMemoryChannelKeysDecodeErrorZ_get_ok(ptr); - InMemoryChannelKeys res_hu_conv = new InMemoryChannelKeys(null, res); + number res = bindings.LDKCResult_InMemoryChannelKeysDecodeErrorZ_get_ok(ptr); + const res_hu_conv: InMemoryChannelKeys = new InMemoryChannelKeys(null, res); this.res = res_hu_conv; } public Result_InMemoryChannelKeysDecodeErrorZ_OK(InMemoryChannelKeys res) { @@ -33,8 +33,8 @@ public class Result_InMemoryChannelKeysDecodeErrorZ extends CommonBase { public final DecodeError err; private Result_InMemoryChannelKeysDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t err = bindings.LDKCResult_InMemoryChannelKeysDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = new DecodeError(null, err); + number err = bindings.LDKCResult_InMemoryChannelKeysDecodeErrorZ_get_err(ptr); + const err_hu_conv: DecodeError = new DecodeError(null, err); this.err = err_hu_conv; } public Result_InMemoryChannelKeysDecodeErrorZ_Err(DecodeError err) { diff --git a/ts/structs/Result_InitDecodeErrorZ.ts b/ts/structs/Result_InitDecodeErrorZ.ts index 469f7277..bd37f300 100644 --- a/ts/structs/Result_InitDecodeErrorZ.ts +++ b/ts/structs/Result_InitDecodeErrorZ.ts @@ -19,8 +19,8 @@ public class Result_InitDecodeErrorZ extends CommonBase { public final Init res; private Result_InitDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t res = bindings.LDKCResult_InitDecodeErrorZ_get_ok(ptr); - Init res_hu_conv = new Init(null, res); + number res = bindings.LDKCResult_InitDecodeErrorZ_get_ok(ptr); + const res_hu_conv: Init = new Init(null, res); this.res = res_hu_conv; } public Result_InitDecodeErrorZ_OK(Init res) { @@ -33,8 +33,8 @@ public class Result_InitDecodeErrorZ extends CommonBase { public final DecodeError err; private Result_InitDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t err = bindings.LDKCResult_InitDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = new DecodeError(null, err); + number err = bindings.LDKCResult_InitDecodeErrorZ_get_err(ptr); + const err_hu_conv: DecodeError = new DecodeError(null, err); this.err = err_hu_conv; } public Result_InitDecodeErrorZ_Err(DecodeError err) { diff --git a/ts/structs/Result_NetAddressu8Z.ts b/ts/structs/Result_NetAddressu8Z.ts index 07f73f22..0725f11f 100644 --- a/ts/structs/Result_NetAddressu8Z.ts +++ b/ts/structs/Result_NetAddressu8Z.ts @@ -19,7 +19,7 @@ public class Result_NetAddressu8Z extends CommonBase { public final NetAddress res; private Result_NetAddressu8Z_OK(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t res = bindings.LDKCResult_NetAddressu8Z_get_ok(ptr); + number res = bindings.LDKCResult_NetAddressu8Z_get_ok(ptr); NetAddress res_hu_conv = NetAddress.constr_from_ptr(res); res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; @@ -30,12 +30,12 @@ public class Result_NetAddressu8Z extends CommonBase { } public static final class Result_NetAddressu8Z_Err extends Result_NetAddressu8Z { - public final byte err; + public final number err; private Result_NetAddressu8Z_Err(Object _dummy, long ptr) { super(_dummy, ptr); this.err = bindings.LDKCResult_NetAddressu8Z_get_err(ptr); } - public Result_NetAddressu8Z_Err(byte err) { + public Result_NetAddressu8Z_Err(number err) { this(null, bindings.CResult_NetAddressu8Z_err(err)); } } diff --git a/ts/structs/Result_NetworkGraphDecodeErrorZ.ts b/ts/structs/Result_NetworkGraphDecodeErrorZ.ts index c66bd013..997a3638 100644 --- a/ts/structs/Result_NetworkGraphDecodeErrorZ.ts +++ b/ts/structs/Result_NetworkGraphDecodeErrorZ.ts @@ -19,8 +19,8 @@ public class Result_NetworkGraphDecodeErrorZ extends CommonBase { public final NetworkGraph res; private Result_NetworkGraphDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t res = bindings.LDKCResult_NetworkGraphDecodeErrorZ_get_ok(ptr); - NetworkGraph res_hu_conv = new NetworkGraph(null, res); + number res = bindings.LDKCResult_NetworkGraphDecodeErrorZ_get_ok(ptr); + const res_hu_conv: NetworkGraph = new NetworkGraph(null, res); this.res = res_hu_conv; } public Result_NetworkGraphDecodeErrorZ_OK(NetworkGraph res) { @@ -33,8 +33,8 @@ public class Result_NetworkGraphDecodeErrorZ extends CommonBase { public final DecodeError err; private Result_NetworkGraphDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t err = bindings.LDKCResult_NetworkGraphDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = new DecodeError(null, err); + number err = bindings.LDKCResult_NetworkGraphDecodeErrorZ_get_err(ptr); + const err_hu_conv: DecodeError = new DecodeError(null, err); this.err = err_hu_conv; } public Result_NetworkGraphDecodeErrorZ_Err(DecodeError err) { diff --git a/ts/structs/Result_NodeAnnouncementInfoDecodeErrorZ.ts b/ts/structs/Result_NodeAnnouncementInfoDecodeErrorZ.ts index 8a348edd..d76322e5 100644 --- a/ts/structs/Result_NodeAnnouncementInfoDecodeErrorZ.ts +++ b/ts/structs/Result_NodeAnnouncementInfoDecodeErrorZ.ts @@ -19,8 +19,8 @@ public class Result_NodeAnnouncementInfoDecodeErrorZ extends CommonBase { public final NodeAnnouncementInfo res; private Result_NodeAnnouncementInfoDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t res = bindings.LDKCResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(ptr); - NodeAnnouncementInfo res_hu_conv = new NodeAnnouncementInfo(null, res); + number res = bindings.LDKCResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(ptr); + const res_hu_conv: NodeAnnouncementInfo = new NodeAnnouncementInfo(null, res); this.res = res_hu_conv; } public Result_NodeAnnouncementInfoDecodeErrorZ_OK(NodeAnnouncementInfo res) { @@ -33,8 +33,8 @@ public class Result_NodeAnnouncementInfoDecodeErrorZ extends CommonBase { public final DecodeError err; private Result_NodeAnnouncementInfoDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t err = bindings.LDKCResult_NodeAnnouncementInfoDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = new DecodeError(null, err); + number err = bindings.LDKCResult_NodeAnnouncementInfoDecodeErrorZ_get_err(ptr); + const err_hu_conv: DecodeError = new DecodeError(null, err); this.err = err_hu_conv; } public Result_NodeAnnouncementInfoDecodeErrorZ_Err(DecodeError err) { diff --git a/ts/structs/Result_NodeInfoDecodeErrorZ.ts b/ts/structs/Result_NodeInfoDecodeErrorZ.ts index 0998baaf..ff25f319 100644 --- a/ts/structs/Result_NodeInfoDecodeErrorZ.ts +++ b/ts/structs/Result_NodeInfoDecodeErrorZ.ts @@ -19,8 +19,8 @@ public class Result_NodeInfoDecodeErrorZ extends CommonBase { public final NodeInfo res; private Result_NodeInfoDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t res = bindings.LDKCResult_NodeInfoDecodeErrorZ_get_ok(ptr); - NodeInfo res_hu_conv = new NodeInfo(null, res); + number res = bindings.LDKCResult_NodeInfoDecodeErrorZ_get_ok(ptr); + const res_hu_conv: NodeInfo = new NodeInfo(null, res); this.res = res_hu_conv; } public Result_NodeInfoDecodeErrorZ_OK(NodeInfo res) { @@ -33,8 +33,8 @@ public class Result_NodeInfoDecodeErrorZ extends CommonBase { public final DecodeError err; private Result_NodeInfoDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t err = bindings.LDKCResult_NodeInfoDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = new DecodeError(null, err); + number err = bindings.LDKCResult_NodeInfoDecodeErrorZ_get_err(ptr); + const err_hu_conv: DecodeError = new DecodeError(null, err); this.err = err_hu_conv; } public Result_NodeInfoDecodeErrorZ_Err(DecodeError err) { diff --git a/ts/structs/Result_NoneAPIErrorZ.ts b/ts/structs/Result_NoneAPIErrorZ.ts index 80d7ce75..7bedbd60 100644 --- a/ts/structs/Result_NoneAPIErrorZ.ts +++ b/ts/structs/Result_NoneAPIErrorZ.ts @@ -28,7 +28,7 @@ public class Result_NoneAPIErrorZ extends CommonBase { public final APIError err; private Result_NoneAPIErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t err = bindings.LDKCResult_NoneAPIErrorZ_get_err(ptr); + number err = bindings.LDKCResult_NoneAPIErrorZ_get_err(ptr); APIError err_hu_conv = APIError.constr_from_ptr(err); err_hu_conv.ptrs_to.add(this); this.err = err_hu_conv; diff --git a/ts/structs/Result_NoneLightningErrorZ.ts b/ts/structs/Result_NoneLightningErrorZ.ts index 71906ee1..13d3735b 100644 --- a/ts/structs/Result_NoneLightningErrorZ.ts +++ b/ts/structs/Result_NoneLightningErrorZ.ts @@ -28,8 +28,8 @@ public class Result_NoneLightningErrorZ extends CommonBase { public final LightningError err; private Result_NoneLightningErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t err = bindings.LDKCResult_NoneLightningErrorZ_get_err(ptr); - LightningError err_hu_conv = new LightningError(null, err); + number err = bindings.LDKCResult_NoneLightningErrorZ_get_err(ptr); + const err_hu_conv: LightningError = new LightningError(null, err); this.err = err_hu_conv; } public Result_NoneLightningErrorZ_Err(LightningError err) { diff --git a/ts/structs/Result_NoneMonitorUpdateErrorZ.ts b/ts/structs/Result_NoneMonitorUpdateErrorZ.ts index 2071bb5d..0790b404 100644 --- a/ts/structs/Result_NoneMonitorUpdateErrorZ.ts +++ b/ts/structs/Result_NoneMonitorUpdateErrorZ.ts @@ -28,8 +28,8 @@ public class Result_NoneMonitorUpdateErrorZ extends CommonBase { public final MonitorUpdateError err; private Result_NoneMonitorUpdateErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t err = bindings.LDKCResult_NoneMonitorUpdateErrorZ_get_err(ptr); - MonitorUpdateError err_hu_conv = new MonitorUpdateError(null, err); + number err = bindings.LDKCResult_NoneMonitorUpdateErrorZ_get_err(ptr); + const err_hu_conv: MonitorUpdateError = new MonitorUpdateError(null, err); this.err = err_hu_conv; } public Result_NoneMonitorUpdateErrorZ_Err(MonitorUpdateError err) { diff --git a/ts/structs/Result_NonePaymentSendFailureZ.ts b/ts/structs/Result_NonePaymentSendFailureZ.ts index 2ed2fad2..69636d7e 100644 --- a/ts/structs/Result_NonePaymentSendFailureZ.ts +++ b/ts/structs/Result_NonePaymentSendFailureZ.ts @@ -28,8 +28,8 @@ public class Result_NonePaymentSendFailureZ extends CommonBase { public final PaymentSendFailure err; private Result_NonePaymentSendFailureZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t err = bindings.LDKCResult_NonePaymentSendFailureZ_get_err(ptr); - PaymentSendFailure err_hu_conv = new PaymentSendFailure(null, err); + number err = bindings.LDKCResult_NonePaymentSendFailureZ_get_err(ptr); + const err_hu_conv: PaymentSendFailure = new PaymentSendFailure(null, err); this.err = err_hu_conv; } public Result_NonePaymentSendFailureZ_Err(PaymentSendFailure err) { diff --git a/ts/structs/Result_NonePeerHandleErrorZ.ts b/ts/structs/Result_NonePeerHandleErrorZ.ts index b836c953..dc058075 100644 --- a/ts/structs/Result_NonePeerHandleErrorZ.ts +++ b/ts/structs/Result_NonePeerHandleErrorZ.ts @@ -28,8 +28,8 @@ public class Result_NonePeerHandleErrorZ extends CommonBase { public final PeerHandleError err; private Result_NonePeerHandleErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t err = bindings.LDKCResult_NonePeerHandleErrorZ_get_err(ptr); - PeerHandleError err_hu_conv = new PeerHandleError(null, err); + number err = bindings.LDKCResult_NonePeerHandleErrorZ_get_err(ptr); + const err_hu_conv: PeerHandleError = new PeerHandleError(null, err); this.err = err_hu_conv; } public Result_NonePeerHandleErrorZ_Err(PeerHandleError err) { diff --git a/ts/structs/Result_PingDecodeErrorZ.ts b/ts/structs/Result_PingDecodeErrorZ.ts index 09554e17..c97cf53a 100644 --- a/ts/structs/Result_PingDecodeErrorZ.ts +++ b/ts/structs/Result_PingDecodeErrorZ.ts @@ -19,8 +19,8 @@ public class Result_PingDecodeErrorZ extends CommonBase { public final Ping res; private Result_PingDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t res = bindings.LDKCResult_PingDecodeErrorZ_get_ok(ptr); - Ping res_hu_conv = new Ping(null, res); + number res = bindings.LDKCResult_PingDecodeErrorZ_get_ok(ptr); + const res_hu_conv: Ping = new Ping(null, res); this.res = res_hu_conv; } public Result_PingDecodeErrorZ_OK(Ping res) { @@ -33,8 +33,8 @@ public class Result_PingDecodeErrorZ extends CommonBase { public final DecodeError err; private Result_PingDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t err = bindings.LDKCResult_PingDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = new DecodeError(null, err); + number err = bindings.LDKCResult_PingDecodeErrorZ_get_err(ptr); + const err_hu_conv: DecodeError = new DecodeError(null, err); this.err = err_hu_conv; } public Result_PingDecodeErrorZ_Err(DecodeError err) { diff --git a/ts/structs/Result_PongDecodeErrorZ.ts b/ts/structs/Result_PongDecodeErrorZ.ts index f101a67b..16e60514 100644 --- a/ts/structs/Result_PongDecodeErrorZ.ts +++ b/ts/structs/Result_PongDecodeErrorZ.ts @@ -19,8 +19,8 @@ public class Result_PongDecodeErrorZ extends CommonBase { public final Pong res; private Result_PongDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t res = bindings.LDKCResult_PongDecodeErrorZ_get_ok(ptr); - Pong res_hu_conv = new Pong(null, res); + number res = bindings.LDKCResult_PongDecodeErrorZ_get_ok(ptr); + const res_hu_conv: Pong = new Pong(null, res); this.res = res_hu_conv; } public Result_PongDecodeErrorZ_OK(Pong res) { @@ -33,8 +33,8 @@ public class Result_PongDecodeErrorZ extends CommonBase { public final DecodeError err; private Result_PongDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t err = bindings.LDKCResult_PongDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = new DecodeError(null, err); + number err = bindings.LDKCResult_PongDecodeErrorZ_get_err(ptr); + const err_hu_conv: DecodeError = new DecodeError(null, err); this.err = err_hu_conv; } public Result_PongDecodeErrorZ_Err(DecodeError err) { diff --git a/ts/structs/Result_PublicKeySecpErrorZ.ts b/ts/structs/Result_PublicKeySecpErrorZ.ts index d5b9096a..bf427c76 100644 --- a/ts/structs/Result_PublicKeySecpErrorZ.ts +++ b/ts/structs/Result_PublicKeySecpErrorZ.ts @@ -16,12 +16,12 @@ public class Result_PublicKeySecpErrorZ extends CommonBase { } } public static final class Result_PublicKeySecpErrorZ_OK extends Result_PublicKeySecpErrorZ { - public final byte[] res; + public final Uint8Array res; private Result_PublicKeySecpErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); this.res = bindings.LDKCResult_PublicKeySecpErrorZ_get_ok(ptr); } - public Result_PublicKeySecpErrorZ_OK(byte[] res) { + public Result_PublicKeySecpErrorZ_OK(Uint8Array res) { this(null, bindings.CResult_PublicKeySecpErrorZ_ok(res)); } } diff --git a/ts/structs/Result_QueryChannelRangeDecodeErrorZ.ts b/ts/structs/Result_QueryChannelRangeDecodeErrorZ.ts index 07847828..40265bb2 100644 --- a/ts/structs/Result_QueryChannelRangeDecodeErrorZ.ts +++ b/ts/structs/Result_QueryChannelRangeDecodeErrorZ.ts @@ -19,8 +19,8 @@ public class Result_QueryChannelRangeDecodeErrorZ extends CommonBase { public final QueryChannelRange res; private Result_QueryChannelRangeDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t res = bindings.LDKCResult_QueryChannelRangeDecodeErrorZ_get_ok(ptr); - QueryChannelRange res_hu_conv = new QueryChannelRange(null, res); + number res = bindings.LDKCResult_QueryChannelRangeDecodeErrorZ_get_ok(ptr); + const res_hu_conv: QueryChannelRange = new QueryChannelRange(null, res); this.res = res_hu_conv; } public Result_QueryChannelRangeDecodeErrorZ_OK(QueryChannelRange res) { @@ -33,8 +33,8 @@ public class Result_QueryChannelRangeDecodeErrorZ extends CommonBase { public final DecodeError err; private Result_QueryChannelRangeDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t err = bindings.LDKCResult_QueryChannelRangeDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = new DecodeError(null, err); + number err = bindings.LDKCResult_QueryChannelRangeDecodeErrorZ_get_err(ptr); + const err_hu_conv: DecodeError = new DecodeError(null, err); this.err = err_hu_conv; } public Result_QueryChannelRangeDecodeErrorZ_Err(DecodeError err) { diff --git a/ts/structs/Result_QueryShortChannelIdsDecodeErrorZ.ts b/ts/structs/Result_QueryShortChannelIdsDecodeErrorZ.ts index f13345ab..546feb8c 100644 --- a/ts/structs/Result_QueryShortChannelIdsDecodeErrorZ.ts +++ b/ts/structs/Result_QueryShortChannelIdsDecodeErrorZ.ts @@ -19,8 +19,8 @@ public class Result_QueryShortChannelIdsDecodeErrorZ extends CommonBase { public final QueryShortChannelIds res; private Result_QueryShortChannelIdsDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t res = bindings.LDKCResult_QueryShortChannelIdsDecodeErrorZ_get_ok(ptr); - QueryShortChannelIds res_hu_conv = new QueryShortChannelIds(null, res); + number res = bindings.LDKCResult_QueryShortChannelIdsDecodeErrorZ_get_ok(ptr); + const res_hu_conv: QueryShortChannelIds = new QueryShortChannelIds(null, res); this.res = res_hu_conv; } public Result_QueryShortChannelIdsDecodeErrorZ_OK(QueryShortChannelIds res) { @@ -33,8 +33,8 @@ public class Result_QueryShortChannelIdsDecodeErrorZ extends CommonBase { public final DecodeError err; private Result_QueryShortChannelIdsDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t err = bindings.LDKCResult_QueryShortChannelIdsDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = new DecodeError(null, err); + number err = bindings.LDKCResult_QueryShortChannelIdsDecodeErrorZ_get_err(ptr); + const err_hu_conv: DecodeError = new DecodeError(null, err); this.err = err_hu_conv; } public Result_QueryShortChannelIdsDecodeErrorZ_Err(DecodeError err) { diff --git a/ts/structs/Result_ReplyChannelRangeDecodeErrorZ.ts b/ts/structs/Result_ReplyChannelRangeDecodeErrorZ.ts index 3c91a47e..133c2eda 100644 --- a/ts/structs/Result_ReplyChannelRangeDecodeErrorZ.ts +++ b/ts/structs/Result_ReplyChannelRangeDecodeErrorZ.ts @@ -19,8 +19,8 @@ public class Result_ReplyChannelRangeDecodeErrorZ extends CommonBase { public final ReplyChannelRange res; private Result_ReplyChannelRangeDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t res = bindings.LDKCResult_ReplyChannelRangeDecodeErrorZ_get_ok(ptr); - ReplyChannelRange res_hu_conv = new ReplyChannelRange(null, res); + number res = bindings.LDKCResult_ReplyChannelRangeDecodeErrorZ_get_ok(ptr); + const res_hu_conv: ReplyChannelRange = new ReplyChannelRange(null, res); this.res = res_hu_conv; } public Result_ReplyChannelRangeDecodeErrorZ_OK(ReplyChannelRange res) { @@ -33,8 +33,8 @@ public class Result_ReplyChannelRangeDecodeErrorZ extends CommonBase { public final DecodeError err; private Result_ReplyChannelRangeDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t err = bindings.LDKCResult_ReplyChannelRangeDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = new DecodeError(null, err); + number err = bindings.LDKCResult_ReplyChannelRangeDecodeErrorZ_get_err(ptr); + const err_hu_conv: DecodeError = new DecodeError(null, err); this.err = err_hu_conv; } public Result_ReplyChannelRangeDecodeErrorZ_Err(DecodeError err) { diff --git a/ts/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.ts b/ts/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.ts index dc355afc..08d3a442 100644 --- a/ts/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.ts +++ b/ts/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.ts @@ -19,8 +19,8 @@ public class Result_ReplyShortChannelIdsEndDecodeErrorZ extends CommonBase { public final ReplyShortChannelIdsEnd res; private Result_ReplyShortChannelIdsEndDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t res = bindings.LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(ptr); - ReplyShortChannelIdsEnd res_hu_conv = new ReplyShortChannelIdsEnd(null, res); + number res = bindings.LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(ptr); + const res_hu_conv: ReplyShortChannelIdsEnd = new ReplyShortChannelIdsEnd(null, res); this.res = res_hu_conv; } public Result_ReplyShortChannelIdsEndDecodeErrorZ_OK(ReplyShortChannelIdsEnd res) { @@ -33,8 +33,8 @@ public class Result_ReplyShortChannelIdsEndDecodeErrorZ extends CommonBase { public final DecodeError err; private Result_ReplyShortChannelIdsEndDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t err = bindings.LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = new DecodeError(null, err); + number err = bindings.LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(ptr); + const err_hu_conv: DecodeError = new DecodeError(null, err); this.err = err_hu_conv; } public Result_ReplyShortChannelIdsEndDecodeErrorZ_Err(DecodeError err) { diff --git a/ts/structs/Result_RouteDecodeErrorZ.ts b/ts/structs/Result_RouteDecodeErrorZ.ts index d3b0e2ef..2fff6d28 100644 --- a/ts/structs/Result_RouteDecodeErrorZ.ts +++ b/ts/structs/Result_RouteDecodeErrorZ.ts @@ -19,8 +19,8 @@ public class Result_RouteDecodeErrorZ extends CommonBase { public final Route res; private Result_RouteDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t res = bindings.LDKCResult_RouteDecodeErrorZ_get_ok(ptr); - Route res_hu_conv = new Route(null, res); + number res = bindings.LDKCResult_RouteDecodeErrorZ_get_ok(ptr); + const res_hu_conv: Route = new Route(null, res); this.res = res_hu_conv; } public Result_RouteDecodeErrorZ_OK(Route res) { @@ -33,8 +33,8 @@ public class Result_RouteDecodeErrorZ extends CommonBase { public final DecodeError err; private Result_RouteDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t err = bindings.LDKCResult_RouteDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = new DecodeError(null, err); + number err = bindings.LDKCResult_RouteDecodeErrorZ_get_err(ptr); + const err_hu_conv: DecodeError = new DecodeError(null, err); this.err = err_hu_conv; } public Result_RouteDecodeErrorZ_Err(DecodeError err) { diff --git a/ts/structs/Result_RouteLightningErrorZ.ts b/ts/structs/Result_RouteLightningErrorZ.ts index 2676851f..bc2d6b4b 100644 --- a/ts/structs/Result_RouteLightningErrorZ.ts +++ b/ts/structs/Result_RouteLightningErrorZ.ts @@ -19,8 +19,8 @@ public class Result_RouteLightningErrorZ extends CommonBase { public final Route res; private Result_RouteLightningErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t res = bindings.LDKCResult_RouteLightningErrorZ_get_ok(ptr); - Route res_hu_conv = new Route(null, res); + number res = bindings.LDKCResult_RouteLightningErrorZ_get_ok(ptr); + const res_hu_conv: Route = new Route(null, res); this.res = res_hu_conv; } public Result_RouteLightningErrorZ_OK(Route res) { @@ -33,8 +33,8 @@ public class Result_RouteLightningErrorZ extends CommonBase { public final LightningError err; private Result_RouteLightningErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t err = bindings.LDKCResult_RouteLightningErrorZ_get_err(ptr); - LightningError err_hu_conv = new LightningError(null, err); + number err = bindings.LDKCResult_RouteLightningErrorZ_get_err(ptr); + const err_hu_conv: LightningError = new LightningError(null, err); this.err = err_hu_conv; } public Result_RouteLightningErrorZ_Err(LightningError err) { diff --git a/ts/structs/Result_RoutingFeesDecodeErrorZ.ts b/ts/structs/Result_RoutingFeesDecodeErrorZ.ts index c4b7a912..cbd3d168 100644 --- a/ts/structs/Result_RoutingFeesDecodeErrorZ.ts +++ b/ts/structs/Result_RoutingFeesDecodeErrorZ.ts @@ -19,8 +19,8 @@ public class Result_RoutingFeesDecodeErrorZ extends CommonBase { public final RoutingFees res; private Result_RoutingFeesDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t res = bindings.LDKCResult_RoutingFeesDecodeErrorZ_get_ok(ptr); - RoutingFees res_hu_conv = new RoutingFees(null, res); + number res = bindings.LDKCResult_RoutingFeesDecodeErrorZ_get_ok(ptr); + const res_hu_conv: RoutingFees = new RoutingFees(null, res); this.res = res_hu_conv; } public Result_RoutingFeesDecodeErrorZ_OK(RoutingFees res) { @@ -33,8 +33,8 @@ public class Result_RoutingFeesDecodeErrorZ extends CommonBase { public final DecodeError err; private Result_RoutingFeesDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t err = bindings.LDKCResult_RoutingFeesDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = new DecodeError(null, err); + number err = bindings.LDKCResult_RoutingFeesDecodeErrorZ_get_err(ptr); + const err_hu_conv: DecodeError = new DecodeError(null, err); this.err = err_hu_conv; } public Result_RoutingFeesDecodeErrorZ_Err(DecodeError err) { diff --git a/ts/structs/Result_SecretKeySecpErrorZ.ts b/ts/structs/Result_SecretKeySecpErrorZ.ts index ce2c2c1f..5ebf99c9 100644 --- a/ts/structs/Result_SecretKeySecpErrorZ.ts +++ b/ts/structs/Result_SecretKeySecpErrorZ.ts @@ -16,12 +16,12 @@ public class Result_SecretKeySecpErrorZ extends CommonBase { } } public static final class Result_SecretKeySecpErrorZ_OK extends Result_SecretKeySecpErrorZ { - public final byte[] res; + public final Uint8Array res; private Result_SecretKeySecpErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); this.res = bindings.LDKCResult_SecretKeySecpErrorZ_get_ok(ptr); } - public Result_SecretKeySecpErrorZ_OK(byte[] res) { + public Result_SecretKeySecpErrorZ_OK(Uint8Array res) { this(null, bindings.CResult_SecretKeySecpErrorZ_ok(res)); } } diff --git a/ts/structs/Result_SignatureNoneZ.ts b/ts/structs/Result_SignatureNoneZ.ts index 74a61f9e..56faaa4f 100644 --- a/ts/structs/Result_SignatureNoneZ.ts +++ b/ts/structs/Result_SignatureNoneZ.ts @@ -16,12 +16,12 @@ public class Result_SignatureNoneZ extends CommonBase { } } public static final class Result_SignatureNoneZ_OK extends Result_SignatureNoneZ { - public final byte[] res; + public final Uint8Array res; private Result_SignatureNoneZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); this.res = bindings.LDKCResult_SignatureNoneZ_get_ok(ptr); } - public Result_SignatureNoneZ_OK(byte[] res) { + public Result_SignatureNoneZ_OK(Uint8Array res) { this(null, bindings.CResult_SignatureNoneZ_ok(res)); } } diff --git a/ts/structs/Result_SpendableOutputDescriptorDecodeErrorZ.ts b/ts/structs/Result_SpendableOutputDescriptorDecodeErrorZ.ts index 056adace..cb6afaa9 100644 --- a/ts/structs/Result_SpendableOutputDescriptorDecodeErrorZ.ts +++ b/ts/structs/Result_SpendableOutputDescriptorDecodeErrorZ.ts @@ -19,7 +19,7 @@ public class Result_SpendableOutputDescriptorDecodeErrorZ extends CommonBase { public final SpendableOutputDescriptor res; private Result_SpendableOutputDescriptorDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t res = bindings.LDKCResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(ptr); + number res = bindings.LDKCResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(ptr); SpendableOutputDescriptor res_hu_conv = SpendableOutputDescriptor.constr_from_ptr(res); res_hu_conv.ptrs_to.add(this); this.res = res_hu_conv; @@ -33,8 +33,8 @@ public class Result_SpendableOutputDescriptorDecodeErrorZ extends CommonBase { public final DecodeError err; private Result_SpendableOutputDescriptorDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t err = bindings.LDKCResult_SpendableOutputDescriptorDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = new DecodeError(null, err); + number err = bindings.LDKCResult_SpendableOutputDescriptorDecodeErrorZ_get_err(ptr); + const err_hu_conv: DecodeError = new DecodeError(null, err); this.err = err_hu_conv; } public Result_SpendableOutputDescriptorDecodeErrorZ_Err(DecodeError err) { diff --git a/ts/structs/Result_TrustedCommitmentTransactionNoneZ.ts b/ts/structs/Result_TrustedCommitmentTransactionNoneZ.ts index 0bd6c403..57391810 100644 --- a/ts/structs/Result_TrustedCommitmentTransactionNoneZ.ts +++ b/ts/structs/Result_TrustedCommitmentTransactionNoneZ.ts @@ -19,8 +19,8 @@ public class Result_TrustedCommitmentTransactionNoneZ extends CommonBase { public final TrustedCommitmentTransaction res; private Result_TrustedCommitmentTransactionNoneZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t res = bindings.LDKCResult_TrustedCommitmentTransactionNoneZ_get_ok(ptr); - TrustedCommitmentTransaction res_hu_conv = new TrustedCommitmentTransaction(null, res); + number res = bindings.LDKCResult_TrustedCommitmentTransactionNoneZ_get_ok(ptr); + const res_hu_conv: TrustedCommitmentTransaction = new TrustedCommitmentTransaction(null, res); this.res = res_hu_conv; } public Result_TrustedCommitmentTransactionNoneZ_OK(TrustedCommitmentTransaction res) { diff --git a/ts/structs/Result_TxCreationKeysSecpErrorZ.ts b/ts/structs/Result_TxCreationKeysSecpErrorZ.ts index 60717ec3..54de3e12 100644 --- a/ts/structs/Result_TxCreationKeysSecpErrorZ.ts +++ b/ts/structs/Result_TxCreationKeysSecpErrorZ.ts @@ -19,8 +19,8 @@ public class Result_TxCreationKeysSecpErrorZ extends CommonBase { public final TxCreationKeys res; private Result_TxCreationKeysSecpErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t res = bindings.LDKCResult_TxCreationKeysSecpErrorZ_get_ok(ptr); - TxCreationKeys res_hu_conv = new TxCreationKeys(null, res); + number res = bindings.LDKCResult_TxCreationKeysSecpErrorZ_get_ok(ptr); + const res_hu_conv: TxCreationKeys = new TxCreationKeys(null, res); this.res = res_hu_conv; } public Result_TxCreationKeysSecpErrorZ_OK(TxCreationKeys res) { diff --git a/ts/structs/Result_TxOutAccessErrorZ.ts b/ts/structs/Result_TxOutAccessErrorZ.ts index 1caef466..53a09f17 100644 --- a/ts/structs/Result_TxOutAccessErrorZ.ts +++ b/ts/structs/Result_TxOutAccessErrorZ.ts @@ -19,7 +19,7 @@ public class Result_TxOutAccessErrorZ extends CommonBase { public final TxOut res; private Result_TxOutAccessErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t res = bindings.LDKCResult_TxOutAccessErrorZ_get_ok(ptr); + number res = bindings.LDKCResult_TxOutAccessErrorZ_get_ok(ptr); TxOut res_conv = new TxOut(null, res); this.res = res_conv; } diff --git a/ts/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.ts b/ts/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.ts index 4bfd88bf..b38975ef 100644 --- a/ts/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.ts +++ b/ts/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.ts @@ -19,8 +19,8 @@ public class Result_UnsignedChannelAnnouncementDecodeErrorZ extends CommonBase { public final UnsignedChannelAnnouncement res; private Result_UnsignedChannelAnnouncementDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t res = bindings.LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(ptr); - UnsignedChannelAnnouncement res_hu_conv = new UnsignedChannelAnnouncement(null, res); + number res = bindings.LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(ptr); + const res_hu_conv: UnsignedChannelAnnouncement = new UnsignedChannelAnnouncement(null, res); this.res = res_hu_conv; } public Result_UnsignedChannelAnnouncementDecodeErrorZ_OK(UnsignedChannelAnnouncement res) { @@ -33,8 +33,8 @@ public class Result_UnsignedChannelAnnouncementDecodeErrorZ extends CommonBase { public final DecodeError err; private Result_UnsignedChannelAnnouncementDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t err = bindings.LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = new DecodeError(null, err); + number err = bindings.LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(ptr); + const err_hu_conv: DecodeError = new DecodeError(null, err); this.err = err_hu_conv; } public Result_UnsignedChannelAnnouncementDecodeErrorZ_Err(DecodeError err) { diff --git a/ts/structs/Result_UnsignedChannelUpdateDecodeErrorZ.ts b/ts/structs/Result_UnsignedChannelUpdateDecodeErrorZ.ts index b78d1841..ecbde1b6 100644 --- a/ts/structs/Result_UnsignedChannelUpdateDecodeErrorZ.ts +++ b/ts/structs/Result_UnsignedChannelUpdateDecodeErrorZ.ts @@ -19,8 +19,8 @@ public class Result_UnsignedChannelUpdateDecodeErrorZ extends CommonBase { public final UnsignedChannelUpdate res; private Result_UnsignedChannelUpdateDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t res = bindings.LDKCResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(ptr); - UnsignedChannelUpdate res_hu_conv = new UnsignedChannelUpdate(null, res); + number res = bindings.LDKCResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(ptr); + const res_hu_conv: UnsignedChannelUpdate = new UnsignedChannelUpdate(null, res); this.res = res_hu_conv; } public Result_UnsignedChannelUpdateDecodeErrorZ_OK(UnsignedChannelUpdate res) { @@ -33,8 +33,8 @@ public class Result_UnsignedChannelUpdateDecodeErrorZ extends CommonBase { public final DecodeError err; private Result_UnsignedChannelUpdateDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t err = bindings.LDKCResult_UnsignedChannelUpdateDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = new DecodeError(null, err); + number err = bindings.LDKCResult_UnsignedChannelUpdateDecodeErrorZ_get_err(ptr); + const err_hu_conv: DecodeError = new DecodeError(null, err); this.err = err_hu_conv; } public Result_UnsignedChannelUpdateDecodeErrorZ_Err(DecodeError err) { diff --git a/ts/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.ts b/ts/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.ts index 2178ea64..7c387223 100644 --- a/ts/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.ts +++ b/ts/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.ts @@ -19,8 +19,8 @@ public class Result_UnsignedNodeAnnouncementDecodeErrorZ extends CommonBase { public final UnsignedNodeAnnouncement res; private Result_UnsignedNodeAnnouncementDecodeErrorZ_OK(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t res = bindings.LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(ptr); - UnsignedNodeAnnouncement res_hu_conv = new UnsignedNodeAnnouncement(null, res); + number res = bindings.LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(ptr); + const res_hu_conv: UnsignedNodeAnnouncement = new UnsignedNodeAnnouncement(null, res); this.res = res_hu_conv; } public Result_UnsignedNodeAnnouncementDecodeErrorZ_OK(UnsignedNodeAnnouncement res) { @@ -33,8 +33,8 @@ public class Result_UnsignedNodeAnnouncementDecodeErrorZ extends CommonBase { public final DecodeError err; private Result_UnsignedNodeAnnouncementDecodeErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t err = bindings.LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(ptr); - DecodeError err_hu_conv = new DecodeError(null, err); + number err = bindings.LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(ptr); + const err_hu_conv: DecodeError = new DecodeError(null, err); this.err = err_hu_conv; } public Result_UnsignedNodeAnnouncementDecodeErrorZ_Err(DecodeError err) { diff --git a/ts/structs/Result_boolLightningErrorZ.ts b/ts/structs/Result_boolLightningErrorZ.ts index 11a9be72..ab9c881b 100644 --- a/ts/structs/Result_boolLightningErrorZ.ts +++ b/ts/structs/Result_boolLightningErrorZ.ts @@ -30,8 +30,8 @@ public class Result_boolLightningErrorZ extends CommonBase { public final LightningError err; private Result_boolLightningErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t err = bindings.LDKCResult_boolLightningErrorZ_get_err(ptr); - LightningError err_hu_conv = new LightningError(null, err); + number err = bindings.LDKCResult_boolLightningErrorZ_get_err(ptr); + const err_hu_conv: LightningError = new LightningError(null, err); this.err = err_hu_conv; } public Result_boolLightningErrorZ_Err(LightningError err) { diff --git a/ts/structs/Result_boolPeerHandleErrorZ.ts b/ts/structs/Result_boolPeerHandleErrorZ.ts index 6370c3ef..366ee35d 100644 --- a/ts/structs/Result_boolPeerHandleErrorZ.ts +++ b/ts/structs/Result_boolPeerHandleErrorZ.ts @@ -30,8 +30,8 @@ public class Result_boolPeerHandleErrorZ extends CommonBase { public final PeerHandleError err; private Result_boolPeerHandleErrorZ_Err(Object _dummy, long ptr) { super(_dummy, ptr); - uint32_t err = bindings.LDKCResult_boolPeerHandleErrorZ_get_err(ptr); - PeerHandleError err_hu_conv = new PeerHandleError(null, err); + number err = bindings.LDKCResult_boolPeerHandleErrorZ_get_err(ptr); + const err_hu_conv: PeerHandleError = new PeerHandleError(null, err); this.err = err_hu_conv; } public Result_boolPeerHandleErrorZ_Err(PeerHandleError err) { diff --git a/ts/structs/RevokeAndACK.ts b/ts/structs/RevokeAndACK.ts index d4d249e3..58808102 100644 --- a/ts/structs/RevokeAndACK.ts +++ b/ts/structs/RevokeAndACK.ts @@ -1,62 +1,70 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class RevokeAndACK extends CommonBase { - RevokeAndACK(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.RevokeAndACK_free(ptr); } - } + + export default class RevokeAndACK extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.RevokeAndACK_free(this.ptr); + } + } public RevokeAndACK clone() { - uint32_t ret = bindings.RevokeAndACK_clone(this.ptr); - RevokeAndACK ret_hu_conv = new RevokeAndACK(null, ret); + number ret = bindings.RevokeAndACK_clone(this.ptr); + const ret_hu_conv: RevokeAndACK = new RevokeAndACK(null, ret); return ret_hu_conv; } - public byte[] get_channel_id() { - byte[] ret = bindings.RevokeAndACK_get_channel_id(this.ptr); + public Uint8Array get_channel_id() { + Uint8Array ret = bindings.RevokeAndACK_get_channel_id(this.ptr); return ret; } - public void set_channel_id(byte[] val) { + public void set_channel_id(Uint8Array val) { bindings.RevokeAndACK_set_channel_id(this.ptr, val); } - public byte[] get_per_commitment_secret() { - byte[] ret = bindings.RevokeAndACK_get_per_commitment_secret(this.ptr); + public Uint8Array get_per_commitment_secret() { + Uint8Array ret = bindings.RevokeAndACK_get_per_commitment_secret(this.ptr); return ret; } - public void set_per_commitment_secret(byte[] val) { + public void set_per_commitment_secret(Uint8Array val) { bindings.RevokeAndACK_set_per_commitment_secret(this.ptr, val); } - public byte[] get_next_per_commitment_point() { - byte[] ret = bindings.RevokeAndACK_get_next_per_commitment_point(this.ptr); + public Uint8Array get_next_per_commitment_point() { + Uint8Array ret = bindings.RevokeAndACK_get_next_per_commitment_point(this.ptr); return ret; } - public void set_next_per_commitment_point(byte[] val) { + public void set_next_per_commitment_point(Uint8Array val) { bindings.RevokeAndACK_set_next_per_commitment_point(this.ptr, val); } - public static RevokeAndACK constructor_new(byte[] channel_id_arg, byte[] per_commitment_secret_arg, byte[] next_per_commitment_point_arg) { - uint32_t ret = bindings.RevokeAndACK_new(channel_id_arg, per_commitment_secret_arg, next_per_commitment_point_arg); - RevokeAndACK ret_hu_conv = new RevokeAndACK(null, ret); + public static RevokeAndACK constructor_new(Uint8Array channel_id_arg, Uint8Array per_commitment_secret_arg, Uint8Array next_per_commitment_point_arg) { + number ret = bindings.RevokeAndACK_new(channel_id_arg, per_commitment_secret_arg, next_per_commitment_point_arg); + const ret_hu_conv: RevokeAndACK = new RevokeAndACK(null, ret); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.RevokeAndACK_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.RevokeAndACK_write(this.ptr); return ret; } - public static RevokeAndACK constructor_read(byte[] ser) { - uint32_t ret = bindings.RevokeAndACK_read(ser); - RevokeAndACK ret_hu_conv = new RevokeAndACK(null, ret); + public static RevokeAndACK constructor_read(Uint8Array ser) { + number ret = bindings.RevokeAndACK_read(ser); + const ret_hu_conv: RevokeAndACK = new RevokeAndACK(null, ret); return ret_hu_conv; } diff --git a/ts/structs/Route.ts b/ts/structs/Route.ts index 83a9283f..d54afc71 100644 --- a/ts/structs/Route.ts +++ b/ts/structs/Route.ts @@ -1,40 +1,48 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class Route extends CommonBase { - Route(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.Route_free(ptr); } - } + + export default class Route extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.Route_free(this.ptr); + } + } public Route clone() { - uint32_t ret = bindings.Route_clone(this.ptr); - Route ret_hu_conv = new Route(null, ret); + number ret = bindings.Route_clone(this.ptr); + const ret_hu_conv: Route = new Route(null, ret); return ret_hu_conv; } public void set_paths(RouteHop[][] val) { - bindings.Route_set_paths(this.ptr, (uint32_t[][])Arrays.stream(val).map(arr_conv_12 -> (uint32_t[])Arrays.stream(arr_conv_12).map(arr_conv_10 -> arr_conv_10 == null ? 0 : arr_conv_10.ptr & ~1).toArray()).toArray()); + bindings.Route_set_paths(this.ptr, (number[][])Arrays.stream(val).map(arr_conv_12 -> (number[])Arrays.stream(arr_conv_12).map(arr_conv_10 -> arr_conv_10 == null ? 0 : arr_conv_10.ptr & ~1).toArray()).toArray()); /* TODO 2 RouteHop[] */; } public static Route constructor_new(RouteHop[][] paths_arg) { - uint32_t ret = bindings.Route_new((uint32_t[][])Arrays.stream(paths_arg).map(arr_conv_12 -> (uint32_t[])Arrays.stream(arr_conv_12).map(arr_conv_10 -> arr_conv_10 == null ? 0 : arr_conv_10.ptr & ~1).toArray()).toArray()); - Route ret_hu_conv = new Route(null, ret); + number ret = bindings.Route_new((number[][])Arrays.stream(paths_arg).map(arr_conv_12 -> (number[])Arrays.stream(arr_conv_12).map(arr_conv_10 -> arr_conv_10 == null ? 0 : arr_conv_10.ptr & ~1).toArray()).toArray()); + const ret_hu_conv: Route = new Route(null, ret); /* TODO 2 RouteHop[] */; return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.Route_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.Route_write(this.ptr); return ret; } - public static Result_RouteDecodeErrorZ constructor_read(byte[] ser) { - uint32_t ret = bindings.Route_read(ser); + public static Result_RouteDecodeErrorZ constructor_read(Uint8Array ser) { + number ret = bindings.Route_read(ser); Result_RouteDecodeErrorZ ret_hu_conv = Result_RouteDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/ts/structs/RouteHint.ts b/ts/structs/RouteHint.ts index c903ad99..35ff0051 100644 --- a/ts/structs/RouteHint.ts +++ b/ts/structs/RouteHint.ts @@ -1,42 +1,50 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class RouteHint extends CommonBase { - RouteHint(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.RouteHint_free(ptr); } - } + + export default class RouteHint extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.RouteHint_free(this.ptr); + } + } public RouteHint clone() { - uint32_t ret = bindings.RouteHint_clone(this.ptr); - RouteHint ret_hu_conv = new RouteHint(null, ret); + number ret = bindings.RouteHint_clone(this.ptr); + const ret_hu_conv: RouteHint = new RouteHint(null, ret); return ret_hu_conv; } - public byte[] get_src_node_id() { - byte[] ret = bindings.RouteHint_get_src_node_id(this.ptr); + public Uint8Array get_src_node_id() { + Uint8Array ret = bindings.RouteHint_get_src_node_id(this.ptr); return ret; } - public void set_src_node_id(byte[] val) { + public void set_src_node_id(Uint8Array val) { bindings.RouteHint_set_src_node_id(this.ptr, val); } - public long get_short_channel_id() { - long ret = bindings.RouteHint_get_short_channel_id(this.ptr); + public number get_short_channel_id() { + number ret = bindings.RouteHint_get_short_channel_id(this.ptr); return ret; } - public void set_short_channel_id(long val) { + public void set_short_channel_id(number val) { bindings.RouteHint_set_short_channel_id(this.ptr, val); } public RoutingFees get_fees() { - uint32_t ret = bindings.RouteHint_get_fees(this.ptr); - RoutingFees ret_hu_conv = new RoutingFees(null, ret); + number ret = bindings.RouteHint_get_fees(this.ptr); + const ret_hu_conv: RoutingFees = new RoutingFees(null, ret); return ret_hu_conv; } @@ -45,27 +53,27 @@ public class RouteHint extends CommonBase { this.ptrs_to.add(val); } - public short get_cltv_expiry_delta() { - short ret = bindings.RouteHint_get_cltv_expiry_delta(this.ptr); + public number get_cltv_expiry_delta() { + number ret = bindings.RouteHint_get_cltv_expiry_delta(this.ptr); return ret; } - public void set_cltv_expiry_delta(short val) { + public void set_cltv_expiry_delta(number val) { bindings.RouteHint_set_cltv_expiry_delta(this.ptr, val); } - public long get_htlc_minimum_msat() { - long ret = bindings.RouteHint_get_htlc_minimum_msat(this.ptr); + public number get_htlc_minimum_msat() { + number ret = bindings.RouteHint_get_htlc_minimum_msat(this.ptr); return ret; } - public void set_htlc_minimum_msat(long val) { + public void set_htlc_minimum_msat(number val) { bindings.RouteHint_set_htlc_minimum_msat(this.ptr, val); } - public static RouteHint constructor_new(byte[] src_node_id_arg, long short_channel_id_arg, RoutingFees fees_arg, short cltv_expiry_delta_arg, long htlc_minimum_msat_arg) { - uint32_t ret = bindings.RouteHint_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); - RouteHint ret_hu_conv = new RouteHint(null, ret); + public static RouteHint constructor_new(Uint8Array src_node_id_arg, number short_channel_id_arg, RoutingFees fees_arg, number cltv_expiry_delta_arg, number htlc_minimum_msat_arg) { + number ret = bindings.RouteHint_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); + const ret_hu_conv: RouteHint = new RouteHint(null, ret); ret_hu_conv.ptrs_to.add(fees_arg); return ret_hu_conv; } diff --git a/ts/structs/RouteHop.ts b/ts/structs/RouteHop.ts index abf06218..6a943251 100644 --- a/ts/structs/RouteHop.ts +++ b/ts/structs/RouteHop.ts @@ -1,33 +1,41 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class RouteHop extends CommonBase { - RouteHop(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.RouteHop_free(ptr); } - } + + export default class RouteHop extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.RouteHop_free(this.ptr); + } + } public RouteHop clone() { - uint32_t ret = bindings.RouteHop_clone(this.ptr); - RouteHop ret_hu_conv = new RouteHop(null, ret); + number ret = bindings.RouteHop_clone(this.ptr); + const ret_hu_conv: RouteHop = new RouteHop(null, ret); return ret_hu_conv; } - public byte[] get_pubkey() { - byte[] ret = bindings.RouteHop_get_pubkey(this.ptr); + public Uint8Array get_pubkey() { + Uint8Array ret = bindings.RouteHop_get_pubkey(this.ptr); return ret; } - public void set_pubkey(byte[] val) { + public void set_pubkey(Uint8Array val) { bindings.RouteHop_set_pubkey(this.ptr, val); } public NodeFeatures get_node_features() { - uint32_t ret = bindings.RouteHop_get_node_features(this.ptr); - NodeFeatures ret_hu_conv = new NodeFeatures(null, ret); + number ret = bindings.RouteHop_get_node_features(this.ptr); + const ret_hu_conv: NodeFeatures = new NodeFeatures(null, ret); return ret_hu_conv; } @@ -36,18 +44,18 @@ public class RouteHop extends CommonBase { this.ptrs_to.add(val); } - public long get_short_channel_id() { - long ret = bindings.RouteHop_get_short_channel_id(this.ptr); + public number get_short_channel_id() { + number ret = bindings.RouteHop_get_short_channel_id(this.ptr); return ret; } - public void set_short_channel_id(long val) { + public void set_short_channel_id(number val) { bindings.RouteHop_set_short_channel_id(this.ptr, val); } public ChannelFeatures get_channel_features() { - uint32_t ret = bindings.RouteHop_get_channel_features(this.ptr); - ChannelFeatures ret_hu_conv = new ChannelFeatures(null, ret); + number ret = bindings.RouteHop_get_channel_features(this.ptr); + const ret_hu_conv: ChannelFeatures = new ChannelFeatures(null, ret); return ret_hu_conv; } @@ -56,27 +64,27 @@ public class RouteHop extends CommonBase { this.ptrs_to.add(val); } - public long get_fee_msat() { - long ret = bindings.RouteHop_get_fee_msat(this.ptr); + public number get_fee_msat() { + number ret = bindings.RouteHop_get_fee_msat(this.ptr); return ret; } - public void set_fee_msat(long val) { + public void set_fee_msat(number val) { bindings.RouteHop_set_fee_msat(this.ptr, val); } - public int get_cltv_expiry_delta() { - int ret = bindings.RouteHop_get_cltv_expiry_delta(this.ptr); + public number get_cltv_expiry_delta() { + number ret = bindings.RouteHop_get_cltv_expiry_delta(this.ptr); return ret; } - public void set_cltv_expiry_delta(int val) { + public void set_cltv_expiry_delta(number val) { bindings.RouteHop_set_cltv_expiry_delta(this.ptr, val); } - public static RouteHop constructor_new(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) { - uint32_t 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); - RouteHop ret_hu_conv = new RouteHop(null, ret); + public static RouteHop constructor_new(Uint8Array pubkey_arg, NodeFeatures node_features_arg, number short_channel_id_arg, ChannelFeatures channel_features_arg, number fee_msat_arg, number cltv_expiry_delta_arg) { + number 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); + const ret_hu_conv: RouteHop = new RouteHop(null, ret); ret_hu_conv.ptrs_to.add(node_features_arg); ret_hu_conv.ptrs_to.add(channel_features_arg); return ret_hu_conv; diff --git a/ts/structs/RoutingFees.ts b/ts/structs/RoutingFees.ts index 5ba023ff..0a0a55cb 100644 --- a/ts/structs/RoutingFees.ts +++ b/ts/structs/RoutingFees.ts @@ -1,53 +1,61 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class RoutingFees extends CommonBase { - RoutingFees(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.RoutingFees_free(ptr); } - } + + export default class RoutingFees extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.RoutingFees_free(this.ptr); + } + } public RoutingFees clone() { - uint32_t ret = bindings.RoutingFees_clone(this.ptr); - RoutingFees ret_hu_conv = new RoutingFees(null, ret); + number ret = bindings.RoutingFees_clone(this.ptr); + const ret_hu_conv: RoutingFees = new RoutingFees(null, ret); return ret_hu_conv; } - public int get_base_msat() { - int ret = bindings.RoutingFees_get_base_msat(this.ptr); + public number get_base_msat() { + number ret = bindings.RoutingFees_get_base_msat(this.ptr); return ret; } - public void set_base_msat(int val) { + public void set_base_msat(number val) { bindings.RoutingFees_set_base_msat(this.ptr, val); } - public int get_proportional_millionths() { - int ret = bindings.RoutingFees_get_proportional_millionths(this.ptr); + public number get_proportional_millionths() { + number ret = bindings.RoutingFees_get_proportional_millionths(this.ptr); return ret; } - public void set_proportional_millionths(int val) { + public void set_proportional_millionths(number val) { bindings.RoutingFees_set_proportional_millionths(this.ptr, val); } - public static RoutingFees constructor_new(int base_msat_arg, int proportional_millionths_arg) { - uint32_t ret = bindings.RoutingFees_new(base_msat_arg, proportional_millionths_arg); - RoutingFees ret_hu_conv = new RoutingFees(null, ret); + public static RoutingFees constructor_new(number base_msat_arg, number proportional_millionths_arg) { + number ret = bindings.RoutingFees_new(base_msat_arg, proportional_millionths_arg); + const ret_hu_conv: RoutingFees = new RoutingFees(null, ret); return ret_hu_conv; } - public static Result_RoutingFeesDecodeErrorZ constructor_read(byte[] ser) { - uint32_t ret = bindings.RoutingFees_read(ser); + public static Result_RoutingFeesDecodeErrorZ constructor_read(Uint8Array ser) { + number ret = bindings.RoutingFees_read(ser); Result_RoutingFeesDecodeErrorZ ret_hu_conv = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.RoutingFees_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.RoutingFees_write(this.ptr); return ret; } diff --git a/ts/structs/RoutingMessageHandler.ts b/ts/structs/RoutingMessageHandler.ts index 12e7a3cf..f7fc16cf 100644 --- a/ts/structs/RoutingMessageHandler.ts +++ b/ts/structs/RoutingMessageHandler.ts @@ -1,19 +1,151 @@ + + +import CommonBase from './CommonBase'; +import * as bindings from '../bindings' // TODO: figure out location + + + + export class RoutingMessageHandler extends CommonBase { + + bindings_instance?: bindings.LDKRoutingMessageHandler; + + constructor(ptr?: number, arg?: bindings.LDKRoutingMessageHandler, messageSendEventsProvider?: bindings.LDKMessageSendEventsProvider) { + if (Number.isFinite(ptr)) { + super(ptr); + this.bindings_instance = null; + } else { + // TODO: private constructor instantiation + super(bindings.LDKRoutingMessageHandler_new(arg, messageSendEventsProvider)); + this.ptrs_to.push(arg); + this.ptrs_to.push(messageSendEventsProvider); + + } + } + + protected finalize() { + if (this.ptr != 0) { + bindings.RoutingMessageHandler_free(this.ptr); + } + super.finalize(); + } + + static new_impl(arg: RoutingMessageHandlerInterface, messageSendEventsProvider_impl: MessageSendEventsProvider.MessageSendEventsProviderInterface): RoutingMessageHandler { + const impl_holder: LDKRoutingMessageHandlerHolder = new LDKRoutingMessageHandlerHolder(); + let structImplementation = { + // todo: in-line interface filling + handle_node_announcement (msg: number): number { + const msg_hu_conv: NodeAnnouncement = new NodeAnnouncement(null, msg); + Result_boolLightningErrorZ ret = arg.handle_node_announcement(msg_hu_conv); + result: number = ret != null ? ret.ptr : 0; + return result; + }, + + handle_channel_announcement (msg: number): number { + const msg_hu_conv: ChannelAnnouncement = new ChannelAnnouncement(null, msg); + Result_boolLightningErrorZ ret = arg.handle_channel_announcement(msg_hu_conv); + result: number = ret != null ? ret.ptr : 0; + return result; + }, + + handle_channel_update (msg: number): number { + const msg_hu_conv: ChannelUpdate = new ChannelUpdate(null, msg); + Result_boolLightningErrorZ ret = arg.handle_channel_update(msg_hu_conv); + result: number = ret != null ? ret.ptr : 0; + return result; + }, + + handle_htlc_fail_channel_update (update: number): void { + HTLCFailChannelUpdate update_hu_conv = HTLCFailChannelUpdate.constr_from_ptr(update); + arg.handle_htlc_fail_channel_update(update_hu_conv); + }, + + get_next_channel_announcements (starting_point: number, batch_amount: number): number[] { + ThreeTuple[] ret = arg.get_next_channel_announcements(starting_point, batch_amount); + result: number[] = (number[])Arrays.stream(ret).map(arr_conv_63 -> bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(arr_conv_63.a == null ? 0 : arr_conv_63.a.ptr & ~1/*XXX: this.ptrs_to.add(arr_conv_63_a)*/, arr_conv_63.b == null ? 0 : arr_conv_63.b.ptr & ~1/*XXX: this.ptrs_to.add(arr_conv_63_b)*/, arr_conv_63.c == null ? 0 : arr_conv_63.c.ptr & ~1/*XXX: this.ptrs_to.add(arr_conv_63_c)*/)).toArray(); + /* TODO 2 ThreeTuple */; + 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[] = (number[])Arrays.stream(ret).map(arr_conv_18 -> arr_conv_18 == null ? 0 : arr_conv_18.ptr & ~1).toArray(); + /* TODO 2 NodeAnnouncement */; + return result; + }, + + sync_routing_table (their_node_id: Uint8Array, init: number): void { + const init_hu_conv: Init = new Init(null, init); + arg.sync_routing_table(their_node_id, init_hu_conv); + }, + + handle_reply_channel_range (their_node_id: Uint8Array, msg: number): number { + const msg_hu_conv: ReplyChannelRange = new ReplyChannelRange(null, msg); + Result_NoneLightningErrorZ ret = arg.handle_reply_channel_range(their_node_id, msg_hu_conv); + result: number = ret != null ? ret.ptr : 0; + return result; + }, + + handle_reply_short_channel_ids_end (their_node_id: Uint8Array, msg: number): number { + const msg_hu_conv: ReplyShortChannelIdsEnd = new ReplyShortChannelIdsEnd(null, msg); + Result_NoneLightningErrorZ ret = arg.handle_reply_short_channel_ids_end(their_node_id, msg_hu_conv); + result: number = ret != null ? ret.ptr : 0; + return result; + }, + + handle_query_channel_range (their_node_id: Uint8Array, msg: number): number { + const msg_hu_conv: QueryChannelRange = new QueryChannelRange(null, msg); + Result_NoneLightningErrorZ ret = arg.handle_query_channel_range(their_node_id, msg_hu_conv); + result: number = ret != null ? ret.ptr : 0; + return result; + }, + + handle_query_short_channel_ids (their_node_id: Uint8Array, msg: number): number { + const msg_hu_conv: QueryShortChannelIds = new QueryShortChannelIds(null, msg); + Result_NoneLightningErrorZ ret = arg.handle_query_short_channel_ids(their_node_id, msg_hu_conv); + result: number = ret != null ? ret.ptr : 0; + return result; + }, + + + }; + impl_holder.held = new RoutingMessageHandler (null, structImplementation, MessageSendEventsProvider.new_impl(MessageSendEventsProvider_impl).bindings_instance); + } + } + + export interface RoutingMessageHandlerInterface { + handle_node_announcement(msg: NodeAnnouncement): Result_boolLightningErrorZ; + handle_channel_announcement(msg: ChannelAnnouncement): Result_boolLightningErrorZ; + handle_channel_update(msg: ChannelUpdate): Result_boolLightningErrorZ; + handle_htlc_fail_channel_update(update: HTLCFailChannelUpdate): void; + get_next_channel_announcements(starting_point: number, batch_amount: number): ThreeTuple[]; + get_next_node_announcements(starting_point: Uint8Array, batch_amount: number): NodeAnnouncement[]; + sync_routing_table(their_node_id: Uint8Array, init: Init): void; + handle_reply_channel_range(their_node_id: Uint8Array, msg: ReplyChannelRange): Result_NoneLightningErrorZ; + handle_reply_short_channel_ids_end(their_node_id: Uint8Array, msg: ReplyShortChannelIdsEnd): Result_NoneLightningErrorZ; + handle_query_channel_range(their_node_id: Uint8Array, msg: QueryChannelRange): Result_NoneLightningErrorZ; + handle_query_short_channel_ids(their_node_id: Uint8Array, msg: QueryShortChannelIds): Result_NoneLightningErrorZ; + + } + + class LDKRoutingMessageHandlerHolder { + held: RoutingMessageHandler; + } public Result_boolLightningErrorZ handle_node_announcement(NodeAnnouncement msg) { - uint32_t ret = bindings.RoutingMessageHandler_handle_node_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1); + number ret = bindings.RoutingMessageHandler_handle_node_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1); Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret); this.ptrs_to.add(msg); return ret_hu_conv; } public Result_boolLightningErrorZ handle_channel_announcement(ChannelAnnouncement msg) { - uint32_t ret = bindings.RoutingMessageHandler_handle_channel_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1); + number ret = bindings.RoutingMessageHandler_handle_channel_announcement(this.ptr, msg == null ? 0 : msg.ptr & ~1); Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret); this.ptrs_to.add(msg); return ret_hu_conv; } public Result_boolLightningErrorZ handle_channel_update(ChannelUpdate msg) { - uint32_t ret = bindings.RoutingMessageHandler_handle_channel_update(this.ptr, msg == null ? 0 : msg.ptr & ~1); + number ret = bindings.RoutingMessageHandler_handle_channel_update(this.ptr, msg == null ? 0 : msg.ptr & ~1); Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret); this.ptrs_to.add(msg); return ret_hu_conv; @@ -24,62 +156,62 @@ this.ptrs_to.add(update); } - public ThreeTuple[] get_next_channel_announcements(long starting_point, byte batch_amount) { - uint32_t[] ret = bindings.RoutingMessageHandler_get_next_channel_announcements(this.ptr, starting_point, batch_amount); + public ThreeTuple[] get_next_channel_announcements(number starting_point, number batch_amount) { + number[] ret = bindings.RoutingMessageHandler_get_next_channel_announcements(this.ptr, starting_point, batch_amount); ThreeTuple[] arr_conv_63_arr = new ThreeTuple[ret.length]; for (int l = 0; l < ret.length; l++) { - uint32_t arr_conv_63 = ret[l]; - uint32_t arr_conv_63_a = bindings.LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(arr_conv_63); - ChannelAnnouncement arr_conv_63_a_hu_conv = new ChannelAnnouncement(null, arr_conv_63_a);; - uint32_t arr_conv_63_b = bindings.LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(arr_conv_63); - ChannelUpdate arr_conv_63_b_hu_conv = new ChannelUpdate(null, arr_conv_63_b);; - uint32_t arr_conv_63_c = bindings.LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(arr_conv_63); - ChannelUpdate arr_conv_63_c_hu_conv = new ChannelUpdate(null, arr_conv_63_c);; + number arr_conv_63 = ret[l]; + number arr_conv_63_a = bindings.LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(arr_conv_63); + const arr_conv_63_a_hu_conv: ChannelAnnouncement = new ChannelAnnouncement(null, arr_conv_63_a);; + number arr_conv_63_b = bindings.LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(arr_conv_63); + const arr_conv_63_b_hu_conv: ChannelUpdate = new ChannelUpdate(null, arr_conv_63_b);; + number arr_conv_63_c = bindings.LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(arr_conv_63); + const arr_conv_63_c_hu_conv: ChannelUpdate = new ChannelUpdate(null, arr_conv_63_c);; ThreeTuple arr_conv_63_conv = new ThreeTuple(arr_conv_63_a_hu_conv, arr_conv_63_b_hu_conv, arr_conv_63_c_hu_conv); arr_conv_63_arr[l] = arr_conv_63_conv; } return arr_conv_63_arr; } - public NodeAnnouncement[] get_next_node_announcements(byte[] starting_point, byte batch_amount) { - uint32_t[] ret = bindings.RoutingMessageHandler_get_next_node_announcements(this.ptr, starting_point, batch_amount); + public NodeAnnouncement[] get_next_node_announcements(Uint8Array starting_point, number batch_amount) { + number[] ret = bindings.RoutingMessageHandler_get_next_node_announcements(this.ptr, starting_point, batch_amount); NodeAnnouncement[] arr_conv_18_arr = new NodeAnnouncement[ret.length]; for (int s = 0; s < ret.length; s++) { - uint32_t arr_conv_18 = ret[s]; - NodeAnnouncement arr_conv_18_hu_conv = new NodeAnnouncement(null, arr_conv_18); + number arr_conv_18 = ret[s]; + const arr_conv_18_hu_conv: NodeAnnouncement = new NodeAnnouncement(null, arr_conv_18); arr_conv_18_arr[s] = arr_conv_18_hu_conv; } return arr_conv_18_arr; } - public void sync_routing_table(byte[] their_node_id, Init init) { + public void sync_routing_table(Uint8Array their_node_id, Init init) { bindings.RoutingMessageHandler_sync_routing_table(this.ptr, their_node_id, init == null ? 0 : init.ptr & ~1); this.ptrs_to.add(init); } - public Result_NoneLightningErrorZ handle_reply_channel_range(byte[] their_node_id, ReplyChannelRange msg) { - uint32_t ret = bindings.RoutingMessageHandler_handle_reply_channel_range(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + public Result_NoneLightningErrorZ handle_reply_channel_range(Uint8Array their_node_id, ReplyChannelRange msg) { + number ret = bindings.RoutingMessageHandler_handle_reply_channel_range(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); this.ptrs_to.add(msg); return ret_hu_conv; } - public Result_NoneLightningErrorZ handle_reply_short_channel_ids_end(byte[] their_node_id, ReplyShortChannelIdsEnd msg) { - uint32_t ret = bindings.RoutingMessageHandler_handle_reply_short_channel_ids_end(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + public Result_NoneLightningErrorZ handle_reply_short_channel_ids_end(Uint8Array their_node_id, ReplyShortChannelIdsEnd msg) { + number ret = bindings.RoutingMessageHandler_handle_reply_short_channel_ids_end(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); this.ptrs_to.add(msg); return ret_hu_conv; } - public Result_NoneLightningErrorZ handle_query_channel_range(byte[] their_node_id, QueryChannelRange msg) { - uint32_t ret = bindings.RoutingMessageHandler_handle_query_channel_range(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + public Result_NoneLightningErrorZ handle_query_channel_range(Uint8Array their_node_id, QueryChannelRange msg) { + number ret = bindings.RoutingMessageHandler_handle_query_channel_range(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); this.ptrs_to.add(msg); return ret_hu_conv; } - public Result_NoneLightningErrorZ handle_query_short_channel_ids(byte[] their_node_id, QueryShortChannelIds msg) { - uint32_t ret = bindings.RoutingMessageHandler_handle_query_short_channel_ids(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); + public Result_NoneLightningErrorZ handle_query_short_channel_ids(Uint8Array their_node_id, QueryShortChannelIds msg) { + number ret = bindings.RoutingMessageHandler_handle_query_short_channel_ids(this.ptr, their_node_id, msg == null ? 0 : msg.ptr & ~1); Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); this.ptrs_to.add(msg); return ret_hu_conv; diff --git a/ts/structs/Shutdown.ts b/ts/structs/Shutdown.ts index fa719196..683f9025 100644 --- a/ts/structs/Shutdown.ts +++ b/ts/structs/Shutdown.ts @@ -1,53 +1,61 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class Shutdown extends CommonBase { - Shutdown(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.Shutdown_free(ptr); } - } + + export default class Shutdown extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.Shutdown_free(this.ptr); + } + } public Shutdown clone() { - uint32_t ret = bindings.Shutdown_clone(this.ptr); - Shutdown ret_hu_conv = new Shutdown(null, ret); + number ret = bindings.Shutdown_clone(this.ptr); + const ret_hu_conv: Shutdown = new Shutdown(null, ret); return ret_hu_conv; } - public byte[] get_channel_id() { - byte[] ret = bindings.Shutdown_get_channel_id(this.ptr); + public Uint8Array get_channel_id() { + Uint8Array ret = bindings.Shutdown_get_channel_id(this.ptr); return ret; } - public void set_channel_id(byte[] val) { + public void set_channel_id(Uint8Array val) { bindings.Shutdown_set_channel_id(this.ptr, val); } - public byte[] get_scriptpubkey() { - byte[] ret = bindings.Shutdown_get_scriptpubkey(this.ptr); + public Uint8Array get_scriptpubkey() { + Uint8Array ret = bindings.Shutdown_get_scriptpubkey(this.ptr); return ret; } - public void set_scriptpubkey(byte[] val) { + public void set_scriptpubkey(Uint8Array val) { bindings.Shutdown_set_scriptpubkey(this.ptr, val); } - public static Shutdown constructor_new(byte[] channel_id_arg, byte[] scriptpubkey_arg) { - uint32_t ret = bindings.Shutdown_new(channel_id_arg, scriptpubkey_arg); - Shutdown ret_hu_conv = new Shutdown(null, ret); + public static Shutdown constructor_new(Uint8Array channel_id_arg, Uint8Array scriptpubkey_arg) { + number ret = bindings.Shutdown_new(channel_id_arg, scriptpubkey_arg); + const ret_hu_conv: Shutdown = new Shutdown(null, ret); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.Shutdown_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.Shutdown_write(this.ptr); return ret; } - public static Shutdown constructor_read(byte[] ser) { - uint32_t ret = bindings.Shutdown_read(ser); - Shutdown ret_hu_conv = new Shutdown(null, ret); + public static Shutdown constructor_read(Uint8Array ser) { + number ret = bindings.Shutdown_read(ser); + const ret_hu_conv: Shutdown = new Shutdown(null, ret); return ret_hu_conv; } diff --git a/ts/structs/SocketDescriptor.ts b/ts/structs/SocketDescriptor.ts index cb5a21ed..a2207ae7 100644 --- a/ts/structs/SocketDescriptor.ts +++ b/ts/structs/SocketDescriptor.ts @@ -1,5 +1,77 @@ - public long send_data(byte[] data, boolean resume_read) { - long ret = bindings.SocketDescriptor_send_data(this.ptr, data, resume_read); + + +import CommonBase from './CommonBase'; +import * as bindings from '../bindings' // TODO: figure out location + + + + export class SocketDescriptor extends CommonBase { + + bindings_instance?: bindings.LDKSocketDescriptor; + + constructor(ptr?: number, arg?: bindings.LDKSocketDescriptor) { + if (Number.isFinite(ptr)) { + super(ptr); + this.bindings_instance = null; + } else { + // TODO: private constructor instantiation + super(bindings.LDKSocketDescriptor_new(arg)); + this.ptrs_to.push(arg); + + } + } + + protected finalize() { + if (this.ptr != 0) { + bindings.SocketDescriptor_free(this.ptr); + } + super.finalize(); + } + + static new_impl(arg: SocketDescriptorInterface): SocketDescriptor { + const impl_holder: LDKSocketDescriptorHolder = new LDKSocketDescriptorHolder(); + let structImplementation = { + // todo: in-line interface filling + send_data (data: Uint8Array, resume_read: boolean): number { + number ret = arg.send_data(data, resume_read); + return ret; + }, + + disconnect_socket (): void { + arg.disconnect_socket(); + }, + + eq (other_arg: number): boolean { + SocketDescriptor ret_hu_conv = new SocketDescriptor(null, other_arg); + ret_hu_conv.ptrs_to.add(this); + boolean ret = arg.eq(ret_hu_conv); + return ret; + }, + + hash (): number { + number ret = arg.hash(); + return ret; + }, + + + }; + impl_holder.held = new SocketDescriptor (null, structImplementation); + } + } + + export interface SocketDescriptorInterface { + send_data(data: Uint8Array, resume_read: boolean): number; + disconnect_socket(): void; + eq(other_arg: SocketDescriptor): boolean; + hash(): number; + + } + + class LDKSocketDescriptorHolder { + held: SocketDescriptor; + } + public number send_data(Uint8Array data, boolean resume_read) { + number ret = bindings.SocketDescriptor_send_data(this.ptr, data, resume_read); return ret; } @@ -7,13 +79,13 @@ bindings.SocketDescriptor_disconnect_socket(this.ptr); } - public long hash() { - long ret = bindings.SocketDescriptor_hash(this.ptr); + public number hash() { + number ret = bindings.SocketDescriptor_hash(this.ptr); return ret; } public SocketDescriptor clone() { - uint32_t ret = bindings.SocketDescriptor_clone(this.ptr); + number ret = bindings.SocketDescriptor_clone(this.ptr); SocketDescriptor ret_hu_conv = new SocketDescriptor(null, ret); ret_hu_conv.ptrs_to.add(this); return ret_hu_conv; diff --git a/ts/structs/SpendableOutputDescriptor.ts b/ts/structs/SpendableOutputDescriptor.ts index e1edf64f..3746a1ab 100644 --- a/ts/structs/SpendableOutputDescriptor.ts +++ b/ts/structs/SpendableOutputDescriptor.ts @@ -28,35 +28,35 @@ export class StaticOutput extends SpendableOutputDescriptor { public output: TxOut; private constructor(ptr: number, obj: bindings.LDKSpendableOutputDescriptor.StaticOutput) { super(null, ptr); - const outpoint: uint32_t = obj.outpoint; - OutPoint outpoint_hu_conv = new OutPoint(null, outpoint); + const outpoint: number = obj.outpoint; + const outpoint_hu_conv: OutPoint = new OutPoint(null, outpoint); this.outpoint = outpoint_hu_conv; - const output: uint32_t = obj.output; + const output: number = obj.output; TxOut output_conv = new TxOut(null, output); this.output = output_conv; } } export class DynamicOutputP2WSH extends SpendableOutputDescriptor { public outpoint: OutPoint; - public per_commitment_point: byte[]; - public to_self_delay: short; + public per_commitment_point: Uint8Array; + public to_self_delay: number; public output: TxOut; - public key_derivation_params: TwoTuple; - public revocation_pubkey: byte[]; + public key_derivation_params: TwoTuple; + public revocation_pubkey: Uint8Array; private constructor(ptr: number, obj: bindings.LDKSpendableOutputDescriptor.DynamicOutputP2WSH) { super(null, ptr); - const outpoint: uint32_t = obj.outpoint; - OutPoint outpoint_hu_conv = new OutPoint(null, outpoint); + const outpoint: number = obj.outpoint; + const outpoint_hu_conv: OutPoint = new OutPoint(null, outpoint); this.outpoint = outpoint_hu_conv; this.per_commitment_point = obj.per_commitment_point; this.to_self_delay = obj.to_self_delay; - const output: uint32_t = obj.output; + const output: number = obj.output; TxOut output_conv = new TxOut(null, output); this.output = output_conv; - const key_derivation_params: uint32_t = obj.key_derivation_params; - long key_derivation_params_a = bindings.LDKC2Tuple_u64u64Z_get_a(key_derivation_params); - long key_derivation_params_b = bindings.LDKC2Tuple_u64u64Z_get_b(key_derivation_params); - TwoTuple key_derivation_params_conv = new TwoTuple(key_derivation_params_a, key_derivation_params_b); + const key_derivation_params: number = obj.key_derivation_params; + number key_derivation_params_a = bindings.LDKC2Tuple_u64u64Z_get_a(key_derivation_params); + number key_derivation_params_b = bindings.LDKC2Tuple_u64u64Z_get_b(key_derivation_params); + TwoTuple key_derivation_params_conv = new TwoTuple(key_derivation_params_a, key_derivation_params_b); this.key_derivation_params = key_derivation_params_conv; this.revocation_pubkey = obj.revocation_pubkey; } @@ -64,19 +64,19 @@ export class DynamicOutputP2WSH extends SpendableOutputDescriptor { export class StaticOutputCounterpartyPayment extends SpendableOutputDescriptor { public outpoint: OutPoint; public output: TxOut; - public key_derivation_params: TwoTuple; + public key_derivation_params: TwoTuple; private constructor(ptr: number, obj: bindings.LDKSpendableOutputDescriptor.StaticOutputCounterpartyPayment) { super(null, ptr); - const outpoint: uint32_t = obj.outpoint; - OutPoint outpoint_hu_conv = new OutPoint(null, outpoint); + const outpoint: number = obj.outpoint; + const outpoint_hu_conv: OutPoint = new OutPoint(null, outpoint); this.outpoint = outpoint_hu_conv; - const output: uint32_t = obj.output; + const output: number = obj.output; TxOut output_conv = new TxOut(null, output); this.output = output_conv; - const key_derivation_params: uint32_t = obj.key_derivation_params; - long key_derivation_params_a = bindings.LDKC2Tuple_u64u64Z_get_a(key_derivation_params); - long key_derivation_params_b = bindings.LDKC2Tuple_u64u64Z_get_b(key_derivation_params); - TwoTuple key_derivation_params_conv = new TwoTuple(key_derivation_params_a, key_derivation_params_b); + const key_derivation_params: number = obj.key_derivation_params; + number key_derivation_params_a = bindings.LDKC2Tuple_u64u64Z_get_a(key_derivation_params); + number key_derivation_params_b = bindings.LDKC2Tuple_u64u64Z_get_b(key_derivation_params); + TwoTuple key_derivation_params_conv = new TwoTuple(key_derivation_params_a, key_derivation_params_b); this.key_derivation_params = key_derivation_params_conv; } } diff --git a/ts/structs/TrustedCommitmentTransaction.ts b/ts/structs/TrustedCommitmentTransaction.ts index 1d0fc4ae..b40e528e 100644 --- a/ts/structs/TrustedCommitmentTransaction.ts +++ b/ts/structs/TrustedCommitmentTransaction.ts @@ -1,34 +1,42 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class TrustedCommitmentTransaction extends CommonBase { - TrustedCommitmentTransaction(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.TrustedCommitmentTransaction_free(ptr); } - } - public byte[] txid() { - byte[] ret = bindings.TrustedCommitmentTransaction_txid(this.ptr); + + export default class TrustedCommitmentTransaction extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.TrustedCommitmentTransaction_free(this.ptr); + } + } + public Uint8Array txid() { + Uint8Array ret = bindings.TrustedCommitmentTransaction_txid(this.ptr); return ret; } public BuiltCommitmentTransaction built_transaction() { - uint32_t ret = bindings.TrustedCommitmentTransaction_built_transaction(this.ptr); - BuiltCommitmentTransaction ret_hu_conv = new BuiltCommitmentTransaction(null, ret); + number ret = bindings.TrustedCommitmentTransaction_built_transaction(this.ptr); + const ret_hu_conv: BuiltCommitmentTransaction = new BuiltCommitmentTransaction(null, ret); return ret_hu_conv; } public TxCreationKeys keys() { - uint32_t ret = bindings.TrustedCommitmentTransaction_keys(this.ptr); - TxCreationKeys ret_hu_conv = new TxCreationKeys(null, ret); + number ret = bindings.TrustedCommitmentTransaction_keys(this.ptr); + const ret_hu_conv: TxCreationKeys = new TxCreationKeys(null, ret); return ret_hu_conv; } - public Result_CVec_SignatureZNoneZ get_htlc_sigs(byte[] htlc_base_key, DirectedChannelTransactionParameters channel_parameters) { - uint32_t ret = bindings.TrustedCommitmentTransaction_get_htlc_sigs(this.ptr, htlc_base_key, channel_parameters == null ? 0 : channel_parameters.ptr & ~1); + public Result_CVec_SignatureZNoneZ get_htlc_sigs(Uint8Array htlc_base_key, DirectedChannelTransactionParameters channel_parameters) { + number ret = bindings.TrustedCommitmentTransaction_get_htlc_sigs(this.ptr, htlc_base_key, channel_parameters == null ? 0 : channel_parameters.ptr & ~1); Result_CVec_SignatureZNoneZ ret_hu_conv = Result_CVec_SignatureZNoneZ.constr_from_ptr(ret); this.ptrs_to.add(channel_parameters); return ret_hu_conv; diff --git a/ts/structs/TxCreationKeys.ts b/ts/structs/TxCreationKeys.ts index 7cd43a56..83aeb588 100644 --- a/ts/structs/TxCreationKeys.ts +++ b/ts/structs/TxCreationKeys.ts @@ -1,91 +1,99 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class TxCreationKeys extends CommonBase { - TxCreationKeys(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.TxCreationKeys_free(ptr); } - } + + export default class TxCreationKeys extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.TxCreationKeys_free(this.ptr); + } + } public TxCreationKeys clone() { - uint32_t ret = bindings.TxCreationKeys_clone(this.ptr); - TxCreationKeys ret_hu_conv = new TxCreationKeys(null, ret); + number ret = bindings.TxCreationKeys_clone(this.ptr); + const ret_hu_conv: TxCreationKeys = new TxCreationKeys(null, ret); return ret_hu_conv; } - public byte[] get_per_commitment_point() { - byte[] ret = bindings.TxCreationKeys_get_per_commitment_point(this.ptr); + public Uint8Array get_per_commitment_point() { + Uint8Array ret = bindings.TxCreationKeys_get_per_commitment_point(this.ptr); return ret; } - public void set_per_commitment_point(byte[] val) { + public void set_per_commitment_point(Uint8Array val) { bindings.TxCreationKeys_set_per_commitment_point(this.ptr, val); } - public byte[] get_revocation_key() { - byte[] ret = bindings.TxCreationKeys_get_revocation_key(this.ptr); + public Uint8Array get_revocation_key() { + Uint8Array ret = bindings.TxCreationKeys_get_revocation_key(this.ptr); return ret; } - public void set_revocation_key(byte[] val) { + public void set_revocation_key(Uint8Array val) { bindings.TxCreationKeys_set_revocation_key(this.ptr, val); } - public byte[] get_broadcaster_htlc_key() { - byte[] ret = bindings.TxCreationKeys_get_broadcaster_htlc_key(this.ptr); + public Uint8Array get_broadcaster_htlc_key() { + Uint8Array ret = bindings.TxCreationKeys_get_broadcaster_htlc_key(this.ptr); return ret; } - public void set_broadcaster_htlc_key(byte[] val) { + public void set_broadcaster_htlc_key(Uint8Array val) { bindings.TxCreationKeys_set_broadcaster_htlc_key(this.ptr, val); } - public byte[] get_countersignatory_htlc_key() { - byte[] ret = bindings.TxCreationKeys_get_countersignatory_htlc_key(this.ptr); + public Uint8Array get_countersignatory_htlc_key() { + Uint8Array ret = bindings.TxCreationKeys_get_countersignatory_htlc_key(this.ptr); return ret; } - public void set_countersignatory_htlc_key(byte[] val) { + public void set_countersignatory_htlc_key(Uint8Array val) { bindings.TxCreationKeys_set_countersignatory_htlc_key(this.ptr, val); } - public byte[] get_broadcaster_delayed_payment_key() { - byte[] ret = bindings.TxCreationKeys_get_broadcaster_delayed_payment_key(this.ptr); + public Uint8Array get_broadcaster_delayed_payment_key() { + Uint8Array ret = bindings.TxCreationKeys_get_broadcaster_delayed_payment_key(this.ptr); return ret; } - public void set_broadcaster_delayed_payment_key(byte[] val) { + public void set_broadcaster_delayed_payment_key(Uint8Array val) { bindings.TxCreationKeys_set_broadcaster_delayed_payment_key(this.ptr, val); } - public static TxCreationKeys constructor_new(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) { - uint32_t ret = bindings.TxCreationKeys_new(per_commitment_point_arg, revocation_key_arg, broadcaster_htlc_key_arg, countersignatory_htlc_key_arg, broadcaster_delayed_payment_key_arg); - TxCreationKeys ret_hu_conv = new TxCreationKeys(null, ret); + public static TxCreationKeys constructor_new(Uint8Array per_commitment_point_arg, Uint8Array revocation_key_arg, Uint8Array broadcaster_htlc_key_arg, Uint8Array countersignatory_htlc_key_arg, Uint8Array broadcaster_delayed_payment_key_arg) { + number ret = bindings.TxCreationKeys_new(per_commitment_point_arg, revocation_key_arg, broadcaster_htlc_key_arg, countersignatory_htlc_key_arg, broadcaster_delayed_payment_key_arg); + const ret_hu_conv: TxCreationKeys = new TxCreationKeys(null, ret); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.TxCreationKeys_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.TxCreationKeys_write(this.ptr); return ret; } - public static TxCreationKeys constructor_read(byte[] ser) { - uint32_t ret = bindings.TxCreationKeys_read(ser); - TxCreationKeys ret_hu_conv = new TxCreationKeys(null, ret); + public static TxCreationKeys constructor_read(Uint8Array ser) { + number ret = bindings.TxCreationKeys_read(ser); + const ret_hu_conv: TxCreationKeys = new TxCreationKeys(null, ret); return ret_hu_conv; } - public static Result_TxCreationKeysSecpErrorZ constructor_derive_new(byte[] per_commitment_point, byte[] broadcaster_delayed_payment_base, byte[] broadcaster_htlc_base, byte[] countersignatory_revocation_base, byte[] countersignatory_htlc_base) { - uint32_t ret = bindings.TxCreationKeys_derive_new(per_commitment_point, broadcaster_delayed_payment_base, broadcaster_htlc_base, countersignatory_revocation_base, countersignatory_htlc_base); + public static Result_TxCreationKeysSecpErrorZ constructor_derive_new(Uint8Array per_commitment_point, Uint8Array broadcaster_delayed_payment_base, Uint8Array broadcaster_htlc_base, Uint8Array countersignatory_revocation_base, Uint8Array countersignatory_htlc_base) { + number ret = bindings.TxCreationKeys_derive_new(per_commitment_point, broadcaster_delayed_payment_base, broadcaster_htlc_base, countersignatory_revocation_base, countersignatory_htlc_base); Result_TxCreationKeysSecpErrorZ ret_hu_conv = Result_TxCreationKeysSecpErrorZ.constr_from_ptr(ret); return ret_hu_conv; } - public static Result_TxCreationKeysSecpErrorZ constructor_from_channel_static_keys(byte[] per_commitment_point, ChannelPublicKeys broadcaster_keys, ChannelPublicKeys countersignatory_keys) { - uint32_t 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); + public static Result_TxCreationKeysSecpErrorZ constructor_from_channel_static_keys(Uint8Array per_commitment_point, ChannelPublicKeys broadcaster_keys, ChannelPublicKeys countersignatory_keys) { + number 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); Result_TxCreationKeysSecpErrorZ ret_hu_conv = Result_TxCreationKeysSecpErrorZ.constr_from_ptr(ret); ret_hu_conv.ptrs_to.add(broadcaster_keys); ret_hu_conv.ptrs_to.add(countersignatory_keys); diff --git a/ts/structs/UnsignedChannelAnnouncement.ts b/ts/structs/UnsignedChannelAnnouncement.ts index db9d7ae1..af033836 100644 --- a/ts/structs/UnsignedChannelAnnouncement.ts +++ b/ts/structs/UnsignedChannelAnnouncement.ts @@ -1,24 +1,32 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class UnsignedChannelAnnouncement extends CommonBase { - UnsignedChannelAnnouncement(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.UnsignedChannelAnnouncement_free(ptr); } - } + + export default class UnsignedChannelAnnouncement extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.UnsignedChannelAnnouncement_free(this.ptr); + } + } public UnsignedChannelAnnouncement clone() { - uint32_t ret = bindings.UnsignedChannelAnnouncement_clone(this.ptr); - UnsignedChannelAnnouncement ret_hu_conv = new UnsignedChannelAnnouncement(null, ret); + number ret = bindings.UnsignedChannelAnnouncement_clone(this.ptr); + const ret_hu_conv: UnsignedChannelAnnouncement = new UnsignedChannelAnnouncement(null, ret); return ret_hu_conv; } public ChannelFeatures get_features() { - uint32_t ret = bindings.UnsignedChannelAnnouncement_get_features(this.ptr); - ChannelFeatures ret_hu_conv = new ChannelFeatures(null, ret); + number ret = bindings.UnsignedChannelAnnouncement_get_features(this.ptr); + const ret_hu_conv: ChannelFeatures = new ChannelFeatures(null, ret); return ret_hu_conv; } @@ -27,67 +35,67 @@ public class UnsignedChannelAnnouncement extends CommonBase { this.ptrs_to.add(val); } - public byte[] get_chain_hash() { - byte[] ret = bindings.UnsignedChannelAnnouncement_get_chain_hash(this.ptr); + public Uint8Array get_chain_hash() { + Uint8Array ret = bindings.UnsignedChannelAnnouncement_get_chain_hash(this.ptr); return ret; } - public void set_chain_hash(byte[] val) { + public void set_chain_hash(Uint8Array val) { bindings.UnsignedChannelAnnouncement_set_chain_hash(this.ptr, val); } - public long get_short_channel_id() { - long ret = bindings.UnsignedChannelAnnouncement_get_short_channel_id(this.ptr); + public number get_short_channel_id() { + number ret = bindings.UnsignedChannelAnnouncement_get_short_channel_id(this.ptr); return ret; } - public void set_short_channel_id(long val) { + public void set_short_channel_id(number val) { bindings.UnsignedChannelAnnouncement_set_short_channel_id(this.ptr, val); } - public byte[] get_node_id_1() { - byte[] ret = bindings.UnsignedChannelAnnouncement_get_node_id_1(this.ptr); + public Uint8Array get_node_id_1() { + Uint8Array ret = bindings.UnsignedChannelAnnouncement_get_node_id_1(this.ptr); return ret; } - public void set_node_id_1(byte[] val) { + public void set_node_id_1(Uint8Array val) { bindings.UnsignedChannelAnnouncement_set_node_id_1(this.ptr, val); } - public byte[] get_node_id_2() { - byte[] ret = bindings.UnsignedChannelAnnouncement_get_node_id_2(this.ptr); + public Uint8Array get_node_id_2() { + Uint8Array ret = bindings.UnsignedChannelAnnouncement_get_node_id_2(this.ptr); return ret; } - public void set_node_id_2(byte[] val) { + public void set_node_id_2(Uint8Array val) { bindings.UnsignedChannelAnnouncement_set_node_id_2(this.ptr, val); } - public byte[] get_bitcoin_key_1() { - byte[] ret = bindings.UnsignedChannelAnnouncement_get_bitcoin_key_1(this.ptr); + public Uint8Array get_bitcoin_key_1() { + Uint8Array ret = bindings.UnsignedChannelAnnouncement_get_bitcoin_key_1(this.ptr); return ret; } - public void set_bitcoin_key_1(byte[] val) { + public void set_bitcoin_key_1(Uint8Array val) { bindings.UnsignedChannelAnnouncement_set_bitcoin_key_1(this.ptr, val); } - public byte[] get_bitcoin_key_2() { - byte[] ret = bindings.UnsignedChannelAnnouncement_get_bitcoin_key_2(this.ptr); + public Uint8Array get_bitcoin_key_2() { + Uint8Array ret = bindings.UnsignedChannelAnnouncement_get_bitcoin_key_2(this.ptr); return ret; } - public void set_bitcoin_key_2(byte[] val) { + public void set_bitcoin_key_2(Uint8Array val) { bindings.UnsignedChannelAnnouncement_set_bitcoin_key_2(this.ptr, val); } - public byte[] write() { - byte[] ret = bindings.UnsignedChannelAnnouncement_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.UnsignedChannelAnnouncement_write(this.ptr); return ret; } - public static Result_UnsignedChannelAnnouncementDecodeErrorZ constructor_read(byte[] ser) { - uint32_t ret = bindings.UnsignedChannelAnnouncement_read(ser); + public static Result_UnsignedChannelAnnouncementDecodeErrorZ constructor_read(Uint8Array ser) { + number ret = bindings.UnsignedChannelAnnouncement_read(ser); Result_UnsignedChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/ts/structs/UnsignedChannelUpdate.ts b/ts/structs/UnsignedChannelUpdate.ts index eeec510d..a002dfc2 100644 --- a/ts/structs/UnsignedChannelUpdate.ts +++ b/ts/structs/UnsignedChannelUpdate.ts @@ -1,100 +1,108 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class UnsignedChannelUpdate extends CommonBase { - UnsignedChannelUpdate(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.UnsignedChannelUpdate_free(ptr); } - } + + export default class UnsignedChannelUpdate extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.UnsignedChannelUpdate_free(this.ptr); + } + } public UnsignedChannelUpdate clone() { - uint32_t ret = bindings.UnsignedChannelUpdate_clone(this.ptr); - UnsignedChannelUpdate ret_hu_conv = new UnsignedChannelUpdate(null, ret); + number ret = bindings.UnsignedChannelUpdate_clone(this.ptr); + const ret_hu_conv: UnsignedChannelUpdate = new UnsignedChannelUpdate(null, ret); return ret_hu_conv; } - public byte[] get_chain_hash() { - byte[] ret = bindings.UnsignedChannelUpdate_get_chain_hash(this.ptr); + public Uint8Array get_chain_hash() { + Uint8Array ret = bindings.UnsignedChannelUpdate_get_chain_hash(this.ptr); return ret; } - public void set_chain_hash(byte[] val) { + public void set_chain_hash(Uint8Array val) { bindings.UnsignedChannelUpdate_set_chain_hash(this.ptr, val); } - public long get_short_channel_id() { - long ret = bindings.UnsignedChannelUpdate_get_short_channel_id(this.ptr); + public number get_short_channel_id() { + number ret = bindings.UnsignedChannelUpdate_get_short_channel_id(this.ptr); return ret; } - public void set_short_channel_id(long val) { + public void set_short_channel_id(number val) { bindings.UnsignedChannelUpdate_set_short_channel_id(this.ptr, val); } - public int get_timestamp() { - int ret = bindings.UnsignedChannelUpdate_get_timestamp(this.ptr); + public number get_timestamp() { + number ret = bindings.UnsignedChannelUpdate_get_timestamp(this.ptr); return ret; } - public void set_timestamp(int val) { + public void set_timestamp(number val) { bindings.UnsignedChannelUpdate_set_timestamp(this.ptr, val); } - public byte get_flags() { - byte ret = bindings.UnsignedChannelUpdate_get_flags(this.ptr); + public number get_flags() { + number ret = bindings.UnsignedChannelUpdate_get_flags(this.ptr); return ret; } - public void set_flags(byte val) { + public void set_flags(number val) { bindings.UnsignedChannelUpdate_set_flags(this.ptr, val); } - public short get_cltv_expiry_delta() { - short ret = bindings.UnsignedChannelUpdate_get_cltv_expiry_delta(this.ptr); + public number get_cltv_expiry_delta() { + number ret = bindings.UnsignedChannelUpdate_get_cltv_expiry_delta(this.ptr); return ret; } - public void set_cltv_expiry_delta(short val) { + public void set_cltv_expiry_delta(number val) { bindings.UnsignedChannelUpdate_set_cltv_expiry_delta(this.ptr, val); } - public long get_htlc_minimum_msat() { - long ret = bindings.UnsignedChannelUpdate_get_htlc_minimum_msat(this.ptr); + public number get_htlc_minimum_msat() { + number ret = bindings.UnsignedChannelUpdate_get_htlc_minimum_msat(this.ptr); return ret; } - public void set_htlc_minimum_msat(long val) { + public void set_htlc_minimum_msat(number val) { bindings.UnsignedChannelUpdate_set_htlc_minimum_msat(this.ptr, val); } - public int get_fee_base_msat() { - int ret = bindings.UnsignedChannelUpdate_get_fee_base_msat(this.ptr); + public number get_fee_base_msat() { + number ret = bindings.UnsignedChannelUpdate_get_fee_base_msat(this.ptr); return ret; } - public void set_fee_base_msat(int val) { + public void set_fee_base_msat(number val) { bindings.UnsignedChannelUpdate_set_fee_base_msat(this.ptr, val); } - public int get_fee_proportional_millionths() { - int ret = bindings.UnsignedChannelUpdate_get_fee_proportional_millionths(this.ptr); + public number get_fee_proportional_millionths() { + number ret = bindings.UnsignedChannelUpdate_get_fee_proportional_millionths(this.ptr); return ret; } - public void set_fee_proportional_millionths(int val) { + public void set_fee_proportional_millionths(number val) { bindings.UnsignedChannelUpdate_set_fee_proportional_millionths(this.ptr, val); } - public byte[] write() { - byte[] ret = bindings.UnsignedChannelUpdate_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.UnsignedChannelUpdate_write(this.ptr); return ret; } - public static Result_UnsignedChannelUpdateDecodeErrorZ constructor_read(byte[] ser) { - uint32_t ret = bindings.UnsignedChannelUpdate_read(ser); + public static Result_UnsignedChannelUpdateDecodeErrorZ constructor_read(Uint8Array ser) { + number ret = bindings.UnsignedChannelUpdate_read(ser); Result_UnsignedChannelUpdateDecodeErrorZ ret_hu_conv = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/ts/structs/UnsignedNodeAnnouncement.ts b/ts/structs/UnsignedNodeAnnouncement.ts index 6c67010d..abd16c56 100644 --- a/ts/structs/UnsignedNodeAnnouncement.ts +++ b/ts/structs/UnsignedNodeAnnouncement.ts @@ -1,24 +1,32 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class UnsignedNodeAnnouncement extends CommonBase { - UnsignedNodeAnnouncement(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.UnsignedNodeAnnouncement_free(ptr); } - } + + export default class UnsignedNodeAnnouncement extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.UnsignedNodeAnnouncement_free(this.ptr); + } + } public UnsignedNodeAnnouncement clone() { - uint32_t ret = bindings.UnsignedNodeAnnouncement_clone(this.ptr); - UnsignedNodeAnnouncement ret_hu_conv = new UnsignedNodeAnnouncement(null, ret); + number ret = bindings.UnsignedNodeAnnouncement_clone(this.ptr); + const ret_hu_conv: UnsignedNodeAnnouncement = new UnsignedNodeAnnouncement(null, ret); return ret_hu_conv; } public NodeFeatures get_features() { - uint32_t ret = bindings.UnsignedNodeAnnouncement_get_features(this.ptr); - NodeFeatures ret_hu_conv = new NodeFeatures(null, ret); + number ret = bindings.UnsignedNodeAnnouncement_get_features(this.ptr); + const ret_hu_conv: NodeFeatures = new NodeFeatures(null, ret); return ret_hu_conv; } @@ -27,54 +35,54 @@ public class UnsignedNodeAnnouncement extends CommonBase { this.ptrs_to.add(val); } - public int get_timestamp() { - int ret = bindings.UnsignedNodeAnnouncement_get_timestamp(this.ptr); + public number get_timestamp() { + number ret = bindings.UnsignedNodeAnnouncement_get_timestamp(this.ptr); return ret; } - public void set_timestamp(int val) { + public void set_timestamp(number val) { bindings.UnsignedNodeAnnouncement_set_timestamp(this.ptr, val); } - public byte[] get_node_id() { - byte[] ret = bindings.UnsignedNodeAnnouncement_get_node_id(this.ptr); + public Uint8Array get_node_id() { + Uint8Array ret = bindings.UnsignedNodeAnnouncement_get_node_id(this.ptr); return ret; } - public void set_node_id(byte[] val) { + public void set_node_id(Uint8Array val) { bindings.UnsignedNodeAnnouncement_set_node_id(this.ptr, val); } - public byte[] get_rgb() { - byte[] ret = bindings.UnsignedNodeAnnouncement_get_rgb(this.ptr); + public Uint8Array get_rgb() { + Uint8Array ret = bindings.UnsignedNodeAnnouncement_get_rgb(this.ptr); return ret; } - public void set_rgb(byte[] val) { + public void set_rgb(Uint8Array val) { bindings.UnsignedNodeAnnouncement_set_rgb(this.ptr, val); } - public byte[] get_alias() { - byte[] ret = bindings.UnsignedNodeAnnouncement_get_alias(this.ptr); + public Uint8Array get_alias() { + Uint8Array ret = bindings.UnsignedNodeAnnouncement_get_alias(this.ptr); return ret; } - public void set_alias(byte[] val) { + public void set_alias(Uint8Array val) { bindings.UnsignedNodeAnnouncement_set_alias(this.ptr, val); } public void set_addresses(NetAddress[] val) { - bindings.UnsignedNodeAnnouncement_set_addresses(this.ptr, (uint32_t[])Arrays.stream(val).map(arr_conv_12 -> arr_conv_12.ptr).toArray()); + bindings.UnsignedNodeAnnouncement_set_addresses(this.ptr, (number[])Arrays.stream(val).map(arr_conv_12 -> arr_conv_12.ptr).toArray()); /* TODO 2 NetAddress */; } - public byte[] write() { - byte[] ret = bindings.UnsignedNodeAnnouncement_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.UnsignedNodeAnnouncement_write(this.ptr); return ret; } - public static Result_UnsignedNodeAnnouncementDecodeErrorZ constructor_read(byte[] ser) { - uint32_t ret = bindings.UnsignedNodeAnnouncement_read(ser); + public static Result_UnsignedNodeAnnouncementDecodeErrorZ constructor_read(Uint8Array ser) { + number ret = bindings.UnsignedNodeAnnouncement_read(ser); Result_UnsignedNodeAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); return ret_hu_conv; } diff --git a/ts/structs/UpdateAddHTLC.ts b/ts/structs/UpdateAddHTLC.ts index 450aae3b..52c5ed48 100644 --- a/ts/structs/UpdateAddHTLC.ts +++ b/ts/structs/UpdateAddHTLC.ts @@ -1,74 +1,82 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class UpdateAddHTLC extends CommonBase { - UpdateAddHTLC(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.UpdateAddHTLC_free(ptr); } - } + + export default class UpdateAddHTLC extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.UpdateAddHTLC_free(this.ptr); + } + } public UpdateAddHTLC clone() { - uint32_t ret = bindings.UpdateAddHTLC_clone(this.ptr); - UpdateAddHTLC ret_hu_conv = new UpdateAddHTLC(null, ret); + number ret = bindings.UpdateAddHTLC_clone(this.ptr); + const ret_hu_conv: UpdateAddHTLC = new UpdateAddHTLC(null, ret); return ret_hu_conv; } - public byte[] get_channel_id() { - byte[] ret = bindings.UpdateAddHTLC_get_channel_id(this.ptr); + public Uint8Array get_channel_id() { + Uint8Array ret = bindings.UpdateAddHTLC_get_channel_id(this.ptr); return ret; } - public void set_channel_id(byte[] val) { + public void set_channel_id(Uint8Array val) { bindings.UpdateAddHTLC_set_channel_id(this.ptr, val); } - public long get_htlc_id() { - long ret = bindings.UpdateAddHTLC_get_htlc_id(this.ptr); + public number get_htlc_id() { + number ret = bindings.UpdateAddHTLC_get_htlc_id(this.ptr); return ret; } - public void set_htlc_id(long val) { + public void set_htlc_id(number val) { bindings.UpdateAddHTLC_set_htlc_id(this.ptr, val); } - public long get_amount_msat() { - long ret = bindings.UpdateAddHTLC_get_amount_msat(this.ptr); + public number get_amount_msat() { + number ret = bindings.UpdateAddHTLC_get_amount_msat(this.ptr); return ret; } - public void set_amount_msat(long val) { + public void set_amount_msat(number val) { bindings.UpdateAddHTLC_set_amount_msat(this.ptr, val); } - public byte[] get_payment_hash() { - byte[] ret = bindings.UpdateAddHTLC_get_payment_hash(this.ptr); + public Uint8Array get_payment_hash() { + Uint8Array ret = bindings.UpdateAddHTLC_get_payment_hash(this.ptr); return ret; } - public void set_payment_hash(byte[] val) { + public void set_payment_hash(Uint8Array val) { bindings.UpdateAddHTLC_set_payment_hash(this.ptr, val); } - public int get_cltv_expiry() { - int ret = bindings.UpdateAddHTLC_get_cltv_expiry(this.ptr); + public number get_cltv_expiry() { + number ret = bindings.UpdateAddHTLC_get_cltv_expiry(this.ptr); return ret; } - public void set_cltv_expiry(int val) { + public void set_cltv_expiry(number val) { bindings.UpdateAddHTLC_set_cltv_expiry(this.ptr, val); } - public byte[] write() { - byte[] ret = bindings.UpdateAddHTLC_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.UpdateAddHTLC_write(this.ptr); return ret; } - public static UpdateAddHTLC constructor_read(byte[] ser) { - uint32_t ret = bindings.UpdateAddHTLC_read(ser); - UpdateAddHTLC ret_hu_conv = new UpdateAddHTLC(null, ret); + public static UpdateAddHTLC constructor_read(Uint8Array ser) { + number ret = bindings.UpdateAddHTLC_read(ser); + const ret_hu_conv: UpdateAddHTLC = new UpdateAddHTLC(null, ret); return ret_hu_conv; } diff --git a/ts/structs/UpdateFailHTLC.ts b/ts/structs/UpdateFailHTLC.ts index 7b39c358..c838d7c5 100644 --- a/ts/structs/UpdateFailHTLC.ts +++ b/ts/structs/UpdateFailHTLC.ts @@ -1,47 +1,55 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class UpdateFailHTLC extends CommonBase { - UpdateFailHTLC(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.UpdateFailHTLC_free(ptr); } - } + + export default class UpdateFailHTLC extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.UpdateFailHTLC_free(this.ptr); + } + } public UpdateFailHTLC clone() { - uint32_t ret = bindings.UpdateFailHTLC_clone(this.ptr); - UpdateFailHTLC ret_hu_conv = new UpdateFailHTLC(null, ret); + number ret = bindings.UpdateFailHTLC_clone(this.ptr); + const ret_hu_conv: UpdateFailHTLC = new UpdateFailHTLC(null, ret); return ret_hu_conv; } - public byte[] get_channel_id() { - byte[] ret = bindings.UpdateFailHTLC_get_channel_id(this.ptr); + public Uint8Array get_channel_id() { + Uint8Array ret = bindings.UpdateFailHTLC_get_channel_id(this.ptr); return ret; } - public void set_channel_id(byte[] val) { + public void set_channel_id(Uint8Array val) { bindings.UpdateFailHTLC_set_channel_id(this.ptr, val); } - public long get_htlc_id() { - long ret = bindings.UpdateFailHTLC_get_htlc_id(this.ptr); + public number get_htlc_id() { + number ret = bindings.UpdateFailHTLC_get_htlc_id(this.ptr); return ret; } - public void set_htlc_id(long val) { + public void set_htlc_id(number val) { bindings.UpdateFailHTLC_set_htlc_id(this.ptr, val); } - public byte[] write() { - byte[] ret = bindings.UpdateFailHTLC_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.UpdateFailHTLC_write(this.ptr); return ret; } - public static UpdateFailHTLC constructor_read(byte[] ser) { - uint32_t ret = bindings.UpdateFailHTLC_read(ser); - UpdateFailHTLC ret_hu_conv = new UpdateFailHTLC(null, ret); + public static UpdateFailHTLC constructor_read(Uint8Array ser) { + number ret = bindings.UpdateFailHTLC_read(ser); + const ret_hu_conv: UpdateFailHTLC = new UpdateFailHTLC(null, ret); return ret_hu_conv; } diff --git a/ts/structs/UpdateFailMalformedHTLC.ts b/ts/structs/UpdateFailMalformedHTLC.ts index 773324d7..10072c09 100644 --- a/ts/structs/UpdateFailMalformedHTLC.ts +++ b/ts/structs/UpdateFailMalformedHTLC.ts @@ -1,56 +1,64 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class UpdateFailMalformedHTLC extends CommonBase { - UpdateFailMalformedHTLC(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.UpdateFailMalformedHTLC_free(ptr); } - } + + export default class UpdateFailMalformedHTLC extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.UpdateFailMalformedHTLC_free(this.ptr); + } + } public UpdateFailMalformedHTLC clone() { - uint32_t ret = bindings.UpdateFailMalformedHTLC_clone(this.ptr); - UpdateFailMalformedHTLC ret_hu_conv = new UpdateFailMalformedHTLC(null, ret); + number ret = bindings.UpdateFailMalformedHTLC_clone(this.ptr); + const ret_hu_conv: UpdateFailMalformedHTLC = new UpdateFailMalformedHTLC(null, ret); return ret_hu_conv; } - public byte[] get_channel_id() { - byte[] ret = bindings.UpdateFailMalformedHTLC_get_channel_id(this.ptr); + public Uint8Array get_channel_id() { + Uint8Array ret = bindings.UpdateFailMalformedHTLC_get_channel_id(this.ptr); return ret; } - public void set_channel_id(byte[] val) { + public void set_channel_id(Uint8Array val) { bindings.UpdateFailMalformedHTLC_set_channel_id(this.ptr, val); } - public long get_htlc_id() { - long ret = bindings.UpdateFailMalformedHTLC_get_htlc_id(this.ptr); + public number get_htlc_id() { + number ret = bindings.UpdateFailMalformedHTLC_get_htlc_id(this.ptr); return ret; } - public void set_htlc_id(long val) { + public void set_htlc_id(number val) { bindings.UpdateFailMalformedHTLC_set_htlc_id(this.ptr, val); } - public short get_failure_code() { - short ret = bindings.UpdateFailMalformedHTLC_get_failure_code(this.ptr); + public number get_failure_code() { + number ret = bindings.UpdateFailMalformedHTLC_get_failure_code(this.ptr); return ret; } - public void set_failure_code(short val) { + public void set_failure_code(number val) { bindings.UpdateFailMalformedHTLC_set_failure_code(this.ptr, val); } - public byte[] write() { - byte[] ret = bindings.UpdateFailMalformedHTLC_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.UpdateFailMalformedHTLC_write(this.ptr); return ret; } - public static UpdateFailMalformedHTLC constructor_read(byte[] ser) { - uint32_t ret = bindings.UpdateFailMalformedHTLC_read(ser); - UpdateFailMalformedHTLC ret_hu_conv = new UpdateFailMalformedHTLC(null, ret); + public static UpdateFailMalformedHTLC constructor_read(Uint8Array ser) { + number ret = bindings.UpdateFailMalformedHTLC_read(ser); + const ret_hu_conv: UpdateFailMalformedHTLC = new UpdateFailMalformedHTLC(null, ret); return ret_hu_conv; } diff --git a/ts/structs/UpdateFee.ts b/ts/structs/UpdateFee.ts index de478b50..ed504174 100644 --- a/ts/structs/UpdateFee.ts +++ b/ts/structs/UpdateFee.ts @@ -1,53 +1,61 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class UpdateFee extends CommonBase { - UpdateFee(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.UpdateFee_free(ptr); } - } + + export default class UpdateFee extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.UpdateFee_free(this.ptr); + } + } public UpdateFee clone() { - uint32_t ret = bindings.UpdateFee_clone(this.ptr); - UpdateFee ret_hu_conv = new UpdateFee(null, ret); + number ret = bindings.UpdateFee_clone(this.ptr); + const ret_hu_conv: UpdateFee = new UpdateFee(null, ret); return ret_hu_conv; } - public byte[] get_channel_id() { - byte[] ret = bindings.UpdateFee_get_channel_id(this.ptr); + public Uint8Array get_channel_id() { + Uint8Array ret = bindings.UpdateFee_get_channel_id(this.ptr); return ret; } - public void set_channel_id(byte[] val) { + public void set_channel_id(Uint8Array val) { bindings.UpdateFee_set_channel_id(this.ptr, val); } - public int get_feerate_per_kw() { - int ret = bindings.UpdateFee_get_feerate_per_kw(this.ptr); + public number get_feerate_per_kw() { + number ret = bindings.UpdateFee_get_feerate_per_kw(this.ptr); return ret; } - public void set_feerate_per_kw(int val) { + public void set_feerate_per_kw(number val) { bindings.UpdateFee_set_feerate_per_kw(this.ptr, val); } - public static UpdateFee constructor_new(byte[] channel_id_arg, int feerate_per_kw_arg) { - uint32_t ret = bindings.UpdateFee_new(channel_id_arg, feerate_per_kw_arg); - UpdateFee ret_hu_conv = new UpdateFee(null, ret); + public static UpdateFee constructor_new(Uint8Array channel_id_arg, number feerate_per_kw_arg) { + number ret = bindings.UpdateFee_new(channel_id_arg, feerate_per_kw_arg); + const ret_hu_conv: UpdateFee = new UpdateFee(null, ret); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.UpdateFee_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.UpdateFee_write(this.ptr); return ret; } - public static UpdateFee constructor_read(byte[] ser) { - uint32_t ret = bindings.UpdateFee_read(ser); - UpdateFee ret_hu_conv = new UpdateFee(null, ret); + public static UpdateFee constructor_read(Uint8Array ser) { + number ret = bindings.UpdateFee_read(ser); + const ret_hu_conv: UpdateFee = new UpdateFee(null, ret); return ret_hu_conv; } diff --git a/ts/structs/UpdateFulfillHTLC.ts b/ts/structs/UpdateFulfillHTLC.ts index a0a1975a..63962f77 100644 --- a/ts/structs/UpdateFulfillHTLC.ts +++ b/ts/structs/UpdateFulfillHTLC.ts @@ -1,62 +1,70 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class UpdateFulfillHTLC extends CommonBase { - UpdateFulfillHTLC(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.UpdateFulfillHTLC_free(ptr); } - } + + export default class UpdateFulfillHTLC extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.UpdateFulfillHTLC_free(this.ptr); + } + } public UpdateFulfillHTLC clone() { - uint32_t ret = bindings.UpdateFulfillHTLC_clone(this.ptr); - UpdateFulfillHTLC ret_hu_conv = new UpdateFulfillHTLC(null, ret); + number ret = bindings.UpdateFulfillHTLC_clone(this.ptr); + const ret_hu_conv: UpdateFulfillHTLC = new UpdateFulfillHTLC(null, ret); return ret_hu_conv; } - public byte[] get_channel_id() { - byte[] ret = bindings.UpdateFulfillHTLC_get_channel_id(this.ptr); + public Uint8Array get_channel_id() { + Uint8Array ret = bindings.UpdateFulfillHTLC_get_channel_id(this.ptr); return ret; } - public void set_channel_id(byte[] val) { + public void set_channel_id(Uint8Array val) { bindings.UpdateFulfillHTLC_set_channel_id(this.ptr, val); } - public long get_htlc_id() { - long ret = bindings.UpdateFulfillHTLC_get_htlc_id(this.ptr); + public number get_htlc_id() { + number ret = bindings.UpdateFulfillHTLC_get_htlc_id(this.ptr); return ret; } - public void set_htlc_id(long val) { + public void set_htlc_id(number val) { bindings.UpdateFulfillHTLC_set_htlc_id(this.ptr, val); } - public byte[] get_payment_preimage() { - byte[] ret = bindings.UpdateFulfillHTLC_get_payment_preimage(this.ptr); + public Uint8Array get_payment_preimage() { + Uint8Array ret = bindings.UpdateFulfillHTLC_get_payment_preimage(this.ptr); return ret; } - public void set_payment_preimage(byte[] val) { + public void set_payment_preimage(Uint8Array val) { bindings.UpdateFulfillHTLC_set_payment_preimage(this.ptr, val); } - public static UpdateFulfillHTLC constructor_new(byte[] channel_id_arg, long htlc_id_arg, byte[] payment_preimage_arg) { - uint32_t ret = bindings.UpdateFulfillHTLC_new(channel_id_arg, htlc_id_arg, payment_preimage_arg); - UpdateFulfillHTLC ret_hu_conv = new UpdateFulfillHTLC(null, ret); + public static UpdateFulfillHTLC constructor_new(Uint8Array channel_id_arg, number htlc_id_arg, Uint8Array payment_preimage_arg) { + number ret = bindings.UpdateFulfillHTLC_new(channel_id_arg, htlc_id_arg, payment_preimage_arg); + const ret_hu_conv: UpdateFulfillHTLC = new UpdateFulfillHTLC(null, ret); return ret_hu_conv; } - public byte[] write() { - byte[] ret = bindings.UpdateFulfillHTLC_write(this.ptr); + public Uint8Array write() { + Uint8Array ret = bindings.UpdateFulfillHTLC_write(this.ptr); return ret; } - public static UpdateFulfillHTLC constructor_read(byte[] ser) { - uint32_t ret = bindings.UpdateFulfillHTLC_read(ser); - UpdateFulfillHTLC ret_hu_conv = new UpdateFulfillHTLC(null, ret); + public static UpdateFulfillHTLC constructor_read(Uint8Array ser) { + number ret = bindings.UpdateFulfillHTLC_read(ser); + const ret_hu_conv: UpdateFulfillHTLC = new UpdateFulfillHTLC(null, ret); return ret_hu_conv; } diff --git a/ts/structs/UserConfig.ts b/ts/structs/UserConfig.ts index 7a3d87e5..44c58657 100644 --- a/ts/structs/UserConfig.ts +++ b/ts/structs/UserConfig.ts @@ -1,24 +1,32 @@ + import CommonBase from './CommonBase'; import * as bindings from '../bindings' // TODO: figure out location -public class UserConfig extends CommonBase { - UserConfig(Object _dummy, long ptr) { super(ptr); } - @Override @SuppressWarnings("deprecation") - protected void finalize() throws Throwable { - super.finalize(); - if (ptr != 0) { bindings.UserConfig_free(ptr); } - } + + export default class UserConfig extends CommonBase { + constructor(_dummy: object, ptr: number) { + super(ptr); + } + + + protected finalize() { + super.finalize(); + + if (this.ptr != 0) { + bindings.UserConfig_free(this.ptr); + } + } public UserConfig clone() { - uint32_t ret = bindings.UserConfig_clone(this.ptr); - UserConfig ret_hu_conv = new UserConfig(null, ret); + number ret = bindings.UserConfig_clone(this.ptr); + const ret_hu_conv: UserConfig = new UserConfig(null, ret); return ret_hu_conv; } public ChannelHandshakeConfig get_own_channel_config() { - uint32_t ret = bindings.UserConfig_get_own_channel_config(this.ptr); - ChannelHandshakeConfig ret_hu_conv = new ChannelHandshakeConfig(null, ret); + number ret = bindings.UserConfig_get_own_channel_config(this.ptr); + const ret_hu_conv: ChannelHandshakeConfig = new ChannelHandshakeConfig(null, ret); return ret_hu_conv; } @@ -28,8 +36,8 @@ public class UserConfig extends CommonBase { } public ChannelHandshakeLimits get_peer_channel_config_limits() { - uint32_t ret = bindings.UserConfig_get_peer_channel_config_limits(this.ptr); - ChannelHandshakeLimits ret_hu_conv = new ChannelHandshakeLimits(null, ret); + number ret = bindings.UserConfig_get_peer_channel_config_limits(this.ptr); + const ret_hu_conv: ChannelHandshakeLimits = new ChannelHandshakeLimits(null, ret); return ret_hu_conv; } @@ -39,8 +47,8 @@ public class UserConfig extends CommonBase { } public ChannelConfig get_channel_options() { - uint32_t ret = bindings.UserConfig_get_channel_options(this.ptr); - ChannelConfig ret_hu_conv = new ChannelConfig(null, ret); + number ret = bindings.UserConfig_get_channel_options(this.ptr); + const ret_hu_conv: ChannelConfig = new ChannelConfig(null, ret); return ret_hu_conv; } @@ -50,8 +58,8 @@ public class UserConfig extends CommonBase { } public static UserConfig constructor_new(ChannelHandshakeConfig own_channel_config_arg, ChannelHandshakeLimits peer_channel_config_limits_arg, ChannelConfig channel_options_arg) { - uint32_t 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); - UserConfig ret_hu_conv = new UserConfig(null, ret); + number 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); + const ret_hu_conv: UserConfig = new UserConfig(null, ret); ret_hu_conv.ptrs_to.add(own_channel_config_arg); ret_hu_conv.ptrs_to.add(peer_channel_config_limits_arg); ret_hu_conv.ptrs_to.add(channel_options_arg); @@ -59,8 +67,8 @@ public class UserConfig extends CommonBase { } public static UserConfig constructor_default() { - uint32_t ret = bindings.UserConfig_default(); - UserConfig ret_hu_conv = new UserConfig(null, ret); + number ret = bindings.UserConfig_default(); + const ret_hu_conv: UserConfig = new UserConfig(null, ret); return ret_hu_conv; } diff --git a/ts/structs/Watch.ts b/ts/structs/Watch.ts index bf0fd550..ea0bdf4b 100644 --- a/ts/structs/Watch.ts +++ b/ts/structs/Watch.ts @@ -1,5 +1,78 @@ + + +import CommonBase from './CommonBase'; +import * as bindings from '../bindings' // TODO: figure out location + + + + export class Watch extends CommonBase { + + bindings_instance?: bindings.LDKWatch; + + constructor(ptr?: number, arg?: bindings.LDKWatch) { + if (Number.isFinite(ptr)) { + super(ptr); + this.bindings_instance = null; + } else { + // TODO: private constructor instantiation + super(bindings.LDKWatch_new(arg)); + this.ptrs_to.push(arg); + + } + } + + protected finalize() { + if (this.ptr != 0) { + bindings.Watch_free(this.ptr); + } + super.finalize(); + } + + static new_impl(arg: WatchInterface): Watch { + const impl_holder: LDKWatchHolder = new LDKWatchHolder(); + let structImplementation = { + // todo: in-line interface filling + watch_channel (funding_txo: number, monitor: number): number { + const funding_txo_hu_conv: OutPoint = new OutPoint(null, funding_txo); + const monitor_hu_conv: ChannelMonitor = new ChannelMonitor(null, monitor); + Result_NoneChannelMonitorUpdateErrZ ret = arg.watch_channel(funding_txo_hu_conv, monitor_hu_conv); + result: number = ret != null ? ret.ptr : 0; + return result; + }, + + update_channel (funding_txo: number, update: number): number { + const funding_txo_hu_conv: OutPoint = new OutPoint(null, funding_txo); + const update_hu_conv: ChannelMonitorUpdate = new ChannelMonitorUpdate(null, update); + Result_NoneChannelMonitorUpdateErrZ ret = arg.update_channel(funding_txo_hu_conv, update_hu_conv); + result: number = ret != null ? ret.ptr : 0; + return result; + }, + + release_pending_monitor_events (): number[] { + MonitorEvent[] ret = arg.release_pending_monitor_events(); + result: number[] = (number[])Arrays.stream(ret).map(arr_conv_14 -> arr_conv_14 == null ? 0 : arr_conv_14.ptr & ~1).toArray(); + /* TODO 2 MonitorEvent */; + return result; + }, + + + }; + impl_holder.held = new Watch (null, structImplementation); + } + } + + export interface WatchInterface { + watch_channel(funding_txo: OutPoint, monitor: ChannelMonitor): Result_NoneChannelMonitorUpdateErrZ; + update_channel(funding_txo: OutPoint, update: ChannelMonitorUpdate): Result_NoneChannelMonitorUpdateErrZ; + release_pending_monitor_events(): MonitorEvent[]; + + } + + class LDKWatchHolder { + held: Watch; + } public Result_NoneChannelMonitorUpdateErrZ watch_channel(OutPoint funding_txo, ChannelMonitor monitor) { - uint32_t ret = bindings.Watch_watch_channel(this.ptr, funding_txo == null ? 0 : funding_txo.ptr & ~1, monitor == null ? 0 : monitor.ptr & ~1); + number ret = bindings.Watch_watch_channel(this.ptr, funding_txo == null ? 0 : funding_txo.ptr & ~1, monitor == null ? 0 : monitor.ptr & ~1); Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret); this.ptrs_to.add(funding_txo); this.ptrs_to.add(monitor); @@ -7,7 +80,7 @@ } public Result_NoneChannelMonitorUpdateErrZ update_channel(OutPoint funding_txo, ChannelMonitorUpdate update) { - uint32_t ret = bindings.Watch_update_channel(this.ptr, funding_txo == null ? 0 : funding_txo.ptr & ~1, update == null ? 0 : update.ptr & ~1); + number ret = bindings.Watch_update_channel(this.ptr, funding_txo == null ? 0 : funding_txo.ptr & ~1, update == null ? 0 : update.ptr & ~1); Result_NoneChannelMonitorUpdateErrZ ret_hu_conv = Result_NoneChannelMonitorUpdateErrZ.constr_from_ptr(ret); this.ptrs_to.add(funding_txo); this.ptrs_to.add(update); @@ -15,11 +88,11 @@ } public MonitorEvent[] release_pending_monitor_events() { - uint32_t[] ret = bindings.Watch_release_pending_monitor_events(this.ptr); + number[] ret = bindings.Watch_release_pending_monitor_events(this.ptr); MonitorEvent[] arr_conv_14_arr = new MonitorEvent[ret.length]; for (int o = 0; o < ret.length; o++) { - uint32_t arr_conv_14 = ret[o]; - MonitorEvent arr_conv_14_hu_conv = new MonitorEvent(null, arr_conv_14); + number arr_conv_14 = ret[o]; + const arr_conv_14_hu_conv: MonitorEvent = new MonitorEvent(null, arr_conv_14); arr_conv_14_arr[o] = arr_conv_14_hu_conv; } return arr_conv_14_arr;