-JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C3TupleTempl_1ChannelAnnouncement_1_1ChannelUpdate_1_1ChannelUpdate_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
- LDKCVecTempl_C3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate *vec = (LDKCVecTempl_C3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate*)ptr;
- return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate));
-}
-JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1NodeAnnouncement_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
- LDKCVecTempl_NodeAnnouncement *vec = (LDKCVecTempl_NodeAnnouncement*)ptr;
- return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKNodeAnnouncement));
-}
-typedef struct LDKRoutingMessageHandler_JCalls {
- atomic_size_t refcnt;
- JavaVM *vm;
- jobject o;
- jmethodID handle_node_announcement_meth;
- jmethodID handle_channel_announcement_meth;
- jmethodID handle_channel_update_meth;
- jmethodID handle_htlc_fail_channel_update_meth;
- jmethodID get_next_channel_announcements_meth;
- jmethodID get_next_node_announcements_meth;
- jmethodID should_request_full_sync_meth;
-} LDKRoutingMessageHandler_JCalls;
-LDKCResult_boolLightningErrorZ handle_node_announcement_jcall(const void* this_arg, const LDKNodeAnnouncement *msg) {
- LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
- JNIEnv *env;
- DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
- LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->handle_node_announcement_meth, msg);
- LDKCResult_boolLightningErrorZ res = *ret;
- FREE(ret);
- return res;
-}
-LDKCResult_boolLightningErrorZ handle_channel_announcement_jcall(const void* this_arg, const LDKChannelAnnouncement *msg) {
- LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
- JNIEnv *env;
- DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
- LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->handle_channel_announcement_meth, msg);
- LDKCResult_boolLightningErrorZ res = *ret;
- FREE(ret);
- return res;
-}
-LDKCResult_boolLightningErrorZ handle_channel_update_jcall(const void* this_arg, const LDKChannelUpdate *msg) {
- LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
- JNIEnv *env;
- DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
- LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->handle_channel_update_meth, msg);
- LDKCResult_boolLightningErrorZ res = *ret;
- FREE(ret);
- return res;
-}
-void handle_htlc_fail_channel_update_jcall(const void* this_arg, const LDKHTLCFailChannelUpdate *update) {
- LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
- JNIEnv *env;
- DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
- return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_htlc_fail_channel_update_meth, update);
-}
-LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcements_jcall(const void* this_arg, uint64_t starting_point, uint8_t batch_amount) {
- LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
- JNIEnv *env;
- DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
- LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* ret = (LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->get_next_channel_announcements_meth, starting_point, batch_amount);
- LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ res = *ret;
- FREE(ret);
- return res;
-}
-LDKCVec_NodeAnnouncementZ get_next_node_announcements_jcall(const void* this_arg, LDKPublicKey starting_point, uint8_t batch_amount) {
- LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
- JNIEnv *env;
- DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
- long starting_point_ref = (long)&starting_point;
- LDKCVec_NodeAnnouncementZ* ret = (LDKCVec_NodeAnnouncementZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->get_next_node_announcements_meth, starting_point_ref, batch_amount);
- LDKCVec_NodeAnnouncementZ res = *ret;
- FREE(ret);
- return res;
-}
-bool should_request_full_sync_jcall(const void* this_arg, LDKPublicKey node_id) {
- LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
- JNIEnv *env;
- DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
- long node_id_ref = (long)&node_id;
- return (*env)->CallBooleanMethod(env, j_calls->o, j_calls->should_request_full_sync_meth, node_id_ref);
-}
-static void LDKRoutingMessageHandler_JCalls_free(void* this_arg) {
- LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
- if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
- JNIEnv *env;
- DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
- (*env)->DeleteGlobalRef(env, j_calls->o);
- FREE(j_calls);
- }
-}
-static void* LDKRoutingMessageHandler_JCalls_clone(const void* this_arg) {
- LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
- atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
- return (void*) this_arg;
-}
-static inline LDKRoutingMessageHandler LDKRoutingMessageHandler_init (JNIEnv * env, jclass _a, jobject o) {
- jclass c = (*env)->GetObjectClass(env, o);
- DO_ASSERT(c != NULL);
- LDKRoutingMessageHandler_JCalls *calls = MALLOC(sizeof(LDKRoutingMessageHandler_JCalls), "LDKRoutingMessageHandler_JCalls");
- atomic_init(&calls->refcnt, 1);
- DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
- calls->o = (*env)->NewGlobalRef(env, o);
- calls->handle_node_announcement_meth = (*env)->GetMethodID(env, c, "handle_node_announcement", "(J)J");
- DO_ASSERT(calls->handle_node_announcement_meth != NULL);
- calls->handle_channel_announcement_meth = (*env)->GetMethodID(env, c, "handle_channel_announcement", "(J)J");
- DO_ASSERT(calls->handle_channel_announcement_meth != NULL);
- calls->handle_channel_update_meth = (*env)->GetMethodID(env, c, "handle_channel_update", "(J)J");
- DO_ASSERT(calls->handle_channel_update_meth != NULL);
- calls->handle_htlc_fail_channel_update_meth = (*env)->GetMethodID(env, c, "handle_htlc_fail_channel_update", "(J)V");
- DO_ASSERT(calls->handle_htlc_fail_channel_update_meth != NULL);
- calls->get_next_channel_announcements_meth = (*env)->GetMethodID(env, c, "get_next_channel_announcements", "(JB)J");
- DO_ASSERT(calls->get_next_channel_announcements_meth != NULL);
- calls->get_next_node_announcements_meth = (*env)->GetMethodID(env, c, "get_next_node_announcements", "(JB)J");
- DO_ASSERT(calls->get_next_node_announcements_meth != NULL);
- calls->should_request_full_sync_meth = (*env)->GetMethodID(env, c, "should_request_full_sync", "(J)Z");
- DO_ASSERT(calls->should_request_full_sync_meth != NULL);
-
- LDKRoutingMessageHandler ret = {
- .this_arg = (void*) calls,
- .handle_node_announcement = handle_node_announcement_jcall,
- .handle_channel_announcement = handle_channel_announcement_jcall,
- .handle_channel_update = handle_channel_update_jcall,
- .handle_htlc_fail_channel_update = handle_htlc_fail_channel_update_jcall,
- .get_next_channel_announcements = get_next_channel_announcements_jcall,
- .get_next_node_announcements = get_next_node_announcements_jcall,
- .should_request_full_sync = should_request_full_sync_jcall,
- .free = LDKRoutingMessageHandler_JCalls_free,
- };
- return ret;
-}
-JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1new (JNIEnv * env, jclass _a, jobject o) {
- LDKRoutingMessageHandler *res_ptr = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
- *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;
-}
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1call_1handle_1node_1announcement(JNIEnv * _env, jclass _b, jlong arg, jlong msg) {
- LDKRoutingMessageHandler* arg_conv = (LDKRoutingMessageHandler*)arg;
- LDKNodeAnnouncement* msg_conv = (LDKNodeAnnouncement*)msg;
- LDKCResult_boolLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
- *ret = (arg_conv->handle_node_announcement)(arg_conv->this_arg, msg_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1call_1handle_1channel_1announcement(JNIEnv * _env, jclass _b, jlong arg, jlong msg) {
- LDKRoutingMessageHandler* arg_conv = (LDKRoutingMessageHandler*)arg;
- LDKChannelAnnouncement* msg_conv = (LDKChannelAnnouncement*)msg;
- LDKCResult_boolLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
- *ret = (arg_conv->handle_channel_announcement)(arg_conv->this_arg, msg_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1call_1handle_1channel_1update(JNIEnv * _env, jclass _b, jlong arg, jlong msg) {
- LDKRoutingMessageHandler* arg_conv = (LDKRoutingMessageHandler*)arg;
- LDKChannelUpdate* msg_conv = (LDKChannelUpdate*)msg;
- LDKCResult_boolLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
- *ret = (arg_conv->handle_channel_update)(arg_conv->this_arg, msg_conv);
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1call_1handle_1htlc_1fail_1channel_1update(JNIEnv * _env, jclass _b, jlong arg, jlong update) {
- LDKRoutingMessageHandler* arg_conv = (LDKRoutingMessageHandler*)arg;
- LDKHTLCFailChannelUpdate* update_conv = (LDKHTLCFailChannelUpdate*)update;
- return (arg_conv->handle_htlc_fail_channel_update)(arg_conv->this_arg, update_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1call_1get_1next_1channel_1announcements(JNIEnv * _env, jclass _b, jlong arg, jlong starting_point, jbyte batch_amount) {
- LDKRoutingMessageHandler* arg_conv = (LDKRoutingMessageHandler*)arg;
- LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* ret = MALLOC(sizeof(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
- *ret = (arg_conv->get_next_channel_announcements)(arg_conv->this_arg, starting_point, batch_amount);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1call_1get_1next_1node_1announcements(JNIEnv * _env, jclass _b, jlong arg, jlong starting_point, jbyte batch_amount) {
- LDKRoutingMessageHandler* arg_conv = (LDKRoutingMessageHandler*)arg;
- LDKPublicKey starting_point_conv = *(LDKPublicKey*)starting_point;
- FREE((void*)starting_point);
- LDKCVec_NodeAnnouncementZ* ret = MALLOC(sizeof(LDKCVec_NodeAnnouncementZ), "LDKCVec_NodeAnnouncementZ");
- *ret = (arg_conv->get_next_node_announcements)(arg_conv->this_arg, starting_point_conv, batch_amount);
- return (long)ret;
-}
-
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1call_1should_1request_1full_1sync(JNIEnv * _env, jclass _b, jlong arg, jlong node_id) {
- LDKRoutingMessageHandler* arg_conv = (LDKRoutingMessageHandler*)arg;
- LDKPublicKey node_id_conv = *(LDKPublicKey*)node_id;
- FREE((void*)node_id);
- return (arg_conv->should_request_full_sync)(arg_conv->this_arg, node_id_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKMessageHandler_1optional_1none (JNIEnv * env, jclass _a) {
- LDKMessageHandler *ret = MALLOC(sizeof(LDKMessageHandler), "LDKMessageHandler");
- ret->inner = NULL;
- return (long)ret;
-}
-typedef struct LDKSocketDescriptor_JCalls {
- atomic_size_t refcnt;
- JavaVM *vm;
- jobject o;
- jmethodID send_data_meth;
- jmethodID disconnect_socket_meth;
- jmethodID eq_meth;
- jmethodID hash_meth;
-} LDKSocketDescriptor_JCalls;
-uintptr_t send_data_jcall(void* this_arg, LDKu8slice data, bool resume_read) {
- LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
- JNIEnv *env;
- DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
- long data_ref = (long)&data;
- return (*env)->CallLongMethod(env, j_calls->o, j_calls->send_data_meth, data_ref, resume_read);
-}
-void disconnect_socket_jcall(void* this_arg) {
- LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
- JNIEnv *env;
- DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
- return (*env)->CallVoidMethod(env, j_calls->o, j_calls->disconnect_socket_meth);
-}
-bool eq_jcall(const void* this_arg, const void *other_arg) {
- LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
- JNIEnv *env;
- DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
- return (*env)->CallBooleanMethod(env, j_calls->o, j_calls->eq_meth, other_arg);
-}
-uint64_t hash_jcall(const void* this_arg) {
- LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
- JNIEnv *env;
- DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
- return (*env)->CallLongMethod(env, j_calls->o, j_calls->hash_meth);
-}
-static void LDKSocketDescriptor_JCalls_free(void* this_arg) {
- LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
- if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
- JNIEnv *env;
- DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
- (*env)->DeleteGlobalRef(env, j_calls->o);
- FREE(j_calls);
- }
-}
-static void* LDKSocketDescriptor_JCalls_clone(const void* this_arg) {
- LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
- atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
- return (void*) this_arg;
-}
-static inline LDKSocketDescriptor LDKSocketDescriptor_init (JNIEnv * env, jclass _a, jobject o) {
- jclass c = (*env)->GetObjectClass(env, o);
- DO_ASSERT(c != NULL);
- LDKSocketDescriptor_JCalls *calls = MALLOC(sizeof(LDKSocketDescriptor_JCalls), "LDKSocketDescriptor_JCalls");
- atomic_init(&calls->refcnt, 1);
- DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
- calls->o = (*env)->NewGlobalRef(env, o);
- calls->send_data_meth = (*env)->GetMethodID(env, c, "send_data", "(JZ)J");
- DO_ASSERT(calls->send_data_meth != NULL);
- calls->disconnect_socket_meth = (*env)->GetMethodID(env, c, "disconnect_socket", "()V");
- DO_ASSERT(calls->disconnect_socket_meth != NULL);
- calls->eq_meth = (*env)->GetMethodID(env, c, "eq", "(J)Z");
- DO_ASSERT(calls->eq_meth != NULL);
- calls->hash_meth = (*env)->GetMethodID(env, c, "hash", "()J");
- DO_ASSERT(calls->hash_meth != NULL);
-
- LDKSocketDescriptor ret = {
- .this_arg = (void*) calls,
- .send_data = send_data_jcall,
- .disconnect_socket = disconnect_socket_jcall,
- .eq = eq_jcall,
- .hash = hash_jcall,
- .clone = LDKSocketDescriptor_JCalls_clone,
- .free = LDKSocketDescriptor_JCalls_free,
- };
- return ret;
-}
-JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1new (JNIEnv * env, jclass _a, jobject o) {
- LDKSocketDescriptor *res_ptr = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
- *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 jlong JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1call_1send_1data(JNIEnv * _env, jclass _b, jlong arg, jlong data, jboolean resume_read) {
- LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg;
- LDKu8slice data_conv = *(LDKu8slice*)data;
- return (arg_conv->send_data)(arg_conv->this_arg, data_conv, resume_read);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1call_1disconnect_1socket(JNIEnv * _env, jclass _b, jlong arg) {
- LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg;
- return (arg_conv->disconnect_socket)(arg_conv->this_arg);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1call_1hash(JNIEnv * _env, jclass _b, jlong arg) {
- LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg;
- return (arg_conv->hash)(arg_conv->this_arg);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKPeerManager_1optional_1none (JNIEnv * env, jclass _a) {
- LDKPeerManager *ret = MALLOC(sizeof(LDKPeerManager), "LDKPeerManager");
- ret->inner = NULL;
- return (long)ret;
-}
-JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1PublicKey_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
- LDKCVecTempl_PublicKey *vec = (LDKCVecTempl_PublicKey*)ptr;
- return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKPublicKey));
-}
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
- return ((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->result_ok;
-}
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
- if (((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->result_ok) {
- return (long)((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->contents.result;
- } else {
- return (long)((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->contents.err;
- }
-}
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
- return ((LDKCResult_boolPeerHandleErrorZ*)arg)->result_ok;
-}
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
- if (((LDKCResult_boolPeerHandleErrorZ*)arg)->result_ok) {
- return (long)((LDKCResult_boolPeerHandleErrorZ*)arg)->contents.result;
- } else {
- return (long)((LDKCResult_boolPeerHandleErrorZ*)arg)->contents.err;
- }
-}
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeySecpErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
- return ((LDKCResult_SecretKeySecpErrorZ*)arg)->result_ok;
-}
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeySecpErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
- if (((LDKCResult_SecretKeySecpErrorZ*)arg)->result_ok) {
- return (long)((LDKCResult_SecretKeySecpErrorZ*)arg)->contents.result;
- } else {
- return (long)((LDKCResult_SecretKeySecpErrorZ*)arg)->contents.err;
- }
-}
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeySecpErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
- return ((LDKCResult_PublicKeySecpErrorZ*)arg)->result_ok;
-}
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeySecpErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
- if (((LDKCResult_PublicKeySecpErrorZ*)arg)->result_ok) {
- return (long)((LDKCResult_PublicKeySecpErrorZ*)arg)->contents.result;
- } else {
- return (long)((LDKCResult_PublicKeySecpErrorZ*)arg)->contents.err;
- }
-}
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKTxCreationKeys_1optional_1none (JNIEnv * env, jclass _a) {
- LDKTxCreationKeys *ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
- ret->inner = NULL;
- return (long)ret;
-}
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysSecpErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
- return ((LDKCResult_TxCreationKeysSecpErrorZ*)arg)->result_ok;
-}
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysSecpErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
- if (((LDKCResult_TxCreationKeysSecpErrorZ*)arg)->result_ok) {
- return (long)((LDKCResult_TxCreationKeysSecpErrorZ*)arg)->contents.result;
- } else {
- return (long)((LDKCResult_TxCreationKeysSecpErrorZ*)arg)->contents.err;
- }
-}
-JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1HTLCOutputInCommitment_1_1Signature_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
- LDKCVecTempl_C2TupleTempl_HTLCOutputInCommitment__Signature *vec = (LDKCVecTempl_C2TupleTempl_HTLCOutputInCommitment__Signature*)ptr;
- return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKC2TupleTempl_HTLCOutputInCommitment__Signature));
-}
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRouteHop_1optional_1none (JNIEnv * env, jclass _a) {
- LDKRouteHop *ret = MALLOC(sizeof(LDKRouteHop), "LDKRouteHop");
- ret->inner = NULL;
- return (long)ret;
-}
-JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1RouteHop_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
- LDKCVecTempl_RouteHop *vec = (LDKCVecTempl_RouteHop*)ptr;
- return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKRouteHop));
-}
-JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1CVecTempl_1RouteHop_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
- LDKCVecTempl_CVecTempl_RouteHop *vec = (LDKCVecTempl_CVecTempl_RouteHop*)ptr;
- return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKCVecTempl_RouteHop));
-}
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRouteHint_1optional_1none (JNIEnv * env, jclass _a) {
- LDKRouteHint *ret = MALLOC(sizeof(LDKRouteHint), "LDKRouteHint");
- ret->inner = NULL;
- return (long)ret;
-}
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRoutingFees_1optional_1none (JNIEnv * env, jclass _a) {
- LDKRoutingFees *ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
- ret->inner = NULL;
- return (long)ret;
-}
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
- return ((LDKCResult_RouteLightningErrorZ*)arg)->result_ok;
-}
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
- if (((LDKCResult_RouteLightningErrorZ*)arg)->result_ok) {
- return (long)((LDKCResult_RouteLightningErrorZ*)arg)->contents.result;
- } else {
- return (long)((LDKCResult_RouteLightningErrorZ*)arg)->contents.err;
- }
-}
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKNetworkGraph_1optional_1none (JNIEnv * env, jclass _a) {
- LDKNetworkGraph *ret = MALLOC(sizeof(LDKNetworkGraph), "LDKNetworkGraph");
- ret->inner = NULL;
- return (long)ret;
-}
-JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1RouteHint_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
- LDKCVecTempl_RouteHint *vec = (LDKCVecTempl_RouteHint*)ptr;
- return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKRouteHint));
-}
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKLockedNetworkGraph_1optional_1none (JNIEnv * env, jclass _a) {
- LDKLockedNetworkGraph *ret = MALLOC(sizeof(LDKLockedNetworkGraph), "LDKLockedNetworkGraph");
- ret->inner = NULL;
- return (long)ret;
-}
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKNetGraphMsgHandler_1optional_1none (JNIEnv * env, jclass _a) {
- LDKNetGraphMsgHandler *ret = MALLOC(sizeof(LDKNetGraphMsgHandler), "LDKNetGraphMsgHandler");
- ret->inner = NULL;
- return (long)ret;
-}
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKDirectionalChannelInfo_1optional_1none (JNIEnv * env, jclass _a) {
- LDKDirectionalChannelInfo *ret = MALLOC(sizeof(LDKDirectionalChannelInfo), "LDKDirectionalChannelInfo");
- ret->inner = NULL;
- return (long)ret;
-}
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelInfo_1optional_1none (JNIEnv * env, jclass _a) {
- LDKChannelInfo *ret = MALLOC(sizeof(LDKChannelInfo), "LDKChannelInfo");
- ret->inner = NULL;
- return (long)ret;
-}
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKNodeAnnouncementInfo_1optional_1none (JNIEnv * env, jclass _a) {
- LDKNodeAnnouncementInfo *ret = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo");
- ret->inner = NULL;
- return (long)ret;
-}
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKNodeInfo_1optional_1none (JNIEnv * env, jclass _a) {
- LDKNodeInfo *ret = MALLOC(sizeof(LDKNodeInfo), "LDKNodeInfo");
- ret->inner = NULL;
- return (long)ret;
-}
-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);
- return C2Tuple_HTLCOutputInCommitmentSignatureZ_free(arg_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKC2Tuple_OutPointScriptZ arg_conv = *(LDKC2Tuple_OutPointScriptZ*)arg;
- FREE((void*)arg);
- return C2Tuple_OutPointScriptZ_free(arg_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKC2Tuple_SignatureCVec_SignatureZZ arg_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)arg;
- FREE((void*)arg);
- return C2Tuple_SignatureCVec_SignatureZZ_free(arg_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1TxOutZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKC2Tuple_TxidCVec_TxOutZZ arg_conv = *(LDKC2Tuple_TxidCVec_TxOutZZ*)arg;
- FREE((void*)arg);
- return C2Tuple_TxidCVec_TxOutZZ_free(arg_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKC2Tuple_u64u64Z arg_conv = *(LDKC2Tuple_u64u64Z*)arg;
- FREE((void*)arg);
- return C2Tuple_u64u64Z_free(arg_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKC2Tuple_usizeTransactionZ arg_conv = *(LDKC2Tuple_usizeTransactionZ*)arg;
- FREE((void*)arg);
- return C2Tuple_usizeTransactionZ_free(arg_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arg_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)arg;
- FREE((void*)arg);
- return C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(arg_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ arg_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg;
- FREE((void*)arg);
- return CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(arg_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
- LDKC2Tuple_SignatureCVec_SignatureZZ arg_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)arg;
- FREE((void*)arg);
- LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
- *ret = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCResult_CVec_SignatureZNoneZ arg_conv = *(LDKCResult_CVec_SignatureZNoneZ*)arg;
- FREE((void*)arg);
- return CResult_CVec_SignatureZNoneZ_free(arg_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCVec_SignatureZ arg_conv = *(LDKCVec_SignatureZ*)arg;
- FREE((void*)arg);
- LDKCResult_CVec_SignatureZNoneZ* ret = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
- *ret = CResult_CVec_SignatureZNoneZ_ok(arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
- LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg;
- FREE((void*)arg);
- LDKCResult_CVec_u8ZPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
- *ret = CResult_CVec_u8ZPeerHandleErrorZ_err(arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCResult_CVec_u8ZPeerHandleErrorZ arg_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg;
- FREE((void*)arg);
- return CResult_CVec_u8ZPeerHandleErrorZ_free(arg_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCVec_u8Z arg_conv = *(LDKCVec_u8Z*)arg;
- FREE((void*)arg);
- LDKCResult_CVec_u8ZPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
- *ret = CResult_CVec_u8ZPeerHandleErrorZ_ok(arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
- LDKAPIError arg_conv = *(LDKAPIError*)arg;
- FREE((void*)arg);
- LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
- *ret = CResult_NoneAPIErrorZ_err(arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCResult_NoneAPIErrorZ arg_conv = *(LDKCResult_NoneAPIErrorZ*)arg;
- FREE((void*)arg);
- return CResult_NoneAPIErrorZ_free(arg_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
- LDKChannelMonitorUpdateErr arg_conv = *(LDKChannelMonitorUpdateErr*)arg;
- FREE((void*)arg);
- LDKCResult_NoneChannelMonitorUpdateErrZ* ret = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
- *ret = CResult_NoneChannelMonitorUpdateErrZ_err(arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCResult_NoneChannelMonitorUpdateErrZ arg_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)arg;
- FREE((void*)arg);
- return CResult_NoneChannelMonitorUpdateErrZ_free(arg_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
- LDKMonitorUpdateError arg_conv = *(LDKMonitorUpdateError*)arg;
- FREE((void*)arg);
- LDKCResult_NoneMonitorUpdateErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
- *ret = CResult_NoneMonitorUpdateErrorZ_err(arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCResult_NoneMonitorUpdateErrorZ arg_conv = *(LDKCResult_NoneMonitorUpdateErrorZ*)arg;
- FREE((void*)arg);
- return CResult_NoneMonitorUpdateErrorZ_free(arg_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
- LDKPaymentSendFailure arg_conv = *(LDKPaymentSendFailure*)arg;
- FREE((void*)arg);
- LDKCResult_NonePaymentSendFailureZ* ret = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
- *ret = CResult_NonePaymentSendFailureZ_err(arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCResult_NonePaymentSendFailureZ arg_conv = *(LDKCResult_NonePaymentSendFailureZ*)arg;
- FREE((void*)arg);
- return CResult_NonePaymentSendFailureZ_free(arg_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
- LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg;
- FREE((void*)arg);
- LDKCResult_NonePeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
- *ret = CResult_NonePeerHandleErrorZ_err(arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCResult_NonePeerHandleErrorZ arg_conv = *(LDKCResult_NonePeerHandleErrorZ*)arg;
- FREE((void*)arg);
- return CResult_NonePeerHandleErrorZ_free(arg_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
- LDKSecp256k1Error arg_conv = *(LDKSecp256k1Error*)arg;
- FREE((void*)arg);
- LDKCResult_PublicKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ");
- *ret = CResult_PublicKeySecpErrorZ_err(arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCResult_PublicKeySecpErrorZ arg_conv = *(LDKCResult_PublicKeySecpErrorZ*)arg;
- FREE((void*)arg);
- return CResult_PublicKeySecpErrorZ_free(arg_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
- LDKPublicKey arg_conv = *(LDKPublicKey*)arg;
- FREE((void*)arg);
- LDKCResult_PublicKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ");
- *ret = CResult_PublicKeySecpErrorZ_ok(arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
- LDKLightningError arg_conv = *(LDKLightningError*)arg;
- FREE((void*)arg);
- LDKCResult_RouteLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
- *ret = CResult_RouteLightningErrorZ_err(arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCResult_RouteLightningErrorZ arg_conv = *(LDKCResult_RouteLightningErrorZ*)arg;
- FREE((void*)arg);
- return CResult_RouteLightningErrorZ_free(arg_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
- LDKRoute arg_conv = *(LDKRoute*)arg;
- FREE((void*)arg);
- LDKCResult_RouteLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
- *ret = CResult_RouteLightningErrorZ_ok(arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
- LDKSecp256k1Error arg_conv = *(LDKSecp256k1Error*)arg;
- FREE((void*)arg);
- LDKCResult_SecretKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ");
- *ret = CResult_SecretKeySecpErrorZ_err(arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCResult_SecretKeySecpErrorZ arg_conv = *(LDKCResult_SecretKeySecpErrorZ*)arg;
- FREE((void*)arg);
- return CResult_SecretKeySecpErrorZ_free(arg_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
- LDKSecretKey arg_conv = *(LDKSecretKey*)arg;
- FREE((void*)arg);
- LDKCResult_SecretKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ");
- *ret = CResult_SecretKeySecpErrorZ_ok(arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCResult_SignatureNoneZ arg_conv = *(LDKCResult_SignatureNoneZ*)arg;
- FREE((void*)arg);
- return CResult_SignatureNoneZ_free(arg_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
- LDKSignature arg_conv = *(LDKSignature*)arg;
- FREE((void*)arg);
- LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
- *ret = CResult_SignatureNoneZ_ok(arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
- LDKSecp256k1Error arg_conv = *(LDKSecp256k1Error*)arg;
- FREE((void*)arg);
- LDKCResult_TxCreationKeysSecpErrorZ* ret = MALLOC(sizeof(LDKCResult_TxCreationKeysSecpErrorZ), "LDKCResult_TxCreationKeysSecpErrorZ");
- *ret = CResult_TxCreationKeysSecpErrorZ_err(arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCResult_TxCreationKeysSecpErrorZ arg_conv = *(LDKCResult_TxCreationKeysSecpErrorZ*)arg;
- FREE((void*)arg);
- return CResult_TxCreationKeysSecpErrorZ_free(arg_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
- LDKTxCreationKeys arg_conv = *(LDKTxCreationKeys*)arg;
- FREE((void*)arg);
- LDKCResult_TxCreationKeysSecpErrorZ* ret = MALLOC(sizeof(LDKCResult_TxCreationKeysSecpErrorZ), "LDKCResult_TxCreationKeysSecpErrorZ");
- *ret = CResult_TxCreationKeysSecpErrorZ_ok(arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
- LDKAccessError arg_conv = *(LDKAccessError*)arg;
- FREE((void*)arg);
- LDKCResult_TxOutAccessErrorZ* ret = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
- *ret = CResult_TxOutAccessErrorZ_err(arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCResult_TxOutAccessErrorZ arg_conv = *(LDKCResult_TxOutAccessErrorZ*)arg;
- FREE((void*)arg);
- return CResult_TxOutAccessErrorZ_free(arg_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
- LDKTxOut arg_conv = *(LDKTxOut*)arg;
- FREE((void*)arg);
- LDKCResult_TxOutAccessErrorZ* ret = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
- *ret = CResult_TxOutAccessErrorZ_ok(arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
- LDKLightningError arg_conv = *(LDKLightningError*)arg;
- FREE((void*)arg);
- LDKCResult_boolLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
- *ret = CResult_boolLightningErrorZ_err(arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCResult_boolLightningErrorZ arg_conv = *(LDKCResult_boolLightningErrorZ*)arg;
- FREE((void*)arg);
- return CResult_boolLightningErrorZ_free(arg_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1ok(JNIEnv * _env, jclass _b, jboolean arg) {
- LDKCResult_boolLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
- *ret = CResult_boolLightningErrorZ_ok(arg);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
- LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg;
- FREE((void*)arg);
- LDKCResult_boolPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
- *ret = CResult_boolPeerHandleErrorZ_err(arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCResult_boolPeerHandleErrorZ arg_conv = *(LDKCResult_boolPeerHandleErrorZ*)arg;
- FREE((void*)arg);
- return CResult_boolPeerHandleErrorZ_free(arg_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b, jboolean arg) {
- LDKCResult_boolPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
- *ret = CResult_boolPeerHandleErrorZ_ok(arg);
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1HTLCOutputInCommitmentSignatureZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ arg_conv = *(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ*)arg;
- FREE((void*)arg);
- return CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ_free(arg_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1TxOutZZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCVec_C2Tuple_TxidCVec_TxOutZZZ arg_conv = *(LDKCVec_C2Tuple_TxidCVec_TxOutZZZ*)arg;
- FREE((void*)arg);
- return CVec_C2Tuple_TxidCVec_TxOutZZZ_free(arg_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1usizeTransactionZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCVec_C2Tuple_usizeTransactionZZ arg_conv = *(LDKCVec_C2Tuple_usizeTransactionZZ*)arg;
- FREE((void*)arg);
- return CVec_C2Tuple_usizeTransactionZZ_free(arg_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ arg_conv = *(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)arg;
- FREE((void*)arg);
- return CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(arg_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1RouteHopZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCVec_CVec_RouteHopZZ arg_conv = *(LDKCVec_CVec_RouteHopZZ*)arg;
- FREE((void*)arg);
- return CVec_CVec_RouteHopZZ_free(arg_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCVec_ChannelDetailsZ arg_conv = *(LDKCVec_ChannelDetailsZ*)arg;
- FREE((void*)arg);
- return CVec_ChannelDetailsZ_free(arg_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelMonitorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCVec_ChannelMonitorZ arg_conv = *(LDKCVec_ChannelMonitorZ*)arg;
- FREE((void*)arg);
- return CVec_ChannelMonitorZ_free(arg_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1EventZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCVec_EventZ arg_conv = *(LDKCVec_EventZ*)arg;
- FREE((void*)arg);
- return CVec_EventZ_free(arg_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1HTLCOutputInCommitmentZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCVec_HTLCOutputInCommitmentZ arg_conv = *(LDKCVec_HTLCOutputInCommitmentZ*)arg;
- FREE((void*)arg);
- return CVec_HTLCOutputInCommitmentZ_free(arg_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MessageSendEventZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCVec_MessageSendEventZ arg_conv = *(LDKCVec_MessageSendEventZ*)arg;
- FREE((void*)arg);
- return CVec_MessageSendEventZ_free(arg_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorEventZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCVec_MonitorEventZ arg_conv = *(LDKCVec_MonitorEventZ*)arg;
- FREE((void*)arg);
- return CVec_MonitorEventZ_free(arg_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NetAddressZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCVec_NetAddressZ arg_conv = *(LDKCVec_NetAddressZ*)arg;
- FREE((void*)arg);
- return CVec_NetAddressZ_free(arg_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NodeAnnouncementZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCVec_NodeAnnouncementZ arg_conv = *(LDKCVec_NodeAnnouncementZ*)arg;
- FREE((void*)arg);
- return CVec_NodeAnnouncementZ_free(arg_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PublicKeyZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCVec_PublicKeyZ arg_conv = *(LDKCVec_PublicKeyZ*)arg;
- FREE((void*)arg);
- return CVec_PublicKeyZ_free(arg_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCVec_RouteHintZ arg_conv = *(LDKCVec_RouteHintZ*)arg;
- FREE((void*)arg);
- return CVec_RouteHintZ_free(arg_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHopZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCVec_RouteHopZ arg_conv = *(LDKCVec_RouteHopZ*)arg;
- FREE((void*)arg);
- return CVec_RouteHopZ_free(arg_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SignatureZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCVec_SignatureZ arg_conv = *(LDKCVec_SignatureZ*)arg;
- FREE((void*)arg);
- return CVec_SignatureZ_free(arg_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SpendableOutputDescriptorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCVec_SpendableOutputDescriptorZ arg_conv = *(LDKCVec_SpendableOutputDescriptorZ*)arg;
- FREE((void*)arg);
- return CVec_SpendableOutputDescriptorZ_free(arg_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCVec_TransactionZ arg_conv = *(LDKCVec_TransactionZ*)arg;
- FREE((void*)arg);
- return CVec_TransactionZ_free(arg_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TxOutZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCVec_TxOutZ arg_conv = *(LDKCVec_TxOutZ*)arg;
- FREE((void*)arg);
- return CVec_TxOutZ_free(arg_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateAddHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCVec_UpdateAddHTLCZ arg_conv = *(LDKCVec_UpdateAddHTLCZ*)arg;
- FREE((void*)arg);
- return CVec_UpdateAddHTLCZ_free(arg_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCVec_UpdateFailHTLCZ arg_conv = *(LDKCVec_UpdateFailHTLCZ*)arg;
- FREE((void*)arg);
- return CVec_UpdateFailHTLCZ_free(arg_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailMalformedHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCVec_UpdateFailMalformedHTLCZ arg_conv = *(LDKCVec_UpdateFailMalformedHTLCZ*)arg;
- FREE((void*)arg);
- return CVec_UpdateFailMalformedHTLCZ_free(arg_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFulfillHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCVec_UpdateFulfillHTLCZ arg_conv = *(LDKCVec_UpdateFulfillHTLCZ*)arg;
- FREE((void*)arg);
- return CVec_UpdateFulfillHTLCZ_free(arg_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u64Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCVec_u64Z arg_conv = *(LDKCVec_u64Z*)arg;
- FREE((void*)arg);
- return CVec_u64Z_free(arg_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u8Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
- LDKCVec_u8Z arg_conv = *(LDKCVec_u8Z*)arg;
- FREE((void*)arg);
- return CVec_u8Z_free(arg_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Transaction_1free(JNIEnv * _env, jclass _b, jlong _res) {
- LDKTransaction _res_conv = *(LDKTransaction*)_res;
- FREE((void*)_res);
- return Transaction_free(_res_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_1free(JNIEnv * _env, jclass _b, jlong _res) {
- LDKTxOut _res_conv = *(LDKTxOut*)_res;
- FREE((void*)_res);
- return TxOut_free(_res_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
- LDKTransaction b_conv = *(LDKTransaction*)b;
- FREE((void*)b);
- LDKC2Tuple_usizeTransactionZ* ret = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
- *ret = C2Tuple_usizeTransactionZ_new(a, b_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1ok(JNIEnv * _env, jclass _b) {
- LDKCResult_NoneChannelMonitorUpdateErrZ* ret = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
- *ret = CResult_NoneChannelMonitorUpdateErrZ_ok();
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1ok(JNIEnv * _env, jclass _b) {
- LDKCResult_NoneMonitorUpdateErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
- *ret = CResult_NoneMonitorUpdateErrorZ_ok();
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
- LDKOutPoint a_conv = *(LDKOutPoint*)a;
- FREE((void*)a);
- a_conv.is_owned = true;
- LDKCVec_u8Z b_conv = *(LDKCVec_u8Z*)b;
- FREE((void*)b);
- LDKC2Tuple_OutPointScriptZ* ret = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
- *ret = C2Tuple_OutPointScriptZ_new(a_conv, b_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1TxOutZZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
- LDKThirtyTwoBytes a_conv = *(LDKThirtyTwoBytes*)a;
- FREE((void*)a);
- LDKCVec_TxOutZ b_conv = *(LDKCVec_TxOutZ*)b;
- FREE((void*)b);
- LDKC2Tuple_TxidCVec_TxOutZZ* ret = MALLOC(sizeof(LDKC2Tuple_TxidCVec_TxOutZZ), "LDKC2Tuple_TxidCVec_TxOutZZ");
- *ret = C2Tuple_TxidCVec_TxOutZZ_new(a_conv, b_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
- LDKC2Tuple_u64u64Z* ret = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
- *ret = C2Tuple_u64u64Z_new(a, b);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
- LDKSignature a_conv = *(LDKSignature*)a;
- FREE((void*)a);
- LDKCVec_SignatureZ b_conv = *(LDKCVec_SignatureZ*)b;
- FREE((void*)b);
- LDKC2Tuple_SignatureCVec_SignatureZZ* ret = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
- *ret = C2Tuple_SignatureCVec_SignatureZZ_new(a_conv, b_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1err(JNIEnv * _env, jclass _b) {
- LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
- *ret = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err();
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1err(JNIEnv * _env, jclass _b) {
- LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
- *ret = CResult_SignatureNoneZ_err();
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1err(JNIEnv * _env, jclass _b) {
- LDKCResult_CVec_SignatureZNoneZ* ret = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
- *ret = CResult_CVec_SignatureZNoneZ_err();
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1ok(JNIEnv * _env, jclass _b) {
- LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
- *ret = CResult_NoneAPIErrorZ_ok();
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1ok(JNIEnv * _env, jclass _b) {
- LDKCResult_NonePaymentSendFailureZ* ret = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
- *ret = CResult_NonePaymentSendFailureZ_ok();
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b, jlong c) {
- LDKChannelAnnouncement a_conv = *(LDKChannelAnnouncement*)a;
- FREE((void*)a);
- a_conv.is_owned = true;
- LDKChannelUpdate b_conv = *(LDKChannelUpdate*)b;
- FREE((void*)b);
- b_conv.is_owned = true;
- LDKChannelUpdate c_conv = *(LDKChannelUpdate*)c;
- FREE((void*)c);
- c_conv.is_owned = true;
- LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
- *ret = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a_conv, b_conv, c_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b) {
- LDKCResult_NonePeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
- *ret = CResult_NonePeerHandleErrorZ_ok();
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HTLCOutputInCommitmentSignatureZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
- LDKHTLCOutputInCommitment a_conv = *(LDKHTLCOutputInCommitment*)a;
- FREE((void*)a);
- a_conv.is_owned = true;
- LDKSignature b_conv = *(LDKSignature*)b;
- FREE((void*)b);
- LDKC2Tuple_HTLCOutputInCommitmentSignatureZ* ret = MALLOC(sizeof(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ), "LDKC2Tuple_HTLCOutputInCommitmentSignatureZ");
- *ret = C2Tuple_HTLCOutputInCommitmentSignatureZ_new(a_conv, b_conv);
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKEvent this_ptr_conv = *(LDKEvent*)this_ptr;
- FREE((void*)this_ptr);
- return Event_free(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)this_ptr;
- FREE((void*)this_ptr);
- return MessageSendEvent_free(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)this_ptr;
- FREE((void*)this_ptr);
- return MessageSendEventsProvider_free(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)this_ptr;
- FREE((void*)this_ptr);
- return EventsProvider_free(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_APIError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKAPIError this_ptr_conv = *(LDKAPIError*)this_ptr;
- FREE((void*)this_ptr);
- return APIError_free(this_ptr_conv);
-}
-
-JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1max(JNIEnv * _env, jclass _b) {
- jclass ret = LDKLevel_to_java(_env, Level_max());
- return ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Logger_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKLogger this_ptr_conv = *(LDKLogger*)this_ptr;
- FREE((void*)this_ptr);
- return Logger_free(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelHandshakeConfig this_ptr_conv = *(LDKChannelHandshakeConfig*)this_ptr;
- FREE((void*)this_ptr);
- this_ptr_conv.is_owned = true;
- return ChannelHandshakeConfig_free(this_ptr_conv);
-}
-
-JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
- return ChannelHandshakeConfig_get_minimum_depth(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
- LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
- return ChannelHandshakeConfig_set_minimum_depth(this_ptr_conv, val);
-}
-
-JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
- return ChannelHandshakeConfig_get_our_to_self_delay(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
- LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
- return ChannelHandshakeConfig_set_our_to_self_delay(this_ptr_conv, val);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
- return ChannelHandshakeConfig_get_our_htlc_minimum_msat(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
- return ChannelHandshakeConfig_set_our_htlc_minimum_msat(this_ptr_conv, val);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1new(JNIEnv * _env, jclass _b, jint minimum_depth_arg, jshort our_to_self_delay_arg, jlong our_htlc_minimum_msat_arg) {
- LDKChannelHandshakeConfig* ret = MALLOC(sizeof(LDKChannelHandshakeConfig), "LDKChannelHandshakeConfig");
- *ret = ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg);
- DO_ASSERT(ret->is_owned);
- ret->is_owned = false;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1default(JNIEnv * _env, jclass _b) {
- LDKChannelHandshakeConfig* ret = MALLOC(sizeof(LDKChannelHandshakeConfig), "LDKChannelHandshakeConfig");
- *ret = ChannelHandshakeConfig_default();
- DO_ASSERT(ret->is_owned);
- ret->is_owned = false;
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelHandshakeLimits this_ptr_conv = *(LDKChannelHandshakeLimits*)this_ptr;
- FREE((void*)this_ptr);
- this_ptr_conv.is_owned = true;
- return ChannelHandshakeLimits_free(this_ptr_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
- return ChannelHandshakeLimits_get_min_funding_satoshis(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
- return ChannelHandshakeLimits_set_min_funding_satoshis(this_ptr_conv, val);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
- return ChannelHandshakeLimits_get_max_htlc_minimum_msat(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
- return ChannelHandshakeLimits_set_max_htlc_minimum_msat(this_ptr_conv, val);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
- return ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
- return ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(this_ptr_conv, val);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
- return ChannelHandshakeLimits_get_max_channel_reserve_satoshis(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
- return ChannelHandshakeLimits_set_max_channel_reserve_satoshis(this_ptr_conv, val);
-}
-
-JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
- return ChannelHandshakeLimits_get_min_max_accepted_htlcs(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
- LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
- return ChannelHandshakeLimits_set_min_max_accepted_htlcs(this_ptr_conv, val);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
- return ChannelHandshakeLimits_get_min_dust_limit_satoshis(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
- return ChannelHandshakeLimits_set_min_dust_limit_satoshis(this_ptr_conv, val);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
- return ChannelHandshakeLimits_get_max_dust_limit_satoshis(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
- return ChannelHandshakeLimits_set_max_dust_limit_satoshis(this_ptr_conv, val);
-}
-
-JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
- return ChannelHandshakeLimits_get_max_minimum_depth(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
- LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
- return ChannelHandshakeLimits_set_max_minimum_depth(this_ptr_conv, val);
-}
-
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1force_1announced_1channel_1preference(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
- return ChannelHandshakeLimits_get_force_announced_channel_preference(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1force_1announced_1channel_1preference(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
- LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
- return ChannelHandshakeLimits_set_force_announced_channel_preference(this_ptr_conv, val);
-}
-
-JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1their_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
- return ChannelHandshakeLimits_get_their_to_self_delay(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1their_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
- LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
- return ChannelHandshakeLimits_set_their_to_self_delay(this_ptr_conv, val);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1new(JNIEnv * _env, jclass _b, jlong min_funding_satoshis_arg, jlong max_htlc_minimum_msat_arg, jlong min_max_htlc_value_in_flight_msat_arg, jlong max_channel_reserve_satoshis_arg, jshort min_max_accepted_htlcs_arg, jlong min_dust_limit_satoshis_arg, jlong max_dust_limit_satoshis_arg, jint max_minimum_depth_arg, jboolean force_announced_channel_preference_arg, jshort their_to_self_delay_arg) {
- LDKChannelHandshakeLimits* ret = MALLOC(sizeof(LDKChannelHandshakeLimits), "LDKChannelHandshakeLimits");
- *ret = ChannelHandshakeLimits_new(min_funding_satoshis_arg, max_htlc_minimum_msat_arg, min_max_htlc_value_in_flight_msat_arg, max_channel_reserve_satoshis_arg, min_max_accepted_htlcs_arg, min_dust_limit_satoshis_arg, max_dust_limit_satoshis_arg, max_minimum_depth_arg, force_announced_channel_preference_arg, their_to_self_delay_arg);
- DO_ASSERT(ret->is_owned);
- ret->is_owned = false;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1default(JNIEnv * _env, jclass _b) {
- LDKChannelHandshakeLimits* ret = MALLOC(sizeof(LDKChannelHandshakeLimits), "LDKChannelHandshakeLimits");
- *ret = ChannelHandshakeLimits_default();
- DO_ASSERT(ret->is_owned);
- ret->is_owned = false;
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelConfig this_ptr_conv = *(LDKChannelConfig*)this_ptr;
- FREE((void*)this_ptr);
- this_ptr_conv.is_owned = true;
- return ChannelConfig_free(this_ptr_conv);
-}
-
-JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
- return ChannelConfig_get_fee_proportional_millionths(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
- LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
- return ChannelConfig_set_fee_proportional_millionths(this_ptr_conv, val);
-}
-
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1announced_1channel(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
- return ChannelConfig_get_announced_channel(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1announced_1channel(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
- LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
- return ChannelConfig_set_announced_channel(this_ptr_conv, val);
-}
-
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1commit_1upfront_1shutdown_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
- return ChannelConfig_get_commit_upfront_shutdown_pubkey(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1commit_1upfront_1shutdown_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
- LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
- return ChannelConfig_set_commit_upfront_shutdown_pubkey(this_ptr_conv, val);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1new(JNIEnv * _env, jclass _b, jint fee_proportional_millionths_arg, jboolean announced_channel_arg, jboolean commit_upfront_shutdown_pubkey_arg) {
- LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
- *ret = ChannelConfig_new(fee_proportional_millionths_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg);
- DO_ASSERT(ret->is_owned);
- ret->is_owned = false;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1default(JNIEnv * _env, jclass _b) {
- LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
- *ret = ChannelConfig_default();
- DO_ASSERT(ret->is_owned);
- ret->is_owned = false;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1write(JNIEnv * _env, jclass _b, jlong obj) {
- LDKChannelConfig* obj_conv = (LDKChannelConfig*)obj;
- LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
- *ret = ChannelConfig_write(obj_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1read(JNIEnv * _env, jclass _b, jlong ser) {
- LDKu8slice ser_conv = *(LDKu8slice*)ser;
- LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
- *ret = ChannelConfig_read(ser_conv);
- DO_ASSERT(ret->is_owned);
- ret->is_owned = false;
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKUserConfig this_ptr_conv = *(LDKUserConfig*)this_ptr;
- FREE((void*)this_ptr);
- this_ptr_conv.is_owned = true;
- return UserConfig_free(this_ptr_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1own_1channel_1config(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
- LDKChannelHandshakeConfig* ret = MALLOC(sizeof(LDKChannelHandshakeConfig), "LDKChannelHandshakeConfig");
- *ret = UserConfig_get_own_channel_config(this_ptr_conv);
- DO_ASSERT(ret->is_owned);
- ret->is_owned = false;
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1own_1channel_1config(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
- LDKChannelHandshakeConfig val_conv = *(LDKChannelHandshakeConfig*)val;
- FREE((void*)val);
- val_conv.is_owned = true;
- return UserConfig_set_own_channel_config(this_ptr_conv, val_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1peer_1channel_1config_1limits(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
- LDKChannelHandshakeLimits* ret = MALLOC(sizeof(LDKChannelHandshakeLimits), "LDKChannelHandshakeLimits");
- *ret = UserConfig_get_peer_channel_config_limits(this_ptr_conv);
- DO_ASSERT(ret->is_owned);
- ret->is_owned = false;
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1peer_1channel_1config_1limits(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
- LDKChannelHandshakeLimits val_conv = *(LDKChannelHandshakeLimits*)val;
- FREE((void*)val);
- val_conv.is_owned = true;
- return UserConfig_set_peer_channel_config_limits(this_ptr_conv, val_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1channel_1options(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
- LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
- *ret = UserConfig_get_channel_options(this_ptr_conv);
- DO_ASSERT(ret->is_owned);
- ret->is_owned = false;
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1channel_1options(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
- LDKChannelConfig val_conv = *(LDKChannelConfig*)val;
- FREE((void*)val);
- val_conv.is_owned = true;
- return UserConfig_set_channel_options(this_ptr_conv, val_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1new(JNIEnv * _env, jclass _b, jlong own_channel_config_arg, jlong peer_channel_config_limits_arg, jlong channel_options_arg) {
- LDKChannelHandshakeConfig own_channel_config_arg_conv = *(LDKChannelHandshakeConfig*)own_channel_config_arg;
- FREE((void*)own_channel_config_arg);
- own_channel_config_arg_conv.is_owned = true;
- LDKChannelHandshakeLimits peer_channel_config_limits_arg_conv = *(LDKChannelHandshakeLimits*)peer_channel_config_limits_arg;
- FREE((void*)peer_channel_config_limits_arg);
- peer_channel_config_limits_arg_conv.is_owned = true;
- LDKChannelConfig channel_options_arg_conv = *(LDKChannelConfig*)channel_options_arg;
- FREE((void*)channel_options_arg);
- channel_options_arg_conv.is_owned = true;
- LDKUserConfig* ret = MALLOC(sizeof(LDKUserConfig), "LDKUserConfig");
- *ret = UserConfig_new(own_channel_config_arg_conv, peer_channel_config_limits_arg_conv, channel_options_arg_conv);
- DO_ASSERT(ret->is_owned);
- ret->is_owned = false;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1default(JNIEnv * _env, jclass _b) {
- LDKUserConfig* ret = MALLOC(sizeof(LDKUserConfig), "LDKUserConfig");
- *ret = UserConfig_default();
- DO_ASSERT(ret->is_owned);
- ret->is_owned = false;
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Access_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKAccess this_ptr_conv = *(LDKAccess*)this_ptr;
- FREE((void*)this_ptr);
- return Access_free(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Watch_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKWatch this_ptr_conv = *(LDKWatch*)this_ptr;
- FREE((void*)this_ptr);
- return Watch_free(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKFilter this_ptr_conv = *(LDKFilter*)this_ptr;
- FREE((void*)this_ptr);
- return Filter_free(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)this_ptr;
- FREE((void*)this_ptr);
- return BroadcasterInterface_free(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)this_ptr;
- FREE((void*)this_ptr);
- return FeeEstimator_free(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChainMonitor this_ptr_conv = *(LDKChainMonitor*)this_ptr;
- FREE((void*)this_ptr);
- this_ptr_conv.is_owned = true;
- return ChainMonitor_free(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1block_1connected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jlong txdata, jint height) {
- LDKChainMonitor* this_arg_conv = (LDKChainMonitor*)this_arg;
- unsigned char header_arr[80];
- (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
- unsigned char (*header_ref)[80] = &header_arr;
- LDKCVec_C2Tuple_usizeTransactionZZ txdata_conv = *(LDKCVec_C2Tuple_usizeTransactionZZ*)txdata;
- FREE((void*)txdata);
- return ChainMonitor_block_connected(this_arg_conv, header_ref, txdata_conv, height);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1block_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jint disconnected_height) {
- LDKChainMonitor* this_arg_conv = (LDKChainMonitor*)this_arg;
- unsigned char header_arr[80];
- (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
- unsigned char (*header_ref)[80] = &header_arr;
- return ChainMonitor_block_disconnected(this_arg_conv, header_ref, disconnected_height);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1new(JNIEnv * _env, jclass _b, jlong chain_source, jlong broadcaster, jlong logger, jlong feeest) {
- LDKFilter* chain_source_conv = (LDKFilter*)chain_source;
- LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)broadcaster;
- if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
- // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
- }
- LDKLogger logger_conv = *(LDKLogger*)logger;
- if (logger_conv.free == LDKLogger_JCalls_free) {
- // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKLogger_JCalls_clone(logger_conv.this_arg);
- }
- LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)feeest;
- if (feeest_conv.free == LDKFeeEstimator_JCalls_free) {
- // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKFeeEstimator_JCalls_clone(feeest_conv.this_arg);
- }
- LDKChainMonitor* ret = MALLOC(sizeof(LDKChainMonitor), "LDKChainMonitor");
- *ret = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv);
- DO_ASSERT(ret->is_owned);
- ret->is_owned = false;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Watch(JNIEnv * _env, jclass _b, jlong this_arg) {
- LDKChainMonitor* this_arg_conv = (LDKChainMonitor*)this_arg;
- LDKWatch* ret = MALLOC(sizeof(LDKWatch), "LDKWatch");
- *ret = ChainMonitor_as_Watch(this_arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1EventsProvider(JNIEnv * _env, jclass _b, jlong this_arg) {
- LDKChainMonitor* this_arg_conv = (LDKChainMonitor*)this_arg;
- LDKEventsProvider* ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
- *ret = ChainMonitor_as_EventsProvider(this_arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelMonitorUpdate this_ptr_conv = *(LDKChannelMonitorUpdate*)this_ptr;
- FREE((void*)this_ptr);
- this_ptr_conv.is_owned = true;
- return ChannelMonitorUpdate_free(this_ptr_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1get_1update_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelMonitorUpdate* this_ptr_conv = (LDKChannelMonitorUpdate*)this_ptr;
- return ChannelMonitorUpdate_get_update_id(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1set_1update_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKChannelMonitorUpdate* this_ptr_conv = (LDKChannelMonitorUpdate*)this_ptr;
- return ChannelMonitorUpdate_set_update_id(this_ptr_conv, val);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
- LDKChannelMonitorUpdate* obj_conv = (LDKChannelMonitorUpdate*)obj;
- LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
- *ret = ChannelMonitorUpdate_write(obj_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
- LDKu8slice ser_conv = *(LDKu8slice*)ser;
- LDKChannelMonitorUpdate* ret = MALLOC(sizeof(LDKChannelMonitorUpdate), "LDKChannelMonitorUpdate");
- *ret = ChannelMonitorUpdate_read(ser_conv);
- DO_ASSERT(ret->is_owned);
- ret->is_owned = false;
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKMonitorUpdateError this_ptr_conv = *(LDKMonitorUpdateError*)this_ptr;
- FREE((void*)this_ptr);
- this_ptr_conv.is_owned = true;
- return MonitorUpdateError_free(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)this_ptr;
- FREE((void*)this_ptr);
- this_ptr_conv.is_owned = true;
- return MonitorEvent_free(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKHTLCUpdate this_ptr_conv = *(LDKHTLCUpdate*)this_ptr;
- FREE((void*)this_ptr);
- this_ptr_conv.is_owned = true;
- return HTLCUpdate_free(this_ptr_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
- LDKHTLCUpdate* obj_conv = (LDKHTLCUpdate*)obj;
- LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
- *ret = HTLCUpdate_write(obj_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
- LDKu8slice ser_conv = *(LDKu8slice*)ser;
- LDKHTLCUpdate* ret = MALLOC(sizeof(LDKHTLCUpdate), "LDKHTLCUpdate");
- *ret = HTLCUpdate_read(ser_conv);
- DO_ASSERT(ret->is_owned);
- ret->is_owned = false;
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelMonitor this_ptr_conv = *(LDKChannelMonitor*)this_ptr;
- FREE((void*)this_ptr);
- this_ptr_conv.is_owned = true;
- return ChannelMonitor_free(this_ptr_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1update_1monitor(JNIEnv * _env, jclass _b, jlong this_arg, jlong updates, jlong broadcaster, jlong logger) {
- LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
- LDKChannelMonitorUpdate updates_conv = *(LDKChannelMonitorUpdate*)updates;
- FREE((void*)updates);
- updates_conv.is_owned = true;
- LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster;
- LDKLogger* logger_conv = (LDKLogger*)logger;
- LDKCResult_NoneMonitorUpdateErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
- *ret = ChannelMonitor_update_monitor(this_arg_conv, updates_conv, broadcaster_conv, logger_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1update_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
- LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
- return ChannelMonitor_get_latest_update_id(this_arg_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1funding_1txo(JNIEnv * _env, jclass _b, jlong this_arg) {
- LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
- LDKC2Tuple_OutPointScriptZ* ret = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
- *ret = ChannelMonitor_get_funding_txo(this_arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1monitor_1events(JNIEnv * _env, jclass _b, jlong this_arg) {
- LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
- LDKCVec_MonitorEventZ* ret = MALLOC(sizeof(LDKCVec_MonitorEventZ), "LDKCVec_MonitorEventZ");
- *ret = ChannelMonitor_get_and_clear_pending_monitor_events(this_arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1events(JNIEnv * _env, jclass _b, jlong this_arg) {
- LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
- LDKCVec_EventZ* ret = MALLOC(sizeof(LDKCVec_EventZ), "LDKCVec_EventZ");
- *ret = ChannelMonitor_get_and_clear_pending_events(this_arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1holder_1commitment_1txn(JNIEnv * _env, jclass _b, jlong this_arg, jlong logger) {
- LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
- LDKLogger* logger_conv = (LDKLogger*)logger;
- LDKCVec_TransactionZ* ret = MALLOC(sizeof(LDKCVec_TransactionZ), "LDKCVec_TransactionZ");
- *ret = ChannelMonitor_get_latest_holder_commitment_txn(this_arg_conv, logger_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_1connected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jlong txdata, jint height, jlong broadcaster, jlong fee_estimator, jlong logger) {
- LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
- unsigned char header_arr[80];
- (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
- unsigned char (*header_ref)[80] = &header_arr;
- LDKCVec_C2Tuple_usizeTransactionZZ txdata_conv = *(LDKCVec_C2Tuple_usizeTransactionZZ*)txdata;
- FREE((void*)txdata);
- LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)broadcaster;
- if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
- // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
- }
- LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)fee_estimator;
- if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
- // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
- }
- LDKLogger logger_conv = *(LDKLogger*)logger;
- if (logger_conv.free == LDKLogger_JCalls_free) {
- // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKLogger_JCalls_clone(logger_conv.this_arg);
- }
- LDKCVec_C2Tuple_TxidCVec_TxOutZZZ* ret = MALLOC(sizeof(LDKCVec_C2Tuple_TxidCVec_TxOutZZZ), "LDKCVec_C2Tuple_TxidCVec_TxOutZZZ");
- *ret = ChannelMonitor_block_connected(this_arg_conv, header_ref, txdata_conv, height, broadcaster_conv, fee_estimator_conv, logger_conv);
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jint height, jlong broadcaster, jlong fee_estimator, jlong logger) {
- LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
- unsigned char header_arr[80];
- (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
- unsigned char (*header_ref)[80] = &header_arr;
- LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)broadcaster;
- if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
- // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
- }
- LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)fee_estimator;
- if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
- // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
- }
- LDKLogger logger_conv = *(LDKLogger*)logger;
- if (logger_conv.free == LDKLogger_JCalls_free) {
- // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKLogger_JCalls_clone(logger_conv.this_arg);
- }
- return ChannelMonitor_block_disconnected(this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKOutPoint this_ptr_conv = *(LDKOutPoint*)this_ptr;
- FREE((void*)this_ptr);
- this_ptr_conv.is_owned = true;
- return OutPoint_free(this_ptr_conv);
-}
-
-JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1txid(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
- jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
- (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OutPoint_get_txid(this_ptr_conv));
- return ret_arr;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1txid(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
- LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
- FREE((void*)val);
- return OutPoint_set_txid(this_ptr_conv, val_conv);
-}
-
-JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1index(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
- return OutPoint_get_index(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1index(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
- LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
- return OutPoint_set_index(this_ptr_conv, val);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1new(JNIEnv * _env, jclass _b, jlong txid_arg, jshort index_arg) {
- LDKThirtyTwoBytes txid_arg_conv = *(LDKThirtyTwoBytes*)txid_arg;
- FREE((void*)txid_arg);
- LDKOutPoint* ret = MALLOC(sizeof(LDKOutPoint), "LDKOutPoint");
- *ret = OutPoint_new(txid_arg_conv, index_arg);
- DO_ASSERT(ret->is_owned);
- ret->is_owned = false;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1to_1channel_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
- LDKOutPoint* this_arg_conv = (LDKOutPoint*)this_arg;
- LDKThirtyTwoBytes* ret = MALLOC(sizeof(LDKThirtyTwoBytes), "LDKThirtyTwoBytes");
- *ret = OutPoint_to_channel_id(this_arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1write(JNIEnv * _env, jclass _b, jlong obj) {
- LDKOutPoint* obj_conv = (LDKOutPoint*)obj;
- LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
- *ret = OutPoint_write(obj_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1read(JNIEnv * _env, jclass _b, jlong ser) {
- LDKu8slice ser_conv = *(LDKu8slice*)ser;
- LDKOutPoint* ret = MALLOC(sizeof(LDKOutPoint), "LDKOutPoint");
- *ret = OutPoint_read(ser_conv);
- DO_ASSERT(ret->is_owned);
- ret->is_owned = false;
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)this_ptr;
- FREE((void*)this_ptr);
- return SpendableOutputDescriptor_free(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelKeys this_ptr_conv = *(LDKChannelKeys*)this_ptr;
- FREE((void*)this_ptr);
- return ChannelKeys_free(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysInterface_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKKeysInterface this_ptr_conv = *(LDKKeysInterface*)this_ptr;
- FREE((void*)this_ptr);
- return KeysInterface_free(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKInMemoryChannelKeys this_ptr_conv = *(LDKInMemoryChannelKeys*)this_ptr;
- FREE((void*)this_ptr);
- this_ptr_conv.is_owned = true;
- return InMemoryChannelKeys_free(this_ptr_conv);
-}
-
-JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1funding_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
- jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
- (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_funding_key(this_ptr_conv));
- return ret_arr;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1funding_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
- LDKSecretKey val_conv = *(LDKSecretKey*)val;
- FREE((void*)val);
- return InMemoryChannelKeys_set_funding_key(this_ptr_conv, val_conv);
-}
-
-JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1revocation_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
- jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
- (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_revocation_base_key(this_ptr_conv));
- return ret_arr;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1revocation_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
- LDKSecretKey val_conv = *(LDKSecretKey*)val;
- FREE((void*)val);
- return InMemoryChannelKeys_set_revocation_base_key(this_ptr_conv, val_conv);
-}
-
-JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
- jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
- (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_payment_key(this_ptr_conv));
- return ret_arr;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
- LDKSecretKey val_conv = *(LDKSecretKey*)val;
- FREE((void*)val);
- return InMemoryChannelKeys_set_payment_key(this_ptr_conv, val_conv);
-}
-
-JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1delayed_1payment_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
- jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
- (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_delayed_payment_base_key(this_ptr_conv));
- return ret_arr;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1delayed_1payment_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
- LDKSecretKey val_conv = *(LDKSecretKey*)val;
- FREE((void*)val);
- return InMemoryChannelKeys_set_delayed_payment_base_key(this_ptr_conv, val_conv);
-}
-
-JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1htlc_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
- jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
- (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_htlc_base_key(this_ptr_conv));
- return ret_arr;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1htlc_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
- LDKSecretKey val_conv = *(LDKSecretKey*)val;
- FREE((void*)val);
- return InMemoryChannelKeys_set_htlc_base_key(this_ptr_conv, val_conv);
-}
-
-JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1commitment_1seed(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
- jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
- (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_commitment_seed(this_ptr_conv));
- return ret_arr;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1commitment_1seed(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
- LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
- FREE((void*)val);
- return InMemoryChannelKeys_set_commitment_seed(this_ptr_conv, val_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1new(JNIEnv * _env, jclass _b, jlong funding_key, jlong revocation_base_key, jlong payment_key, jlong delayed_payment_base_key, jlong htlc_base_key, jlong commitment_seed, jlong channel_value_satoshis, jlong key_derivation_params) {
- LDKSecretKey funding_key_conv = *(LDKSecretKey*)funding_key;
- FREE((void*)funding_key);
- LDKSecretKey revocation_base_key_conv = *(LDKSecretKey*)revocation_base_key;
- FREE((void*)revocation_base_key);
- LDKSecretKey payment_key_conv = *(LDKSecretKey*)payment_key;
- FREE((void*)payment_key);
- LDKSecretKey delayed_payment_base_key_conv = *(LDKSecretKey*)delayed_payment_base_key;
- FREE((void*)delayed_payment_base_key);
- LDKSecretKey htlc_base_key_conv = *(LDKSecretKey*)htlc_base_key;
- FREE((void*)htlc_base_key);
- LDKThirtyTwoBytes commitment_seed_conv = *(LDKThirtyTwoBytes*)commitment_seed;
- FREE((void*)commitment_seed);
- LDKC2Tuple_u64u64Z key_derivation_params_conv = *(LDKC2Tuple_u64u64Z*)key_derivation_params;
- FREE((void*)key_derivation_params);
- LDKInMemoryChannelKeys* ret = MALLOC(sizeof(LDKInMemoryChannelKeys), "LDKInMemoryChannelKeys");
- *ret = InMemoryChannelKeys_new(funding_key_conv, revocation_base_key_conv, payment_key_conv, delayed_payment_base_key_conv, htlc_base_key_conv, commitment_seed_conv, channel_value_satoshis, key_derivation_params_conv);
- DO_ASSERT(ret->is_owned);
- ret->is_owned = false;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1counterparty_1pubkeys(JNIEnv * _env, jclass _b, jlong this_arg) {
- LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
- LDKChannelPublicKeys* ret = MALLOC(sizeof(LDKChannelPublicKeys), "LDKChannelPublicKeys");
- *ret = InMemoryChannelKeys_counterparty_pubkeys(this_arg_conv);
- DO_ASSERT(ret->is_owned);
- ret->is_owned = false;
- return (long)ret;
-}
-
-JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1counterparty_1selected_1contest_1delay(JNIEnv * _env, jclass _b, jlong this_arg) {
- LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
- return InMemoryChannelKeys_counterparty_selected_contest_delay(this_arg_conv);
-}
-
-JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1holder_1selected_1contest_1delay(JNIEnv * _env, jclass _b, jlong this_arg) {
- LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
- return InMemoryChannelKeys_holder_selected_contest_delay(this_arg_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1as_1ChannelKeys(JNIEnv * _env, jclass _b, jlong this_arg) {
- LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
- LDKChannelKeys* ret = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys");
- *ret = InMemoryChannelKeys_as_ChannelKeys(this_arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1write(JNIEnv * _env, jclass _b, jlong obj) {
- LDKInMemoryChannelKeys* obj_conv = (LDKInMemoryChannelKeys*)obj;
- LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
- *ret = InMemoryChannelKeys_write(obj_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1read(JNIEnv * _env, jclass _b, jlong ser) {
- LDKu8slice ser_conv = *(LDKu8slice*)ser;
- LDKInMemoryChannelKeys* ret = MALLOC(sizeof(LDKInMemoryChannelKeys), "LDKInMemoryChannelKeys");
- *ret = InMemoryChannelKeys_read(ser_conv);
- DO_ASSERT(ret->is_owned);
- ret->is_owned = false;
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysManager_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKKeysManager this_ptr_conv = *(LDKKeysManager*)this_ptr;
- FREE((void*)this_ptr);
- this_ptr_conv.is_owned = true;
- return KeysManager_free(this_ptr_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1new(JNIEnv * _env, jclass _b, jbyteArray seed, jclass network, jlong starting_time_secs, jint starting_time_nanos) {
- unsigned char seed_arr[32];
- (*_env)->GetByteArrayRegion (_env, seed, 0, 32, seed_arr);
- unsigned char (*seed_ref)[32] = &seed_arr;
- LDKNetwork network_conv = LDKNetwork_from_java(_env, network);
- LDKKeysManager* ret = MALLOC(sizeof(LDKKeysManager), "LDKKeysManager");
- *ret = KeysManager_new(seed_ref, network_conv, starting_time_secs, starting_time_nanos);
- DO_ASSERT(ret->is_owned);
- ret->is_owned = false;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1derive_1channel_1keys(JNIEnv * _env, jclass _b, jlong this_arg, jlong channel_value_satoshis, jlong params_1, jlong params_2) {
- LDKKeysManager* this_arg_conv = (LDKKeysManager*)this_arg;
- LDKInMemoryChannelKeys* ret = MALLOC(sizeof(LDKInMemoryChannelKeys), "LDKInMemoryChannelKeys");
- *ret = KeysManager_derive_channel_keys(this_arg_conv, channel_value_satoshis, params_1, params_2);
- DO_ASSERT(ret->is_owned);
- ret->is_owned = false;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1KeysInterface(JNIEnv * _env, jclass _b, jlong this_arg) {
- LDKKeysManager* this_arg_conv = (LDKKeysManager*)this_arg;
- LDKKeysInterface* ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
- *ret = KeysManager_as_KeysInterface(this_arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelManager this_ptr_conv = *(LDKChannelManager*)this_ptr;
- FREE((void*)this_ptr);
- this_ptr_conv.is_owned = true;
- return ChannelManager_free(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelDetails this_ptr_conv = *(LDKChannelDetails*)this_ptr;
- FREE((void*)this_ptr);
- this_ptr_conv.is_owned = true;
- return ChannelDetails_free(this_ptr_conv);
-}
-
-JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
- jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
- (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ChannelDetails_get_channel_id(this_ptr_conv));
- return ret_arr;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
- LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
- FREE((void*)val);
- return ChannelDetails_set_channel_id(this_ptr_conv, val_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1remote_1network_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
- LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
- *ret = ChannelDetails_get_remote_network_id(this_ptr_conv);
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1remote_1network_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
- LDKPublicKey val_conv = *(LDKPublicKey*)val;
- FREE((void*)val);
- return ChannelDetails_set_remote_network_id(this_ptr_conv, val_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1counterparty_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
- LDKInitFeatures* ret = MALLOC(sizeof(LDKInitFeatures), "LDKInitFeatures");
- *ret = ChannelDetails_get_counterparty_features(this_ptr_conv);
- DO_ASSERT(ret->is_owned);
- ret->is_owned = false;
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1counterparty_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
- LDKInitFeatures val_conv = *(LDKInitFeatures*)val;
- FREE((void*)val);
- val_conv.is_owned = true;
- return ChannelDetails_set_counterparty_features(this_ptr_conv, val_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1value_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
- return ChannelDetails_get_channel_value_satoshis(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1value_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
- return ChannelDetails_set_channel_value_satoshis(this_ptr_conv, val);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1user_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
- return ChannelDetails_get_user_id(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1user_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
- return ChannelDetails_set_user_id(this_ptr_conv, val);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
- return ChannelDetails_get_outbound_capacity_msat(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1outbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
- return ChannelDetails_set_outbound_capacity_msat(this_ptr_conv, val);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
- return ChannelDetails_get_inbound_capacity_msat(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
- return ChannelDetails_set_inbound_capacity_msat(this_ptr_conv, val);
-}
-
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1live(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
- return ChannelDetails_get_is_live(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1live(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
- LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
- return ChannelDetails_set_is_live(this_ptr_conv, val);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)this_ptr;
- FREE((void*)this_ptr);
- this_ptr_conv.is_owned = true;
- return PaymentSendFailure_free(this_ptr_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1new(JNIEnv * _env, jclass _b, jclass network, jlong fee_est, jlong chain_monitor, jlong tx_broadcaster, jlong logger, jlong keys_manager, jlong config, jlong current_blockchain_height) {
- LDKNetwork network_conv = LDKNetwork_from_java(_env, network);
- LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)fee_est;
- if (fee_est_conv.free == LDKFeeEstimator_JCalls_free) {
- // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKFeeEstimator_JCalls_clone(fee_est_conv.this_arg);
- }
- LDKWatch chain_monitor_conv = *(LDKWatch*)chain_monitor;
- if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
- // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKWatch_JCalls_clone(chain_monitor_conv.this_arg);
- }
- LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)tx_broadcaster;
- if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
- // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKBroadcasterInterface_JCalls_clone(tx_broadcaster_conv.this_arg);
- }
- LDKLogger logger_conv = *(LDKLogger*)logger;
- if (logger_conv.free == LDKLogger_JCalls_free) {
- // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKLogger_JCalls_clone(logger_conv.this_arg);
- }
- LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)keys_manager;
- if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
- // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKKeysInterface_JCalls_clone(keys_manager_conv.this_arg);
- }
- LDKUserConfig config_conv = *(LDKUserConfig*)config;
- FREE((void*)config);
- config_conv.is_owned = true;
- LDKChannelManager* ret = MALLOC(sizeof(LDKChannelManager), "LDKChannelManager");
- *ret = ChannelManager_new(network_conv, fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, keys_manager_conv, config_conv, current_blockchain_height);
- DO_ASSERT(ret->is_owned);
- ret->is_owned = false;
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1create_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jlong their_network_key, jlong channel_value_satoshis, jlong push_msat, jlong user_id, jlong override_config) {
- LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
- LDKPublicKey their_network_key_conv = *(LDKPublicKey*)their_network_key;
- FREE((void*)their_network_key);
- LDKUserConfig override_config_conv = *(LDKUserConfig*)override_config;
- FREE((void*)override_config);
- override_config_conv.is_owned = true;
- LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
- *ret = ChannelManager_create_channel(this_arg_conv, their_network_key_conv, channel_value_satoshis, push_msat, user_id, override_config_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
- LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
- LDKCVec_ChannelDetailsZ* ret = MALLOC(sizeof(LDKCVec_ChannelDetailsZ), "LDKCVec_ChannelDetailsZ");
- *ret = ChannelManager_list_channels(this_arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1usable_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
- LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
- LDKCVec_ChannelDetailsZ* ret = MALLOC(sizeof(LDKCVec_ChannelDetailsZ), "LDKCVec_ChannelDetailsZ");
- *ret = ChannelManager_list_usable_channels(this_arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray channel_id) {
- LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
- unsigned char channel_id_arr[32];
- (*_env)->GetByteArrayRegion (_env, channel_id, 0, 32, channel_id_arr);
- unsigned char (*channel_id_ref)[32] = &channel_id_arr;
- LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
- *ret = ChannelManager_close_channel(this_arg_conv, channel_id_ref);
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray channel_id) {
- LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
- unsigned char channel_id_arr[32];
- (*_env)->GetByteArrayRegion (_env, channel_id, 0, 32, channel_id_arr);
- unsigned char (*channel_id_ref)[32] = &channel_id_arr;
- return ChannelManager_force_close_channel(this_arg_conv, channel_id_ref);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1all_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
- LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
- return ChannelManager_force_close_all_channels(this_arg_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payment(JNIEnv * _env, jclass _b, jlong this_arg, jlong route, jlong payment_hash, jlong payment_secret) {
- LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
- LDKRoute* route_conv = (LDKRoute*)route;
- LDKThirtyTwoBytes payment_hash_conv = *(LDKThirtyTwoBytes*)payment_hash;
- FREE((void*)payment_hash);
- LDKThirtyTwoBytes payment_secret_conv = *(LDKThirtyTwoBytes*)payment_secret;
- FREE((void*)payment_secret);
- LDKCResult_NonePaymentSendFailureZ* ret = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
- *ret = ChannelManager_send_payment(this_arg_conv, route_conv, payment_hash_conv, payment_secret_conv);
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1funding_1transaction_1generated(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray temporary_channel_id, jlong funding_txo) {
- LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
- unsigned char temporary_channel_id_arr[32];
- (*_env)->GetByteArrayRegion (_env, temporary_channel_id, 0, 32, temporary_channel_id_arr);
- unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
- LDKOutPoint funding_txo_conv = *(LDKOutPoint*)funding_txo;
- FREE((void*)funding_txo);
- funding_txo_conv.is_owned = true;
- return ChannelManager_funding_transaction_generated(this_arg_conv, temporary_channel_id_ref, funding_txo_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1broadcast_1node_1announcement(JNIEnv * _env, jclass _b, jlong this_arg, jlong rgb, jlong alias, jlong addresses) {
- LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
- LDKThreeBytes rgb_conv = *(LDKThreeBytes*)rgb;
- FREE((void*)rgb);
- LDKThirtyTwoBytes alias_conv = *(LDKThirtyTwoBytes*)alias;
- FREE((void*)alias);
- LDKCVec_NetAddressZ addresses_conv = *(LDKCVec_NetAddressZ*)addresses;
- FREE((void*)addresses);
- return ChannelManager_broadcast_node_announcement(this_arg_conv, rgb_conv, alias_conv, addresses_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1process_1pending_1htlc_1forwards(JNIEnv * _env, jclass _b, jlong this_arg) {
- LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
- return ChannelManager_process_pending_htlc_forwards(this_arg_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1timer_1chan_1freshness_1every_1min(JNIEnv * _env, jclass _b, jlong this_arg) {
- LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
- return ChannelManager_timer_chan_freshness_every_min(this_arg_conv);
-}
-
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1fail_1htlc_1backwards(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray payment_hash, jlong payment_secret) {
- LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
- unsigned char payment_hash_arr[32];
- (*_env)->GetByteArrayRegion (_env, payment_hash, 0, 32, payment_hash_arr);
- unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
- LDKThirtyTwoBytes payment_secret_conv = *(LDKThirtyTwoBytes*)payment_secret;
- FREE((void*)payment_secret);
- return ChannelManager_fail_htlc_backwards(this_arg_conv, payment_hash_ref, payment_secret_conv);
-}
-
-JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1claim_1funds(JNIEnv * _env, jclass _b, jlong this_arg, jlong payment_preimage, jlong payment_secret, jlong expected_amount) {
- LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
- LDKThirtyTwoBytes payment_preimage_conv = *(LDKThirtyTwoBytes*)payment_preimage;
- FREE((void*)payment_preimage);
- LDKThirtyTwoBytes payment_secret_conv = *(LDKThirtyTwoBytes*)payment_secret;
- FREE((void*)payment_secret);
- return ChannelManager_claim_funds(this_arg_conv, payment_preimage_conv, payment_secret_conv, expected_amount);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1our_1node_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
- LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
- LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
- *ret = ChannelManager_get_our_node_id(this_arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1channel_1monitor_1updated(JNIEnv * _env, jclass _b, jlong this_arg, jlong funding_txo, jlong highest_applied_update_id) {
- LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
- LDKOutPoint* funding_txo_conv = (LDKOutPoint*)funding_txo;
- return ChannelManager_channel_monitor_updated(this_arg_conv, funding_txo_conv, highest_applied_update_id);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1MessageSendEventsProvider(JNIEnv * _env, jclass _b, jlong this_arg) {
- LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
- LDKMessageSendEventsProvider* ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
- *ret = ChannelManager_as_MessageSendEventsProvider(this_arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1EventsProvider(JNIEnv * _env, jclass _b, jlong this_arg) {
- LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
- LDKEventsProvider* ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
- *ret = ChannelManager_as_EventsProvider(this_arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1block_1connected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jlong txdata, jint height) {
- LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
- unsigned char header_arr[80];
- (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
- unsigned char (*header_ref)[80] = &header_arr;
- LDKCVec_C2Tuple_usizeTransactionZZ txdata_conv = *(LDKCVec_C2Tuple_usizeTransactionZZ*)txdata;
- FREE((void*)txdata);
- return ChannelManager_block_connected(this_arg_conv, header_ref, txdata_conv, height);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1block_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header) {
- LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
- unsigned char header_arr[80];
- (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
- unsigned char (*header_ref)[80] = &header_arr;
- return ChannelManager_block_disconnected(this_arg_conv, header_ref);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1ChannelMessageHandler(JNIEnv * _env, jclass _b, jlong this_arg) {
- LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
- LDKChannelMessageHandler* ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
- *ret = ChannelManager_as_ChannelMessageHandler(this_arg_conv);
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelManagerReadArgs this_ptr_conv = *(LDKChannelManagerReadArgs*)this_ptr;
- FREE((void*)this_ptr);
- this_ptr_conv.is_owned = true;
- return ChannelManagerReadArgs_free(this_ptr_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1keys_1manager(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
- long ret = (long)ChannelManagerReadArgs_get_keys_manager(this_ptr_conv);
- return ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1keys_1manager(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
- LDKKeysInterface val_conv = *(LDKKeysInterface*)val;
- if (val_conv.free == LDKKeysInterface_JCalls_free) {
- // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKKeysInterface_JCalls_clone(val_conv.this_arg);
- }
- return ChannelManagerReadArgs_set_keys_manager(this_ptr_conv, val_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1fee_1estimator(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
- long ret = (long)ChannelManagerReadArgs_get_fee_estimator(this_ptr_conv);
- return ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1fee_1estimator(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
- LDKFeeEstimator val_conv = *(LDKFeeEstimator*)val;
- if (val_conv.free == LDKFeeEstimator_JCalls_free) {
- // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKFeeEstimator_JCalls_clone(val_conv.this_arg);
- }
- return ChannelManagerReadArgs_set_fee_estimator(this_ptr_conv, val_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1chain_1monitor(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
- long ret = (long)ChannelManagerReadArgs_get_chain_monitor(this_ptr_conv);
- return ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1chain_1monitor(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
- LDKWatch val_conv = *(LDKWatch*)val;
- if (val_conv.free == LDKWatch_JCalls_free) {
- // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKWatch_JCalls_clone(val_conv.this_arg);
- }
- return ChannelManagerReadArgs_set_chain_monitor(this_ptr_conv, val_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1tx_1broadcaster(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
- long ret = (long)ChannelManagerReadArgs_get_tx_broadcaster(this_ptr_conv);
- return ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1tx_1broadcaster(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
- LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)val;
- if (val_conv.free == LDKBroadcasterInterface_JCalls_free) {
- // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKBroadcasterInterface_JCalls_clone(val_conv.this_arg);
- }
- return ChannelManagerReadArgs_set_tx_broadcaster(this_ptr_conv, val_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1logger(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
- long ret = (long)ChannelManagerReadArgs_get_logger(this_ptr_conv);
- return ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1logger(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
- LDKLogger val_conv = *(LDKLogger*)val;
- if (val_conv.free == LDKLogger_JCalls_free) {
- // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKLogger_JCalls_clone(val_conv.this_arg);
- }
- return ChannelManagerReadArgs_set_logger(this_ptr_conv, val_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1default_1config(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
- LDKUserConfig* ret = MALLOC(sizeof(LDKUserConfig), "LDKUserConfig");
- *ret = ChannelManagerReadArgs_get_default_config(this_ptr_conv);
- DO_ASSERT(ret->is_owned);
- ret->is_owned = false;
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1default_1config(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
- LDKUserConfig val_conv = *(LDKUserConfig*)val;
- FREE((void*)val);
- val_conv.is_owned = true;
- return ChannelManagerReadArgs_set_default_config(this_ptr_conv, val_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new(JNIEnv * _env, jclass _b, jlong keys_manager, jlong fee_estimator, jlong chain_monitor, jlong tx_broadcaster, jlong logger, jlong default_config, jlong channel_monitors) {
- LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)keys_manager;
- if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
- // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKKeysInterface_JCalls_clone(keys_manager_conv.this_arg);
- }
- LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)fee_estimator;
- if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
- // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
- }
- LDKWatch chain_monitor_conv = *(LDKWatch*)chain_monitor;
- if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
- // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKWatch_JCalls_clone(chain_monitor_conv.this_arg);
- }
- LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)tx_broadcaster;
- if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
- // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKBroadcasterInterface_JCalls_clone(tx_broadcaster_conv.this_arg);
- }
- LDKLogger logger_conv = *(LDKLogger*)logger;
- if (logger_conv.free == LDKLogger_JCalls_free) {
- // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
- LDKLogger_JCalls_clone(logger_conv.this_arg);
- }
- LDKUserConfig default_config_conv = *(LDKUserConfig*)default_config;
- FREE((void*)default_config);
- default_config_conv.is_owned = true;
- LDKCVec_ChannelMonitorZ channel_monitors_conv = *(LDKCVec_ChannelMonitorZ*)channel_monitors;
- FREE((void*)channel_monitors);
- LDKChannelManagerReadArgs* ret = MALLOC(sizeof(LDKChannelManagerReadArgs), "LDKChannelManagerReadArgs");
- *ret = ChannelManagerReadArgs_new(keys_manager_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, default_config_conv, channel_monitors_conv);
- DO_ASSERT(ret->is_owned);
- ret->is_owned = false;
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DecodeError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKDecodeError this_ptr_conv = *(LDKDecodeError*)this_ptr;
- FREE((void*)this_ptr);
- this_ptr_conv.is_owned = true;
- return DecodeError_free(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKInit this_ptr_conv = *(LDKInit*)this_ptr;
- FREE((void*)this_ptr);
- this_ptr_conv.is_owned = true;
- return Init_free(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKErrorMessage this_ptr_conv = *(LDKErrorMessage*)this_ptr;
- FREE((void*)this_ptr);
- this_ptr_conv.is_owned = true;
- return ErrorMessage_free(this_ptr_conv);
-}
-
-JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
- jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
- (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ErrorMessage_get_channel_id(this_ptr_conv));
- return ret_arr;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
- LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
- FREE((void*)val);
- return ErrorMessage_set_channel_id(this_ptr_conv, val_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1data(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
- LDKStr* ret = MALLOC(sizeof(LDKStr), "LDKStr");
- *ret = ErrorMessage_get_data(this_ptr_conv);
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1data(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
- LDKCVec_u8Z val_conv = *(LDKCVec_u8Z*)val;
- FREE((void*)val);
- return ErrorMessage_set_data(this_ptr_conv, val_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong data_arg) {
- LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
- FREE((void*)channel_id_arg);
- LDKCVec_u8Z data_arg_conv = *(LDKCVec_u8Z*)data_arg;
- FREE((void*)data_arg);
- LDKErrorMessage* ret = MALLOC(sizeof(LDKErrorMessage), "LDKErrorMessage");
- *ret = ErrorMessage_new(channel_id_arg_conv, data_arg_conv);
- DO_ASSERT(ret->is_owned);
- ret->is_owned = false;
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKPing this_ptr_conv = *(LDKPing*)this_ptr;
- FREE((void*)this_ptr);
- this_ptr_conv.is_owned = true;
- return Ping_free(this_ptr_conv);
-}
-
-JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Ping_1get_1ponglen(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
- return Ping_get_ponglen(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1ponglen(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
- LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
- return Ping_set_ponglen(this_ptr_conv, val);
-}
-
-JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Ping_1get_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
- return Ping_get_byteslen(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
- LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
- return Ping_set_byteslen(this_ptr_conv, val);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1new(JNIEnv * _env, jclass _b, jshort ponglen_arg, jshort byteslen_arg) {
- LDKPing* ret = MALLOC(sizeof(LDKPing), "LDKPing");
- *ret = Ping_new(ponglen_arg, byteslen_arg);
- DO_ASSERT(ret->is_owned);
- ret->is_owned = false;
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKPong this_ptr_conv = *(LDKPong*)this_ptr;
- FREE((void*)this_ptr);
- this_ptr_conv.is_owned = true;
- return Pong_free(this_ptr_conv);
-}
-
-JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Pong_1get_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKPong* this_ptr_conv = (LDKPong*)this_ptr;
- return Pong_get_byteslen(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1set_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
- LDKPong* this_ptr_conv = (LDKPong*)this_ptr;
- return Pong_set_byteslen(this_ptr_conv, val);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1new(JNIEnv * _env, jclass _b, jshort byteslen_arg) {
- LDKPong* ret = MALLOC(sizeof(LDKPong), "LDKPong");
- *ret = Pong_new(byteslen_arg);
- DO_ASSERT(ret->is_owned);
- ret->is_owned = false;
- return (long)ret;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKOpenChannel this_ptr_conv = *(LDKOpenChannel*)this_ptr;
- FREE((void*)this_ptr);
- this_ptr_conv.is_owned = true;
- return OpenChannel_free(this_ptr_conv);
-}
-
-JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
- jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
- (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OpenChannel_get_chain_hash(this_ptr_conv));
- return ret_arr;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
- LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
- FREE((void*)val);
- return OpenChannel_set_chain_hash(this_ptr_conv, val_conv);
-}
-
-JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
- jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
- (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OpenChannel_get_temporary_channel_id(this_ptr_conv));
- return ret_arr;
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
- LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
- FREE((void*)val);
- return OpenChannel_set_temporary_channel_id(this_ptr_conv, val_conv);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
- return OpenChannel_get_funding_satoshis(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
- return OpenChannel_set_funding_satoshis(this_ptr_conv, val);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1push_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
- return OpenChannel_get_push_msat(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1push_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
- return OpenChannel_set_push_msat(this_ptr_conv, val);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
- return OpenChannel_get_dust_limit_satoshis(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
- return OpenChannel_set_dust_limit_satoshis(this_ptr_conv, val);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
- return OpenChannel_get_max_htlc_value_in_flight_msat(this_ptr_conv);
-}
-
-JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
- LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
- return OpenChannel_set_max_htlc_value_in_flight_msat(this_ptr_conv, val);
-}
-
-JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
- LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
- return OpenChannel_get_channel_reserve_satoshis(this_ptr_conv);