1 #include "org_ldk_impl_bindings.h"
2 #include <rust_types.h>
9 static mtx_t allocation_mtx;
11 void __attribute__((constructor)) init_mtx() {
12 assert(mtx_init(&allocation_mtx, mtx_plain) == thrd_success);
15 typedef struct allocation {
16 struct allocation* next;
18 const char* struct_name;
20 static allocation* allocation_ll = NULL;
22 void* MALLOC(size_t len, const char* struct_name) {
23 void* res = malloc(len);
24 allocation* new_alloc = malloc(sizeof(allocation));
26 new_alloc->struct_name = struct_name;
27 assert(mtx_lock(&allocation_mtx) == thrd_success);
28 new_alloc->next = allocation_ll;
29 allocation_ll = new_alloc;
30 assert(mtx_unlock(&allocation_mtx) == thrd_success);
34 void FREE(void* ptr) {
36 assert(mtx_lock(&allocation_mtx) == thrd_success);
37 allocation* it = allocation_ll;
38 while (it->ptr != ptr) { p = it; it = it->next; }
39 if (p) { p->next = it->next; } else { allocation_ll = it->next; }
40 assert(mtx_unlock(&allocation_mtx) == thrd_success);
41 assert(it->ptr == ptr);
46 void __attribute__((destructor)) check_leaks() {
47 for (allocation* a = allocation_ll; a != NULL; a = a->next) { fprintf(stderr, "%s %p remains\n", a->struct_name, a->ptr); }
48 assert(allocation_ll == NULL);
51 jmethodID ordinal_meth = NULL;
52 JNIEXPORT void Java_org_ldk_impl_bindings_init(JNIEnv * env, jclass _b, jclass enum_class) {
53 ordinal_meth = (*env)->GetMethodID(env, enum_class, "ordinal", "()I");
54 assert(ordinal_meth != NULL);
57 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_deref_1bool (JNIEnv * env, jclass _a, jlong ptr) {
60 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_deref_1long (JNIEnv * env, jclass _a, jlong ptr) {
63 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_free_1heap_1ptr (JNIEnv * env, jclass _a, jlong ptr) {
66 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_u8_1vec_1to_1heap_1slice (JNIEnv * env, jclass _a, jlong ptr) {
67 LDKCVec_u8Z *vec = (LDKCVec_u8Z*)ptr;
68 LDKu8slice *slice = (LDKu8slice*)MALLOC(sizeof(LDKu8slice), "u8slice");
69 slice->data = vec->data;
70 slice->datalen = vec->datalen;
73 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_u8_1vec_1len (JNIEnv * env, jclass _a, jlong ptr) {
74 LDKCVec_u8Z *vec = (LDKCVec_u8Z*)ptr;
75 return (long)vec->datalen;
78 // We assume that CVec_u8Z and u8slice are the same size and layout (and thus pointers to the two can be mixed)
79 _Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKu8slice), "Vec<u8> and [u8] need to have been mapped identically");
80 _Static_assert(offsetof(LDKCVec_u8Z, data) == offsetof(LDKu8slice, data), "Vec<u8> and [u8] need to have been mapped identically");
81 _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKu8slice, datalen), "Vec<u8> and [u8] need to have been mapped identically");
83 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKSecretKey_1new(JNIEnv * _env, jclass _b) {
84 LDKSecretKey* key = (LDKSecretKey*)MALLOC(sizeof(LDKSecretKey), "LDKSecretKey");
87 static inline LDKAccessError LDKAccessError_from_java(JNIEnv *env, jclass val) {
88 switch ((*env)->CallIntMethod(env, val, ordinal_meth)) {
89 case 0: return LDKAccessError_UnknownChain;
90 case 1: return LDKAccessError_UnknownTx;
94 static inline jclass LDKAccessError_to_java(JNIEnv *env, LDKAccessError val) {
95 // TODO: This is pretty inefficient, we really need to cache the field IDs and class
96 jclass enum_class = (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAccessError;");
97 assert(enum_class != NULL);
99 case LDKAccessError_UnknownChain: {
100 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKAccessError_UnknownChain", "Lorg/ldk/impl/bindings$LDKAccessError;");
101 assert(field != NULL);
102 return (*env)->GetStaticObjectField(env, enum_class, field);
104 case LDKAccessError_UnknownTx: {
105 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKAccessError_UnknownTx", "Lorg/ldk/impl/bindings$LDKAccessError;");
106 assert(field != NULL);
107 return (*env)->GetStaticObjectField(env, enum_class, field);
109 default: assert(false);
113 static inline LDKChannelMonitorUpdateErr LDKChannelMonitorUpdateErr_from_java(JNIEnv *env, jclass val) {
114 switch ((*env)->CallIntMethod(env, val, ordinal_meth)) {
115 case 0: return LDKChannelMonitorUpdateErr_TemporaryFailure;
116 case 1: return LDKChannelMonitorUpdateErr_PermanentFailure;
120 static inline jclass LDKChannelMonitorUpdateErr_to_java(JNIEnv *env, LDKChannelMonitorUpdateErr val) {
121 // TODO: This is pretty inefficient, we really need to cache the field IDs and class
122 jclass enum_class = (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKChannelMonitorUpdateErr;");
123 assert(enum_class != NULL);
125 case LDKChannelMonitorUpdateErr_TemporaryFailure: {
126 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKChannelMonitorUpdateErr_TemporaryFailure", "Lorg/ldk/impl/bindings$LDKChannelMonitorUpdateErr;");
127 assert(field != NULL);
128 return (*env)->GetStaticObjectField(env, enum_class, field);
130 case LDKChannelMonitorUpdateErr_PermanentFailure: {
131 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKChannelMonitorUpdateErr_PermanentFailure", "Lorg/ldk/impl/bindings$LDKChannelMonitorUpdateErr;");
132 assert(field != NULL);
133 return (*env)->GetStaticObjectField(env, enum_class, field);
135 default: assert(false);
139 static inline LDKConfirmationTarget LDKConfirmationTarget_from_java(JNIEnv *env, jclass val) {
140 switch ((*env)->CallIntMethod(env, val, ordinal_meth)) {
141 case 0: return LDKConfirmationTarget_Background;
142 case 1: return LDKConfirmationTarget_Normal;
143 case 2: return LDKConfirmationTarget_HighPriority;
147 static inline jclass LDKConfirmationTarget_to_java(JNIEnv *env, LDKConfirmationTarget val) {
148 // TODO: This is pretty inefficient, we really need to cache the field IDs and class
149 jclass enum_class = (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKConfirmationTarget;");
150 assert(enum_class != NULL);
152 case LDKConfirmationTarget_Background: {
153 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKConfirmationTarget_Background", "Lorg/ldk/impl/bindings$LDKConfirmationTarget;");
154 assert(field != NULL);
155 return (*env)->GetStaticObjectField(env, enum_class, field);
157 case LDKConfirmationTarget_Normal: {
158 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKConfirmationTarget_Normal", "Lorg/ldk/impl/bindings$LDKConfirmationTarget;");
159 assert(field != NULL);
160 return (*env)->GetStaticObjectField(env, enum_class, field);
162 case LDKConfirmationTarget_HighPriority: {
163 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKConfirmationTarget_HighPriority", "Lorg/ldk/impl/bindings$LDKConfirmationTarget;");
164 assert(field != NULL);
165 return (*env)->GetStaticObjectField(env, enum_class, field);
167 default: assert(false);
171 static inline LDKLevel LDKLevel_from_java(JNIEnv *env, jclass val) {
172 switch ((*env)->CallIntMethod(env, val, ordinal_meth)) {
173 case 0: return LDKLevel_Off;
174 case 1: return LDKLevel_Error;
175 case 2: return LDKLevel_Warn;
176 case 3: return LDKLevel_Info;
177 case 4: return LDKLevel_Debug;
178 case 5: return LDKLevel_Trace;
182 static inline jclass LDKLevel_to_java(JNIEnv *env, LDKLevel val) {
183 // TODO: This is pretty inefficient, we really need to cache the field IDs and class
184 jclass enum_class = (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKLevel;");
185 assert(enum_class != NULL);
188 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKLevel_Off", "Lorg/ldk/impl/bindings$LDKLevel;");
189 assert(field != NULL);
190 return (*env)->GetStaticObjectField(env, enum_class, field);
192 case LDKLevel_Error: {
193 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKLevel_Error", "Lorg/ldk/impl/bindings$LDKLevel;");
194 assert(field != NULL);
195 return (*env)->GetStaticObjectField(env, enum_class, field);
197 case LDKLevel_Warn: {
198 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKLevel_Warn", "Lorg/ldk/impl/bindings$LDKLevel;");
199 assert(field != NULL);
200 return (*env)->GetStaticObjectField(env, enum_class, field);
202 case LDKLevel_Info: {
203 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKLevel_Info", "Lorg/ldk/impl/bindings$LDKLevel;");
204 assert(field != NULL);
205 return (*env)->GetStaticObjectField(env, enum_class, field);
207 case LDKLevel_Debug: {
208 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKLevel_Debug", "Lorg/ldk/impl/bindings$LDKLevel;");
209 assert(field != NULL);
210 return (*env)->GetStaticObjectField(env, enum_class, field);
212 case LDKLevel_Trace: {
213 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKLevel_Trace", "Lorg/ldk/impl/bindings$LDKLevel;");
214 assert(field != NULL);
215 return (*env)->GetStaticObjectField(env, enum_class, field);
217 default: assert(false);
221 static inline LDKNetwork LDKNetwork_from_java(JNIEnv *env, jclass val) {
222 switch ((*env)->CallIntMethod(env, val, ordinal_meth)) {
223 case 0: return LDKNetwork_Bitcoin;
224 case 1: return LDKNetwork_Testnet;
225 case 2: return LDKNetwork_Regtest;
229 static inline jclass LDKNetwork_to_java(JNIEnv *env, LDKNetwork val) {
230 // TODO: This is pretty inefficient, we really need to cache the field IDs and class
231 jclass enum_class = (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetwork;");
232 assert(enum_class != NULL);
234 case LDKNetwork_Bitcoin: {
235 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKNetwork_Bitcoin", "Lorg/ldk/impl/bindings$LDKNetwork;");
236 assert(field != NULL);
237 return (*env)->GetStaticObjectField(env, enum_class, field);
239 case LDKNetwork_Testnet: {
240 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKNetwork_Testnet", "Lorg/ldk/impl/bindings$LDKNetwork;");
241 assert(field != NULL);
242 return (*env)->GetStaticObjectField(env, enum_class, field);
244 case LDKNetwork_Regtest: {
245 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKNetwork_Regtest", "Lorg/ldk/impl/bindings$LDKNetwork;");
246 assert(field != NULL);
247 return (*env)->GetStaticObjectField(env, enum_class, field);
249 default: assert(false);
253 static inline LDKSecp256k1Error LDKSecp256k1Error_from_java(JNIEnv *env, jclass val) {
254 switch ((*env)->CallIntMethod(env, val, ordinal_meth)) {
255 case 0: return LDKSecp256k1Error_IncorrectSignature;
256 case 1: return LDKSecp256k1Error_InvalidMessage;
257 case 2: return LDKSecp256k1Error_InvalidPublicKey;
258 case 3: return LDKSecp256k1Error_InvalidSignature;
259 case 4: return LDKSecp256k1Error_InvalidSecretKey;
260 case 5: return LDKSecp256k1Error_InvalidRecoveryId;
261 case 6: return LDKSecp256k1Error_InvalidTweak;
262 case 7: return LDKSecp256k1Error_NotEnoughMemory;
263 case 8: return LDKSecp256k1Error_CallbackPanicked;
267 static inline jclass LDKSecp256k1Error_to_java(JNIEnv *env, LDKSecp256k1Error val) {
268 // TODO: This is pretty inefficient, we really need to cache the field IDs and class
269 jclass enum_class = (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKSecp256k1Error;");
270 assert(enum_class != NULL);
272 case LDKSecp256k1Error_IncorrectSignature: {
273 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKSecp256k1Error_IncorrectSignature", "Lorg/ldk/impl/bindings$LDKSecp256k1Error;");
274 assert(field != NULL);
275 return (*env)->GetStaticObjectField(env, enum_class, field);
277 case LDKSecp256k1Error_InvalidMessage: {
278 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKSecp256k1Error_InvalidMessage", "Lorg/ldk/impl/bindings$LDKSecp256k1Error;");
279 assert(field != NULL);
280 return (*env)->GetStaticObjectField(env, enum_class, field);
282 case LDKSecp256k1Error_InvalidPublicKey: {
283 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKSecp256k1Error_InvalidPublicKey", "Lorg/ldk/impl/bindings$LDKSecp256k1Error;");
284 assert(field != NULL);
285 return (*env)->GetStaticObjectField(env, enum_class, field);
287 case LDKSecp256k1Error_InvalidSignature: {
288 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKSecp256k1Error_InvalidSignature", "Lorg/ldk/impl/bindings$LDKSecp256k1Error;");
289 assert(field != NULL);
290 return (*env)->GetStaticObjectField(env, enum_class, field);
292 case LDKSecp256k1Error_InvalidSecretKey: {
293 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKSecp256k1Error_InvalidSecretKey", "Lorg/ldk/impl/bindings$LDKSecp256k1Error;");
294 assert(field != NULL);
295 return (*env)->GetStaticObjectField(env, enum_class, field);
297 case LDKSecp256k1Error_InvalidRecoveryId: {
298 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKSecp256k1Error_InvalidRecoveryId", "Lorg/ldk/impl/bindings$LDKSecp256k1Error;");
299 assert(field != NULL);
300 return (*env)->GetStaticObjectField(env, enum_class, field);
302 case LDKSecp256k1Error_InvalidTweak: {
303 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKSecp256k1Error_InvalidTweak", "Lorg/ldk/impl/bindings$LDKSecp256k1Error;");
304 assert(field != NULL);
305 return (*env)->GetStaticObjectField(env, enum_class, field);
307 case LDKSecp256k1Error_NotEnoughMemory: {
308 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKSecp256k1Error_NotEnoughMemory", "Lorg/ldk/impl/bindings$LDKSecp256k1Error;");
309 assert(field != NULL);
310 return (*env)->GetStaticObjectField(env, enum_class, field);
312 case LDKSecp256k1Error_CallbackPanicked: {
313 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKSecp256k1Error_CallbackPanicked", "Lorg/ldk/impl/bindings$LDKSecp256k1Error;");
314 assert(field != NULL);
315 return (*env)->GetStaticObjectField(env, enum_class, field);
317 default: assert(false);
321 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
322 return ((LDKCResult_NoneChannelMonitorUpdateErrZ*)arg)->result_ok;
324 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
325 if (((LDKCResult_NoneChannelMonitorUpdateErrZ*)arg)->result_ok) {
326 return (long)((LDKCResult_NoneChannelMonitorUpdateErrZ*)arg)->contents.result;
328 return (long)((LDKCResult_NoneChannelMonitorUpdateErrZ*)arg)->contents.err;
331 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
332 return ((LDKCResult_NoneMonitorUpdateErrorZ*)arg)->result_ok;
334 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
335 if (((LDKCResult_NoneMonitorUpdateErrorZ*)arg)->result_ok) {
336 return (long)((LDKCResult_NoneMonitorUpdateErrorZ*)arg)->contents.result;
338 return (long)((LDKCResult_NoneMonitorUpdateErrorZ*)arg)->contents.err;
341 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
342 return ((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg)->result_ok;
344 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
345 if (((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg)->result_ok) {
346 return (long)((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg)->contents.result;
348 return (long)((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg)->contents.err;
351 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignatureNoneZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
352 return ((LDKCResult_SignatureNoneZ*)arg)->result_ok;
354 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignatureNoneZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
355 if (((LDKCResult_SignatureNoneZ*)arg)->result_ok) {
356 return (long)((LDKCResult_SignatureNoneZ*)arg)->contents.result;
358 return (long)((LDKCResult_SignatureNoneZ*)arg)->contents.err;
361 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
362 return ((LDKCResult_CVec_SignatureZNoneZ*)arg)->result_ok;
364 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
365 if (((LDKCResult_CVec_SignatureZNoneZ*)arg)->result_ok) {
366 return (long)((LDKCResult_CVec_SignatureZNoneZ*)arg)->contents.result;
368 return (long)((LDKCResult_CVec_SignatureZNoneZ*)arg)->contents.err;
371 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
372 return ((LDKCResult_NoneAPIErrorZ*)arg)->result_ok;
374 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
375 if (((LDKCResult_NoneAPIErrorZ*)arg)->result_ok) {
376 return (long)((LDKCResult_NoneAPIErrorZ*)arg)->contents.result;
378 return (long)((LDKCResult_NoneAPIErrorZ*)arg)->contents.err;
381 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
382 return ((LDKCResult_NonePaymentSendFailureZ*)arg)->result_ok;
384 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
385 if (((LDKCResult_NonePaymentSendFailureZ*)arg)->result_ok) {
386 return (long)((LDKCResult_NonePaymentSendFailureZ*)arg)->contents.result;
388 return (long)((LDKCResult_NonePaymentSendFailureZ*)arg)->contents.err;
391 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
392 return ((LDKCResult_NonePeerHandleErrorZ*)arg)->result_ok;
394 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
395 if (((LDKCResult_NonePeerHandleErrorZ*)arg)->result_ok) {
396 return (long)((LDKCResult_NonePeerHandleErrorZ*)arg)->contents.result;
398 return (long)((LDKCResult_NonePeerHandleErrorZ*)arg)->contents.err;
401 typedef struct LDKMessageSendEventsProvider_JCalls {
402 atomic_size_t refcnt;
405 jmethodID get_and_clear_pending_msg_events_meth;
406 } LDKMessageSendEventsProvider_JCalls;
407 LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_jcall(const void* this_arg) {
408 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
409 LDKCVec_MessageSendEventZ* ret = (LDKCVec_MessageSendEventZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_and_clear_pending_msg_events_meth);
410 LDKCVec_MessageSendEventZ res = *ret;
414 static void LDKMessageSendEventsProvider_JCalls_free(void* this_arg) {
415 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
416 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
417 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
421 static void* LDKMessageSendEventsProvider_JCalls_clone(const void* this_arg) {
422 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
423 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
424 return (void*) this_arg;
426 static inline LDKMessageSendEventsProvider LDKMessageSendEventsProvider_init (JNIEnv * env, jclass _a, jobject o) {
427 jclass c = (*env)->GetObjectClass(env, o);
429 LDKMessageSendEventsProvider_JCalls *calls = MALLOC(sizeof(LDKMessageSendEventsProvider_JCalls), "LDKMessageSendEventsProvider_JCalls");
430 atomic_init(&calls->refcnt, 1);
432 calls->o = (*env)->NewGlobalRef(env, o);
433 calls->get_and_clear_pending_msg_events_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_msg_events", "()J");
434 assert(calls->get_and_clear_pending_msg_events_meth != NULL);
436 LDKMessageSendEventsProvider ret = {
437 .this_arg = (void*) calls,
438 .get_and_clear_pending_msg_events = get_and_clear_pending_msg_events_jcall,
439 .free = LDKMessageSendEventsProvider_JCalls_free,
443 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1new (JNIEnv * env, jclass _a, jobject o) {
444 LDKMessageSendEventsProvider *res_ptr = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
445 *res_ptr = LDKMessageSendEventsProvider_init(env, _a, o);
446 return (long)res_ptr;
448 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
449 return ((LDKMessageSendEventsProvider_JCalls*)val)->o;
451 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1call_1get_1and_1clear_1pending_1msg_1events(JNIEnv * _env, jclass _b, jlong arg) {
452 LDKMessageSendEventsProvider* arg_conv = (LDKMessageSendEventsProvider*)arg;
453 LDKCVec_MessageSendEventZ* ret = MALLOC(sizeof(LDKCVec_MessageSendEventZ), "LDKCVec_MessageSendEventZ");
454 *ret = (arg_conv->get_and_clear_pending_msg_events)(arg_conv->this_arg);
458 typedef struct LDKEventsProvider_JCalls {
459 atomic_size_t refcnt;
462 jmethodID get_and_clear_pending_events_meth;
463 } LDKEventsProvider_JCalls;
464 LDKCVec_EventZ get_and_clear_pending_events_jcall(const void* this_arg) {
465 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
466 LDKCVec_EventZ* ret = (LDKCVec_EventZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_and_clear_pending_events_meth);
467 LDKCVec_EventZ res = *ret;
471 static void LDKEventsProvider_JCalls_free(void* this_arg) {
472 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
473 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
474 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
478 static void* LDKEventsProvider_JCalls_clone(const void* this_arg) {
479 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
480 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
481 return (void*) this_arg;
483 static inline LDKEventsProvider LDKEventsProvider_init (JNIEnv * env, jclass _a, jobject o) {
484 jclass c = (*env)->GetObjectClass(env, o);
486 LDKEventsProvider_JCalls *calls = MALLOC(sizeof(LDKEventsProvider_JCalls), "LDKEventsProvider_JCalls");
487 atomic_init(&calls->refcnt, 1);
489 calls->o = (*env)->NewGlobalRef(env, o);
490 calls->get_and_clear_pending_events_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_events", "()J");
491 assert(calls->get_and_clear_pending_events_meth != NULL);
493 LDKEventsProvider ret = {
494 .this_arg = (void*) calls,
495 .get_and_clear_pending_events = get_and_clear_pending_events_jcall,
496 .free = LDKEventsProvider_JCalls_free,
500 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1new (JNIEnv * env, jclass _a, jobject o) {
501 LDKEventsProvider *res_ptr = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
502 *res_ptr = LDKEventsProvider_init(env, _a, o);
503 return (long)res_ptr;
505 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
506 return ((LDKEventsProvider_JCalls*)val)->o;
508 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1call_1get_1and_1clear_1pending_1events(JNIEnv * _env, jclass _b, jlong arg) {
509 LDKEventsProvider* arg_conv = (LDKEventsProvider*)arg;
510 LDKCVec_EventZ* ret = MALLOC(sizeof(LDKCVec_EventZ), "LDKCVec_EventZ");
511 *ret = (arg_conv->get_and_clear_pending_events)(arg_conv->this_arg);
515 typedef struct LDKLogger_JCalls {
516 atomic_size_t refcnt;
521 void log_jcall(const void* this_arg, const char *record) {
522 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
523 jstring record_conv = (*j_calls->env)->NewStringUTF(j_calls->env, record);
524 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->log_meth, record_conv);
526 static void LDKLogger_JCalls_free(void* this_arg) {
527 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
528 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
529 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
533 static void* LDKLogger_JCalls_clone(const void* this_arg) {
534 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
535 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
536 return (void*) this_arg;
538 static inline LDKLogger LDKLogger_init (JNIEnv * env, jclass _a, jobject o) {
539 jclass c = (*env)->GetObjectClass(env, o);
541 LDKLogger_JCalls *calls = MALLOC(sizeof(LDKLogger_JCalls), "LDKLogger_JCalls");
542 atomic_init(&calls->refcnt, 1);
544 calls->o = (*env)->NewGlobalRef(env, o);
545 calls->log_meth = (*env)->GetMethodID(env, c, "log", "(Ljava/lang/String;)V");
546 assert(calls->log_meth != NULL);
549 .this_arg = (void*) calls,
551 .free = LDKLogger_JCalls_free,
555 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKLogger_1new (JNIEnv * env, jclass _a, jobject o) {
556 LDKLogger *res_ptr = MALLOC(sizeof(LDKLogger), "LDKLogger");
557 *res_ptr = LDKLogger_init(env, _a, o);
558 return (long)res_ptr;
560 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKLogger_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
561 return ((LDKLogger_JCalls*)val)->o;
563 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
564 return ((LDKCResult_TxOutAccessErrorZ*)arg)->result_ok;
566 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
567 if (((LDKCResult_TxOutAccessErrorZ*)arg)->result_ok) {
568 return (long)((LDKCResult_TxOutAccessErrorZ*)arg)->contents.result;
570 return (long)((LDKCResult_TxOutAccessErrorZ*)arg)->contents.err;
573 typedef struct LDKAccess_JCalls {
574 atomic_size_t refcnt;
577 jmethodID get_utxo_meth;
579 LDKCResult_TxOutAccessErrorZ get_utxo_jcall(const void* this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id) {
580 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
581 jbyteArray genesis_hash_arr = (*j_calls->env)->NewByteArray(j_calls->env, 32);
582 (*j_calls->env)->SetByteArrayRegion(j_calls->env, genesis_hash_arr, 0, 32, *genesis_hash);
583 LDKCResult_TxOutAccessErrorZ* ret = (LDKCResult_TxOutAccessErrorZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_utxo_meth, genesis_hash_arr, short_channel_id);
584 LDKCResult_TxOutAccessErrorZ res = *ret;
588 static void LDKAccess_JCalls_free(void* this_arg) {
589 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
590 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
591 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
595 static void* LDKAccess_JCalls_clone(const void* this_arg) {
596 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
597 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
598 return (void*) this_arg;
600 static inline LDKAccess LDKAccess_init (JNIEnv * env, jclass _a, jobject o) {
601 jclass c = (*env)->GetObjectClass(env, o);
603 LDKAccess_JCalls *calls = MALLOC(sizeof(LDKAccess_JCalls), "LDKAccess_JCalls");
604 atomic_init(&calls->refcnt, 1);
606 calls->o = (*env)->NewGlobalRef(env, o);
607 calls->get_utxo_meth = (*env)->GetMethodID(env, c, "get_utxo", "([BJ)J");
608 assert(calls->get_utxo_meth != NULL);
611 .this_arg = (void*) calls,
612 .get_utxo = get_utxo_jcall,
613 .free = LDKAccess_JCalls_free,
617 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKAccess_1new (JNIEnv * env, jclass _a, jobject o) {
618 LDKAccess *res_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess");
619 *res_ptr = LDKAccess_init(env, _a, o);
620 return (long)res_ptr;
622 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAccess_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
623 return ((LDKAccess_JCalls*)val)->o;
625 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKAccess_1call_1get_1utxo(JNIEnv * _env, jclass _b, jlong arg, jbyteArray genesis_hash, jlong short_channel_id) {
626 LDKAccess* arg_conv = (LDKAccess*)arg;
627 unsigned char genesis_hash_arr[32];
628 (*_env)->GetByteArrayRegion (_env, genesis_hash, 0, 32, genesis_hash_arr);
629 unsigned char (*genesis_hash_ref)[32] = &genesis_hash_arr;
630 LDKCResult_TxOutAccessErrorZ* ret = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
631 *ret = (arg_conv->get_utxo)(arg_conv->this_arg, genesis_hash_ref, short_channel_id);
635 typedef struct LDKChannelKeys_JCalls {
636 atomic_size_t refcnt;
639 jmethodID get_per_commitment_point_meth;
640 jmethodID release_commitment_secret_meth;
641 jmethodID key_derivation_params_meth;
642 jmethodID sign_counterparty_commitment_meth;
643 jmethodID sign_holder_commitment_meth;
644 jmethodID sign_holder_commitment_htlc_transactions_meth;
645 jmethodID sign_justice_transaction_meth;
646 jmethodID sign_counterparty_htlc_transaction_meth;
647 jmethodID sign_closing_transaction_meth;
648 jmethodID sign_channel_announcement_meth;
649 jmethodID on_accept_meth;
650 } LDKChannelKeys_JCalls;
651 LDKPublicKey get_per_commitment_point_jcall(const void* this_arg, uint64_t idx) {
652 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
653 LDKPublicKey* ret = (LDKPublicKey*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_per_commitment_point_meth, idx);
654 LDKPublicKey res = *ret;
658 LDKThirtyTwoBytes release_commitment_secret_jcall(const void* this_arg, uint64_t idx) {
659 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
660 LDKThirtyTwoBytes* ret = (LDKThirtyTwoBytes*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->release_commitment_secret_meth, idx);
661 LDKThirtyTwoBytes res = *ret;
665 LDKC2Tuple_u64u64Z key_derivation_params_jcall(const void* this_arg) {
666 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
667 LDKC2Tuple_u64u64Z* ret = (LDKC2Tuple_u64u64Z*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->key_derivation_params_meth);
668 LDKC2Tuple_u64u64Z res = *ret;
672 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_jcall(const void* this_arg, uint32_t feerate_per_kw, LDKTransaction commitment_tx, const LDKPreCalculatedTxCreationKeys *keys, LDKCVec_HTLCOutputInCommitmentZ htlcs) {
673 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
674 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->sign_counterparty_commitment_meth, feerate_per_kw, commitment_tx, keys, htlcs);
675 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ res = *ret;
679 LDKCResult_SignatureNoneZ sign_holder_commitment_jcall(const void* this_arg, const LDKHolderCommitmentTransaction *holder_commitment_tx) {
680 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
681 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->sign_holder_commitment_meth, holder_commitment_tx);
682 LDKCResult_SignatureNoneZ res = *ret;
686 LDKCResult_CVec_SignatureZNoneZ sign_holder_commitment_htlc_transactions_jcall(const void* this_arg, const LDKHolderCommitmentTransaction *holder_commitment_tx) {
687 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
688 LDKCResult_CVec_SignatureZNoneZ* ret = (LDKCResult_CVec_SignatureZNoneZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->sign_holder_commitment_htlc_transactions_meth, holder_commitment_tx);
689 LDKCResult_CVec_SignatureZNoneZ res = *ret;
693 LDKCResult_SignatureNoneZ sign_justice_transaction_jcall(const void* this_arg, LDKTransaction justice_tx, uintptr_t input, uint64_t amount, const uint8_t (*per_commitment_key)[32], const LDKHTLCOutputInCommitment *htlc) {
694 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
695 jbyteArray per_commitment_key_arr = (*j_calls->env)->NewByteArray(j_calls->env, 32);
696 (*j_calls->env)->SetByteArrayRegion(j_calls->env, per_commitment_key_arr, 0, 32, *per_commitment_key);
697 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->sign_justice_transaction_meth, justice_tx, input, amount, per_commitment_key_arr, htlc);
698 LDKCResult_SignatureNoneZ res = *ret;
702 LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_jcall(const void* this_arg, LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, LDKPublicKey per_commitment_point, const LDKHTLCOutputInCommitment *htlc) {
703 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
704 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->sign_counterparty_htlc_transaction_meth, htlc_tx, input, amount, per_commitment_point, htlc);
705 LDKCResult_SignatureNoneZ res = *ret;
709 LDKCResult_SignatureNoneZ sign_closing_transaction_jcall(const void* this_arg, LDKTransaction closing_tx) {
710 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
711 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->sign_closing_transaction_meth, closing_tx);
712 LDKCResult_SignatureNoneZ res = *ret;
716 LDKCResult_SignatureNoneZ sign_channel_announcement_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement *msg) {
717 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
718 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->sign_channel_announcement_meth, msg);
719 LDKCResult_SignatureNoneZ res = *ret;
723 void on_accept_jcall(void* this_arg, const LDKChannelPublicKeys *channel_points, uint16_t counterparty_selected_contest_delay, uint16_t holder_selected_contest_delay) {
724 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
725 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->on_accept_meth, channel_points, counterparty_selected_contest_delay, holder_selected_contest_delay);
727 static void LDKChannelKeys_JCalls_free(void* this_arg) {
728 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
729 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
730 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
734 static void* LDKChannelKeys_JCalls_clone(const void* this_arg) {
735 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
736 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
737 return (void*) this_arg;
739 static inline LDKChannelKeys LDKChannelKeys_init (JNIEnv * env, jclass _a, jobject o) {
740 jclass c = (*env)->GetObjectClass(env, o);
742 LDKChannelKeys_JCalls *calls = MALLOC(sizeof(LDKChannelKeys_JCalls), "LDKChannelKeys_JCalls");
743 atomic_init(&calls->refcnt, 1);
745 calls->o = (*env)->NewGlobalRef(env, o);
746 calls->get_per_commitment_point_meth = (*env)->GetMethodID(env, c, "get_per_commitment_point", "(J)J");
747 assert(calls->get_per_commitment_point_meth != NULL);
748 calls->release_commitment_secret_meth = (*env)->GetMethodID(env, c, "release_commitment_secret", "(J)J");
749 assert(calls->release_commitment_secret_meth != NULL);
750 calls->key_derivation_params_meth = (*env)->GetMethodID(env, c, "key_derivation_params", "()J");
751 assert(calls->key_derivation_params_meth != NULL);
752 calls->sign_counterparty_commitment_meth = (*env)->GetMethodID(env, c, "sign_counterparty_commitment", "(IJJJ)J");
753 assert(calls->sign_counterparty_commitment_meth != NULL);
754 calls->sign_holder_commitment_meth = (*env)->GetMethodID(env, c, "sign_holder_commitment", "(J)J");
755 assert(calls->sign_holder_commitment_meth != NULL);
756 calls->sign_holder_commitment_htlc_transactions_meth = (*env)->GetMethodID(env, c, "sign_holder_commitment_htlc_transactions", "(J)J");
757 assert(calls->sign_holder_commitment_htlc_transactions_meth != NULL);
758 calls->sign_justice_transaction_meth = (*env)->GetMethodID(env, c, "sign_justice_transaction", "(JJJ[BJ)J");
759 assert(calls->sign_justice_transaction_meth != NULL);
760 calls->sign_counterparty_htlc_transaction_meth = (*env)->GetMethodID(env, c, "sign_counterparty_htlc_transaction", "(JJJJJ)J");
761 assert(calls->sign_counterparty_htlc_transaction_meth != NULL);
762 calls->sign_closing_transaction_meth = (*env)->GetMethodID(env, c, "sign_closing_transaction", "(J)J");
763 assert(calls->sign_closing_transaction_meth != NULL);
764 calls->sign_channel_announcement_meth = (*env)->GetMethodID(env, c, "sign_channel_announcement", "(J)J");
765 assert(calls->sign_channel_announcement_meth != NULL);
766 calls->on_accept_meth = (*env)->GetMethodID(env, c, "on_accept", "(JSS)V");
767 assert(calls->on_accept_meth != NULL);
769 LDKChannelKeys ret = {
770 .this_arg = (void*) calls,
771 .get_per_commitment_point = get_per_commitment_point_jcall,
772 .release_commitment_secret = release_commitment_secret_jcall,
773 .key_derivation_params = key_derivation_params_jcall,
774 .sign_counterparty_commitment = sign_counterparty_commitment_jcall,
775 .sign_holder_commitment = sign_holder_commitment_jcall,
776 .sign_holder_commitment_htlc_transactions = sign_holder_commitment_htlc_transactions_jcall,
777 .sign_justice_transaction = sign_justice_transaction_jcall,
778 .sign_counterparty_htlc_transaction = sign_counterparty_htlc_transaction_jcall,
779 .sign_closing_transaction = sign_closing_transaction_jcall,
780 .sign_channel_announcement = sign_channel_announcement_jcall,
781 .on_accept = on_accept_jcall,
782 .clone = LDKChannelKeys_JCalls_clone,
783 .free = LDKChannelKeys_JCalls_free,
787 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1new (JNIEnv * env, jclass _a, jobject o) {
788 LDKChannelKeys *res_ptr = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys");
789 *res_ptr = LDKChannelKeys_init(env, _a, o);
790 return (long)res_ptr;
792 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
793 return ((LDKChannelKeys_JCalls*)val)->o;
795 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1call_1get_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong arg, jlong idx) {
796 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
797 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
798 *ret = (arg_conv->get_per_commitment_point)(arg_conv->this_arg, idx);
802 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1call_1release_1commitment_1secret(JNIEnv * _env, jclass _b, jlong arg, jlong idx) {
803 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
804 LDKThirtyTwoBytes* ret = MALLOC(sizeof(LDKThirtyTwoBytes), "LDKThirtyTwoBytes");
805 *ret = (arg_conv->release_commitment_secret)(arg_conv->this_arg, idx);
809 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1call_1key_1derivation_1params(JNIEnv * _env, jclass _b, jlong arg) {
810 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
811 LDKC2Tuple_u64u64Z* ret = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
812 *ret = (arg_conv->key_derivation_params)(arg_conv->this_arg);
816 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1call_1sign_1counterparty_1commitment(JNIEnv * _env, jclass _b, jlong arg, jint feerate_per_kw, jlong commitment_tx, jlong keys, jlong htlcs) {
817 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
818 LDKTransaction commitment_tx_conv = *(LDKTransaction*)commitment_tx;
819 FREE((void*)commitment_tx);
820 LDKPreCalculatedTxCreationKeys* keys_conv = (LDKPreCalculatedTxCreationKeys*)keys;
821 LDKCVec_HTLCOutputInCommitmentZ htlcs_conv = *(LDKCVec_HTLCOutputInCommitmentZ*)htlcs;
823 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
824 *ret = (arg_conv->sign_counterparty_commitment)(arg_conv->this_arg, feerate_per_kw, commitment_tx_conv, keys_conv, htlcs_conv);
828 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1call_1sign_1holder_1commitment(JNIEnv * _env, jclass _b, jlong arg, jlong holder_commitment_tx) {
829 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
830 LDKHolderCommitmentTransaction* holder_commitment_tx_conv = (LDKHolderCommitmentTransaction*)holder_commitment_tx;
831 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
832 *ret = (arg_conv->sign_holder_commitment)(arg_conv->this_arg, holder_commitment_tx_conv);
836 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1call_1sign_1holder_1commitment_1htlc_1transactions(JNIEnv * _env, jclass _b, jlong arg, jlong holder_commitment_tx) {
837 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
838 LDKHolderCommitmentTransaction* holder_commitment_tx_conv = (LDKHolderCommitmentTransaction*)holder_commitment_tx;
839 LDKCResult_CVec_SignatureZNoneZ* ret = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
840 *ret = (arg_conv->sign_holder_commitment_htlc_transactions)(arg_conv->this_arg, holder_commitment_tx_conv);
844 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1call_1sign_1justice_1transaction(JNIEnv * _env, jclass _b, jlong arg, jlong justice_tx, jlong input, jlong amount, jbyteArray per_commitment_key, jlong htlc) {
845 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
846 LDKTransaction justice_tx_conv = *(LDKTransaction*)justice_tx;
847 FREE((void*)justice_tx);
848 unsigned char per_commitment_key_arr[32];
849 (*_env)->GetByteArrayRegion (_env, per_commitment_key, 0, 32, per_commitment_key_arr);
850 unsigned char (*per_commitment_key_ref)[32] = &per_commitment_key_arr;
851 LDKHTLCOutputInCommitment* htlc_conv = (LDKHTLCOutputInCommitment*)htlc;
852 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
853 *ret = (arg_conv->sign_justice_transaction)(arg_conv->this_arg, justice_tx_conv, input, amount, per_commitment_key_ref, htlc_conv);
857 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1call_1sign_1counterparty_1htlc_1transaction(JNIEnv * _env, jclass _b, jlong arg, jlong htlc_tx, jlong input, jlong amount, jlong per_commitment_point, jlong htlc) {
858 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
859 LDKTransaction htlc_tx_conv = *(LDKTransaction*)htlc_tx;
860 FREE((void*)htlc_tx);
861 LDKPublicKey per_commitment_point_conv = *(LDKPublicKey*)per_commitment_point;
862 FREE((void*)per_commitment_point);
863 LDKHTLCOutputInCommitment* htlc_conv = (LDKHTLCOutputInCommitment*)htlc;
864 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
865 *ret = (arg_conv->sign_counterparty_htlc_transaction)(arg_conv->this_arg, htlc_tx_conv, input, amount, per_commitment_point_conv, htlc_conv);
869 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1call_1sign_1closing_1transaction(JNIEnv * _env, jclass _b, jlong arg, jlong closing_tx) {
870 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
871 LDKTransaction closing_tx_conv = *(LDKTransaction*)closing_tx;
872 FREE((void*)closing_tx);
873 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
874 *ret = (arg_conv->sign_closing_transaction)(arg_conv->this_arg, closing_tx_conv);
878 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1call_1sign_1channel_1announcement(JNIEnv * _env, jclass _b, jlong arg, jlong msg) {
879 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
880 LDKUnsignedChannelAnnouncement* msg_conv = (LDKUnsignedChannelAnnouncement*)msg;
881 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
882 *ret = (arg_conv->sign_channel_announcement)(arg_conv->this_arg, msg_conv);
886 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1call_1on_1accept(JNIEnv * _env, jclass _b, jlong arg, jlong channel_points, jshort counterparty_selected_contest_delay, jshort holder_selected_contest_delay) {
887 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
888 LDKChannelPublicKeys* channel_points_conv = (LDKChannelPublicKeys*)channel_points;
889 return (arg_conv->on_accept)(arg_conv->this_arg, channel_points_conv, counterparty_selected_contest_delay, holder_selected_contest_delay);
892 typedef struct LDKWatch_JCalls {
893 atomic_size_t refcnt;
896 jmethodID watch_channel_meth;
897 jmethodID update_channel_meth;
898 jmethodID release_pending_monitor_events_meth;
900 LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) {
901 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
902 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->watch_channel_meth, funding_txo, monitor);
903 LDKCResult_NoneChannelMonitorUpdateErrZ res = *ret;
907 LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate update) {
908 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
909 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->update_channel_meth, funding_txo, update);
910 LDKCResult_NoneChannelMonitorUpdateErrZ res = *ret;
914 LDKCVec_MonitorEventZ release_pending_monitor_events_jcall(const void* this_arg) {
915 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
916 LDKCVec_MonitorEventZ* ret = (LDKCVec_MonitorEventZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->release_pending_monitor_events_meth);
917 LDKCVec_MonitorEventZ res = *ret;
921 static void LDKWatch_JCalls_free(void* this_arg) {
922 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
923 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
924 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
928 static void* LDKWatch_JCalls_clone(const void* this_arg) {
929 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
930 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
931 return (void*) this_arg;
933 static inline LDKWatch LDKWatch_init (JNIEnv * env, jclass _a, jobject o) {
934 jclass c = (*env)->GetObjectClass(env, o);
936 LDKWatch_JCalls *calls = MALLOC(sizeof(LDKWatch_JCalls), "LDKWatch_JCalls");
937 atomic_init(&calls->refcnt, 1);
939 calls->o = (*env)->NewGlobalRef(env, o);
940 calls->watch_channel_meth = (*env)->GetMethodID(env, c, "watch_channel", "(JJ)J");
941 assert(calls->watch_channel_meth != NULL);
942 calls->update_channel_meth = (*env)->GetMethodID(env, c, "update_channel", "(JJ)J");
943 assert(calls->update_channel_meth != NULL);
944 calls->release_pending_monitor_events_meth = (*env)->GetMethodID(env, c, "release_pending_monitor_events", "()J");
945 assert(calls->release_pending_monitor_events_meth != NULL);
948 .this_arg = (void*) calls,
949 .watch_channel = watch_channel_jcall,
950 .update_channel = update_channel_jcall,
951 .release_pending_monitor_events = release_pending_monitor_events_jcall,
952 .free = LDKWatch_JCalls_free,
956 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKWatch_1new (JNIEnv * env, jclass _a, jobject o) {
957 LDKWatch *res_ptr = MALLOC(sizeof(LDKWatch), "LDKWatch");
958 *res_ptr = LDKWatch_init(env, _a, o);
959 return (long)res_ptr;
961 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKWatch_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
962 return ((LDKWatch_JCalls*)val)->o;
964 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKWatch_1call_1watch_1channel(JNIEnv * _env, jclass _b, jlong arg, jlong funding_txo, jlong monitor) {
965 LDKWatch* arg_conv = (LDKWatch*)arg;
966 LDKOutPoint funding_txo_conv = *(LDKOutPoint*)funding_txo;
967 FREE((void*)funding_txo);
968 funding_txo_conv.is_owned = true;
969 LDKChannelMonitor monitor_conv = *(LDKChannelMonitor*)monitor;
970 FREE((void*)monitor);
971 monitor_conv.is_owned = true;
972 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
973 *ret = (arg_conv->watch_channel)(arg_conv->this_arg, funding_txo_conv, monitor_conv);
977 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKWatch_1call_1update_1channel(JNIEnv * _env, jclass _b, jlong arg, jlong funding_txo, jlong update) {
978 LDKWatch* arg_conv = (LDKWatch*)arg;
979 LDKOutPoint funding_txo_conv = *(LDKOutPoint*)funding_txo;
980 FREE((void*)funding_txo);
981 funding_txo_conv.is_owned = true;
982 LDKChannelMonitorUpdate update_conv = *(LDKChannelMonitorUpdate*)update;
984 update_conv.is_owned = true;
985 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
986 *ret = (arg_conv->update_channel)(arg_conv->this_arg, funding_txo_conv, update_conv);
990 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKWatch_1call_1release_1pending_1monitor_1events(JNIEnv * _env, jclass _b, jlong arg) {
991 LDKWatch* arg_conv = (LDKWatch*)arg;
992 LDKCVec_MonitorEventZ* ret = MALLOC(sizeof(LDKCVec_MonitorEventZ), "LDKCVec_MonitorEventZ");
993 *ret = (arg_conv->release_pending_monitor_events)(arg_conv->this_arg);
997 typedef struct LDKFilter_JCalls {
998 atomic_size_t refcnt;
1001 jmethodID register_tx_meth;
1002 jmethodID register_output_meth;
1004 void register_tx_jcall(const void* this_arg, const uint8_t (*txid)[32], LDKu8slice script_pubkey) {
1005 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
1006 jbyteArray txid_arr = (*j_calls->env)->NewByteArray(j_calls->env, 32);
1007 (*j_calls->env)->SetByteArrayRegion(j_calls->env, txid_arr, 0, 32, *txid);
1008 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->register_tx_meth, txid_arr, script_pubkey);
1010 void register_output_jcall(const void* this_arg, const LDKOutPoint *outpoint, LDKu8slice script_pubkey) {
1011 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
1012 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->register_output_meth, outpoint, script_pubkey);
1014 static void LDKFilter_JCalls_free(void* this_arg) {
1015 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
1016 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1017 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
1021 static void* LDKFilter_JCalls_clone(const void* this_arg) {
1022 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
1023 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1024 return (void*) this_arg;
1026 static inline LDKFilter LDKFilter_init (JNIEnv * env, jclass _a, jobject o) {
1027 jclass c = (*env)->GetObjectClass(env, o);
1029 LDKFilter_JCalls *calls = MALLOC(sizeof(LDKFilter_JCalls), "LDKFilter_JCalls");
1030 atomic_init(&calls->refcnt, 1);
1032 calls->o = (*env)->NewGlobalRef(env, o);
1033 calls->register_tx_meth = (*env)->GetMethodID(env, c, "register_tx", "([BJ)V");
1034 assert(calls->register_tx_meth != NULL);
1035 calls->register_output_meth = (*env)->GetMethodID(env, c, "register_output", "(JJ)V");
1036 assert(calls->register_output_meth != NULL);
1039 .this_arg = (void*) calls,
1040 .register_tx = register_tx_jcall,
1041 .register_output = register_output_jcall,
1042 .free = LDKFilter_JCalls_free,
1046 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKFilter_1new (JNIEnv * env, jclass _a, jobject o) {
1047 LDKFilter *res_ptr = MALLOC(sizeof(LDKFilter), "LDKFilter");
1048 *res_ptr = LDKFilter_init(env, _a, o);
1049 return (long)res_ptr;
1051 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFilter_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
1052 return ((LDKFilter_JCalls*)val)->o;
1054 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKFilter_1call_1register_1tx(JNIEnv * _env, jclass _b, jlong arg, jbyteArray txid, jlong script_pubkey) {
1055 LDKFilter* arg_conv = (LDKFilter*)arg;
1056 unsigned char txid_arr[32];
1057 (*_env)->GetByteArrayRegion (_env, txid, 0, 32, txid_arr);
1058 unsigned char (*txid_ref)[32] = &txid_arr;
1059 LDKu8slice script_pubkey_conv = *(LDKu8slice*)script_pubkey;
1060 FREE((void*)script_pubkey);
1061 return (arg_conv->register_tx)(arg_conv->this_arg, txid_ref, script_pubkey_conv);
1064 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKFilter_1call_1register_1output(JNIEnv * _env, jclass _b, jlong arg, jlong outpoint, jlong script_pubkey) {
1065 LDKFilter* arg_conv = (LDKFilter*)arg;
1066 LDKOutPoint* outpoint_conv = (LDKOutPoint*)outpoint;
1067 LDKu8slice script_pubkey_conv = *(LDKu8slice*)script_pubkey;
1068 FREE((void*)script_pubkey);
1069 return (arg_conv->register_output)(arg_conv->this_arg, outpoint_conv, script_pubkey_conv);
1072 typedef struct LDKBroadcasterInterface_JCalls {
1073 atomic_size_t refcnt;
1076 jmethodID broadcast_transaction_meth;
1077 } LDKBroadcasterInterface_JCalls;
1078 void broadcast_transaction_jcall(const void* this_arg, LDKTransaction tx) {
1079 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
1080 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->broadcast_transaction_meth, tx);
1082 static void LDKBroadcasterInterface_JCalls_free(void* this_arg) {
1083 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
1084 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1085 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
1089 static void* LDKBroadcasterInterface_JCalls_clone(const void* this_arg) {
1090 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
1091 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1092 return (void*) this_arg;
1094 static inline LDKBroadcasterInterface LDKBroadcasterInterface_init (JNIEnv * env, jclass _a, jobject o) {
1095 jclass c = (*env)->GetObjectClass(env, o);
1097 LDKBroadcasterInterface_JCalls *calls = MALLOC(sizeof(LDKBroadcasterInterface_JCalls), "LDKBroadcasterInterface_JCalls");
1098 atomic_init(&calls->refcnt, 1);
1100 calls->o = (*env)->NewGlobalRef(env, o);
1101 calls->broadcast_transaction_meth = (*env)->GetMethodID(env, c, "broadcast_transaction", "(J)V");
1102 assert(calls->broadcast_transaction_meth != NULL);
1104 LDKBroadcasterInterface ret = {
1105 .this_arg = (void*) calls,
1106 .broadcast_transaction = broadcast_transaction_jcall,
1107 .free = LDKBroadcasterInterface_JCalls_free,
1111 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1new (JNIEnv * env, jclass _a, jobject o) {
1112 LDKBroadcasterInterface *res_ptr = MALLOC(sizeof(LDKBroadcasterInterface), "LDKBroadcasterInterface");
1113 *res_ptr = LDKBroadcasterInterface_init(env, _a, o);
1114 return (long)res_ptr;
1116 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
1117 return ((LDKBroadcasterInterface_JCalls*)val)->o;
1119 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1call_1broadcast_1transaction(JNIEnv * _env, jclass _b, jlong arg, jlong tx) {
1120 LDKBroadcasterInterface* arg_conv = (LDKBroadcasterInterface*)arg;
1121 LDKTransaction tx_conv = *(LDKTransaction*)tx;
1123 return (arg_conv->broadcast_transaction)(arg_conv->this_arg, tx_conv);
1126 typedef struct LDKFeeEstimator_JCalls {
1127 atomic_size_t refcnt;
1130 jmethodID get_est_sat_per_1000_weight_meth;
1131 } LDKFeeEstimator_JCalls;
1132 uint32_t get_est_sat_per_1000_weight_jcall(const void* this_arg, LDKConfirmationTarget confirmation_target) {
1133 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
1134 jclass confirmation_target_conv = LDKConfirmationTarget_to_java(j_calls->env, confirmation_target);
1135 return (*j_calls->env)->CallIntMethod(j_calls->env, j_calls->o, j_calls->get_est_sat_per_1000_weight_meth, confirmation_target_conv);
1137 static void LDKFeeEstimator_JCalls_free(void* this_arg) {
1138 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
1139 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1140 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
1144 static void* LDKFeeEstimator_JCalls_clone(const void* this_arg) {
1145 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
1146 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1147 return (void*) this_arg;
1149 static inline LDKFeeEstimator LDKFeeEstimator_init (JNIEnv * env, jclass _a, jobject o) {
1150 jclass c = (*env)->GetObjectClass(env, o);
1152 LDKFeeEstimator_JCalls *calls = MALLOC(sizeof(LDKFeeEstimator_JCalls), "LDKFeeEstimator_JCalls");
1153 atomic_init(&calls->refcnt, 1);
1155 calls->o = (*env)->NewGlobalRef(env, o);
1156 calls->get_est_sat_per_1000_weight_meth = (*env)->GetMethodID(env, c, "get_est_sat_per_1000_weight", "(Lorg/ldk/impl/bindings$LDKConfirmationTarget;)I");
1157 assert(calls->get_est_sat_per_1000_weight_meth != NULL);
1159 LDKFeeEstimator ret = {
1160 .this_arg = (void*) calls,
1161 .get_est_sat_per_1000_weight = get_est_sat_per_1000_weight_jcall,
1162 .free = LDKFeeEstimator_JCalls_free,
1166 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1new (JNIEnv * env, jclass _a, jobject o) {
1167 LDKFeeEstimator *res_ptr = MALLOC(sizeof(LDKFeeEstimator), "LDKFeeEstimator");
1168 *res_ptr = LDKFeeEstimator_init(env, _a, o);
1169 return (long)res_ptr;
1171 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
1172 return ((LDKFeeEstimator_JCalls*)val)->o;
1174 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1call_1get_1est_1sat_1per_11000_1weight(JNIEnv * _env, jclass _b, jlong arg, jclass confirmation_target) {
1175 LDKFeeEstimator* arg_conv = (LDKFeeEstimator*)arg;
1176 LDKConfirmationTarget confirmation_target_conv = LDKConfirmationTarget_from_java(_env, confirmation_target);
1177 return (arg_conv->get_est_sat_per_1000_weight)(arg_conv->this_arg, confirmation_target_conv);
1180 typedef struct LDKKeysInterface_JCalls {
1181 atomic_size_t refcnt;
1184 jmethodID get_node_secret_meth;
1185 jmethodID get_destination_script_meth;
1186 jmethodID get_shutdown_pubkey_meth;
1187 jmethodID get_channel_keys_meth;
1188 jmethodID get_secure_random_bytes_meth;
1189 } LDKKeysInterface_JCalls;
1190 LDKSecretKey get_node_secret_jcall(const void* this_arg) {
1191 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
1192 LDKSecretKey* ret = (LDKSecretKey*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_node_secret_meth);
1193 LDKSecretKey res = *ret;
1197 LDKCVec_u8Z get_destination_script_jcall(const void* this_arg) {
1198 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
1199 LDKCVec_u8Z* ret = (LDKCVec_u8Z*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_destination_script_meth);
1200 LDKCVec_u8Z res = *ret;
1204 LDKPublicKey get_shutdown_pubkey_jcall(const void* this_arg) {
1205 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
1206 LDKPublicKey* ret = (LDKPublicKey*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_shutdown_pubkey_meth);
1207 LDKPublicKey res = *ret;
1211 LDKChannelKeys get_channel_keys_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) {
1212 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
1213 LDKChannelKeys* ret = (LDKChannelKeys*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_channel_keys_meth, inbound, channel_value_satoshis);
1214 LDKChannelKeys res = *ret;
1218 LDKThirtyTwoBytes get_secure_random_bytes_jcall(const void* this_arg) {
1219 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
1220 LDKThirtyTwoBytes* ret = (LDKThirtyTwoBytes*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_secure_random_bytes_meth);
1221 LDKThirtyTwoBytes res = *ret;
1225 static void LDKKeysInterface_JCalls_free(void* this_arg) {
1226 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
1227 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1228 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
1232 static void* LDKKeysInterface_JCalls_clone(const void* this_arg) {
1233 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
1234 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1235 return (void*) this_arg;
1237 static inline LDKKeysInterface LDKKeysInterface_init (JNIEnv * env, jclass _a, jobject o) {
1238 jclass c = (*env)->GetObjectClass(env, o);
1240 LDKKeysInterface_JCalls *calls = MALLOC(sizeof(LDKKeysInterface_JCalls), "LDKKeysInterface_JCalls");
1241 atomic_init(&calls->refcnt, 1);
1243 calls->o = (*env)->NewGlobalRef(env, o);
1244 calls->get_node_secret_meth = (*env)->GetMethodID(env, c, "get_node_secret", "()J");
1245 assert(calls->get_node_secret_meth != NULL);
1246 calls->get_destination_script_meth = (*env)->GetMethodID(env, c, "get_destination_script", "()J");
1247 assert(calls->get_destination_script_meth != NULL);
1248 calls->get_shutdown_pubkey_meth = (*env)->GetMethodID(env, c, "get_shutdown_pubkey", "()J");
1249 assert(calls->get_shutdown_pubkey_meth != NULL);
1250 calls->get_channel_keys_meth = (*env)->GetMethodID(env, c, "get_channel_keys", "(ZJ)J");
1251 assert(calls->get_channel_keys_meth != NULL);
1252 calls->get_secure_random_bytes_meth = (*env)->GetMethodID(env, c, "get_secure_random_bytes", "()J");
1253 assert(calls->get_secure_random_bytes_meth != NULL);
1255 LDKKeysInterface ret = {
1256 .this_arg = (void*) calls,
1257 .get_node_secret = get_node_secret_jcall,
1258 .get_destination_script = get_destination_script_jcall,
1259 .get_shutdown_pubkey = get_shutdown_pubkey_jcall,
1260 .get_channel_keys = get_channel_keys_jcall,
1261 .get_secure_random_bytes = get_secure_random_bytes_jcall,
1262 .free = LDKKeysInterface_JCalls_free,
1266 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1new (JNIEnv * env, jclass _a, jobject o) {
1267 LDKKeysInterface *res_ptr = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
1268 *res_ptr = LDKKeysInterface_init(env, _a, o);
1269 return (long)res_ptr;
1271 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
1272 return ((LDKKeysInterface_JCalls*)val)->o;
1274 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1call_1get_1node_1secret(JNIEnv * _env, jclass _b, jlong arg) {
1275 LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg;
1276 LDKSecretKey* ret = MALLOC(sizeof(LDKSecretKey), "LDKSecretKey");
1277 *ret = (arg_conv->get_node_secret)(arg_conv->this_arg);
1281 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1call_1get_1destination_1script(JNIEnv * _env, jclass _b, jlong arg) {
1282 LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg;
1283 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
1284 *ret = (arg_conv->get_destination_script)(arg_conv->this_arg);
1288 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1call_1get_1shutdown_1pubkey(JNIEnv * _env, jclass _b, jlong arg) {
1289 LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg;
1290 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
1291 *ret = (arg_conv->get_shutdown_pubkey)(arg_conv->this_arg);
1295 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1call_1get_1channel_1keys(JNIEnv * _env, jclass _b, jlong arg, jboolean inbound, jlong channel_value_satoshis) {
1296 LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg;
1297 LDKChannelKeys* ret = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys");
1298 *ret = (arg_conv->get_channel_keys)(arg_conv->this_arg, inbound, channel_value_satoshis);
1302 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1call_1get_1secure_1random_1bytes(JNIEnv * _env, jclass _b, jlong arg) {
1303 LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg;
1304 LDKThirtyTwoBytes* ret = MALLOC(sizeof(LDKThirtyTwoBytes), "LDKThirtyTwoBytes");
1305 *ret = (arg_conv->get_secure_random_bytes)(arg_conv->this_arg);
1309 typedef struct LDKChannelMessageHandler_JCalls {
1310 atomic_size_t refcnt;
1313 LDKMessageSendEventsProvider_JCalls* MessageSendEventsProvider;
1314 jmethodID handle_open_channel_meth;
1315 jmethodID handle_accept_channel_meth;
1316 jmethodID handle_funding_created_meth;
1317 jmethodID handle_funding_signed_meth;
1318 jmethodID handle_funding_locked_meth;
1319 jmethodID handle_shutdown_meth;
1320 jmethodID handle_closing_signed_meth;
1321 jmethodID handle_update_add_htlc_meth;
1322 jmethodID handle_update_fulfill_htlc_meth;
1323 jmethodID handle_update_fail_htlc_meth;
1324 jmethodID handle_update_fail_malformed_htlc_meth;
1325 jmethodID handle_commitment_signed_meth;
1326 jmethodID handle_revoke_and_ack_meth;
1327 jmethodID handle_update_fee_meth;
1328 jmethodID handle_announcement_signatures_meth;
1329 jmethodID peer_disconnected_meth;
1330 jmethodID peer_connected_meth;
1331 jmethodID handle_channel_reestablish_meth;
1332 jmethodID handle_error_meth;
1333 } LDKChannelMessageHandler_JCalls;
1334 void handle_open_channel_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKOpenChannel *msg) {
1335 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1336 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_open_channel_meth, their_node_id, their_features, msg);
1338 void handle_accept_channel_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKAcceptChannel *msg) {
1339 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1340 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_accept_channel_meth, their_node_id, their_features, msg);
1342 void handle_funding_created_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated *msg) {
1343 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1344 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_funding_created_meth, their_node_id, msg);
1346 void handle_funding_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned *msg) {
1347 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1348 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_funding_signed_meth, their_node_id, msg);
1350 void handle_funding_locked_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingLocked *msg) {
1351 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1352 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_funding_locked_meth, their_node_id, msg);
1354 void handle_shutdown_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKShutdown *msg) {
1355 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1356 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_shutdown_meth, their_node_id, msg);
1358 void handle_closing_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned *msg) {
1359 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1360 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_closing_signed_meth, their_node_id, msg);
1362 void handle_update_add_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC *msg) {
1363 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1364 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_update_add_htlc_meth, their_node_id, msg);
1366 void handle_update_fulfill_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC *msg) {
1367 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1368 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_update_fulfill_htlc_meth, their_node_id, msg);
1370 void handle_update_fail_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC *msg) {
1371 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1372 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_update_fail_htlc_meth, their_node_id, msg);
1374 void handle_update_fail_malformed_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC *msg) {
1375 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1376 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_update_fail_malformed_htlc_meth, their_node_id, msg);
1378 void handle_commitment_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned *msg) {
1379 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1380 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_commitment_signed_meth, their_node_id, msg);
1382 void handle_revoke_and_ack_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK *msg) {
1383 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1384 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_revoke_and_ack_meth, their_node_id, msg);
1386 void handle_update_fee_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee *msg) {
1387 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1388 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_update_fee_meth, their_node_id, msg);
1390 void handle_announcement_signatures_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures *msg) {
1391 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1392 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_announcement_signatures_meth, their_node_id, msg);
1394 void peer_disconnected_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) {
1395 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1396 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->peer_disconnected_meth, their_node_id, no_connection_possible);
1398 void peer_connected_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit *msg) {
1399 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1400 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->peer_connected_meth, their_node_id, msg);
1402 void handle_channel_reestablish_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReestablish *msg) {
1403 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1404 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_channel_reestablish_meth, their_node_id, msg);
1406 void handle_error_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage *msg) {
1407 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1408 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_error_meth, their_node_id, msg);
1410 static void LDKChannelMessageHandler_JCalls_free(void* this_arg) {
1411 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1412 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1413 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
1417 static void* LDKChannelMessageHandler_JCalls_clone(const void* this_arg) {
1418 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1419 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1420 atomic_fetch_add_explicit(&j_calls->MessageSendEventsProvider->refcnt, 1, memory_order_release);
1421 return (void*) this_arg;
1423 static inline LDKChannelMessageHandler LDKChannelMessageHandler_init (JNIEnv * env, jclass _a, jobject o, jobject MessageSendEventsProvider) {
1424 jclass c = (*env)->GetObjectClass(env, o);
1426 LDKChannelMessageHandler_JCalls *calls = MALLOC(sizeof(LDKChannelMessageHandler_JCalls), "LDKChannelMessageHandler_JCalls");
1427 atomic_init(&calls->refcnt, 1);
1429 calls->o = (*env)->NewGlobalRef(env, o);
1430 calls->handle_open_channel_meth = (*env)->GetMethodID(env, c, "handle_open_channel", "(JJJ)V");
1431 assert(calls->handle_open_channel_meth != NULL);
1432 calls->handle_accept_channel_meth = (*env)->GetMethodID(env, c, "handle_accept_channel", "(JJJ)V");
1433 assert(calls->handle_accept_channel_meth != NULL);
1434 calls->handle_funding_created_meth = (*env)->GetMethodID(env, c, "handle_funding_created", "(JJ)V");
1435 assert(calls->handle_funding_created_meth != NULL);
1436 calls->handle_funding_signed_meth = (*env)->GetMethodID(env, c, "handle_funding_signed", "(JJ)V");
1437 assert(calls->handle_funding_signed_meth != NULL);
1438 calls->handle_funding_locked_meth = (*env)->GetMethodID(env, c, "handle_funding_locked", "(JJ)V");
1439 assert(calls->handle_funding_locked_meth != NULL);
1440 calls->handle_shutdown_meth = (*env)->GetMethodID(env, c, "handle_shutdown", "(JJ)V");
1441 assert(calls->handle_shutdown_meth != NULL);
1442 calls->handle_closing_signed_meth = (*env)->GetMethodID(env, c, "handle_closing_signed", "(JJ)V");
1443 assert(calls->handle_closing_signed_meth != NULL);
1444 calls->handle_update_add_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_add_htlc", "(JJ)V");
1445 assert(calls->handle_update_add_htlc_meth != NULL);
1446 calls->handle_update_fulfill_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fulfill_htlc", "(JJ)V");
1447 assert(calls->handle_update_fulfill_htlc_meth != NULL);
1448 calls->handle_update_fail_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fail_htlc", "(JJ)V");
1449 assert(calls->handle_update_fail_htlc_meth != NULL);
1450 calls->handle_update_fail_malformed_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fail_malformed_htlc", "(JJ)V");
1451 assert(calls->handle_update_fail_malformed_htlc_meth != NULL);
1452 calls->handle_commitment_signed_meth = (*env)->GetMethodID(env, c, "handle_commitment_signed", "(JJ)V");
1453 assert(calls->handle_commitment_signed_meth != NULL);
1454 calls->handle_revoke_and_ack_meth = (*env)->GetMethodID(env, c, "handle_revoke_and_ack", "(JJ)V");
1455 assert(calls->handle_revoke_and_ack_meth != NULL);
1456 calls->handle_update_fee_meth = (*env)->GetMethodID(env, c, "handle_update_fee", "(JJ)V");
1457 assert(calls->handle_update_fee_meth != NULL);
1458 calls->handle_announcement_signatures_meth = (*env)->GetMethodID(env, c, "handle_announcement_signatures", "(JJ)V");
1459 assert(calls->handle_announcement_signatures_meth != NULL);
1460 calls->peer_disconnected_meth = (*env)->GetMethodID(env, c, "peer_disconnected", "(JZ)V");
1461 assert(calls->peer_disconnected_meth != NULL);
1462 calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "(JJ)V");
1463 assert(calls->peer_connected_meth != NULL);
1464 calls->handle_channel_reestablish_meth = (*env)->GetMethodID(env, c, "handle_channel_reestablish", "(JJ)V");
1465 assert(calls->handle_channel_reestablish_meth != NULL);
1466 calls->handle_error_meth = (*env)->GetMethodID(env, c, "handle_error", "(JJ)V");
1467 assert(calls->handle_error_meth != NULL);
1469 LDKChannelMessageHandler ret = {
1470 .this_arg = (void*) calls,
1471 .handle_open_channel = handle_open_channel_jcall,
1472 .handle_accept_channel = handle_accept_channel_jcall,
1473 .handle_funding_created = handle_funding_created_jcall,
1474 .handle_funding_signed = handle_funding_signed_jcall,
1475 .handle_funding_locked = handle_funding_locked_jcall,
1476 .handle_shutdown = handle_shutdown_jcall,
1477 .handle_closing_signed = handle_closing_signed_jcall,
1478 .handle_update_add_htlc = handle_update_add_htlc_jcall,
1479 .handle_update_fulfill_htlc = handle_update_fulfill_htlc_jcall,
1480 .handle_update_fail_htlc = handle_update_fail_htlc_jcall,
1481 .handle_update_fail_malformed_htlc = handle_update_fail_malformed_htlc_jcall,
1482 .handle_commitment_signed = handle_commitment_signed_jcall,
1483 .handle_revoke_and_ack = handle_revoke_and_ack_jcall,
1484 .handle_update_fee = handle_update_fee_jcall,
1485 .handle_announcement_signatures = handle_announcement_signatures_jcall,
1486 .peer_disconnected = peer_disconnected_jcall,
1487 .peer_connected = peer_connected_jcall,
1488 .handle_channel_reestablish = handle_channel_reestablish_jcall,
1489 .handle_error = handle_error_jcall,
1490 .free = LDKChannelMessageHandler_JCalls_free,
1491 .MessageSendEventsProvider = LDKMessageSendEventsProvider_init(env, _a, MessageSendEventsProvider),
1493 calls->MessageSendEventsProvider = ret.MessageSendEventsProvider.this_arg;
1496 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1new (JNIEnv * env, jclass _a, jobject o, jobject MessageSendEventsProvider) {
1497 LDKChannelMessageHandler *res_ptr = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
1498 *res_ptr = LDKChannelMessageHandler_init(env, _a, o, MessageSendEventsProvider);
1499 return (long)res_ptr;
1501 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
1502 return ((LDKChannelMessageHandler_JCalls*)val)->o;
1504 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1open_1channel(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong their_features, jlong msg) {
1505 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
1506 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
1507 FREE((void*)their_node_id);
1508 LDKInitFeatures their_features_conv = *(LDKInitFeatures*)their_features;
1509 FREE((void*)their_features);
1510 their_features_conv.is_owned = true;
1511 LDKOpenChannel* msg_conv = (LDKOpenChannel*)msg;
1512 return (arg_conv->handle_open_channel)(arg_conv->this_arg, their_node_id_conv, their_features_conv, msg_conv);
1515 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1accept_1channel(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong their_features, jlong msg) {
1516 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
1517 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
1518 FREE((void*)their_node_id);
1519 LDKInitFeatures their_features_conv = *(LDKInitFeatures*)their_features;
1520 FREE((void*)their_features);
1521 their_features_conv.is_owned = true;
1522 LDKAcceptChannel* msg_conv = (LDKAcceptChannel*)msg;
1523 return (arg_conv->handle_accept_channel)(arg_conv->this_arg, their_node_id_conv, their_features_conv, msg_conv);
1526 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1funding_1created(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
1527 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
1528 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
1529 FREE((void*)their_node_id);
1530 LDKFundingCreated* msg_conv = (LDKFundingCreated*)msg;
1531 return (arg_conv->handle_funding_created)(arg_conv->this_arg, their_node_id_conv, msg_conv);
1534 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1funding_1signed(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
1535 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
1536 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
1537 FREE((void*)their_node_id);
1538 LDKFundingSigned* msg_conv = (LDKFundingSigned*)msg;
1539 return (arg_conv->handle_funding_signed)(arg_conv->this_arg, their_node_id_conv, msg_conv);
1542 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1funding_1locked(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
1543 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
1544 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
1545 FREE((void*)their_node_id);
1546 LDKFundingLocked* msg_conv = (LDKFundingLocked*)msg;
1547 return (arg_conv->handle_funding_locked)(arg_conv->this_arg, their_node_id_conv, msg_conv);
1550 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1shutdown(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
1551 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
1552 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
1553 FREE((void*)their_node_id);
1554 LDKShutdown* msg_conv = (LDKShutdown*)msg;
1555 return (arg_conv->handle_shutdown)(arg_conv->this_arg, their_node_id_conv, msg_conv);
1558 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1closing_1signed(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
1559 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
1560 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
1561 FREE((void*)their_node_id);
1562 LDKClosingSigned* msg_conv = (LDKClosingSigned*)msg;
1563 return (arg_conv->handle_closing_signed)(arg_conv->this_arg, their_node_id_conv, msg_conv);
1566 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1update_1add_1htlc(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
1567 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
1568 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
1569 FREE((void*)their_node_id);
1570 LDKUpdateAddHTLC* msg_conv = (LDKUpdateAddHTLC*)msg;
1571 return (arg_conv->handle_update_add_htlc)(arg_conv->this_arg, their_node_id_conv, msg_conv);
1574 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1update_1fulfill_1htlc(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
1575 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
1576 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
1577 FREE((void*)their_node_id);
1578 LDKUpdateFulfillHTLC* msg_conv = (LDKUpdateFulfillHTLC*)msg;
1579 return (arg_conv->handle_update_fulfill_htlc)(arg_conv->this_arg, their_node_id_conv, msg_conv);
1582 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1update_1fail_1htlc(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
1583 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
1584 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
1585 FREE((void*)their_node_id);
1586 LDKUpdateFailHTLC* msg_conv = (LDKUpdateFailHTLC*)msg;
1587 return (arg_conv->handle_update_fail_htlc)(arg_conv->this_arg, their_node_id_conv, msg_conv);
1590 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1update_1fail_1malformed_1htlc(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
1591 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
1592 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
1593 FREE((void*)their_node_id);
1594 LDKUpdateFailMalformedHTLC* msg_conv = (LDKUpdateFailMalformedHTLC*)msg;
1595 return (arg_conv->handle_update_fail_malformed_htlc)(arg_conv->this_arg, their_node_id_conv, msg_conv);
1598 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1commitment_1signed(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
1599 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
1600 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
1601 FREE((void*)their_node_id);
1602 LDKCommitmentSigned* msg_conv = (LDKCommitmentSigned*)msg;
1603 return (arg_conv->handle_commitment_signed)(arg_conv->this_arg, their_node_id_conv, msg_conv);
1606 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1revoke_1and_1ack(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
1607 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
1608 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
1609 FREE((void*)their_node_id);
1610 LDKRevokeAndACK* msg_conv = (LDKRevokeAndACK*)msg;
1611 return (arg_conv->handle_revoke_and_ack)(arg_conv->this_arg, their_node_id_conv, msg_conv);
1614 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1update_1fee(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
1615 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
1616 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
1617 FREE((void*)their_node_id);
1618 LDKUpdateFee* msg_conv = (LDKUpdateFee*)msg;
1619 return (arg_conv->handle_update_fee)(arg_conv->this_arg, their_node_id_conv, msg_conv);
1622 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1announcement_1signatures(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
1623 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
1624 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
1625 FREE((void*)their_node_id);
1626 LDKAnnouncementSignatures* msg_conv = (LDKAnnouncementSignatures*)msg;
1627 return (arg_conv->handle_announcement_signatures)(arg_conv->this_arg, their_node_id_conv, msg_conv);
1630 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1peer_1disconnected(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jboolean no_connection_possible) {
1631 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
1632 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
1633 FREE((void*)their_node_id);
1634 return (arg_conv->peer_disconnected)(arg_conv->this_arg, their_node_id_conv, no_connection_possible);
1637 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1peer_1connected(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
1638 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
1639 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
1640 FREE((void*)their_node_id);
1641 LDKInit* msg_conv = (LDKInit*)msg;
1642 return (arg_conv->peer_connected)(arg_conv->this_arg, their_node_id_conv, msg_conv);
1645 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1channel_1reestablish(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
1646 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
1647 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
1648 FREE((void*)their_node_id);
1649 LDKChannelReestablish* msg_conv = (LDKChannelReestablish*)msg;
1650 return (arg_conv->handle_channel_reestablish)(arg_conv->this_arg, their_node_id_conv, msg_conv);
1653 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1error(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
1654 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
1655 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
1656 FREE((void*)their_node_id);
1657 LDKErrorMessage* msg_conv = (LDKErrorMessage*)msg;
1658 return (arg_conv->handle_error)(arg_conv->this_arg, their_node_id_conv, msg_conv);
1661 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
1662 return ((LDKCResult_boolLightningErrorZ*)arg)->result_ok;
1664 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
1665 if (((LDKCResult_boolLightningErrorZ*)arg)->result_ok) {
1666 return (long)((LDKCResult_boolLightningErrorZ*)arg)->contents.result;
1668 return (long)((LDKCResult_boolLightningErrorZ*)arg)->contents.err;
1671 typedef struct LDKRoutingMessageHandler_JCalls {
1672 atomic_size_t refcnt;
1675 jmethodID handle_node_announcement_meth;
1676 jmethodID handle_channel_announcement_meth;
1677 jmethodID handle_channel_update_meth;
1678 jmethodID handle_htlc_fail_channel_update_meth;
1679 jmethodID get_next_channel_announcements_meth;
1680 jmethodID get_next_node_announcements_meth;
1681 jmethodID should_request_full_sync_meth;
1682 } LDKRoutingMessageHandler_JCalls;
1683 LDKCResult_boolLightningErrorZ handle_node_announcement_jcall(const void* this_arg, const LDKNodeAnnouncement *msg) {
1684 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1685 LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->handle_node_announcement_meth, msg);
1686 LDKCResult_boolLightningErrorZ res = *ret;
1690 LDKCResult_boolLightningErrorZ handle_channel_announcement_jcall(const void* this_arg, const LDKChannelAnnouncement *msg) {
1691 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1692 LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->handle_channel_announcement_meth, msg);
1693 LDKCResult_boolLightningErrorZ res = *ret;
1697 LDKCResult_boolLightningErrorZ handle_channel_update_jcall(const void* this_arg, const LDKChannelUpdate *msg) {
1698 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1699 LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->handle_channel_update_meth, msg);
1700 LDKCResult_boolLightningErrorZ res = *ret;
1704 void handle_htlc_fail_channel_update_jcall(const void* this_arg, const LDKHTLCFailChannelUpdate *update) {
1705 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1706 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_htlc_fail_channel_update_meth, update);
1708 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcements_jcall(const void* this_arg, uint64_t starting_point, uint8_t batch_amount) {
1709 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1710 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* ret = (LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_next_channel_announcements_meth, starting_point, batch_amount);
1711 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ res = *ret;
1715 LDKCVec_NodeAnnouncementZ get_next_node_announcements_jcall(const void* this_arg, LDKPublicKey starting_point, uint8_t batch_amount) {
1716 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1717 LDKCVec_NodeAnnouncementZ* ret = (LDKCVec_NodeAnnouncementZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_next_node_announcements_meth, starting_point, batch_amount);
1718 LDKCVec_NodeAnnouncementZ res = *ret;
1722 bool should_request_full_sync_jcall(const void* this_arg, LDKPublicKey node_id) {
1723 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1724 return (*j_calls->env)->CallBooleanMethod(j_calls->env, j_calls->o, j_calls->should_request_full_sync_meth, node_id);
1726 static void LDKRoutingMessageHandler_JCalls_free(void* this_arg) {
1727 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1728 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1729 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
1733 static void* LDKRoutingMessageHandler_JCalls_clone(const void* this_arg) {
1734 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1735 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1736 return (void*) this_arg;
1738 static inline LDKRoutingMessageHandler LDKRoutingMessageHandler_init (JNIEnv * env, jclass _a, jobject o) {
1739 jclass c = (*env)->GetObjectClass(env, o);
1741 LDKRoutingMessageHandler_JCalls *calls = MALLOC(sizeof(LDKRoutingMessageHandler_JCalls), "LDKRoutingMessageHandler_JCalls");
1742 atomic_init(&calls->refcnt, 1);
1744 calls->o = (*env)->NewGlobalRef(env, o);
1745 calls->handle_node_announcement_meth = (*env)->GetMethodID(env, c, "handle_node_announcement", "(J)J");
1746 assert(calls->handle_node_announcement_meth != NULL);
1747 calls->handle_channel_announcement_meth = (*env)->GetMethodID(env, c, "handle_channel_announcement", "(J)J");
1748 assert(calls->handle_channel_announcement_meth != NULL);
1749 calls->handle_channel_update_meth = (*env)->GetMethodID(env, c, "handle_channel_update", "(J)J");
1750 assert(calls->handle_channel_update_meth != NULL);
1751 calls->handle_htlc_fail_channel_update_meth = (*env)->GetMethodID(env, c, "handle_htlc_fail_channel_update", "(J)V");
1752 assert(calls->handle_htlc_fail_channel_update_meth != NULL);
1753 calls->get_next_channel_announcements_meth = (*env)->GetMethodID(env, c, "get_next_channel_announcements", "(JB)J");
1754 assert(calls->get_next_channel_announcements_meth != NULL);
1755 calls->get_next_node_announcements_meth = (*env)->GetMethodID(env, c, "get_next_node_announcements", "(JB)J");
1756 assert(calls->get_next_node_announcements_meth != NULL);
1757 calls->should_request_full_sync_meth = (*env)->GetMethodID(env, c, "should_request_full_sync", "(J)Z");
1758 assert(calls->should_request_full_sync_meth != NULL);
1760 LDKRoutingMessageHandler ret = {
1761 .this_arg = (void*) calls,
1762 .handle_node_announcement = handle_node_announcement_jcall,
1763 .handle_channel_announcement = handle_channel_announcement_jcall,
1764 .handle_channel_update = handle_channel_update_jcall,
1765 .handle_htlc_fail_channel_update = handle_htlc_fail_channel_update_jcall,
1766 .get_next_channel_announcements = get_next_channel_announcements_jcall,
1767 .get_next_node_announcements = get_next_node_announcements_jcall,
1768 .should_request_full_sync = should_request_full_sync_jcall,
1769 .free = LDKRoutingMessageHandler_JCalls_free,
1773 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1new (JNIEnv * env, jclass _a, jobject o) {
1774 LDKRoutingMessageHandler *res_ptr = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
1775 *res_ptr = LDKRoutingMessageHandler_init(env, _a, o);
1776 return (long)res_ptr;
1778 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
1779 return ((LDKRoutingMessageHandler_JCalls*)val)->o;
1781 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1call_1handle_1node_1announcement(JNIEnv * _env, jclass _b, jlong arg, jlong msg) {
1782 LDKRoutingMessageHandler* arg_conv = (LDKRoutingMessageHandler*)arg;
1783 LDKNodeAnnouncement* msg_conv = (LDKNodeAnnouncement*)msg;
1784 LDKCResult_boolLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
1785 *ret = (arg_conv->handle_node_announcement)(arg_conv->this_arg, msg_conv);
1789 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1call_1handle_1channel_1announcement(JNIEnv * _env, jclass _b, jlong arg, jlong msg) {
1790 LDKRoutingMessageHandler* arg_conv = (LDKRoutingMessageHandler*)arg;
1791 LDKChannelAnnouncement* msg_conv = (LDKChannelAnnouncement*)msg;
1792 LDKCResult_boolLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
1793 *ret = (arg_conv->handle_channel_announcement)(arg_conv->this_arg, msg_conv);
1797 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1call_1handle_1channel_1update(JNIEnv * _env, jclass _b, jlong arg, jlong msg) {
1798 LDKRoutingMessageHandler* arg_conv = (LDKRoutingMessageHandler*)arg;
1799 LDKChannelUpdate* msg_conv = (LDKChannelUpdate*)msg;
1800 LDKCResult_boolLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
1801 *ret = (arg_conv->handle_channel_update)(arg_conv->this_arg, msg_conv);
1805 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1call_1handle_1htlc_1fail_1channel_1update(JNIEnv * _env, jclass _b, jlong arg, jlong update) {
1806 LDKRoutingMessageHandler* arg_conv = (LDKRoutingMessageHandler*)arg;
1807 LDKHTLCFailChannelUpdate* update_conv = (LDKHTLCFailChannelUpdate*)update;
1808 return (arg_conv->handle_htlc_fail_channel_update)(arg_conv->this_arg, update_conv);
1811 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) {
1812 LDKRoutingMessageHandler* arg_conv = (LDKRoutingMessageHandler*)arg;
1813 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* ret = MALLOC(sizeof(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
1814 *ret = (arg_conv->get_next_channel_announcements)(arg_conv->this_arg, starting_point, batch_amount);
1818 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) {
1819 LDKRoutingMessageHandler* arg_conv = (LDKRoutingMessageHandler*)arg;
1820 LDKPublicKey starting_point_conv = *(LDKPublicKey*)starting_point;
1821 FREE((void*)starting_point);
1822 LDKCVec_NodeAnnouncementZ* ret = MALLOC(sizeof(LDKCVec_NodeAnnouncementZ), "LDKCVec_NodeAnnouncementZ");
1823 *ret = (arg_conv->get_next_node_announcements)(arg_conv->this_arg, starting_point_conv, batch_amount);
1827 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1call_1should_1request_1full_1sync(JNIEnv * _env, jclass _b, jlong arg, jlong node_id) {
1828 LDKRoutingMessageHandler* arg_conv = (LDKRoutingMessageHandler*)arg;
1829 LDKPublicKey node_id_conv = *(LDKPublicKey*)node_id;
1830 FREE((void*)node_id);
1831 return (arg_conv->should_request_full_sync)(arg_conv->this_arg, node_id_conv);
1834 typedef struct LDKSocketDescriptor_JCalls {
1835 atomic_size_t refcnt;
1838 jmethodID send_data_meth;
1839 jmethodID disconnect_socket_meth;
1841 jmethodID hash_meth;
1842 } LDKSocketDescriptor_JCalls;
1843 uintptr_t send_data_jcall(void* this_arg, LDKu8slice data, bool resume_read) {
1844 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
1845 return (*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->send_data_meth, data, resume_read);
1847 void disconnect_socket_jcall(void* this_arg) {
1848 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
1849 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->disconnect_socket_meth);
1851 bool eq_jcall(const void* this_arg, const void *other_arg) {
1852 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
1853 return (*j_calls->env)->CallBooleanMethod(j_calls->env, j_calls->o, j_calls->eq_meth, other_arg);
1855 uint64_t hash_jcall(const void* this_arg) {
1856 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
1857 return (*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->hash_meth);
1859 static void LDKSocketDescriptor_JCalls_free(void* this_arg) {
1860 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
1861 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1862 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
1866 static void* LDKSocketDescriptor_JCalls_clone(const void* this_arg) {
1867 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
1868 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1869 return (void*) this_arg;
1871 static inline LDKSocketDescriptor LDKSocketDescriptor_init (JNIEnv * env, jclass _a, jobject o) {
1872 jclass c = (*env)->GetObjectClass(env, o);
1874 LDKSocketDescriptor_JCalls *calls = MALLOC(sizeof(LDKSocketDescriptor_JCalls), "LDKSocketDescriptor_JCalls");
1875 atomic_init(&calls->refcnt, 1);
1877 calls->o = (*env)->NewGlobalRef(env, o);
1878 calls->send_data_meth = (*env)->GetMethodID(env, c, "send_data", "(JZ)J");
1879 assert(calls->send_data_meth != NULL);
1880 calls->disconnect_socket_meth = (*env)->GetMethodID(env, c, "disconnect_socket", "()V");
1881 assert(calls->disconnect_socket_meth != NULL);
1882 calls->eq_meth = (*env)->GetMethodID(env, c, "eq", "(J)Z");
1883 assert(calls->eq_meth != NULL);
1884 calls->hash_meth = (*env)->GetMethodID(env, c, "hash", "()J");
1885 assert(calls->hash_meth != NULL);
1887 LDKSocketDescriptor ret = {
1888 .this_arg = (void*) calls,
1889 .send_data = send_data_jcall,
1890 .disconnect_socket = disconnect_socket_jcall,
1893 .clone = LDKSocketDescriptor_JCalls_clone,
1894 .free = LDKSocketDescriptor_JCalls_free,
1898 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1new (JNIEnv * env, jclass _a, jobject o) {
1899 LDKSocketDescriptor *res_ptr = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
1900 *res_ptr = LDKSocketDescriptor_init(env, _a, o);
1901 return (long)res_ptr;
1903 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
1904 return ((LDKSocketDescriptor_JCalls*)val)->o;
1906 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1call_1send_1data(JNIEnv * _env, jclass _b, jlong arg, jlong data, jboolean resume_read) {
1907 LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg;
1908 LDKu8slice data_conv = *(LDKu8slice*)data;
1910 return (arg_conv->send_data)(arg_conv->this_arg, data_conv, resume_read);
1913 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1call_1disconnect_1socket(JNIEnv * _env, jclass _b, jlong arg) {
1914 LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg;
1915 return (arg_conv->disconnect_socket)(arg_conv->this_arg);
1918 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1call_1hash(JNIEnv * _env, jclass _b, jlong arg) {
1919 LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg;
1920 return (arg_conv->hash)(arg_conv->this_arg);
1923 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
1924 return ((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->result_ok;
1926 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
1927 if (((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->result_ok) {
1928 return (long)((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->contents.result;
1930 return (long)((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->contents.err;
1933 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
1934 return ((LDKCResult_boolPeerHandleErrorZ*)arg)->result_ok;
1936 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
1937 if (((LDKCResult_boolPeerHandleErrorZ*)arg)->result_ok) {
1938 return (long)((LDKCResult_boolPeerHandleErrorZ*)arg)->contents.result;
1940 return (long)((LDKCResult_boolPeerHandleErrorZ*)arg)->contents.err;
1943 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeySecpErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
1944 return ((LDKCResult_SecretKeySecpErrorZ*)arg)->result_ok;
1946 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeySecpErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
1947 if (((LDKCResult_SecretKeySecpErrorZ*)arg)->result_ok) {
1948 return (long)((LDKCResult_SecretKeySecpErrorZ*)arg)->contents.result;
1950 return (long)((LDKCResult_SecretKeySecpErrorZ*)arg)->contents.err;
1953 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeySecpErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
1954 return ((LDKCResult_PublicKeySecpErrorZ*)arg)->result_ok;
1956 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeySecpErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
1957 if (((LDKCResult_PublicKeySecpErrorZ*)arg)->result_ok) {
1958 return (long)((LDKCResult_PublicKeySecpErrorZ*)arg)->contents.result;
1960 return (long)((LDKCResult_PublicKeySecpErrorZ*)arg)->contents.err;
1963 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysSecpErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
1964 return ((LDKCResult_TxCreationKeysSecpErrorZ*)arg)->result_ok;
1966 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysSecpErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
1967 if (((LDKCResult_TxCreationKeysSecpErrorZ*)arg)->result_ok) {
1968 return (long)((LDKCResult_TxCreationKeysSecpErrorZ*)arg)->contents.result;
1970 return (long)((LDKCResult_TxCreationKeysSecpErrorZ*)arg)->contents.err;
1973 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
1974 return ((LDKCResult_RouteLightningErrorZ*)arg)->result_ok;
1976 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
1977 if (((LDKCResult_RouteLightningErrorZ*)arg)->result_ok) {
1978 return (long)((LDKCResult_RouteLightningErrorZ*)arg)->contents.result;
1980 return (long)((LDKCResult_RouteLightningErrorZ*)arg)->contents.err;
1983 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HTLCOutputInCommitmentSignatureZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1984 LDKC2Tuple_HTLCOutputInCommitmentSignatureZ arg_conv = *(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ*)arg;
1986 return C2Tuple_HTLCOutputInCommitmentSignatureZ_free(arg_conv);
1989 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1990 LDKC2Tuple_OutPointScriptZ arg_conv = *(LDKC2Tuple_OutPointScriptZ*)arg;
1992 return C2Tuple_OutPointScriptZ_free(arg_conv);
1995 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1996 LDKC2Tuple_SignatureCVec_SignatureZZ arg_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)arg;
1998 return C2Tuple_SignatureCVec_SignatureZZ_free(arg_conv);
2001 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1TxOutZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2002 LDKC2Tuple_TxidCVec_TxOutZZ arg_conv = *(LDKC2Tuple_TxidCVec_TxOutZZ*)arg;
2004 return C2Tuple_TxidCVec_TxOutZZ_free(arg_conv);
2007 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
2008 LDKC2Tuple_u64u64Z arg_conv = *(LDKC2Tuple_u64u64Z*)arg;
2010 return C2Tuple_u64u64Z_free(arg_conv);
2013 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2014 LDKC2Tuple_usizeTransactionZ arg_conv = *(LDKC2Tuple_usizeTransactionZ*)arg;
2016 return C2Tuple_usizeTransactionZ_free(arg_conv);
2019 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2020 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arg_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)arg;
2022 return C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(arg_conv);
2025 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2026 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ arg_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg;
2028 return CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(arg_conv);
2031 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
2032 LDKC2Tuple_SignatureCVec_SignatureZZ arg_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)arg;
2034 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
2035 *ret = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(arg_conv);
2039 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2040 LDKCResult_CVec_SignatureZNoneZ arg_conv = *(LDKCResult_CVec_SignatureZNoneZ*)arg;
2042 return CResult_CVec_SignatureZNoneZ_free(arg_conv);
2045 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
2046 LDKCVec_SignatureZ arg_conv = *(LDKCVec_SignatureZ*)arg;
2048 LDKCResult_CVec_SignatureZNoneZ* ret = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
2049 *ret = CResult_CVec_SignatureZNoneZ_ok(arg_conv);
2053 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
2054 LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg;
2056 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
2057 *ret = CResult_CVec_u8ZPeerHandleErrorZ_err(arg_conv);
2061 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2062 LDKCResult_CVec_u8ZPeerHandleErrorZ arg_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg;
2064 return CResult_CVec_u8ZPeerHandleErrorZ_free(arg_conv);
2067 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
2068 LDKCVec_u8Z arg_conv = *(LDKCVec_u8Z*)arg;
2070 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
2071 *ret = CResult_CVec_u8ZPeerHandleErrorZ_ok(arg_conv);
2075 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
2076 LDKAPIError arg_conv = *(LDKAPIError*)arg;
2078 LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
2079 *ret = CResult_NoneAPIErrorZ_err(arg_conv);
2083 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2084 LDKCResult_NoneAPIErrorZ arg_conv = *(LDKCResult_NoneAPIErrorZ*)arg;
2086 return CResult_NoneAPIErrorZ_free(arg_conv);
2089 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
2090 LDKChannelMonitorUpdateErr arg_conv = *(LDKChannelMonitorUpdateErr*)arg;
2092 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
2093 *ret = CResult_NoneChannelMonitorUpdateErrZ_err(arg_conv);
2097 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2098 LDKCResult_NoneChannelMonitorUpdateErrZ arg_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)arg;
2100 return CResult_NoneChannelMonitorUpdateErrZ_free(arg_conv);
2103 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
2104 LDKMonitorUpdateError arg_conv = *(LDKMonitorUpdateError*)arg;
2106 LDKCResult_NoneMonitorUpdateErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
2107 *ret = CResult_NoneMonitorUpdateErrorZ_err(arg_conv);
2111 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2112 LDKCResult_NoneMonitorUpdateErrorZ arg_conv = *(LDKCResult_NoneMonitorUpdateErrorZ*)arg;
2114 return CResult_NoneMonitorUpdateErrorZ_free(arg_conv);
2117 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
2118 LDKPaymentSendFailure arg_conv = *(LDKPaymentSendFailure*)arg;
2120 LDKCResult_NonePaymentSendFailureZ* ret = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
2121 *ret = CResult_NonePaymentSendFailureZ_err(arg_conv);
2125 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2126 LDKCResult_NonePaymentSendFailureZ arg_conv = *(LDKCResult_NonePaymentSendFailureZ*)arg;
2128 return CResult_NonePaymentSendFailureZ_free(arg_conv);
2131 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
2132 LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg;
2134 LDKCResult_NonePeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
2135 *ret = CResult_NonePeerHandleErrorZ_err(arg_conv);
2139 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2140 LDKCResult_NonePeerHandleErrorZ arg_conv = *(LDKCResult_NonePeerHandleErrorZ*)arg;
2142 return CResult_NonePeerHandleErrorZ_free(arg_conv);
2145 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
2146 LDKSecp256k1Error arg_conv = *(LDKSecp256k1Error*)arg;
2148 LDKCResult_PublicKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ");
2149 *ret = CResult_PublicKeySecpErrorZ_err(arg_conv);
2153 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2154 LDKCResult_PublicKeySecpErrorZ arg_conv = *(LDKCResult_PublicKeySecpErrorZ*)arg;
2156 return CResult_PublicKeySecpErrorZ_free(arg_conv);
2159 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
2160 LDKPublicKey arg_conv = *(LDKPublicKey*)arg;
2162 LDKCResult_PublicKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ");
2163 *ret = CResult_PublicKeySecpErrorZ_ok(arg_conv);
2167 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
2168 LDKLightningError arg_conv = *(LDKLightningError*)arg;
2170 LDKCResult_RouteLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
2171 *ret = CResult_RouteLightningErrorZ_err(arg_conv);
2175 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2176 LDKCResult_RouteLightningErrorZ arg_conv = *(LDKCResult_RouteLightningErrorZ*)arg;
2178 return CResult_RouteLightningErrorZ_free(arg_conv);
2181 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
2182 LDKRoute arg_conv = *(LDKRoute*)arg;
2184 LDKCResult_RouteLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
2185 *ret = CResult_RouteLightningErrorZ_ok(arg_conv);
2189 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
2190 LDKSecp256k1Error arg_conv = *(LDKSecp256k1Error*)arg;
2192 LDKCResult_SecretKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ");
2193 *ret = CResult_SecretKeySecpErrorZ_err(arg_conv);
2197 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2198 LDKCResult_SecretKeySecpErrorZ arg_conv = *(LDKCResult_SecretKeySecpErrorZ*)arg;
2200 return CResult_SecretKeySecpErrorZ_free(arg_conv);
2203 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
2204 LDKSecretKey arg_conv = *(LDKSecretKey*)arg;
2206 LDKCResult_SecretKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ");
2207 *ret = CResult_SecretKeySecpErrorZ_ok(arg_conv);
2211 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2212 LDKCResult_SignatureNoneZ arg_conv = *(LDKCResult_SignatureNoneZ*)arg;
2214 return CResult_SignatureNoneZ_free(arg_conv);
2217 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
2218 LDKSignature arg_conv = *(LDKSignature*)arg;
2220 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
2221 *ret = CResult_SignatureNoneZ_ok(arg_conv);
2225 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
2226 LDKSecp256k1Error arg_conv = *(LDKSecp256k1Error*)arg;
2228 LDKCResult_TxCreationKeysSecpErrorZ* ret = MALLOC(sizeof(LDKCResult_TxCreationKeysSecpErrorZ), "LDKCResult_TxCreationKeysSecpErrorZ");
2229 *ret = CResult_TxCreationKeysSecpErrorZ_err(arg_conv);
2233 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2234 LDKCResult_TxCreationKeysSecpErrorZ arg_conv = *(LDKCResult_TxCreationKeysSecpErrorZ*)arg;
2236 return CResult_TxCreationKeysSecpErrorZ_free(arg_conv);
2239 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
2240 LDKTxCreationKeys arg_conv = *(LDKTxCreationKeys*)arg;
2242 LDKCResult_TxCreationKeysSecpErrorZ* ret = MALLOC(sizeof(LDKCResult_TxCreationKeysSecpErrorZ), "LDKCResult_TxCreationKeysSecpErrorZ");
2243 *ret = CResult_TxCreationKeysSecpErrorZ_ok(arg_conv);
2247 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
2248 LDKAccessError arg_conv = *(LDKAccessError*)arg;
2250 LDKCResult_TxOutAccessErrorZ* ret = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
2251 *ret = CResult_TxOutAccessErrorZ_err(arg_conv);
2255 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2256 LDKCResult_TxOutAccessErrorZ arg_conv = *(LDKCResult_TxOutAccessErrorZ*)arg;
2258 return CResult_TxOutAccessErrorZ_free(arg_conv);
2261 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
2262 LDKTxOut arg_conv = *(LDKTxOut*)arg;
2264 LDKCResult_TxOutAccessErrorZ* ret = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
2265 *ret = CResult_TxOutAccessErrorZ_ok(arg_conv);
2269 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
2270 LDKLightningError arg_conv = *(LDKLightningError*)arg;
2272 LDKCResult_boolLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
2273 *ret = CResult_boolLightningErrorZ_err(arg_conv);
2277 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2278 LDKCResult_boolLightningErrorZ arg_conv = *(LDKCResult_boolLightningErrorZ*)arg;
2280 return CResult_boolLightningErrorZ_free(arg_conv);
2283 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1ok(JNIEnv * _env, jclass _b, jboolean arg) {
2284 LDKCResult_boolLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
2285 *ret = CResult_boolLightningErrorZ_ok(arg);
2289 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
2290 LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg;
2292 LDKCResult_boolPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
2293 *ret = CResult_boolPeerHandleErrorZ_err(arg_conv);
2297 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2298 LDKCResult_boolPeerHandleErrorZ arg_conv = *(LDKCResult_boolPeerHandleErrorZ*)arg;
2300 return CResult_boolPeerHandleErrorZ_free(arg_conv);
2303 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b, jboolean arg) {
2304 LDKCResult_boolPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
2305 *ret = CResult_boolPeerHandleErrorZ_ok(arg);
2309 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1HTLCOutputInCommitmentSignatureZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2310 LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ arg_conv = *(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ*)arg;
2312 return CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ_free(arg_conv);
2315 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1TxOutZZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2316 LDKCVec_C2Tuple_TxidCVec_TxOutZZZ arg_conv = *(LDKCVec_C2Tuple_TxidCVec_TxOutZZZ*)arg;
2318 return CVec_C2Tuple_TxidCVec_TxOutZZZ_free(arg_conv);
2321 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1usizeTransactionZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2322 LDKCVec_C2Tuple_usizeTransactionZZ arg_conv = *(LDKCVec_C2Tuple_usizeTransactionZZ*)arg;
2324 return CVec_C2Tuple_usizeTransactionZZ_free(arg_conv);
2327 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2328 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ arg_conv = *(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)arg;
2330 return CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(arg_conv);
2333 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1RouteHopZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2334 LDKCVec_CVec_RouteHopZZ arg_conv = *(LDKCVec_CVec_RouteHopZZ*)arg;
2336 return CVec_CVec_RouteHopZZ_free(arg_conv);
2339 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2340 LDKCVec_ChannelDetailsZ arg_conv = *(LDKCVec_ChannelDetailsZ*)arg;
2342 return CVec_ChannelDetailsZ_free(arg_conv);
2345 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelMonitorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2346 LDKCVec_ChannelMonitorZ arg_conv = *(LDKCVec_ChannelMonitorZ*)arg;
2348 return CVec_ChannelMonitorZ_free(arg_conv);
2351 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1EventZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2352 LDKCVec_EventZ arg_conv = *(LDKCVec_EventZ*)arg;
2354 return CVec_EventZ_free(arg_conv);
2357 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1HTLCOutputInCommitmentZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2358 LDKCVec_HTLCOutputInCommitmentZ arg_conv = *(LDKCVec_HTLCOutputInCommitmentZ*)arg;
2360 return CVec_HTLCOutputInCommitmentZ_free(arg_conv);
2363 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MessageSendEventZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2364 LDKCVec_MessageSendEventZ arg_conv = *(LDKCVec_MessageSendEventZ*)arg;
2366 return CVec_MessageSendEventZ_free(arg_conv);
2369 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorEventZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2370 LDKCVec_MonitorEventZ arg_conv = *(LDKCVec_MonitorEventZ*)arg;
2372 return CVec_MonitorEventZ_free(arg_conv);
2375 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NetAddressZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2376 LDKCVec_NetAddressZ arg_conv = *(LDKCVec_NetAddressZ*)arg;
2378 return CVec_NetAddressZ_free(arg_conv);
2381 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NodeAnnouncementZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2382 LDKCVec_NodeAnnouncementZ arg_conv = *(LDKCVec_NodeAnnouncementZ*)arg;
2384 return CVec_NodeAnnouncementZ_free(arg_conv);
2387 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PublicKeyZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2388 LDKCVec_PublicKeyZ arg_conv = *(LDKCVec_PublicKeyZ*)arg;
2390 return CVec_PublicKeyZ_free(arg_conv);
2393 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2394 LDKCVec_RouteHintZ arg_conv = *(LDKCVec_RouteHintZ*)arg;
2396 return CVec_RouteHintZ_free(arg_conv);
2399 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHopZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2400 LDKCVec_RouteHopZ arg_conv = *(LDKCVec_RouteHopZ*)arg;
2402 return CVec_RouteHopZ_free(arg_conv);
2405 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SignatureZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2406 LDKCVec_SignatureZ arg_conv = *(LDKCVec_SignatureZ*)arg;
2408 return CVec_SignatureZ_free(arg_conv);
2411 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SpendableOutputDescriptorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2412 LDKCVec_SpendableOutputDescriptorZ arg_conv = *(LDKCVec_SpendableOutputDescriptorZ*)arg;
2414 return CVec_SpendableOutputDescriptorZ_free(arg_conv);
2417 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2418 LDKCVec_TransactionZ arg_conv = *(LDKCVec_TransactionZ*)arg;
2420 return CVec_TransactionZ_free(arg_conv);
2423 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TxOutZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2424 LDKCVec_TxOutZ arg_conv = *(LDKCVec_TxOutZ*)arg;
2426 return CVec_TxOutZ_free(arg_conv);
2429 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateAddHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2430 LDKCVec_UpdateAddHTLCZ arg_conv = *(LDKCVec_UpdateAddHTLCZ*)arg;
2432 return CVec_UpdateAddHTLCZ_free(arg_conv);
2435 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2436 LDKCVec_UpdateFailHTLCZ arg_conv = *(LDKCVec_UpdateFailHTLCZ*)arg;
2438 return CVec_UpdateFailHTLCZ_free(arg_conv);
2441 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailMalformedHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2442 LDKCVec_UpdateFailMalformedHTLCZ arg_conv = *(LDKCVec_UpdateFailMalformedHTLCZ*)arg;
2444 return CVec_UpdateFailMalformedHTLCZ_free(arg_conv);
2447 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFulfillHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
2448 LDKCVec_UpdateFulfillHTLCZ arg_conv = *(LDKCVec_UpdateFulfillHTLCZ*)arg;
2450 return CVec_UpdateFulfillHTLCZ_free(arg_conv);
2453 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u64Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
2454 LDKCVec_u64Z arg_conv = *(LDKCVec_u64Z*)arg;
2456 return CVec_u64Z_free(arg_conv);
2459 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u8Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
2460 LDKCVec_u8Z arg_conv = *(LDKCVec_u8Z*)arg;
2462 return CVec_u8Z_free(arg_conv);
2465 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Transaction_1free(JNIEnv * _env, jclass _b, jlong _res) {
2466 LDKTransaction _res_conv = *(LDKTransaction*)_res;
2468 return Transaction_free(_res_conv);
2471 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_1free(JNIEnv * _env, jclass _b, jlong _res) {
2472 LDKTxOut _res_conv = *(LDKTxOut*)_res;
2474 return TxOut_free(_res_conv);
2477 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
2478 LDKTransaction b_conv = *(LDKTransaction*)b;
2480 LDKC2Tuple_usizeTransactionZ* ret = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
2481 *ret = C2Tuple_usizeTransactionZ_new(a, b_conv);
2485 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1ok(JNIEnv * _env, jclass _b) {
2486 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
2487 *ret = CResult_NoneChannelMonitorUpdateErrZ_ok();
2491 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1ok(JNIEnv * _env, jclass _b) {
2492 LDKCResult_NoneMonitorUpdateErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
2493 *ret = CResult_NoneMonitorUpdateErrorZ_ok();
2497 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
2498 LDKOutPoint a_conv = *(LDKOutPoint*)a;
2500 a_conv.is_owned = true;
2501 LDKCVec_u8Z b_conv = *(LDKCVec_u8Z*)b;
2503 LDKC2Tuple_OutPointScriptZ* ret = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
2504 *ret = C2Tuple_OutPointScriptZ_new(a_conv, b_conv);
2508 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1TxOutZZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
2509 LDKThirtyTwoBytes a_conv = *(LDKThirtyTwoBytes*)a;
2511 LDKCVec_TxOutZ b_conv = *(LDKCVec_TxOutZ*)b;
2513 LDKC2Tuple_TxidCVec_TxOutZZ* ret = MALLOC(sizeof(LDKC2Tuple_TxidCVec_TxOutZZ), "LDKC2Tuple_TxidCVec_TxOutZZ");
2514 *ret = C2Tuple_TxidCVec_TxOutZZ_new(a_conv, b_conv);
2518 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
2519 LDKC2Tuple_u64u64Z* ret = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
2520 *ret = C2Tuple_u64u64Z_new(a, b);
2524 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
2525 LDKSignature a_conv = *(LDKSignature*)a;
2527 LDKCVec_SignatureZ b_conv = *(LDKCVec_SignatureZ*)b;
2529 LDKC2Tuple_SignatureCVec_SignatureZZ* ret = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
2530 *ret = C2Tuple_SignatureCVec_SignatureZZ_new(a_conv, b_conv);
2534 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1err(JNIEnv * _env, jclass _b) {
2535 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
2536 *ret = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err();
2540 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1err(JNIEnv * _env, jclass _b) {
2541 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
2542 *ret = CResult_SignatureNoneZ_err();
2546 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1err(JNIEnv * _env, jclass _b) {
2547 LDKCResult_CVec_SignatureZNoneZ* ret = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
2548 *ret = CResult_CVec_SignatureZNoneZ_err();
2552 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1ok(JNIEnv * _env, jclass _b) {
2553 LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
2554 *ret = CResult_NoneAPIErrorZ_ok();
2558 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1ok(JNIEnv * _env, jclass _b) {
2559 LDKCResult_NonePaymentSendFailureZ* ret = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
2560 *ret = CResult_NonePaymentSendFailureZ_ok();
2564 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b, jlong c) {
2565 LDKChannelAnnouncement a_conv = *(LDKChannelAnnouncement*)a;
2567 a_conv.is_owned = true;
2568 LDKChannelUpdate b_conv = *(LDKChannelUpdate*)b;
2570 b_conv.is_owned = true;
2571 LDKChannelUpdate c_conv = *(LDKChannelUpdate*)c;
2573 c_conv.is_owned = true;
2574 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
2575 *ret = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a_conv, b_conv, c_conv);
2579 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b) {
2580 LDKCResult_NonePeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
2581 *ret = CResult_NonePeerHandleErrorZ_ok();
2585 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HTLCOutputInCommitmentSignatureZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
2586 LDKHTLCOutputInCommitment a_conv = *(LDKHTLCOutputInCommitment*)a;
2588 a_conv.is_owned = true;
2589 LDKSignature b_conv = *(LDKSignature*)b;
2591 LDKC2Tuple_HTLCOutputInCommitmentSignatureZ* ret = MALLOC(sizeof(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ), "LDKC2Tuple_HTLCOutputInCommitmentSignatureZ");
2592 *ret = C2Tuple_HTLCOutputInCommitmentSignatureZ_new(a_conv, b_conv);
2596 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2597 LDKEvent this_ptr_conv = *(LDKEvent*)this_ptr;
2598 FREE((void*)this_ptr);
2599 return Event_free(this_ptr_conv);
2602 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2603 LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)this_ptr;
2604 FREE((void*)this_ptr);
2605 return MessageSendEvent_free(this_ptr_conv);
2608 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2609 LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)this_ptr;
2610 FREE((void*)this_ptr);
2611 return MessageSendEventsProvider_free(this_ptr_conv);
2614 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2615 LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)this_ptr;
2616 FREE((void*)this_ptr);
2617 return EventsProvider_free(this_ptr_conv);
2620 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_APIError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2621 LDKAPIError this_ptr_conv = *(LDKAPIError*)this_ptr;
2622 FREE((void*)this_ptr);
2623 return APIError_free(this_ptr_conv);
2626 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1max(JNIEnv * _env, jclass _b) {
2627 jclass ret = LDKLevel_to_java(_env, Level_max());
2631 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Logger_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2632 LDKLogger this_ptr_conv = *(LDKLogger*)this_ptr;
2633 FREE((void*)this_ptr);
2634 return Logger_free(this_ptr_conv);
2637 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2638 LDKChannelHandshakeConfig this_ptr_conv = *(LDKChannelHandshakeConfig*)this_ptr;
2639 FREE((void*)this_ptr);
2640 this_ptr_conv.is_owned = true;
2641 return ChannelHandshakeConfig_free(this_ptr_conv);
2644 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr) {
2645 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
2646 return ChannelHandshakeConfig_get_minimum_depth(this_ptr_conv);
2649 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
2650 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
2651 return ChannelHandshakeConfig_set_minimum_depth(this_ptr_conv, val);
2654 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
2655 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
2656 return ChannelHandshakeConfig_get_our_to_self_delay(this_ptr_conv);
2659 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
2660 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
2661 return ChannelHandshakeConfig_set_our_to_self_delay(this_ptr_conv, val);
2664 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
2665 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
2666 return ChannelHandshakeConfig_get_our_htlc_minimum_msat(this_ptr_conv);
2669 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2670 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
2671 return ChannelHandshakeConfig_set_our_htlc_minimum_msat(this_ptr_conv, val);
2674 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) {
2675 LDKChannelHandshakeConfig* ret = MALLOC(sizeof(LDKChannelHandshakeConfig), "LDKChannelHandshakeConfig");
2676 *ret = ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg);
2677 assert(ret->is_owned);
2678 ret->is_owned = false;
2682 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1default(JNIEnv * _env, jclass _b) {
2683 LDKChannelHandshakeConfig* ret = MALLOC(sizeof(LDKChannelHandshakeConfig), "LDKChannelHandshakeConfig");
2684 *ret = ChannelHandshakeConfig_default();
2685 assert(ret->is_owned);
2686 ret->is_owned = false;
2690 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2691 LDKChannelHandshakeLimits this_ptr_conv = *(LDKChannelHandshakeLimits*)this_ptr;
2692 FREE((void*)this_ptr);
2693 this_ptr_conv.is_owned = true;
2694 return ChannelHandshakeLimits_free(this_ptr_conv);
2697 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
2698 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2699 return ChannelHandshakeLimits_get_min_funding_satoshis(this_ptr_conv);
2702 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2703 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2704 return ChannelHandshakeLimits_set_min_funding_satoshis(this_ptr_conv, val);
2707 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
2708 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2709 return ChannelHandshakeLimits_get_max_htlc_minimum_msat(this_ptr_conv);
2712 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2713 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2714 return ChannelHandshakeLimits_set_max_htlc_minimum_msat(this_ptr_conv, val);
2717 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
2718 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2719 return ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(this_ptr_conv);
2722 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) {
2723 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2724 return ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(this_ptr_conv, val);
2727 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
2728 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2729 return ChannelHandshakeLimits_get_max_channel_reserve_satoshis(this_ptr_conv);
2732 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2733 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2734 return ChannelHandshakeLimits_set_max_channel_reserve_satoshis(this_ptr_conv, val);
2737 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr) {
2738 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2739 return ChannelHandshakeLimits_get_min_max_accepted_htlcs(this_ptr_conv);
2742 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
2743 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2744 return ChannelHandshakeLimits_set_min_max_accepted_htlcs(this_ptr_conv, val);
2747 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
2748 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2749 return ChannelHandshakeLimits_get_min_dust_limit_satoshis(this_ptr_conv);
2752 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2753 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2754 return ChannelHandshakeLimits_set_min_dust_limit_satoshis(this_ptr_conv, val);
2757 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
2758 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2759 return ChannelHandshakeLimits_get_max_dust_limit_satoshis(this_ptr_conv);
2762 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2763 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2764 return ChannelHandshakeLimits_set_max_dust_limit_satoshis(this_ptr_conv, val);
2767 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr) {
2768 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2769 return ChannelHandshakeLimits_get_max_minimum_depth(this_ptr_conv);
2772 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
2773 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2774 return ChannelHandshakeLimits_set_max_minimum_depth(this_ptr_conv, val);
2777 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1force_1announced_1channel_1preference(JNIEnv * _env, jclass _b, jlong this_ptr) {
2778 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2779 return ChannelHandshakeLimits_get_force_announced_channel_preference(this_ptr_conv);
2782 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1force_1announced_1channel_1preference(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
2783 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2784 return ChannelHandshakeLimits_set_force_announced_channel_preference(this_ptr_conv, val);
2787 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1their_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
2788 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2789 return ChannelHandshakeLimits_get_their_to_self_delay(this_ptr_conv);
2792 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1their_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
2793 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2794 return ChannelHandshakeLimits_set_their_to_self_delay(this_ptr_conv, val);
2797 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) {
2798 LDKChannelHandshakeLimits* ret = MALLOC(sizeof(LDKChannelHandshakeLimits), "LDKChannelHandshakeLimits");
2799 *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);
2800 assert(ret->is_owned);
2801 ret->is_owned = false;
2805 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1default(JNIEnv * _env, jclass _b) {
2806 LDKChannelHandshakeLimits* ret = MALLOC(sizeof(LDKChannelHandshakeLimits), "LDKChannelHandshakeLimits");
2807 *ret = ChannelHandshakeLimits_default();
2808 assert(ret->is_owned);
2809 ret->is_owned = false;
2813 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2814 LDKChannelConfig this_ptr_conv = *(LDKChannelConfig*)this_ptr;
2815 FREE((void*)this_ptr);
2816 this_ptr_conv.is_owned = true;
2817 return ChannelConfig_free(this_ptr_conv);
2820 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr) {
2821 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
2822 return ChannelConfig_get_fee_proportional_millionths(this_ptr_conv);
2825 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
2826 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
2827 return ChannelConfig_set_fee_proportional_millionths(this_ptr_conv, val);
2830 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1announced_1channel(JNIEnv * _env, jclass _b, jlong this_ptr) {
2831 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
2832 return ChannelConfig_get_announced_channel(this_ptr_conv);
2835 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1announced_1channel(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
2836 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
2837 return ChannelConfig_set_announced_channel(this_ptr_conv, val);
2840 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1commit_1upfront_1shutdown_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
2841 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
2842 return ChannelConfig_get_commit_upfront_shutdown_pubkey(this_ptr_conv);
2845 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1commit_1upfront_1shutdown_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
2846 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
2847 return ChannelConfig_set_commit_upfront_shutdown_pubkey(this_ptr_conv, val);
2850 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) {
2851 LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
2852 *ret = ChannelConfig_new(fee_proportional_millionths_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg);
2853 assert(ret->is_owned);
2854 ret->is_owned = false;
2858 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1default(JNIEnv * _env, jclass _b) {
2859 LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
2860 *ret = ChannelConfig_default();
2861 assert(ret->is_owned);
2862 ret->is_owned = false;
2866 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1write(JNIEnv * _env, jclass _b, jlong obj) {
2867 LDKChannelConfig* obj_conv = (LDKChannelConfig*)obj;
2868 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
2869 *ret = ChannelConfig_write(obj_conv);
2873 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1read(JNIEnv * _env, jclass _b, jlong ser) {
2874 LDKu8slice ser_conv = *(LDKu8slice*)ser;
2876 LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
2877 *ret = ChannelConfig_read(ser_conv);
2878 assert(ret->is_owned);
2879 ret->is_owned = false;
2883 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2884 LDKUserConfig this_ptr_conv = *(LDKUserConfig*)this_ptr;
2885 FREE((void*)this_ptr);
2886 this_ptr_conv.is_owned = true;
2887 return UserConfig_free(this_ptr_conv);
2890 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1own_1channel_1config(JNIEnv * _env, jclass _b, jlong this_ptr) {
2891 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
2892 LDKChannelHandshakeConfig* ret = MALLOC(sizeof(LDKChannelHandshakeConfig), "LDKChannelHandshakeConfig");
2893 *ret = UserConfig_get_own_channel_config(this_ptr_conv);
2894 assert(ret->is_owned);
2895 ret->is_owned = false;
2899 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1own_1channel_1config(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2900 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
2901 LDKChannelHandshakeConfig val_conv = *(LDKChannelHandshakeConfig*)val;
2903 val_conv.is_owned = true;
2904 return UserConfig_set_own_channel_config(this_ptr_conv, val_conv);
2907 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1peer_1channel_1config_1limits(JNIEnv * _env, jclass _b, jlong this_ptr) {
2908 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
2909 LDKChannelHandshakeLimits* ret = MALLOC(sizeof(LDKChannelHandshakeLimits), "LDKChannelHandshakeLimits");
2910 *ret = UserConfig_get_peer_channel_config_limits(this_ptr_conv);
2911 assert(ret->is_owned);
2912 ret->is_owned = false;
2916 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1peer_1channel_1config_1limits(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2917 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
2918 LDKChannelHandshakeLimits val_conv = *(LDKChannelHandshakeLimits*)val;
2920 val_conv.is_owned = true;
2921 return UserConfig_set_peer_channel_config_limits(this_ptr_conv, val_conv);
2924 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1channel_1options(JNIEnv * _env, jclass _b, jlong this_ptr) {
2925 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
2926 LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
2927 *ret = UserConfig_get_channel_options(this_ptr_conv);
2928 assert(ret->is_owned);
2929 ret->is_owned = false;
2933 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1channel_1options(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2934 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
2935 LDKChannelConfig val_conv = *(LDKChannelConfig*)val;
2937 val_conv.is_owned = true;
2938 return UserConfig_set_channel_options(this_ptr_conv, val_conv);
2941 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) {
2942 LDKChannelHandshakeConfig own_channel_config_arg_conv = *(LDKChannelHandshakeConfig*)own_channel_config_arg;
2943 FREE((void*)own_channel_config_arg);
2944 own_channel_config_arg_conv.is_owned = true;
2945 LDKChannelHandshakeLimits peer_channel_config_limits_arg_conv = *(LDKChannelHandshakeLimits*)peer_channel_config_limits_arg;
2946 FREE((void*)peer_channel_config_limits_arg);
2947 peer_channel_config_limits_arg_conv.is_owned = true;
2948 LDKChannelConfig channel_options_arg_conv = *(LDKChannelConfig*)channel_options_arg;
2949 FREE((void*)channel_options_arg);
2950 channel_options_arg_conv.is_owned = true;
2951 LDKUserConfig* ret = MALLOC(sizeof(LDKUserConfig), "LDKUserConfig");
2952 *ret = UserConfig_new(own_channel_config_arg_conv, peer_channel_config_limits_arg_conv, channel_options_arg_conv);
2953 assert(ret->is_owned);
2954 ret->is_owned = false;
2958 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1default(JNIEnv * _env, jclass _b) {
2959 LDKUserConfig* ret = MALLOC(sizeof(LDKUserConfig), "LDKUserConfig");
2960 *ret = UserConfig_default();
2961 assert(ret->is_owned);
2962 ret->is_owned = false;
2966 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Access_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2967 LDKAccess this_ptr_conv = *(LDKAccess*)this_ptr;
2968 FREE((void*)this_ptr);
2969 return Access_free(this_ptr_conv);
2972 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Watch_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2973 LDKWatch this_ptr_conv = *(LDKWatch*)this_ptr;
2974 FREE((void*)this_ptr);
2975 return Watch_free(this_ptr_conv);
2978 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2979 LDKFilter this_ptr_conv = *(LDKFilter*)this_ptr;
2980 FREE((void*)this_ptr);
2981 return Filter_free(this_ptr_conv);
2984 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2985 LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)this_ptr;
2986 FREE((void*)this_ptr);
2987 return BroadcasterInterface_free(this_ptr_conv);
2990 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2991 LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)this_ptr;
2992 FREE((void*)this_ptr);
2993 return FeeEstimator_free(this_ptr_conv);
2996 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2997 LDKChainMonitor this_ptr_conv = *(LDKChainMonitor*)this_ptr;
2998 FREE((void*)this_ptr);
2999 this_ptr_conv.is_owned = true;
3000 return ChainMonitor_free(this_ptr_conv);
3003 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1block_1connected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jlong txdata, jint height) {
3004 LDKChainMonitor* this_arg_conv = (LDKChainMonitor*)this_arg;
3005 unsigned char header_arr[80];
3006 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
3007 unsigned char (*header_ref)[80] = &header_arr;
3008 LDKCVec_C2Tuple_usizeTransactionZZ txdata_conv = *(LDKCVec_C2Tuple_usizeTransactionZZ*)txdata;
3009 FREE((void*)txdata);
3010 return ChainMonitor_block_connected(this_arg_conv, header_ref, txdata_conv, height);
3013 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1block_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jint disconnected_height) {
3014 LDKChainMonitor* this_arg_conv = (LDKChainMonitor*)this_arg;
3015 unsigned char header_arr[80];
3016 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
3017 unsigned char (*header_ref)[80] = &header_arr;
3018 return ChainMonitor_block_disconnected(this_arg_conv, header_ref, disconnected_height);
3021 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1new(JNIEnv * _env, jclass _b, jlong chain_source, jlong broadcaster, jlong logger, jlong feeest) {
3022 LDKFilter* chain_source_conv = (LDKFilter*)chain_source;
3023 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)broadcaster;
3024 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
3025 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3026 LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
3028 LDKLogger logger_conv = *(LDKLogger*)logger;
3029 if (logger_conv.free == LDKLogger_JCalls_free) {
3030 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3031 LDKLogger_JCalls_clone(logger_conv.this_arg);
3033 LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)feeest;
3034 if (feeest_conv.free == LDKFeeEstimator_JCalls_free) {
3035 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3036 LDKFeeEstimator_JCalls_clone(feeest_conv.this_arg);
3038 LDKChainMonitor* ret = MALLOC(sizeof(LDKChainMonitor), "LDKChainMonitor");
3039 *ret = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv);
3040 assert(ret->is_owned);
3041 ret->is_owned = false;
3045 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Watch(JNIEnv * _env, jclass _b, jlong this_arg) {
3046 LDKChainMonitor* this_arg_conv = (LDKChainMonitor*)this_arg;
3047 LDKWatch* ret = MALLOC(sizeof(LDKWatch), "LDKWatch");
3048 *ret = ChainMonitor_as_Watch(this_arg_conv);
3052 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1EventsProvider(JNIEnv * _env, jclass _b, jlong this_arg) {
3053 LDKChainMonitor* this_arg_conv = (LDKChainMonitor*)this_arg;
3054 LDKEventsProvider* ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
3055 *ret = ChainMonitor_as_EventsProvider(this_arg_conv);
3059 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3060 LDKChannelMonitorUpdate this_ptr_conv = *(LDKChannelMonitorUpdate*)this_ptr;
3061 FREE((void*)this_ptr);
3062 this_ptr_conv.is_owned = true;
3063 return ChannelMonitorUpdate_free(this_ptr_conv);
3066 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1get_1update_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3067 LDKChannelMonitorUpdate* this_ptr_conv = (LDKChannelMonitorUpdate*)this_ptr;
3068 return ChannelMonitorUpdate_get_update_id(this_ptr_conv);
3071 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1set_1update_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3072 LDKChannelMonitorUpdate* this_ptr_conv = (LDKChannelMonitorUpdate*)this_ptr;
3073 return ChannelMonitorUpdate_set_update_id(this_ptr_conv, val);
3076 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
3077 LDKChannelMonitorUpdate* obj_conv = (LDKChannelMonitorUpdate*)obj;
3078 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
3079 *ret = ChannelMonitorUpdate_write(obj_conv);
3083 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
3084 LDKu8slice ser_conv = *(LDKu8slice*)ser;
3086 LDKChannelMonitorUpdate* ret = MALLOC(sizeof(LDKChannelMonitorUpdate), "LDKChannelMonitorUpdate");
3087 *ret = ChannelMonitorUpdate_read(ser_conv);
3088 assert(ret->is_owned);
3089 ret->is_owned = false;
3093 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3094 LDKMonitorUpdateError this_ptr_conv = *(LDKMonitorUpdateError*)this_ptr;
3095 FREE((void*)this_ptr);
3096 this_ptr_conv.is_owned = true;
3097 return MonitorUpdateError_free(this_ptr_conv);
3100 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3101 LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)this_ptr;
3102 FREE((void*)this_ptr);
3103 this_ptr_conv.is_owned = true;
3104 return MonitorEvent_free(this_ptr_conv);
3107 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3108 LDKHTLCUpdate this_ptr_conv = *(LDKHTLCUpdate*)this_ptr;
3109 FREE((void*)this_ptr);
3110 this_ptr_conv.is_owned = true;
3111 return HTLCUpdate_free(this_ptr_conv);
3114 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
3115 LDKHTLCUpdate* obj_conv = (LDKHTLCUpdate*)obj;
3116 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
3117 *ret = HTLCUpdate_write(obj_conv);
3121 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
3122 LDKu8slice ser_conv = *(LDKu8slice*)ser;
3124 LDKHTLCUpdate* ret = MALLOC(sizeof(LDKHTLCUpdate), "LDKHTLCUpdate");
3125 *ret = HTLCUpdate_read(ser_conv);
3126 assert(ret->is_owned);
3127 ret->is_owned = false;
3131 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3132 LDKChannelMonitor this_ptr_conv = *(LDKChannelMonitor*)this_ptr;
3133 FREE((void*)this_ptr);
3134 this_ptr_conv.is_owned = true;
3135 return ChannelMonitor_free(this_ptr_conv);
3138 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1update_1monitor(JNIEnv * _env, jclass _b, jlong this_arg, jlong updates, jlong broadcaster, jlong logger) {
3139 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
3140 LDKChannelMonitorUpdate updates_conv = *(LDKChannelMonitorUpdate*)updates;
3141 FREE((void*)updates);
3142 updates_conv.is_owned = true;
3143 LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster;
3144 LDKLogger* logger_conv = (LDKLogger*)logger;
3145 LDKCResult_NoneMonitorUpdateErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
3146 *ret = ChannelMonitor_update_monitor(this_arg_conv, updates_conv, broadcaster_conv, logger_conv);
3150 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1update_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
3151 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
3152 return ChannelMonitor_get_latest_update_id(this_arg_conv);
3155 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1funding_1txo(JNIEnv * _env, jclass _b, jlong this_arg) {
3156 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
3157 LDKC2Tuple_OutPointScriptZ* ret = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
3158 *ret = ChannelMonitor_get_funding_txo(this_arg_conv);
3162 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1monitor_1events(JNIEnv * _env, jclass _b, jlong this_arg) {
3163 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
3164 LDKCVec_MonitorEventZ* ret = MALLOC(sizeof(LDKCVec_MonitorEventZ), "LDKCVec_MonitorEventZ");
3165 *ret = ChannelMonitor_get_and_clear_pending_monitor_events(this_arg_conv);
3169 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1events(JNIEnv * _env, jclass _b, jlong this_arg) {
3170 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
3171 LDKCVec_EventZ* ret = MALLOC(sizeof(LDKCVec_EventZ), "LDKCVec_EventZ");
3172 *ret = ChannelMonitor_get_and_clear_pending_events(this_arg_conv);
3176 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1holder_1commitment_1txn(JNIEnv * _env, jclass _b, jlong this_arg, jlong logger) {
3177 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
3178 LDKLogger* logger_conv = (LDKLogger*)logger;
3179 LDKCVec_TransactionZ* ret = MALLOC(sizeof(LDKCVec_TransactionZ), "LDKCVec_TransactionZ");
3180 *ret = ChannelMonitor_get_latest_holder_commitment_txn(this_arg_conv, logger_conv);
3184 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) {
3185 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
3186 unsigned char header_arr[80];
3187 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
3188 unsigned char (*header_ref)[80] = &header_arr;
3189 LDKCVec_C2Tuple_usizeTransactionZZ txdata_conv = *(LDKCVec_C2Tuple_usizeTransactionZZ*)txdata;
3190 FREE((void*)txdata);
3191 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)broadcaster;
3192 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
3193 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3194 LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
3196 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)fee_estimator;
3197 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
3198 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3199 LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
3201 LDKLogger logger_conv = *(LDKLogger*)logger;
3202 if (logger_conv.free == LDKLogger_JCalls_free) {
3203 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3204 LDKLogger_JCalls_clone(logger_conv.this_arg);
3206 LDKCVec_C2Tuple_TxidCVec_TxOutZZZ* ret = MALLOC(sizeof(LDKCVec_C2Tuple_TxidCVec_TxOutZZZ), "LDKCVec_C2Tuple_TxidCVec_TxOutZZZ");
3207 *ret = ChannelMonitor_block_connected(this_arg_conv, header_ref, txdata_conv, height, broadcaster_conv, fee_estimator_conv, logger_conv);
3211 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) {
3212 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
3213 unsigned char header_arr[80];
3214 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
3215 unsigned char (*header_ref)[80] = &header_arr;
3216 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)broadcaster;
3217 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
3218 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3219 LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
3221 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)fee_estimator;
3222 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
3223 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3224 LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
3226 LDKLogger logger_conv = *(LDKLogger*)logger;
3227 if (logger_conv.free == LDKLogger_JCalls_free) {
3228 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3229 LDKLogger_JCalls_clone(logger_conv.this_arg);
3231 return ChannelMonitor_block_disconnected(this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
3234 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3235 LDKOutPoint this_ptr_conv = *(LDKOutPoint*)this_ptr;
3236 FREE((void*)this_ptr);
3237 this_ptr_conv.is_owned = true;
3238 return OutPoint_free(this_ptr_conv);
3241 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1txid(JNIEnv * _env, jclass _b, jlong this_ptr) {
3242 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
3243 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3244 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OutPoint_get_txid(this_ptr_conv));
3248 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1txid(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3249 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
3250 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3252 return OutPoint_set_txid(this_ptr_conv, val_conv);
3255 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1index(JNIEnv * _env, jclass _b, jlong this_ptr) {
3256 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
3257 return OutPoint_get_index(this_ptr_conv);
3260 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1index(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3261 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
3262 return OutPoint_set_index(this_ptr_conv, val);
3265 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1new(JNIEnv * _env, jclass _b, jlong txid_arg, jshort index_arg) {
3266 LDKThirtyTwoBytes txid_arg_conv = *(LDKThirtyTwoBytes*)txid_arg;
3267 FREE((void*)txid_arg);
3268 LDKOutPoint* ret = MALLOC(sizeof(LDKOutPoint), "LDKOutPoint");
3269 *ret = OutPoint_new(txid_arg_conv, index_arg);
3270 assert(ret->is_owned);
3271 ret->is_owned = false;
3275 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1to_1channel_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
3276 LDKOutPoint* this_arg_conv = (LDKOutPoint*)this_arg;
3277 LDKThirtyTwoBytes* ret = MALLOC(sizeof(LDKThirtyTwoBytes), "LDKThirtyTwoBytes");
3278 *ret = OutPoint_to_channel_id(this_arg_conv);
3282 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1write(JNIEnv * _env, jclass _b, jlong obj) {
3283 LDKOutPoint* obj_conv = (LDKOutPoint*)obj;
3284 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
3285 *ret = OutPoint_write(obj_conv);
3289 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1read(JNIEnv * _env, jclass _b, jlong ser) {
3290 LDKu8slice ser_conv = *(LDKu8slice*)ser;
3292 LDKOutPoint* ret = MALLOC(sizeof(LDKOutPoint), "LDKOutPoint");
3293 *ret = OutPoint_read(ser_conv);
3294 assert(ret->is_owned);
3295 ret->is_owned = false;
3299 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3300 LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)this_ptr;
3301 FREE((void*)this_ptr);
3302 return SpendableOutputDescriptor_free(this_ptr_conv);
3305 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3306 LDKChannelKeys this_ptr_conv = *(LDKChannelKeys*)this_ptr;
3307 FREE((void*)this_ptr);
3308 return ChannelKeys_free(this_ptr_conv);
3311 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysInterface_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3312 LDKKeysInterface this_ptr_conv = *(LDKKeysInterface*)this_ptr;
3313 FREE((void*)this_ptr);
3314 return KeysInterface_free(this_ptr_conv);
3317 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3318 LDKInMemoryChannelKeys this_ptr_conv = *(LDKInMemoryChannelKeys*)this_ptr;
3319 FREE((void*)this_ptr);
3320 this_ptr_conv.is_owned = true;
3321 return InMemoryChannelKeys_free(this_ptr_conv);
3324 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1funding_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
3325 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
3326 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3327 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_funding_key(this_ptr_conv));
3331 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1funding_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3332 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
3333 LDKSecretKey val_conv = *(LDKSecretKey*)val;
3335 return InMemoryChannelKeys_set_funding_key(this_ptr_conv, val_conv);
3338 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1revocation_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
3339 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
3340 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3341 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_revocation_base_key(this_ptr_conv));
3345 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1revocation_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3346 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
3347 LDKSecretKey val_conv = *(LDKSecretKey*)val;
3349 return InMemoryChannelKeys_set_revocation_base_key(this_ptr_conv, val_conv);
3352 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
3353 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
3354 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3355 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_payment_key(this_ptr_conv));
3359 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3360 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
3361 LDKSecretKey val_conv = *(LDKSecretKey*)val;
3363 return InMemoryChannelKeys_set_payment_key(this_ptr_conv, val_conv);
3366 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1delayed_1payment_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
3367 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
3368 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3369 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_delayed_payment_base_key(this_ptr_conv));
3373 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1delayed_1payment_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3374 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
3375 LDKSecretKey val_conv = *(LDKSecretKey*)val;
3377 return InMemoryChannelKeys_set_delayed_payment_base_key(this_ptr_conv, val_conv);
3380 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1htlc_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
3381 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
3382 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3383 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_htlc_base_key(this_ptr_conv));
3387 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1htlc_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3388 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
3389 LDKSecretKey val_conv = *(LDKSecretKey*)val;
3391 return InMemoryChannelKeys_set_htlc_base_key(this_ptr_conv, val_conv);
3394 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1commitment_1seed(JNIEnv * _env, jclass _b, jlong this_ptr) {
3395 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
3396 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3397 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_commitment_seed(this_ptr_conv));
3401 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1commitment_1seed(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3402 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
3403 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3405 return InMemoryChannelKeys_set_commitment_seed(this_ptr_conv, val_conv);
3408 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) {
3409 LDKSecretKey funding_key_conv = *(LDKSecretKey*)funding_key;
3410 FREE((void*)funding_key);
3411 LDKSecretKey revocation_base_key_conv = *(LDKSecretKey*)revocation_base_key;
3412 FREE((void*)revocation_base_key);
3413 LDKSecretKey payment_key_conv = *(LDKSecretKey*)payment_key;
3414 FREE((void*)payment_key);
3415 LDKSecretKey delayed_payment_base_key_conv = *(LDKSecretKey*)delayed_payment_base_key;
3416 FREE((void*)delayed_payment_base_key);
3417 LDKSecretKey htlc_base_key_conv = *(LDKSecretKey*)htlc_base_key;
3418 FREE((void*)htlc_base_key);
3419 LDKThirtyTwoBytes commitment_seed_conv = *(LDKThirtyTwoBytes*)commitment_seed;
3420 FREE((void*)commitment_seed);
3421 LDKC2Tuple_u64u64Z key_derivation_params_conv = *(LDKC2Tuple_u64u64Z*)key_derivation_params;
3422 FREE((void*)key_derivation_params);
3423 LDKInMemoryChannelKeys* ret = MALLOC(sizeof(LDKInMemoryChannelKeys), "LDKInMemoryChannelKeys");
3424 *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);
3425 assert(ret->is_owned);
3426 ret->is_owned = false;
3430 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1counterparty_1pubkeys(JNIEnv * _env, jclass _b, jlong this_arg) {
3431 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
3432 LDKChannelPublicKeys* ret = MALLOC(sizeof(LDKChannelPublicKeys), "LDKChannelPublicKeys");
3433 *ret = InMemoryChannelKeys_counterparty_pubkeys(this_arg_conv);
3434 assert(ret->is_owned);
3435 ret->is_owned = false;
3439 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1counterparty_1selected_1contest_1delay(JNIEnv * _env, jclass _b, jlong this_arg) {
3440 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
3441 return InMemoryChannelKeys_counterparty_selected_contest_delay(this_arg_conv);
3444 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1holder_1selected_1contest_1delay(JNIEnv * _env, jclass _b, jlong this_arg) {
3445 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
3446 return InMemoryChannelKeys_holder_selected_contest_delay(this_arg_conv);
3449 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1as_1ChannelKeys(JNIEnv * _env, jclass _b, jlong this_arg) {
3450 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
3451 LDKChannelKeys* ret = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys");
3452 *ret = InMemoryChannelKeys_as_ChannelKeys(this_arg_conv);
3456 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1write(JNIEnv * _env, jclass _b, jlong obj) {
3457 LDKInMemoryChannelKeys* obj_conv = (LDKInMemoryChannelKeys*)obj;
3458 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
3459 *ret = InMemoryChannelKeys_write(obj_conv);
3463 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1read(JNIEnv * _env, jclass _b, jlong ser) {
3464 LDKu8slice ser_conv = *(LDKu8slice*)ser;
3466 LDKInMemoryChannelKeys* ret = MALLOC(sizeof(LDKInMemoryChannelKeys), "LDKInMemoryChannelKeys");
3467 *ret = InMemoryChannelKeys_read(ser_conv);
3468 assert(ret->is_owned);
3469 ret->is_owned = false;
3473 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysManager_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3474 LDKKeysManager this_ptr_conv = *(LDKKeysManager*)this_ptr;
3475 FREE((void*)this_ptr);
3476 this_ptr_conv.is_owned = true;
3477 return KeysManager_free(this_ptr_conv);
3480 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) {
3481 unsigned char seed_arr[32];
3482 (*_env)->GetByteArrayRegion (_env, seed, 0, 32, seed_arr);
3483 unsigned char (*seed_ref)[32] = &seed_arr;
3484 LDKNetwork network_conv = LDKNetwork_from_java(_env, network);
3485 LDKKeysManager* ret = MALLOC(sizeof(LDKKeysManager), "LDKKeysManager");
3486 *ret = KeysManager_new(seed_ref, network_conv, starting_time_secs, starting_time_nanos);
3487 assert(ret->is_owned);
3488 ret->is_owned = false;
3492 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) {
3493 LDKKeysManager* this_arg_conv = (LDKKeysManager*)this_arg;
3494 LDKInMemoryChannelKeys* ret = MALLOC(sizeof(LDKInMemoryChannelKeys), "LDKInMemoryChannelKeys");
3495 *ret = KeysManager_derive_channel_keys(this_arg_conv, channel_value_satoshis, params_1, params_2);
3496 assert(ret->is_owned);
3497 ret->is_owned = false;
3501 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1KeysInterface(JNIEnv * _env, jclass _b, jlong this_arg) {
3502 LDKKeysManager* this_arg_conv = (LDKKeysManager*)this_arg;
3503 LDKKeysInterface* ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
3504 *ret = KeysManager_as_KeysInterface(this_arg_conv);
3508 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3509 LDKChannelManager this_ptr_conv = *(LDKChannelManager*)this_ptr;
3510 FREE((void*)this_ptr);
3511 this_ptr_conv.is_owned = true;
3512 return ChannelManager_free(this_ptr_conv);
3515 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3516 LDKChannelDetails this_ptr_conv = *(LDKChannelDetails*)this_ptr;
3517 FREE((void*)this_ptr);
3518 this_ptr_conv.is_owned = true;
3519 return ChannelDetails_free(this_ptr_conv);
3522 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3523 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
3524 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3525 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ChannelDetails_get_channel_id(this_ptr_conv));
3529 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3530 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
3531 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3533 return ChannelDetails_set_channel_id(this_ptr_conv, val_conv);
3536 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1remote_1network_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3537 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
3538 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3539 *ret = ChannelDetails_get_remote_network_id(this_ptr_conv);
3543 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1remote_1network_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3544 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
3545 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3547 return ChannelDetails_set_remote_network_id(this_ptr_conv, val_conv);
3550 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1counterparty_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
3551 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
3552 LDKInitFeatures* ret = MALLOC(sizeof(LDKInitFeatures), "LDKInitFeatures");
3553 *ret = ChannelDetails_get_counterparty_features(this_ptr_conv);
3554 assert(ret->is_owned);
3555 ret->is_owned = false;
3559 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1counterparty_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3560 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
3561 LDKInitFeatures val_conv = *(LDKInitFeatures*)val;
3563 val_conv.is_owned = true;
3564 return ChannelDetails_set_counterparty_features(this_ptr_conv, val_conv);
3567 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1value_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3568 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
3569 return ChannelDetails_get_channel_value_satoshis(this_ptr_conv);
3572 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1value_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3573 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
3574 return ChannelDetails_set_channel_value_satoshis(this_ptr_conv, val);
3577 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1user_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3578 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
3579 return ChannelDetails_get_user_id(this_ptr_conv);
3582 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1user_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3583 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
3584 return ChannelDetails_set_user_id(this_ptr_conv, val);
3587 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3588 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
3589 return ChannelDetails_get_outbound_capacity_msat(this_ptr_conv);
3592 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1outbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3593 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
3594 return ChannelDetails_set_outbound_capacity_msat(this_ptr_conv, val);
3597 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3598 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
3599 return ChannelDetails_get_inbound_capacity_msat(this_ptr_conv);
3602 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3603 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
3604 return ChannelDetails_set_inbound_capacity_msat(this_ptr_conv, val);
3607 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1live(JNIEnv * _env, jclass _b, jlong this_ptr) {
3608 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
3609 return ChannelDetails_get_is_live(this_ptr_conv);
3612 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1live(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
3613 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
3614 return ChannelDetails_set_is_live(this_ptr_conv, val);
3617 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3618 LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)this_ptr;
3619 FREE((void*)this_ptr);
3620 this_ptr_conv.is_owned = true;
3621 return PaymentSendFailure_free(this_ptr_conv);
3624 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) {
3625 LDKNetwork network_conv = LDKNetwork_from_java(_env, network);
3626 LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)fee_est;
3627 if (fee_est_conv.free == LDKFeeEstimator_JCalls_free) {
3628 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3629 LDKFeeEstimator_JCalls_clone(fee_est_conv.this_arg);
3631 LDKWatch chain_monitor_conv = *(LDKWatch*)chain_monitor;
3632 if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
3633 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3634 LDKWatch_JCalls_clone(chain_monitor_conv.this_arg);
3636 LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)tx_broadcaster;
3637 if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
3638 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3639 LDKBroadcasterInterface_JCalls_clone(tx_broadcaster_conv.this_arg);
3641 LDKLogger logger_conv = *(LDKLogger*)logger;
3642 if (logger_conv.free == LDKLogger_JCalls_free) {
3643 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3644 LDKLogger_JCalls_clone(logger_conv.this_arg);
3646 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)keys_manager;
3647 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
3648 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3649 LDKKeysInterface_JCalls_clone(keys_manager_conv.this_arg);
3651 LDKUserConfig config_conv = *(LDKUserConfig*)config;
3652 FREE((void*)config);
3653 config_conv.is_owned = true;
3654 LDKChannelManager* ret = MALLOC(sizeof(LDKChannelManager), "LDKChannelManager");
3655 *ret = ChannelManager_new(network_conv, fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, keys_manager_conv, config_conv, current_blockchain_height);
3656 assert(ret->is_owned);
3657 ret->is_owned = false;
3661 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) {
3662 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3663 LDKPublicKey their_network_key_conv = *(LDKPublicKey*)their_network_key;
3664 FREE((void*)their_network_key);
3665 LDKUserConfig override_config_conv = *(LDKUserConfig*)override_config;
3666 FREE((void*)override_config);
3667 override_config_conv.is_owned = true;
3668 LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
3669 *ret = ChannelManager_create_channel(this_arg_conv, their_network_key_conv, channel_value_satoshis, push_msat, user_id, override_config_conv);
3673 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
3674 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3675 LDKCVec_ChannelDetailsZ* ret = MALLOC(sizeof(LDKCVec_ChannelDetailsZ), "LDKCVec_ChannelDetailsZ");
3676 *ret = ChannelManager_list_channels(this_arg_conv);
3680 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1usable_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
3681 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3682 LDKCVec_ChannelDetailsZ* ret = MALLOC(sizeof(LDKCVec_ChannelDetailsZ), "LDKCVec_ChannelDetailsZ");
3683 *ret = ChannelManager_list_usable_channels(this_arg_conv);
3687 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray channel_id) {
3688 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3689 unsigned char channel_id_arr[32];
3690 (*_env)->GetByteArrayRegion (_env, channel_id, 0, 32, channel_id_arr);
3691 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
3692 LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
3693 *ret = ChannelManager_close_channel(this_arg_conv, channel_id_ref);
3697 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray channel_id) {
3698 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3699 unsigned char channel_id_arr[32];
3700 (*_env)->GetByteArrayRegion (_env, channel_id, 0, 32, channel_id_arr);
3701 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
3702 return ChannelManager_force_close_channel(this_arg_conv, channel_id_ref);
3705 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1all_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
3706 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3707 return ChannelManager_force_close_all_channels(this_arg_conv);
3710 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) {
3711 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3712 LDKRoute* route_conv = (LDKRoute*)route;
3713 LDKThirtyTwoBytes payment_hash_conv = *(LDKThirtyTwoBytes*)payment_hash;
3714 FREE((void*)payment_hash);
3715 LDKThirtyTwoBytes payment_secret_conv = *(LDKThirtyTwoBytes*)payment_secret;
3716 FREE((void*)payment_secret);
3717 LDKCResult_NonePaymentSendFailureZ* ret = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
3718 *ret = ChannelManager_send_payment(this_arg_conv, route_conv, payment_hash_conv, payment_secret_conv);
3722 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) {
3723 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3724 unsigned char temporary_channel_id_arr[32];
3725 (*_env)->GetByteArrayRegion (_env, temporary_channel_id, 0, 32, temporary_channel_id_arr);
3726 unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
3727 LDKOutPoint funding_txo_conv = *(LDKOutPoint*)funding_txo;
3728 FREE((void*)funding_txo);
3729 funding_txo_conv.is_owned = true;
3730 return ChannelManager_funding_transaction_generated(this_arg_conv, temporary_channel_id_ref, funding_txo_conv);
3733 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) {
3734 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3735 LDKThreeBytes rgb_conv = *(LDKThreeBytes*)rgb;
3737 LDKThirtyTwoBytes alias_conv = *(LDKThirtyTwoBytes*)alias;
3739 LDKCVec_NetAddressZ addresses_conv = *(LDKCVec_NetAddressZ*)addresses;
3740 FREE((void*)addresses);
3741 return ChannelManager_broadcast_node_announcement(this_arg_conv, rgb_conv, alias_conv, addresses_conv);
3744 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1process_1pending_1htlc_1forwards(JNIEnv * _env, jclass _b, jlong this_arg) {
3745 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3746 return ChannelManager_process_pending_htlc_forwards(this_arg_conv);
3749 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1timer_1chan_1freshness_1every_1min(JNIEnv * _env, jclass _b, jlong this_arg) {
3750 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3751 return ChannelManager_timer_chan_freshness_every_min(this_arg_conv);
3754 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) {
3755 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3756 unsigned char payment_hash_arr[32];
3757 (*_env)->GetByteArrayRegion (_env, payment_hash, 0, 32, payment_hash_arr);
3758 unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
3759 LDKThirtyTwoBytes payment_secret_conv = *(LDKThirtyTwoBytes*)payment_secret;
3760 FREE((void*)payment_secret);
3761 return ChannelManager_fail_htlc_backwards(this_arg_conv, payment_hash_ref, payment_secret_conv);
3764 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) {
3765 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3766 LDKThirtyTwoBytes payment_preimage_conv = *(LDKThirtyTwoBytes*)payment_preimage;
3767 FREE((void*)payment_preimage);
3768 LDKThirtyTwoBytes payment_secret_conv = *(LDKThirtyTwoBytes*)payment_secret;
3769 FREE((void*)payment_secret);
3770 return ChannelManager_claim_funds(this_arg_conv, payment_preimage_conv, payment_secret_conv, expected_amount);
3773 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1our_1node_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
3774 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3775 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3776 *ret = ChannelManager_get_our_node_id(this_arg_conv);
3780 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) {
3781 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3782 LDKOutPoint* funding_txo_conv = (LDKOutPoint*)funding_txo;
3783 return ChannelManager_channel_monitor_updated(this_arg_conv, funding_txo_conv, highest_applied_update_id);
3786 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1MessageSendEventsProvider(JNIEnv * _env, jclass _b, jlong this_arg) {
3787 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3788 LDKMessageSendEventsProvider* ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
3789 *ret = ChannelManager_as_MessageSendEventsProvider(this_arg_conv);
3793 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1EventsProvider(JNIEnv * _env, jclass _b, jlong this_arg) {
3794 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3795 LDKEventsProvider* ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
3796 *ret = ChannelManager_as_EventsProvider(this_arg_conv);
3800 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1block_1connected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jlong txdata, jint height) {
3801 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3802 unsigned char header_arr[80];
3803 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
3804 unsigned char (*header_ref)[80] = &header_arr;
3805 LDKCVec_C2Tuple_usizeTransactionZZ txdata_conv = *(LDKCVec_C2Tuple_usizeTransactionZZ*)txdata;
3806 FREE((void*)txdata);
3807 return ChannelManager_block_connected(this_arg_conv, header_ref, txdata_conv, height);
3810 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1block_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header) {
3811 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3812 unsigned char header_arr[80];
3813 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
3814 unsigned char (*header_ref)[80] = &header_arr;
3815 return ChannelManager_block_disconnected(this_arg_conv, header_ref);
3818 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1ChannelMessageHandler(JNIEnv * _env, jclass _b, jlong this_arg) {
3819 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3820 LDKChannelMessageHandler* ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
3821 *ret = ChannelManager_as_ChannelMessageHandler(this_arg_conv);
3825 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3826 LDKChannelManagerReadArgs this_ptr_conv = *(LDKChannelManagerReadArgs*)this_ptr;
3827 FREE((void*)this_ptr);
3828 this_ptr_conv.is_owned = true;
3829 return ChannelManagerReadArgs_free(this_ptr_conv);
3832 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1keys_1manager(JNIEnv * _env, jclass _b, jlong this_ptr) {
3833 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3834 long ret = (long)ChannelManagerReadArgs_get_keys_manager(this_ptr_conv);
3838 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1keys_1manager(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3839 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3840 LDKKeysInterface val_conv = *(LDKKeysInterface*)val;
3841 if (val_conv.free == LDKKeysInterface_JCalls_free) {
3842 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3843 LDKKeysInterface_JCalls_clone(val_conv.this_arg);
3845 return ChannelManagerReadArgs_set_keys_manager(this_ptr_conv, val_conv);
3848 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1fee_1estimator(JNIEnv * _env, jclass _b, jlong this_ptr) {
3849 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3850 long ret = (long)ChannelManagerReadArgs_get_fee_estimator(this_ptr_conv);
3854 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1fee_1estimator(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3855 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3856 LDKFeeEstimator val_conv = *(LDKFeeEstimator*)val;
3857 if (val_conv.free == LDKFeeEstimator_JCalls_free) {
3858 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3859 LDKFeeEstimator_JCalls_clone(val_conv.this_arg);
3861 return ChannelManagerReadArgs_set_fee_estimator(this_ptr_conv, val_conv);
3864 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1chain_1monitor(JNIEnv * _env, jclass _b, jlong this_ptr) {
3865 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3866 long ret = (long)ChannelManagerReadArgs_get_chain_monitor(this_ptr_conv);
3870 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1chain_1monitor(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3871 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3872 LDKWatch val_conv = *(LDKWatch*)val;
3873 if (val_conv.free == LDKWatch_JCalls_free) {
3874 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3875 LDKWatch_JCalls_clone(val_conv.this_arg);
3877 return ChannelManagerReadArgs_set_chain_monitor(this_ptr_conv, val_conv);
3880 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1tx_1broadcaster(JNIEnv * _env, jclass _b, jlong this_ptr) {
3881 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3882 long ret = (long)ChannelManagerReadArgs_get_tx_broadcaster(this_ptr_conv);
3886 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1tx_1broadcaster(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3887 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3888 LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)val;
3889 if (val_conv.free == LDKBroadcasterInterface_JCalls_free) {
3890 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3891 LDKBroadcasterInterface_JCalls_clone(val_conv.this_arg);
3893 return ChannelManagerReadArgs_set_tx_broadcaster(this_ptr_conv, val_conv);
3896 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1logger(JNIEnv * _env, jclass _b, jlong this_ptr) {
3897 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3898 long ret = (long)ChannelManagerReadArgs_get_logger(this_ptr_conv);
3902 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1logger(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3903 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3904 LDKLogger val_conv = *(LDKLogger*)val;
3905 if (val_conv.free == LDKLogger_JCalls_free) {
3906 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3907 LDKLogger_JCalls_clone(val_conv.this_arg);
3909 return ChannelManagerReadArgs_set_logger(this_ptr_conv, val_conv);
3912 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1default_1config(JNIEnv * _env, jclass _b, jlong this_ptr) {
3913 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3914 LDKUserConfig* ret = MALLOC(sizeof(LDKUserConfig), "LDKUserConfig");
3915 *ret = ChannelManagerReadArgs_get_default_config(this_ptr_conv);
3916 assert(ret->is_owned);
3917 ret->is_owned = false;
3921 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1default_1config(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3922 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3923 LDKUserConfig val_conv = *(LDKUserConfig*)val;
3925 val_conv.is_owned = true;
3926 return ChannelManagerReadArgs_set_default_config(this_ptr_conv, val_conv);
3929 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) {
3930 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)keys_manager;
3931 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
3932 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3933 LDKKeysInterface_JCalls_clone(keys_manager_conv.this_arg);
3935 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)fee_estimator;
3936 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
3937 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3938 LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
3940 LDKWatch chain_monitor_conv = *(LDKWatch*)chain_monitor;
3941 if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
3942 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3943 LDKWatch_JCalls_clone(chain_monitor_conv.this_arg);
3945 LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)tx_broadcaster;
3946 if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
3947 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3948 LDKBroadcasterInterface_JCalls_clone(tx_broadcaster_conv.this_arg);
3950 LDKLogger logger_conv = *(LDKLogger*)logger;
3951 if (logger_conv.free == LDKLogger_JCalls_free) {
3952 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3953 LDKLogger_JCalls_clone(logger_conv.this_arg);
3955 LDKUserConfig default_config_conv = *(LDKUserConfig*)default_config;
3956 FREE((void*)default_config);
3957 default_config_conv.is_owned = true;
3958 LDKCVec_ChannelMonitorZ channel_monitors_conv = *(LDKCVec_ChannelMonitorZ*)channel_monitors;
3959 FREE((void*)channel_monitors);
3960 LDKChannelManagerReadArgs* ret = MALLOC(sizeof(LDKChannelManagerReadArgs), "LDKChannelManagerReadArgs");
3961 *ret = ChannelManagerReadArgs_new(keys_manager_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, default_config_conv, channel_monitors_conv);
3962 assert(ret->is_owned);
3963 ret->is_owned = false;
3967 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DecodeError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3968 LDKDecodeError this_ptr_conv = *(LDKDecodeError*)this_ptr;
3969 FREE((void*)this_ptr);
3970 this_ptr_conv.is_owned = true;
3971 return DecodeError_free(this_ptr_conv);
3974 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3975 LDKInit this_ptr_conv = *(LDKInit*)this_ptr;
3976 FREE((void*)this_ptr);
3977 this_ptr_conv.is_owned = true;
3978 return Init_free(this_ptr_conv);
3981 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3982 LDKErrorMessage this_ptr_conv = *(LDKErrorMessage*)this_ptr;
3983 FREE((void*)this_ptr);
3984 this_ptr_conv.is_owned = true;
3985 return ErrorMessage_free(this_ptr_conv);
3988 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3989 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
3990 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3991 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ErrorMessage_get_channel_id(this_ptr_conv));
3995 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3996 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
3997 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3999 return ErrorMessage_set_channel_id(this_ptr_conv, val_conv);
4002 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1data(JNIEnv * _env, jclass _b, jlong this_ptr) {
4003 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
4004 LDKStr* ret = MALLOC(sizeof(LDKStr), "LDKStr");
4005 *ret = ErrorMessage_get_data(this_ptr_conv);
4009 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1data(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4010 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
4011 LDKCVec_u8Z val_conv = *(LDKCVec_u8Z*)val;
4013 return ErrorMessage_set_data(this_ptr_conv, val_conv);
4016 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong data_arg) {
4017 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4018 FREE((void*)channel_id_arg);
4019 LDKCVec_u8Z data_arg_conv = *(LDKCVec_u8Z*)data_arg;
4020 FREE((void*)data_arg);
4021 LDKErrorMessage* ret = MALLOC(sizeof(LDKErrorMessage), "LDKErrorMessage");
4022 *ret = ErrorMessage_new(channel_id_arg_conv, data_arg_conv);
4023 assert(ret->is_owned);
4024 ret->is_owned = false;
4028 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4029 LDKPing this_ptr_conv = *(LDKPing*)this_ptr;
4030 FREE((void*)this_ptr);
4031 this_ptr_conv.is_owned = true;
4032 return Ping_free(this_ptr_conv);
4035 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Ping_1get_1ponglen(JNIEnv * _env, jclass _b, jlong this_ptr) {
4036 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
4037 return Ping_get_ponglen(this_ptr_conv);
4040 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1ponglen(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
4041 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
4042 return Ping_set_ponglen(this_ptr_conv, val);
4045 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Ping_1get_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr) {
4046 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
4047 return Ping_get_byteslen(this_ptr_conv);
4050 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
4051 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
4052 return Ping_set_byteslen(this_ptr_conv, val);
4055 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1new(JNIEnv * _env, jclass _b, jshort ponglen_arg, jshort byteslen_arg) {
4056 LDKPing* ret = MALLOC(sizeof(LDKPing), "LDKPing");
4057 *ret = Ping_new(ponglen_arg, byteslen_arg);
4058 assert(ret->is_owned);
4059 ret->is_owned = false;
4063 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4064 LDKPong this_ptr_conv = *(LDKPong*)this_ptr;
4065 FREE((void*)this_ptr);
4066 this_ptr_conv.is_owned = true;
4067 return Pong_free(this_ptr_conv);
4070 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Pong_1get_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr) {
4071 LDKPong* this_ptr_conv = (LDKPong*)this_ptr;
4072 return Pong_get_byteslen(this_ptr_conv);
4075 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1set_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
4076 LDKPong* this_ptr_conv = (LDKPong*)this_ptr;
4077 return Pong_set_byteslen(this_ptr_conv, val);
4080 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1new(JNIEnv * _env, jclass _b, jshort byteslen_arg) {
4081 LDKPong* ret = MALLOC(sizeof(LDKPong), "LDKPong");
4082 *ret = Pong_new(byteslen_arg);
4083 assert(ret->is_owned);
4084 ret->is_owned = false;
4088 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4089 LDKOpenChannel this_ptr_conv = *(LDKOpenChannel*)this_ptr;
4090 FREE((void*)this_ptr);
4091 this_ptr_conv.is_owned = true;
4092 return OpenChannel_free(this_ptr_conv);
4095 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
4096 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4097 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4098 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OpenChannel_get_chain_hash(this_ptr_conv));
4102 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4103 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4104 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4106 return OpenChannel_set_chain_hash(this_ptr_conv, val_conv);
4109 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4110 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4111 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4112 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OpenChannel_get_temporary_channel_id(this_ptr_conv));
4116 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4117 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4118 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4120 return OpenChannel_set_temporary_channel_id(this_ptr_conv, val_conv);
4123 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
4124 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4125 return OpenChannel_get_funding_satoshis(this_ptr_conv);
4128 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4129 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4130 return OpenChannel_set_funding_satoshis(this_ptr_conv, val);
4133 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1push_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
4134 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4135 return OpenChannel_get_push_msat(this_ptr_conv);
4138 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1push_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4139 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4140 return OpenChannel_set_push_msat(this_ptr_conv, val);
4143 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
4144 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4145 return OpenChannel_get_dust_limit_satoshis(this_ptr_conv);
4148 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4149 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4150 return OpenChannel_set_dust_limit_satoshis(this_ptr_conv, val);
4153 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
4154 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4155 return OpenChannel_get_max_htlc_value_in_flight_msat(this_ptr_conv);
4158 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) {
4159 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4160 return OpenChannel_set_max_htlc_value_in_flight_msat(this_ptr_conv, val);
4163 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
4164 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4165 return OpenChannel_get_channel_reserve_satoshis(this_ptr_conv);
4168 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4169 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4170 return OpenChannel_set_channel_reserve_satoshis(this_ptr_conv, val);
4173 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
4174 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4175 return OpenChannel_get_htlc_minimum_msat(this_ptr_conv);
4178 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4179 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4180 return OpenChannel_set_htlc_minimum_msat(this_ptr_conv, val);
4183 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr) {
4184 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4185 return OpenChannel_get_feerate_per_kw(this_ptr_conv);
4188 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
4189 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4190 return OpenChannel_set_feerate_per_kw(this_ptr_conv, val);
4193 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
4194 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4195 return OpenChannel_get_to_self_delay(this_ptr_conv);
4198 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
4199 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4200 return OpenChannel_set_to_self_delay(this_ptr_conv, val);
4203 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr) {
4204 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4205 return OpenChannel_get_max_accepted_htlcs(this_ptr_conv);
4208 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
4209 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4210 return OpenChannel_set_max_accepted_htlcs(this_ptr_conv, val);
4213 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
4214 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4215 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4216 *ret = OpenChannel_get_funding_pubkey(this_ptr_conv);
4220 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4221 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4222 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4224 return OpenChannel_set_funding_pubkey(this_ptr_conv, val_conv);
4227 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
4228 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4229 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4230 *ret = OpenChannel_get_revocation_basepoint(this_ptr_conv);
4234 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4235 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4236 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4238 return OpenChannel_set_revocation_basepoint(this_ptr_conv, val_conv);
4241 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
4242 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4243 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4244 *ret = OpenChannel_get_payment_point(this_ptr_conv);
4248 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4249 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4250 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4252 return OpenChannel_set_payment_point(this_ptr_conv, val_conv);
4255 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
4256 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4257 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4258 *ret = OpenChannel_get_delayed_payment_basepoint(this_ptr_conv);
4262 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4263 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4264 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4266 return OpenChannel_set_delayed_payment_basepoint(this_ptr_conv, val_conv);
4269 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
4270 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4271 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4272 *ret = OpenChannel_get_htlc_basepoint(this_ptr_conv);
4276 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4277 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4278 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4280 return OpenChannel_set_htlc_basepoint(this_ptr_conv, val_conv);
4283 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
4284 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4285 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4286 *ret = OpenChannel_get_first_per_commitment_point(this_ptr_conv);
4290 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4291 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4292 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4294 return OpenChannel_set_first_per_commitment_point(this_ptr_conv, val_conv);
4297 JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1flags(JNIEnv * _env, jclass _b, jlong this_ptr) {
4298 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4299 return OpenChannel_get_channel_flags(this_ptr_conv);
4302 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1flags(JNIEnv * _env, jclass _b, jlong this_ptr, jbyte val) {
4303 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
4304 return OpenChannel_set_channel_flags(this_ptr_conv, val);
4307 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4308 LDKAcceptChannel this_ptr_conv = *(LDKAcceptChannel*)this_ptr;
4309 FREE((void*)this_ptr);
4310 this_ptr_conv.is_owned = true;
4311 return AcceptChannel_free(this_ptr_conv);
4314 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4315 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
4316 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4317 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *AcceptChannel_get_temporary_channel_id(this_ptr_conv));
4321 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4322 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
4323 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4325 return AcceptChannel_set_temporary_channel_id(this_ptr_conv, val_conv);
4328 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
4329 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
4330 return AcceptChannel_get_dust_limit_satoshis(this_ptr_conv);
4333 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4334 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
4335 return AcceptChannel_set_dust_limit_satoshis(this_ptr_conv, val);
4338 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
4339 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
4340 return AcceptChannel_get_max_htlc_value_in_flight_msat(this_ptr_conv);
4343 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4344 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
4345 return AcceptChannel_set_max_htlc_value_in_flight_msat(this_ptr_conv, val);
4348 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
4349 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
4350 return AcceptChannel_get_channel_reserve_satoshis(this_ptr_conv);
4353 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4354 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
4355 return AcceptChannel_set_channel_reserve_satoshis(this_ptr_conv, val);
4358 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
4359 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
4360 return AcceptChannel_get_htlc_minimum_msat(this_ptr_conv);
4363 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4364 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
4365 return AcceptChannel_set_htlc_minimum_msat(this_ptr_conv, val);
4368 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr) {
4369 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
4370 return AcceptChannel_get_minimum_depth(this_ptr_conv);
4373 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
4374 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
4375 return AcceptChannel_set_minimum_depth(this_ptr_conv, val);
4378 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
4379 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
4380 return AcceptChannel_get_to_self_delay(this_ptr_conv);
4383 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
4384 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
4385 return AcceptChannel_set_to_self_delay(this_ptr_conv, val);
4388 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr) {
4389 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
4390 return AcceptChannel_get_max_accepted_htlcs(this_ptr_conv);
4393 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
4394 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
4395 return AcceptChannel_set_max_accepted_htlcs(this_ptr_conv, val);
4398 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
4399 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
4400 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4401 *ret = AcceptChannel_get_funding_pubkey(this_ptr_conv);
4405 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4406 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
4407 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4409 return AcceptChannel_set_funding_pubkey(this_ptr_conv, val_conv);
4412 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
4413 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
4414 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4415 *ret = AcceptChannel_get_revocation_basepoint(this_ptr_conv);
4419 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4420 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
4421 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4423 return AcceptChannel_set_revocation_basepoint(this_ptr_conv, val_conv);
4426 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
4427 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
4428 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4429 *ret = AcceptChannel_get_payment_point(this_ptr_conv);
4433 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4434 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
4435 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4437 return AcceptChannel_set_payment_point(this_ptr_conv, val_conv);
4440 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
4441 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
4442 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4443 *ret = AcceptChannel_get_delayed_payment_basepoint(this_ptr_conv);
4447 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4448 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
4449 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4451 return AcceptChannel_set_delayed_payment_basepoint(this_ptr_conv, val_conv);
4454 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
4455 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
4456 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4457 *ret = AcceptChannel_get_htlc_basepoint(this_ptr_conv);
4461 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4462 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
4463 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4465 return AcceptChannel_set_htlc_basepoint(this_ptr_conv, val_conv);
4468 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
4469 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
4470 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4471 *ret = AcceptChannel_get_first_per_commitment_point(this_ptr_conv);
4475 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4476 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
4477 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4479 return AcceptChannel_set_first_per_commitment_point(this_ptr_conv, val_conv);
4482 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4483 LDKFundingCreated this_ptr_conv = *(LDKFundingCreated*)this_ptr;
4484 FREE((void*)this_ptr);
4485 this_ptr_conv.is_owned = true;
4486 return FundingCreated_free(this_ptr_conv);
4489 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4490 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
4491 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4492 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingCreated_get_temporary_channel_id(this_ptr_conv));
4496 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4497 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
4498 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4500 return FundingCreated_set_temporary_channel_id(this_ptr_conv, val_conv);
4503 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1txid(JNIEnv * _env, jclass _b, jlong this_ptr) {
4504 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
4505 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4506 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingCreated_get_funding_txid(this_ptr_conv));
4510 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1txid(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4511 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
4512 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4514 return FundingCreated_set_funding_txid(this_ptr_conv, val_conv);
4517 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1output_1index(JNIEnv * _env, jclass _b, jlong this_ptr) {
4518 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
4519 return FundingCreated_get_funding_output_index(this_ptr_conv);
4522 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1output_1index(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
4523 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
4524 return FundingCreated_set_funding_output_index(this_ptr_conv, val);
4527 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
4528 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
4529 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4530 *ret = FundingCreated_get_signature(this_ptr_conv);
4534 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4535 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
4536 LDKSignature val_conv = *(LDKSignature*)val;
4538 return FundingCreated_set_signature(this_ptr_conv, val_conv);
4541 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1new(JNIEnv * _env, jclass _b, jlong temporary_channel_id_arg, jlong funding_txid_arg, jshort funding_output_index_arg, jlong signature_arg) {
4542 LDKThirtyTwoBytes temporary_channel_id_arg_conv = *(LDKThirtyTwoBytes*)temporary_channel_id_arg;
4543 FREE((void*)temporary_channel_id_arg);
4544 LDKThirtyTwoBytes funding_txid_arg_conv = *(LDKThirtyTwoBytes*)funding_txid_arg;
4545 FREE((void*)funding_txid_arg);
4546 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
4547 FREE((void*)signature_arg);
4548 LDKFundingCreated* ret = MALLOC(sizeof(LDKFundingCreated), "LDKFundingCreated");
4549 *ret = FundingCreated_new(temporary_channel_id_arg_conv, funding_txid_arg_conv, funding_output_index_arg, signature_arg_conv);
4550 assert(ret->is_owned);
4551 ret->is_owned = false;
4555 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4556 LDKFundingSigned this_ptr_conv = *(LDKFundingSigned*)this_ptr;
4557 FREE((void*)this_ptr);
4558 this_ptr_conv.is_owned = true;
4559 return FundingSigned_free(this_ptr_conv);
4562 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4563 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
4564 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4565 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingSigned_get_channel_id(this_ptr_conv));
4569 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4570 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
4571 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4573 return FundingSigned_set_channel_id(this_ptr_conv, val_conv);
4576 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
4577 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
4578 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4579 *ret = FundingSigned_get_signature(this_ptr_conv);
4583 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4584 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
4585 LDKSignature val_conv = *(LDKSignature*)val;
4587 return FundingSigned_set_signature(this_ptr_conv, val_conv);
4590 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong signature_arg) {
4591 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4592 FREE((void*)channel_id_arg);
4593 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
4594 FREE((void*)signature_arg);
4595 LDKFundingSigned* ret = MALLOC(sizeof(LDKFundingSigned), "LDKFundingSigned");
4596 *ret = FundingSigned_new(channel_id_arg_conv, signature_arg_conv);
4597 assert(ret->is_owned);
4598 ret->is_owned = false;
4602 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4603 LDKFundingLocked this_ptr_conv = *(LDKFundingLocked*)this_ptr;
4604 FREE((void*)this_ptr);
4605 this_ptr_conv.is_owned = true;
4606 return FundingLocked_free(this_ptr_conv);
4609 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4610 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
4611 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4612 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingLocked_get_channel_id(this_ptr_conv));
4616 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4617 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
4618 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4620 return FundingLocked_set_channel_id(this_ptr_conv, val_conv);
4623 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
4624 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
4625 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4626 *ret = FundingLocked_get_next_per_commitment_point(this_ptr_conv);
4630 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4631 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
4632 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4634 return FundingLocked_set_next_per_commitment_point(this_ptr_conv, val_conv);
4637 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong next_per_commitment_point_arg) {
4638 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4639 FREE((void*)channel_id_arg);
4640 LDKPublicKey next_per_commitment_point_arg_conv = *(LDKPublicKey*)next_per_commitment_point_arg;
4641 FREE((void*)next_per_commitment_point_arg);
4642 LDKFundingLocked* ret = MALLOC(sizeof(LDKFundingLocked), "LDKFundingLocked");
4643 *ret = FundingLocked_new(channel_id_arg_conv, next_per_commitment_point_arg_conv);
4644 assert(ret->is_owned);
4645 ret->is_owned = false;
4649 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4650 LDKShutdown this_ptr_conv = *(LDKShutdown*)this_ptr;
4651 FREE((void*)this_ptr);
4652 this_ptr_conv.is_owned = true;
4653 return Shutdown_free(this_ptr_conv);
4656 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4657 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
4658 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4659 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *Shutdown_get_channel_id(this_ptr_conv));
4663 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4664 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
4665 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4667 return Shutdown_set_channel_id(this_ptr_conv, val_conv);
4670 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1scriptpubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
4671 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
4672 LDKu8slice* ret = MALLOC(sizeof(LDKu8slice), "LDKu8slice");
4673 *ret = Shutdown_get_scriptpubkey(this_ptr_conv);
4677 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1scriptpubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4678 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
4679 LDKCVec_u8Z val_conv = *(LDKCVec_u8Z*)val;
4681 return Shutdown_set_scriptpubkey(this_ptr_conv, val_conv);
4684 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong scriptpubkey_arg) {
4685 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4686 FREE((void*)channel_id_arg);
4687 LDKCVec_u8Z scriptpubkey_arg_conv = *(LDKCVec_u8Z*)scriptpubkey_arg;
4688 FREE((void*)scriptpubkey_arg);
4689 LDKShutdown* ret = MALLOC(sizeof(LDKShutdown), "LDKShutdown");
4690 *ret = Shutdown_new(channel_id_arg_conv, scriptpubkey_arg_conv);
4691 assert(ret->is_owned);
4692 ret->is_owned = false;
4696 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4697 LDKClosingSigned this_ptr_conv = *(LDKClosingSigned*)this_ptr;
4698 FREE((void*)this_ptr);
4699 this_ptr_conv.is_owned = true;
4700 return ClosingSigned_free(this_ptr_conv);
4703 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4704 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
4705 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4706 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ClosingSigned_get_channel_id(this_ptr_conv));
4710 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4711 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
4712 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4714 return ClosingSigned_set_channel_id(this_ptr_conv, val_conv);
4717 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
4718 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
4719 return ClosingSigned_get_fee_satoshis(this_ptr_conv);
4722 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4723 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
4724 return ClosingSigned_set_fee_satoshis(this_ptr_conv, val);
4727 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
4728 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
4729 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4730 *ret = ClosingSigned_get_signature(this_ptr_conv);
4734 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4735 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
4736 LDKSignature val_conv = *(LDKSignature*)val;
4738 return ClosingSigned_set_signature(this_ptr_conv, val_conv);
4741 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong fee_satoshis_arg, jlong signature_arg) {
4742 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4743 FREE((void*)channel_id_arg);
4744 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
4745 FREE((void*)signature_arg);
4746 LDKClosingSigned* ret = MALLOC(sizeof(LDKClosingSigned), "LDKClosingSigned");
4747 *ret = ClosingSigned_new(channel_id_arg_conv, fee_satoshis_arg, signature_arg_conv);
4748 assert(ret->is_owned);
4749 ret->is_owned = false;
4753 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4754 LDKUpdateAddHTLC this_ptr_conv = *(LDKUpdateAddHTLC*)this_ptr;
4755 FREE((void*)this_ptr);
4756 this_ptr_conv.is_owned = true;
4757 return UpdateAddHTLC_free(this_ptr_conv);
4760 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4761 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4762 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4763 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateAddHTLC_get_channel_id(this_ptr_conv));
4767 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4768 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4769 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4771 return UpdateAddHTLC_set_channel_id(this_ptr_conv, val_conv);
4774 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4775 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4776 return UpdateAddHTLC_get_htlc_id(this_ptr_conv);
4779 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4780 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4781 return UpdateAddHTLC_set_htlc_id(this_ptr_conv, val);
4784 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
4785 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4786 return UpdateAddHTLC_get_amount_msat(this_ptr_conv);
4789 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4790 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4791 return UpdateAddHTLC_set_amount_msat(this_ptr_conv, val);
4794 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
4795 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4796 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4797 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateAddHTLC_get_payment_hash(this_ptr_conv));
4801 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4802 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4803 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4805 return UpdateAddHTLC_set_payment_hash(this_ptr_conv, val_conv);
4808 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr) {
4809 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4810 return UpdateAddHTLC_get_cltv_expiry(this_ptr_conv);
4813 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
4814 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4815 return UpdateAddHTLC_set_cltv_expiry(this_ptr_conv, val);
4818 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4819 LDKUpdateFulfillHTLC this_ptr_conv = *(LDKUpdateFulfillHTLC*)this_ptr;
4820 FREE((void*)this_ptr);
4821 this_ptr_conv.is_owned = true;
4822 return UpdateFulfillHTLC_free(this_ptr_conv);
4825 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4826 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
4827 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4828 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_channel_id(this_ptr_conv));
4832 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4833 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
4834 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4836 return UpdateFulfillHTLC_set_channel_id(this_ptr_conv, val_conv);
4839 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4840 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
4841 return UpdateFulfillHTLC_get_htlc_id(this_ptr_conv);
4844 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4845 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
4846 return UpdateFulfillHTLC_set_htlc_id(this_ptr_conv, val);
4849 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1payment_1preimage(JNIEnv * _env, jclass _b, jlong this_ptr) {
4850 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
4851 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4852 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_payment_preimage(this_ptr_conv));
4856 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1payment_1preimage(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4857 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
4858 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4860 return UpdateFulfillHTLC_set_payment_preimage(this_ptr_conv, val_conv);
4863 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong htlc_id_arg, jlong payment_preimage_arg) {
4864 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4865 FREE((void*)channel_id_arg);
4866 LDKThirtyTwoBytes payment_preimage_arg_conv = *(LDKThirtyTwoBytes*)payment_preimage_arg;
4867 FREE((void*)payment_preimage_arg);
4868 LDKUpdateFulfillHTLC* ret = MALLOC(sizeof(LDKUpdateFulfillHTLC), "LDKUpdateFulfillHTLC");
4869 *ret = UpdateFulfillHTLC_new(channel_id_arg_conv, htlc_id_arg, payment_preimage_arg_conv);
4870 assert(ret->is_owned);
4871 ret->is_owned = false;
4875 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4876 LDKUpdateFailHTLC this_ptr_conv = *(LDKUpdateFailHTLC*)this_ptr;
4877 FREE((void*)this_ptr);
4878 this_ptr_conv.is_owned = true;
4879 return UpdateFailHTLC_free(this_ptr_conv);
4882 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4883 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
4884 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4885 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFailHTLC_get_channel_id(this_ptr_conv));
4889 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4890 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
4891 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4893 return UpdateFailHTLC_set_channel_id(this_ptr_conv, val_conv);
4896 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4897 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
4898 return UpdateFailHTLC_get_htlc_id(this_ptr_conv);
4901 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4902 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
4903 return UpdateFailHTLC_set_htlc_id(this_ptr_conv, val);
4906 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4907 LDKUpdateFailMalformedHTLC this_ptr_conv = *(LDKUpdateFailMalformedHTLC*)this_ptr;
4908 FREE((void*)this_ptr);
4909 this_ptr_conv.is_owned = true;
4910 return UpdateFailMalformedHTLC_free(this_ptr_conv);
4913 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4914 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
4915 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4916 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFailMalformedHTLC_get_channel_id(this_ptr_conv));
4920 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4921 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
4922 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4924 return UpdateFailMalformedHTLC_set_channel_id(this_ptr_conv, val_conv);
4927 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4928 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
4929 return UpdateFailMalformedHTLC_get_htlc_id(this_ptr_conv);
4932 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4933 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
4934 return UpdateFailMalformedHTLC_set_htlc_id(this_ptr_conv, val);
4937 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1failure_1code(JNIEnv * _env, jclass _b, jlong this_ptr) {
4938 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
4939 return UpdateFailMalformedHTLC_get_failure_code(this_ptr_conv);
4942 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1failure_1code(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
4943 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
4944 return UpdateFailMalformedHTLC_set_failure_code(this_ptr_conv, val);
4947 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4948 LDKCommitmentSigned this_ptr_conv = *(LDKCommitmentSigned*)this_ptr;
4949 FREE((void*)this_ptr);
4950 this_ptr_conv.is_owned = true;
4951 return CommitmentSigned_free(this_ptr_conv);
4954 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4955 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
4956 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4957 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *CommitmentSigned_get_channel_id(this_ptr_conv));
4961 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4962 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
4963 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4965 return CommitmentSigned_set_channel_id(this_ptr_conv, val_conv);
4968 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
4969 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
4970 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4971 *ret = CommitmentSigned_get_signature(this_ptr_conv);
4975 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4976 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
4977 LDKSignature val_conv = *(LDKSignature*)val;
4979 return CommitmentSigned_set_signature(this_ptr_conv, val_conv);
4982 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1htlc_1signatures(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4983 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
4984 LDKCVec_SignatureZ val_conv = *(LDKCVec_SignatureZ*)val;
4986 return CommitmentSigned_set_htlc_signatures(this_ptr_conv, val_conv);
4989 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong signature_arg, jlong htlc_signatures_arg) {
4990 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4991 FREE((void*)channel_id_arg);
4992 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
4993 FREE((void*)signature_arg);
4994 LDKCVec_SignatureZ htlc_signatures_arg_conv = *(LDKCVec_SignatureZ*)htlc_signatures_arg;
4995 FREE((void*)htlc_signatures_arg);
4996 LDKCommitmentSigned* ret = MALLOC(sizeof(LDKCommitmentSigned), "LDKCommitmentSigned");
4997 *ret = CommitmentSigned_new(channel_id_arg_conv, signature_arg_conv, htlc_signatures_arg_conv);
4998 assert(ret->is_owned);
4999 ret->is_owned = false;
5003 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5004 LDKRevokeAndACK this_ptr_conv = *(LDKRevokeAndACK*)this_ptr;
5005 FREE((void*)this_ptr);
5006 this_ptr_conv.is_owned = true;
5007 return RevokeAndACK_free(this_ptr_conv);
5010 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5011 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
5012 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5013 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *RevokeAndACK_get_channel_id(this_ptr_conv));
5017 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5018 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
5019 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5021 return RevokeAndACK_set_channel_id(this_ptr_conv, val_conv);
5024 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr) {
5025 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
5026 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5027 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *RevokeAndACK_get_per_commitment_secret(this_ptr_conv));
5031 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5032 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
5033 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5035 return RevokeAndACK_set_per_commitment_secret(this_ptr_conv, val_conv);
5038 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
5039 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
5040 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5041 *ret = RevokeAndACK_get_next_per_commitment_point(this_ptr_conv);
5045 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5046 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
5047 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5049 return RevokeAndACK_set_next_per_commitment_point(this_ptr_conv, val_conv);
5052 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong per_commitment_secret_arg, jlong next_per_commitment_point_arg) {
5053 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
5054 FREE((void*)channel_id_arg);
5055 LDKThirtyTwoBytes per_commitment_secret_arg_conv = *(LDKThirtyTwoBytes*)per_commitment_secret_arg;
5056 FREE((void*)per_commitment_secret_arg);
5057 LDKPublicKey next_per_commitment_point_arg_conv = *(LDKPublicKey*)next_per_commitment_point_arg;
5058 FREE((void*)next_per_commitment_point_arg);
5059 LDKRevokeAndACK* ret = MALLOC(sizeof(LDKRevokeAndACK), "LDKRevokeAndACK");
5060 *ret = RevokeAndACK_new(channel_id_arg_conv, per_commitment_secret_arg_conv, next_per_commitment_point_arg_conv);
5061 assert(ret->is_owned);
5062 ret->is_owned = false;
5066 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5067 LDKUpdateFee this_ptr_conv = *(LDKUpdateFee*)this_ptr;
5068 FREE((void*)this_ptr);
5069 this_ptr_conv.is_owned = true;
5070 return UpdateFee_free(this_ptr_conv);
5073 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5074 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
5075 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5076 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFee_get_channel_id(this_ptr_conv));
5080 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5081 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
5082 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5084 return UpdateFee_set_channel_id(this_ptr_conv, val_conv);
5087 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr) {
5088 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
5089 return UpdateFee_get_feerate_per_kw(this_ptr_conv);
5092 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5093 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
5094 return UpdateFee_set_feerate_per_kw(this_ptr_conv, val);
5097 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jint feerate_per_kw_arg) {
5098 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
5099 FREE((void*)channel_id_arg);
5100 LDKUpdateFee* ret = MALLOC(sizeof(LDKUpdateFee), "LDKUpdateFee");
5101 *ret = UpdateFee_new(channel_id_arg_conv, feerate_per_kw_arg);
5102 assert(ret->is_owned);
5103 ret->is_owned = false;
5107 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5108 LDKDataLossProtect this_ptr_conv = *(LDKDataLossProtect*)this_ptr;
5109 FREE((void*)this_ptr);
5110 this_ptr_conv.is_owned = true;
5111 return DataLossProtect_free(this_ptr_conv);
5114 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1your_1last_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr) {
5115 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
5116 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5117 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *DataLossProtect_get_your_last_per_commitment_secret(this_ptr_conv));
5121 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1your_1last_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5122 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
5123 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5125 return DataLossProtect_set_your_last_per_commitment_secret(this_ptr_conv, val_conv);
5128 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1my_1current_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
5129 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
5130 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5131 *ret = DataLossProtect_get_my_current_per_commitment_point(this_ptr_conv);
5135 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1my_1current_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5136 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
5137 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5139 return DataLossProtect_set_my_current_per_commitment_point(this_ptr_conv, val_conv);
5142 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1new(JNIEnv * _env, jclass _b, jlong your_last_per_commitment_secret_arg, jlong my_current_per_commitment_point_arg) {
5143 LDKThirtyTwoBytes your_last_per_commitment_secret_arg_conv = *(LDKThirtyTwoBytes*)your_last_per_commitment_secret_arg;
5144 FREE((void*)your_last_per_commitment_secret_arg);
5145 LDKPublicKey my_current_per_commitment_point_arg_conv = *(LDKPublicKey*)my_current_per_commitment_point_arg;
5146 FREE((void*)my_current_per_commitment_point_arg);
5147 LDKDataLossProtect* ret = MALLOC(sizeof(LDKDataLossProtect), "LDKDataLossProtect");
5148 *ret = DataLossProtect_new(your_last_per_commitment_secret_arg_conv, my_current_per_commitment_point_arg_conv);
5149 assert(ret->is_owned);
5150 ret->is_owned = false;
5154 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5155 LDKChannelReestablish this_ptr_conv = *(LDKChannelReestablish*)this_ptr;
5156 FREE((void*)this_ptr);
5157 this_ptr_conv.is_owned = true;
5158 return ChannelReestablish_free(this_ptr_conv);
5161 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5162 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
5163 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5164 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ChannelReestablish_get_channel_id(this_ptr_conv));
5168 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5169 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
5170 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5172 return ChannelReestablish_set_channel_id(this_ptr_conv, val_conv);
5175 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1local_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr) {
5176 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
5177 return ChannelReestablish_get_next_local_commitment_number(this_ptr_conv);
5180 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1local_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5181 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
5182 return ChannelReestablish_set_next_local_commitment_number(this_ptr_conv, val);
5185 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1remote_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr) {
5186 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
5187 return ChannelReestablish_get_next_remote_commitment_number(this_ptr_conv);
5190 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1remote_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5191 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
5192 return ChannelReestablish_set_next_remote_commitment_number(this_ptr_conv, val);
5195 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5196 LDKAnnouncementSignatures this_ptr_conv = *(LDKAnnouncementSignatures*)this_ptr;
5197 FREE((void*)this_ptr);
5198 this_ptr_conv.is_owned = true;
5199 return AnnouncementSignatures_free(this_ptr_conv);
5202 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5203 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
5204 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5205 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *AnnouncementSignatures_get_channel_id(this_ptr_conv));
5209 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5210 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
5211 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5213 return AnnouncementSignatures_set_channel_id(this_ptr_conv, val_conv);
5216 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5217 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
5218 return AnnouncementSignatures_get_short_channel_id(this_ptr_conv);
5221 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5222 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
5223 return AnnouncementSignatures_set_short_channel_id(this_ptr_conv, val);
5226 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1node_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
5227 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
5228 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
5229 *ret = AnnouncementSignatures_get_node_signature(this_ptr_conv);
5233 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1node_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5234 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
5235 LDKSignature val_conv = *(LDKSignature*)val;
5237 return AnnouncementSignatures_set_node_signature(this_ptr_conv, val_conv);
5240 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1bitcoin_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
5241 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
5242 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
5243 *ret = AnnouncementSignatures_get_bitcoin_signature(this_ptr_conv);
5247 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1bitcoin_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5248 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
5249 LDKSignature val_conv = *(LDKSignature*)val;
5251 return AnnouncementSignatures_set_bitcoin_signature(this_ptr_conv, val_conv);
5254 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong short_channel_id_arg, jlong node_signature_arg, jlong bitcoin_signature_arg) {
5255 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
5256 FREE((void*)channel_id_arg);
5257 LDKSignature node_signature_arg_conv = *(LDKSignature*)node_signature_arg;
5258 FREE((void*)node_signature_arg);
5259 LDKSignature bitcoin_signature_arg_conv = *(LDKSignature*)bitcoin_signature_arg;
5260 FREE((void*)bitcoin_signature_arg);
5261 LDKAnnouncementSignatures* ret = MALLOC(sizeof(LDKAnnouncementSignatures), "LDKAnnouncementSignatures");
5262 *ret = AnnouncementSignatures_new(channel_id_arg_conv, short_channel_id_arg, node_signature_arg_conv, bitcoin_signature_arg_conv);
5263 assert(ret->is_owned);
5264 ret->is_owned = false;
5268 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetAddress_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5269 LDKNetAddress this_ptr_conv = *(LDKNetAddress*)this_ptr;
5270 FREE((void*)this_ptr);
5271 return NetAddress_free(this_ptr_conv);
5274 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5275 LDKUnsignedNodeAnnouncement this_ptr_conv = *(LDKUnsignedNodeAnnouncement*)this_ptr;
5276 FREE((void*)this_ptr);
5277 this_ptr_conv.is_owned = true;
5278 return UnsignedNodeAnnouncement_free(this_ptr_conv);
5281 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
5282 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
5283 LDKNodeFeatures* ret = MALLOC(sizeof(LDKNodeFeatures), "LDKNodeFeatures");
5284 *ret = UnsignedNodeAnnouncement_get_features(this_ptr_conv);
5285 assert(ret->is_owned);
5286 ret->is_owned = false;
5290 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5291 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
5292 LDKNodeFeatures val_conv = *(LDKNodeFeatures*)val;
5294 val_conv.is_owned = true;
5295 return UnsignedNodeAnnouncement_set_features(this_ptr_conv, val_conv);
5298 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr) {
5299 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
5300 return UnsignedNodeAnnouncement_get_timestamp(this_ptr_conv);
5303 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5304 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
5305 return UnsignedNodeAnnouncement_set_timestamp(this_ptr_conv, val);
5308 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5309 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
5310 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5311 *ret = UnsignedNodeAnnouncement_get_node_id(this_ptr_conv);
5315 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5316 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
5317 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5319 return UnsignedNodeAnnouncement_set_node_id(this_ptr_conv, val_conv);
5322 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr) {
5323 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
5324 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 3);
5325 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 3, *UnsignedNodeAnnouncement_get_rgb(this_ptr_conv));
5329 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5330 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
5331 LDKThreeBytes val_conv = *(LDKThreeBytes*)val;
5333 return UnsignedNodeAnnouncement_set_rgb(this_ptr_conv, val_conv);
5336 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1alias(JNIEnv * _env, jclass _b, jlong this_ptr) {
5337 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
5338 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5339 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedNodeAnnouncement_get_alias(this_ptr_conv));
5343 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1alias(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5344 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
5345 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5347 return UnsignedNodeAnnouncement_set_alias(this_ptr_conv, val_conv);
5350 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1addresses(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5351 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
5352 LDKCVec_NetAddressZ val_conv = *(LDKCVec_NetAddressZ*)val;
5354 return UnsignedNodeAnnouncement_set_addresses(this_ptr_conv, val_conv);
5357 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5358 LDKNodeAnnouncement this_ptr_conv = *(LDKNodeAnnouncement*)this_ptr;
5359 FREE((void*)this_ptr);
5360 this_ptr_conv.is_owned = true;
5361 return NodeAnnouncement_free(this_ptr_conv);
5364 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
5365 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
5366 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
5367 *ret = NodeAnnouncement_get_signature(this_ptr_conv);
5371 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5372 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
5373 LDKSignature val_conv = *(LDKSignature*)val;
5375 return NodeAnnouncement_set_signature(this_ptr_conv, val_conv);
5378 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1contents(JNIEnv * _env, jclass _b, jlong this_ptr) {
5379 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
5380 LDKUnsignedNodeAnnouncement* ret = MALLOC(sizeof(LDKUnsignedNodeAnnouncement), "LDKUnsignedNodeAnnouncement");
5381 *ret = NodeAnnouncement_get_contents(this_ptr_conv);
5382 assert(ret->is_owned);
5383 ret->is_owned = false;
5387 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1contents(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5388 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
5389 LDKUnsignedNodeAnnouncement val_conv = *(LDKUnsignedNodeAnnouncement*)val;
5391 val_conv.is_owned = true;
5392 return NodeAnnouncement_set_contents(this_ptr_conv, val_conv);
5395 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1new(JNIEnv * _env, jclass _b, jlong signature_arg, jlong contents_arg) {
5396 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
5397 FREE((void*)signature_arg);
5398 LDKUnsignedNodeAnnouncement contents_arg_conv = *(LDKUnsignedNodeAnnouncement*)contents_arg;
5399 FREE((void*)contents_arg);
5400 contents_arg_conv.is_owned = true;
5401 LDKNodeAnnouncement* ret = MALLOC(sizeof(LDKNodeAnnouncement), "LDKNodeAnnouncement");
5402 *ret = NodeAnnouncement_new(signature_arg_conv, contents_arg_conv);
5403 assert(ret->is_owned);
5404 ret->is_owned = false;
5408 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5409 LDKUnsignedChannelAnnouncement this_ptr_conv = *(LDKUnsignedChannelAnnouncement*)this_ptr;
5410 FREE((void*)this_ptr);
5411 this_ptr_conv.is_owned = true;
5412 return UnsignedChannelAnnouncement_free(this_ptr_conv);
5415 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
5416 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
5417 LDKChannelFeatures* ret = MALLOC(sizeof(LDKChannelFeatures), "LDKChannelFeatures");
5418 *ret = UnsignedChannelAnnouncement_get_features(this_ptr_conv);
5419 assert(ret->is_owned);
5420 ret->is_owned = false;
5424 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5425 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
5426 LDKChannelFeatures val_conv = *(LDKChannelFeatures*)val;
5428 val_conv.is_owned = true;
5429 return UnsignedChannelAnnouncement_set_features(this_ptr_conv, val_conv);
5432 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
5433 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
5434 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5435 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedChannelAnnouncement_get_chain_hash(this_ptr_conv));
5439 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5440 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
5441 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5443 return UnsignedChannelAnnouncement_set_chain_hash(this_ptr_conv, val_conv);
5446 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5447 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
5448 return UnsignedChannelAnnouncement_get_short_channel_id(this_ptr_conv);
5451 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5452 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
5453 return UnsignedChannelAnnouncement_set_short_channel_id(this_ptr_conv, val);
5456 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
5457 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
5458 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5459 *ret = UnsignedChannelAnnouncement_get_node_id_1(this_ptr_conv);
5463 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5464 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
5465 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5467 return UnsignedChannelAnnouncement_set_node_id_1(this_ptr_conv, val_conv);
5470 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
5471 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
5472 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5473 *ret = UnsignedChannelAnnouncement_get_node_id_2(this_ptr_conv);
5477 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5478 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
5479 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5481 return UnsignedChannelAnnouncement_set_node_id_2(this_ptr_conv, val_conv);
5484 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
5485 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
5486 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5487 *ret = UnsignedChannelAnnouncement_get_bitcoin_key_1(this_ptr_conv);
5491 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5492 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
5493 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5495 return UnsignedChannelAnnouncement_set_bitcoin_key_1(this_ptr_conv, val_conv);
5498 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
5499 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
5500 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5501 *ret = UnsignedChannelAnnouncement_get_bitcoin_key_2(this_ptr_conv);
5505 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5506 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
5507 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5509 return UnsignedChannelAnnouncement_set_bitcoin_key_2(this_ptr_conv, val_conv);
5512 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5513 LDKChannelAnnouncement this_ptr_conv = *(LDKChannelAnnouncement*)this_ptr;
5514 FREE((void*)this_ptr);
5515 this_ptr_conv.is_owned = true;
5516 return ChannelAnnouncement_free(this_ptr_conv);
5519 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
5520 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
5521 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
5522 *ret = ChannelAnnouncement_get_node_signature_1(this_ptr_conv);
5526 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5527 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
5528 LDKSignature val_conv = *(LDKSignature*)val;
5530 return ChannelAnnouncement_set_node_signature_1(this_ptr_conv, val_conv);
5533 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
5534 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
5535 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
5536 *ret = ChannelAnnouncement_get_node_signature_2(this_ptr_conv);
5540 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5541 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
5542 LDKSignature val_conv = *(LDKSignature*)val;
5544 return ChannelAnnouncement_set_node_signature_2(this_ptr_conv, val_conv);
5547 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
5548 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
5549 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
5550 *ret = ChannelAnnouncement_get_bitcoin_signature_1(this_ptr_conv);
5554 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5555 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
5556 LDKSignature val_conv = *(LDKSignature*)val;
5558 return ChannelAnnouncement_set_bitcoin_signature_1(this_ptr_conv, val_conv);
5561 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
5562 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
5563 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
5564 *ret = ChannelAnnouncement_get_bitcoin_signature_2(this_ptr_conv);
5568 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5569 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
5570 LDKSignature val_conv = *(LDKSignature*)val;
5572 return ChannelAnnouncement_set_bitcoin_signature_2(this_ptr_conv, val_conv);
5575 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1contents(JNIEnv * _env, jclass _b, jlong this_ptr) {
5576 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
5577 LDKUnsignedChannelAnnouncement* ret = MALLOC(sizeof(LDKUnsignedChannelAnnouncement), "LDKUnsignedChannelAnnouncement");
5578 *ret = ChannelAnnouncement_get_contents(this_ptr_conv);
5579 assert(ret->is_owned);
5580 ret->is_owned = false;
5584 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1contents(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5585 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
5586 LDKUnsignedChannelAnnouncement val_conv = *(LDKUnsignedChannelAnnouncement*)val;
5588 val_conv.is_owned = true;
5589 return ChannelAnnouncement_set_contents(this_ptr_conv, val_conv);
5592 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1new(JNIEnv * _env, jclass _b, jlong node_signature_1_arg, jlong node_signature_2_arg, jlong bitcoin_signature_1_arg, jlong bitcoin_signature_2_arg, jlong contents_arg) {
5593 LDKSignature node_signature_1_arg_conv = *(LDKSignature*)node_signature_1_arg;
5594 FREE((void*)node_signature_1_arg);
5595 LDKSignature node_signature_2_arg_conv = *(LDKSignature*)node_signature_2_arg;
5596 FREE((void*)node_signature_2_arg);
5597 LDKSignature bitcoin_signature_1_arg_conv = *(LDKSignature*)bitcoin_signature_1_arg;
5598 FREE((void*)bitcoin_signature_1_arg);
5599 LDKSignature bitcoin_signature_2_arg_conv = *(LDKSignature*)bitcoin_signature_2_arg;
5600 FREE((void*)bitcoin_signature_2_arg);
5601 LDKUnsignedChannelAnnouncement contents_arg_conv = *(LDKUnsignedChannelAnnouncement*)contents_arg;
5602 FREE((void*)contents_arg);
5603 contents_arg_conv.is_owned = true;
5604 LDKChannelAnnouncement* ret = MALLOC(sizeof(LDKChannelAnnouncement), "LDKChannelAnnouncement");
5605 *ret = ChannelAnnouncement_new(node_signature_1_arg_conv, node_signature_2_arg_conv, bitcoin_signature_1_arg_conv, bitcoin_signature_2_arg_conv, contents_arg_conv);
5606 assert(ret->is_owned);
5607 ret->is_owned = false;
5611 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5612 LDKUnsignedChannelUpdate this_ptr_conv = *(LDKUnsignedChannelUpdate*)this_ptr;
5613 FREE((void*)this_ptr);
5614 this_ptr_conv.is_owned = true;
5615 return UnsignedChannelUpdate_free(this_ptr_conv);
5618 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
5619 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5620 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5621 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedChannelUpdate_get_chain_hash(this_ptr_conv));
5625 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5626 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5627 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5629 return UnsignedChannelUpdate_set_chain_hash(this_ptr_conv, val_conv);
5632 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5633 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5634 return UnsignedChannelUpdate_get_short_channel_id(this_ptr_conv);
5637 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5638 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5639 return UnsignedChannelUpdate_set_short_channel_id(this_ptr_conv, val);
5642 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr) {
5643 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5644 return UnsignedChannelUpdate_get_timestamp(this_ptr_conv);
5647 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5648 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5649 return UnsignedChannelUpdate_set_timestamp(this_ptr_conv, val);
5652 JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1flags(JNIEnv * _env, jclass _b, jlong this_ptr) {
5653 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5654 return UnsignedChannelUpdate_get_flags(this_ptr_conv);
5657 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1flags(JNIEnv * _env, jclass _b, jlong this_ptr, jbyte val) {
5658 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5659 return UnsignedChannelUpdate_set_flags(this_ptr_conv, val);
5662 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
5663 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5664 return UnsignedChannelUpdate_get_cltv_expiry_delta(this_ptr_conv);
5667 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
5668 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5669 return UnsignedChannelUpdate_set_cltv_expiry_delta(this_ptr_conv, val);
5672 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
5673 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5674 return UnsignedChannelUpdate_get_htlc_minimum_msat(this_ptr_conv);
5677 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5678 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5679 return UnsignedChannelUpdate_set_htlc_minimum_msat(this_ptr_conv, val);
5682 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
5683 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5684 return UnsignedChannelUpdate_get_fee_base_msat(this_ptr_conv);
5687 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5688 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5689 return UnsignedChannelUpdate_set_fee_base_msat(this_ptr_conv, val);
5692 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr) {
5693 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5694 return UnsignedChannelUpdate_get_fee_proportional_millionths(this_ptr_conv);
5697 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5698 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5699 return UnsignedChannelUpdate_set_fee_proportional_millionths(this_ptr_conv, val);
5702 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5703 LDKChannelUpdate this_ptr_conv = *(LDKChannelUpdate*)this_ptr;
5704 FREE((void*)this_ptr);
5705 this_ptr_conv.is_owned = true;
5706 return ChannelUpdate_free(this_ptr_conv);
5709 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
5710 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
5711 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
5712 *ret = ChannelUpdate_get_signature(this_ptr_conv);
5716 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5717 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
5718 LDKSignature val_conv = *(LDKSignature*)val;
5720 return ChannelUpdate_set_signature(this_ptr_conv, val_conv);
5723 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1contents(JNIEnv * _env, jclass _b, jlong this_ptr) {
5724 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
5725 LDKUnsignedChannelUpdate* ret = MALLOC(sizeof(LDKUnsignedChannelUpdate), "LDKUnsignedChannelUpdate");
5726 *ret = ChannelUpdate_get_contents(this_ptr_conv);
5727 assert(ret->is_owned);
5728 ret->is_owned = false;
5732 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1contents(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5733 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
5734 LDKUnsignedChannelUpdate val_conv = *(LDKUnsignedChannelUpdate*)val;
5736 val_conv.is_owned = true;
5737 return ChannelUpdate_set_contents(this_ptr_conv, val_conv);
5740 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1new(JNIEnv * _env, jclass _b, jlong signature_arg, jlong contents_arg) {
5741 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
5742 FREE((void*)signature_arg);
5743 LDKUnsignedChannelUpdate contents_arg_conv = *(LDKUnsignedChannelUpdate*)contents_arg;
5744 FREE((void*)contents_arg);
5745 contents_arg_conv.is_owned = true;
5746 LDKChannelUpdate* ret = MALLOC(sizeof(LDKChannelUpdate), "LDKChannelUpdate");
5747 *ret = ChannelUpdate_new(signature_arg_conv, contents_arg_conv);
5748 assert(ret->is_owned);
5749 ret->is_owned = false;
5753 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5754 LDKQueryChannelRange this_ptr_conv = *(LDKQueryChannelRange*)this_ptr;
5755 FREE((void*)this_ptr);
5756 this_ptr_conv.is_owned = true;
5757 return QueryChannelRange_free(this_ptr_conv);
5760 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
5761 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
5762 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5763 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *QueryChannelRange_get_chain_hash(this_ptr_conv));
5767 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5768 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
5769 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5771 return QueryChannelRange_set_chain_hash(this_ptr_conv, val_conv);
5774 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1first_1blocknum(JNIEnv * _env, jclass _b, jlong this_ptr) {
5775 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
5776 return QueryChannelRange_get_first_blocknum(this_ptr_conv);
5779 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1first_1blocknum(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5780 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
5781 return QueryChannelRange_set_first_blocknum(this_ptr_conv, val);
5784 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1number_1of_1blocks(JNIEnv * _env, jclass _b, jlong this_ptr) {
5785 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
5786 return QueryChannelRange_get_number_of_blocks(this_ptr_conv);
5789 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1number_1of_1blocks(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5790 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
5791 return QueryChannelRange_set_number_of_blocks(this_ptr_conv, val);
5794 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1new(JNIEnv * _env, jclass _b, jlong chain_hash_arg, jint first_blocknum_arg, jint number_of_blocks_arg) {
5795 LDKThirtyTwoBytes chain_hash_arg_conv = *(LDKThirtyTwoBytes*)chain_hash_arg;
5796 FREE((void*)chain_hash_arg);
5797 LDKQueryChannelRange* ret = MALLOC(sizeof(LDKQueryChannelRange), "LDKQueryChannelRange");
5798 *ret = QueryChannelRange_new(chain_hash_arg_conv, first_blocknum_arg, number_of_blocks_arg);
5799 assert(ret->is_owned);
5800 ret->is_owned = false;
5804 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5805 LDKReplyChannelRange this_ptr_conv = *(LDKReplyChannelRange*)this_ptr;
5806 FREE((void*)this_ptr);
5807 this_ptr_conv.is_owned = true;
5808 return ReplyChannelRange_free(this_ptr_conv);
5811 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
5812 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5813 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5814 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ReplyChannelRange_get_chain_hash(this_ptr_conv));
5818 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5819 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5820 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5822 return ReplyChannelRange_set_chain_hash(this_ptr_conv, val_conv);
5825 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1first_1blocknum(JNIEnv * _env, jclass _b, jlong this_ptr) {
5826 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5827 return ReplyChannelRange_get_first_blocknum(this_ptr_conv);
5830 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1first_1blocknum(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5831 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5832 return ReplyChannelRange_set_first_blocknum(this_ptr_conv, val);
5835 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1number_1of_1blocks(JNIEnv * _env, jclass _b, jlong this_ptr) {
5836 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5837 return ReplyChannelRange_get_number_of_blocks(this_ptr_conv);
5840 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1number_1of_1blocks(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5841 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5842 return ReplyChannelRange_set_number_of_blocks(this_ptr_conv, val);
5845 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1full_1information(JNIEnv * _env, jclass _b, jlong this_ptr) {
5846 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5847 return ReplyChannelRange_get_full_information(this_ptr_conv);
5850 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1full_1information(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
5851 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5852 return ReplyChannelRange_set_full_information(this_ptr_conv, val);
5855 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1short_1channel_1ids(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5856 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5857 LDKCVec_u64Z val_conv = *(LDKCVec_u64Z*)val;
5859 return ReplyChannelRange_set_short_channel_ids(this_ptr_conv, val_conv);
5862 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1new(JNIEnv * _env, jclass _b, jlong chain_hash_arg, jint first_blocknum_arg, jint number_of_blocks_arg, jboolean full_information_arg, jlong short_channel_ids_arg) {
5863 LDKThirtyTwoBytes chain_hash_arg_conv = *(LDKThirtyTwoBytes*)chain_hash_arg;
5864 FREE((void*)chain_hash_arg);
5865 LDKCVec_u64Z short_channel_ids_arg_conv = *(LDKCVec_u64Z*)short_channel_ids_arg;
5866 FREE((void*)short_channel_ids_arg);
5867 LDKReplyChannelRange* ret = MALLOC(sizeof(LDKReplyChannelRange), "LDKReplyChannelRange");
5868 *ret = ReplyChannelRange_new(chain_hash_arg_conv, first_blocknum_arg, number_of_blocks_arg, full_information_arg, short_channel_ids_arg_conv);
5869 assert(ret->is_owned);
5870 ret->is_owned = false;
5874 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5875 LDKQueryShortChannelIds this_ptr_conv = *(LDKQueryShortChannelIds*)this_ptr;
5876 FREE((void*)this_ptr);
5877 this_ptr_conv.is_owned = true;
5878 return QueryShortChannelIds_free(this_ptr_conv);
5881 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
5882 LDKQueryShortChannelIds* this_ptr_conv = (LDKQueryShortChannelIds*)this_ptr;
5883 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5884 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *QueryShortChannelIds_get_chain_hash(this_ptr_conv));
5888 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5889 LDKQueryShortChannelIds* this_ptr_conv = (LDKQueryShortChannelIds*)this_ptr;
5890 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5892 return QueryShortChannelIds_set_chain_hash(this_ptr_conv, val_conv);
5895 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1short_1channel_1ids(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5896 LDKQueryShortChannelIds* this_ptr_conv = (LDKQueryShortChannelIds*)this_ptr;
5897 LDKCVec_u64Z val_conv = *(LDKCVec_u64Z*)val;
5899 return QueryShortChannelIds_set_short_channel_ids(this_ptr_conv, val_conv);
5902 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1new(JNIEnv * _env, jclass _b, jlong chain_hash_arg, jlong short_channel_ids_arg) {
5903 LDKThirtyTwoBytes chain_hash_arg_conv = *(LDKThirtyTwoBytes*)chain_hash_arg;
5904 FREE((void*)chain_hash_arg);
5905 LDKCVec_u64Z short_channel_ids_arg_conv = *(LDKCVec_u64Z*)short_channel_ids_arg;
5906 FREE((void*)short_channel_ids_arg);
5907 LDKQueryShortChannelIds* ret = MALLOC(sizeof(LDKQueryShortChannelIds), "LDKQueryShortChannelIds");
5908 *ret = QueryShortChannelIds_new(chain_hash_arg_conv, short_channel_ids_arg_conv);
5909 assert(ret->is_owned);
5910 ret->is_owned = false;
5914 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5915 LDKReplyShortChannelIdsEnd this_ptr_conv = *(LDKReplyShortChannelIdsEnd*)this_ptr;
5916 FREE((void*)this_ptr);
5917 this_ptr_conv.is_owned = true;
5918 return ReplyShortChannelIdsEnd_free(this_ptr_conv);
5921 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
5922 LDKReplyShortChannelIdsEnd* this_ptr_conv = (LDKReplyShortChannelIdsEnd*)this_ptr;
5923 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5924 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ReplyShortChannelIdsEnd_get_chain_hash(this_ptr_conv));
5928 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5929 LDKReplyShortChannelIdsEnd* this_ptr_conv = (LDKReplyShortChannelIdsEnd*)this_ptr;
5930 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5932 return ReplyShortChannelIdsEnd_set_chain_hash(this_ptr_conv, val_conv);
5935 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1full_1information(JNIEnv * _env, jclass _b, jlong this_ptr) {
5936 LDKReplyShortChannelIdsEnd* this_ptr_conv = (LDKReplyShortChannelIdsEnd*)this_ptr;
5937 return ReplyShortChannelIdsEnd_get_full_information(this_ptr_conv);
5940 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1full_1information(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
5941 LDKReplyShortChannelIdsEnd* this_ptr_conv = (LDKReplyShortChannelIdsEnd*)this_ptr;
5942 return ReplyShortChannelIdsEnd_set_full_information(this_ptr_conv, val);
5945 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1new(JNIEnv * _env, jclass _b, jlong chain_hash_arg, jboolean full_information_arg) {
5946 LDKThirtyTwoBytes chain_hash_arg_conv = *(LDKThirtyTwoBytes*)chain_hash_arg;
5947 FREE((void*)chain_hash_arg);
5948 LDKReplyShortChannelIdsEnd* ret = MALLOC(sizeof(LDKReplyShortChannelIdsEnd), "LDKReplyShortChannelIdsEnd");
5949 *ret = ReplyShortChannelIdsEnd_new(chain_hash_arg_conv, full_information_arg);
5950 assert(ret->is_owned);
5951 ret->is_owned = false;
5955 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5956 LDKGossipTimestampFilter this_ptr_conv = *(LDKGossipTimestampFilter*)this_ptr;
5957 FREE((void*)this_ptr);
5958 this_ptr_conv.is_owned = true;
5959 return GossipTimestampFilter_free(this_ptr_conv);
5962 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
5963 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
5964 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5965 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *GossipTimestampFilter_get_chain_hash(this_ptr_conv));
5969 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5970 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
5971 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5973 return GossipTimestampFilter_set_chain_hash(this_ptr_conv, val_conv);
5976 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1first_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr) {
5977 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
5978 return GossipTimestampFilter_get_first_timestamp(this_ptr_conv);
5981 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1first_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5982 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
5983 return GossipTimestampFilter_set_first_timestamp(this_ptr_conv, val);
5986 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1timestamp_1range(JNIEnv * _env, jclass _b, jlong this_ptr) {
5987 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
5988 return GossipTimestampFilter_get_timestamp_range(this_ptr_conv);
5991 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1timestamp_1range(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5992 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
5993 return GossipTimestampFilter_set_timestamp_range(this_ptr_conv, val);
5996 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1new(JNIEnv * _env, jclass _b, jlong chain_hash_arg, jint first_timestamp_arg, jint timestamp_range_arg) {
5997 LDKThirtyTwoBytes chain_hash_arg_conv = *(LDKThirtyTwoBytes*)chain_hash_arg;
5998 FREE((void*)chain_hash_arg);
5999 LDKGossipTimestampFilter* ret = MALLOC(sizeof(LDKGossipTimestampFilter), "LDKGossipTimestampFilter");
6000 *ret = GossipTimestampFilter_new(chain_hash_arg_conv, first_timestamp_arg, timestamp_range_arg);
6001 assert(ret->is_owned);
6002 ret->is_owned = false;
6006 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorAction_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6007 LDKErrorAction this_ptr_conv = *(LDKErrorAction*)this_ptr;
6008 FREE((void*)this_ptr);
6009 return ErrorAction_free(this_ptr_conv);
6012 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6013 LDKLightningError this_ptr_conv = *(LDKLightningError*)this_ptr;
6014 FREE((void*)this_ptr);
6015 this_ptr_conv.is_owned = true;
6016 return LightningError_free(this_ptr_conv);
6019 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1err(JNIEnv * _env, jclass _b, jlong this_ptr) {
6020 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
6021 LDKStr* ret = MALLOC(sizeof(LDKStr), "LDKStr");
6022 *ret = LightningError_get_err(this_ptr_conv);
6026 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1err(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6027 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
6028 LDKCVec_u8Z val_conv = *(LDKCVec_u8Z*)val;
6030 return LightningError_set_err(this_ptr_conv, val_conv);
6033 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1action(JNIEnv * _env, jclass _b, jlong this_ptr) {
6034 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
6035 LDKErrorAction* ret = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
6036 *ret = LightningError_get_action(this_ptr_conv);
6040 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1action(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6041 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
6042 LDKErrorAction val_conv = *(LDKErrorAction*)val;
6044 return LightningError_set_action(this_ptr_conv, val_conv);
6047 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1new(JNIEnv * _env, jclass _b, jlong err_arg, jlong action_arg) {
6048 LDKCVec_u8Z err_arg_conv = *(LDKCVec_u8Z*)err_arg;
6049 FREE((void*)err_arg);
6050 LDKErrorAction action_arg_conv = *(LDKErrorAction*)action_arg;
6051 FREE((void*)action_arg);
6052 LDKLightningError* ret = MALLOC(sizeof(LDKLightningError), "LDKLightningError");
6053 *ret = LightningError_new(err_arg_conv, action_arg_conv);
6054 assert(ret->is_owned);
6055 ret->is_owned = false;
6059 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6060 LDKCommitmentUpdate this_ptr_conv = *(LDKCommitmentUpdate*)this_ptr;
6061 FREE((void*)this_ptr);
6062 this_ptr_conv.is_owned = true;
6063 return CommitmentUpdate_free(this_ptr_conv);
6066 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1add_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6067 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
6068 LDKCVec_UpdateAddHTLCZ val_conv = *(LDKCVec_UpdateAddHTLCZ*)val;
6070 return CommitmentUpdate_set_update_add_htlcs(this_ptr_conv, val_conv);
6073 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fulfill_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6074 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
6075 LDKCVec_UpdateFulfillHTLCZ val_conv = *(LDKCVec_UpdateFulfillHTLCZ*)val;
6077 return CommitmentUpdate_set_update_fulfill_htlcs(this_ptr_conv, val_conv);
6080 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6081 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
6082 LDKCVec_UpdateFailHTLCZ val_conv = *(LDKCVec_UpdateFailHTLCZ*)val;
6084 return CommitmentUpdate_set_update_fail_htlcs(this_ptr_conv, val_conv);
6087 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1malformed_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6088 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
6089 LDKCVec_UpdateFailMalformedHTLCZ val_conv = *(LDKCVec_UpdateFailMalformedHTLCZ*)val;
6091 return CommitmentUpdate_set_update_fail_malformed_htlcs(this_ptr_conv, val_conv);
6094 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fee(JNIEnv * _env, jclass _b, jlong this_ptr) {
6095 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
6096 LDKUpdateFee* ret = MALLOC(sizeof(LDKUpdateFee), "LDKUpdateFee");
6097 *ret = CommitmentUpdate_get_update_fee(this_ptr_conv);
6098 assert(ret->is_owned);
6099 ret->is_owned = false;
6103 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fee(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6104 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
6105 LDKUpdateFee val_conv = *(LDKUpdateFee*)val;
6107 val_conv.is_owned = true;
6108 return CommitmentUpdate_set_update_fee(this_ptr_conv, val_conv);
6111 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1commitment_1signed(JNIEnv * _env, jclass _b, jlong this_ptr) {
6112 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
6113 LDKCommitmentSigned* ret = MALLOC(sizeof(LDKCommitmentSigned), "LDKCommitmentSigned");
6114 *ret = CommitmentUpdate_get_commitment_signed(this_ptr_conv);
6115 assert(ret->is_owned);
6116 ret->is_owned = false;
6120 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1commitment_1signed(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6121 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
6122 LDKCommitmentSigned val_conv = *(LDKCommitmentSigned*)val;
6124 val_conv.is_owned = true;
6125 return CommitmentUpdate_set_commitment_signed(this_ptr_conv, val_conv);
6128 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1new(JNIEnv * _env, jclass _b, jlong update_add_htlcs_arg, jlong update_fulfill_htlcs_arg, jlong update_fail_htlcs_arg, jlong update_fail_malformed_htlcs_arg, jlong update_fee_arg, jlong commitment_signed_arg) {
6129 LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg_conv = *(LDKCVec_UpdateAddHTLCZ*)update_add_htlcs_arg;
6130 FREE((void*)update_add_htlcs_arg);
6131 LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg_conv = *(LDKCVec_UpdateFulfillHTLCZ*)update_fulfill_htlcs_arg;
6132 FREE((void*)update_fulfill_htlcs_arg);
6133 LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg_conv = *(LDKCVec_UpdateFailHTLCZ*)update_fail_htlcs_arg;
6134 FREE((void*)update_fail_htlcs_arg);
6135 LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg_conv = *(LDKCVec_UpdateFailMalformedHTLCZ*)update_fail_malformed_htlcs_arg;
6136 FREE((void*)update_fail_malformed_htlcs_arg);
6137 LDKUpdateFee update_fee_arg_conv = *(LDKUpdateFee*)update_fee_arg;
6138 FREE((void*)update_fee_arg);
6139 update_fee_arg_conv.is_owned = true;
6140 LDKCommitmentSigned commitment_signed_arg_conv = *(LDKCommitmentSigned*)commitment_signed_arg;
6141 FREE((void*)commitment_signed_arg);
6142 commitment_signed_arg_conv.is_owned = true;
6143 LDKCommitmentUpdate* ret = MALLOC(sizeof(LDKCommitmentUpdate), "LDKCommitmentUpdate");
6144 *ret = CommitmentUpdate_new(update_add_htlcs_arg_conv, update_fulfill_htlcs_arg_conv, update_fail_htlcs_arg_conv, update_fail_malformed_htlcs_arg_conv, update_fee_arg_conv, commitment_signed_arg_conv);
6145 assert(ret->is_owned);
6146 ret->is_owned = false;
6150 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCFailChannelUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6151 LDKHTLCFailChannelUpdate this_ptr_conv = *(LDKHTLCFailChannelUpdate*)this_ptr;
6152 FREE((void*)this_ptr);
6153 return HTLCFailChannelUpdate_free(this_ptr_conv);
6156 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6157 LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)this_ptr;
6158 FREE((void*)this_ptr);
6159 return ChannelMessageHandler_free(this_ptr_conv);
6162 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6163 LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)this_ptr;
6164 FREE((void*)this_ptr);
6165 return RoutingMessageHandler_free(this_ptr_conv);
6168 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1write(JNIEnv * _env, jclass _b, jlong obj) {
6169 LDKAcceptChannel* obj_conv = (LDKAcceptChannel*)obj;
6170 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6171 *ret = AcceptChannel_write(obj_conv);
6175 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1read(JNIEnv * _env, jclass _b, jlong ser) {
6176 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6178 LDKAcceptChannel* ret = MALLOC(sizeof(LDKAcceptChannel), "LDKAcceptChannel");
6179 *ret = AcceptChannel_read(ser_conv);
6180 assert(ret->is_owned);
6181 ret->is_owned = false;
6185 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1write(JNIEnv * _env, jclass _b, jlong obj) {
6186 LDKAnnouncementSignatures* obj_conv = (LDKAnnouncementSignatures*)obj;
6187 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6188 *ret = AnnouncementSignatures_write(obj_conv);
6192 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1read(JNIEnv * _env, jclass _b, jlong ser) {
6193 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6195 LDKAnnouncementSignatures* ret = MALLOC(sizeof(LDKAnnouncementSignatures), "LDKAnnouncementSignatures");
6196 *ret = AnnouncementSignatures_read(ser_conv);
6197 assert(ret->is_owned);
6198 ret->is_owned = false;
6202 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1write(JNIEnv * _env, jclass _b, jlong obj) {
6203 LDKChannelReestablish* obj_conv = (LDKChannelReestablish*)obj;
6204 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6205 *ret = ChannelReestablish_write(obj_conv);
6209 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1read(JNIEnv * _env, jclass _b, jlong ser) {
6210 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6212 LDKChannelReestablish* ret = MALLOC(sizeof(LDKChannelReestablish), "LDKChannelReestablish");
6213 *ret = ChannelReestablish_read(ser_conv);
6214 assert(ret->is_owned);
6215 ret->is_owned = false;
6219 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
6220 LDKClosingSigned* obj_conv = (LDKClosingSigned*)obj;
6221 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6222 *ret = ClosingSigned_write(obj_conv);
6226 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1read(JNIEnv * _env, jclass _b, jlong ser) {
6227 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6229 LDKClosingSigned* ret = MALLOC(sizeof(LDKClosingSigned), "LDKClosingSigned");
6230 *ret = ClosingSigned_read(ser_conv);
6231 assert(ret->is_owned);
6232 ret->is_owned = false;
6236 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
6237 LDKCommitmentSigned* obj_conv = (LDKCommitmentSigned*)obj;
6238 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6239 *ret = CommitmentSigned_write(obj_conv);
6243 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1read(JNIEnv * _env, jclass _b, jlong ser) {
6244 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6246 LDKCommitmentSigned* ret = MALLOC(sizeof(LDKCommitmentSigned), "LDKCommitmentSigned");
6247 *ret = CommitmentSigned_read(ser_conv);
6248 assert(ret->is_owned);
6249 ret->is_owned = false;
6253 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1write(JNIEnv * _env, jclass _b, jlong obj) {
6254 LDKFundingCreated* obj_conv = (LDKFundingCreated*)obj;
6255 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6256 *ret = FundingCreated_write(obj_conv);
6260 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1read(JNIEnv * _env, jclass _b, jlong ser) {
6261 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6263 LDKFundingCreated* ret = MALLOC(sizeof(LDKFundingCreated), "LDKFundingCreated");
6264 *ret = FundingCreated_read(ser_conv);
6265 assert(ret->is_owned);
6266 ret->is_owned = false;
6270 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
6271 LDKFundingSigned* obj_conv = (LDKFundingSigned*)obj;
6272 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6273 *ret = FundingSigned_write(obj_conv);
6277 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1read(JNIEnv * _env, jclass _b, jlong ser) {
6278 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6280 LDKFundingSigned* ret = MALLOC(sizeof(LDKFundingSigned), "LDKFundingSigned");
6281 *ret = FundingSigned_read(ser_conv);
6282 assert(ret->is_owned);
6283 ret->is_owned = false;
6287 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1write(JNIEnv * _env, jclass _b, jlong obj) {
6288 LDKFundingLocked* obj_conv = (LDKFundingLocked*)obj;
6289 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6290 *ret = FundingLocked_write(obj_conv);
6294 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1read(JNIEnv * _env, jclass _b, jlong ser) {
6295 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6297 LDKFundingLocked* ret = MALLOC(sizeof(LDKFundingLocked), "LDKFundingLocked");
6298 *ret = FundingLocked_read(ser_conv);
6299 assert(ret->is_owned);
6300 ret->is_owned = false;
6304 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1write(JNIEnv * _env, jclass _b, jlong obj) {
6305 LDKInit* obj_conv = (LDKInit*)obj;
6306 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6307 *ret = Init_write(obj_conv);
6311 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1read(JNIEnv * _env, jclass _b, jlong ser) {
6312 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6314 LDKInit* ret = MALLOC(sizeof(LDKInit), "LDKInit");
6315 *ret = Init_read(ser_conv);
6316 assert(ret->is_owned);
6317 ret->is_owned = false;
6321 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1write(JNIEnv * _env, jclass _b, jlong obj) {
6322 LDKOpenChannel* obj_conv = (LDKOpenChannel*)obj;
6323 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6324 *ret = OpenChannel_write(obj_conv);
6328 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1read(JNIEnv * _env, jclass _b, jlong ser) {
6329 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6331 LDKOpenChannel* ret = MALLOC(sizeof(LDKOpenChannel), "LDKOpenChannel");
6332 *ret = OpenChannel_read(ser_conv);
6333 assert(ret->is_owned);
6334 ret->is_owned = false;
6338 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1write(JNIEnv * _env, jclass _b, jlong obj) {
6339 LDKRevokeAndACK* obj_conv = (LDKRevokeAndACK*)obj;
6340 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6341 *ret = RevokeAndACK_write(obj_conv);
6345 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1read(JNIEnv * _env, jclass _b, jlong ser) {
6346 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6348 LDKRevokeAndACK* ret = MALLOC(sizeof(LDKRevokeAndACK), "LDKRevokeAndACK");
6349 *ret = RevokeAndACK_read(ser_conv);
6350 assert(ret->is_owned);
6351 ret->is_owned = false;
6355 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1write(JNIEnv * _env, jclass _b, jlong obj) {
6356 LDKShutdown* obj_conv = (LDKShutdown*)obj;
6357 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6358 *ret = Shutdown_write(obj_conv);
6362 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1read(JNIEnv * _env, jclass _b, jlong ser) {
6363 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6365 LDKShutdown* ret = MALLOC(sizeof(LDKShutdown), "LDKShutdown");
6366 *ret = Shutdown_read(ser_conv);
6367 assert(ret->is_owned);
6368 ret->is_owned = false;
6372 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
6373 LDKUpdateFailHTLC* obj_conv = (LDKUpdateFailHTLC*)obj;
6374 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6375 *ret = UpdateFailHTLC_write(obj_conv);
6379 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
6380 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6382 LDKUpdateFailHTLC* ret = MALLOC(sizeof(LDKUpdateFailHTLC), "LDKUpdateFailHTLC");
6383 *ret = UpdateFailHTLC_read(ser_conv);
6384 assert(ret->is_owned);
6385 ret->is_owned = false;
6389 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
6390 LDKUpdateFailMalformedHTLC* obj_conv = (LDKUpdateFailMalformedHTLC*)obj;
6391 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6392 *ret = UpdateFailMalformedHTLC_write(obj_conv);
6396 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
6397 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6399 LDKUpdateFailMalformedHTLC* ret = MALLOC(sizeof(LDKUpdateFailMalformedHTLC), "LDKUpdateFailMalformedHTLC");
6400 *ret = UpdateFailMalformedHTLC_read(ser_conv);
6401 assert(ret->is_owned);
6402 ret->is_owned = false;
6406 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1write(JNIEnv * _env, jclass _b, jlong obj) {
6407 LDKUpdateFee* obj_conv = (LDKUpdateFee*)obj;
6408 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6409 *ret = UpdateFee_write(obj_conv);
6413 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1read(JNIEnv * _env, jclass _b, jlong ser) {
6414 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6416 LDKUpdateFee* ret = MALLOC(sizeof(LDKUpdateFee), "LDKUpdateFee");
6417 *ret = UpdateFee_read(ser_conv);
6418 assert(ret->is_owned);
6419 ret->is_owned = false;
6423 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
6424 LDKUpdateFulfillHTLC* obj_conv = (LDKUpdateFulfillHTLC*)obj;
6425 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6426 *ret = UpdateFulfillHTLC_write(obj_conv);
6430 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
6431 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6433 LDKUpdateFulfillHTLC* ret = MALLOC(sizeof(LDKUpdateFulfillHTLC), "LDKUpdateFulfillHTLC");
6434 *ret = UpdateFulfillHTLC_read(ser_conv);
6435 assert(ret->is_owned);
6436 ret->is_owned = false;
6440 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
6441 LDKUpdateAddHTLC* obj_conv = (LDKUpdateAddHTLC*)obj;
6442 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6443 *ret = UpdateAddHTLC_write(obj_conv);
6447 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
6448 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6450 LDKUpdateAddHTLC* ret = MALLOC(sizeof(LDKUpdateAddHTLC), "LDKUpdateAddHTLC");
6451 *ret = UpdateAddHTLC_read(ser_conv);
6452 assert(ret->is_owned);
6453 ret->is_owned = false;
6457 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1write(JNIEnv * _env, jclass _b, jlong obj) {
6458 LDKPing* obj_conv = (LDKPing*)obj;
6459 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6460 *ret = Ping_write(obj_conv);
6464 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1read(JNIEnv * _env, jclass _b, jlong ser) {
6465 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6467 LDKPing* ret = MALLOC(sizeof(LDKPing), "LDKPing");
6468 *ret = Ping_read(ser_conv);
6469 assert(ret->is_owned);
6470 ret->is_owned = false;
6474 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1write(JNIEnv * _env, jclass _b, jlong obj) {
6475 LDKPong* obj_conv = (LDKPong*)obj;
6476 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6477 *ret = Pong_write(obj_conv);
6481 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1read(JNIEnv * _env, jclass _b, jlong ser) {
6482 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6484 LDKPong* ret = MALLOC(sizeof(LDKPong), "LDKPong");
6485 *ret = Pong_read(ser_conv);
6486 assert(ret->is_owned);
6487 ret->is_owned = false;
6491 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
6492 LDKUnsignedChannelAnnouncement* obj_conv = (LDKUnsignedChannelAnnouncement*)obj;
6493 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6494 *ret = UnsignedChannelAnnouncement_write(obj_conv);
6498 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
6499 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6501 LDKUnsignedChannelAnnouncement* ret = MALLOC(sizeof(LDKUnsignedChannelAnnouncement), "LDKUnsignedChannelAnnouncement");
6502 *ret = UnsignedChannelAnnouncement_read(ser_conv);
6503 assert(ret->is_owned);
6504 ret->is_owned = false;
6508 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
6509 LDKChannelAnnouncement* obj_conv = (LDKChannelAnnouncement*)obj;
6510 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6511 *ret = ChannelAnnouncement_write(obj_conv);
6515 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
6516 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6518 LDKChannelAnnouncement* ret = MALLOC(sizeof(LDKChannelAnnouncement), "LDKChannelAnnouncement");
6519 *ret = ChannelAnnouncement_read(ser_conv);
6520 assert(ret->is_owned);
6521 ret->is_owned = false;
6525 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
6526 LDKUnsignedChannelUpdate* obj_conv = (LDKUnsignedChannelUpdate*)obj;
6527 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6528 *ret = UnsignedChannelUpdate_write(obj_conv);
6532 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
6533 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6535 LDKUnsignedChannelUpdate* ret = MALLOC(sizeof(LDKUnsignedChannelUpdate), "LDKUnsignedChannelUpdate");
6536 *ret = UnsignedChannelUpdate_read(ser_conv);
6537 assert(ret->is_owned);
6538 ret->is_owned = false;
6542 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
6543 LDKChannelUpdate* obj_conv = (LDKChannelUpdate*)obj;
6544 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6545 *ret = ChannelUpdate_write(obj_conv);
6549 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
6550 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6552 LDKChannelUpdate* ret = MALLOC(sizeof(LDKChannelUpdate), "LDKChannelUpdate");
6553 *ret = ChannelUpdate_read(ser_conv);
6554 assert(ret->is_owned);
6555 ret->is_owned = false;
6559 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1write(JNIEnv * _env, jclass _b, jlong obj) {
6560 LDKErrorMessage* obj_conv = (LDKErrorMessage*)obj;
6561 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6562 *ret = ErrorMessage_write(obj_conv);
6566 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1read(JNIEnv * _env, jclass _b, jlong ser) {
6567 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6569 LDKErrorMessage* ret = MALLOC(sizeof(LDKErrorMessage), "LDKErrorMessage");
6570 *ret = ErrorMessage_read(ser_conv);
6571 assert(ret->is_owned);
6572 ret->is_owned = false;
6576 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
6577 LDKUnsignedNodeAnnouncement* obj_conv = (LDKUnsignedNodeAnnouncement*)obj;
6578 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6579 *ret = UnsignedNodeAnnouncement_write(obj_conv);
6583 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
6584 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6586 LDKUnsignedNodeAnnouncement* ret = MALLOC(sizeof(LDKUnsignedNodeAnnouncement), "LDKUnsignedNodeAnnouncement");
6587 *ret = UnsignedNodeAnnouncement_read(ser_conv);
6588 assert(ret->is_owned);
6589 ret->is_owned = false;
6593 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
6594 LDKNodeAnnouncement* obj_conv = (LDKNodeAnnouncement*)obj;
6595 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6596 *ret = NodeAnnouncement_write(obj_conv);
6600 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
6601 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6603 LDKNodeAnnouncement* ret = MALLOC(sizeof(LDKNodeAnnouncement), "LDKNodeAnnouncement");
6604 *ret = NodeAnnouncement_read(ser_conv);
6605 assert(ret->is_owned);
6606 ret->is_owned = false;
6610 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1read(JNIEnv * _env, jclass _b, jlong ser) {
6611 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6613 LDKQueryShortChannelIds* ret = MALLOC(sizeof(LDKQueryShortChannelIds), "LDKQueryShortChannelIds");
6614 *ret = QueryShortChannelIds_read(ser_conv);
6615 assert(ret->is_owned);
6616 ret->is_owned = false;
6620 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1write(JNIEnv * _env, jclass _b, jlong obj) {
6621 LDKQueryShortChannelIds* obj_conv = (LDKQueryShortChannelIds*)obj;
6622 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6623 *ret = QueryShortChannelIds_write(obj_conv);
6627 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1read(JNIEnv * _env, jclass _b, jlong ser) {
6628 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6630 LDKReplyShortChannelIdsEnd* ret = MALLOC(sizeof(LDKReplyShortChannelIdsEnd), "LDKReplyShortChannelIdsEnd");
6631 *ret = ReplyShortChannelIdsEnd_read(ser_conv);
6632 assert(ret->is_owned);
6633 ret->is_owned = false;
6637 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1write(JNIEnv * _env, jclass _b, jlong obj) {
6638 LDKReplyShortChannelIdsEnd* obj_conv = (LDKReplyShortChannelIdsEnd*)obj;
6639 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6640 *ret = ReplyShortChannelIdsEnd_write(obj_conv);
6644 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1read(JNIEnv * _env, jclass _b, jlong ser) {
6645 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6647 LDKQueryChannelRange* ret = MALLOC(sizeof(LDKQueryChannelRange), "LDKQueryChannelRange");
6648 *ret = QueryChannelRange_read(ser_conv);
6649 assert(ret->is_owned);
6650 ret->is_owned = false;
6654 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1write(JNIEnv * _env, jclass _b, jlong obj) {
6655 LDKQueryChannelRange* obj_conv = (LDKQueryChannelRange*)obj;
6656 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6657 *ret = QueryChannelRange_write(obj_conv);
6661 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1read(JNIEnv * _env, jclass _b, jlong ser) {
6662 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6664 LDKReplyChannelRange* ret = MALLOC(sizeof(LDKReplyChannelRange), "LDKReplyChannelRange");
6665 *ret = ReplyChannelRange_read(ser_conv);
6666 assert(ret->is_owned);
6667 ret->is_owned = false;
6671 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1write(JNIEnv * _env, jclass _b, jlong obj) {
6672 LDKReplyChannelRange* obj_conv = (LDKReplyChannelRange*)obj;
6673 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6674 *ret = ReplyChannelRange_write(obj_conv);
6678 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1read(JNIEnv * _env, jclass _b, jlong ser) {
6679 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6681 LDKGossipTimestampFilter* ret = MALLOC(sizeof(LDKGossipTimestampFilter), "LDKGossipTimestampFilter");
6682 *ret = GossipTimestampFilter_read(ser_conv);
6683 assert(ret->is_owned);
6684 ret->is_owned = false;
6688 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1write(JNIEnv * _env, jclass _b, jlong obj) {
6689 LDKGossipTimestampFilter* obj_conv = (LDKGossipTimestampFilter*)obj;
6690 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6691 *ret = GossipTimestampFilter_write(obj_conv);
6695 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6696 LDKMessageHandler this_ptr_conv = *(LDKMessageHandler*)this_ptr;
6697 FREE((void*)this_ptr);
6698 this_ptr_conv.is_owned = true;
6699 return MessageHandler_free(this_ptr_conv);
6702 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1chan_1handler(JNIEnv * _env, jclass _b, jlong this_ptr) {
6703 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
6704 long ret = (long)MessageHandler_get_chan_handler(this_ptr_conv);
6708 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1chan_1handler(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6709 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
6710 LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)val;
6711 if (val_conv.free == LDKChannelMessageHandler_JCalls_free) {
6712 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
6713 LDKChannelMessageHandler_JCalls_clone(val_conv.this_arg);
6715 return MessageHandler_set_chan_handler(this_ptr_conv, val_conv);
6718 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1route_1handler(JNIEnv * _env, jclass _b, jlong this_ptr) {
6719 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
6720 long ret = (long)MessageHandler_get_route_handler(this_ptr_conv);
6724 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1route_1handler(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6725 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
6726 LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)val;
6727 if (val_conv.free == LDKRoutingMessageHandler_JCalls_free) {
6728 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
6729 LDKRoutingMessageHandler_JCalls_clone(val_conv.this_arg);
6731 return MessageHandler_set_route_handler(this_ptr_conv, val_conv);
6734 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new(JNIEnv * _env, jclass _b, jlong chan_handler_arg, jlong route_handler_arg) {
6735 LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)chan_handler_arg;
6736 if (chan_handler_arg_conv.free == LDKChannelMessageHandler_JCalls_free) {
6737 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
6738 LDKChannelMessageHandler_JCalls_clone(chan_handler_arg_conv.this_arg);
6740 LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)route_handler_arg;
6741 if (route_handler_arg_conv.free == LDKRoutingMessageHandler_JCalls_free) {
6742 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
6743 LDKRoutingMessageHandler_JCalls_clone(route_handler_arg_conv.this_arg);
6745 LDKMessageHandler* ret = MALLOC(sizeof(LDKMessageHandler), "LDKMessageHandler");
6746 *ret = MessageHandler_new(chan_handler_arg_conv, route_handler_arg_conv);
6747 assert(ret->is_owned);
6748 ret->is_owned = false;
6752 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6753 LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)this_ptr;
6754 FREE((void*)this_ptr);
6755 return SocketDescriptor_free(this_ptr_conv);
6758 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6759 LDKPeerHandleError this_ptr_conv = *(LDKPeerHandleError*)this_ptr;
6760 FREE((void*)this_ptr);
6761 this_ptr_conv.is_owned = true;
6762 return PeerHandleError_free(this_ptr_conv);
6765 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1get_1no_1connection_1possible(JNIEnv * _env, jclass _b, jlong this_ptr) {
6766 LDKPeerHandleError* this_ptr_conv = (LDKPeerHandleError*)this_ptr;
6767 return PeerHandleError_get_no_connection_possible(this_ptr_conv);
6770 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1set_1no_1connection_1possible(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
6771 LDKPeerHandleError* this_ptr_conv = (LDKPeerHandleError*)this_ptr;
6772 return PeerHandleError_set_no_connection_possible(this_ptr_conv, val);
6775 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new(JNIEnv * _env, jclass _b, jboolean no_connection_possible_arg) {
6776 LDKPeerHandleError* ret = MALLOC(sizeof(LDKPeerHandleError), "LDKPeerHandleError");
6777 *ret = PeerHandleError_new(no_connection_possible_arg);
6778 assert(ret->is_owned);
6779 ret->is_owned = false;
6783 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6784 LDKPeerManager this_ptr_conv = *(LDKPeerManager*)this_ptr;
6785 FREE((void*)this_ptr);
6786 this_ptr_conv.is_owned = true;
6787 return PeerManager_free(this_ptr_conv);
6790 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1new(JNIEnv * _env, jclass _b, jlong message_handler, jlong our_node_secret, jbyteArray ephemeral_random_data, jlong logger) {
6791 LDKMessageHandler message_handler_conv = *(LDKMessageHandler*)message_handler;
6792 FREE((void*)message_handler);
6793 message_handler_conv.is_owned = true;
6794 LDKSecretKey our_node_secret_conv = *(LDKSecretKey*)our_node_secret;
6795 FREE((void*)our_node_secret);
6796 unsigned char ephemeral_random_data_arr[32];
6797 (*_env)->GetByteArrayRegion (_env, ephemeral_random_data, 0, 32, ephemeral_random_data_arr);
6798 unsigned char (*ephemeral_random_data_ref)[32] = &ephemeral_random_data_arr;
6799 LDKLogger logger_conv = *(LDKLogger*)logger;
6800 if (logger_conv.free == LDKLogger_JCalls_free) {
6801 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
6802 LDKLogger_JCalls_clone(logger_conv.this_arg);
6804 LDKPeerManager* ret = MALLOC(sizeof(LDKPeerManager), "LDKPeerManager");
6805 *ret = PeerManager_new(message_handler_conv, our_node_secret_conv, ephemeral_random_data_ref, logger_conv);
6806 assert(ret->is_owned);
6807 ret->is_owned = false;
6811 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1get_1peer_1node_1ids(JNIEnv * _env, jclass _b, jlong this_arg) {
6812 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
6813 LDKCVec_PublicKeyZ* ret = MALLOC(sizeof(LDKCVec_PublicKeyZ), "LDKCVec_PublicKeyZ");
6814 *ret = PeerManager_get_peer_node_ids(this_arg_conv);
6818 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1outbound_1connection(JNIEnv * _env, jclass _b, jlong this_arg, jlong their_node_id, jlong descriptor) {
6819 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
6820 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
6821 FREE((void*)their_node_id);
6822 LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)descriptor;
6823 if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
6824 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
6825 LDKSocketDescriptor_JCalls_clone(descriptor_conv.this_arg);
6827 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
6828 *ret = PeerManager_new_outbound_connection(this_arg_conv, their_node_id_conv, descriptor_conv);
6832 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1inbound_1connection(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) {
6833 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
6834 LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)descriptor;
6835 if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
6836 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
6837 LDKSocketDescriptor_JCalls_clone(descriptor_conv.this_arg);
6839 LDKCResult_NonePeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
6840 *ret = PeerManager_new_inbound_connection(this_arg_conv, descriptor_conv);
6844 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1write_1buffer_1space_1avail(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) {
6845 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
6846 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor;
6847 LDKCResult_NonePeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
6848 *ret = PeerManager_write_buffer_space_avail(this_arg_conv, descriptor_conv);
6852 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1read_1event(JNIEnv * _env, jclass _b, jlong this_arg, jlong peer_descriptor, jlong data) {
6853 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
6854 LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor;
6855 LDKu8slice data_conv = *(LDKu8slice*)data;
6857 LDKCResult_boolPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
6858 *ret = PeerManager_read_event(this_arg_conv, peer_descriptor_conv, data_conv);
6862 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1process_1events(JNIEnv * _env, jclass _b, jlong this_arg) {
6863 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
6864 return PeerManager_process_events(this_arg_conv);
6867 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1socket_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) {
6868 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
6869 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor;
6870 return PeerManager_socket_disconnected(this_arg_conv, descriptor_conv);
6873 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1timer_1tick_1occured(JNIEnv * _env, jclass _b, jlong this_arg) {
6874 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
6875 return PeerManager_timer_tick_occured(this_arg_conv);
6878 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_build_1commitment_1secret(JNIEnv * _env, jclass _b, jbyteArray commitment_seed, jlong idx) {
6879 unsigned char commitment_seed_arr[32];
6880 (*_env)->GetByteArrayRegion (_env, commitment_seed, 0, 32, commitment_seed_arr);
6881 unsigned char (*commitment_seed_ref)[32] = &commitment_seed_arr;
6882 LDKThirtyTwoBytes* ret = MALLOC(sizeof(LDKThirtyTwoBytes), "LDKThirtyTwoBytes");
6883 *ret = build_commitment_secret(commitment_seed_ref, idx);
6887 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1private_1key(JNIEnv * _env, jclass _b, jlong per_commitment_point, jbyteArray base_secret) {
6888 LDKPublicKey per_commitment_point_conv = *(LDKPublicKey*)per_commitment_point;
6889 FREE((void*)per_commitment_point);
6890 unsigned char base_secret_arr[32];
6891 (*_env)->GetByteArrayRegion (_env, base_secret, 0, 32, base_secret_arr);
6892 unsigned char (*base_secret_ref)[32] = &base_secret_arr;
6893 LDKCResult_SecretKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ");
6894 *ret = derive_private_key(per_commitment_point_conv, base_secret_ref);
6898 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1public_1key(JNIEnv * _env, jclass _b, jlong per_commitment_point, jlong base_point) {
6899 LDKPublicKey per_commitment_point_conv = *(LDKPublicKey*)per_commitment_point;
6900 FREE((void*)per_commitment_point);
6901 LDKPublicKey base_point_conv = *(LDKPublicKey*)base_point;
6902 FREE((void*)base_point);
6903 LDKCResult_PublicKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ");
6904 *ret = derive_public_key(per_commitment_point_conv, base_point_conv);
6908 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1private_1revocation_1key(JNIEnv * _env, jclass _b, jbyteArray per_commitment_secret, jbyteArray countersignatory_revocation_base_secret) {
6909 unsigned char per_commitment_secret_arr[32];
6910 (*_env)->GetByteArrayRegion (_env, per_commitment_secret, 0, 32, per_commitment_secret_arr);
6911 unsigned char (*per_commitment_secret_ref)[32] = &per_commitment_secret_arr;
6912 unsigned char countersignatory_revocation_base_secret_arr[32];
6913 (*_env)->GetByteArrayRegion (_env, countersignatory_revocation_base_secret, 0, 32, countersignatory_revocation_base_secret_arr);
6914 unsigned char (*countersignatory_revocation_base_secret_ref)[32] = &countersignatory_revocation_base_secret_arr;
6915 LDKCResult_SecretKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ");
6916 *ret = derive_private_revocation_key(per_commitment_secret_ref, countersignatory_revocation_base_secret_ref);
6920 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1public_1revocation_1key(JNIEnv * _env, jclass _b, jlong per_commitment_point, jlong countersignatory_revocation_base_point) {
6921 LDKPublicKey per_commitment_point_conv = *(LDKPublicKey*)per_commitment_point;
6922 FREE((void*)per_commitment_point);
6923 LDKPublicKey countersignatory_revocation_base_point_conv = *(LDKPublicKey*)countersignatory_revocation_base_point;
6924 FREE((void*)countersignatory_revocation_base_point);
6925 LDKCResult_PublicKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ");
6926 *ret = derive_public_revocation_key(per_commitment_point_conv, countersignatory_revocation_base_point_conv);
6930 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6931 LDKTxCreationKeys this_ptr_conv = *(LDKTxCreationKeys*)this_ptr;
6932 FREE((void*)this_ptr);
6933 this_ptr_conv.is_owned = true;
6934 return TxCreationKeys_free(this_ptr_conv);
6937 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
6938 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6939 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6940 *ret = TxCreationKeys_get_per_commitment_point(this_ptr_conv);
6944 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6945 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6946 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6948 return TxCreationKeys_set_per_commitment_point(this_ptr_conv, val_conv);
6951 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1revocation_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
6952 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6953 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6954 *ret = TxCreationKeys_get_revocation_key(this_ptr_conv);
6958 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1revocation_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6959 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6960 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6962 return TxCreationKeys_set_revocation_key(this_ptr_conv, val_conv);
6965 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
6966 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6967 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6968 *ret = TxCreationKeys_get_broadcaster_htlc_key(this_ptr_conv);
6972 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6973 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6974 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6976 return TxCreationKeys_set_broadcaster_htlc_key(this_ptr_conv, val_conv);
6979 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1countersignatory_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
6980 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6981 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6982 *ret = TxCreationKeys_get_countersignatory_htlc_key(this_ptr_conv);
6986 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1countersignatory_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6987 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6988 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6990 return TxCreationKeys_set_countersignatory_htlc_key(this_ptr_conv, val_conv);
6993 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1delayed_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
6994 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6995 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6996 *ret = TxCreationKeys_get_broadcaster_delayed_payment_key(this_ptr_conv);
7000 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1delayed_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7001 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
7002 LDKPublicKey val_conv = *(LDKPublicKey*)val;
7004 return TxCreationKeys_set_broadcaster_delayed_payment_key(this_ptr_conv, val_conv);
7007 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1new(JNIEnv * _env, jclass _b, jlong per_commitment_point_arg, jlong revocation_key_arg, jlong broadcaster_htlc_key_arg, jlong countersignatory_htlc_key_arg, jlong broadcaster_delayed_payment_key_arg) {
7008 LDKPublicKey per_commitment_point_arg_conv = *(LDKPublicKey*)per_commitment_point_arg;
7009 FREE((void*)per_commitment_point_arg);
7010 LDKPublicKey revocation_key_arg_conv = *(LDKPublicKey*)revocation_key_arg;
7011 FREE((void*)revocation_key_arg);
7012 LDKPublicKey broadcaster_htlc_key_arg_conv = *(LDKPublicKey*)broadcaster_htlc_key_arg;
7013 FREE((void*)broadcaster_htlc_key_arg);
7014 LDKPublicKey countersignatory_htlc_key_arg_conv = *(LDKPublicKey*)countersignatory_htlc_key_arg;
7015 FREE((void*)countersignatory_htlc_key_arg);
7016 LDKPublicKey broadcaster_delayed_payment_key_arg_conv = *(LDKPublicKey*)broadcaster_delayed_payment_key_arg;
7017 FREE((void*)broadcaster_delayed_payment_key_arg);
7018 LDKTxCreationKeys* ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
7019 *ret = TxCreationKeys_new(per_commitment_point_arg_conv, revocation_key_arg_conv, broadcaster_htlc_key_arg_conv, countersignatory_htlc_key_arg_conv, broadcaster_delayed_payment_key_arg_conv);
7020 assert(ret->is_owned);
7021 ret->is_owned = false;
7025 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1write(JNIEnv * _env, jclass _b, jlong obj) {
7026 LDKTxCreationKeys* obj_conv = (LDKTxCreationKeys*)obj;
7027 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7028 *ret = TxCreationKeys_write(obj_conv);
7032 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1read(JNIEnv * _env, jclass _b, jlong ser) {
7033 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7035 LDKTxCreationKeys* ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
7036 *ret = TxCreationKeys_read(ser_conv);
7037 assert(ret->is_owned);
7038 ret->is_owned = false;
7042 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7043 LDKPreCalculatedTxCreationKeys this_ptr_conv = *(LDKPreCalculatedTxCreationKeys*)this_ptr;
7044 FREE((void*)this_ptr);
7045 this_ptr_conv.is_owned = true;
7046 return PreCalculatedTxCreationKeys_free(this_ptr_conv);
7049 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1new(JNIEnv * _env, jclass _b, jlong keys) {
7050 LDKTxCreationKeys keys_conv = *(LDKTxCreationKeys*)keys;
7052 keys_conv.is_owned = true;
7053 LDKPreCalculatedTxCreationKeys* ret = MALLOC(sizeof(LDKPreCalculatedTxCreationKeys), "LDKPreCalculatedTxCreationKeys");
7054 *ret = PreCalculatedTxCreationKeys_new(keys_conv);
7055 assert(ret->is_owned);
7056 ret->is_owned = false;
7060 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1trust_1key_1derivation(JNIEnv * _env, jclass _b, jlong this_arg) {
7061 LDKPreCalculatedTxCreationKeys* this_arg_conv = (LDKPreCalculatedTxCreationKeys*)this_arg;
7062 LDKTxCreationKeys* ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
7063 *ret = PreCalculatedTxCreationKeys_trust_key_derivation(this_arg_conv);
7064 assert(ret->is_owned);
7065 ret->is_owned = false;
7069 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_arg) {
7070 LDKPreCalculatedTxCreationKeys* this_arg_conv = (LDKPreCalculatedTxCreationKeys*)this_arg;
7071 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
7072 *ret = PreCalculatedTxCreationKeys_per_commitment_point(this_arg_conv);
7076 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7077 LDKChannelPublicKeys this_ptr_conv = *(LDKChannelPublicKeys*)this_ptr;
7078 FREE((void*)this_ptr);
7079 this_ptr_conv.is_owned = true;
7080 return ChannelPublicKeys_free(this_ptr_conv);
7083 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
7084 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
7085 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
7086 *ret = ChannelPublicKeys_get_funding_pubkey(this_ptr_conv);
7090 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7091 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
7092 LDKPublicKey val_conv = *(LDKPublicKey*)val;
7094 return ChannelPublicKeys_set_funding_pubkey(this_ptr_conv, val_conv);
7097 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
7098 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
7099 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
7100 *ret = ChannelPublicKeys_get_revocation_basepoint(this_ptr_conv);
7104 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7105 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
7106 LDKPublicKey val_conv = *(LDKPublicKey*)val;
7108 return ChannelPublicKeys_set_revocation_basepoint(this_ptr_conv, val_conv);
7111 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
7112 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
7113 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
7114 *ret = ChannelPublicKeys_get_payment_point(this_ptr_conv);
7118 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7119 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
7120 LDKPublicKey val_conv = *(LDKPublicKey*)val;
7122 return ChannelPublicKeys_set_payment_point(this_ptr_conv, val_conv);
7125 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
7126 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
7127 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
7128 *ret = ChannelPublicKeys_get_delayed_payment_basepoint(this_ptr_conv);
7132 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7133 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
7134 LDKPublicKey val_conv = *(LDKPublicKey*)val;
7136 return ChannelPublicKeys_set_delayed_payment_basepoint(this_ptr_conv, val_conv);
7139 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
7140 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
7141 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
7142 *ret = ChannelPublicKeys_get_htlc_basepoint(this_ptr_conv);
7146 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7147 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
7148 LDKPublicKey val_conv = *(LDKPublicKey*)val;
7150 return ChannelPublicKeys_set_htlc_basepoint(this_ptr_conv, val_conv);
7153 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1new(JNIEnv * _env, jclass _b, jlong funding_pubkey_arg, jlong revocation_basepoint_arg, jlong payment_point_arg, jlong delayed_payment_basepoint_arg, jlong htlc_basepoint_arg) {
7154 LDKPublicKey funding_pubkey_arg_conv = *(LDKPublicKey*)funding_pubkey_arg;
7155 FREE((void*)funding_pubkey_arg);
7156 LDKPublicKey revocation_basepoint_arg_conv = *(LDKPublicKey*)revocation_basepoint_arg;
7157 FREE((void*)revocation_basepoint_arg);
7158 LDKPublicKey payment_point_arg_conv = *(LDKPublicKey*)payment_point_arg;
7159 FREE((void*)payment_point_arg);
7160 LDKPublicKey delayed_payment_basepoint_arg_conv = *(LDKPublicKey*)delayed_payment_basepoint_arg;
7161 FREE((void*)delayed_payment_basepoint_arg);
7162 LDKPublicKey htlc_basepoint_arg_conv = *(LDKPublicKey*)htlc_basepoint_arg;
7163 FREE((void*)htlc_basepoint_arg);
7164 LDKChannelPublicKeys* ret = MALLOC(sizeof(LDKChannelPublicKeys), "LDKChannelPublicKeys");
7165 *ret = ChannelPublicKeys_new(funding_pubkey_arg_conv, revocation_basepoint_arg_conv, payment_point_arg_conv, delayed_payment_basepoint_arg_conv, htlc_basepoint_arg_conv);
7166 assert(ret->is_owned);
7167 ret->is_owned = false;
7171 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1write(JNIEnv * _env, jclass _b, jlong obj) {
7172 LDKChannelPublicKeys* obj_conv = (LDKChannelPublicKeys*)obj;
7173 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7174 *ret = ChannelPublicKeys_write(obj_conv);
7178 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1read(JNIEnv * _env, jclass _b, jlong ser) {
7179 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7181 LDKChannelPublicKeys* ret = MALLOC(sizeof(LDKChannelPublicKeys), "LDKChannelPublicKeys");
7182 *ret = ChannelPublicKeys_read(ser_conv);
7183 assert(ret->is_owned);
7184 ret->is_owned = false;
7188 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1derive_1new(JNIEnv * _env, jclass _b, jlong per_commitment_point, jlong broadcaster_delayed_payment_base, jlong broadcaster_htlc_base, jlong countersignatory_revocation_base, jlong countersignatory_htlc_base) {
7189 LDKPublicKey per_commitment_point_conv = *(LDKPublicKey*)per_commitment_point;
7190 FREE((void*)per_commitment_point);
7191 LDKPublicKey broadcaster_delayed_payment_base_conv = *(LDKPublicKey*)broadcaster_delayed_payment_base;
7192 FREE((void*)broadcaster_delayed_payment_base);
7193 LDKPublicKey broadcaster_htlc_base_conv = *(LDKPublicKey*)broadcaster_htlc_base;
7194 FREE((void*)broadcaster_htlc_base);
7195 LDKPublicKey countersignatory_revocation_base_conv = *(LDKPublicKey*)countersignatory_revocation_base;
7196 FREE((void*)countersignatory_revocation_base);
7197 LDKPublicKey countersignatory_htlc_base_conv = *(LDKPublicKey*)countersignatory_htlc_base;
7198 FREE((void*)countersignatory_htlc_base);
7199 LDKCResult_TxCreationKeysSecpErrorZ* ret = MALLOC(sizeof(LDKCResult_TxCreationKeysSecpErrorZ), "LDKCResult_TxCreationKeysSecpErrorZ");
7200 *ret = TxCreationKeys_derive_new(per_commitment_point_conv, broadcaster_delayed_payment_base_conv, broadcaster_htlc_base_conv, countersignatory_revocation_base_conv, countersignatory_htlc_base_conv);
7204 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_get_1revokeable_1redeemscript(JNIEnv * _env, jclass _b, jlong revocation_key, jshort contest_delay, jlong broadcaster_delayed_payment_key) {
7205 LDKPublicKey revocation_key_conv = *(LDKPublicKey*)revocation_key;
7206 FREE((void*)revocation_key);
7207 LDKPublicKey broadcaster_delayed_payment_key_conv = *(LDKPublicKey*)broadcaster_delayed_payment_key;
7208 FREE((void*)broadcaster_delayed_payment_key);
7209 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7210 *ret = get_revokeable_redeemscript(revocation_key_conv, contest_delay, broadcaster_delayed_payment_key_conv);
7214 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7215 LDKHTLCOutputInCommitment this_ptr_conv = *(LDKHTLCOutputInCommitment*)this_ptr;
7216 FREE((void*)this_ptr);
7217 this_ptr_conv.is_owned = true;
7218 return HTLCOutputInCommitment_free(this_ptr_conv);
7221 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1offered(JNIEnv * _env, jclass _b, jlong this_ptr) {
7222 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
7223 return HTLCOutputInCommitment_get_offered(this_ptr_conv);
7226 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1offered(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
7227 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
7228 return HTLCOutputInCommitment_set_offered(this_ptr_conv, val);
7231 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
7232 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
7233 return HTLCOutputInCommitment_get_amount_msat(this_ptr_conv);
7236 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7237 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
7238 return HTLCOutputInCommitment_set_amount_msat(this_ptr_conv, val);
7241 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr) {
7242 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
7243 return HTLCOutputInCommitment_get_cltv_expiry(this_ptr_conv);
7246 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
7247 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
7248 return HTLCOutputInCommitment_set_cltv_expiry(this_ptr_conv, val);
7251 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
7252 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
7253 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
7254 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *HTLCOutputInCommitment_get_payment_hash(this_ptr_conv));
7258 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7259 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
7260 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
7262 return HTLCOutputInCommitment_set_payment_hash(this_ptr_conv, val_conv);
7265 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1write(JNIEnv * _env, jclass _b, jlong obj) {
7266 LDKHTLCOutputInCommitment* obj_conv = (LDKHTLCOutputInCommitment*)obj;
7267 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7268 *ret = HTLCOutputInCommitment_write(obj_conv);
7272 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1read(JNIEnv * _env, jclass _b, jlong ser) {
7273 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7275 LDKHTLCOutputInCommitment* ret = MALLOC(sizeof(LDKHTLCOutputInCommitment), "LDKHTLCOutputInCommitment");
7276 *ret = HTLCOutputInCommitment_read(ser_conv);
7277 assert(ret->is_owned);
7278 ret->is_owned = false;
7282 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_get_1htlc_1redeemscript(JNIEnv * _env, jclass _b, jlong htlc, jlong keys) {
7283 LDKHTLCOutputInCommitment* htlc_conv = (LDKHTLCOutputInCommitment*)htlc;
7284 LDKTxCreationKeys* keys_conv = (LDKTxCreationKeys*)keys;
7285 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7286 *ret = get_htlc_redeemscript(htlc_conv, keys_conv);
7290 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_make_1funding_1redeemscript(JNIEnv * _env, jclass _b, jlong broadcaster, jlong countersignatory) {
7291 LDKPublicKey broadcaster_conv = *(LDKPublicKey*)broadcaster;
7292 FREE((void*)broadcaster);
7293 LDKPublicKey countersignatory_conv = *(LDKPublicKey*)countersignatory;
7294 FREE((void*)countersignatory);
7295 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7296 *ret = make_funding_redeemscript(broadcaster_conv, countersignatory_conv);
7300 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_build_1htlc_1transaction(JNIEnv * _env, jclass _b, jbyteArray prev_hash, jint feerate_per_kw, jshort contest_delay, jlong htlc, jlong broadcaster_delayed_payment_key, jlong revocation_key) {
7301 unsigned char prev_hash_arr[32];
7302 (*_env)->GetByteArrayRegion (_env, prev_hash, 0, 32, prev_hash_arr);
7303 unsigned char (*prev_hash_ref)[32] = &prev_hash_arr;
7304 LDKHTLCOutputInCommitment* htlc_conv = (LDKHTLCOutputInCommitment*)htlc;
7305 LDKPublicKey broadcaster_delayed_payment_key_conv = *(LDKPublicKey*)broadcaster_delayed_payment_key;
7306 FREE((void*)broadcaster_delayed_payment_key);
7307 LDKPublicKey revocation_key_conv = *(LDKPublicKey*)revocation_key;
7308 FREE((void*)revocation_key);
7309 LDKTransaction* ret = MALLOC(sizeof(LDKTransaction), "LDKTransaction");
7310 *ret = build_htlc_transaction(prev_hash_ref, feerate_per_kw, contest_delay, htlc_conv, broadcaster_delayed_payment_key_conv, revocation_key_conv);
7314 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7315 LDKHolderCommitmentTransaction this_ptr_conv = *(LDKHolderCommitmentTransaction*)this_ptr;
7316 FREE((void*)this_ptr);
7317 this_ptr_conv.is_owned = true;
7318 return HolderCommitmentTransaction_free(this_ptr_conv);
7321 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1unsigned_1tx(JNIEnv * _env, jclass _b, jlong this_ptr) {
7322 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
7323 LDKTransaction* ret = MALLOC(sizeof(LDKTransaction), "LDKTransaction");
7324 *ret = HolderCommitmentTransaction_get_unsigned_tx(this_ptr_conv);
7328 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1unsigned_1tx(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7329 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
7330 LDKTransaction val_conv = *(LDKTransaction*)val;
7332 return HolderCommitmentTransaction_set_unsigned_tx(this_ptr_conv, val_conv);
7335 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1counterparty_1sig(JNIEnv * _env, jclass _b, jlong this_ptr) {
7336 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
7337 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
7338 *ret = HolderCommitmentTransaction_get_counterparty_sig(this_ptr_conv);
7342 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1sig(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7343 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
7344 LDKSignature val_conv = *(LDKSignature*)val;
7346 return HolderCommitmentTransaction_set_counterparty_sig(this_ptr_conv, val_conv);
7349 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr) {
7350 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
7351 return HolderCommitmentTransaction_get_feerate_per_kw(this_ptr_conv);
7354 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
7355 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
7356 return HolderCommitmentTransaction_set_feerate_per_kw(this_ptr_conv, val);
7359 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1per_1htlc(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7360 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
7361 LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ val_conv = *(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ*)val;
7363 return HolderCommitmentTransaction_set_per_htlc(this_ptr_conv, val_conv);
7366 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1new_1missing_1holder_1sig(JNIEnv * _env, jclass _b, jlong unsigned_tx, jlong counterparty_sig, jlong holder_funding_key, jlong counterparty_funding_key, jlong keys, jint feerate_per_kw, jlong htlc_data) {
7367 LDKTransaction unsigned_tx_conv = *(LDKTransaction*)unsigned_tx;
7368 FREE((void*)unsigned_tx);
7369 LDKSignature counterparty_sig_conv = *(LDKSignature*)counterparty_sig;
7370 FREE((void*)counterparty_sig);
7371 LDKPublicKey holder_funding_key_conv = *(LDKPublicKey*)holder_funding_key;
7372 FREE((void*)holder_funding_key);
7373 LDKPublicKey counterparty_funding_key_conv = *(LDKPublicKey*)counterparty_funding_key;
7374 FREE((void*)counterparty_funding_key);
7375 LDKTxCreationKeys keys_conv = *(LDKTxCreationKeys*)keys;
7377 keys_conv.is_owned = true;
7378 LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ htlc_data_conv = *(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ*)htlc_data;
7379 FREE((void*)htlc_data);
7380 LDKHolderCommitmentTransaction* ret = MALLOC(sizeof(LDKHolderCommitmentTransaction), "LDKHolderCommitmentTransaction");
7381 *ret = HolderCommitmentTransaction_new_missing_holder_sig(unsigned_tx_conv, counterparty_sig_conv, holder_funding_key_conv, counterparty_funding_key_conv, keys_conv, feerate_per_kw, htlc_data_conv);
7382 assert(ret->is_owned);
7383 ret->is_owned = false;
7387 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1trust_1key_1derivation(JNIEnv * _env, jclass _b, jlong this_arg) {
7388 LDKHolderCommitmentTransaction* this_arg_conv = (LDKHolderCommitmentTransaction*)this_arg;
7389 LDKTxCreationKeys* ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
7390 *ret = HolderCommitmentTransaction_trust_key_derivation(this_arg_conv);
7391 assert(ret->is_owned);
7392 ret->is_owned = false;
7396 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1txid(JNIEnv * _env, jclass _b, jlong this_arg) {
7397 LDKHolderCommitmentTransaction* this_arg_conv = (LDKHolderCommitmentTransaction*)this_arg;
7398 LDKThirtyTwoBytes* ret = MALLOC(sizeof(LDKThirtyTwoBytes), "LDKThirtyTwoBytes");
7399 *ret = HolderCommitmentTransaction_txid(this_arg_conv);
7403 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1holder_1sig(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray funding_key, jlong funding_redeemscript, jlong channel_value_satoshis) {
7404 LDKHolderCommitmentTransaction* this_arg_conv = (LDKHolderCommitmentTransaction*)this_arg;
7405 unsigned char funding_key_arr[32];
7406 (*_env)->GetByteArrayRegion (_env, funding_key, 0, 32, funding_key_arr);
7407 unsigned char (*funding_key_ref)[32] = &funding_key_arr;
7408 LDKu8slice funding_redeemscript_conv = *(LDKu8slice*)funding_redeemscript;
7409 FREE((void*)funding_redeemscript);
7410 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
7411 *ret = HolderCommitmentTransaction_get_holder_sig(this_arg_conv, funding_key_ref, funding_redeemscript_conv, channel_value_satoshis);
7415 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1htlc_1sigs(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray htlc_base_key, jshort counterparty_selected_contest_delay) {
7416 LDKHolderCommitmentTransaction* this_arg_conv = (LDKHolderCommitmentTransaction*)this_arg;
7417 unsigned char htlc_base_key_arr[32];
7418 (*_env)->GetByteArrayRegion (_env, htlc_base_key, 0, 32, htlc_base_key_arr);
7419 unsigned char (*htlc_base_key_ref)[32] = &htlc_base_key_arr;
7420 LDKCResult_CVec_SignatureZNoneZ* ret = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
7421 *ret = HolderCommitmentTransaction_get_htlc_sigs(this_arg_conv, htlc_base_key_ref, counterparty_selected_contest_delay);
7425 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1write(JNIEnv * _env, jclass _b, jlong obj) {
7426 LDKHolderCommitmentTransaction* obj_conv = (LDKHolderCommitmentTransaction*)obj;
7427 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7428 *ret = HolderCommitmentTransaction_write(obj_conv);
7432 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1read(JNIEnv * _env, jclass _b, jlong ser) {
7433 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7435 LDKHolderCommitmentTransaction* ret = MALLOC(sizeof(LDKHolderCommitmentTransaction), "LDKHolderCommitmentTransaction");
7436 *ret = HolderCommitmentTransaction_read(ser_conv);
7437 assert(ret->is_owned);
7438 ret->is_owned = false;
7442 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7443 LDKInitFeatures this_ptr_conv = *(LDKInitFeatures*)this_ptr;
7444 FREE((void*)this_ptr);
7445 this_ptr_conv.is_owned = true;
7446 return InitFeatures_free(this_ptr_conv);
7449 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7450 LDKNodeFeatures this_ptr_conv = *(LDKNodeFeatures*)this_ptr;
7451 FREE((void*)this_ptr);
7452 this_ptr_conv.is_owned = true;
7453 return NodeFeatures_free(this_ptr_conv);
7456 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7457 LDKChannelFeatures this_ptr_conv = *(LDKChannelFeatures*)this_ptr;
7458 FREE((void*)this_ptr);
7459 this_ptr_conv.is_owned = true;
7460 return ChannelFeatures_free(this_ptr_conv);
7463 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7464 LDKRouteHop this_ptr_conv = *(LDKRouteHop*)this_ptr;
7465 FREE((void*)this_ptr);
7466 this_ptr_conv.is_owned = true;
7467 return RouteHop_free(this_ptr_conv);
7470 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
7471 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
7472 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
7473 *ret = RouteHop_get_pubkey(this_ptr_conv);
7477 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7478 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
7479 LDKPublicKey val_conv = *(LDKPublicKey*)val;
7481 return RouteHop_set_pubkey(this_ptr_conv, val_conv);
7484 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1node_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
7485 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
7486 LDKNodeFeatures* ret = MALLOC(sizeof(LDKNodeFeatures), "LDKNodeFeatures");
7487 *ret = RouteHop_get_node_features(this_ptr_conv);
7488 assert(ret->is_owned);
7489 ret->is_owned = false;
7493 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1node_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7494 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
7495 LDKNodeFeatures val_conv = *(LDKNodeFeatures*)val;
7497 val_conv.is_owned = true;
7498 return RouteHop_set_node_features(this_ptr_conv, val_conv);
7501 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
7502 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
7503 return RouteHop_get_short_channel_id(this_ptr_conv);
7506 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7507 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
7508 return RouteHop_set_short_channel_id(this_ptr_conv, val);
7511 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1channel_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
7512 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
7513 LDKChannelFeatures* ret = MALLOC(sizeof(LDKChannelFeatures), "LDKChannelFeatures");
7514 *ret = RouteHop_get_channel_features(this_ptr_conv);
7515 assert(ret->is_owned);
7516 ret->is_owned = false;
7520 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1channel_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7521 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
7522 LDKChannelFeatures val_conv = *(LDKChannelFeatures*)val;
7524 val_conv.is_owned = true;
7525 return RouteHop_set_channel_features(this_ptr_conv, val_conv);
7528 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1fee_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
7529 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
7530 return RouteHop_get_fee_msat(this_ptr_conv);
7533 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1fee_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7534 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
7535 return RouteHop_set_fee_msat(this_ptr_conv, val);
7538 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
7539 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
7540 return RouteHop_get_cltv_expiry_delta(this_ptr_conv);
7543 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
7544 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
7545 return RouteHop_set_cltv_expiry_delta(this_ptr_conv, val);
7548 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1new(JNIEnv * _env, jclass _b, jlong pubkey_arg, jlong node_features_arg, jlong short_channel_id_arg, jlong channel_features_arg, jlong fee_msat_arg, jint cltv_expiry_delta_arg) {
7549 LDKPublicKey pubkey_arg_conv = *(LDKPublicKey*)pubkey_arg;
7550 FREE((void*)pubkey_arg);
7551 LDKNodeFeatures node_features_arg_conv = *(LDKNodeFeatures*)node_features_arg;
7552 FREE((void*)node_features_arg);
7553 node_features_arg_conv.is_owned = true;
7554 LDKChannelFeatures channel_features_arg_conv = *(LDKChannelFeatures*)channel_features_arg;
7555 FREE((void*)channel_features_arg);
7556 channel_features_arg_conv.is_owned = true;
7557 LDKRouteHop* ret = MALLOC(sizeof(LDKRouteHop), "LDKRouteHop");
7558 *ret = RouteHop_new(pubkey_arg_conv, node_features_arg_conv, short_channel_id_arg, channel_features_arg_conv, fee_msat_arg, cltv_expiry_delta_arg);
7559 assert(ret->is_owned);
7560 ret->is_owned = false;
7564 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7565 LDKRoute this_ptr_conv = *(LDKRoute*)this_ptr;
7566 FREE((void*)this_ptr);
7567 this_ptr_conv.is_owned = true;
7568 return Route_free(this_ptr_conv);
7571 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1paths(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7572 LDKRoute* this_ptr_conv = (LDKRoute*)this_ptr;
7573 LDKCVec_CVec_RouteHopZZ val_conv = *(LDKCVec_CVec_RouteHopZZ*)val;
7575 return Route_set_paths(this_ptr_conv, val_conv);
7578 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv * _env, jclass _b, jlong paths_arg) {
7579 LDKCVec_CVec_RouteHopZZ paths_arg_conv = *(LDKCVec_CVec_RouteHopZZ*)paths_arg;
7580 FREE((void*)paths_arg);
7581 LDKRoute* ret = MALLOC(sizeof(LDKRoute), "LDKRoute");
7582 *ret = Route_new(paths_arg_conv);
7583 assert(ret->is_owned);
7584 ret->is_owned = false;
7588 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1write(JNIEnv * _env, jclass _b, jlong obj) {
7589 LDKRoute* obj_conv = (LDKRoute*)obj;
7590 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7591 *ret = Route_write(obj_conv);
7595 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1read(JNIEnv * _env, jclass _b, jlong ser) {
7596 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7598 LDKRoute* ret = MALLOC(sizeof(LDKRoute), "LDKRoute");
7599 *ret = Route_read(ser_conv);
7600 assert(ret->is_owned);
7601 ret->is_owned = false;
7605 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7606 LDKRouteHint this_ptr_conv = *(LDKRouteHint*)this_ptr;
7607 FREE((void*)this_ptr);
7608 this_ptr_conv.is_owned = true;
7609 return RouteHint_free(this_ptr_conv);
7612 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1src_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
7613 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
7614 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
7615 *ret = RouteHint_get_src_node_id(this_ptr_conv);
7619 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1src_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7620 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
7621 LDKPublicKey val_conv = *(LDKPublicKey*)val;
7623 return RouteHint_set_src_node_id(this_ptr_conv, val_conv);
7626 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
7627 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
7628 return RouteHint_get_short_channel_id(this_ptr_conv);
7631 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7632 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
7633 return RouteHint_set_short_channel_id(this_ptr_conv, val);
7636 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1fees(JNIEnv * _env, jclass _b, jlong this_ptr) {
7637 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
7638 LDKRoutingFees* ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
7639 *ret = RouteHint_get_fees(this_ptr_conv);
7640 assert(ret->is_owned);
7641 ret->is_owned = false;
7645 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1fees(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7646 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
7647 LDKRoutingFees val_conv = *(LDKRoutingFees*)val;
7649 val_conv.is_owned = true;
7650 return RouteHint_set_fees(this_ptr_conv, val_conv);
7653 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
7654 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
7655 return RouteHint_get_cltv_expiry_delta(this_ptr_conv);
7658 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
7659 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
7660 return RouteHint_set_cltv_expiry_delta(this_ptr_conv, val);
7663 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
7664 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
7665 return RouteHint_get_htlc_minimum_msat(this_ptr_conv);
7668 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7669 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
7670 return RouteHint_set_htlc_minimum_msat(this_ptr_conv, val);
7673 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1new(JNIEnv * _env, jclass _b, jlong src_node_id_arg, jlong short_channel_id_arg, jlong fees_arg, jshort cltv_expiry_delta_arg, jlong htlc_minimum_msat_arg) {
7674 LDKPublicKey src_node_id_arg_conv = *(LDKPublicKey*)src_node_id_arg;
7675 FREE((void*)src_node_id_arg);
7676 LDKRoutingFees fees_arg_conv = *(LDKRoutingFees*)fees_arg;
7677 FREE((void*)fees_arg);
7678 fees_arg_conv.is_owned = true;
7679 LDKRouteHint* ret = MALLOC(sizeof(LDKRouteHint), "LDKRouteHint");
7680 *ret = RouteHint_new(src_node_id_arg_conv, short_channel_id_arg, fees_arg_conv, cltv_expiry_delta_arg, htlc_minimum_msat_arg);
7681 assert(ret->is_owned);
7682 ret->is_owned = false;
7686 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_get_1route(JNIEnv * _env, jclass _b, jlong our_node_id, jlong network, jlong target, jlong first_hops, jlong last_hops, jlong final_value_msat, jint final_cltv, jlong logger) {
7687 LDKPublicKey our_node_id_conv = *(LDKPublicKey*)our_node_id;
7688 FREE((void*)our_node_id);
7689 LDKNetworkGraph* network_conv = (LDKNetworkGraph*)network;
7690 LDKPublicKey target_conv = *(LDKPublicKey*)target;
7691 FREE((void*)target);
7692 LDKCVec_ChannelDetailsZ* first_hops_conv = (LDKCVec_ChannelDetailsZ*)first_hops;
7693 LDKCVec_RouteHintZ last_hops_conv = *(LDKCVec_RouteHintZ*)last_hops;
7694 FREE((void*)last_hops);
7695 LDKLogger logger_conv = *(LDKLogger*)logger;
7696 if (logger_conv.free == LDKLogger_JCalls_free) {
7697 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
7698 LDKLogger_JCalls_clone(logger_conv.this_arg);
7700 LDKCResult_RouteLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
7701 *ret = get_route(our_node_id_conv, network_conv, target_conv, first_hops_conv, last_hops_conv, final_value_msat, final_cltv, logger_conv);
7705 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7706 LDKNetworkGraph this_ptr_conv = *(LDKNetworkGraph*)this_ptr;
7707 FREE((void*)this_ptr);
7708 this_ptr_conv.is_owned = true;
7709 return NetworkGraph_free(this_ptr_conv);
7712 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockedNetworkGraph_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7713 LDKLockedNetworkGraph this_ptr_conv = *(LDKLockedNetworkGraph*)this_ptr;
7714 FREE((void*)this_ptr);
7715 this_ptr_conv.is_owned = true;
7716 return LockedNetworkGraph_free(this_ptr_conv);
7719 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7720 LDKNetGraphMsgHandler this_ptr_conv = *(LDKNetGraphMsgHandler*)this_ptr;
7721 FREE((void*)this_ptr);
7722 this_ptr_conv.is_owned = true;
7723 return NetGraphMsgHandler_free(this_ptr_conv);
7726 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new(JNIEnv * _env, jclass _b, jlong chain_access, jlong logger) {
7727 LDKAccess* chain_access_conv = (LDKAccess*)chain_access;
7728 LDKLogger logger_conv = *(LDKLogger*)logger;
7729 if (logger_conv.free == LDKLogger_JCalls_free) {
7730 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
7731 LDKLogger_JCalls_clone(logger_conv.this_arg);
7733 LDKNetGraphMsgHandler* ret = MALLOC(sizeof(LDKNetGraphMsgHandler), "LDKNetGraphMsgHandler");
7734 *ret = NetGraphMsgHandler_new(chain_access_conv, logger_conv);
7735 assert(ret->is_owned);
7736 ret->is_owned = false;
7740 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1from_1net_1graph(JNIEnv * _env, jclass _b, jlong chain_access, jlong logger, jlong network_graph) {
7741 LDKAccess* chain_access_conv = (LDKAccess*)chain_access;
7742 LDKLogger logger_conv = *(LDKLogger*)logger;
7743 if (logger_conv.free == LDKLogger_JCalls_free) {
7744 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
7745 LDKLogger_JCalls_clone(logger_conv.this_arg);
7747 LDKNetworkGraph network_graph_conv = *(LDKNetworkGraph*)network_graph;
7748 FREE((void*)network_graph);
7749 network_graph_conv.is_owned = true;
7750 LDKNetGraphMsgHandler* ret = MALLOC(sizeof(LDKNetGraphMsgHandler), "LDKNetGraphMsgHandler");
7751 *ret = NetGraphMsgHandler_from_net_graph(chain_access_conv, logger_conv, network_graph_conv);
7752 assert(ret->is_owned);
7753 ret->is_owned = false;
7757 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1read_1locked_1graph(JNIEnv * _env, jclass _b, jlong this_arg) {
7758 LDKNetGraphMsgHandler* this_arg_conv = (LDKNetGraphMsgHandler*)this_arg;
7759 LDKLockedNetworkGraph* ret = MALLOC(sizeof(LDKLockedNetworkGraph), "LDKLockedNetworkGraph");
7760 *ret = NetGraphMsgHandler_read_locked_graph(this_arg_conv);
7761 assert(ret->is_owned);
7762 ret->is_owned = false;
7766 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LockedNetworkGraph_1graph(JNIEnv * _env, jclass _b, jlong this_arg) {
7767 LDKLockedNetworkGraph* this_arg_conv = (LDKLockedNetworkGraph*)this_arg;
7768 LDKNetworkGraph* ret = MALLOC(sizeof(LDKNetworkGraph), "LDKNetworkGraph");
7769 *ret = LockedNetworkGraph_graph(this_arg_conv);
7770 assert(ret->is_owned);
7771 ret->is_owned = false;
7775 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1RoutingMessageHandler(JNIEnv * _env, jclass _b, jlong this_arg) {
7776 LDKNetGraphMsgHandler* this_arg_conv = (LDKNetGraphMsgHandler*)this_arg;
7777 LDKRoutingMessageHandler* ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
7778 *ret = NetGraphMsgHandler_as_RoutingMessageHandler(this_arg_conv);
7782 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7783 LDKDirectionalChannelInfo this_ptr_conv = *(LDKDirectionalChannelInfo*)this_ptr;
7784 FREE((void*)this_ptr);
7785 this_ptr_conv.is_owned = true;
7786 return DirectionalChannelInfo_free(this_ptr_conv);
7789 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr) {
7790 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7791 return DirectionalChannelInfo_get_last_update(this_ptr_conv);
7794 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
7795 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7796 return DirectionalChannelInfo_set_last_update(this_ptr_conv, val);
7799 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1enabled(JNIEnv * _env, jclass _b, jlong this_ptr) {
7800 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7801 return DirectionalChannelInfo_get_enabled(this_ptr_conv);
7804 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1enabled(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
7805 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7806 return DirectionalChannelInfo_set_enabled(this_ptr_conv, val);
7809 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
7810 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7811 return DirectionalChannelInfo_get_cltv_expiry_delta(this_ptr_conv);
7814 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
7815 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7816 return DirectionalChannelInfo_set_cltv_expiry_delta(this_ptr_conv, val);
7819 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
7820 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7821 return DirectionalChannelInfo_get_htlc_minimum_msat(this_ptr_conv);
7824 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7825 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7826 return DirectionalChannelInfo_set_htlc_minimum_msat(this_ptr_conv, val);
7829 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1last_1update_1message(JNIEnv * _env, jclass _b, jlong this_ptr) {
7830 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7831 LDKChannelUpdate* ret = MALLOC(sizeof(LDKChannelUpdate), "LDKChannelUpdate");
7832 *ret = DirectionalChannelInfo_get_last_update_message(this_ptr_conv);
7833 assert(ret->is_owned);
7834 ret->is_owned = false;
7838 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1last_1update_1message(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7839 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7840 LDKChannelUpdate val_conv = *(LDKChannelUpdate*)val;
7842 val_conv.is_owned = true;
7843 return DirectionalChannelInfo_set_last_update_message(this_ptr_conv, val_conv);
7846 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
7847 LDKDirectionalChannelInfo* obj_conv = (LDKDirectionalChannelInfo*)obj;
7848 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7849 *ret = DirectionalChannelInfo_write(obj_conv);
7853 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
7854 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7856 LDKDirectionalChannelInfo* ret = MALLOC(sizeof(LDKDirectionalChannelInfo), "LDKDirectionalChannelInfo");
7857 *ret = DirectionalChannelInfo_read(ser_conv);
7858 assert(ret->is_owned);
7859 ret->is_owned = false;
7863 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7864 LDKChannelInfo this_ptr_conv = *(LDKChannelInfo*)this_ptr;
7865 FREE((void*)this_ptr);
7866 this_ptr_conv.is_owned = true;
7867 return ChannelInfo_free(this_ptr_conv);
7870 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
7871 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7872 LDKChannelFeatures* ret = MALLOC(sizeof(LDKChannelFeatures), "LDKChannelFeatures");
7873 *ret = ChannelInfo_get_features(this_ptr_conv);
7874 assert(ret->is_owned);
7875 ret->is_owned = false;
7879 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7880 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7881 LDKChannelFeatures val_conv = *(LDKChannelFeatures*)val;
7883 val_conv.is_owned = true;
7884 return ChannelInfo_set_features(this_ptr_conv, val_conv);
7887 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1one(JNIEnv * _env, jclass _b, jlong this_ptr) {
7888 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7889 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
7890 *ret = ChannelInfo_get_node_one(this_ptr_conv);
7894 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1one(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7895 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7896 LDKPublicKey val_conv = *(LDKPublicKey*)val;
7898 return ChannelInfo_set_node_one(this_ptr_conv, val_conv);
7901 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1one_1to_1two(JNIEnv * _env, jclass _b, jlong this_ptr) {
7902 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7903 LDKDirectionalChannelInfo* ret = MALLOC(sizeof(LDKDirectionalChannelInfo), "LDKDirectionalChannelInfo");
7904 *ret = ChannelInfo_get_one_to_two(this_ptr_conv);
7905 assert(ret->is_owned);
7906 ret->is_owned = false;
7910 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1one_1to_1two(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7911 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7912 LDKDirectionalChannelInfo val_conv = *(LDKDirectionalChannelInfo*)val;
7914 val_conv.is_owned = true;
7915 return ChannelInfo_set_one_to_two(this_ptr_conv, val_conv);
7918 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1two(JNIEnv * _env, jclass _b, jlong this_ptr) {
7919 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7920 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
7921 *ret = ChannelInfo_get_node_two(this_ptr_conv);
7925 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1two(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7926 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7927 LDKPublicKey val_conv = *(LDKPublicKey*)val;
7929 return ChannelInfo_set_node_two(this_ptr_conv, val_conv);
7932 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1two_1to_1one(JNIEnv * _env, jclass _b, jlong this_ptr) {
7933 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7934 LDKDirectionalChannelInfo* ret = MALLOC(sizeof(LDKDirectionalChannelInfo), "LDKDirectionalChannelInfo");
7935 *ret = ChannelInfo_get_two_to_one(this_ptr_conv);
7936 assert(ret->is_owned);
7937 ret->is_owned = false;
7941 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1two_1to_1one(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7942 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7943 LDKDirectionalChannelInfo val_conv = *(LDKDirectionalChannelInfo*)val;
7945 val_conv.is_owned = true;
7946 return ChannelInfo_set_two_to_one(this_ptr_conv, val_conv);
7949 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1announcement_1message(JNIEnv * _env, jclass _b, jlong this_ptr) {
7950 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7951 LDKChannelAnnouncement* ret = MALLOC(sizeof(LDKChannelAnnouncement), "LDKChannelAnnouncement");
7952 *ret = ChannelInfo_get_announcement_message(this_ptr_conv);
7953 assert(ret->is_owned);
7954 ret->is_owned = false;
7958 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1announcement_1message(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7959 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7960 LDKChannelAnnouncement val_conv = *(LDKChannelAnnouncement*)val;
7962 val_conv.is_owned = true;
7963 return ChannelInfo_set_announcement_message(this_ptr_conv, val_conv);
7966 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
7967 LDKChannelInfo* obj_conv = (LDKChannelInfo*)obj;
7968 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7969 *ret = ChannelInfo_write(obj_conv);
7973 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
7974 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7976 LDKChannelInfo* ret = MALLOC(sizeof(LDKChannelInfo), "LDKChannelInfo");
7977 *ret = ChannelInfo_read(ser_conv);
7978 assert(ret->is_owned);
7979 ret->is_owned = false;
7983 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7984 LDKRoutingFees this_ptr_conv = *(LDKRoutingFees*)this_ptr;
7985 FREE((void*)this_ptr);
7986 this_ptr_conv.is_owned = true;
7987 return RoutingFees_free(this_ptr_conv);
7990 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
7991 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
7992 return RoutingFees_get_base_msat(this_ptr_conv);
7995 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
7996 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
7997 return RoutingFees_set_base_msat(this_ptr_conv, val);
8000 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr) {
8001 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
8002 return RoutingFees_get_proportional_millionths(this_ptr_conv);
8005 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
8006 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
8007 return RoutingFees_set_proportional_millionths(this_ptr_conv, val);
8010 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1new(JNIEnv * _env, jclass _b, jint base_msat_arg, jint proportional_millionths_arg) {
8011 LDKRoutingFees* ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
8012 *ret = RoutingFees_new(base_msat_arg, proportional_millionths_arg);
8013 assert(ret->is_owned);
8014 ret->is_owned = false;
8018 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1read(JNIEnv * _env, jclass _b, jlong ser) {
8019 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8021 LDKRoutingFees* ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
8022 *ret = RoutingFees_read(ser_conv);
8023 assert(ret->is_owned);
8024 ret->is_owned = false;
8028 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1write(JNIEnv * _env, jclass _b, jlong obj) {
8029 LDKRoutingFees* obj_conv = (LDKRoutingFees*)obj;
8030 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8031 *ret = RoutingFees_write(obj_conv);
8035 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8036 LDKNodeAnnouncementInfo this_ptr_conv = *(LDKNodeAnnouncementInfo*)this_ptr;
8037 FREE((void*)this_ptr);
8038 this_ptr_conv.is_owned = true;
8039 return NodeAnnouncementInfo_free(this_ptr_conv);
8042 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
8043 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
8044 LDKNodeFeatures* ret = MALLOC(sizeof(LDKNodeFeatures), "LDKNodeFeatures");
8045 *ret = NodeAnnouncementInfo_get_features(this_ptr_conv);
8046 assert(ret->is_owned);
8047 ret->is_owned = false;
8051 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8052 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
8053 LDKNodeFeatures val_conv = *(LDKNodeFeatures*)val;
8055 val_conv.is_owned = true;
8056 return NodeAnnouncementInfo_set_features(this_ptr_conv, val_conv);
8059 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr) {
8060 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
8061 return NodeAnnouncementInfo_get_last_update(this_ptr_conv);
8064 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
8065 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
8066 return NodeAnnouncementInfo_set_last_update(this_ptr_conv, val);
8069 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr) {
8070 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
8071 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 3);
8072 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 3, *NodeAnnouncementInfo_get_rgb(this_ptr_conv));
8076 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8077 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
8078 LDKThreeBytes val_conv = *(LDKThreeBytes*)val;
8080 return NodeAnnouncementInfo_set_rgb(this_ptr_conv, val_conv);
8083 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1alias(JNIEnv * _env, jclass _b, jlong this_ptr) {
8084 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
8085 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
8086 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *NodeAnnouncementInfo_get_alias(this_ptr_conv));
8090 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1alias(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8091 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
8092 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
8094 return NodeAnnouncementInfo_set_alias(this_ptr_conv, val_conv);
8097 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1addresses(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8098 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
8099 LDKCVec_NetAddressZ val_conv = *(LDKCVec_NetAddressZ*)val;
8101 return NodeAnnouncementInfo_set_addresses(this_ptr_conv, val_conv);
8104 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1announcement_1message(JNIEnv * _env, jclass _b, jlong this_ptr) {
8105 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
8106 LDKNodeAnnouncement* ret = MALLOC(sizeof(LDKNodeAnnouncement), "LDKNodeAnnouncement");
8107 *ret = NodeAnnouncementInfo_get_announcement_message(this_ptr_conv);
8108 assert(ret->is_owned);
8109 ret->is_owned = false;
8113 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1announcement_1message(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8114 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
8115 LDKNodeAnnouncement val_conv = *(LDKNodeAnnouncement*)val;
8117 val_conv.is_owned = true;
8118 return NodeAnnouncementInfo_set_announcement_message(this_ptr_conv, val_conv);
8121 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1new(JNIEnv * _env, jclass _b, jlong features_arg, jint last_update_arg, jlong rgb_arg, jlong alias_arg, jlong addresses_arg, jlong announcement_message_arg) {
8122 LDKNodeFeatures features_arg_conv = *(LDKNodeFeatures*)features_arg;
8123 FREE((void*)features_arg);
8124 features_arg_conv.is_owned = true;
8125 LDKThreeBytes rgb_arg_conv = *(LDKThreeBytes*)rgb_arg;
8126 FREE((void*)rgb_arg);
8127 LDKThirtyTwoBytes alias_arg_conv = *(LDKThirtyTwoBytes*)alias_arg;
8128 FREE((void*)alias_arg);
8129 LDKCVec_NetAddressZ addresses_arg_conv = *(LDKCVec_NetAddressZ*)addresses_arg;
8130 FREE((void*)addresses_arg);
8131 LDKNodeAnnouncement announcement_message_arg_conv = *(LDKNodeAnnouncement*)announcement_message_arg;
8132 FREE((void*)announcement_message_arg);
8133 announcement_message_arg_conv.is_owned = true;
8134 LDKNodeAnnouncementInfo* ret = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo");
8135 *ret = NodeAnnouncementInfo_new(features_arg_conv, last_update_arg, rgb_arg_conv, alias_arg_conv, addresses_arg_conv, announcement_message_arg_conv);
8136 assert(ret->is_owned);
8137 ret->is_owned = false;
8141 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
8142 LDKNodeAnnouncementInfo* obj_conv = (LDKNodeAnnouncementInfo*)obj;
8143 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8144 *ret = NodeAnnouncementInfo_write(obj_conv);
8148 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
8149 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8151 LDKNodeAnnouncementInfo* ret = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo");
8152 *ret = NodeAnnouncementInfo_read(ser_conv);
8153 assert(ret->is_owned);
8154 ret->is_owned = false;
8158 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8159 LDKNodeInfo this_ptr_conv = *(LDKNodeInfo*)this_ptr;
8160 FREE((void*)this_ptr);
8161 this_ptr_conv.is_owned = true;
8162 return NodeInfo_free(this_ptr_conv);
8165 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1channels(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8166 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
8167 LDKCVec_u64Z val_conv = *(LDKCVec_u64Z*)val;
8169 return NodeInfo_set_channels(this_ptr_conv, val_conv);
8172 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1lowest_1inbound_1channel_1fees(JNIEnv * _env, jclass _b, jlong this_ptr) {
8173 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
8174 LDKRoutingFees* ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
8175 *ret = NodeInfo_get_lowest_inbound_channel_fees(this_ptr_conv);
8176 assert(ret->is_owned);
8177 ret->is_owned = false;
8181 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1lowest_1inbound_1channel_1fees(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8182 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
8183 LDKRoutingFees val_conv = *(LDKRoutingFees*)val;
8185 val_conv.is_owned = true;
8186 return NodeInfo_set_lowest_inbound_channel_fees(this_ptr_conv, val_conv);
8189 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1announcement_1info(JNIEnv * _env, jclass _b, jlong this_ptr) {
8190 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
8191 LDKNodeAnnouncementInfo* ret = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo");
8192 *ret = NodeInfo_get_announcement_info(this_ptr_conv);
8193 assert(ret->is_owned);
8194 ret->is_owned = false;
8198 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1announcement_1info(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8199 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
8200 LDKNodeAnnouncementInfo val_conv = *(LDKNodeAnnouncementInfo*)val;
8202 val_conv.is_owned = true;
8203 return NodeInfo_set_announcement_info(this_ptr_conv, val_conv);
8206 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1new(JNIEnv * _env, jclass _b, jlong channels_arg, jlong lowest_inbound_channel_fees_arg, jlong announcement_info_arg) {
8207 LDKCVec_u64Z channels_arg_conv = *(LDKCVec_u64Z*)channels_arg;
8208 FREE((void*)channels_arg);
8209 LDKRoutingFees lowest_inbound_channel_fees_arg_conv = *(LDKRoutingFees*)lowest_inbound_channel_fees_arg;
8210 FREE((void*)lowest_inbound_channel_fees_arg);
8211 lowest_inbound_channel_fees_arg_conv.is_owned = true;
8212 LDKNodeAnnouncementInfo announcement_info_arg_conv = *(LDKNodeAnnouncementInfo*)announcement_info_arg;
8213 FREE((void*)announcement_info_arg);
8214 announcement_info_arg_conv.is_owned = true;
8215 LDKNodeInfo* ret = MALLOC(sizeof(LDKNodeInfo), "LDKNodeInfo");
8216 *ret = NodeInfo_new(channels_arg_conv, lowest_inbound_channel_fees_arg_conv, announcement_info_arg_conv);
8217 assert(ret->is_owned);
8218 ret->is_owned = false;
8222 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
8223 LDKNodeInfo* obj_conv = (LDKNodeInfo*)obj;
8224 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8225 *ret = NodeInfo_write(obj_conv);
8229 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
8230 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8232 LDKNodeInfo* ret = MALLOC(sizeof(LDKNodeInfo), "LDKNodeInfo");
8233 *ret = NodeInfo_read(ser_conv);
8234 assert(ret->is_owned);
8235 ret->is_owned = false;
8239 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1write(JNIEnv * _env, jclass _b, jlong obj) {
8240 LDKNetworkGraph* obj_conv = (LDKNetworkGraph*)obj;
8241 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8242 *ret = NetworkGraph_write(obj_conv);
8246 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read(JNIEnv * _env, jclass _b, jlong ser) {
8247 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8249 LDKNetworkGraph* ret = MALLOC(sizeof(LDKNetworkGraph), "LDKNetworkGraph");
8250 *ret = NetworkGraph_read(ser_conv);
8251 assert(ret->is_owned);
8252 ret->is_owned = false;
8256 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new(JNIEnv * _env, jclass _b) {
8257 LDKNetworkGraph* ret = MALLOC(sizeof(LDKNetworkGraph), "LDKNetworkGraph");
8258 *ret = NetworkGraph_new();
8259 assert(ret->is_owned);
8260 ret->is_owned = false;
8264 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1close_1channel_1from_1update(JNIEnv * _env, jclass _b, jlong this_arg, jlong short_channel_id, jboolean is_permanent) {
8265 LDKNetworkGraph* this_arg_conv = (LDKNetworkGraph*)this_arg;
8266 return NetworkGraph_close_channel_from_update(this_arg_conv, short_channel_id, is_permanent);