From: Matt Corallo Date: Fri, 9 Oct 2020 22:22:50 +0000 (-0400) Subject: Map tuples and ThirtyTwoBytes into array. X-Git-Tag: v0.0.1~122 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=2e76d7417e5b98ecb168878d956cba7ef11a26bc;p=ldk-java Map tuples and ThirtyTwoBytes into array. --- diff --git a/genbindings.py b/genbindings.py index be8e6489..0415de5d 100755 --- a/genbindings.py +++ b/genbindings.py @@ -184,10 +184,10 @@ with open(sys.argv[1]) as in_h, open(sys.argv[2], "w") as out_java, open(sys.arg arr_len = ret_arr_len assert(ty_info.c_ty == "jbyteArray") if ty_info.rust_obj is not None: - arg_conv = ty_info.rust_obj + " " + arr_name + "_ref;\n" + "(*_env)->GetByteArrayRegion (_env, """ + arr_name + ", 0, " + arr_len + ", " + arr_name + "_ref.data);" + arg_conv = ty_info.rust_obj + " " + arr_name + "_ref;\n" + "(*_env)->GetByteArrayRegion (_env, " + arr_name + ", 0, " + arr_len + ", " + arr_name + "_ref.data);" arr_access = ("", ".data") else: - arg_conv = "unsigned char " + arr_name + "_arr[" + arr_len + "];\n" + "(*_env)->GetByteArrayRegion (_env, """ + arr_name + ", 0, " + arr_len + ", " + arr_name + "_arr);\n" + "unsigned char (*""" + arr_name + "_ref)[" + arr_len + "] = &" + arr_name + "_arr;" + arg_conv = "unsigned char " + arr_name + "_arr[" + arr_len + "];\n" + "(*_env)->GetByteArrayRegion (_env, " + arr_name + ", 0, " + arr_len + ", " + arr_name + "_arr);\n" + "unsigned char (*" + arr_name + "_ref)[" + arr_len + "] = &" + arr_name + "_arr;" arr_access = ("*", "") return ConvInfo(ty_info = ty_info, arg_name = ty_info.var_name, arg_conv = arg_conv, @@ -220,7 +220,8 @@ with open(sys.argv[1]) as in_h, open(sys.argv[2], "w") as out_java, open(sys.arg arg_conv_name = ty_info.var_name + "_conv", ret_conv = ("CANT PASS TRAIT TO Java?", ""), ret_conv_name = "NO CONV POSSIBLE") if ty_info.rust_obj != "LDKu8slice": - # Don't bother free'ing slices passed in - we often pass them Rust -> Rust + # Don't bother free'ing slices passed in - Rust doesn't auto-free the + # underlying unlike Vecs, and it gives Java more freedom. base_conv = base_conv + "\nFREE((void*)" + ty_info.var_name + ");"; if ty_info.rust_obj in opaque_structs: return ConvInfo(ty_info = ty_info, arg_name = ty_info.var_name, @@ -476,7 +477,6 @@ with open(sys.argv[1]) as in_h, open(sys.argv[2], "w") as out_java, open(sys.arg out_c.write("\t\tdefault: abort();\n") out_c.write("\t}\n}\n") - def map_trait(struct_name, field_var_lines, trait_fn_lines): out_c.write("typedef struct " + struct_name + "_JCalls {\n") out_c.write("\tatomic_size_t refcnt;\n") @@ -724,6 +724,7 @@ public class bindings { 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 long vec_slice_len(long vec); public static native long new_empty_slice_vec(); @@ -768,6 +769,14 @@ JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_bytes_1to_1u8_1vec (JNIEnv * _ (*_env)->GetByteArrayRegion (_env, bytes, 0, vec->datalen, vec->data); return (long)vec; } +JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_new_1txpointer_1copy_1data (JNIEnv * env, jclass _b, jbyteArray bytes) { + LDKTransaction *txdata = (LDKTransaction*)MALLOC(sizeof(LDKTransaction), "LDKTransaction"); + txdata->datalen = (*env)->GetArrayLength(env, bytes); + txdata->data = (uint8_t*)malloc(txdata->datalen); // May be freed by rust, so don't track allocation + txdata->data_is_owned = true; + (*env)->GetByteArrayRegion (env, bytes, 0, txdata->datalen, txdata->data); + return (long)txdata; +} JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_vec_1slice_1len (JNIEnv * env, jclass _a, jlong ptr) { // Check offsets of a few Vec types are all consistent as we're meant to be generic across types _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKCVec_SignatureZ, datalen), "Vec<*> needs to be mapped identically"); @@ -830,7 +839,6 @@ _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKu8slice, datalen), union_enum_items = {} for line in in_h: if in_block_comment: - #out_java.write("\t" + line) if line.endswith("*/\n"): in_block_comment = False elif cur_block_obj is not None: @@ -845,6 +853,7 @@ _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKu8slice, datalen), is_unitary_enum = False is_union_enum = False is_union = False + is_tuple = False trait_fn_lines = [] field_var_lines = [] @@ -856,7 +865,6 @@ _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKu8slice, datalen), in_block_comment = False else: struct_name_match = struct_name_regex.match(struct_line) - vec_ty_match = line_indicates_vec_regex.match(struct_line) if struct_name_match is not None: struct_name = struct_name_match.group(3) if struct_name_match.group(1) == "enum": @@ -870,8 +878,11 @@ _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKu8slice, datalen), is_opaque = True elif line_indicates_result_regex.match(struct_line): is_result = True - elif vec_ty_match is not None and struct_name.startswith("LDKCVecTempl_"): + vec_ty_match = line_indicates_vec_regex.match(struct_line) + if vec_ty_match is not None and struct_name.startswith("LDKCVecTempl_"): vec_ty = vec_ty_match.group(1) + elif struct_name.startswith("LDKC2TupleTempl_") or struct_name.startswith("LDKC3TupleTempl_"): + is_tuple = True trait_fn_match = line_indicates_trait_regex.match(struct_line) if trait_fn_match is not None: trait_fn_lines.append(trait_fn_match) @@ -899,12 +910,61 @@ _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKu8slice, datalen), out_c.write("}\n") elif is_result: result_templ_structs.add(struct_name) + elif is_tuple: + out_java.write("\tpublic static native long " + struct_name + "_new(") + out_c.write("JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_" + struct_name.replace("_", "_1") + "_1new(JNIEnv *_env, jclass _b") + for idx, line in enumerate(field_lines): + if idx != 0 and idx < len(field_lines) - 2: + ty_info = java_c_types(line.strip(';'), None) + if idx != 1: + out_java.write(", ") + e = chr(ord('a') + idx - 1) + out_java.write(ty_info.java_ty + " " + e) + out_c.write(", " + ty_info.c_ty + " " + e) + out_java.write(");\n") + out_c.write(") {\n") + out_c.write("\t" + struct_name + "* ret = MALLOC(sizeof(" + struct_name + "), \"" + struct_name + "\");\n") + for idx, line in enumerate(field_lines): + if idx != 0 and idx < len(field_lines) - 2: + ty_info = map_type(line.strip(';'), False, None, False) + e = chr(ord('a') + idx - 1) + if ty_info.arg_conv is not None: + out_c.write("\t" + ty_info.arg_conv.replace("\n", "\n\t")) + out_c.write("\n\tret->" + e + " = " + ty_info.arg_conv_name + ";\n") + else: + out_c.write("\tret->" + e + " = " + e + ";\n") + out_c.write("\treturn (long)ret;\n") + out_c.write("}\n") elif vec_ty is not None: out_java.write("\tpublic static native VecOrSliceDef " + struct_name + "_arr_info(long vec_ptr);\n") out_c.write("JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_" + struct_name.replace("_", "_1") + "_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {\n") out_c.write("\t" + struct_name + " *vec = (" + struct_name + "*)ptr;\n") out_c.write("\treturn (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(" + vec_ty + "));\n") out_c.write("}\n") + + ty_info = map_type(vec_ty + " arr_elem", False, None, False) + out_java.write("\tpublic static native long " + struct_name + "_new(" + ty_info.java_ty + "[] elems);\n") + out_c.write("JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_" + struct_name.replace("_", "_1") + "_1new(JNIEnv *env, jclass _b, j" + ty_info.java_ty + "Array elems){\n") + out_c.write("\t" + struct_name + " *ret = MALLOC(sizeof(" + struct_name + "), \"" + struct_name + "\");\n") + out_c.write("\tret->datalen = (*env)->GetArrayLength(env, elems);\n") + out_c.write("\tif (ret->datalen == 0) {\n") + out_c.write("\t\tret->data = NULL;\n") + out_c.write("\t} else {\n") + out_c.write("\t\tret->data = malloc(sizeof(" + vec_ty + ") * ret->datalen); // often freed by rust directly\n") + assert len(ty_info.java_fn_ty_arg) == 1 # ie we're a primitive of some form + out_c.write("\t\t" + ty_info.c_ty + " *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);\n") + out_c.write("\t\tfor (size_t i = 0; i < ret->datalen; i++) {\n") + if ty_info.arg_conv is not None: + out_c.write("\t\t\t" + ty_info.c_ty + " arr_elem = java_elems[i];\n") + out_c.write("\t\t\t" + ty_info.arg_conv.replace("\n", "\n\t\t\t") + "\n") + out_c.write("\t\t\tret->data[i] = " + ty_info.arg_conv_name + ";\n") + else: + out_c.write("\t\t\tret->data[i] = java_elems[i];\n") + out_c.write("\t\t}\n") + out_c.write("\t\t(*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);\n") + out_c.write("\t}\n") + out_c.write("\treturn (long)ret;\n") + out_c.write("}\n") elif is_union_enum: assert(struct_name.endswith("_Tag")) struct_name = struct_name[:-4] diff --git a/src/main/java/org/ldk/impl/bindings.java b/src/main/java/org/ldk/impl/bindings.java index 1f61ac2e..e571cdce 100644 --- a/src/main/java/org/ldk/impl/bindings.java +++ b/src/main/java/org/ldk/impl/bindings.java @@ -34,14 +34,22 @@ public class bindings { static { LDKNetwork.values(); /* Force enum statics to run */ } static { LDKSecp256k1Error.values(); /* Force enum statics to run */ } public static native VecOrSliceDef LDKCVecTempl_u8_arr_info(long vec_ptr); + public static native long LDKCVecTempl_u8_new(byte[] elems); + public static native long LDKC2TupleTempl_usize__Transaction_new(long a, long b); public static native boolean LDKCResult_NoneChannelMonitorUpdateErrZ_result_ok(long arg); public static native long LDKCResult_NoneChannelMonitorUpdateErrZ_get_inner(long arg); public static native long LDKMonitorUpdateError_optional_none(); public static native boolean LDKCResult_NoneMonitorUpdateErrorZ_result_ok(long arg); public static native long LDKCResult_NoneMonitorUpdateErrorZ_get_inner(long arg); public static native long LDKOutPoint_optional_none(); + public static native long LDKC2TupleTempl_OutPoint__CVec_u8Z_new(long a, long b); public static native VecOrSliceDef LDKCVecTempl_TxOut_arr_info(long vec_ptr); + public static native long LDKCVecTempl_TxOut_new(long[] elems); + public static native long LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut_new(byte[] a, long b); + public static native long LDKC2TupleTempl_u64__u64_new(long a, long b); public static native VecOrSliceDef LDKCVecTempl_Signature_arr_info(long vec_ptr); + public static native long LDKCVecTempl_Signature_new(long[] elems); + public static native long LDKC2TupleTempl_Signature__CVecTempl_Signature_new(long a, long b); public static native boolean LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_result_ok(long arg); public static native long LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_inner(long arg); public static native boolean LDKCResult_SignatureNoneZ_result_ok(long arg); @@ -80,10 +88,12 @@ public class bindings { public static native long LDKCResult_NonePaymentSendFailureZ_get_inner(long arg); public static native long LDKChannelAnnouncement_optional_none(); public static native long LDKChannelUpdate_optional_none(); + public static native long LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate_new(long a, long b, long c); public static native long LDKPeerHandleError_optional_none(); public static native boolean LDKCResult_NonePeerHandleErrorZ_result_ok(long arg); public static native long LDKCResult_NonePeerHandleErrorZ_get_inner(long arg); public static native long LDKHTLCOutputInCommitment_optional_none(); + public static native long LDKC2TupleTempl_HTLCOutputInCommitment__Signature_new(long a, long b); public static class LDKSpendableOutputDescriptor { private LDKSpendableOutputDescriptor() {} public final static class StaticOutput extends LDKSpendableOutputDescriptor { @@ -111,6 +121,7 @@ public class bindings { static { LDKSpendableOutputDescriptor.init(); } public static native LDKSpendableOutputDescriptor LDKSpendableOutputDescriptor_ref_from_ptr(long ptr); public static native VecOrSliceDef LDKCVecTempl_SpendableOutputDescriptor_arr_info(long vec_ptr); + public static native long LDKCVecTempl_SpendableOutputDescriptor_new(long[] elems); public static class LDKEvent { private LDKEvent() {} public final static class FundingGenerationReady extends LDKEvent { @@ -285,6 +296,7 @@ public class bindings { static { LDKMessageSendEvent.init(); } public static native LDKMessageSendEvent LDKMessageSendEvent_ref_from_ptr(long ptr); public static native VecOrSliceDef LDKCVecTempl_MessageSendEvent_arr_info(long vec_ptr); + public static native long LDKCVecTempl_MessageSendEvent_new(long[] elems); public interface LDKMessageSendEventsProvider { long get_and_clear_pending_msg_events(); } @@ -293,6 +305,7 @@ public class bindings { // LDKCVec_MessageSendEventZ LDKMessageSendEventsProvider_call_get_and_clear_pending_msg_events LDKMessageSendEventsProvider* arg public static native long LDKMessageSendEventsProvider_call_get_and_clear_pending_msg_events(long arg); public static native VecOrSliceDef LDKCVecTempl_Event_arr_info(long vec_ptr); + public static native long LDKCVecTempl_Event_new(long[] elems); public interface LDKEventsProvider { long get_and_clear_pending_events(); } @@ -321,6 +334,7 @@ public class bindings { public static native long LDKChannelPublicKeys_optional_none(); public static native long LDKPreCalculatedTxCreationKeys_optional_none(); public static native VecOrSliceDef LDKCVecTempl_HTLCOutputInCommitment_arr_info(long vec_ptr); + public static native long LDKCVecTempl_HTLCOutputInCommitment_new(long[] elems); public static native long LDKHolderCommitmentTransaction_optional_none(); public static native long LDKUnsignedChannelAnnouncement_optional_none(); public interface LDKChannelKeys { @@ -364,6 +378,7 @@ public class bindings { public static native long LDKChannelMonitorUpdate_optional_none(); public static native long LDKMonitorEvent_optional_none(); public static native VecOrSliceDef LDKCVecTempl_MonitorEvent_arr_info(long vec_ptr); + public static native long LDKCVecTempl_MonitorEvent_new(long[] elems); public interface LDKWatch { long watch_channel(long funding_txo, long monitor); long update_channel(long funding_txo, long update); @@ -403,9 +418,12 @@ public class bindings { public static native int LDKFeeEstimator_call_get_est_sat_per_1000_weight(long arg, LDKConfirmationTarget confirmation_target); public static native long LDKChainMonitor_optional_none(); public static native VecOrSliceDef LDKCVecTempl_C2TupleTempl_usize__Transaction_arr_info(long vec_ptr); + public static native long LDKCVecTempl_C2TupleTempl_usize__Transaction_new(long[] elems); public static native long LDKHTLCUpdate_optional_none(); public static native VecOrSliceDef LDKCVecTempl_Transaction_arr_info(long vec_ptr); + public static native long LDKCVecTempl_Transaction_new(long[] elems); public static native VecOrSliceDef LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut_arr_info(long vec_ptr); + public static native long LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut_new(long[] elems); public interface LDKKeysInterface { long get_node_secret(); long get_destination_script(); @@ -431,6 +449,7 @@ public class bindings { public static native long LDKChannelDetails_optional_none(); public static native long LDKInitFeatures_optional_none(); public static native VecOrSliceDef LDKCVecTempl_ChannelDetails_arr_info(long vec_ptr); + public static native long LDKCVecTempl_ChannelDetails_new(long[] elems); public static native long LDKRoute_optional_none(); public static class LDKNetAddress { private LDKNetAddress() {} @@ -461,6 +480,7 @@ public class bindings { static { LDKNetAddress.init(); } public static native LDKNetAddress LDKNetAddress_ref_from_ptr(long ptr); public static native VecOrSliceDef LDKCVecTempl_NetAddress_arr_info(long vec_ptr); + public static native long LDKCVecTempl_NetAddress_new(long[] elems); public static native long LDKUpdateAddHTLC_optional_none(); public static native long LDKUpdateFulfillHTLC_optional_none(); public static native long LDKUpdateFailHTLC_optional_none(); @@ -531,6 +551,7 @@ public class bindings { public static native void LDKChannelMessageHandler_call_handle_error(long arg, long their_node_id, long msg); public static native long LDKChannelManagerReadArgs_optional_none(); public static native VecOrSliceDef LDKCVecTempl_ChannelMonitor_arr_info(long vec_ptr); + public static native long LDKCVecTempl_ChannelMonitor_new(long[] elems); public static native long LDKDecodeError_optional_none(); public static native long LDKPing_optional_none(); public static native long LDKPong_optional_none(); @@ -542,18 +563,25 @@ public class bindings { public static native long LDKQueryChannelRange_optional_none(); public static native long LDKReplyChannelRange_optional_none(); public static native VecOrSliceDef LDKCVecTempl_u64_arr_info(long vec_ptr); + public static native long LDKCVecTempl_u64_new(long[] elems); public static native long LDKQueryShortChannelIds_optional_none(); public static native long LDKReplyShortChannelIdsEnd_optional_none(); public static native long LDKGossipTimestampFilter_optional_none(); public static native long LDKLightningError_optional_none(); public static native VecOrSliceDef LDKCVecTempl_UpdateAddHTLC_arr_info(long vec_ptr); + public static native long LDKCVecTempl_UpdateAddHTLC_new(long[] elems); public static native VecOrSliceDef LDKCVecTempl_UpdateFulfillHTLC_arr_info(long vec_ptr); + public static native long LDKCVecTempl_UpdateFulfillHTLC_new(long[] elems); public static native VecOrSliceDef LDKCVecTempl_UpdateFailHTLC_arr_info(long vec_ptr); + public static native long LDKCVecTempl_UpdateFailHTLC_new(long[] elems); public static native VecOrSliceDef LDKCVecTempl_UpdateFailMalformedHTLC_arr_info(long vec_ptr); + public static native long LDKCVecTempl_UpdateFailMalformedHTLC_new(long[] elems); public static native boolean LDKCResult_boolLightningErrorZ_result_ok(long arg); public static native long LDKCResult_boolLightningErrorZ_get_inner(long arg); public static native VecOrSliceDef LDKCVecTempl_C3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate_arr_info(long vec_ptr); + public static native long LDKCVecTempl_C3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate_new(long[] elems); public static native VecOrSliceDef LDKCVecTempl_NodeAnnouncement_arr_info(long vec_ptr); + public static native long LDKCVecTempl_NodeAnnouncement_new(long[] elems); public interface LDKRoutingMessageHandler { long handle_node_announcement(long msg); long handle_channel_announcement(long msg); @@ -596,6 +624,7 @@ public class bindings { public static native long LDKSocketDescriptor_call_hash(long arg); public static native long LDKPeerManager_optional_none(); public static native VecOrSliceDef LDKCVecTempl_PublicKey_arr_info(long vec_ptr); + public static native long LDKCVecTempl_PublicKey_new(long[] elems); public static native boolean LDKCResult_CVec_u8ZPeerHandleErrorZ_result_ok(long arg); public static native long LDKCResult_CVec_u8ZPeerHandleErrorZ_get_inner(long arg); public static native boolean LDKCResult_boolPeerHandleErrorZ_result_ok(long arg); @@ -608,15 +637,19 @@ public class bindings { public static native boolean LDKCResult_TxCreationKeysSecpErrorZ_result_ok(long arg); public static native long LDKCResult_TxCreationKeysSecpErrorZ_get_inner(long arg); public static native VecOrSliceDef LDKCVecTempl_C2TupleTempl_HTLCOutputInCommitment__Signature_arr_info(long vec_ptr); + public static native long LDKCVecTempl_C2TupleTempl_HTLCOutputInCommitment__Signature_new(long[] elems); public static native long LDKRouteHop_optional_none(); public static native VecOrSliceDef LDKCVecTempl_RouteHop_arr_info(long vec_ptr); + public static native long LDKCVecTempl_RouteHop_new(long[] elems); public static native VecOrSliceDef LDKCVecTempl_CVecTempl_RouteHop_arr_info(long vec_ptr); + public static native long LDKCVecTempl_CVecTempl_RouteHop_new(long[] elems); public static native long LDKRouteHint_optional_none(); public static native long LDKRoutingFees_optional_none(); public static native boolean LDKCResult_RouteLightningErrorZ_result_ok(long arg); public static native long LDKCResult_RouteLightningErrorZ_get_inner(long arg); public static native long LDKNetworkGraph_optional_none(); public static native VecOrSliceDef LDKCVecTempl_RouteHint_arr_info(long vec_ptr); + public static native long LDKCVecTempl_RouteHint_new(long[] elems); public static native long LDKLockedNetworkGraph_optional_none(); public static native long LDKNetGraphMsgHandler_optional_none(); public static native long LDKDirectionalChannelInfo_optional_none(); diff --git a/src/main/jni/bindings.c b/src/main/jni/bindings.c index 6348b72d..7a2e32eb 100644 --- a/src/main/jni/bindings.c +++ b/src/main/jni/bindings.c @@ -88,6 +88,14 @@ JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_bytes_1to_1u8_1vec (JNIEnv * _ (*_env)->GetByteArrayRegion (_env, bytes, 0, vec->datalen, vec->data); return (long)vec; } +JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_new_1txpointer_1copy_1data (JNIEnv * env, jclass _b, jbyteArray bytes) { + LDKTransaction *txdata = (LDKTransaction*)MALLOC(sizeof(LDKTransaction), "LDKTransaction"); + txdata->datalen = (*env)->GetArrayLength(env, bytes); + txdata->data = (uint8_t*)malloc(txdata->datalen); // May be freed by rust, so don't track allocation + txdata->data_is_owned = true; + (*env)->GetByteArrayRegion (env, bytes, 0, txdata->datalen, txdata->data); + return (long)txdata; +} JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_vec_1slice_1len (JNIEnv * env, jclass _a, jlong ptr) { // Check offsets of a few Vec types are all consistent as we're meant to be generic across types _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKCVec_SignatureZ, datalen), "Vec<*> needs to be mapped identically"); @@ -368,6 +376,29 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1u8_1arr_1info LDKCVecTempl_u8 *vec = (LDKCVecTempl_u8*)ptr; return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(uint8_t)); } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1u8_1new(JNIEnv *env, jclass _b, jbyteArray elems){ + LDKCVecTempl_u8 *ret = MALLOC(sizeof(LDKCVecTempl_u8), "LDKCVecTempl_u8"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = malloc(sizeof(uint8_t) * ret->datalen); // often freed by rust directly + jbyte *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + ret->data[i] = java_elems[i]; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2TupleTempl_1usize_1_1Transaction_1new(JNIEnv *_env, jclass _b, jlong a, jlong b) { + LDKC2TupleTempl_usize__Transaction* ret = MALLOC(sizeof(LDKC2TupleTempl_usize__Transaction), "LDKC2TupleTempl_usize__Transaction"); + ret->a = a; + LDKTransaction b_conv = *(LDKTransaction*)b; + FREE((void*)b); + ret->b = b_conv; + return (long)ret; +} JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { return ((LDKCResult_NoneChannelMonitorUpdateErrZ*)arg)->result_ok; } @@ -398,14 +429,87 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKOutPoint_1optional_1none ( ret->inner = NULL; return (long)ret; } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2TupleTempl_1OutPoint_1_1CVec_1u8Z_1new(JNIEnv *_env, jclass _b, jlong a, jlong b) { + LDKC2TupleTempl_OutPoint__CVec_u8Z* ret = MALLOC(sizeof(LDKC2TupleTempl_OutPoint__CVec_u8Z), "LDKC2TupleTempl_OutPoint__CVec_u8Z"); + LDKOutPoint a_conv = *(LDKOutPoint*)a; + FREE((void*)a); + a_conv.is_owned = true; + ret->a = a_conv; + LDKCVec_u8Z b_conv = *(LDKCVec_u8Z*)b; + FREE((void*)b); + ret->b = b_conv; + return (long)ret; +} JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1TxOut_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { LDKCVecTempl_TxOut *vec = (LDKCVecTempl_TxOut*)ptr; return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKTxOut)); } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1TxOut_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVecTempl_TxOut *ret = MALLOC(sizeof(LDKCVecTempl_TxOut), "LDKCVecTempl_TxOut"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = malloc(sizeof(LDKTxOut) * ret->datalen); // often freed by rust directly + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKTxOut arr_elem_conv = *(LDKTxOut*)arr_elem; + FREE((void*)arr_elem); + ret->data[i] = arr_elem_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2TupleTempl_1ThirtyTwoBytes_1_1CVecTempl_1TxOut_1new(JNIEnv *_env, jclass _b, jbyteArray a, jlong b) { + LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut* ret = MALLOC(sizeof(LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut), "LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut"); + LDKThirtyTwoBytes a_ref; + (*_env)->GetByteArrayRegion (_env, a, 0, 32, a_ref.data); + ret->a = a_ref; + LDKCVecTempl_TxOut b_conv = *(LDKCVecTempl_TxOut*)b; + FREE((void*)b); + ret->b = b_conv; + return (long)ret; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2TupleTempl_1u64_1_1u64_1new(JNIEnv *_env, jclass _b, jlong a, jlong b) { + LDKC2TupleTempl_u64__u64* ret = MALLOC(sizeof(LDKC2TupleTempl_u64__u64), "LDKC2TupleTempl_u64__u64"); + ret->a = a; + ret->b = b; + return (long)ret; +} JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Signature_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { LDKCVecTempl_Signature *vec = (LDKCVecTempl_Signature*)ptr; return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKSignature)); } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Signature_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVecTempl_Signature *ret = MALLOC(sizeof(LDKCVecTempl_Signature), "LDKCVecTempl_Signature"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = malloc(sizeof(LDKSignature) * ret->datalen); // often freed by rust directly + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKSignature arr_elem_conv = *(LDKSignature*)arr_elem; + FREE((void*)arr_elem); + ret->data[i] = arr_elem_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; +} +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2TupleTempl_1Signature_1_1CVecTempl_1Signature_1new(JNIEnv *_env, jclass _b, jlong a, jlong b) { + LDKC2TupleTempl_Signature__CVecTempl_Signature* ret = MALLOC(sizeof(LDKC2TupleTempl_Signature__CVecTempl_Signature), "LDKC2TupleTempl_Signature__CVecTempl_Signature"); + LDKSignature a_conv = *(LDKSignature*)a; + FREE((void*)a); + ret->a = a_conv; + LDKCVecTempl_Signature b_conv = *(LDKCVecTempl_Signature*)b; + FREE((void*)b); + ret->b = b_conv; + return (long)ret; +} JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { return ((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg)->result_ok; } @@ -533,6 +637,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelUpdate_1optional_1n ret->inner = NULL; return (long)ret; } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC3TupleTempl_1ChannelAnnouncement_1_1ChannelUpdate_1_1ChannelUpdate_1new(JNIEnv *_env, jclass _b, jlong a, jlong b, jlong c) { + LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate* ret = MALLOC(sizeof(LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate), "LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate"); + LDKChannelAnnouncement a_conv = *(LDKChannelAnnouncement*)a; + FREE((void*)a); + a_conv.is_owned = true; + ret->a = a_conv; + LDKChannelUpdate b_conv = *(LDKChannelUpdate*)b; + FREE((void*)b); + b_conv.is_owned = true; + ret->b = b_conv; + LDKChannelUpdate c_conv = *(LDKChannelUpdate*)c; + FREE((void*)c); + c_conv.is_owned = true; + ret->c = c_conv; + return (long)ret; +} JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKPeerHandleError_1optional_1none (JNIEnv * env, jclass _a) { LDKPeerHandleError *ret = MALLOC(sizeof(LDKPeerHandleError), "LDKPeerHandleError"); ret->inner = NULL; @@ -553,6 +673,17 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKHTLCOutputInCommitment_1op ret->inner = NULL; return (long)ret; } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2TupleTempl_1HTLCOutputInCommitment_1_1Signature_1new(JNIEnv *_env, jclass _b, jlong a, jlong b) { + LDKC2TupleTempl_HTLCOutputInCommitment__Signature* ret = MALLOC(sizeof(LDKC2TupleTempl_HTLCOutputInCommitment__Signature), "LDKC2TupleTempl_HTLCOutputInCommitment__Signature"); + LDKHTLCOutputInCommitment a_conv = *(LDKHTLCOutputInCommitment*)a; + FREE((void*)a); + a_conv.is_owned = true; + ret->a = a_conv; + LDKSignature b_conv = *(LDKSignature*)b; + FREE((void*)b); + ret->b = b_conv; + return (long)ret; +} static jclass LDKSpendableOutputDescriptor_StaticOutput_class = NULL; static jmethodID LDKSpendableOutputDescriptor_StaticOutput_meth = NULL; static jclass LDKSpendableOutputDescriptor_DynamicOutputP2WSH_class = NULL; @@ -605,6 +736,24 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1SpendableOutp LDKCVecTempl_SpendableOutputDescriptor *vec = (LDKCVecTempl_SpendableOutputDescriptor*)ptr; return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKSpendableOutputDescriptor)); } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1SpendableOutputDescriptor_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVecTempl_SpendableOutputDescriptor *ret = MALLOC(sizeof(LDKCVecTempl_SpendableOutputDescriptor), "LDKCVecTempl_SpendableOutputDescriptor"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = malloc(sizeof(LDKSpendableOutputDescriptor) * ret->datalen); // often freed by rust directly + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKSpendableOutputDescriptor arr_elem_conv = *(LDKSpendableOutputDescriptor*)arr_elem; + FREE((void*)arr_elem); + ret->data[i] = arr_elem_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; +} static jclass LDKEvent_FundingGenerationReady_class = NULL; static jmethodID LDKEvent_FundingGenerationReady_meth = NULL; static jclass LDKEvent_FundingBroadcastSafe_class = NULL; @@ -1042,6 +1191,24 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1MessageSendEv LDKCVecTempl_MessageSendEvent *vec = (LDKCVecTempl_MessageSendEvent*)ptr; return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKMessageSendEvent)); } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1MessageSendEvent_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVecTempl_MessageSendEvent *ret = MALLOC(sizeof(LDKCVecTempl_MessageSendEvent), "LDKCVecTempl_MessageSendEvent"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = malloc(sizeof(LDKMessageSendEvent) * ret->datalen); // often freed by rust directly + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKMessageSendEvent arr_elem_conv = *(LDKMessageSendEvent*)arr_elem; + FREE((void*)arr_elem); + ret->data[i] = arr_elem_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; +} typedef struct LDKMessageSendEventsProvider_JCalls { atomic_size_t refcnt; JavaVM *vm; @@ -1107,6 +1274,24 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Event_1arr_1i LDKCVecTempl_Event *vec = (LDKCVecTempl_Event*)ptr; return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKEvent)); } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Event_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVecTempl_Event *ret = MALLOC(sizeof(LDKCVecTempl_Event), "LDKCVecTempl_Event"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = malloc(sizeof(LDKEvent) * ret->datalen); // often freed by rust directly + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKEvent arr_elem_conv = *(LDKEvent*)arr_elem; + FREE((void*)arr_elem); + ret->data[i] = arr_elem_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; +} typedef struct LDKEventsProvider_JCalls { atomic_size_t refcnt; JavaVM *vm; @@ -1330,6 +1515,25 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1HTLCOutputInC LDKCVecTempl_HTLCOutputInCommitment *vec = (LDKCVecTempl_HTLCOutputInCommitment*)ptr; return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKHTLCOutputInCommitment)); } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1HTLCOutputInCommitment_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVecTempl_HTLCOutputInCommitment *ret = MALLOC(sizeof(LDKCVecTempl_HTLCOutputInCommitment), "LDKCVecTempl_HTLCOutputInCommitment"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = malloc(sizeof(LDKHTLCOutputInCommitment) * ret->datalen); // often freed by rust directly + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKHTLCOutputInCommitment arr_elem_conv = *(LDKHTLCOutputInCommitment*)arr_elem; + FREE((void*)arr_elem); + arr_elem_conv.is_owned = true; + ret->data[i] = arr_elem_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; +} JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKHolderCommitmentTransaction_1optional_1none (JNIEnv * env, jclass _a) { LDKHolderCommitmentTransaction *ret = MALLOC(sizeof(LDKHolderCommitmentTransaction), "LDKHolderCommitmentTransaction"); ret->inner = NULL; @@ -1646,6 +1850,25 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1MonitorEvent_ LDKCVecTempl_MonitorEvent *vec = (LDKCVecTempl_MonitorEvent*)ptr; return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKMonitorEvent)); } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1MonitorEvent_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVecTempl_MonitorEvent *ret = MALLOC(sizeof(LDKCVecTempl_MonitorEvent), "LDKCVecTempl_MonitorEvent"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = malloc(sizeof(LDKMonitorEvent) * ret->datalen); // often freed by rust directly + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKMonitorEvent arr_elem_conv = *(LDKMonitorEvent*)arr_elem; + FREE((void*)arr_elem); + arr_elem_conv.is_owned = true; + ret->data[i] = arr_elem_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; +} typedef struct LDKWatch_JCalls { atomic_size_t refcnt; JavaVM *vm; @@ -1970,6 +2193,24 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_ LDKCVecTempl_C2TupleTempl_usize__Transaction *vec = (LDKCVecTempl_C2TupleTempl_usize__Transaction*)ptr; return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKC2TupleTempl_usize__Transaction)); } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1usize_1_1Transaction_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVecTempl_C2TupleTempl_usize__Transaction *ret = MALLOC(sizeof(LDKCVecTempl_C2TupleTempl_usize__Transaction), "LDKCVecTempl_C2TupleTempl_usize__Transaction"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = malloc(sizeof(LDKC2TupleTempl_usize__Transaction) * ret->datalen); // often freed by rust directly + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKC2TupleTempl_usize__Transaction arr_elem_conv = *(LDKC2TupleTempl_usize__Transaction*)arr_elem; + FREE((void*)arr_elem); + ret->data[i] = arr_elem_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; +} JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKHTLCUpdate_1optional_1none (JNIEnv * env, jclass _a) { LDKHTLCUpdate *ret = MALLOC(sizeof(LDKHTLCUpdate), "LDKHTLCUpdate"); ret->inner = NULL; @@ -1979,10 +2220,46 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Transaction_1 LDKCVecTempl_Transaction *vec = (LDKCVecTempl_Transaction*)ptr; return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKTransaction)); } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Transaction_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVecTempl_Transaction *ret = MALLOC(sizeof(LDKCVecTempl_Transaction), "LDKCVecTempl_Transaction"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = malloc(sizeof(LDKTransaction) * ret->datalen); // often freed by rust directly + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKTransaction arr_elem_conv = *(LDKTransaction*)arr_elem; + FREE((void*)arr_elem); + ret->data[i] = arr_elem_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; +} JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1ThirtyTwoBytes_1_1CVecTempl_1TxOut_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut *vec = (LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut*)ptr; return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut)); } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1ThirtyTwoBytes_1_1CVecTempl_1TxOut_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut *ret = MALLOC(sizeof(LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut), "LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = malloc(sizeof(LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut) * ret->datalen); // often freed by rust directly + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut arr_elem_conv = *(LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut*)arr_elem; + FREE((void*)arr_elem); + ret->data[i] = arr_elem_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; +} typedef struct LDKKeysInterface_JCalls { atomic_size_t refcnt; JavaVM *vm; @@ -2153,6 +2430,25 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1ChannelDetail LDKCVecTempl_ChannelDetails *vec = (LDKCVecTempl_ChannelDetails*)ptr; return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKChannelDetails)); } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1ChannelDetails_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVecTempl_ChannelDetails *ret = MALLOC(sizeof(LDKCVecTempl_ChannelDetails), "LDKCVecTempl_ChannelDetails"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = malloc(sizeof(LDKChannelDetails) * ret->datalen); // often freed by rust directly + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKChannelDetails arr_elem_conv = *(LDKChannelDetails*)arr_elem; + FREE((void*)arr_elem); + arr_elem_conv.is_owned = true; + ret->data[i] = arr_elem_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; +} JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRoute_1optional_1none (JNIEnv * env, jclass _a) { LDKRoute *ret = MALLOC(sizeof(LDKRoute), "LDKRoute"); ret->inner = NULL; @@ -2215,6 +2511,24 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1NetAddress_1a LDKCVecTempl_NetAddress *vec = (LDKCVecTempl_NetAddress*)ptr; return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKNetAddress)); } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1NetAddress_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVecTempl_NetAddress *ret = MALLOC(sizeof(LDKCVecTempl_NetAddress), "LDKCVecTempl_NetAddress"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = malloc(sizeof(LDKNetAddress) * ret->datalen); // often freed by rust directly + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKNetAddress arr_elem_conv = *(LDKNetAddress*)arr_elem; + FREE((void*)arr_elem); + ret->data[i] = arr_elem_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; +} JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKUpdateAddHTLC_1optional_1none (JNIEnv * env, jclass _a) { LDKUpdateAddHTLC *ret = MALLOC(sizeof(LDKUpdateAddHTLC), "LDKUpdateAddHTLC"); ret->inner = NULL; @@ -2672,6 +2986,25 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1ChannelMonito LDKCVecTempl_ChannelMonitor *vec = (LDKCVecTempl_ChannelMonitor*)ptr; return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKChannelMonitor)); } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1ChannelMonitor_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVecTempl_ChannelMonitor *ret = MALLOC(sizeof(LDKCVecTempl_ChannelMonitor), "LDKCVecTempl_ChannelMonitor"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = malloc(sizeof(LDKChannelMonitor) * ret->datalen); // often freed by rust directly + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKChannelMonitor arr_elem_conv = *(LDKChannelMonitor*)arr_elem; + FREE((void*)arr_elem); + arr_elem_conv.is_owned = true; + ret->data[i] = arr_elem_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; +} JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKDecodeError_1optional_1none (JNIEnv * env, jclass _a) { LDKDecodeError *ret = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); ret->inner = NULL; @@ -2726,6 +3059,21 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1u64_1arr_1inf LDKCVecTempl_u64 *vec = (LDKCVecTempl_u64*)ptr; return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(uint64_t)); } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1u64_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVecTempl_u64 *ret = MALLOC(sizeof(LDKCVecTempl_u64), "LDKCVecTempl_u64"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = malloc(sizeof(uint64_t) * ret->datalen); // often freed by rust directly + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + ret->data[i] = java_elems[i]; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; +} JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKQueryShortChannelIds_1optional_1none (JNIEnv * env, jclass _a) { LDKQueryShortChannelIds *ret = MALLOC(sizeof(LDKQueryShortChannelIds), "LDKQueryShortChannelIds"); ret->inner = NULL; @@ -2750,18 +3098,94 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateAddHTLC LDKCVecTempl_UpdateAddHTLC *vec = (LDKCVecTempl_UpdateAddHTLC*)ptr; return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKUpdateAddHTLC)); } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateAddHTLC_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVecTempl_UpdateAddHTLC *ret = MALLOC(sizeof(LDKCVecTempl_UpdateAddHTLC), "LDKCVecTempl_UpdateAddHTLC"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = malloc(sizeof(LDKUpdateAddHTLC) * ret->datalen); // often freed by rust directly + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKUpdateAddHTLC arr_elem_conv = *(LDKUpdateAddHTLC*)arr_elem; + FREE((void*)arr_elem); + arr_elem_conv.is_owned = true; + ret->data[i] = arr_elem_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; +} JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFulfillHTLC_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { LDKCVecTempl_UpdateFulfillHTLC *vec = (LDKCVecTempl_UpdateFulfillHTLC*)ptr; return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKUpdateFulfillHTLC)); } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFulfillHTLC_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVecTempl_UpdateFulfillHTLC *ret = MALLOC(sizeof(LDKCVecTempl_UpdateFulfillHTLC), "LDKCVecTempl_UpdateFulfillHTLC"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = malloc(sizeof(LDKUpdateFulfillHTLC) * ret->datalen); // often freed by rust directly + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKUpdateFulfillHTLC arr_elem_conv = *(LDKUpdateFulfillHTLC*)arr_elem; + FREE((void*)arr_elem); + arr_elem_conv.is_owned = true; + ret->data[i] = arr_elem_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; +} JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFailHTLC_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { LDKCVecTempl_UpdateFailHTLC *vec = (LDKCVecTempl_UpdateFailHTLC*)ptr; return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKUpdateFailHTLC)); } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFailHTLC_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVecTempl_UpdateFailHTLC *ret = MALLOC(sizeof(LDKCVecTempl_UpdateFailHTLC), "LDKCVecTempl_UpdateFailHTLC"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = malloc(sizeof(LDKUpdateFailHTLC) * ret->datalen); // often freed by rust directly + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKUpdateFailHTLC arr_elem_conv = *(LDKUpdateFailHTLC*)arr_elem; + FREE((void*)arr_elem); + arr_elem_conv.is_owned = true; + ret->data[i] = arr_elem_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; +} JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFailMalformedHTLC_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { LDKCVecTempl_UpdateFailMalformedHTLC *vec = (LDKCVecTempl_UpdateFailMalformedHTLC*)ptr; return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKUpdateFailMalformedHTLC)); } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFailMalformedHTLC_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVecTempl_UpdateFailMalformedHTLC *ret = MALLOC(sizeof(LDKCVecTempl_UpdateFailMalformedHTLC), "LDKCVecTempl_UpdateFailMalformedHTLC"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = malloc(sizeof(LDKUpdateFailMalformedHTLC) * ret->datalen); // often freed by rust directly + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKUpdateFailMalformedHTLC arr_elem_conv = *(LDKUpdateFailMalformedHTLC*)arr_elem; + FREE((void*)arr_elem); + arr_elem_conv.is_owned = true; + ret->data[i] = arr_elem_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; +} JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { return ((LDKCResult_boolLightningErrorZ*)arg)->result_ok; } @@ -2776,10 +3200,47 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C3TupleTempl_ LDKCVecTempl_C3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate *vec = (LDKCVecTempl_C3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate*)ptr; return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate)); } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C3TupleTempl_1ChannelAnnouncement_1_1ChannelUpdate_1_1ChannelUpdate_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVecTempl_C3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate *ret = MALLOC(sizeof(LDKCVecTempl_C3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate), "LDKCVecTempl_C3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = malloc(sizeof(LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate) * ret->datalen); // often freed by rust directly + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate arr_elem_conv = *(LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate*)arr_elem; + FREE((void*)arr_elem); + ret->data[i] = arr_elem_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; +} JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1NodeAnnouncement_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { LDKCVecTempl_NodeAnnouncement *vec = (LDKCVecTempl_NodeAnnouncement*)ptr; return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKNodeAnnouncement)); } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1NodeAnnouncement_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVecTempl_NodeAnnouncement *ret = MALLOC(sizeof(LDKCVecTempl_NodeAnnouncement), "LDKCVecTempl_NodeAnnouncement"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = malloc(sizeof(LDKNodeAnnouncement) * ret->datalen); // often freed by rust directly + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKNodeAnnouncement arr_elem_conv = *(LDKNodeAnnouncement*)arr_elem; + FREE((void*)arr_elem); + arr_elem_conv.is_owned = true; + ret->data[i] = arr_elem_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; +} typedef struct LDKRoutingMessageHandler_JCalls { atomic_size_t refcnt; JavaVM *vm; @@ -3074,6 +3535,24 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1PublicKey_1ar LDKCVecTempl_PublicKey *vec = (LDKCVecTempl_PublicKey*)ptr; return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKPublicKey)); } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1PublicKey_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVecTempl_PublicKey *ret = MALLOC(sizeof(LDKCVecTempl_PublicKey), "LDKCVecTempl_PublicKey"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = malloc(sizeof(LDKPublicKey) * ret->datalen); // often freed by rust directly + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKPublicKey arr_elem_conv = *(LDKPublicKey*)arr_elem; + FREE((void*)arr_elem); + ret->data[i] = arr_elem_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; +} JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { return ((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->result_ok; } @@ -3133,6 +3612,24 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_ LDKCVecTempl_C2TupleTempl_HTLCOutputInCommitment__Signature *vec = (LDKCVecTempl_C2TupleTempl_HTLCOutputInCommitment__Signature*)ptr; return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKC2TupleTempl_HTLCOutputInCommitment__Signature)); } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1HTLCOutputInCommitment_1_1Signature_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVecTempl_C2TupleTempl_HTLCOutputInCommitment__Signature *ret = MALLOC(sizeof(LDKCVecTempl_C2TupleTempl_HTLCOutputInCommitment__Signature), "LDKCVecTempl_C2TupleTempl_HTLCOutputInCommitment__Signature"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = malloc(sizeof(LDKC2TupleTempl_HTLCOutputInCommitment__Signature) * ret->datalen); // often freed by rust directly + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKC2TupleTempl_HTLCOutputInCommitment__Signature arr_elem_conv = *(LDKC2TupleTempl_HTLCOutputInCommitment__Signature*)arr_elem; + FREE((void*)arr_elem); + ret->data[i] = arr_elem_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; +} JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRouteHop_1optional_1none (JNIEnv * env, jclass _a) { LDKRouteHop *ret = MALLOC(sizeof(LDKRouteHop), "LDKRouteHop"); ret->inner = NULL; @@ -3142,10 +3639,47 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1RouteHop_1arr LDKCVecTempl_RouteHop *vec = (LDKCVecTempl_RouteHop*)ptr; return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKRouteHop)); } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1RouteHop_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVecTempl_RouteHop *ret = MALLOC(sizeof(LDKCVecTempl_RouteHop), "LDKCVecTempl_RouteHop"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = malloc(sizeof(LDKRouteHop) * ret->datalen); // often freed by rust directly + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKRouteHop arr_elem_conv = *(LDKRouteHop*)arr_elem; + FREE((void*)arr_elem); + arr_elem_conv.is_owned = true; + ret->data[i] = arr_elem_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; +} JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1CVecTempl_1RouteHop_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { LDKCVecTempl_CVecTempl_RouteHop *vec = (LDKCVecTempl_CVecTempl_RouteHop*)ptr; return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKCVecTempl_RouteHop)); } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1CVecTempl_1RouteHop_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVecTempl_CVecTempl_RouteHop *ret = MALLOC(sizeof(LDKCVecTempl_CVecTempl_RouteHop), "LDKCVecTempl_CVecTempl_RouteHop"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = malloc(sizeof(LDKCVecTempl_RouteHop) * ret->datalen); // often freed by rust directly + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKCVecTempl_RouteHop arr_elem_conv = *(LDKCVecTempl_RouteHop*)arr_elem; + FREE((void*)arr_elem); + ret->data[i] = arr_elem_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; +} JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRouteHint_1optional_1none (JNIEnv * env, jclass _a) { LDKRouteHint *ret = MALLOC(sizeof(LDKRouteHint), "LDKRouteHint"); ret->inner = NULL; @@ -3175,6 +3709,25 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1RouteHint_1ar LDKCVecTempl_RouteHint *vec = (LDKCVecTempl_RouteHint*)ptr; return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKRouteHint)); } +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1RouteHint_1new(JNIEnv *env, jclass _b, jlongArray elems){ + LDKCVecTempl_RouteHint *ret = MALLOC(sizeof(LDKCVecTempl_RouteHint), "LDKCVecTempl_RouteHint"); + ret->datalen = (*env)->GetArrayLength(env, elems); + if (ret->datalen == 0) { + ret->data = NULL; + } else { + ret->data = malloc(sizeof(LDKRouteHint) * ret->datalen); // often freed by rust directly + jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL); + for (size_t i = 0; i < ret->datalen; i++) { + jlong arr_elem = java_elems[i]; + LDKRouteHint arr_elem_conv = *(LDKRouteHint*)arr_elem; + FREE((void*)arr_elem); + arr_elem_conv.is_owned = true; + ret->data[i] = arr_elem_conv; + } + (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0); + } + return (long)ret; +} JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKLockedNetworkGraph_1optional_1none (JNIEnv * env, jclass _a) { LDKLockedNetworkGraph *ret = MALLOC(sizeof(LDKLockedNetworkGraph), "LDKLockedNetworkGraph"); ret->inner = NULL; diff --git a/src/main/jni/org_ldk_impl_bindings.h b/src/main/jni/org_ldk_impl_bindings.h index 951b34b9..2ecf5b63 100644 --- a/src/main/jni/org_ldk_impl_bindings.h +++ b/src/main/jni/org_ldk_impl_bindings.h @@ -63,6 +63,14 @@ JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_get_1u8_1slice_1bytes JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_bytes_1to_1u8_1vec (JNIEnv *, jclass, jbyteArray); +/* + * Class: org_ldk_impl_bindings + * Method: new_txpointer_copy_data + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_new_1txpointer_1copy_1data + (JNIEnv *, jclass, jbyteArray); + /* * Class: org_ldk_impl_bindings * Method: vec_slice_len @@ -95,6 +103,22 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKSecretKey_1new JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1u8_1arr_1info (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKCVecTempl_u8_new + * Signature: ([B)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1u8_1new + (JNIEnv *, jclass, jbyteArray); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKC2TupleTempl_usize__Transaction_new + * Signature: (JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2TupleTempl_1usize_1_1Transaction_1new + (JNIEnv *, jclass, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: LDKCResult_NoneChannelMonitorUpdateErrZ_result_ok @@ -143,6 +167,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdate JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKOutPoint_1optional_1none (JNIEnv *, jclass); +/* + * Class: org_ldk_impl_bindings + * Method: LDKC2TupleTempl_OutPoint__CVec_u8Z_new + * Signature: (JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2TupleTempl_1OutPoint_1_1CVec_1u8Z_1new + (JNIEnv *, jclass, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: LDKCVecTempl_TxOut_arr_info @@ -151,6 +183,30 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKOutPoint_1optional_1none JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1TxOut_1arr_1info (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKCVecTempl_TxOut_new + * Signature: ([J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1TxOut_1new + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut_new + * Signature: ([BJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2TupleTempl_1ThirtyTwoBytes_1_1CVecTempl_1TxOut_1new + (JNIEnv *, jclass, jbyteArray, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKC2TupleTempl_u64__u64_new + * Signature: (JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2TupleTempl_1u64_1_1u64_1new + (JNIEnv *, jclass, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: LDKCVecTempl_Signature_arr_info @@ -159,6 +215,22 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1TxOut_1arr_1i JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Signature_1arr_1info (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKCVecTempl_Signature_new + * Signature: ([J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Signature_1new + (JNIEnv *, jclass, jlongArray); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKC2TupleTempl_Signature__CVecTempl_Signature_new + * Signature: (JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2TupleTempl_1Signature_1_1CVecTempl_1Signature_1new + (JNIEnv *, jclass, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_result_ok @@ -271,6 +343,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelAnnouncement_1optio JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelUpdate_1optional_1none (JNIEnv *, jclass); +/* + * Class: org_ldk_impl_bindings + * Method: LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate_new + * Signature: (JJJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC3TupleTempl_1ChannelAnnouncement_1_1ChannelUpdate_1_1ChannelUpdate_1new + (JNIEnv *, jclass, jlong, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: LDKPeerHandleError_optional_none @@ -303,6 +383,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErr JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKHTLCOutputInCommitment_1optional_1none (JNIEnv *, jclass); +/* + * Class: org_ldk_impl_bindings + * Method: LDKC2TupleTempl_HTLCOutputInCommitment__Signature_new + * Signature: (JJ)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2TupleTempl_1HTLCOutputInCommitment_1_1Signature_1new + (JNIEnv *, jclass, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: LDKSpendableOutputDescriptor_ref_from_ptr @@ -319,6 +407,14 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSpendableOutputDescripto JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1SpendableOutputDescriptor_1arr_1info (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKCVecTempl_SpendableOutputDescriptor_new + * Signature: ([J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1SpendableOutputDescriptor_1new + (JNIEnv *, jclass, jlongArray); + /* * Class: org_ldk_impl_bindings * Method: LDKEvent_ref_from_ptr @@ -463,6 +559,14 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1f JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1MessageSendEvent_1arr_1info (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKCVecTempl_MessageSendEvent_new + * Signature: ([J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1MessageSendEvent_1new + (JNIEnv *, jclass, jlongArray); + /* * Class: org_ldk_impl_bindings * Method: LDKMessageSendEventsProvider_new @@ -495,6 +599,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Event_1arr_1info (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKCVecTempl_Event_new + * Signature: ([J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Event_1new + (JNIEnv *, jclass, jlongArray); + /* * Class: org_ldk_impl_bindings * Method: LDKEventsProvider_new @@ -631,6 +743,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKPreCalculatedTxCreationKey JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1HTLCOutputInCommitment_1arr_1info (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKCVecTempl_HTLCOutputInCommitment_new + * Signature: ([J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1HTLCOutputInCommitment_1new + (JNIEnv *, jclass, jlongArray); + /* * Class: org_ldk_impl_bindings * Method: LDKHolderCommitmentTransaction_optional_none @@ -783,6 +903,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1optional_1no JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1MonitorEvent_1arr_1info (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKCVecTempl_MonitorEvent_new + * Signature: ([J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1MonitorEvent_1new + (JNIEnv *, jclass, jlongArray); + /* * Class: org_ldk_impl_bindings * Method: LDKWatch_new @@ -919,6 +1047,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChainMonitor_1optional_1no JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1usize_1_1Transaction_1arr_1info (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKCVecTempl_C2TupleTempl_usize__Transaction_new + * Signature: ([J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1usize_1_1Transaction_1new + (JNIEnv *, jclass, jlongArray); + /* * Class: org_ldk_impl_bindings * Method: LDKHTLCUpdate_optional_none @@ -935,6 +1071,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKHTLCUpdate_1optional_1none JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Transaction_1arr_1info (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKCVecTempl_Transaction_new + * Signature: ([J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Transaction_1new + (JNIEnv *, jclass, jlongArray); + /* * Class: org_ldk_impl_bindings * Method: LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut_arr_info @@ -943,6 +1087,14 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Transaction_1 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1ThirtyTwoBytes_1_1CVecTempl_1TxOut_1arr_1info (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut_new + * Signature: ([J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1ThirtyTwoBytes_1_1CVecTempl_1TxOut_1new + (JNIEnv *, jclass, jlongArray); + /* * Class: org_ldk_impl_bindings * Method: LDKKeysInterface_new @@ -1047,6 +1199,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKInitFeatures_1optional_1no JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1ChannelDetails_1arr_1info (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKCVecTempl_ChannelDetails_new + * Signature: ([J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1ChannelDetails_1new + (JNIEnv *, jclass, jlongArray); + /* * Class: org_ldk_impl_bindings * Method: LDKRoute_optional_none @@ -1071,6 +1231,14 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetAddress_1ref_1from_1p JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1NetAddress_1arr_1info (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKCVecTempl_NetAddress_new + * Signature: ([J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1NetAddress_1new + (JNIEnv *, jclass, jlongArray); + /* * Class: org_ldk_impl_bindings * Method: LDKUpdateAddHTLC_optional_none @@ -1311,6 +1479,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelManagerReadArgs_1op JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1ChannelMonitor_1arr_1info (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKCVecTempl_ChannelMonitor_new + * Signature: ([J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1ChannelMonitor_1new + (JNIEnv *, jclass, jlongArray); + /* * Class: org_ldk_impl_bindings * Method: LDKDecodeError_optional_none @@ -1399,6 +1575,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKReplyChannelRange_1optiona JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1u64_1arr_1info (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKCVecTempl_u64_new + * Signature: ([J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1u64_1new + (JNIEnv *, jclass, jlongArray); + /* * Class: org_ldk_impl_bindings * Method: LDKQueryShortChannelIds_optional_none @@ -1439,6 +1623,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKLightningError_1optional_1 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateAddHTLC_1arr_1info (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKCVecTempl_UpdateAddHTLC_new + * Signature: ([J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateAddHTLC_1new + (JNIEnv *, jclass, jlongArray); + /* * Class: org_ldk_impl_bindings * Method: LDKCVecTempl_UpdateFulfillHTLC_arr_info @@ -1447,6 +1639,14 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateAddHTLC JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFulfillHTLC_1arr_1info (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKCVecTempl_UpdateFulfillHTLC_new + * Signature: ([J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFulfillHTLC_1new + (JNIEnv *, jclass, jlongArray); + /* * Class: org_ldk_impl_bindings * Method: LDKCVecTempl_UpdateFailHTLC_arr_info @@ -1455,6 +1655,14 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFulfill JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFailHTLC_1arr_1info (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKCVecTempl_UpdateFailHTLC_new + * Signature: ([J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFailHTLC_1new + (JNIEnv *, jclass, jlongArray); + /* * Class: org_ldk_impl_bindings * Method: LDKCVecTempl_UpdateFailMalformedHTLC_arr_info @@ -1463,6 +1671,14 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFailHTL JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFailMalformedHTLC_1arr_1info (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKCVecTempl_UpdateFailMalformedHTLC_new + * Signature: ([J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFailMalformedHTLC_1new + (JNIEnv *, jclass, jlongArray); + /* * Class: org_ldk_impl_bindings * Method: LDKCResult_boolLightningErrorZ_result_ok @@ -1487,6 +1703,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErro JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C3TupleTempl_1ChannelAnnouncement_1_1ChannelUpdate_1_1ChannelUpdate_1arr_1info (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKCVecTempl_C3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate_new + * Signature: ([J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C3TupleTempl_1ChannelAnnouncement_1_1ChannelUpdate_1_1ChannelUpdate_1new + (JNIEnv *, jclass, jlongArray); + /* * Class: org_ldk_impl_bindings * Method: LDKCVecTempl_NodeAnnouncement_arr_info @@ -1495,6 +1719,14 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C3TupleTempl_ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1NodeAnnouncement_1arr_1info (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKCVecTempl_NodeAnnouncement_new + * Signature: ([J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1NodeAnnouncement_1new + (JNIEnv *, jclass, jlongArray); + /* * Class: org_ldk_impl_bindings * Method: LDKRoutingMessageHandler_new @@ -1631,6 +1863,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKPeerManager_1optional_1non JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1PublicKey_1arr_1info (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKCVecTempl_PublicKey_new + * Signature: ([J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1PublicKey_1new + (JNIEnv *, jclass, jlongArray); + /* * Class: org_ldk_impl_bindings * Method: LDKCResult_CVec_u8ZPeerHandleErrorZ_result_ok @@ -1727,6 +1967,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysSec JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1HTLCOutputInCommitment_1_1Signature_1arr_1info (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKCVecTempl_C2TupleTempl_HTLCOutputInCommitment__Signature_new + * Signature: ([J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1HTLCOutputInCommitment_1_1Signature_1new + (JNIEnv *, jclass, jlongArray); + /* * Class: org_ldk_impl_bindings * Method: LDKRouteHop_optional_none @@ -1743,6 +1991,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRouteHop_1optional_1none JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1RouteHop_1arr_1info (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKCVecTempl_RouteHop_new + * Signature: ([J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1RouteHop_1new + (JNIEnv *, jclass, jlongArray); + /* * Class: org_ldk_impl_bindings * Method: LDKCVecTempl_CVecTempl_RouteHop_arr_info @@ -1751,6 +2007,14 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1RouteHop_1arr JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1CVecTempl_1RouteHop_1arr_1info (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKCVecTempl_CVecTempl_RouteHop_new + * Signature: ([J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1CVecTempl_1RouteHop_1new + (JNIEnv *, jclass, jlongArray); + /* * Class: org_ldk_impl_bindings * Method: LDKRouteHint_optional_none @@ -1799,6 +2063,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKNetworkGraph_1optional_1no JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1RouteHint_1arr_1info (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKCVecTempl_RouteHint_new + * Signature: ([J)J + */ +JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1RouteHint_1new + (JNIEnv *, jclass, jlongArray); + /* * Class: org_ldk_impl_bindings * Method: LDKLockedNetworkGraph_optional_none