out_c.write("\treturn (long)res_ptr;\n")
out_c.write("}\n")
+ out_java.write("\tpublic static native " + struct_name + " " + struct_name + "_get_obj_from_jcalls(long val);\n")
+ out_c.write("JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_" + struct_name.replace("_", "_1") + "_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {\n")
+ out_c.write("\treturn ((" + struct_name + "_JCalls*)val)->o;\n")
+ out_c.write("}\n")
out_java.write("""package org.ldk.impl;
long get_and_clear_pending_msg_events();
}
public static native long LDKMessageSendEventsProvider_new(LDKMessageSendEventsProvider impl);
+ public static native LDKMessageSendEventsProvider LDKMessageSendEventsProvider_get_obj_from_jcalls(long val);
public interface LDKEventsProvider {
long get_and_clear_pending_events();
}
public static native long LDKEventsProvider_new(LDKEventsProvider impl);
+ public static native LDKEventsProvider LDKEventsProvider_get_obj_from_jcalls(long val);
public interface LDKLogger {
void log(String record);
}
public static native long LDKLogger_new(LDKLogger impl);
+ public static native LDKLogger LDKLogger_get_obj_from_jcalls(long val);
public interface LDKAccess {
long get_utxo(byte[] genesis_hash, long short_channel_id);
}
public static native long LDKAccess_new(LDKAccess impl);
+ public static native LDKAccess LDKAccess_get_obj_from_jcalls(long val);
public interface LDKChannelKeys {
long get_per_commitment_point(long idx);
long release_commitment_secret(long idx);
void on_accept(long channel_points, short counterparty_selected_contest_delay, short holder_selected_contest_delay);
}
public static native long LDKChannelKeys_new(LDKChannelKeys impl);
+ public static native LDKChannelKeys LDKChannelKeys_get_obj_from_jcalls(long val);
public interface LDKWatch {
long watch_channel(long funding_txo, long monitor);
long update_channel(long funding_txo, long update);
long release_pending_monitor_events();
}
public static native long LDKWatch_new(LDKWatch impl);
+ public static native LDKWatch LDKWatch_get_obj_from_jcalls(long val);
public interface LDKFilter {
void register_tx(byte[] txid, long script_pubkey);
void register_output(long outpoint, long script_pubkey);
}
public static native long LDKFilter_new(LDKFilter impl);
+ public static native LDKFilter LDKFilter_get_obj_from_jcalls(long val);
public interface LDKBroadcasterInterface {
void broadcast_transaction(long tx);
}
public static native long LDKBroadcasterInterface_new(LDKBroadcasterInterface impl);
+ public static native LDKBroadcasterInterface LDKBroadcasterInterface_get_obj_from_jcalls(long val);
public interface LDKFeeEstimator {
int get_est_sat_per_1000_weight(LDKConfirmationTarget confirmation_target);
}
public static native long LDKFeeEstimator_new(LDKFeeEstimator impl);
+ public static native LDKFeeEstimator LDKFeeEstimator_get_obj_from_jcalls(long val);
public interface LDKKeysInterface {
long get_node_secret();
long get_destination_script();
long get_secure_random_bytes();
}
public static native long LDKKeysInterface_new(LDKKeysInterface impl);
+ public static native LDKKeysInterface LDKKeysInterface_get_obj_from_jcalls(long val);
public interface LDKChannelMessageHandler {
void handle_open_channel(long their_node_id, long their_features, long msg);
void handle_accept_channel(long their_node_id, long their_features, long msg);
void handle_error(long their_node_id, long msg);
}
public static native long LDKChannelMessageHandler_new(LDKChannelMessageHandler impl, LDKMessageSendEventsProvider MessageSendEventsProvider);
+ public static native LDKChannelMessageHandler LDKChannelMessageHandler_get_obj_from_jcalls(long val);
public interface LDKRoutingMessageHandler {
long handle_node_announcement(long msg);
long handle_channel_announcement(long msg);
boolean should_request_full_sync(long node_id);
}
public static native long LDKRoutingMessageHandler_new(LDKRoutingMessageHandler impl);
+ public static native LDKRoutingMessageHandler LDKRoutingMessageHandler_get_obj_from_jcalls(long val);
public interface LDKSocketDescriptor {
long send_data(long data, boolean resume_read);
void disconnect_socket();
long hash();
}
public static native long LDKSocketDescriptor_new(LDKSocketDescriptor impl);
+ public static native LDKSocketDescriptor LDKSocketDescriptor_get_obj_from_jcalls(long val);
/// extern const void (*C2Tuple_HTLCOutputInCommitmentSignatureZ_free)(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ);
public static native void C2Tuple_HTLCOutputInCommitmentSignatureZ_free(long arg);
/// extern const void (*C2Tuple_OutPointScriptZ_free)(LDKC2Tuple_OutPointScriptZ);
*res_ptr = LDKMessageSendEventsProvider_init(env, _a, o);
return (long)res_ptr;
}
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
+ return ((LDKMessageSendEventsProvider_JCalls*)val)->o;
+}
typedef struct LDKEventsProvider_JCalls {
atomic_size_t refcnt;
JNIEnv *env;
*res_ptr = LDKEventsProvider_init(env, _a, o);
return (long)res_ptr;
}
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
+ return ((LDKEventsProvider_JCalls*)val)->o;
+}
typedef struct LDKLogger_JCalls {
atomic_size_t refcnt;
JNIEnv *env;
*res_ptr = LDKLogger_init(env, _a, o);
return (long)res_ptr;
}
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKLogger_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
+ return ((LDKLogger_JCalls*)val)->o;
+}
typedef struct LDKAccess_JCalls {
atomic_size_t refcnt;
JNIEnv *env;
*res_ptr = LDKAccess_init(env, _a, o);
return (long)res_ptr;
}
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAccess_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
+ return ((LDKAccess_JCalls*)val)->o;
+}
typedef struct LDKChannelKeys_JCalls {
atomic_size_t refcnt;
JNIEnv *env;
*res_ptr = LDKChannelKeys_init(env, _a, o);
return (long)res_ptr;
}
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
+ return ((LDKChannelKeys_JCalls*)val)->o;
+}
typedef struct LDKWatch_JCalls {
atomic_size_t refcnt;
JNIEnv *env;
*res_ptr = LDKWatch_init(env, _a, o);
return (long)res_ptr;
}
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKWatch_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
+ return ((LDKWatch_JCalls*)val)->o;
+}
typedef struct LDKFilter_JCalls {
atomic_size_t refcnt;
JNIEnv *env;
*res_ptr = LDKFilter_init(env, _a, o);
return (long)res_ptr;
}
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFilter_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
+ return ((LDKFilter_JCalls*)val)->o;
+}
typedef struct LDKBroadcasterInterface_JCalls {
atomic_size_t refcnt;
JNIEnv *env;
*res_ptr = LDKBroadcasterInterface_init(env, _a, o);
return (long)res_ptr;
}
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
+ return ((LDKBroadcasterInterface_JCalls*)val)->o;
+}
typedef struct LDKFeeEstimator_JCalls {
atomic_size_t refcnt;
JNIEnv *env;
*res_ptr = LDKFeeEstimator_init(env, _a, o);
return (long)res_ptr;
}
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
+ return ((LDKFeeEstimator_JCalls*)val)->o;
+}
typedef struct LDKKeysInterface_JCalls {
atomic_size_t refcnt;
JNIEnv *env;
*res_ptr = LDKKeysInterface_init(env, _a, o);
return (long)res_ptr;
}
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
+ return ((LDKKeysInterface_JCalls*)val)->o;
+}
typedef struct LDKChannelMessageHandler_JCalls {
atomic_size_t refcnt;
JNIEnv *env;
*res_ptr = LDKChannelMessageHandler_init(env, _a, o, MessageSendEventsProvider);
return (long)res_ptr;
}
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
+ return ((LDKChannelMessageHandler_JCalls*)val)->o;
+}
typedef struct LDKRoutingMessageHandler_JCalls {
atomic_size_t refcnt;
JNIEnv *env;
*res_ptr = LDKRoutingMessageHandler_init(env, _a, o);
return (long)res_ptr;
}
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
+ return ((LDKRoutingMessageHandler_JCalls*)val)->o;
+}
typedef struct LDKSocketDescriptor_JCalls {
atomic_size_t refcnt;
JNIEnv *env;
*res_ptr = LDKSocketDescriptor_init(env, _a, o);
return (long)res_ptr;
}
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
+ return ((LDKSocketDescriptor_JCalls*)val)->o;
+}
JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HTLCOutputInCommitmentSignatureZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
LDKC2Tuple_HTLCOutputInCommitmentSignatureZ arg_conv = *(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ*)arg;
FREE((void*)arg);
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1new
(JNIEnv *, jclass, jobject);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKMessageSendEventsProvider_get_obj_from_jcalls
+ * Signature: (J)Lorg/ldk/impl/bindings/LDKMessageSendEventsProvider;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1get_1obj_1from_1jcalls
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: LDKEventsProvider_new
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1new
(JNIEnv *, jclass, jobject);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKEventsProvider_get_obj_from_jcalls
+ * Signature: (J)Lorg/ldk/impl/bindings/LDKEventsProvider;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1get_1obj_1from_1jcalls
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: LDKLogger_new
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKLogger_1new
(JNIEnv *, jclass, jobject);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKLogger_get_obj_from_jcalls
+ * Signature: (J)Lorg/ldk/impl/bindings/LDKLogger;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKLogger_1get_1obj_1from_1jcalls
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: LDKAccess_new
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKAccess_1new
(JNIEnv *, jclass, jobject);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKAccess_get_obj_from_jcalls
+ * Signature: (J)Lorg/ldk/impl/bindings/LDKAccess;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAccess_1get_1obj_1from_1jcalls
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: LDKChannelKeys_new
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1new
(JNIEnv *, jclass, jobject);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKChannelKeys_get_obj_from_jcalls
+ * Signature: (J)Lorg/ldk/impl/bindings/LDKChannelKeys;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1get_1obj_1from_1jcalls
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: LDKWatch_new
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKWatch_1new
(JNIEnv *, jclass, jobject);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKWatch_get_obj_from_jcalls
+ * Signature: (J)Lorg/ldk/impl/bindings/LDKWatch;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKWatch_1get_1obj_1from_1jcalls
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: LDKFilter_new
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKFilter_1new
(JNIEnv *, jclass, jobject);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKFilter_get_obj_from_jcalls
+ * Signature: (J)Lorg/ldk/impl/bindings/LDKFilter;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFilter_1get_1obj_1from_1jcalls
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: LDKBroadcasterInterface_new
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1new
(JNIEnv *, jclass, jobject);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKBroadcasterInterface_get_obj_from_jcalls
+ * Signature: (J)Lorg/ldk/impl/bindings/LDKBroadcasterInterface;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1get_1obj_1from_1jcalls
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: LDKFeeEstimator_new
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1new
(JNIEnv *, jclass, jobject);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKFeeEstimator_get_obj_from_jcalls
+ * Signature: (J)Lorg/ldk/impl/bindings/LDKFeeEstimator;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1get_1obj_1from_1jcalls
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: LDKKeysInterface_new
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1new
(JNIEnv *, jclass, jobject);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKKeysInterface_get_obj_from_jcalls
+ * Signature: (J)Lorg/ldk/impl/bindings/LDKKeysInterface;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1get_1obj_1from_1jcalls
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: LDKChannelMessageHandler_new
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1new
(JNIEnv *, jclass, jobject, jobject);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKChannelMessageHandler_get_obj_from_jcalls
+ * Signature: (J)Lorg/ldk/impl/bindings/LDKChannelMessageHandler;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1get_1obj_1from_1jcalls
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: LDKRoutingMessageHandler_new
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1new
(JNIEnv *, jclass, jobject);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKRoutingMessageHandler_get_obj_from_jcalls
+ * Signature: (J)Lorg/ldk/impl/bindings/LDKRoutingMessageHandler;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1get_1obj_1from_1jcalls
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: LDKSocketDescriptor_new
JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1new
(JNIEnv *, jclass, jobject);
+/*
+ * Class: org_ldk_impl_bindings
+ * Method: LDKSocketDescriptor_get_obj_from_jcalls
+ * Signature: (J)Lorg/ldk/impl/bindings/LDKSocketDescriptor;
+ */
+JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1get_1obj_1from_1jcalls
+ (JNIEnv *, jclass, jlong);
+
/*
* Class: org_ldk_impl_bindings
* Method: C2Tuple_HTLCOutputInCommitmentSignatureZ_free