From: Matt Corallo Date: Thu, 8 Oct 2020 02:10:11 +0000 (-0400) Subject: Map Rust enums with inner fields X-Git-Tag: v0.0.1~126 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=dab177785e966c5e9434d28a2be54ba69bc62739;p=ldk-java Map Rust enums with inner fields --- diff --git a/genbindings.py b/genbindings.py index ab1df820..be317e8f 100755 --- a/genbindings.py +++ b/genbindings.py @@ -48,6 +48,32 @@ with open(sys.argv[1]) as in_h, open(sys.argv[2], "w") as out_java, open(sys.arg trait_structs = set() unitary_enums = set() + def camel_to_snake(s): + # Convert camel case to snake case, in a way that appears to match cbindgen + con = "_" + ret = "" + lastchar = "" + lastund = False + for char in s: + if lastchar.isupper(): + if not char.isupper() and not lastund: + ret = ret + "_" + lastund = True + else: + lastund = False + ret = ret + lastchar.lower() + else: + ret = ret + lastchar + if char.isupper() and not lastund: + ret = ret + "_" + lastund = True + else: + lastund = False + lastchar = char + if char.isnumeric(): + lastund = True + return (ret + lastchar.lower()).strip("_") + var_is_arr_regex = re.compile("\(\*([A-za-z_]*)\)\[([0-9]*)\]") var_ty_regex = re.compile("([A-za-z_0-9]*)(.*)") def java_c_types(fn_arg, ret_arr_len): @@ -548,6 +574,7 @@ public class bindings { public static native boolean deref_bool(long ptr); public static native long deref_long(long ptr); public static native void free_heap_ptr(long ptr); + public static native byte[] read_bytes(long ptr, long len); public static native byte[] get_u8_slice_bytes(long slice_ptr); public static native long bytes_to_u8_vec(byte[] bytes); public static native long vec_slice_len(long vec); @@ -576,6 +603,11 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_deref_1long (JNIEnv * env, jc JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_free_1heap_1ptr (JNIEnv * env, jclass _a, jlong ptr) { FREE((void*)ptr); } +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_read_1bytes (JNIEnv * _env, jclass _b, jlong ptr, jlong len) { + jbyteArray ret_arr = (*_env)->NewByteArray(_env, len); + (*_env)->SetByteArrayRegion(_env, ret_arr, 0, len, (unsigned char*)ptr); + return ret_arr; +} JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_get_1u8_1slice_1bytes (JNIEnv * _env, jclass _b, jlong slice_ptr) { LDKu8slice *slice = (LDKu8slice*)slice_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, slice->datalen); @@ -648,6 +680,7 @@ _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKu8slice, datalen), assert(struct_alias_regex.match("typedef LDKCResultTempl_bool__PeerHandleError LDKCResult_boolPeerHandleErrorZ;")) result_templ_structs = set() + union_enum_items = {} for line in in_h: if in_block_comment: #out_java.write("\t" + line) @@ -708,6 +741,7 @@ _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKu8slice, datalen), assert(not is_union or not (len(trait_fn_lines) != 0 or is_unitary_enum or is_union_enum or is_opaque or is_result or vec_ty is not None)) assert(not is_result or not (len(trait_fn_lines) != 0 or is_unitary_enum or is_union_enum or is_opaque or is_union or vec_ty is not None)) assert(vec_ty is None or not (len(trait_fn_lines) != 0 or is_unitary_enum or is_union_enum or is_opaque or is_union or is_result)) + if is_opaque: opaque_structs.add(struct_name) out_java.write("\tpublic static native long " + struct_name + "_optional_none();\n") @@ -724,6 +758,89 @@ _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKu8slice, datalen), 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") + elif is_union_enum: + assert(struct_name.endswith("_Tag")) + struct_name = struct_name[:-4] + union_enum_items[struct_name] = {"field_lines": field_lines} + elif struct_name.endswith("_Body") and struct_name.split("_")[0] in union_enum_items: + enum_var_name = struct_name.split("_") + union_enum_items[enum_var_name[0]][enum_var_name[1]] = field_lines + elif struct_name in union_enum_items: + tag_field_lines = union_enum_items[struct_name]["field_lines"] + init_meth_jty_strs = {} + for idx, struct_line in enumerate(tag_field_lines): + if idx == 0: + out_java.write("\tpublic static class " + struct_name + " {\n") + out_java.write("\t\tprivate " + struct_name + "() {}\n") + elif idx == len(tag_field_lines) - 3: + assert(struct_line.endswith("_Sentinel,")) + elif idx == len(tag_field_lines) - 2: + out_java.write("\t\tstatic native void init();\n") + out_java.write("\t}\n") + elif idx == len(tag_field_lines) - 1: + assert(struct_line == "") + else: + var_name = struct_line.strip(' ,')[len(struct_name) + 1:] + out_java.write("\t\tpublic final static class " + var_name + " extends " + struct_name + " {\n") + out_c.write("jclass " + struct_name + "_" + var_name + "_class = NULL;\n") + out_c.write("jmethodID " + struct_name + "_" + var_name + "_meth = NULL;\n") + init_meth_jty_str = "" + init_meth_params = "" + init_meth_body = "" + if "LDK" + var_name in union_enum_items[struct_name]: + enum_var_lines = union_enum_items[struct_name]["LDK" + var_name] + for idx, field in enumerate(enum_var_lines): + if idx != 0 and idx < len(enum_var_lines) - 2: + field_ty = java_c_types(field.strip(' ;'), None) + out_java.write("\t\t\tpublic " + field_ty.java_ty + " " + field_ty.var_name + ";\n") + init_meth_jty_str = init_meth_jty_str + field_ty.java_fn_ty_arg + if idx > 1: + init_meth_params = init_meth_params + ", " + init_meth_params = init_meth_params + field_ty.java_ty + " " + field_ty.var_name + init_meth_body = init_meth_body + "this." + field_ty.var_name + " = " + field_ty.var_name + "; " + out_java.write("\t\t\t" + var_name + "(" + init_meth_params + ") { ") + out_java.write(init_meth_body) + out_java.write("}\n") + out_java.write("\t\t}\n") + init_meth_jty_strs[var_name] = init_meth_jty_str + out_java.write("\tstatic { " + struct_name + ".init(); }\n") + out_java.write("\tpublic static native " + struct_name + " " + struct_name + "_ref_from_ptr(long ptr);\n"); + + out_c.write("JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024" + struct_name.replace("_", "_1") + "_init (JNIEnv * env, jclass _a) {\n") + for idx, struct_line in enumerate(tag_field_lines): + if idx != 0 and idx < len(tag_field_lines) - 3: + var_name = struct_line.strip(' ,')[len(struct_name) + 1:] + out_c.write("\t" + struct_name + "_" + var_name + "_class =\n") + out_c.write("\t\t(*env)->NewGlobalRef(env, (*env)->FindClass(env, \"Lorg/ldk/impl/bindings$" + struct_name + "$" + var_name + ";\"));\n") + out_c.write("\tDO_ASSERT(" + struct_name + "_" + var_name + "_class != NULL);\n") + out_c.write("\t" + struct_name + "_" + var_name + "_meth = (*env)->GetMethodID(env, " + struct_name + "_" + var_name + "_class, \"\", \"(" + init_meth_jty_strs[var_name] + ")V\");\n") + out_c.write("\tDO_ASSERT(" + struct_name + "_" + var_name + "_meth != NULL);\n") + out_c.write("}\n") + out_c.write("JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_" + struct_name.replace("_", "_1") + "_1ref_1from_1ptr (JNIEnv * env, jclass _c, jlong ptr) {\n") + out_c.write("\t" + struct_name + " *obj = (" + struct_name + "*)ptr;\n") + out_c.write("\tswitch(obj->tag) {\n") + for idx, struct_line in enumerate(tag_field_lines): + if idx != 0 and idx < len(tag_field_lines) - 3: + var_name = struct_line.strip(' ,')[len(struct_name) + 1:] + out_c.write("\t\tcase " + struct_name + "_" + var_name + ":\n") + out_c.write("\t\t\treturn (*env)->NewObject(env, " + struct_name + "_" + var_name + "_class, " + struct_name + "_" + var_name + "_meth") + if "LDK" + var_name in union_enum_items[struct_name]: + enum_var_lines = union_enum_items[struct_name]["LDK" + var_name] + out_c.write(",\n\t\t\t\t") + for idx, field in enumerate(enum_var_lines): + if idx != 0 and idx < len(enum_var_lines) - 2: + field_ty = java_c_types(field.strip(' ;'), None) + if idx >= 2: + out_c.write(", ") + if field_ty.is_ptr: + out_c.write("(long)") + elif field_ty.passed_as_ptr or field_ty.arr_len is not None: + out_c.write("(long)&") + out_c.write("obj->" + camel_to_snake(var_name) + "." + field_ty.var_name) + out_c.write("\n\t\t\t") + out_c.write(");\n") + out_c.write("\t\tdefault: abort();\n") + out_c.write("\t}\n}\n") elif is_unitary_enum: with open(sys.argv[3] + "/" + struct_name + ".java", "w") as out_java_enum: out_java_enum.write("package org.ldk.enums;\n\n") @@ -771,7 +888,7 @@ _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKu8slice, datalen), for idx, struct_line in enumerate(field_lines): if idx > 0 and idx < len(field_lines) - 3: variant = struct_line.strip().strip(",") - out_c.write("\t\tcase " + variant + ": \n") + out_c.write("\t\tcase " + variant + ":\n") out_c.write("\t\t\treturn (*env)->GetStaticObjectField(env, " + struct_name + "_class, " + struct_name + "_" + variant + ");\n") ord_v = ord_v + 1 out_c.write("\t\tdefault: abort();\n") diff --git a/src/main/java/org/ldk/impl/bindings.java b/src/main/java/org/ldk/impl/bindings.java index e153db6d..995a03e0 100644 --- a/src/main/java/org/ldk/impl/bindings.java +++ b/src/main/java/org/ldk/impl/bindings.java @@ -19,6 +19,7 @@ public class bindings { public static native boolean deref_bool(long ptr); public static native long deref_long(long ptr); public static native void free_heap_ptr(long ptr); + public static native byte[] read_bytes(long ptr, long len); public static native byte[] get_u8_slice_bytes(long slice_ptr); public static native long bytes_to_u8_vec(byte[] bytes); public static native long vec_slice_len(long vec); @@ -47,6 +48,31 @@ public class bindings { public static native long LDKCResult_SignatureNoneZ_get_inner(long arg); public static native boolean LDKCResult_CVec_SignatureZNoneZ_result_ok(long arg); public static native long LDKCResult_CVec_SignatureZNoneZ_get_inner(long arg); + public static class LDKAPIError { + private LDKAPIError() {} + public final static class APIMisuseError extends LDKAPIError { + public long err; + APIMisuseError(long err) { this.err = err; } + } + public final static class FeeRateTooHigh extends LDKAPIError { + public long err; + public int feerate; + FeeRateTooHigh(long err, int feerate) { this.err = err; this.feerate = feerate; } + } + public final static class RouteError extends LDKAPIError { + public long err; + RouteError(long err) { this.err = err; } + } + public final static class ChannelUnavailable extends LDKAPIError { + public long err; + ChannelUnavailable(long err) { this.err = err; } + } + public final static class MonitorUpdateFailed extends LDKAPIError { + } + static native void init(); + } + static { LDKAPIError.init(); } + public static native LDKAPIError LDKAPIError_ref_from_ptr(long ptr); public static native boolean LDKCResult_NoneAPIErrorZ_result_ok(long arg); public static native long LDKCResult_NoneAPIErrorZ_get_inner(long arg); public static native long LDKPaymentSendFailure_optional_none(); @@ -58,7 +84,74 @@ public class bindings { 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 class LDKSpendableOutputDescriptor { + private LDKSpendableOutputDescriptor() {} + public final static class StaticOutput extends LDKSpendableOutputDescriptor { + public long outpoint; + public long output; + StaticOutput(long outpoint, long output) { this.outpoint = outpoint; this.output = output; } + } + public final static class DynamicOutputP2WSH extends LDKSpendableOutputDescriptor { + public long outpoint; + public long per_commitment_point; + public short to_self_delay; + public long output; + public long key_derivation_params; + public long revocation_pubkey; + DynamicOutputP2WSH(long outpoint, long per_commitment_point, short to_self_delay, long output, long key_derivation_params, long revocation_pubkey) { this.outpoint = outpoint; this.per_commitment_point = per_commitment_point; this.to_self_delay = to_self_delay; this.output = output; this.key_derivation_params = key_derivation_params; this.revocation_pubkey = revocation_pubkey; } + } + public final static class StaticOutputCounterpartyPayment extends LDKSpendableOutputDescriptor { + public long outpoint; + public long output; + public long key_derivation_params; + StaticOutputCounterpartyPayment(long outpoint, long output, long key_derivation_params) { this.outpoint = outpoint; this.output = output; this.key_derivation_params = key_derivation_params; } + } + static native void init(); + } + static { LDKSpendableOutputDescriptor.init(); } + public static native LDKSpendableOutputDescriptor LDKSpendableOutputDescriptor_ref_from_ptr(long ptr); public static native VecOrSliceDef LDKCVecTempl_SpendableOutputDescriptor_arr_info(long vec_ptr); + public static class LDKEvent { + private LDKEvent() {} + public final static class FundingGenerationReady extends LDKEvent { + public long temporary_channel_id; + public long channel_value_satoshis; + public long output_script; + public long user_channel_id; + FundingGenerationReady(long temporary_channel_id, long channel_value_satoshis, long output_script, long user_channel_id) { this.temporary_channel_id = temporary_channel_id; this.channel_value_satoshis = channel_value_satoshis; this.output_script = output_script; this.user_channel_id = user_channel_id; } + } + public final static class FundingBroadcastSafe extends LDKEvent { + public long funding_txo; + public long user_channel_id; + FundingBroadcastSafe(long funding_txo, long user_channel_id) { this.funding_txo = funding_txo; this.user_channel_id = user_channel_id; } + } + public final static class PaymentReceived extends LDKEvent { + public long payment_hash; + public long payment_secret; + public long amt; + PaymentReceived(long payment_hash, long payment_secret, long amt) { this.payment_hash = payment_hash; this.payment_secret = payment_secret; this.amt = amt; } + } + public final static class PaymentSent extends LDKEvent { + public long payment_preimage; + PaymentSent(long payment_preimage) { this.payment_preimage = payment_preimage; } + } + public final static class PaymentFailed extends LDKEvent { + public long payment_hash; + public boolean rejected_by_dest; + PaymentFailed(long payment_hash, boolean rejected_by_dest) { this.payment_hash = payment_hash; this.rejected_by_dest = rejected_by_dest; } + } + public final static class PendingHTLCsForwardable extends LDKEvent { + public long time_forwardable; + PendingHTLCsForwardable(long time_forwardable) { this.time_forwardable = time_forwardable; } + } + public final static class SpendableOutputs extends LDKEvent { + public long outputs; + SpendableOutputs(long outputs) { this.outputs = outputs; } + } + static native void init(); + } + static { LDKEvent.init(); } + public static native LDKEvent LDKEvent_ref_from_ptr(long ptr); public static native long LDKAcceptChannel_optional_none(); public static native long LDKOpenChannel_optional_none(); public static native long LDKFundingCreated_optional_none(); @@ -72,6 +165,125 @@ public class bindings { public static native long LDKChannelReestablish_optional_none(); public static native long LDKNodeAnnouncement_optional_none(); public static native long LDKErrorMessage_optional_none(); + public static class LDKErrorAction { + private LDKErrorAction() {} + public final static class DisconnectPeer extends LDKErrorAction { + public long msg; + DisconnectPeer(long msg) { this.msg = msg; } + } + public final static class IgnoreError extends LDKErrorAction { + } + public final static class SendErrorMessage extends LDKErrorAction { + public long msg; + SendErrorMessage(long msg) { this.msg = msg; } + } + static native void init(); + } + static { LDKErrorAction.init(); } + public static native LDKErrorAction LDKErrorAction_ref_from_ptr(long ptr); + public static class LDKHTLCFailChannelUpdate { + private LDKHTLCFailChannelUpdate() {} + public final static class ChannelUpdateMessage extends LDKHTLCFailChannelUpdate { + public long msg; + ChannelUpdateMessage(long msg) { this.msg = msg; } + } + public final static class ChannelClosed extends LDKHTLCFailChannelUpdate { + public long short_channel_id; + public boolean is_permanent; + ChannelClosed(long short_channel_id, boolean is_permanent) { this.short_channel_id = short_channel_id; this.is_permanent = is_permanent; } + } + public final static class NodeFailure extends LDKHTLCFailChannelUpdate { + public long node_id; + public boolean is_permanent; + NodeFailure(long node_id, boolean is_permanent) { this.node_id = node_id; this.is_permanent = is_permanent; } + } + static native void init(); + } + static { LDKHTLCFailChannelUpdate.init(); } + public static native LDKHTLCFailChannelUpdate LDKHTLCFailChannelUpdate_ref_from_ptr(long ptr); + public static class LDKMessageSendEvent { + private LDKMessageSendEvent() {} + public final static class SendAcceptChannel extends LDKMessageSendEvent { + public long node_id; + public long msg; + SendAcceptChannel(long node_id, long msg) { this.node_id = node_id; this.msg = msg; } + } + public final static class SendOpenChannel extends LDKMessageSendEvent { + public long node_id; + public long msg; + SendOpenChannel(long node_id, long msg) { this.node_id = node_id; this.msg = msg; } + } + public final static class SendFundingCreated extends LDKMessageSendEvent { + public long node_id; + public long msg; + SendFundingCreated(long node_id, long msg) { this.node_id = node_id; this.msg = msg; } + } + public final static class SendFundingSigned extends LDKMessageSendEvent { + public long node_id; + public long msg; + SendFundingSigned(long node_id, long msg) { this.node_id = node_id; this.msg = msg; } + } + public final static class SendFundingLocked extends LDKMessageSendEvent { + public long node_id; + public long msg; + SendFundingLocked(long node_id, long msg) { this.node_id = node_id; this.msg = msg; } + } + public final static class SendAnnouncementSignatures extends LDKMessageSendEvent { + public long node_id; + public long msg; + SendAnnouncementSignatures(long node_id, long msg) { this.node_id = node_id; this.msg = msg; } + } + public final static class UpdateHTLCs extends LDKMessageSendEvent { + public long node_id; + public long updates; + UpdateHTLCs(long node_id, long updates) { this.node_id = node_id; this.updates = updates; } + } + public final static class SendRevokeAndACK extends LDKMessageSendEvent { + public long node_id; + public long msg; + SendRevokeAndACK(long node_id, long msg) { this.node_id = node_id; this.msg = msg; } + } + public final static class SendClosingSigned extends LDKMessageSendEvent { + public long node_id; + public long msg; + SendClosingSigned(long node_id, long msg) { this.node_id = node_id; this.msg = msg; } + } + public final static class SendShutdown extends LDKMessageSendEvent { + public long node_id; + public long msg; + SendShutdown(long node_id, long msg) { this.node_id = node_id; this.msg = msg; } + } + public final static class SendChannelReestablish extends LDKMessageSendEvent { + public long node_id; + public long msg; + SendChannelReestablish(long node_id, long msg) { this.node_id = node_id; this.msg = msg; } + } + public final static class BroadcastChannelAnnouncement extends LDKMessageSendEvent { + public long msg; + public long update_msg; + BroadcastChannelAnnouncement(long msg, long update_msg) { this.msg = msg; this.update_msg = update_msg; } + } + public final static class BroadcastNodeAnnouncement extends LDKMessageSendEvent { + public long msg; + BroadcastNodeAnnouncement(long msg) { this.msg = msg; } + } + public final static class BroadcastChannelUpdate extends LDKMessageSendEvent { + public long msg; + BroadcastChannelUpdate(long msg) { this.msg = msg; } + } + public final static class HandleError extends LDKMessageSendEvent { + public long node_id; + public long action; + HandleError(long node_id, long action) { this.node_id = node_id; this.action = action; } + } + public final static class PaymentFailureNetworkUpdate extends LDKMessageSendEvent { + public long update; + PaymentFailureNetworkUpdate(long update) { this.update = update; } + } + static native void init(); + } + 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 interface LDKMessageSendEventsProvider { long get_and_clear_pending_msg_events(); @@ -220,6 +432,34 @@ public class bindings { public static native long LDKInitFeatures_optional_none(); public static native VecOrSliceDef LDKCVecTempl_ChannelDetails_arr_info(long vec_ptr); public static native long LDKRoute_optional_none(); + public static class LDKNetAddress { + private LDKNetAddress() {} + public final static class IPv4 extends LDKNetAddress { + public long addr; + public short port; + IPv4(long addr, short port) { this.addr = addr; this.port = port; } + } + public final static class IPv6 extends LDKNetAddress { + public long addr; + public short port; + IPv6(long addr, short port) { this.addr = addr; this.port = port; } + } + public final static class OnionV2 extends LDKNetAddress { + public long addr; + public short port; + OnionV2(long addr, short port) { this.addr = addr; this.port = port; } + } + public final static class OnionV3 extends LDKNetAddress { + public long ed25519_pubkey; + public short checksum; + public byte version; + public short port; + OnionV3(long ed25519_pubkey, short checksum, byte version, short port) { this.ed25519_pubkey = ed25519_pubkey; this.checksum = checksum; this.version = version; this.port = port; } + } + static native void init(); + } + static { LDKNetAddress.init(); } + public static native LDKNetAddress LDKNetAddress_ref_from_ptr(long ptr); public static native VecOrSliceDef LDKCVecTempl_NetAddress_arr_info(long vec_ptr); public static native long LDKUpdateAddHTLC_optional_none(); public static native long LDKUpdateFulfillHTLC_optional_none(); diff --git a/src/main/jni/bindings.c b/src/main/jni/bindings.c index 362b0b8a..645775b4 100644 --- a/src/main/jni/bindings.c +++ b/src/main/jni/bindings.c @@ -70,6 +70,11 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_deref_1long (JNIEnv * env, jc JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_free_1heap_1ptr (JNIEnv * env, jclass _a, jlong ptr) { FREE((void*)ptr); } +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_read_1bytes (JNIEnv * _env, jclass _b, jlong ptr, jlong len) { + jbyteArray ret_arr = (*_env)->NewByteArray(_env, len); + (*_env)->SetByteArrayRegion(_env, ret_arr, 0, len, (unsigned char*)ptr); + return ret_arr; +} JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_get_1u8_1slice_1bytes (JNIEnv * _env, jclass _b, jlong slice_ptr) { LDKu8slice *slice = (LDKu8slice*)slice_ptr; jbyteArray ret_arr = (*_env)->NewByteArray(_env, slice->datalen); @@ -431,6 +436,67 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZN return (long)((LDKCResult_CVec_SignatureZNoneZ*)arg)->contents.err; } } +jclass LDKAPIError_APIMisuseError_class = NULL; +jmethodID LDKAPIError_APIMisuseError_meth = NULL; +jclass LDKAPIError_FeeRateTooHigh_class = NULL; +jmethodID LDKAPIError_FeeRateTooHigh_meth = NULL; +jclass LDKAPIError_RouteError_class = NULL; +jmethodID LDKAPIError_RouteError_meth = NULL; +jclass LDKAPIError_ChannelUnavailable_class = NULL; +jmethodID LDKAPIError_ChannelUnavailable_meth = NULL; +jclass LDKAPIError_MonitorUpdateFailed_class = NULL; +jmethodID LDKAPIError_MonitorUpdateFailed_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAPIError_init (JNIEnv * env, jclass _a) { + LDKAPIError_APIMisuseError_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$APIMisuseError;")); + DO_ASSERT(LDKAPIError_APIMisuseError_class != NULL); + LDKAPIError_APIMisuseError_meth = (*env)->GetMethodID(env, LDKAPIError_APIMisuseError_class, "", "(J)V"); + DO_ASSERT(LDKAPIError_APIMisuseError_meth != NULL); + LDKAPIError_FeeRateTooHigh_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$FeeRateTooHigh;")); + DO_ASSERT(LDKAPIError_FeeRateTooHigh_class != NULL); + LDKAPIError_FeeRateTooHigh_meth = (*env)->GetMethodID(env, LDKAPIError_FeeRateTooHigh_class, "", "(JI)V"); + DO_ASSERT(LDKAPIError_FeeRateTooHigh_meth != NULL); + LDKAPIError_RouteError_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$RouteError;")); + DO_ASSERT(LDKAPIError_RouteError_class != NULL); + LDKAPIError_RouteError_meth = (*env)->GetMethodID(env, LDKAPIError_RouteError_class, "", "(J)V"); + DO_ASSERT(LDKAPIError_RouteError_meth != NULL); + LDKAPIError_ChannelUnavailable_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$ChannelUnavailable;")); + DO_ASSERT(LDKAPIError_ChannelUnavailable_class != NULL); + LDKAPIError_ChannelUnavailable_meth = (*env)->GetMethodID(env, LDKAPIError_ChannelUnavailable_class, "", "(J)V"); + DO_ASSERT(LDKAPIError_ChannelUnavailable_meth != NULL); + LDKAPIError_MonitorUpdateFailed_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$MonitorUpdateFailed;")); + DO_ASSERT(LDKAPIError_MonitorUpdateFailed_class != NULL); + LDKAPIError_MonitorUpdateFailed_meth = (*env)->GetMethodID(env, LDKAPIError_MonitorUpdateFailed_class, "", "()V"); + DO_ASSERT(LDKAPIError_MonitorUpdateFailed_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAPIError_1ref_1from_1ptr (JNIEnv * env, jclass _c, jlong ptr) { + LDKAPIError *obj = (LDKAPIError*)ptr; + switch(obj->tag) { + case LDKAPIError_APIMisuseError: + return (*env)->NewObject(env, LDKAPIError_APIMisuseError_class, LDKAPIError_APIMisuseError_meth, + (long)&obj->api_misuse_error.err + ); + case LDKAPIError_FeeRateTooHigh: + return (*env)->NewObject(env, LDKAPIError_FeeRateTooHigh_class, LDKAPIError_FeeRateTooHigh_meth, + (long)&obj->fee_rate_too_high.err, obj->fee_rate_too_high.feerate + ); + case LDKAPIError_RouteError: + return (*env)->NewObject(env, LDKAPIError_RouteError_class, LDKAPIError_RouteError_meth, + (long)&obj->route_error.err + ); + case LDKAPIError_ChannelUnavailable: + return (*env)->NewObject(env, LDKAPIError_ChannelUnavailable_class, LDKAPIError_ChannelUnavailable_meth, + (long)&obj->channel_unavailable.err + ); + case LDKAPIError_MonitorUpdateFailed: + return (*env)->NewObject(env, LDKAPIError_MonitorUpdateFailed_class, LDKAPIError_MonitorUpdateFailed_meth); + default: abort(); + } +} JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) { return ((LDKCResult_NoneAPIErrorZ*)arg)->result_ok; } @@ -486,10 +552,136 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKHTLCOutputInCommitment_1op ret->inner = NULL; return (long)ret; } +jclass LDKSpendableOutputDescriptor_StaticOutput_class = NULL; +jmethodID LDKSpendableOutputDescriptor_StaticOutput_meth = NULL; +jclass LDKSpendableOutputDescriptor_DynamicOutputP2WSH_class = NULL; +jmethodID LDKSpendableOutputDescriptor_DynamicOutputP2WSH_meth = NULL; +jclass LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_class = NULL; +jmethodID LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSpendableOutputDescriptor_init (JNIEnv * env, jclass _a) { + LDKSpendableOutputDescriptor_StaticOutput_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKSpendableOutputDescriptor$StaticOutput;")); + DO_ASSERT(LDKSpendableOutputDescriptor_StaticOutput_class != NULL); + LDKSpendableOutputDescriptor_StaticOutput_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_StaticOutput_class, "", "(JJ)V"); + DO_ASSERT(LDKSpendableOutputDescriptor_StaticOutput_meth != NULL); + LDKSpendableOutputDescriptor_DynamicOutputP2WSH_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKSpendableOutputDescriptor$DynamicOutputP2WSH;")); + DO_ASSERT(LDKSpendableOutputDescriptor_DynamicOutputP2WSH_class != NULL); + LDKSpendableOutputDescriptor_DynamicOutputP2WSH_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_DynamicOutputP2WSH_class, "", "(JJSJJJ)V"); + DO_ASSERT(LDKSpendableOutputDescriptor_DynamicOutputP2WSH_meth != NULL); + LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKSpendableOutputDescriptor$StaticOutputCounterpartyPayment;")); + DO_ASSERT(LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_class != NULL); + LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_class, "", "(JJJ)V"); + DO_ASSERT(LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSpendableOutputDescriptor_1ref_1from_1ptr (JNIEnv * env, jclass _c, jlong ptr) { + LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)ptr; + switch(obj->tag) { + case LDKSpendableOutputDescriptor_StaticOutput: + return (*env)->NewObject(env, LDKSpendableOutputDescriptor_StaticOutput_class, LDKSpendableOutputDescriptor_StaticOutput_meth, + (long)&obj->static_output.outpoint, (long)&obj->static_output.output + ); + case LDKSpendableOutputDescriptor_DynamicOutputP2WSH: + return (*env)->NewObject(env, LDKSpendableOutputDescriptor_DynamicOutputP2WSH_class, LDKSpendableOutputDescriptor_DynamicOutputP2WSH_meth, + (long)&obj->dynamic_output_p2wsh.outpoint, (long)&obj->dynamic_output_p2wsh.per_commitment_point, obj->dynamic_output_p2wsh.to_self_delay, (long)&obj->dynamic_output_p2wsh.output, (long)&obj->dynamic_output_p2wsh.key_derivation_params, (long)&obj->dynamic_output_p2wsh.revocation_pubkey + ); + case LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment: + return (*env)->NewObject(env, LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_class, LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_meth, + (long)&obj->static_output_counterparty_payment.outpoint, (long)&obj->static_output_counterparty_payment.output, (long)&obj->static_output_counterparty_payment.key_derivation_params + ); + default: abort(); + } +} JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1SpendableOutputDescriptor_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { LDKCVecTempl_SpendableOutputDescriptor *vec = (LDKCVecTempl_SpendableOutputDescriptor*)ptr; return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKSpendableOutputDescriptor)); } +jclass LDKEvent_FundingGenerationReady_class = NULL; +jmethodID LDKEvent_FundingGenerationReady_meth = NULL; +jclass LDKEvent_FundingBroadcastSafe_class = NULL; +jmethodID LDKEvent_FundingBroadcastSafe_meth = NULL; +jclass LDKEvent_PaymentReceived_class = NULL; +jmethodID LDKEvent_PaymentReceived_meth = NULL; +jclass LDKEvent_PaymentSent_class = NULL; +jmethodID LDKEvent_PaymentSent_meth = NULL; +jclass LDKEvent_PaymentFailed_class = NULL; +jmethodID LDKEvent_PaymentFailed_meth = NULL; +jclass LDKEvent_PendingHTLCsForwardable_class = NULL; +jmethodID LDKEvent_PendingHTLCsForwardable_meth = NULL; +jclass LDKEvent_SpendableOutputs_class = NULL; +jmethodID LDKEvent_SpendableOutputs_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv * env, jclass _a) { + LDKEvent_FundingGenerationReady_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$FundingGenerationReady;")); + DO_ASSERT(LDKEvent_FundingGenerationReady_class != NULL); + LDKEvent_FundingGenerationReady_meth = (*env)->GetMethodID(env, LDKEvent_FundingGenerationReady_class, "", "(JJJJ)V"); + DO_ASSERT(LDKEvent_FundingGenerationReady_meth != NULL); + LDKEvent_FundingBroadcastSafe_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$FundingBroadcastSafe;")); + DO_ASSERT(LDKEvent_FundingBroadcastSafe_class != NULL); + LDKEvent_FundingBroadcastSafe_meth = (*env)->GetMethodID(env, LDKEvent_FundingBroadcastSafe_class, "", "(JJ)V"); + DO_ASSERT(LDKEvent_FundingBroadcastSafe_meth != NULL); + LDKEvent_PaymentReceived_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentReceived;")); + DO_ASSERT(LDKEvent_PaymentReceived_class != NULL); + LDKEvent_PaymentReceived_meth = (*env)->GetMethodID(env, LDKEvent_PaymentReceived_class, "", "(JJJ)V"); + DO_ASSERT(LDKEvent_PaymentReceived_meth != NULL); + LDKEvent_PaymentSent_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentSent;")); + DO_ASSERT(LDKEvent_PaymentSent_class != NULL); + LDKEvent_PaymentSent_meth = (*env)->GetMethodID(env, LDKEvent_PaymentSent_class, "", "(J)V"); + DO_ASSERT(LDKEvent_PaymentSent_meth != NULL); + LDKEvent_PaymentFailed_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentFailed;")); + DO_ASSERT(LDKEvent_PaymentFailed_class != NULL); + LDKEvent_PaymentFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentFailed_class, "", "(JZ)V"); + DO_ASSERT(LDKEvent_PaymentFailed_meth != NULL); + LDKEvent_PendingHTLCsForwardable_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PendingHTLCsForwardable;")); + DO_ASSERT(LDKEvent_PendingHTLCsForwardable_class != NULL); + LDKEvent_PendingHTLCsForwardable_meth = (*env)->GetMethodID(env, LDKEvent_PendingHTLCsForwardable_class, "", "(J)V"); + DO_ASSERT(LDKEvent_PendingHTLCsForwardable_meth != NULL); + LDKEvent_SpendableOutputs_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$SpendableOutputs;")); + DO_ASSERT(LDKEvent_SpendableOutputs_class != NULL); + LDKEvent_SpendableOutputs_meth = (*env)->GetMethodID(env, LDKEvent_SpendableOutputs_class, "", "(J)V"); + DO_ASSERT(LDKEvent_SpendableOutputs_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr (JNIEnv * env, jclass _c, jlong ptr) { + LDKEvent *obj = (LDKEvent*)ptr; + switch(obj->tag) { + case LDKEvent_FundingGenerationReady: + return (*env)->NewObject(env, LDKEvent_FundingGenerationReady_class, LDKEvent_FundingGenerationReady_meth, + (long)&obj->funding_generation_ready.temporary_channel_id, obj->funding_generation_ready.channel_value_satoshis, (long)&obj->funding_generation_ready.output_script, obj->funding_generation_ready.user_channel_id + ); + case LDKEvent_FundingBroadcastSafe: + return (*env)->NewObject(env, LDKEvent_FundingBroadcastSafe_class, LDKEvent_FundingBroadcastSafe_meth, + (long)&obj->funding_broadcast_safe.funding_txo, obj->funding_broadcast_safe.user_channel_id + ); + case LDKEvent_PaymentReceived: + return (*env)->NewObject(env, LDKEvent_PaymentReceived_class, LDKEvent_PaymentReceived_meth, + (long)&obj->payment_received.payment_hash, (long)&obj->payment_received.payment_secret, obj->payment_received.amt + ); + case LDKEvent_PaymentSent: + return (*env)->NewObject(env, LDKEvent_PaymentSent_class, LDKEvent_PaymentSent_meth, + (long)&obj->payment_sent.payment_preimage + ); + case LDKEvent_PaymentFailed: + return (*env)->NewObject(env, LDKEvent_PaymentFailed_class, LDKEvent_PaymentFailed_meth, + (long)&obj->payment_failed.payment_hash, obj->payment_failed.rejected_by_dest + ); + case LDKEvent_PendingHTLCsForwardable: + return (*env)->NewObject(env, LDKEvent_PendingHTLCsForwardable_class, LDKEvent_PendingHTLCsForwardable_meth, + obj->pending_htl_cs_forwardable.time_forwardable + ); + case LDKEvent_SpendableOutputs: + return (*env)->NewObject(env, LDKEvent_SpendableOutputs_class, LDKEvent_SpendableOutputs_meth, + (long)&obj->spendable_outputs.outputs + ); + default: abort(); + } +} JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKAcceptChannel_1optional_1none (JNIEnv * env, jclass _a) { LDKAcceptChannel *ret = MALLOC(sizeof(LDKAcceptChannel), "LDKAcceptChannel"); ret->inner = NULL; @@ -555,6 +747,270 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKErrorMessage_1optional_1no ret->inner = NULL; return (long)ret; } +jclass LDKErrorAction_DisconnectPeer_class = NULL; +jmethodID LDKErrorAction_DisconnectPeer_meth = NULL; +jclass LDKErrorAction_IgnoreError_class = NULL; +jmethodID LDKErrorAction_IgnoreError_meth = NULL; +jclass LDKErrorAction_SendErrorMessage_class = NULL; +jmethodID LDKErrorAction_SendErrorMessage_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKErrorAction_init (JNIEnv * env, jclass _a) { + LDKErrorAction_DisconnectPeer_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKErrorAction$DisconnectPeer;")); + DO_ASSERT(LDKErrorAction_DisconnectPeer_class != NULL); + LDKErrorAction_DisconnectPeer_meth = (*env)->GetMethodID(env, LDKErrorAction_DisconnectPeer_class, "", "(J)V"); + DO_ASSERT(LDKErrorAction_DisconnectPeer_meth != NULL); + LDKErrorAction_IgnoreError_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKErrorAction$IgnoreError;")); + DO_ASSERT(LDKErrorAction_IgnoreError_class != NULL); + LDKErrorAction_IgnoreError_meth = (*env)->GetMethodID(env, LDKErrorAction_IgnoreError_class, "", "()V"); + DO_ASSERT(LDKErrorAction_IgnoreError_meth != NULL); + LDKErrorAction_SendErrorMessage_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKErrorAction$SendErrorMessage;")); + DO_ASSERT(LDKErrorAction_SendErrorMessage_class != NULL); + LDKErrorAction_SendErrorMessage_meth = (*env)->GetMethodID(env, LDKErrorAction_SendErrorMessage_class, "", "(J)V"); + DO_ASSERT(LDKErrorAction_SendErrorMessage_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKErrorAction_1ref_1from_1ptr (JNIEnv * env, jclass _c, jlong ptr) { + LDKErrorAction *obj = (LDKErrorAction*)ptr; + switch(obj->tag) { + case LDKErrorAction_DisconnectPeer: + return (*env)->NewObject(env, LDKErrorAction_DisconnectPeer_class, LDKErrorAction_DisconnectPeer_meth, + (long)&obj->disconnect_peer.msg + ); + case LDKErrorAction_IgnoreError: + return (*env)->NewObject(env, LDKErrorAction_IgnoreError_class, LDKErrorAction_IgnoreError_meth); + case LDKErrorAction_SendErrorMessage: + return (*env)->NewObject(env, LDKErrorAction_SendErrorMessage_class, LDKErrorAction_SendErrorMessage_meth, + (long)&obj->send_error_message.msg + ); + default: abort(); + } +} +jclass LDKHTLCFailChannelUpdate_ChannelUpdateMessage_class = NULL; +jmethodID LDKHTLCFailChannelUpdate_ChannelUpdateMessage_meth = NULL; +jclass LDKHTLCFailChannelUpdate_ChannelClosed_class = NULL; +jmethodID LDKHTLCFailChannelUpdate_ChannelClosed_meth = NULL; +jclass LDKHTLCFailChannelUpdate_NodeFailure_class = NULL; +jmethodID LDKHTLCFailChannelUpdate_NodeFailure_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKHTLCFailChannelUpdate_init (JNIEnv * env, jclass _a) { + LDKHTLCFailChannelUpdate_ChannelUpdateMessage_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKHTLCFailChannelUpdate$ChannelUpdateMessage;")); + DO_ASSERT(LDKHTLCFailChannelUpdate_ChannelUpdateMessage_class != NULL); + LDKHTLCFailChannelUpdate_ChannelUpdateMessage_meth = (*env)->GetMethodID(env, LDKHTLCFailChannelUpdate_ChannelUpdateMessage_class, "", "(J)V"); + DO_ASSERT(LDKHTLCFailChannelUpdate_ChannelUpdateMessage_meth != NULL); + LDKHTLCFailChannelUpdate_ChannelClosed_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKHTLCFailChannelUpdate$ChannelClosed;")); + DO_ASSERT(LDKHTLCFailChannelUpdate_ChannelClosed_class != NULL); + LDKHTLCFailChannelUpdate_ChannelClosed_meth = (*env)->GetMethodID(env, LDKHTLCFailChannelUpdate_ChannelClosed_class, "", "(JZ)V"); + DO_ASSERT(LDKHTLCFailChannelUpdate_ChannelClosed_meth != NULL); + LDKHTLCFailChannelUpdate_NodeFailure_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKHTLCFailChannelUpdate$NodeFailure;")); + DO_ASSERT(LDKHTLCFailChannelUpdate_NodeFailure_class != NULL); + LDKHTLCFailChannelUpdate_NodeFailure_meth = (*env)->GetMethodID(env, LDKHTLCFailChannelUpdate_NodeFailure_class, "", "(JZ)V"); + DO_ASSERT(LDKHTLCFailChannelUpdate_NodeFailure_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKHTLCFailChannelUpdate_1ref_1from_1ptr (JNIEnv * env, jclass _c, jlong ptr) { + LDKHTLCFailChannelUpdate *obj = (LDKHTLCFailChannelUpdate*)ptr; + switch(obj->tag) { + case LDKHTLCFailChannelUpdate_ChannelUpdateMessage: + return (*env)->NewObject(env, LDKHTLCFailChannelUpdate_ChannelUpdateMessage_class, LDKHTLCFailChannelUpdate_ChannelUpdateMessage_meth, + (long)&obj->channel_update_message.msg + ); + case LDKHTLCFailChannelUpdate_ChannelClosed: + return (*env)->NewObject(env, LDKHTLCFailChannelUpdate_ChannelClosed_class, LDKHTLCFailChannelUpdate_ChannelClosed_meth, + obj->channel_closed.short_channel_id, obj->channel_closed.is_permanent + ); + case LDKHTLCFailChannelUpdate_NodeFailure: + return (*env)->NewObject(env, LDKHTLCFailChannelUpdate_NodeFailure_class, LDKHTLCFailChannelUpdate_NodeFailure_meth, + (long)&obj->node_failure.node_id, obj->node_failure.is_permanent + ); + default: abort(); + } +} +jclass LDKMessageSendEvent_SendAcceptChannel_class = NULL; +jmethodID LDKMessageSendEvent_SendAcceptChannel_meth = NULL; +jclass LDKMessageSendEvent_SendOpenChannel_class = NULL; +jmethodID LDKMessageSendEvent_SendOpenChannel_meth = NULL; +jclass LDKMessageSendEvent_SendFundingCreated_class = NULL; +jmethodID LDKMessageSendEvent_SendFundingCreated_meth = NULL; +jclass LDKMessageSendEvent_SendFundingSigned_class = NULL; +jmethodID LDKMessageSendEvent_SendFundingSigned_meth = NULL; +jclass LDKMessageSendEvent_SendFundingLocked_class = NULL; +jmethodID LDKMessageSendEvent_SendFundingLocked_meth = NULL; +jclass LDKMessageSendEvent_SendAnnouncementSignatures_class = NULL; +jmethodID LDKMessageSendEvent_SendAnnouncementSignatures_meth = NULL; +jclass LDKMessageSendEvent_UpdateHTLCs_class = NULL; +jmethodID LDKMessageSendEvent_UpdateHTLCs_meth = NULL; +jclass LDKMessageSendEvent_SendRevokeAndACK_class = NULL; +jmethodID LDKMessageSendEvent_SendRevokeAndACK_meth = NULL; +jclass LDKMessageSendEvent_SendClosingSigned_class = NULL; +jmethodID LDKMessageSendEvent_SendClosingSigned_meth = NULL; +jclass LDKMessageSendEvent_SendShutdown_class = NULL; +jmethodID LDKMessageSendEvent_SendShutdown_meth = NULL; +jclass LDKMessageSendEvent_SendChannelReestablish_class = NULL; +jmethodID LDKMessageSendEvent_SendChannelReestablish_meth = NULL; +jclass LDKMessageSendEvent_BroadcastChannelAnnouncement_class = NULL; +jmethodID LDKMessageSendEvent_BroadcastChannelAnnouncement_meth = NULL; +jclass LDKMessageSendEvent_BroadcastNodeAnnouncement_class = NULL; +jmethodID LDKMessageSendEvent_BroadcastNodeAnnouncement_meth = NULL; +jclass LDKMessageSendEvent_BroadcastChannelUpdate_class = NULL; +jmethodID LDKMessageSendEvent_BroadcastChannelUpdate_meth = NULL; +jclass LDKMessageSendEvent_HandleError_class = NULL; +jmethodID LDKMessageSendEvent_HandleError_meth = NULL; +jclass LDKMessageSendEvent_PaymentFailureNetworkUpdate_class = NULL; +jmethodID LDKMessageSendEvent_PaymentFailureNetworkUpdate_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendEvent_init (JNIEnv * env, jclass _a) { + LDKMessageSendEvent_SendAcceptChannel_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendAcceptChannel;")); + DO_ASSERT(LDKMessageSendEvent_SendAcceptChannel_class != NULL); + LDKMessageSendEvent_SendAcceptChannel_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendAcceptChannel_class, "", "(JJ)V"); + DO_ASSERT(LDKMessageSendEvent_SendAcceptChannel_meth != NULL); + LDKMessageSendEvent_SendOpenChannel_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendOpenChannel;")); + DO_ASSERT(LDKMessageSendEvent_SendOpenChannel_class != NULL); + LDKMessageSendEvent_SendOpenChannel_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendOpenChannel_class, "", "(JJ)V"); + DO_ASSERT(LDKMessageSendEvent_SendOpenChannel_meth != NULL); + LDKMessageSendEvent_SendFundingCreated_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendFundingCreated;")); + DO_ASSERT(LDKMessageSendEvent_SendFundingCreated_class != NULL); + LDKMessageSendEvent_SendFundingCreated_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendFundingCreated_class, "", "(JJ)V"); + DO_ASSERT(LDKMessageSendEvent_SendFundingCreated_meth != NULL); + LDKMessageSendEvent_SendFundingSigned_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendFundingSigned;")); + DO_ASSERT(LDKMessageSendEvent_SendFundingSigned_class != NULL); + LDKMessageSendEvent_SendFundingSigned_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendFundingSigned_class, "", "(JJ)V"); + DO_ASSERT(LDKMessageSendEvent_SendFundingSigned_meth != NULL); + LDKMessageSendEvent_SendFundingLocked_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendFundingLocked;")); + DO_ASSERT(LDKMessageSendEvent_SendFundingLocked_class != NULL); + LDKMessageSendEvent_SendFundingLocked_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendFundingLocked_class, "", "(JJ)V"); + DO_ASSERT(LDKMessageSendEvent_SendFundingLocked_meth != NULL); + LDKMessageSendEvent_SendAnnouncementSignatures_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendAnnouncementSignatures;")); + DO_ASSERT(LDKMessageSendEvent_SendAnnouncementSignatures_class != NULL); + LDKMessageSendEvent_SendAnnouncementSignatures_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendAnnouncementSignatures_class, "", "(JJ)V"); + DO_ASSERT(LDKMessageSendEvent_SendAnnouncementSignatures_meth != NULL); + LDKMessageSendEvent_UpdateHTLCs_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$UpdateHTLCs;")); + DO_ASSERT(LDKMessageSendEvent_UpdateHTLCs_class != NULL); + LDKMessageSendEvent_UpdateHTLCs_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_UpdateHTLCs_class, "", "(JJ)V"); + DO_ASSERT(LDKMessageSendEvent_UpdateHTLCs_meth != NULL); + LDKMessageSendEvent_SendRevokeAndACK_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendRevokeAndACK;")); + DO_ASSERT(LDKMessageSendEvent_SendRevokeAndACK_class != NULL); + LDKMessageSendEvent_SendRevokeAndACK_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendRevokeAndACK_class, "", "(JJ)V"); + DO_ASSERT(LDKMessageSendEvent_SendRevokeAndACK_meth != NULL); + LDKMessageSendEvent_SendClosingSigned_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendClosingSigned;")); + DO_ASSERT(LDKMessageSendEvent_SendClosingSigned_class != NULL); + LDKMessageSendEvent_SendClosingSigned_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendClosingSigned_class, "", "(JJ)V"); + DO_ASSERT(LDKMessageSendEvent_SendClosingSigned_meth != NULL); + LDKMessageSendEvent_SendShutdown_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendShutdown;")); + DO_ASSERT(LDKMessageSendEvent_SendShutdown_class != NULL); + LDKMessageSendEvent_SendShutdown_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendShutdown_class, "", "(JJ)V"); + DO_ASSERT(LDKMessageSendEvent_SendShutdown_meth != NULL); + LDKMessageSendEvent_SendChannelReestablish_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendChannelReestablish;")); + DO_ASSERT(LDKMessageSendEvent_SendChannelReestablish_class != NULL); + LDKMessageSendEvent_SendChannelReestablish_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendChannelReestablish_class, "", "(JJ)V"); + DO_ASSERT(LDKMessageSendEvent_SendChannelReestablish_meth != NULL); + LDKMessageSendEvent_BroadcastChannelAnnouncement_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$BroadcastChannelAnnouncement;")); + DO_ASSERT(LDKMessageSendEvent_BroadcastChannelAnnouncement_class != NULL); + LDKMessageSendEvent_BroadcastChannelAnnouncement_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_BroadcastChannelAnnouncement_class, "", "(JJ)V"); + DO_ASSERT(LDKMessageSendEvent_BroadcastChannelAnnouncement_meth != NULL); + LDKMessageSendEvent_BroadcastNodeAnnouncement_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$BroadcastNodeAnnouncement;")); + DO_ASSERT(LDKMessageSendEvent_BroadcastNodeAnnouncement_class != NULL); + LDKMessageSendEvent_BroadcastNodeAnnouncement_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_BroadcastNodeAnnouncement_class, "", "(J)V"); + DO_ASSERT(LDKMessageSendEvent_BroadcastNodeAnnouncement_meth != NULL); + LDKMessageSendEvent_BroadcastChannelUpdate_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$BroadcastChannelUpdate;")); + DO_ASSERT(LDKMessageSendEvent_BroadcastChannelUpdate_class != NULL); + LDKMessageSendEvent_BroadcastChannelUpdate_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_BroadcastChannelUpdate_class, "", "(J)V"); + DO_ASSERT(LDKMessageSendEvent_BroadcastChannelUpdate_meth != NULL); + LDKMessageSendEvent_HandleError_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$HandleError;")); + DO_ASSERT(LDKMessageSendEvent_HandleError_class != NULL); + LDKMessageSendEvent_HandleError_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_HandleError_class, "", "(JJ)V"); + DO_ASSERT(LDKMessageSendEvent_HandleError_meth != NULL); + LDKMessageSendEvent_PaymentFailureNetworkUpdate_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$PaymentFailureNetworkUpdate;")); + DO_ASSERT(LDKMessageSendEvent_PaymentFailureNetworkUpdate_class != NULL); + LDKMessageSendEvent_PaymentFailureNetworkUpdate_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_PaymentFailureNetworkUpdate_class, "", "(J)V"); + DO_ASSERT(LDKMessageSendEvent_PaymentFailureNetworkUpdate_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1from_1ptr (JNIEnv * env, jclass _c, jlong ptr) { + LDKMessageSendEvent *obj = (LDKMessageSendEvent*)ptr; + switch(obj->tag) { + case LDKMessageSendEvent_SendAcceptChannel: + return (*env)->NewObject(env, LDKMessageSendEvent_SendAcceptChannel_class, LDKMessageSendEvent_SendAcceptChannel_meth, + (long)&obj->send_accept_channel.node_id, (long)&obj->send_accept_channel.msg + ); + case LDKMessageSendEvent_SendOpenChannel: + return (*env)->NewObject(env, LDKMessageSendEvent_SendOpenChannel_class, LDKMessageSendEvent_SendOpenChannel_meth, + (long)&obj->send_open_channel.node_id, (long)&obj->send_open_channel.msg + ); + case LDKMessageSendEvent_SendFundingCreated: + return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingCreated_class, LDKMessageSendEvent_SendFundingCreated_meth, + (long)&obj->send_funding_created.node_id, (long)&obj->send_funding_created.msg + ); + case LDKMessageSendEvent_SendFundingSigned: + return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingSigned_class, LDKMessageSendEvent_SendFundingSigned_meth, + (long)&obj->send_funding_signed.node_id, (long)&obj->send_funding_signed.msg + ); + case LDKMessageSendEvent_SendFundingLocked: + return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingLocked_class, LDKMessageSendEvent_SendFundingLocked_meth, + (long)&obj->send_funding_locked.node_id, (long)&obj->send_funding_locked.msg + ); + case LDKMessageSendEvent_SendAnnouncementSignatures: + return (*env)->NewObject(env, LDKMessageSendEvent_SendAnnouncementSignatures_class, LDKMessageSendEvent_SendAnnouncementSignatures_meth, + (long)&obj->send_announcement_signatures.node_id, (long)&obj->send_announcement_signatures.msg + ); + case LDKMessageSendEvent_UpdateHTLCs: + return (*env)->NewObject(env, LDKMessageSendEvent_UpdateHTLCs_class, LDKMessageSendEvent_UpdateHTLCs_meth, + (long)&obj->update_htl_cs.node_id, (long)&obj->update_htl_cs.updates + ); + case LDKMessageSendEvent_SendRevokeAndACK: + return (*env)->NewObject(env, LDKMessageSendEvent_SendRevokeAndACK_class, LDKMessageSendEvent_SendRevokeAndACK_meth, + (long)&obj->send_revoke_and_ack.node_id, (long)&obj->send_revoke_and_ack.msg + ); + case LDKMessageSendEvent_SendClosingSigned: + return (*env)->NewObject(env, LDKMessageSendEvent_SendClosingSigned_class, LDKMessageSendEvent_SendClosingSigned_meth, + (long)&obj->send_closing_signed.node_id, (long)&obj->send_closing_signed.msg + ); + case LDKMessageSendEvent_SendShutdown: + return (*env)->NewObject(env, LDKMessageSendEvent_SendShutdown_class, LDKMessageSendEvent_SendShutdown_meth, + (long)&obj->send_shutdown.node_id, (long)&obj->send_shutdown.msg + ); + case LDKMessageSendEvent_SendChannelReestablish: + return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelReestablish_class, LDKMessageSendEvent_SendChannelReestablish_meth, + (long)&obj->send_channel_reestablish.node_id, (long)&obj->send_channel_reestablish.msg + ); + case LDKMessageSendEvent_BroadcastChannelAnnouncement: + return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastChannelAnnouncement_class, LDKMessageSendEvent_BroadcastChannelAnnouncement_meth, + (long)&obj->broadcast_channel_announcement.msg, (long)&obj->broadcast_channel_announcement.update_msg + ); + case LDKMessageSendEvent_BroadcastNodeAnnouncement: + return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastNodeAnnouncement_class, LDKMessageSendEvent_BroadcastNodeAnnouncement_meth, + (long)&obj->broadcast_node_announcement.msg + ); + case LDKMessageSendEvent_BroadcastChannelUpdate: + return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastChannelUpdate_class, LDKMessageSendEvent_BroadcastChannelUpdate_meth, + (long)&obj->broadcast_channel_update.msg + ); + case LDKMessageSendEvent_HandleError: + return (*env)->NewObject(env, LDKMessageSendEvent_HandleError_class, LDKMessageSendEvent_HandleError_meth, + (long)&obj->handle_error.node_id, (long)&obj->handle_error.action + ); + case LDKMessageSendEvent_PaymentFailureNetworkUpdate: + return (*env)->NewObject(env, LDKMessageSendEvent_PaymentFailureNetworkUpdate_class, LDKMessageSendEvent_PaymentFailureNetworkUpdate_meth, + (long)&obj->payment_failure_network_update.update + ); + default: abort(); + } +} JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1MessageSendEvent_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { LDKCVecTempl_MessageSendEvent *vec = (LDKCVecTempl_MessageSendEvent*)ptr; return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKMessageSendEvent)); @@ -1675,6 +2131,58 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRoute_1optional_1none (JNI ret->inner = NULL; return (long)ret; } +jclass LDKNetAddress_IPv4_class = NULL; +jmethodID LDKNetAddress_IPv4_meth = NULL; +jclass LDKNetAddress_IPv6_class = NULL; +jmethodID LDKNetAddress_IPv6_meth = NULL; +jclass LDKNetAddress_OnionV2_class = NULL; +jmethodID LDKNetAddress_OnionV2_meth = NULL; +jclass LDKNetAddress_OnionV3_class = NULL; +jmethodID LDKNetAddress_OnionV3_meth = NULL; +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNetAddress_init (JNIEnv * env, jclass _a) { + LDKNetAddress_IPv4_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetAddress$IPv4;")); + DO_ASSERT(LDKNetAddress_IPv4_class != NULL); + LDKNetAddress_IPv4_meth = (*env)->GetMethodID(env, LDKNetAddress_IPv4_class, "", "(JS)V"); + DO_ASSERT(LDKNetAddress_IPv4_meth != NULL); + LDKNetAddress_IPv6_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetAddress$IPv6;")); + DO_ASSERT(LDKNetAddress_IPv6_class != NULL); + LDKNetAddress_IPv6_meth = (*env)->GetMethodID(env, LDKNetAddress_IPv6_class, "", "(JS)V"); + DO_ASSERT(LDKNetAddress_IPv6_meth != NULL); + LDKNetAddress_OnionV2_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetAddress$OnionV2;")); + DO_ASSERT(LDKNetAddress_OnionV2_class != NULL); + LDKNetAddress_OnionV2_meth = (*env)->GetMethodID(env, LDKNetAddress_OnionV2_class, "", "(JS)V"); + DO_ASSERT(LDKNetAddress_OnionV2_meth != NULL); + LDKNetAddress_OnionV3_class = + (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetAddress$OnionV3;")); + DO_ASSERT(LDKNetAddress_OnionV3_class != NULL); + LDKNetAddress_OnionV3_meth = (*env)->GetMethodID(env, LDKNetAddress_OnionV3_class, "", "(JSBS)V"); + DO_ASSERT(LDKNetAddress_OnionV3_meth != NULL); +} +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetAddress_1ref_1from_1ptr (JNIEnv * env, jclass _c, jlong ptr) { + LDKNetAddress *obj = (LDKNetAddress*)ptr; + switch(obj->tag) { + case LDKNetAddress_IPv4: + return (*env)->NewObject(env, LDKNetAddress_IPv4_class, LDKNetAddress_IPv4_meth, + (long)&obj->i_pv4.addr, obj->i_pv4.port + ); + case LDKNetAddress_IPv6: + return (*env)->NewObject(env, LDKNetAddress_IPv6_class, LDKNetAddress_IPv6_meth, + (long)&obj->i_pv6.addr, obj->i_pv6.port + ); + case LDKNetAddress_OnionV2: + return (*env)->NewObject(env, LDKNetAddress_OnionV2_class, LDKNetAddress_OnionV2_meth, + (long)&obj->onion_v2.addr, obj->onion_v2.port + ); + case LDKNetAddress_OnionV3: + return (*env)->NewObject(env, LDKNetAddress_OnionV3_class, LDKNetAddress_OnionV3_meth, + (long)&obj->onion_v3.ed25519_pubkey, obj->onion_v3.checksum, obj->onion_v3.version, obj->onion_v3.port + ); + default: abort(); + } +} JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1NetAddress_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) { LDKCVecTempl_NetAddress *vec = (LDKCVecTempl_NetAddress*)ptr; return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKNetAddress)); diff --git a/src/main/jni/org_ldk_enums_LDKAccessError.h b/src/main/jni/org_ldk_enums_LDKAccessError.h new file mode 100644 index 00000000..4c3f9fb4 --- /dev/null +++ b/src/main/jni/org_ldk_enums_LDKAccessError.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_enums_LDKAccessError */ + +#ifndef _Included_org_ldk_enums_LDKAccessError +#define _Included_org_ldk_enums_LDKAccessError +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_enums_LDKAccessError + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_enums_LDKAccessError_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_enums_LDKChannelMonitorUpdateErr.h b/src/main/jni/org_ldk_enums_LDKChannelMonitorUpdateErr.h new file mode 100644 index 00000000..f33dd016 --- /dev/null +++ b/src/main/jni/org_ldk_enums_LDKChannelMonitorUpdateErr.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_enums_LDKChannelMonitorUpdateErr */ + +#ifndef _Included_org_ldk_enums_LDKChannelMonitorUpdateErr +#define _Included_org_ldk_enums_LDKChannelMonitorUpdateErr +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_enums_LDKChannelMonitorUpdateErr + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_enums_LDKChannelMonitorUpdateErr_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_enums_LDKConfirmationTarget.h b/src/main/jni/org_ldk_enums_LDKConfirmationTarget.h new file mode 100644 index 00000000..80e4ecfe --- /dev/null +++ b/src/main/jni/org_ldk_enums_LDKConfirmationTarget.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_enums_LDKConfirmationTarget */ + +#ifndef _Included_org_ldk_enums_LDKConfirmationTarget +#define _Included_org_ldk_enums_LDKConfirmationTarget +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_enums_LDKConfirmationTarget + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_enums_LDKConfirmationTarget_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_enums_LDKLevel.h b/src/main/jni/org_ldk_enums_LDKLevel.h new file mode 100644 index 00000000..6c207299 --- /dev/null +++ b/src/main/jni/org_ldk_enums_LDKLevel.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_enums_LDKLevel */ + +#ifndef _Included_org_ldk_enums_LDKLevel +#define _Included_org_ldk_enums_LDKLevel +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_enums_LDKLevel + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_enums_LDKLevel_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_enums_LDKNetwork.h b/src/main/jni/org_ldk_enums_LDKNetwork.h new file mode 100644 index 00000000..506909f5 --- /dev/null +++ b/src/main/jni/org_ldk_enums_LDKNetwork.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_enums_LDKNetwork */ + +#ifndef _Included_org_ldk_enums_LDKNetwork +#define _Included_org_ldk_enums_LDKNetwork +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_enums_LDKNetwork + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_enums_LDKNetwork_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_enums_LDKSecp256k1Error.h b/src/main/jni/org_ldk_enums_LDKSecp256k1Error.h new file mode 100644 index 00000000..f70fa7b2 --- /dev/null +++ b/src/main/jni/org_ldk_enums_LDKSecp256k1Error.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_enums_LDKSecp256k1Error */ + +#ifndef _Included_org_ldk_enums_LDKSecp256k1Error +#define _Included_org_ldk_enums_LDKSecp256k1Error +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_enums_LDKSecp256k1Error + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_enums_LDKSecp256k1Error_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings.h b/src/main/jni/org_ldk_impl_bindings.h index da0ba30a..c300ce5f 100644 --- a/src/main/jni/org_ldk_impl_bindings.h +++ b/src/main/jni/org_ldk_impl_bindings.h @@ -39,6 +39,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_deref_1long JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_free_1heap_1ptr (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: read_bytes + * Signature: (JJ)[B + */ +JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_read_1bytes + (JNIEnv *, jclass, jlong, jlong); + /* * Class: org_ldk_impl_bindings * Method: get_u8_slice_bytes @@ -199,6 +207,14 @@ JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1Signatur JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1get_1inner (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKAPIError_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKAPIError; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAPIError_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: LDKCResult_NoneAPIErrorZ_result_ok @@ -287,6 +303,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: LDKSpendableOutputDescriptor_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKSpendableOutputDescriptor; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSpendableOutputDescriptor_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: LDKCVecTempl_SpendableOutputDescriptor_arr_info @@ -295,6 +319,14 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKHTLCOutputInCommitment_1op JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1SpendableOutputDescriptor_1arr_1info (JNIEnv *, jclass, jlong); +/* + * Class: org_ldk_impl_bindings + * Method: LDKEvent_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKEvent; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: LDKAcceptChannel_optional_none @@ -399,6 +431,30 @@ JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKNodeAnnouncement_1optional JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKErrorMessage_1optional_1none (JNIEnv *, jclass); +/* + * Class: org_ldk_impl_bindings + * Method: LDKErrorAction_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKErrorAction; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKErrorAction_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKHTLCFailChannelUpdate_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKHTLCFailChannelUpdate; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKHTLCFailChannelUpdate_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); + +/* + * Class: org_ldk_impl_bindings + * Method: LDKMessageSendEvent_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKMessageSendEvent; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: LDKCVecTempl_MessageSendEvent_arr_info @@ -999,6 +1055,14 @@ JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1ChannelDetail JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRoute_1optional_1none (JNIEnv *, jclass); +/* + * Class: org_ldk_impl_bindings + * Method: LDKNetAddress_ref_from_ptr + * Signature: (J)Lorg/ldk/impl/bindings/LDKNetAddress; + */ +JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetAddress_1ref_1from_1ptr + (JNIEnv *, jclass, jlong); + /* * Class: org_ldk_impl_bindings * Method: LDKCVecTempl_NetAddress_arr_info diff --git a/src/main/jni/org_ldk_impl_bindings_LDKAPIError.h b/src/main/jni/org_ldk_impl_bindings_LDKAPIError.h new file mode 100644 index 00000000..e353be6e --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKAPIError.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKAPIError */ + +#ifndef _Included_org_ldk_impl_bindings_LDKAPIError +#define _Included_org_ldk_impl_bindings_LDKAPIError +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKAPIError + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAPIError_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKAPIError_APIMisuseError.h b/src/main/jni/org_ldk_impl_bindings_LDKAPIError_APIMisuseError.h new file mode 100644 index 00000000..d3b5f10b --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKAPIError_APIMisuseError.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKAPIError_APIMisuseError */ + +#ifndef _Included_org_ldk_impl_bindings_LDKAPIError_APIMisuseError +#define _Included_org_ldk_impl_bindings_LDKAPIError_APIMisuseError +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKAPIError_APIMisuseError + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAPIError_00024APIMisuseError_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKAPIError_ChannelUnavailable.h b/src/main/jni/org_ldk_impl_bindings_LDKAPIError_ChannelUnavailable.h new file mode 100644 index 00000000..6aa77e69 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKAPIError_ChannelUnavailable.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKAPIError_ChannelUnavailable */ + +#ifndef _Included_org_ldk_impl_bindings_LDKAPIError_ChannelUnavailable +#define _Included_org_ldk_impl_bindings_LDKAPIError_ChannelUnavailable +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKAPIError_ChannelUnavailable + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAPIError_00024ChannelUnavailable_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKAPIError_FeeRateTooHigh.h b/src/main/jni/org_ldk_impl_bindings_LDKAPIError_FeeRateTooHigh.h new file mode 100644 index 00000000..ff8cfbe2 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKAPIError_FeeRateTooHigh.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKAPIError_FeeRateTooHigh */ + +#ifndef _Included_org_ldk_impl_bindings_LDKAPIError_FeeRateTooHigh +#define _Included_org_ldk_impl_bindings_LDKAPIError_FeeRateTooHigh +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKAPIError_FeeRateTooHigh + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAPIError_00024FeeRateTooHigh_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKAPIError_MonitorUpdateFailed.h b/src/main/jni/org_ldk_impl_bindings_LDKAPIError_MonitorUpdateFailed.h new file mode 100644 index 00000000..5c5998b9 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKAPIError_MonitorUpdateFailed.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKAPIError_MonitorUpdateFailed */ + +#ifndef _Included_org_ldk_impl_bindings_LDKAPIError_MonitorUpdateFailed +#define _Included_org_ldk_impl_bindings_LDKAPIError_MonitorUpdateFailed +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKAPIError_MonitorUpdateFailed + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAPIError_00024MonitorUpdateFailed_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKAPIError_RouteError.h b/src/main/jni/org_ldk_impl_bindings_LDKAPIError_RouteError.h new file mode 100644 index 00000000..14d99aca --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKAPIError_RouteError.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKAPIError_RouteError */ + +#ifndef _Included_org_ldk_impl_bindings_LDKAPIError_RouteError +#define _Included_org_ldk_impl_bindings_LDKAPIError_RouteError +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKAPIError_RouteError + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAPIError_00024RouteError_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKErrorAction.h b/src/main/jni/org_ldk_impl_bindings_LDKErrorAction.h new file mode 100644 index 00000000..448410ef --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKErrorAction.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKErrorAction */ + +#ifndef _Included_org_ldk_impl_bindings_LDKErrorAction +#define _Included_org_ldk_impl_bindings_LDKErrorAction +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKErrorAction + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKErrorAction_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKErrorAction_DisconnectPeer.h b/src/main/jni/org_ldk_impl_bindings_LDKErrorAction_DisconnectPeer.h new file mode 100644 index 00000000..1eb1067c --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKErrorAction_DisconnectPeer.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKErrorAction_DisconnectPeer */ + +#ifndef _Included_org_ldk_impl_bindings_LDKErrorAction_DisconnectPeer +#define _Included_org_ldk_impl_bindings_LDKErrorAction_DisconnectPeer +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKErrorAction_DisconnectPeer + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKErrorAction_00024DisconnectPeer_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKErrorAction_IgnoreError.h b/src/main/jni/org_ldk_impl_bindings_LDKErrorAction_IgnoreError.h new file mode 100644 index 00000000..34280f40 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKErrorAction_IgnoreError.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKErrorAction_IgnoreError */ + +#ifndef _Included_org_ldk_impl_bindings_LDKErrorAction_IgnoreError +#define _Included_org_ldk_impl_bindings_LDKErrorAction_IgnoreError +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKErrorAction_IgnoreError + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKErrorAction_00024IgnoreError_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKErrorAction_SendErrorMessage.h b/src/main/jni/org_ldk_impl_bindings_LDKErrorAction_SendErrorMessage.h new file mode 100644 index 00000000..aa4d8db4 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKErrorAction_SendErrorMessage.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKErrorAction_SendErrorMessage */ + +#ifndef _Included_org_ldk_impl_bindings_LDKErrorAction_SendErrorMessage +#define _Included_org_ldk_impl_bindings_LDKErrorAction_SendErrorMessage +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKErrorAction_SendErrorMessage + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKErrorAction_00024SendErrorMessage_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKEvent.h b/src/main/jni/org_ldk_impl_bindings_LDKEvent.h new file mode 100644 index 00000000..5e6649c2 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKEvent.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKEvent */ + +#ifndef _Included_org_ldk_impl_bindings_LDKEvent +#define _Included_org_ldk_impl_bindings_LDKEvent +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKEvent + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKEvent_FundingBroadcastSafe.h b/src/main/jni/org_ldk_impl_bindings_LDKEvent_FundingBroadcastSafe.h new file mode 100644 index 00000000..02f80344 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKEvent_FundingBroadcastSafe.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKEvent_FundingBroadcastSafe */ + +#ifndef _Included_org_ldk_impl_bindings_LDKEvent_FundingBroadcastSafe +#define _Included_org_ldk_impl_bindings_LDKEvent_FundingBroadcastSafe +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKEvent_FundingBroadcastSafe + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_00024FundingBroadcastSafe_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKEvent_FundingGenerationReady.h b/src/main/jni/org_ldk_impl_bindings_LDKEvent_FundingGenerationReady.h new file mode 100644 index 00000000..cd05bf37 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKEvent_FundingGenerationReady.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKEvent_FundingGenerationReady */ + +#ifndef _Included_org_ldk_impl_bindings_LDKEvent_FundingGenerationReady +#define _Included_org_ldk_impl_bindings_LDKEvent_FundingGenerationReady +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKEvent_FundingGenerationReady + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_00024FundingGenerationReady_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKEvent_PaymentFailed.h b/src/main/jni/org_ldk_impl_bindings_LDKEvent_PaymentFailed.h new file mode 100644 index 00000000..ecb0d35c --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKEvent_PaymentFailed.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKEvent_PaymentFailed */ + +#ifndef _Included_org_ldk_impl_bindings_LDKEvent_PaymentFailed +#define _Included_org_ldk_impl_bindings_LDKEvent_PaymentFailed +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKEvent_PaymentFailed + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_00024PaymentFailed_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKEvent_PaymentReceived.h b/src/main/jni/org_ldk_impl_bindings_LDKEvent_PaymentReceived.h new file mode 100644 index 00000000..05951df5 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKEvent_PaymentReceived.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKEvent_PaymentReceived */ + +#ifndef _Included_org_ldk_impl_bindings_LDKEvent_PaymentReceived +#define _Included_org_ldk_impl_bindings_LDKEvent_PaymentReceived +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKEvent_PaymentReceived + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_00024PaymentReceived_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKEvent_PaymentSent.h b/src/main/jni/org_ldk_impl_bindings_LDKEvent_PaymentSent.h new file mode 100644 index 00000000..7941646c --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKEvent_PaymentSent.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKEvent_PaymentSent */ + +#ifndef _Included_org_ldk_impl_bindings_LDKEvent_PaymentSent +#define _Included_org_ldk_impl_bindings_LDKEvent_PaymentSent +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKEvent_PaymentSent + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_00024PaymentSent_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKEvent_PendingHTLCsForwardable.h b/src/main/jni/org_ldk_impl_bindings_LDKEvent_PendingHTLCsForwardable.h new file mode 100644 index 00000000..66803a67 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKEvent_PendingHTLCsForwardable.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKEvent_PendingHTLCsForwardable */ + +#ifndef _Included_org_ldk_impl_bindings_LDKEvent_PendingHTLCsForwardable +#define _Included_org_ldk_impl_bindings_LDKEvent_PendingHTLCsForwardable +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKEvent_PendingHTLCsForwardable + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_00024PendingHTLCsForwardable_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKEvent_SpendableOutputs.h b/src/main/jni/org_ldk_impl_bindings_LDKEvent_SpendableOutputs.h new file mode 100644 index 00000000..4c789f4a --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKEvent_SpendableOutputs.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKEvent_SpendableOutputs */ + +#ifndef _Included_org_ldk_impl_bindings_LDKEvent_SpendableOutputs +#define _Included_org_ldk_impl_bindings_LDKEvent_SpendableOutputs +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKEvent_SpendableOutputs + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_00024SpendableOutputs_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKHTLCFailChannelUpdate.h b/src/main/jni/org_ldk_impl_bindings_LDKHTLCFailChannelUpdate.h new file mode 100644 index 00000000..e14bad00 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKHTLCFailChannelUpdate.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKHTLCFailChannelUpdate */ + +#ifndef _Included_org_ldk_impl_bindings_LDKHTLCFailChannelUpdate +#define _Included_org_ldk_impl_bindings_LDKHTLCFailChannelUpdate +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKHTLCFailChannelUpdate + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKHTLCFailChannelUpdate_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKHTLCFailChannelUpdate_ChannelClosed.h b/src/main/jni/org_ldk_impl_bindings_LDKHTLCFailChannelUpdate_ChannelClosed.h new file mode 100644 index 00000000..25f3ed0f --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKHTLCFailChannelUpdate_ChannelClosed.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKHTLCFailChannelUpdate_ChannelClosed */ + +#ifndef _Included_org_ldk_impl_bindings_LDKHTLCFailChannelUpdate_ChannelClosed +#define _Included_org_ldk_impl_bindings_LDKHTLCFailChannelUpdate_ChannelClosed +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKHTLCFailChannelUpdate_ChannelClosed + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKHTLCFailChannelUpdate_00024ChannelClosed_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKHTLCFailChannelUpdate_ChannelUpdateMessage.h b/src/main/jni/org_ldk_impl_bindings_LDKHTLCFailChannelUpdate_ChannelUpdateMessage.h new file mode 100644 index 00000000..b7e137d2 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKHTLCFailChannelUpdate_ChannelUpdateMessage.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKHTLCFailChannelUpdate_ChannelUpdateMessage */ + +#ifndef _Included_org_ldk_impl_bindings_LDKHTLCFailChannelUpdate_ChannelUpdateMessage +#define _Included_org_ldk_impl_bindings_LDKHTLCFailChannelUpdate_ChannelUpdateMessage +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKHTLCFailChannelUpdate_ChannelUpdateMessage + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKHTLCFailChannelUpdate_00024ChannelUpdateMessage_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKHTLCFailChannelUpdate_NodeFailure.h b/src/main/jni/org_ldk_impl_bindings_LDKHTLCFailChannelUpdate_NodeFailure.h new file mode 100644 index 00000000..02b60ca3 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKHTLCFailChannelUpdate_NodeFailure.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKHTLCFailChannelUpdate_NodeFailure */ + +#ifndef _Included_org_ldk_impl_bindings_LDKHTLCFailChannelUpdate_NodeFailure +#define _Included_org_ldk_impl_bindings_LDKHTLCFailChannelUpdate_NodeFailure +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKHTLCFailChannelUpdate_NodeFailure + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKHTLCFailChannelUpdate_00024NodeFailure_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent.h b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent.h new file mode 100644 index 00000000..a95768ac --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKMessageSendEvent */ + +#ifndef _Included_org_ldk_impl_bindings_LDKMessageSendEvent +#define _Included_org_ldk_impl_bindings_LDKMessageSendEvent +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKMessageSendEvent + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendEvent_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_BroadcastChannelAnnouncement.h b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_BroadcastChannelAnnouncement.h new file mode 100644 index 00000000..5eecaa53 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_BroadcastChannelAnnouncement.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKMessageSendEvent_BroadcastChannelAnnouncement */ + +#ifndef _Included_org_ldk_impl_bindings_LDKMessageSendEvent_BroadcastChannelAnnouncement +#define _Included_org_ldk_impl_bindings_LDKMessageSendEvent_BroadcastChannelAnnouncement +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKMessageSendEvent_BroadcastChannelAnnouncement + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendEvent_00024BroadcastChannelAnnouncement_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_BroadcastChannelUpdate.h b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_BroadcastChannelUpdate.h new file mode 100644 index 00000000..4f46bdc5 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_BroadcastChannelUpdate.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKMessageSendEvent_BroadcastChannelUpdate */ + +#ifndef _Included_org_ldk_impl_bindings_LDKMessageSendEvent_BroadcastChannelUpdate +#define _Included_org_ldk_impl_bindings_LDKMessageSendEvent_BroadcastChannelUpdate +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKMessageSendEvent_BroadcastChannelUpdate + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendEvent_00024BroadcastChannelUpdate_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_BroadcastNodeAnnouncement.h b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_BroadcastNodeAnnouncement.h new file mode 100644 index 00000000..e05f157a --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_BroadcastNodeAnnouncement.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKMessageSendEvent_BroadcastNodeAnnouncement */ + +#ifndef _Included_org_ldk_impl_bindings_LDKMessageSendEvent_BroadcastNodeAnnouncement +#define _Included_org_ldk_impl_bindings_LDKMessageSendEvent_BroadcastNodeAnnouncement +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKMessageSendEvent_BroadcastNodeAnnouncement + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendEvent_00024BroadcastNodeAnnouncement_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_HandleError.h b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_HandleError.h new file mode 100644 index 00000000..4952139e --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_HandleError.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKMessageSendEvent_HandleError */ + +#ifndef _Included_org_ldk_impl_bindings_LDKMessageSendEvent_HandleError +#define _Included_org_ldk_impl_bindings_LDKMessageSendEvent_HandleError +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKMessageSendEvent_HandleError + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendEvent_00024HandleError_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_PaymentFailureNetworkUpdate.h b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_PaymentFailureNetworkUpdate.h new file mode 100644 index 00000000..2002da32 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_PaymentFailureNetworkUpdate.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKMessageSendEvent_PaymentFailureNetworkUpdate */ + +#ifndef _Included_org_ldk_impl_bindings_LDKMessageSendEvent_PaymentFailureNetworkUpdate +#define _Included_org_ldk_impl_bindings_LDKMessageSendEvent_PaymentFailureNetworkUpdate +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKMessageSendEvent_PaymentFailureNetworkUpdate + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendEvent_00024PaymentFailureNetworkUpdate_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_SendAcceptChannel.h b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_SendAcceptChannel.h new file mode 100644 index 00000000..007357cc --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_SendAcceptChannel.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKMessageSendEvent_SendAcceptChannel */ + +#ifndef _Included_org_ldk_impl_bindings_LDKMessageSendEvent_SendAcceptChannel +#define _Included_org_ldk_impl_bindings_LDKMessageSendEvent_SendAcceptChannel +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKMessageSendEvent_SendAcceptChannel + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendEvent_00024SendAcceptChannel_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_SendAnnouncementSignatures.h b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_SendAnnouncementSignatures.h new file mode 100644 index 00000000..12c51218 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_SendAnnouncementSignatures.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKMessageSendEvent_SendAnnouncementSignatures */ + +#ifndef _Included_org_ldk_impl_bindings_LDKMessageSendEvent_SendAnnouncementSignatures +#define _Included_org_ldk_impl_bindings_LDKMessageSendEvent_SendAnnouncementSignatures +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKMessageSendEvent_SendAnnouncementSignatures + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendEvent_00024SendAnnouncementSignatures_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_SendChannelReestablish.h b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_SendChannelReestablish.h new file mode 100644 index 00000000..fa5ccd45 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_SendChannelReestablish.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKMessageSendEvent_SendChannelReestablish */ + +#ifndef _Included_org_ldk_impl_bindings_LDKMessageSendEvent_SendChannelReestablish +#define _Included_org_ldk_impl_bindings_LDKMessageSendEvent_SendChannelReestablish +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKMessageSendEvent_SendChannelReestablish + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendEvent_00024SendChannelReestablish_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_SendClosingSigned.h b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_SendClosingSigned.h new file mode 100644 index 00000000..1301549b --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_SendClosingSigned.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKMessageSendEvent_SendClosingSigned */ + +#ifndef _Included_org_ldk_impl_bindings_LDKMessageSendEvent_SendClosingSigned +#define _Included_org_ldk_impl_bindings_LDKMessageSendEvent_SendClosingSigned +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKMessageSendEvent_SendClosingSigned + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendEvent_00024SendClosingSigned_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_SendFundingCreated.h b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_SendFundingCreated.h new file mode 100644 index 00000000..0071ad8d --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_SendFundingCreated.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKMessageSendEvent_SendFundingCreated */ + +#ifndef _Included_org_ldk_impl_bindings_LDKMessageSendEvent_SendFundingCreated +#define _Included_org_ldk_impl_bindings_LDKMessageSendEvent_SendFundingCreated +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKMessageSendEvent_SendFundingCreated + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendEvent_00024SendFundingCreated_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_SendFundingLocked.h b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_SendFundingLocked.h new file mode 100644 index 00000000..33536750 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_SendFundingLocked.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKMessageSendEvent_SendFundingLocked */ + +#ifndef _Included_org_ldk_impl_bindings_LDKMessageSendEvent_SendFundingLocked +#define _Included_org_ldk_impl_bindings_LDKMessageSendEvent_SendFundingLocked +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKMessageSendEvent_SendFundingLocked + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendEvent_00024SendFundingLocked_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_SendFundingSigned.h b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_SendFundingSigned.h new file mode 100644 index 00000000..f7b7e8de --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_SendFundingSigned.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKMessageSendEvent_SendFundingSigned */ + +#ifndef _Included_org_ldk_impl_bindings_LDKMessageSendEvent_SendFundingSigned +#define _Included_org_ldk_impl_bindings_LDKMessageSendEvent_SendFundingSigned +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKMessageSendEvent_SendFundingSigned + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendEvent_00024SendFundingSigned_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_SendOpenChannel.h b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_SendOpenChannel.h new file mode 100644 index 00000000..df296b64 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_SendOpenChannel.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKMessageSendEvent_SendOpenChannel */ + +#ifndef _Included_org_ldk_impl_bindings_LDKMessageSendEvent_SendOpenChannel +#define _Included_org_ldk_impl_bindings_LDKMessageSendEvent_SendOpenChannel +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKMessageSendEvent_SendOpenChannel + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendEvent_00024SendOpenChannel_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_SendRevokeAndACK.h b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_SendRevokeAndACK.h new file mode 100644 index 00000000..804bf805 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_SendRevokeAndACK.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKMessageSendEvent_SendRevokeAndACK */ + +#ifndef _Included_org_ldk_impl_bindings_LDKMessageSendEvent_SendRevokeAndACK +#define _Included_org_ldk_impl_bindings_LDKMessageSendEvent_SendRevokeAndACK +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKMessageSendEvent_SendRevokeAndACK + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendEvent_00024SendRevokeAndACK_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_SendShutdown.h b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_SendShutdown.h new file mode 100644 index 00000000..e3ee1639 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_SendShutdown.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKMessageSendEvent_SendShutdown */ + +#ifndef _Included_org_ldk_impl_bindings_LDKMessageSendEvent_SendShutdown +#define _Included_org_ldk_impl_bindings_LDKMessageSendEvent_SendShutdown +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKMessageSendEvent_SendShutdown + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendEvent_00024SendShutdown_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_UpdateHTLCs.h b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_UpdateHTLCs.h new file mode 100644 index 00000000..324fcce2 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKMessageSendEvent_UpdateHTLCs.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKMessageSendEvent_UpdateHTLCs */ + +#ifndef _Included_org_ldk_impl_bindings_LDKMessageSendEvent_UpdateHTLCs +#define _Included_org_ldk_impl_bindings_LDKMessageSendEvent_UpdateHTLCs +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKMessageSendEvent_UpdateHTLCs + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendEvent_00024UpdateHTLCs_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKNetAddress.h b/src/main/jni/org_ldk_impl_bindings_LDKNetAddress.h new file mode 100644 index 00000000..ab3d6ed6 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKNetAddress.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKNetAddress */ + +#ifndef _Included_org_ldk_impl_bindings_LDKNetAddress +#define _Included_org_ldk_impl_bindings_LDKNetAddress +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKNetAddress + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNetAddress_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKNetAddress_IPv4.h b/src/main/jni/org_ldk_impl_bindings_LDKNetAddress_IPv4.h new file mode 100644 index 00000000..581a5c77 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKNetAddress_IPv4.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKNetAddress_IPv4 */ + +#ifndef _Included_org_ldk_impl_bindings_LDKNetAddress_IPv4 +#define _Included_org_ldk_impl_bindings_LDKNetAddress_IPv4 +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKNetAddress_IPv4 + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNetAddress_00024IPv4_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKNetAddress_IPv6.h b/src/main/jni/org_ldk_impl_bindings_LDKNetAddress_IPv6.h new file mode 100644 index 00000000..5ceb866b --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKNetAddress_IPv6.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKNetAddress_IPv6 */ + +#ifndef _Included_org_ldk_impl_bindings_LDKNetAddress_IPv6 +#define _Included_org_ldk_impl_bindings_LDKNetAddress_IPv6 +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKNetAddress_IPv6 + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNetAddress_00024IPv6_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKNetAddress_OnionV2.h b/src/main/jni/org_ldk_impl_bindings_LDKNetAddress_OnionV2.h new file mode 100644 index 00000000..074e2802 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKNetAddress_OnionV2.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKNetAddress_OnionV2 */ + +#ifndef _Included_org_ldk_impl_bindings_LDKNetAddress_OnionV2 +#define _Included_org_ldk_impl_bindings_LDKNetAddress_OnionV2 +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKNetAddress_OnionV2 + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNetAddress_00024OnionV2_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKNetAddress_OnionV3.h b/src/main/jni/org_ldk_impl_bindings_LDKNetAddress_OnionV3.h new file mode 100644 index 00000000..57ebe381 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKNetAddress_OnionV3.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKNetAddress_OnionV3 */ + +#ifndef _Included_org_ldk_impl_bindings_LDKNetAddress_OnionV3 +#define _Included_org_ldk_impl_bindings_LDKNetAddress_OnionV3 +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKNetAddress_OnionV3 + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNetAddress_00024OnionV3_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKSpendableOutputDescriptor.h b/src/main/jni/org_ldk_impl_bindings_LDKSpendableOutputDescriptor.h new file mode 100644 index 00000000..c8a0faac --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKSpendableOutputDescriptor.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKSpendableOutputDescriptor */ + +#ifndef _Included_org_ldk_impl_bindings_LDKSpendableOutputDescriptor +#define _Included_org_ldk_impl_bindings_LDKSpendableOutputDescriptor +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKSpendableOutputDescriptor + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSpendableOutputDescriptor_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKSpendableOutputDescriptor_DynamicOutputP2WSH.h b/src/main/jni/org_ldk_impl_bindings_LDKSpendableOutputDescriptor_DynamicOutputP2WSH.h new file mode 100644 index 00000000..82593888 --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKSpendableOutputDescriptor_DynamicOutputP2WSH.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKSpendableOutputDescriptor_DynamicOutputP2WSH */ + +#ifndef _Included_org_ldk_impl_bindings_LDKSpendableOutputDescriptor_DynamicOutputP2WSH +#define _Included_org_ldk_impl_bindings_LDKSpendableOutputDescriptor_DynamicOutputP2WSH +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKSpendableOutputDescriptor_DynamicOutputP2WSH + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSpendableOutputDescriptor_00024DynamicOutputP2WSH_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKSpendableOutputDescriptor_StaticOutput.h b/src/main/jni/org_ldk_impl_bindings_LDKSpendableOutputDescriptor_StaticOutput.h new file mode 100644 index 00000000..f42e2bfb --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKSpendableOutputDescriptor_StaticOutput.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKSpendableOutputDescriptor_StaticOutput */ + +#ifndef _Included_org_ldk_impl_bindings_LDKSpendableOutputDescriptor_StaticOutput +#define _Included_org_ldk_impl_bindings_LDKSpendableOutputDescriptor_StaticOutput +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKSpendableOutputDescriptor_StaticOutput + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSpendableOutputDescriptor_00024StaticOutput_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/main/jni/org_ldk_impl_bindings_LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment.h b/src/main/jni/org_ldk_impl_bindings_LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment.h new file mode 100644 index 00000000..eff5b26b --- /dev/null +++ b/src/main/jni/org_ldk_impl_bindings_LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class org_ldk_impl_bindings_LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment */ + +#ifndef _Included_org_ldk_impl_bindings_LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment +#define _Included_org_ldk_impl_bindings_LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: org_ldk_impl_bindings_LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment + * Method: init + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSpendableOutputDescriptor_00024StaticOutputCounterpartyPayment_init + (JNIEnv *, jclass); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/src/test/java/org/ldk/PeerTest.java b/src/test/java/org/ldk/PeerTest.java index 8ff630d7..17f3cf2a 100644 --- a/src/test/java/org/ldk/PeerTest.java +++ b/src/test/java/org/ldk/PeerTest.java @@ -140,7 +140,7 @@ public class PeerTest { while (!list.isEmpty()) { list.poll().join(); } - long cc_res = bindings.ChannelManager_create_channel(peer1.chan_manager, bindings.ChannelManager_get_our_node_id(peer2.chan_manager), 10000, 1000, 0, bindings.LDKUserConfig_optional_none()); + long cc_res = bindings.ChannelManager_create_channel(peer1.chan_manager, bindings.ChannelManager_get_our_node_id(peer2.chan_manager), 10000, 1000, 42, bindings.LDKUserConfig_optional_none()); assert bindings.LDKCResult_NoneAPIErrorZ_result_ok(cc_res); bindings.CResult_NoneAPIErrorZ_free(cc_res); @@ -152,12 +152,20 @@ public class PeerTest { long events = bindings.LDKEventsProvider_call_get_and_clear_pending_events(peer1.chan_manager_events); bindings.VecOrSliceDef events_arr_info = bindings.LDKCVecTempl_Event_arr_info(events); assert events_arr_info.datalen == 1; + bindings.LDKEvent event = bindings.LDKEvent_ref_from_ptr(events_arr_info.dataptr); + assert event instanceof bindings.LDKEvent.FundingGenerationReady; + assert ((bindings.LDKEvent.FundingGenerationReady)event).channel_value_satoshis == 10000; + assert ((bindings.LDKEvent.FundingGenerationReady)event).user_channel_id == 42; + assert bindings.get_u8_slice_bytes(((bindings.LDKEvent.FundingGenerationReady)event).output_script).length == 34; + byte[] chan_id = bindings.read_bytes(((bindings.LDKEvent.FundingGenerationReady)event).temporary_channel_id, 32); bindings.CVec_EventZ_free(events); long peer1_chans = bindings.ChannelManager_list_channels(peer1.chan_manager); long peer2_chans = bindings.ChannelManager_list_channels(peer2.chan_manager); assert bindings.vec_slice_len(peer1_chans) == 1; assert bindings.vec_slice_len(peer2_chans) == 1; + assert java.util.Arrays.equals(bindings.ChannelDetails_get_channel_id(bindings.LDKCVecTempl_ChannelDetails_arr_info(peer1_chans).dataptr), chan_id); + assert java.util.Arrays.equals(bindings.ChannelDetails_get_channel_id(bindings.LDKCVecTempl_ChannelDetails_arr_info(peer2_chans).dataptr), chan_id); bindings.CVec_ChannelDetailsZ_free(peer1_chans); bindings.CVec_ChannelDetailsZ_free(peer2_chans);