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,
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,
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")
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();
(*_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");
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:
is_unitary_enum = False
is_union_enum = False
is_union = False
+ is_tuple = False
trait_fn_lines = []
field_var_lines = []
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":
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)
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]
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);
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 {
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 {
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();
}
// 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();
}
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 {
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);
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();
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() {}
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();
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();
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);
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);
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();
(*_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");
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;
}
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;
}
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
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;
}
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;
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;
}
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;
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;
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;
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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