1 #include "org_ldk_impl_bindings.h"
2 #include <rust_types.h>
7 #define DO_ASSERT(a) do { bool _assert_val = (a); assert(_assert_val); } while(0)
9 // Running a leak check across all the allocations and frees of the JDK is a mess,
10 // so instead we implement our own naive leak checker here, relying on the -wrap
11 // linker option to wrap malloc/calloc/realloc/free, tracking everyhing allocated
12 // and free'd in Rust or C across the generated bindings shared library.
16 static mtx_t allocation_mtx;
18 void __attribute__((constructor)) init_mtx() {
19 DO_ASSERT(mtx_init(&allocation_mtx, mtx_plain) == thrd_success);
23 typedef struct allocation {
24 struct allocation* next;
26 const char* struct_name;
30 static allocation* allocation_ll = NULL;
32 void* __real_malloc(size_t len);
33 void* __real_calloc(size_t nmemb, size_t len);
34 static void new_allocation(void* res, const char* struct_name) {
35 allocation* new_alloc = __real_malloc(sizeof(allocation));
37 new_alloc->struct_name = struct_name;
38 new_alloc->bt_len = backtrace(new_alloc->bt, BT_MAX);
39 DO_ASSERT(mtx_lock(&allocation_mtx) == thrd_success);
40 new_alloc->next = allocation_ll;
41 allocation_ll = new_alloc;
42 DO_ASSERT(mtx_unlock(&allocation_mtx) == thrd_success);
44 static void* MALLOC(size_t len, const char* struct_name) {
45 void* res = __real_malloc(len);
46 new_allocation(res, struct_name);
49 void __real_free(void* ptr);
50 static void alloc_freed(void* ptr) {
52 DO_ASSERT(mtx_lock(&allocation_mtx) == thrd_success);
53 allocation* it = allocation_ll;
54 while (it->ptr != ptr) { p = it; it = it->next; }
55 if (p) { p->next = it->next; } else { allocation_ll = it->next; }
56 DO_ASSERT(mtx_unlock(&allocation_mtx) == thrd_success);
57 DO_ASSERT(it->ptr == ptr);
60 static void FREE(void* ptr) {
65 void* __wrap_malloc(size_t len) {
66 void* res = __real_malloc(len);
67 new_allocation(res, "malloc call");
70 void* __wrap_calloc(size_t nmemb, size_t len) {
71 void* res = __real_calloc(nmemb, len);
72 new_allocation(res, "calloc call");
75 void __wrap_free(void* ptr) {
80 void* __real_realloc(void* ptr, size_t newlen);
81 void* __wrap_realloc(void* ptr, size_t len) {
83 void* res = __real_realloc(ptr, len);
84 new_allocation(res, "realloc call");
87 void __wrap_reallocarray(void* ptr, size_t new_sz) {
88 // Rust doesn't seem to use reallocarray currently
92 void __attribute__((destructor)) check_leaks() {
93 for (allocation* a = allocation_ll; a != NULL; a = a->next) {
94 fprintf(stderr, "%s %p remains:\n", a->struct_name, a->ptr);
95 backtrace_symbols_fd(a->bt, a->bt_len, STDERR_FILENO);
96 fprintf(stderr, "\n\n");
98 DO_ASSERT(allocation_ll == NULL);
101 static jmethodID ordinal_meth = NULL;
102 static jmethodID slicedef_meth = NULL;
103 static jclass slicedef_cls = NULL;
104 JNIEXPORT void Java_org_ldk_impl_bindings_init(JNIEnv * env, jclass _b, jclass enum_class, jclass slicedef_class) {
105 ordinal_meth = (*env)->GetMethodID(env, enum_class, "ordinal", "()I");
106 DO_ASSERT(ordinal_meth != NULL);
107 slicedef_meth = (*env)->GetMethodID(env, slicedef_class, "<init>", "(JJJ)V");
108 DO_ASSERT(slicedef_meth != NULL);
109 slicedef_cls = (*env)->NewGlobalRef(env, slicedef_class);
110 DO_ASSERT(slicedef_cls != NULL);
113 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_deref_1bool (JNIEnv * env, jclass _a, jlong ptr) {
114 return *((bool*)ptr);
116 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_deref_1long (JNIEnv * env, jclass _a, jlong ptr) {
117 return *((long*)ptr);
119 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_free_1heap_1ptr (JNIEnv * env, jclass _a, jlong ptr) {
122 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_read_1bytes (JNIEnv * _env, jclass _b, jlong ptr, jlong len) {
123 jbyteArray ret_arr = (*_env)->NewByteArray(_env, len);
124 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, len, (unsigned char*)ptr);
127 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_get_1u8_1slice_1bytes (JNIEnv * _env, jclass _b, jlong slice_ptr) {
128 LDKu8slice *slice = (LDKu8slice*)slice_ptr;
129 jbyteArray ret_arr = (*_env)->NewByteArray(_env, slice->datalen);
130 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, slice->datalen, slice->data);
133 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_bytes_1to_1u8_1vec (JNIEnv * _env, jclass _b, jbyteArray bytes) {
134 LDKCVec_u8Z *vec = (LDKCVec_u8Z*)MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8");
135 vec->datalen = (*_env)->GetArrayLength(_env, bytes);
136 vec->data = (uint8_t*)MALLOC(vec->datalen, "LDKCVec_u8Z Bytes");
137 (*_env)->GetByteArrayRegion (_env, bytes, 0, vec->datalen, vec->data);
140 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_new_1txpointer_1copy_1data (JNIEnv * env, jclass _b, jbyteArray bytes) {
141 LDKTransaction *txdata = (LDKTransaction*)MALLOC(sizeof(LDKTransaction), "LDKTransaction");
142 txdata->datalen = (*env)->GetArrayLength(env, bytes);
143 txdata->data = (uint8_t*)MALLOC(txdata->datalen, "Tx Data Bytes");
144 txdata->data_is_owned = true;
145 (*env)->GetByteArrayRegion (env, bytes, 0, txdata->datalen, txdata->data);
148 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_vec_1slice_1len (JNIEnv * env, jclass _a, jlong ptr) {
149 // Check offsets of a few Vec types are all consistent as we're meant to be generic across types
150 _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKCVec_SignatureZ, datalen), "Vec<*> needs to be mapped identically");
151 _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKCVec_MessageSendEventZ, datalen), "Vec<*> needs to be mapped identically");
152 _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKCVec_EventZ, datalen), "Vec<*> needs to be mapped identically");
153 _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKCVec_C2Tuple_usizeTransactionZZ, datalen), "Vec<*> needs to be mapped identically");
154 LDKCVec_u8Z *vec = (LDKCVec_u8Z*)ptr;
155 return (long)vec->datalen;
157 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_new_1empty_1slice_1vec (JNIEnv * _env, jclass _b) {
158 // Check sizes of a few Vec types are all consistent as we're meant to be generic across types
159 _Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKCVec_SignatureZ), "Vec<*> needs to be mapped identically");
160 _Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKCVec_MessageSendEventZ), "Vec<*> needs to be mapped identically");
161 _Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKCVec_EventZ), "Vec<*> needs to be mapped identically");
162 _Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKCVec_C2Tuple_usizeTransactionZZ), "Vec<*> needs to be mapped identically");
163 LDKCVec_u8Z *vec = (LDKCVec_u8Z*)MALLOC(sizeof(LDKCVec_u8Z), "Empty LDKCVec");
169 // We assume that CVec_u8Z and u8slice are the same size and layout (and thus pointers to the two can be mixed)
170 _Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKu8slice), "Vec<u8> and [u8] need to have been mapped identically");
171 _Static_assert(offsetof(LDKCVec_u8Z, data) == offsetof(LDKu8slice, data), "Vec<u8> and [u8] need to have been mapped identically");
172 _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKu8slice, datalen), "Vec<u8> and [u8] need to have been mapped identically");
174 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKSecretKey_1new(JNIEnv * _env, jclass _b) {
175 LDKSecretKey* key = (LDKSecretKey*)MALLOC(sizeof(LDKSecretKey), "LDKSecretKey");
178 static inline LDKAccessError LDKAccessError_from_java(JNIEnv *env, jclass val) {
179 switch ((*env)->CallIntMethod(env, val, ordinal_meth)) {
180 case 0: return LDKAccessError_UnknownChain;
181 case 1: return LDKAccessError_UnknownTx;
185 static jclass LDKAccessError_class = NULL;
186 static jfieldID LDKAccessError_LDKAccessError_UnknownChain = NULL;
187 static jfieldID LDKAccessError_LDKAccessError_UnknownTx = NULL;
188 JNIEXPORT void JNICALL Java_org_ldk_enums_LDKAccessError_init (JNIEnv * env, jclass clz) {
189 LDKAccessError_class = (*env)->NewGlobalRef(env, clz);
190 DO_ASSERT(LDKAccessError_class != NULL);
191 LDKAccessError_LDKAccessError_UnknownChain = (*env)->GetStaticFieldID(env, LDKAccessError_class, "LDKAccessError_UnknownChain", "Lorg/ldk/enums/LDKAccessError;");
192 DO_ASSERT(LDKAccessError_LDKAccessError_UnknownChain != NULL);
193 LDKAccessError_LDKAccessError_UnknownTx = (*env)->GetStaticFieldID(env, LDKAccessError_class, "LDKAccessError_UnknownTx", "Lorg/ldk/enums/LDKAccessError;");
194 DO_ASSERT(LDKAccessError_LDKAccessError_UnknownTx != NULL);
196 static inline jclass LDKAccessError_to_java(JNIEnv *env, LDKAccessError val) {
198 case LDKAccessError_UnknownChain:
199 return (*env)->GetStaticObjectField(env, LDKAccessError_class, LDKAccessError_LDKAccessError_UnknownChain);
200 case LDKAccessError_UnknownTx:
201 return (*env)->GetStaticObjectField(env, LDKAccessError_class, LDKAccessError_LDKAccessError_UnknownTx);
206 static inline LDKChannelMonitorUpdateErr LDKChannelMonitorUpdateErr_from_java(JNIEnv *env, jclass val) {
207 switch ((*env)->CallIntMethod(env, val, ordinal_meth)) {
208 case 0: return LDKChannelMonitorUpdateErr_TemporaryFailure;
209 case 1: return LDKChannelMonitorUpdateErr_PermanentFailure;
213 static jclass LDKChannelMonitorUpdateErr_class = NULL;
214 static jfieldID LDKChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_TemporaryFailure = NULL;
215 static jfieldID LDKChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_PermanentFailure = NULL;
216 JNIEXPORT void JNICALL Java_org_ldk_enums_LDKChannelMonitorUpdateErr_init (JNIEnv * env, jclass clz) {
217 LDKChannelMonitorUpdateErr_class = (*env)->NewGlobalRef(env, clz);
218 DO_ASSERT(LDKChannelMonitorUpdateErr_class != NULL);
219 LDKChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_TemporaryFailure = (*env)->GetStaticFieldID(env, LDKChannelMonitorUpdateErr_class, "LDKChannelMonitorUpdateErr_TemporaryFailure", "Lorg/ldk/enums/LDKChannelMonitorUpdateErr;");
220 DO_ASSERT(LDKChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_TemporaryFailure != NULL);
221 LDKChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_PermanentFailure = (*env)->GetStaticFieldID(env, LDKChannelMonitorUpdateErr_class, "LDKChannelMonitorUpdateErr_PermanentFailure", "Lorg/ldk/enums/LDKChannelMonitorUpdateErr;");
222 DO_ASSERT(LDKChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_PermanentFailure != NULL);
224 static inline jclass LDKChannelMonitorUpdateErr_to_java(JNIEnv *env, LDKChannelMonitorUpdateErr val) {
226 case LDKChannelMonitorUpdateErr_TemporaryFailure:
227 return (*env)->GetStaticObjectField(env, LDKChannelMonitorUpdateErr_class, LDKChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_TemporaryFailure);
228 case LDKChannelMonitorUpdateErr_PermanentFailure:
229 return (*env)->GetStaticObjectField(env, LDKChannelMonitorUpdateErr_class, LDKChannelMonitorUpdateErr_LDKChannelMonitorUpdateErr_PermanentFailure);
234 static inline LDKConfirmationTarget LDKConfirmationTarget_from_java(JNIEnv *env, jclass val) {
235 switch ((*env)->CallIntMethod(env, val, ordinal_meth)) {
236 case 0: return LDKConfirmationTarget_Background;
237 case 1: return LDKConfirmationTarget_Normal;
238 case 2: return LDKConfirmationTarget_HighPriority;
242 static jclass LDKConfirmationTarget_class = NULL;
243 static jfieldID LDKConfirmationTarget_LDKConfirmationTarget_Background = NULL;
244 static jfieldID LDKConfirmationTarget_LDKConfirmationTarget_Normal = NULL;
245 static jfieldID LDKConfirmationTarget_LDKConfirmationTarget_HighPriority = NULL;
246 JNIEXPORT void JNICALL Java_org_ldk_enums_LDKConfirmationTarget_init (JNIEnv * env, jclass clz) {
247 LDKConfirmationTarget_class = (*env)->NewGlobalRef(env, clz);
248 DO_ASSERT(LDKConfirmationTarget_class != NULL);
249 LDKConfirmationTarget_LDKConfirmationTarget_Background = (*env)->GetStaticFieldID(env, LDKConfirmationTarget_class, "LDKConfirmationTarget_Background", "Lorg/ldk/enums/LDKConfirmationTarget;");
250 DO_ASSERT(LDKConfirmationTarget_LDKConfirmationTarget_Background != NULL);
251 LDKConfirmationTarget_LDKConfirmationTarget_Normal = (*env)->GetStaticFieldID(env, LDKConfirmationTarget_class, "LDKConfirmationTarget_Normal", "Lorg/ldk/enums/LDKConfirmationTarget;");
252 DO_ASSERT(LDKConfirmationTarget_LDKConfirmationTarget_Normal != NULL);
253 LDKConfirmationTarget_LDKConfirmationTarget_HighPriority = (*env)->GetStaticFieldID(env, LDKConfirmationTarget_class, "LDKConfirmationTarget_HighPriority", "Lorg/ldk/enums/LDKConfirmationTarget;");
254 DO_ASSERT(LDKConfirmationTarget_LDKConfirmationTarget_HighPriority != NULL);
256 static inline jclass LDKConfirmationTarget_to_java(JNIEnv *env, LDKConfirmationTarget val) {
258 case LDKConfirmationTarget_Background:
259 return (*env)->GetStaticObjectField(env, LDKConfirmationTarget_class, LDKConfirmationTarget_LDKConfirmationTarget_Background);
260 case LDKConfirmationTarget_Normal:
261 return (*env)->GetStaticObjectField(env, LDKConfirmationTarget_class, LDKConfirmationTarget_LDKConfirmationTarget_Normal);
262 case LDKConfirmationTarget_HighPriority:
263 return (*env)->GetStaticObjectField(env, LDKConfirmationTarget_class, LDKConfirmationTarget_LDKConfirmationTarget_HighPriority);
268 static inline LDKLevel LDKLevel_from_java(JNIEnv *env, jclass val) {
269 switch ((*env)->CallIntMethod(env, val, ordinal_meth)) {
270 case 0: return LDKLevel_Off;
271 case 1: return LDKLevel_Error;
272 case 2: return LDKLevel_Warn;
273 case 3: return LDKLevel_Info;
274 case 4: return LDKLevel_Debug;
275 case 5: return LDKLevel_Trace;
279 static jclass LDKLevel_class = NULL;
280 static jfieldID LDKLevel_LDKLevel_Off = NULL;
281 static jfieldID LDKLevel_LDKLevel_Error = NULL;
282 static jfieldID LDKLevel_LDKLevel_Warn = NULL;
283 static jfieldID LDKLevel_LDKLevel_Info = NULL;
284 static jfieldID LDKLevel_LDKLevel_Debug = NULL;
285 static jfieldID LDKLevel_LDKLevel_Trace = NULL;
286 JNIEXPORT void JNICALL Java_org_ldk_enums_LDKLevel_init (JNIEnv * env, jclass clz) {
287 LDKLevel_class = (*env)->NewGlobalRef(env, clz);
288 DO_ASSERT(LDKLevel_class != NULL);
289 LDKLevel_LDKLevel_Off = (*env)->GetStaticFieldID(env, LDKLevel_class, "LDKLevel_Off", "Lorg/ldk/enums/LDKLevel;");
290 DO_ASSERT(LDKLevel_LDKLevel_Off != NULL);
291 LDKLevel_LDKLevel_Error = (*env)->GetStaticFieldID(env, LDKLevel_class, "LDKLevel_Error", "Lorg/ldk/enums/LDKLevel;");
292 DO_ASSERT(LDKLevel_LDKLevel_Error != NULL);
293 LDKLevel_LDKLevel_Warn = (*env)->GetStaticFieldID(env, LDKLevel_class, "LDKLevel_Warn", "Lorg/ldk/enums/LDKLevel;");
294 DO_ASSERT(LDKLevel_LDKLevel_Warn != NULL);
295 LDKLevel_LDKLevel_Info = (*env)->GetStaticFieldID(env, LDKLevel_class, "LDKLevel_Info", "Lorg/ldk/enums/LDKLevel;");
296 DO_ASSERT(LDKLevel_LDKLevel_Info != NULL);
297 LDKLevel_LDKLevel_Debug = (*env)->GetStaticFieldID(env, LDKLevel_class, "LDKLevel_Debug", "Lorg/ldk/enums/LDKLevel;");
298 DO_ASSERT(LDKLevel_LDKLevel_Debug != NULL);
299 LDKLevel_LDKLevel_Trace = (*env)->GetStaticFieldID(env, LDKLevel_class, "LDKLevel_Trace", "Lorg/ldk/enums/LDKLevel;");
300 DO_ASSERT(LDKLevel_LDKLevel_Trace != NULL);
302 static inline jclass LDKLevel_to_java(JNIEnv *env, LDKLevel val) {
305 return (*env)->GetStaticObjectField(env, LDKLevel_class, LDKLevel_LDKLevel_Off);
307 return (*env)->GetStaticObjectField(env, LDKLevel_class, LDKLevel_LDKLevel_Error);
309 return (*env)->GetStaticObjectField(env, LDKLevel_class, LDKLevel_LDKLevel_Warn);
311 return (*env)->GetStaticObjectField(env, LDKLevel_class, LDKLevel_LDKLevel_Info);
313 return (*env)->GetStaticObjectField(env, LDKLevel_class, LDKLevel_LDKLevel_Debug);
315 return (*env)->GetStaticObjectField(env, LDKLevel_class, LDKLevel_LDKLevel_Trace);
320 static inline LDKNetwork LDKNetwork_from_java(JNIEnv *env, jclass val) {
321 switch ((*env)->CallIntMethod(env, val, ordinal_meth)) {
322 case 0: return LDKNetwork_Bitcoin;
323 case 1: return LDKNetwork_Testnet;
324 case 2: return LDKNetwork_Regtest;
328 static jclass LDKNetwork_class = NULL;
329 static jfieldID LDKNetwork_LDKNetwork_Bitcoin = NULL;
330 static jfieldID LDKNetwork_LDKNetwork_Testnet = NULL;
331 static jfieldID LDKNetwork_LDKNetwork_Regtest = NULL;
332 JNIEXPORT void JNICALL Java_org_ldk_enums_LDKNetwork_init (JNIEnv * env, jclass clz) {
333 LDKNetwork_class = (*env)->NewGlobalRef(env, clz);
334 DO_ASSERT(LDKNetwork_class != NULL);
335 LDKNetwork_LDKNetwork_Bitcoin = (*env)->GetStaticFieldID(env, LDKNetwork_class, "LDKNetwork_Bitcoin", "Lorg/ldk/enums/LDKNetwork;");
336 DO_ASSERT(LDKNetwork_LDKNetwork_Bitcoin != NULL);
337 LDKNetwork_LDKNetwork_Testnet = (*env)->GetStaticFieldID(env, LDKNetwork_class, "LDKNetwork_Testnet", "Lorg/ldk/enums/LDKNetwork;");
338 DO_ASSERT(LDKNetwork_LDKNetwork_Testnet != NULL);
339 LDKNetwork_LDKNetwork_Regtest = (*env)->GetStaticFieldID(env, LDKNetwork_class, "LDKNetwork_Regtest", "Lorg/ldk/enums/LDKNetwork;");
340 DO_ASSERT(LDKNetwork_LDKNetwork_Regtest != NULL);
342 static inline jclass LDKNetwork_to_java(JNIEnv *env, LDKNetwork val) {
344 case LDKNetwork_Bitcoin:
345 return (*env)->GetStaticObjectField(env, LDKNetwork_class, LDKNetwork_LDKNetwork_Bitcoin);
346 case LDKNetwork_Testnet:
347 return (*env)->GetStaticObjectField(env, LDKNetwork_class, LDKNetwork_LDKNetwork_Testnet);
348 case LDKNetwork_Regtest:
349 return (*env)->GetStaticObjectField(env, LDKNetwork_class, LDKNetwork_LDKNetwork_Regtest);
354 static inline LDKSecp256k1Error LDKSecp256k1Error_from_java(JNIEnv *env, jclass val) {
355 switch ((*env)->CallIntMethod(env, val, ordinal_meth)) {
356 case 0: return LDKSecp256k1Error_IncorrectSignature;
357 case 1: return LDKSecp256k1Error_InvalidMessage;
358 case 2: return LDKSecp256k1Error_InvalidPublicKey;
359 case 3: return LDKSecp256k1Error_InvalidSignature;
360 case 4: return LDKSecp256k1Error_InvalidSecretKey;
361 case 5: return LDKSecp256k1Error_InvalidRecoveryId;
362 case 6: return LDKSecp256k1Error_InvalidTweak;
363 case 7: return LDKSecp256k1Error_NotEnoughMemory;
364 case 8: return LDKSecp256k1Error_CallbackPanicked;
368 static jclass LDKSecp256k1Error_class = NULL;
369 static jfieldID LDKSecp256k1Error_LDKSecp256k1Error_IncorrectSignature = NULL;
370 static jfieldID LDKSecp256k1Error_LDKSecp256k1Error_InvalidMessage = NULL;
371 static jfieldID LDKSecp256k1Error_LDKSecp256k1Error_InvalidPublicKey = NULL;
372 static jfieldID LDKSecp256k1Error_LDKSecp256k1Error_InvalidSignature = NULL;
373 static jfieldID LDKSecp256k1Error_LDKSecp256k1Error_InvalidSecretKey = NULL;
374 static jfieldID LDKSecp256k1Error_LDKSecp256k1Error_InvalidRecoveryId = NULL;
375 static jfieldID LDKSecp256k1Error_LDKSecp256k1Error_InvalidTweak = NULL;
376 static jfieldID LDKSecp256k1Error_LDKSecp256k1Error_NotEnoughMemory = NULL;
377 static jfieldID LDKSecp256k1Error_LDKSecp256k1Error_CallbackPanicked = NULL;
378 JNIEXPORT void JNICALL Java_org_ldk_enums_LDKSecp256k1Error_init (JNIEnv * env, jclass clz) {
379 LDKSecp256k1Error_class = (*env)->NewGlobalRef(env, clz);
380 DO_ASSERT(LDKSecp256k1Error_class != NULL);
381 LDKSecp256k1Error_LDKSecp256k1Error_IncorrectSignature = (*env)->GetStaticFieldID(env, LDKSecp256k1Error_class, "LDKSecp256k1Error_IncorrectSignature", "Lorg/ldk/enums/LDKSecp256k1Error;");
382 DO_ASSERT(LDKSecp256k1Error_LDKSecp256k1Error_IncorrectSignature != NULL);
383 LDKSecp256k1Error_LDKSecp256k1Error_InvalidMessage = (*env)->GetStaticFieldID(env, LDKSecp256k1Error_class, "LDKSecp256k1Error_InvalidMessage", "Lorg/ldk/enums/LDKSecp256k1Error;");
384 DO_ASSERT(LDKSecp256k1Error_LDKSecp256k1Error_InvalidMessage != NULL);
385 LDKSecp256k1Error_LDKSecp256k1Error_InvalidPublicKey = (*env)->GetStaticFieldID(env, LDKSecp256k1Error_class, "LDKSecp256k1Error_InvalidPublicKey", "Lorg/ldk/enums/LDKSecp256k1Error;");
386 DO_ASSERT(LDKSecp256k1Error_LDKSecp256k1Error_InvalidPublicKey != NULL);
387 LDKSecp256k1Error_LDKSecp256k1Error_InvalidSignature = (*env)->GetStaticFieldID(env, LDKSecp256k1Error_class, "LDKSecp256k1Error_InvalidSignature", "Lorg/ldk/enums/LDKSecp256k1Error;");
388 DO_ASSERT(LDKSecp256k1Error_LDKSecp256k1Error_InvalidSignature != NULL);
389 LDKSecp256k1Error_LDKSecp256k1Error_InvalidSecretKey = (*env)->GetStaticFieldID(env, LDKSecp256k1Error_class, "LDKSecp256k1Error_InvalidSecretKey", "Lorg/ldk/enums/LDKSecp256k1Error;");
390 DO_ASSERT(LDKSecp256k1Error_LDKSecp256k1Error_InvalidSecretKey != NULL);
391 LDKSecp256k1Error_LDKSecp256k1Error_InvalidRecoveryId = (*env)->GetStaticFieldID(env, LDKSecp256k1Error_class, "LDKSecp256k1Error_InvalidRecoveryId", "Lorg/ldk/enums/LDKSecp256k1Error;");
392 DO_ASSERT(LDKSecp256k1Error_LDKSecp256k1Error_InvalidRecoveryId != NULL);
393 LDKSecp256k1Error_LDKSecp256k1Error_InvalidTweak = (*env)->GetStaticFieldID(env, LDKSecp256k1Error_class, "LDKSecp256k1Error_InvalidTweak", "Lorg/ldk/enums/LDKSecp256k1Error;");
394 DO_ASSERT(LDKSecp256k1Error_LDKSecp256k1Error_InvalidTweak != NULL);
395 LDKSecp256k1Error_LDKSecp256k1Error_NotEnoughMemory = (*env)->GetStaticFieldID(env, LDKSecp256k1Error_class, "LDKSecp256k1Error_NotEnoughMemory", "Lorg/ldk/enums/LDKSecp256k1Error;");
396 DO_ASSERT(LDKSecp256k1Error_LDKSecp256k1Error_NotEnoughMemory != NULL);
397 LDKSecp256k1Error_LDKSecp256k1Error_CallbackPanicked = (*env)->GetStaticFieldID(env, LDKSecp256k1Error_class, "LDKSecp256k1Error_CallbackPanicked", "Lorg/ldk/enums/LDKSecp256k1Error;");
398 DO_ASSERT(LDKSecp256k1Error_LDKSecp256k1Error_CallbackPanicked != NULL);
400 static inline jclass LDKSecp256k1Error_to_java(JNIEnv *env, LDKSecp256k1Error val) {
402 case LDKSecp256k1Error_IncorrectSignature:
403 return (*env)->GetStaticObjectField(env, LDKSecp256k1Error_class, LDKSecp256k1Error_LDKSecp256k1Error_IncorrectSignature);
404 case LDKSecp256k1Error_InvalidMessage:
405 return (*env)->GetStaticObjectField(env, LDKSecp256k1Error_class, LDKSecp256k1Error_LDKSecp256k1Error_InvalidMessage);
406 case LDKSecp256k1Error_InvalidPublicKey:
407 return (*env)->GetStaticObjectField(env, LDKSecp256k1Error_class, LDKSecp256k1Error_LDKSecp256k1Error_InvalidPublicKey);
408 case LDKSecp256k1Error_InvalidSignature:
409 return (*env)->GetStaticObjectField(env, LDKSecp256k1Error_class, LDKSecp256k1Error_LDKSecp256k1Error_InvalidSignature);
410 case LDKSecp256k1Error_InvalidSecretKey:
411 return (*env)->GetStaticObjectField(env, LDKSecp256k1Error_class, LDKSecp256k1Error_LDKSecp256k1Error_InvalidSecretKey);
412 case LDKSecp256k1Error_InvalidRecoveryId:
413 return (*env)->GetStaticObjectField(env, LDKSecp256k1Error_class, LDKSecp256k1Error_LDKSecp256k1Error_InvalidRecoveryId);
414 case LDKSecp256k1Error_InvalidTweak:
415 return (*env)->GetStaticObjectField(env, LDKSecp256k1Error_class, LDKSecp256k1Error_LDKSecp256k1Error_InvalidTweak);
416 case LDKSecp256k1Error_NotEnoughMemory:
417 return (*env)->GetStaticObjectField(env, LDKSecp256k1Error_class, LDKSecp256k1Error_LDKSecp256k1Error_NotEnoughMemory);
418 case LDKSecp256k1Error_CallbackPanicked:
419 return (*env)->GetStaticObjectField(env, LDKSecp256k1Error_class, LDKSecp256k1Error_LDKSecp256k1Error_CallbackPanicked);
424 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1u8_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
425 LDKCVecTempl_u8 *vec = (LDKCVecTempl_u8*)ptr;
426 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(uint8_t));
428 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1u8_1new(JNIEnv *env, jclass _b, jbyteArray elems){
429 LDKCVecTempl_u8 *ret = MALLOC(sizeof(LDKCVecTempl_u8), "LDKCVecTempl_u8");
430 ret->datalen = (*env)->GetArrayLength(env, elems);
431 if (ret->datalen == 0) {
434 ret->data = MALLOC(sizeof(uint8_t) * ret->datalen, "LDKCVecTempl_u8 Data");
435 jbyte *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
436 for (size_t i = 0; i < ret->datalen; i++) {
437 ret->data[i] = java_elems[i];
439 (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
443 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2TupleTempl_1usize_1_1Transaction_1new(JNIEnv *_env, jclass _b, jlong a, jlong b) {
444 LDKC2TupleTempl_usize__Transaction* ret = MALLOC(sizeof(LDKC2TupleTempl_usize__Transaction), "LDKC2TupleTempl_usize__Transaction");
446 LDKTransaction b_conv = *(LDKTransaction*)b;
451 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
452 return ((LDKCResult_NoneChannelMonitorUpdateErrZ*)arg)->result_ok;
454 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
455 if (((LDKCResult_NoneChannelMonitorUpdateErrZ*)arg)->result_ok) {
456 return (long)((LDKCResult_NoneChannelMonitorUpdateErrZ*)arg)->contents.result;
458 return (long)((LDKCResult_NoneChannelMonitorUpdateErrZ*)arg)->contents.err;
461 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKMonitorUpdateError_1optional_1none (JNIEnv * env, jclass _a) {
462 LDKMonitorUpdateError *ret = MALLOC(sizeof(LDKMonitorUpdateError), "LDKMonitorUpdateError");
466 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
467 return ((LDKCResult_NoneMonitorUpdateErrorZ*)arg)->result_ok;
469 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
470 if (((LDKCResult_NoneMonitorUpdateErrorZ*)arg)->result_ok) {
471 return (long)((LDKCResult_NoneMonitorUpdateErrorZ*)arg)->contents.result;
473 return (long)((LDKCResult_NoneMonitorUpdateErrorZ*)arg)->contents.err;
476 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKOutPoint_1optional_1none (JNIEnv * env, jclass _a) {
477 LDKOutPoint *ret = MALLOC(sizeof(LDKOutPoint), "LDKOutPoint");
481 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2TupleTempl_1OutPoint_1_1CVec_1u8Z_1new(JNIEnv *_env, jclass _b, jlong a, jlong b) {
482 LDKC2TupleTempl_OutPoint__CVec_u8Z* ret = MALLOC(sizeof(LDKC2TupleTempl_OutPoint__CVec_u8Z), "LDKC2TupleTempl_OutPoint__CVec_u8Z");
483 LDKOutPoint a_conv = *(LDKOutPoint*)a;
485 a_conv.is_owned = true;
487 LDKCVec_u8Z b_conv = *(LDKCVec_u8Z*)b;
492 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1TxOut_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
493 LDKCVecTempl_TxOut *vec = (LDKCVecTempl_TxOut*)ptr;
494 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKTxOut));
496 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1TxOut_1new(JNIEnv *env, jclass _b, jlongArray elems){
497 LDKCVecTempl_TxOut *ret = MALLOC(sizeof(LDKCVecTempl_TxOut), "LDKCVecTempl_TxOut");
498 ret->datalen = (*env)->GetArrayLength(env, elems);
499 if (ret->datalen == 0) {
502 ret->data = malloc(sizeof(LDKTxOut) * ret->datalen); // often freed by rust directly
503 jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
504 for (size_t i = 0; i < ret->datalen; i++) {
505 jlong arr_elem = java_elems[i];
506 LDKTxOut arr_elem_conv = *(LDKTxOut*)arr_elem;
507 FREE((void*)arr_elem);
508 ret->data[i] = arr_elem_conv;
510 (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
514 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2TupleTempl_1ThirtyTwoBytes_1_1CVecTempl_1TxOut_1new(JNIEnv *_env, jclass _b, jbyteArray a, jlong b) {
515 LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut* ret = MALLOC(sizeof(LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut), "LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut");
516 LDKThirtyTwoBytes a_ref;
517 (*_env)->GetByteArrayRegion (_env, a, 0, 32, a_ref.data);
519 LDKCVecTempl_TxOut b_conv = *(LDKCVecTempl_TxOut*)b;
524 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2TupleTempl_1u64_1_1u64_1new(JNIEnv *_env, jclass _b, jlong a, jlong b) {
525 LDKC2TupleTempl_u64__u64* ret = MALLOC(sizeof(LDKC2TupleTempl_u64__u64), "LDKC2TupleTempl_u64__u64");
530 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Signature_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
531 LDKCVecTempl_Signature *vec = (LDKCVecTempl_Signature*)ptr;
532 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKSignature));
534 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Signature_1new(JNIEnv *env, jclass _b, jlongArray elems){
535 LDKCVecTempl_Signature *ret = MALLOC(sizeof(LDKCVecTempl_Signature), "LDKCVecTempl_Signature");
536 ret->datalen = (*env)->GetArrayLength(env, elems);
537 if (ret->datalen == 0) {
540 ret->data = malloc(sizeof(LDKSignature) * ret->datalen); // often freed by rust directly
541 jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
542 for (size_t i = 0; i < ret->datalen; i++) {
543 jlong arr_elem = java_elems[i];
544 LDKSignature arr_elem_conv = *(LDKSignature*)arr_elem;
545 FREE((void*)arr_elem);
546 ret->data[i] = arr_elem_conv;
548 (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
552 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2TupleTempl_1Signature_1_1CVecTempl_1Signature_1new(JNIEnv *_env, jclass _b, jlong a, jlong b) {
553 LDKC2TupleTempl_Signature__CVecTempl_Signature* ret = MALLOC(sizeof(LDKC2TupleTempl_Signature__CVecTempl_Signature), "LDKC2TupleTempl_Signature__CVecTempl_Signature");
554 LDKSignature a_conv = *(LDKSignature*)a;
557 LDKCVecTempl_Signature b_conv = *(LDKCVecTempl_Signature*)b;
562 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
563 return ((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg)->result_ok;
565 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
566 if (((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg)->result_ok) {
567 return (long)((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg)->contents.result;
569 return (long)((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg)->contents.err;
572 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignatureNoneZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
573 return ((LDKCResult_SignatureNoneZ*)arg)->result_ok;
575 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignatureNoneZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
576 if (((LDKCResult_SignatureNoneZ*)arg)->result_ok) {
577 return (long)((LDKCResult_SignatureNoneZ*)arg)->contents.result;
579 return (long)((LDKCResult_SignatureNoneZ*)arg)->contents.err;
582 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
583 return ((LDKCResult_CVec_SignatureZNoneZ*)arg)->result_ok;
585 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
586 if (((LDKCResult_CVec_SignatureZNoneZ*)arg)->result_ok) {
587 return (long)((LDKCResult_CVec_SignatureZNoneZ*)arg)->contents.result;
589 return (long)((LDKCResult_CVec_SignatureZNoneZ*)arg)->contents.err;
592 static jclass LDKAPIError_APIMisuseError_class = NULL;
593 static jmethodID LDKAPIError_APIMisuseError_meth = NULL;
594 static jclass LDKAPIError_FeeRateTooHigh_class = NULL;
595 static jmethodID LDKAPIError_FeeRateTooHigh_meth = NULL;
596 static jclass LDKAPIError_RouteError_class = NULL;
597 static jmethodID LDKAPIError_RouteError_meth = NULL;
598 static jclass LDKAPIError_ChannelUnavailable_class = NULL;
599 static jmethodID LDKAPIError_ChannelUnavailable_meth = NULL;
600 static jclass LDKAPIError_MonitorUpdateFailed_class = NULL;
601 static jmethodID LDKAPIError_MonitorUpdateFailed_meth = NULL;
602 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKAPIError_init (JNIEnv * env, jclass _a) {
603 LDKAPIError_APIMisuseError_class =
604 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$APIMisuseError;"));
605 DO_ASSERT(LDKAPIError_APIMisuseError_class != NULL);
606 LDKAPIError_APIMisuseError_meth = (*env)->GetMethodID(env, LDKAPIError_APIMisuseError_class, "<init>", "(J)V");
607 DO_ASSERT(LDKAPIError_APIMisuseError_meth != NULL);
608 LDKAPIError_FeeRateTooHigh_class =
609 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$FeeRateTooHigh;"));
610 DO_ASSERT(LDKAPIError_FeeRateTooHigh_class != NULL);
611 LDKAPIError_FeeRateTooHigh_meth = (*env)->GetMethodID(env, LDKAPIError_FeeRateTooHigh_class, "<init>", "(JI)V");
612 DO_ASSERT(LDKAPIError_FeeRateTooHigh_meth != NULL);
613 LDKAPIError_RouteError_class =
614 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$RouteError;"));
615 DO_ASSERT(LDKAPIError_RouteError_class != NULL);
616 LDKAPIError_RouteError_meth = (*env)->GetMethodID(env, LDKAPIError_RouteError_class, "<init>", "(J)V");
617 DO_ASSERT(LDKAPIError_RouteError_meth != NULL);
618 LDKAPIError_ChannelUnavailable_class =
619 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$ChannelUnavailable;"));
620 DO_ASSERT(LDKAPIError_ChannelUnavailable_class != NULL);
621 LDKAPIError_ChannelUnavailable_meth = (*env)->GetMethodID(env, LDKAPIError_ChannelUnavailable_class, "<init>", "(J)V");
622 DO_ASSERT(LDKAPIError_ChannelUnavailable_meth != NULL);
623 LDKAPIError_MonitorUpdateFailed_class =
624 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAPIError$MonitorUpdateFailed;"));
625 DO_ASSERT(LDKAPIError_MonitorUpdateFailed_class != NULL);
626 LDKAPIError_MonitorUpdateFailed_meth = (*env)->GetMethodID(env, LDKAPIError_MonitorUpdateFailed_class, "<init>", "()V");
627 DO_ASSERT(LDKAPIError_MonitorUpdateFailed_meth != NULL);
629 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAPIError_1ref_1from_1ptr (JNIEnv * env, jclass _c, jlong ptr) {
630 LDKAPIError *obj = (LDKAPIError*)ptr;
632 case LDKAPIError_APIMisuseError: {
633 long err_ref = (long)&obj->api_misuse_error.err;
634 return (*env)->NewObject(env, LDKAPIError_APIMisuseError_class, LDKAPIError_APIMisuseError_meth, err_ref);
636 case LDKAPIError_FeeRateTooHigh: {
637 long err_ref = (long)&obj->fee_rate_too_high.err;
638 return (*env)->NewObject(env, LDKAPIError_FeeRateTooHigh_class, LDKAPIError_FeeRateTooHigh_meth, err_ref, obj->fee_rate_too_high.feerate);
640 case LDKAPIError_RouteError: {
641 long err_ref = (long)&obj->route_error.err;
642 return (*env)->NewObject(env, LDKAPIError_RouteError_class, LDKAPIError_RouteError_meth, err_ref);
644 case LDKAPIError_ChannelUnavailable: {
645 long err_ref = (long)&obj->channel_unavailable.err;
646 return (*env)->NewObject(env, LDKAPIError_ChannelUnavailable_class, LDKAPIError_ChannelUnavailable_meth, err_ref);
648 case LDKAPIError_MonitorUpdateFailed: {
649 return (*env)->NewObject(env, LDKAPIError_MonitorUpdateFailed_class, LDKAPIError_MonitorUpdateFailed_meth);
654 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
655 return ((LDKCResult_NoneAPIErrorZ*)arg)->result_ok;
657 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
658 if (((LDKCResult_NoneAPIErrorZ*)arg)->result_ok) {
659 return (long)((LDKCResult_NoneAPIErrorZ*)arg)->contents.result;
661 return (long)((LDKCResult_NoneAPIErrorZ*)arg)->contents.err;
664 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKPaymentSendFailure_1optional_1none (JNIEnv * env, jclass _a) {
665 LDKPaymentSendFailure *ret = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
669 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
670 return ((LDKCResult_NonePaymentSendFailureZ*)arg)->result_ok;
672 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
673 if (((LDKCResult_NonePaymentSendFailureZ*)arg)->result_ok) {
674 return (long)((LDKCResult_NonePaymentSendFailureZ*)arg)->contents.result;
676 return (long)((LDKCResult_NonePaymentSendFailureZ*)arg)->contents.err;
679 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelAnnouncement_1optional_1none (JNIEnv * env, jclass _a) {
680 LDKChannelAnnouncement *ret = MALLOC(sizeof(LDKChannelAnnouncement), "LDKChannelAnnouncement");
684 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelUpdate_1optional_1none (JNIEnv * env, jclass _a) {
685 LDKChannelUpdate *ret = MALLOC(sizeof(LDKChannelUpdate), "LDKChannelUpdate");
689 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC3TupleTempl_1ChannelAnnouncement_1_1ChannelUpdate_1_1ChannelUpdate_1new(JNIEnv *_env, jclass _b, jlong a, jlong b, jlong c) {
690 LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate* ret = MALLOC(sizeof(LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate), "LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate");
691 LDKChannelAnnouncement a_conv = *(LDKChannelAnnouncement*)a;
693 a_conv.is_owned = true;
695 LDKChannelUpdate b_conv = *(LDKChannelUpdate*)b;
697 b_conv.is_owned = true;
699 LDKChannelUpdate c_conv = *(LDKChannelUpdate*)c;
701 c_conv.is_owned = true;
705 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKPeerHandleError_1optional_1none (JNIEnv * env, jclass _a) {
706 LDKPeerHandleError *ret = MALLOC(sizeof(LDKPeerHandleError), "LDKPeerHandleError");
710 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
711 return ((LDKCResult_NonePeerHandleErrorZ*)arg)->result_ok;
713 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
714 if (((LDKCResult_NonePeerHandleErrorZ*)arg)->result_ok) {
715 return (long)((LDKCResult_NonePeerHandleErrorZ*)arg)->contents.result;
717 return (long)((LDKCResult_NonePeerHandleErrorZ*)arg)->contents.err;
720 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKHTLCOutputInCommitment_1optional_1none (JNIEnv * env, jclass _a) {
721 LDKHTLCOutputInCommitment *ret = MALLOC(sizeof(LDKHTLCOutputInCommitment), "LDKHTLCOutputInCommitment");
725 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKC2TupleTempl_1HTLCOutputInCommitment_1_1Signature_1new(JNIEnv *_env, jclass _b, jlong a, jlong b) {
726 LDKC2TupleTempl_HTLCOutputInCommitment__Signature* ret = MALLOC(sizeof(LDKC2TupleTempl_HTLCOutputInCommitment__Signature), "LDKC2TupleTempl_HTLCOutputInCommitment__Signature");
727 LDKHTLCOutputInCommitment a_conv = *(LDKHTLCOutputInCommitment*)a;
729 a_conv.is_owned = true;
731 LDKSignature b_conv = *(LDKSignature*)b;
736 static jclass LDKSpendableOutputDescriptor_StaticOutput_class = NULL;
737 static jmethodID LDKSpendableOutputDescriptor_StaticOutput_meth = NULL;
738 static jclass LDKSpendableOutputDescriptor_DynamicOutputP2WSH_class = NULL;
739 static jmethodID LDKSpendableOutputDescriptor_DynamicOutputP2WSH_meth = NULL;
740 static jclass LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_class = NULL;
741 static jmethodID LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_meth = NULL;
742 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKSpendableOutputDescriptor_init (JNIEnv * env, jclass _a) {
743 LDKSpendableOutputDescriptor_StaticOutput_class =
744 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKSpendableOutputDescriptor$StaticOutput;"));
745 DO_ASSERT(LDKSpendableOutputDescriptor_StaticOutput_class != NULL);
746 LDKSpendableOutputDescriptor_StaticOutput_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_StaticOutput_class, "<init>", "(JJ)V");
747 DO_ASSERT(LDKSpendableOutputDescriptor_StaticOutput_meth != NULL);
748 LDKSpendableOutputDescriptor_DynamicOutputP2WSH_class =
749 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKSpendableOutputDescriptor$DynamicOutputP2WSH;"));
750 DO_ASSERT(LDKSpendableOutputDescriptor_DynamicOutputP2WSH_class != NULL);
751 LDKSpendableOutputDescriptor_DynamicOutputP2WSH_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_DynamicOutputP2WSH_class, "<init>", "(JJSJJJ)V");
752 DO_ASSERT(LDKSpendableOutputDescriptor_DynamicOutputP2WSH_meth != NULL);
753 LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_class =
754 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKSpendableOutputDescriptor$StaticOutputCounterpartyPayment;"));
755 DO_ASSERT(LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_class != NULL);
756 LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_meth = (*env)->GetMethodID(env, LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_class, "<init>", "(JJJ)V");
757 DO_ASSERT(LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_meth != NULL);
759 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSpendableOutputDescriptor_1ref_1from_1ptr (JNIEnv * env, jclass _c, jlong ptr) {
760 LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)ptr;
762 case LDKSpendableOutputDescriptor_StaticOutput: {
763 long outpoint_ref = (long)&obj->static_output.outpoint;
764 long output_ref = (long)&obj->static_output.output;
765 return (*env)->NewObject(env, LDKSpendableOutputDescriptor_StaticOutput_class, LDKSpendableOutputDescriptor_StaticOutput_meth, outpoint_ref, output_ref);
767 case LDKSpendableOutputDescriptor_DynamicOutputP2WSH: {
768 long outpoint_ref = (long)&obj->dynamic_output_p2wsh.outpoint;
769 long per_commitment_point_ref = (long)&obj->dynamic_output_p2wsh.per_commitment_point;
770 long output_ref = (long)&obj->dynamic_output_p2wsh.output;
771 long key_derivation_params_ref = (long)&obj->dynamic_output_p2wsh.key_derivation_params;
772 long revocation_pubkey_ref = (long)&obj->dynamic_output_p2wsh.revocation_pubkey;
773 return (*env)->NewObject(env, LDKSpendableOutputDescriptor_DynamicOutputP2WSH_class, LDKSpendableOutputDescriptor_DynamicOutputP2WSH_meth, outpoint_ref, per_commitment_point_ref, obj->dynamic_output_p2wsh.to_self_delay, output_ref, key_derivation_params_ref, revocation_pubkey_ref);
775 case LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment: {
776 long outpoint_ref = (long)&obj->static_output_counterparty_payment.outpoint;
777 long output_ref = (long)&obj->static_output_counterparty_payment.output;
778 long key_derivation_params_ref = (long)&obj->static_output_counterparty_payment.key_derivation_params;
779 return (*env)->NewObject(env, LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_class, LDKSpendableOutputDescriptor_StaticOutputCounterpartyPayment_meth, outpoint_ref, output_ref, key_derivation_params_ref);
784 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1SpendableOutputDescriptor_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
785 LDKCVecTempl_SpendableOutputDescriptor *vec = (LDKCVecTempl_SpendableOutputDescriptor*)ptr;
786 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKSpendableOutputDescriptor));
788 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1SpendableOutputDescriptor_1new(JNIEnv *env, jclass _b, jlongArray elems){
789 LDKCVecTempl_SpendableOutputDescriptor *ret = MALLOC(sizeof(LDKCVecTempl_SpendableOutputDescriptor), "LDKCVecTempl_SpendableOutputDescriptor");
790 ret->datalen = (*env)->GetArrayLength(env, elems);
791 if (ret->datalen == 0) {
794 ret->data = malloc(sizeof(LDKSpendableOutputDescriptor) * ret->datalen); // often freed by rust directly
795 jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
796 for (size_t i = 0; i < ret->datalen; i++) {
797 jlong arr_elem = java_elems[i];
798 LDKSpendableOutputDescriptor arr_elem_conv = *(LDKSpendableOutputDescriptor*)arr_elem;
799 FREE((void*)arr_elem);
800 ret->data[i] = arr_elem_conv;
802 (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
806 static jclass LDKEvent_FundingGenerationReady_class = NULL;
807 static jmethodID LDKEvent_FundingGenerationReady_meth = NULL;
808 static jclass LDKEvent_FundingBroadcastSafe_class = NULL;
809 static jmethodID LDKEvent_FundingBroadcastSafe_meth = NULL;
810 static jclass LDKEvent_PaymentReceived_class = NULL;
811 static jmethodID LDKEvent_PaymentReceived_meth = NULL;
812 static jclass LDKEvent_PaymentSent_class = NULL;
813 static jmethodID LDKEvent_PaymentSent_meth = NULL;
814 static jclass LDKEvent_PaymentFailed_class = NULL;
815 static jmethodID LDKEvent_PaymentFailed_meth = NULL;
816 static jclass LDKEvent_PendingHTLCsForwardable_class = NULL;
817 static jmethodID LDKEvent_PendingHTLCsForwardable_meth = NULL;
818 static jclass LDKEvent_SpendableOutputs_class = NULL;
819 static jmethodID LDKEvent_SpendableOutputs_meth = NULL;
820 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKEvent_init (JNIEnv * env, jclass _a) {
821 LDKEvent_FundingGenerationReady_class =
822 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$FundingGenerationReady;"));
823 DO_ASSERT(LDKEvent_FundingGenerationReady_class != NULL);
824 LDKEvent_FundingGenerationReady_meth = (*env)->GetMethodID(env, LDKEvent_FundingGenerationReady_class, "<init>", "([BJJJ)V");
825 DO_ASSERT(LDKEvent_FundingGenerationReady_meth != NULL);
826 LDKEvent_FundingBroadcastSafe_class =
827 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$FundingBroadcastSafe;"));
828 DO_ASSERT(LDKEvent_FundingBroadcastSafe_class != NULL);
829 LDKEvent_FundingBroadcastSafe_meth = (*env)->GetMethodID(env, LDKEvent_FundingBroadcastSafe_class, "<init>", "(JJ)V");
830 DO_ASSERT(LDKEvent_FundingBroadcastSafe_meth != NULL);
831 LDKEvent_PaymentReceived_class =
832 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentReceived;"));
833 DO_ASSERT(LDKEvent_PaymentReceived_class != NULL);
834 LDKEvent_PaymentReceived_meth = (*env)->GetMethodID(env, LDKEvent_PaymentReceived_class, "<init>", "([B[BJ)V");
835 DO_ASSERT(LDKEvent_PaymentReceived_meth != NULL);
836 LDKEvent_PaymentSent_class =
837 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentSent;"));
838 DO_ASSERT(LDKEvent_PaymentSent_class != NULL);
839 LDKEvent_PaymentSent_meth = (*env)->GetMethodID(env, LDKEvent_PaymentSent_class, "<init>", "([B)V");
840 DO_ASSERT(LDKEvent_PaymentSent_meth != NULL);
841 LDKEvent_PaymentFailed_class =
842 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PaymentFailed;"));
843 DO_ASSERT(LDKEvent_PaymentFailed_class != NULL);
844 LDKEvent_PaymentFailed_meth = (*env)->GetMethodID(env, LDKEvent_PaymentFailed_class, "<init>", "([BZ)V");
845 DO_ASSERT(LDKEvent_PaymentFailed_meth != NULL);
846 LDKEvent_PendingHTLCsForwardable_class =
847 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$PendingHTLCsForwardable;"));
848 DO_ASSERT(LDKEvent_PendingHTLCsForwardable_class != NULL);
849 LDKEvent_PendingHTLCsForwardable_meth = (*env)->GetMethodID(env, LDKEvent_PendingHTLCsForwardable_class, "<init>", "(J)V");
850 DO_ASSERT(LDKEvent_PendingHTLCsForwardable_meth != NULL);
851 LDKEvent_SpendableOutputs_class =
852 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKEvent$SpendableOutputs;"));
853 DO_ASSERT(LDKEvent_SpendableOutputs_class != NULL);
854 LDKEvent_SpendableOutputs_meth = (*env)->GetMethodID(env, LDKEvent_SpendableOutputs_class, "<init>", "(J)V");
855 DO_ASSERT(LDKEvent_SpendableOutputs_meth != NULL);
857 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEvent_1ref_1from_1ptr (JNIEnv * env, jclass _c, jlong ptr) {
858 LDKEvent *obj = (LDKEvent*)ptr;
860 case LDKEvent_FundingGenerationReady: {
861 jbyteArray temporary_channel_id_arr = (*env)->NewByteArray(env, 32);
862 (*env)->SetByteArrayRegion(env, temporary_channel_id_arr, 0, 32, obj->funding_generation_ready.temporary_channel_id.data);
863 long output_script_ref = (long)&obj->funding_generation_ready.output_script;
864 return (*env)->NewObject(env, LDKEvent_FundingGenerationReady_class, LDKEvent_FundingGenerationReady_meth, temporary_channel_id_arr, obj->funding_generation_ready.channel_value_satoshis, output_script_ref, obj->funding_generation_ready.user_channel_id);
866 case LDKEvent_FundingBroadcastSafe: {
867 long funding_txo_ref = (long)&obj->funding_broadcast_safe.funding_txo;
868 return (*env)->NewObject(env, LDKEvent_FundingBroadcastSafe_class, LDKEvent_FundingBroadcastSafe_meth, funding_txo_ref, obj->funding_broadcast_safe.user_channel_id);
870 case LDKEvent_PaymentReceived: {
871 jbyteArray payment_hash_arr = (*env)->NewByteArray(env, 32);
872 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_received.payment_hash.data);
873 jbyteArray payment_secret_arr = (*env)->NewByteArray(env, 32);
874 (*env)->SetByteArrayRegion(env, payment_secret_arr, 0, 32, obj->payment_received.payment_secret.data);
875 return (*env)->NewObject(env, LDKEvent_PaymentReceived_class, LDKEvent_PaymentReceived_meth, payment_hash_arr, payment_secret_arr, obj->payment_received.amt);
877 case LDKEvent_PaymentSent: {
878 jbyteArray payment_preimage_arr = (*env)->NewByteArray(env, 32);
879 (*env)->SetByteArrayRegion(env, payment_preimage_arr, 0, 32, obj->payment_sent.payment_preimage.data);
880 return (*env)->NewObject(env, LDKEvent_PaymentSent_class, LDKEvent_PaymentSent_meth, payment_preimage_arr);
882 case LDKEvent_PaymentFailed: {
883 jbyteArray payment_hash_arr = (*env)->NewByteArray(env, 32);
884 (*env)->SetByteArrayRegion(env, payment_hash_arr, 0, 32, obj->payment_failed.payment_hash.data);
885 return (*env)->NewObject(env, LDKEvent_PaymentFailed_class, LDKEvent_PaymentFailed_meth, payment_hash_arr, obj->payment_failed.rejected_by_dest);
887 case LDKEvent_PendingHTLCsForwardable: {
888 return (*env)->NewObject(env, LDKEvent_PendingHTLCsForwardable_class, LDKEvent_PendingHTLCsForwardable_meth, obj->pending_htl_cs_forwardable.time_forwardable);
890 case LDKEvent_SpendableOutputs: {
891 long outputs_ref = (long)&obj->spendable_outputs.outputs;
892 return (*env)->NewObject(env, LDKEvent_SpendableOutputs_class, LDKEvent_SpendableOutputs_meth, outputs_ref);
897 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKAcceptChannel_1optional_1none (JNIEnv * env, jclass _a) {
898 LDKAcceptChannel *ret = MALLOC(sizeof(LDKAcceptChannel), "LDKAcceptChannel");
902 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKOpenChannel_1optional_1none (JNIEnv * env, jclass _a) {
903 LDKOpenChannel *ret = MALLOC(sizeof(LDKOpenChannel), "LDKOpenChannel");
907 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKFundingCreated_1optional_1none (JNIEnv * env, jclass _a) {
908 LDKFundingCreated *ret = MALLOC(sizeof(LDKFundingCreated), "LDKFundingCreated");
912 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKFundingSigned_1optional_1none (JNIEnv * env, jclass _a) {
913 LDKFundingSigned *ret = MALLOC(sizeof(LDKFundingSigned), "LDKFundingSigned");
917 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKFundingLocked_1optional_1none (JNIEnv * env, jclass _a) {
918 LDKFundingLocked *ret = MALLOC(sizeof(LDKFundingLocked), "LDKFundingLocked");
922 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKAnnouncementSignatures_1optional_1none (JNIEnv * env, jclass _a) {
923 LDKAnnouncementSignatures *ret = MALLOC(sizeof(LDKAnnouncementSignatures), "LDKAnnouncementSignatures");
927 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCommitmentUpdate_1optional_1none (JNIEnv * env, jclass _a) {
928 LDKCommitmentUpdate *ret = MALLOC(sizeof(LDKCommitmentUpdate), "LDKCommitmentUpdate");
932 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRevokeAndACK_1optional_1none (JNIEnv * env, jclass _a) {
933 LDKRevokeAndACK *ret = MALLOC(sizeof(LDKRevokeAndACK), "LDKRevokeAndACK");
937 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKClosingSigned_1optional_1none (JNIEnv * env, jclass _a) {
938 LDKClosingSigned *ret = MALLOC(sizeof(LDKClosingSigned), "LDKClosingSigned");
942 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKShutdown_1optional_1none (JNIEnv * env, jclass _a) {
943 LDKShutdown *ret = MALLOC(sizeof(LDKShutdown), "LDKShutdown");
947 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelReestablish_1optional_1none (JNIEnv * env, jclass _a) {
948 LDKChannelReestablish *ret = MALLOC(sizeof(LDKChannelReestablish), "LDKChannelReestablish");
952 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKNodeAnnouncement_1optional_1none (JNIEnv * env, jclass _a) {
953 LDKNodeAnnouncement *ret = MALLOC(sizeof(LDKNodeAnnouncement), "LDKNodeAnnouncement");
957 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKErrorMessage_1optional_1none (JNIEnv * env, jclass _a) {
958 LDKErrorMessage *ret = MALLOC(sizeof(LDKErrorMessage), "LDKErrorMessage");
962 static jclass LDKErrorAction_DisconnectPeer_class = NULL;
963 static jmethodID LDKErrorAction_DisconnectPeer_meth = NULL;
964 static jclass LDKErrorAction_IgnoreError_class = NULL;
965 static jmethodID LDKErrorAction_IgnoreError_meth = NULL;
966 static jclass LDKErrorAction_SendErrorMessage_class = NULL;
967 static jmethodID LDKErrorAction_SendErrorMessage_meth = NULL;
968 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKErrorAction_init (JNIEnv * env, jclass _a) {
969 LDKErrorAction_DisconnectPeer_class =
970 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKErrorAction$DisconnectPeer;"));
971 DO_ASSERT(LDKErrorAction_DisconnectPeer_class != NULL);
972 LDKErrorAction_DisconnectPeer_meth = (*env)->GetMethodID(env, LDKErrorAction_DisconnectPeer_class, "<init>", "(J)V");
973 DO_ASSERT(LDKErrorAction_DisconnectPeer_meth != NULL);
974 LDKErrorAction_IgnoreError_class =
975 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKErrorAction$IgnoreError;"));
976 DO_ASSERT(LDKErrorAction_IgnoreError_class != NULL);
977 LDKErrorAction_IgnoreError_meth = (*env)->GetMethodID(env, LDKErrorAction_IgnoreError_class, "<init>", "()V");
978 DO_ASSERT(LDKErrorAction_IgnoreError_meth != NULL);
979 LDKErrorAction_SendErrorMessage_class =
980 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKErrorAction$SendErrorMessage;"));
981 DO_ASSERT(LDKErrorAction_SendErrorMessage_class != NULL);
982 LDKErrorAction_SendErrorMessage_meth = (*env)->GetMethodID(env, LDKErrorAction_SendErrorMessage_class, "<init>", "(J)V");
983 DO_ASSERT(LDKErrorAction_SendErrorMessage_meth != NULL);
985 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKErrorAction_1ref_1from_1ptr (JNIEnv * env, jclass _c, jlong ptr) {
986 LDKErrorAction *obj = (LDKErrorAction*)ptr;
988 case LDKErrorAction_DisconnectPeer: {
989 long msg_ref = (long)&obj->disconnect_peer.msg;
990 return (*env)->NewObject(env, LDKErrorAction_DisconnectPeer_class, LDKErrorAction_DisconnectPeer_meth, msg_ref);
992 case LDKErrorAction_IgnoreError: {
993 return (*env)->NewObject(env, LDKErrorAction_IgnoreError_class, LDKErrorAction_IgnoreError_meth);
995 case LDKErrorAction_SendErrorMessage: {
996 long msg_ref = (long)&obj->send_error_message.msg;
997 return (*env)->NewObject(env, LDKErrorAction_SendErrorMessage_class, LDKErrorAction_SendErrorMessage_meth, msg_ref);
1002 static jclass LDKHTLCFailChannelUpdate_ChannelUpdateMessage_class = NULL;
1003 static jmethodID LDKHTLCFailChannelUpdate_ChannelUpdateMessage_meth = NULL;
1004 static jclass LDKHTLCFailChannelUpdate_ChannelClosed_class = NULL;
1005 static jmethodID LDKHTLCFailChannelUpdate_ChannelClosed_meth = NULL;
1006 static jclass LDKHTLCFailChannelUpdate_NodeFailure_class = NULL;
1007 static jmethodID LDKHTLCFailChannelUpdate_NodeFailure_meth = NULL;
1008 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKHTLCFailChannelUpdate_init (JNIEnv * env, jclass _a) {
1009 LDKHTLCFailChannelUpdate_ChannelUpdateMessage_class =
1010 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKHTLCFailChannelUpdate$ChannelUpdateMessage;"));
1011 DO_ASSERT(LDKHTLCFailChannelUpdate_ChannelUpdateMessage_class != NULL);
1012 LDKHTLCFailChannelUpdate_ChannelUpdateMessage_meth = (*env)->GetMethodID(env, LDKHTLCFailChannelUpdate_ChannelUpdateMessage_class, "<init>", "(J)V");
1013 DO_ASSERT(LDKHTLCFailChannelUpdate_ChannelUpdateMessage_meth != NULL);
1014 LDKHTLCFailChannelUpdate_ChannelClosed_class =
1015 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKHTLCFailChannelUpdate$ChannelClosed;"));
1016 DO_ASSERT(LDKHTLCFailChannelUpdate_ChannelClosed_class != NULL);
1017 LDKHTLCFailChannelUpdate_ChannelClosed_meth = (*env)->GetMethodID(env, LDKHTLCFailChannelUpdate_ChannelClosed_class, "<init>", "(JZ)V");
1018 DO_ASSERT(LDKHTLCFailChannelUpdate_ChannelClosed_meth != NULL);
1019 LDKHTLCFailChannelUpdate_NodeFailure_class =
1020 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKHTLCFailChannelUpdate$NodeFailure;"));
1021 DO_ASSERT(LDKHTLCFailChannelUpdate_NodeFailure_class != NULL);
1022 LDKHTLCFailChannelUpdate_NodeFailure_meth = (*env)->GetMethodID(env, LDKHTLCFailChannelUpdate_NodeFailure_class, "<init>", "(JZ)V");
1023 DO_ASSERT(LDKHTLCFailChannelUpdate_NodeFailure_meth != NULL);
1025 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKHTLCFailChannelUpdate_1ref_1from_1ptr (JNIEnv * env, jclass _c, jlong ptr) {
1026 LDKHTLCFailChannelUpdate *obj = (LDKHTLCFailChannelUpdate*)ptr;
1028 case LDKHTLCFailChannelUpdate_ChannelUpdateMessage: {
1029 long msg_ref = (long)&obj->channel_update_message.msg;
1030 return (*env)->NewObject(env, LDKHTLCFailChannelUpdate_ChannelUpdateMessage_class, LDKHTLCFailChannelUpdate_ChannelUpdateMessage_meth, msg_ref);
1032 case LDKHTLCFailChannelUpdate_ChannelClosed: {
1033 return (*env)->NewObject(env, LDKHTLCFailChannelUpdate_ChannelClosed_class, LDKHTLCFailChannelUpdate_ChannelClosed_meth, obj->channel_closed.short_channel_id, obj->channel_closed.is_permanent);
1035 case LDKHTLCFailChannelUpdate_NodeFailure: {
1036 long node_id_ref = (long)&obj->node_failure.node_id;
1037 return (*env)->NewObject(env, LDKHTLCFailChannelUpdate_NodeFailure_class, LDKHTLCFailChannelUpdate_NodeFailure_meth, node_id_ref, obj->node_failure.is_permanent);
1042 static jclass LDKMessageSendEvent_SendAcceptChannel_class = NULL;
1043 static jmethodID LDKMessageSendEvent_SendAcceptChannel_meth = NULL;
1044 static jclass LDKMessageSendEvent_SendOpenChannel_class = NULL;
1045 static jmethodID LDKMessageSendEvent_SendOpenChannel_meth = NULL;
1046 static jclass LDKMessageSendEvent_SendFundingCreated_class = NULL;
1047 static jmethodID LDKMessageSendEvent_SendFundingCreated_meth = NULL;
1048 static jclass LDKMessageSendEvent_SendFundingSigned_class = NULL;
1049 static jmethodID LDKMessageSendEvent_SendFundingSigned_meth = NULL;
1050 static jclass LDKMessageSendEvent_SendFundingLocked_class = NULL;
1051 static jmethodID LDKMessageSendEvent_SendFundingLocked_meth = NULL;
1052 static jclass LDKMessageSendEvent_SendAnnouncementSignatures_class = NULL;
1053 static jmethodID LDKMessageSendEvent_SendAnnouncementSignatures_meth = NULL;
1054 static jclass LDKMessageSendEvent_UpdateHTLCs_class = NULL;
1055 static jmethodID LDKMessageSendEvent_UpdateHTLCs_meth = NULL;
1056 static jclass LDKMessageSendEvent_SendRevokeAndACK_class = NULL;
1057 static jmethodID LDKMessageSendEvent_SendRevokeAndACK_meth = NULL;
1058 static jclass LDKMessageSendEvent_SendClosingSigned_class = NULL;
1059 static jmethodID LDKMessageSendEvent_SendClosingSigned_meth = NULL;
1060 static jclass LDKMessageSendEvent_SendShutdown_class = NULL;
1061 static jmethodID LDKMessageSendEvent_SendShutdown_meth = NULL;
1062 static jclass LDKMessageSendEvent_SendChannelReestablish_class = NULL;
1063 static jmethodID LDKMessageSendEvent_SendChannelReestablish_meth = NULL;
1064 static jclass LDKMessageSendEvent_BroadcastChannelAnnouncement_class = NULL;
1065 static jmethodID LDKMessageSendEvent_BroadcastChannelAnnouncement_meth = NULL;
1066 static jclass LDKMessageSendEvent_BroadcastNodeAnnouncement_class = NULL;
1067 static jmethodID LDKMessageSendEvent_BroadcastNodeAnnouncement_meth = NULL;
1068 static jclass LDKMessageSendEvent_BroadcastChannelUpdate_class = NULL;
1069 static jmethodID LDKMessageSendEvent_BroadcastChannelUpdate_meth = NULL;
1070 static jclass LDKMessageSendEvent_HandleError_class = NULL;
1071 static jmethodID LDKMessageSendEvent_HandleError_meth = NULL;
1072 static jclass LDKMessageSendEvent_PaymentFailureNetworkUpdate_class = NULL;
1073 static jmethodID LDKMessageSendEvent_PaymentFailureNetworkUpdate_meth = NULL;
1074 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKMessageSendEvent_init (JNIEnv * env, jclass _a) {
1075 LDKMessageSendEvent_SendAcceptChannel_class =
1076 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendAcceptChannel;"));
1077 DO_ASSERT(LDKMessageSendEvent_SendAcceptChannel_class != NULL);
1078 LDKMessageSendEvent_SendAcceptChannel_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendAcceptChannel_class, "<init>", "(JJ)V");
1079 DO_ASSERT(LDKMessageSendEvent_SendAcceptChannel_meth != NULL);
1080 LDKMessageSendEvent_SendOpenChannel_class =
1081 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendOpenChannel;"));
1082 DO_ASSERT(LDKMessageSendEvent_SendOpenChannel_class != NULL);
1083 LDKMessageSendEvent_SendOpenChannel_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendOpenChannel_class, "<init>", "(JJ)V");
1084 DO_ASSERT(LDKMessageSendEvent_SendOpenChannel_meth != NULL);
1085 LDKMessageSendEvent_SendFundingCreated_class =
1086 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendFundingCreated;"));
1087 DO_ASSERT(LDKMessageSendEvent_SendFundingCreated_class != NULL);
1088 LDKMessageSendEvent_SendFundingCreated_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendFundingCreated_class, "<init>", "(JJ)V");
1089 DO_ASSERT(LDKMessageSendEvent_SendFundingCreated_meth != NULL);
1090 LDKMessageSendEvent_SendFundingSigned_class =
1091 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendFundingSigned;"));
1092 DO_ASSERT(LDKMessageSendEvent_SendFundingSigned_class != NULL);
1093 LDKMessageSendEvent_SendFundingSigned_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendFundingSigned_class, "<init>", "(JJ)V");
1094 DO_ASSERT(LDKMessageSendEvent_SendFundingSigned_meth != NULL);
1095 LDKMessageSendEvent_SendFundingLocked_class =
1096 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendFundingLocked;"));
1097 DO_ASSERT(LDKMessageSendEvent_SendFundingLocked_class != NULL);
1098 LDKMessageSendEvent_SendFundingLocked_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendFundingLocked_class, "<init>", "(JJ)V");
1099 DO_ASSERT(LDKMessageSendEvent_SendFundingLocked_meth != NULL);
1100 LDKMessageSendEvent_SendAnnouncementSignatures_class =
1101 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendAnnouncementSignatures;"));
1102 DO_ASSERT(LDKMessageSendEvent_SendAnnouncementSignatures_class != NULL);
1103 LDKMessageSendEvent_SendAnnouncementSignatures_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendAnnouncementSignatures_class, "<init>", "(JJ)V");
1104 DO_ASSERT(LDKMessageSendEvent_SendAnnouncementSignatures_meth != NULL);
1105 LDKMessageSendEvent_UpdateHTLCs_class =
1106 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$UpdateHTLCs;"));
1107 DO_ASSERT(LDKMessageSendEvent_UpdateHTLCs_class != NULL);
1108 LDKMessageSendEvent_UpdateHTLCs_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_UpdateHTLCs_class, "<init>", "(JJ)V");
1109 DO_ASSERT(LDKMessageSendEvent_UpdateHTLCs_meth != NULL);
1110 LDKMessageSendEvent_SendRevokeAndACK_class =
1111 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendRevokeAndACK;"));
1112 DO_ASSERT(LDKMessageSendEvent_SendRevokeAndACK_class != NULL);
1113 LDKMessageSendEvent_SendRevokeAndACK_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendRevokeAndACK_class, "<init>", "(JJ)V");
1114 DO_ASSERT(LDKMessageSendEvent_SendRevokeAndACK_meth != NULL);
1115 LDKMessageSendEvent_SendClosingSigned_class =
1116 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendClosingSigned;"));
1117 DO_ASSERT(LDKMessageSendEvent_SendClosingSigned_class != NULL);
1118 LDKMessageSendEvent_SendClosingSigned_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendClosingSigned_class, "<init>", "(JJ)V");
1119 DO_ASSERT(LDKMessageSendEvent_SendClosingSigned_meth != NULL);
1120 LDKMessageSendEvent_SendShutdown_class =
1121 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendShutdown;"));
1122 DO_ASSERT(LDKMessageSendEvent_SendShutdown_class != NULL);
1123 LDKMessageSendEvent_SendShutdown_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendShutdown_class, "<init>", "(JJ)V");
1124 DO_ASSERT(LDKMessageSendEvent_SendShutdown_meth != NULL);
1125 LDKMessageSendEvent_SendChannelReestablish_class =
1126 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$SendChannelReestablish;"));
1127 DO_ASSERT(LDKMessageSendEvent_SendChannelReestablish_class != NULL);
1128 LDKMessageSendEvent_SendChannelReestablish_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_SendChannelReestablish_class, "<init>", "(JJ)V");
1129 DO_ASSERT(LDKMessageSendEvent_SendChannelReestablish_meth != NULL);
1130 LDKMessageSendEvent_BroadcastChannelAnnouncement_class =
1131 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$BroadcastChannelAnnouncement;"));
1132 DO_ASSERT(LDKMessageSendEvent_BroadcastChannelAnnouncement_class != NULL);
1133 LDKMessageSendEvent_BroadcastChannelAnnouncement_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_BroadcastChannelAnnouncement_class, "<init>", "(JJ)V");
1134 DO_ASSERT(LDKMessageSendEvent_BroadcastChannelAnnouncement_meth != NULL);
1135 LDKMessageSendEvent_BroadcastNodeAnnouncement_class =
1136 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$BroadcastNodeAnnouncement;"));
1137 DO_ASSERT(LDKMessageSendEvent_BroadcastNodeAnnouncement_class != NULL);
1138 LDKMessageSendEvent_BroadcastNodeAnnouncement_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_BroadcastNodeAnnouncement_class, "<init>", "(J)V");
1139 DO_ASSERT(LDKMessageSendEvent_BroadcastNodeAnnouncement_meth != NULL);
1140 LDKMessageSendEvent_BroadcastChannelUpdate_class =
1141 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$BroadcastChannelUpdate;"));
1142 DO_ASSERT(LDKMessageSendEvent_BroadcastChannelUpdate_class != NULL);
1143 LDKMessageSendEvent_BroadcastChannelUpdate_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_BroadcastChannelUpdate_class, "<init>", "(J)V");
1144 DO_ASSERT(LDKMessageSendEvent_BroadcastChannelUpdate_meth != NULL);
1145 LDKMessageSendEvent_HandleError_class =
1146 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$HandleError;"));
1147 DO_ASSERT(LDKMessageSendEvent_HandleError_class != NULL);
1148 LDKMessageSendEvent_HandleError_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_HandleError_class, "<init>", "(JJ)V");
1149 DO_ASSERT(LDKMessageSendEvent_HandleError_meth != NULL);
1150 LDKMessageSendEvent_PaymentFailureNetworkUpdate_class =
1151 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKMessageSendEvent$PaymentFailureNetworkUpdate;"));
1152 DO_ASSERT(LDKMessageSendEvent_PaymentFailureNetworkUpdate_class != NULL);
1153 LDKMessageSendEvent_PaymentFailureNetworkUpdate_meth = (*env)->GetMethodID(env, LDKMessageSendEvent_PaymentFailureNetworkUpdate_class, "<init>", "(J)V");
1154 DO_ASSERT(LDKMessageSendEvent_PaymentFailureNetworkUpdate_meth != NULL);
1156 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEvent_1ref_1from_1ptr (JNIEnv * env, jclass _c, jlong ptr) {
1157 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)ptr;
1159 case LDKMessageSendEvent_SendAcceptChannel: {
1160 long node_id_ref = (long)&obj->send_accept_channel.node_id;
1161 long msg_ref = (long)&obj->send_accept_channel.msg;
1162 return (*env)->NewObject(env, LDKMessageSendEvent_SendAcceptChannel_class, LDKMessageSendEvent_SendAcceptChannel_meth, node_id_ref, msg_ref);
1164 case LDKMessageSendEvent_SendOpenChannel: {
1165 long node_id_ref = (long)&obj->send_open_channel.node_id;
1166 long msg_ref = (long)&obj->send_open_channel.msg;
1167 return (*env)->NewObject(env, LDKMessageSendEvent_SendOpenChannel_class, LDKMessageSendEvent_SendOpenChannel_meth, node_id_ref, msg_ref);
1169 case LDKMessageSendEvent_SendFundingCreated: {
1170 long node_id_ref = (long)&obj->send_funding_created.node_id;
1171 long msg_ref = (long)&obj->send_funding_created.msg;
1172 return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingCreated_class, LDKMessageSendEvent_SendFundingCreated_meth, node_id_ref, msg_ref);
1174 case LDKMessageSendEvent_SendFundingSigned: {
1175 long node_id_ref = (long)&obj->send_funding_signed.node_id;
1176 long msg_ref = (long)&obj->send_funding_signed.msg;
1177 return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingSigned_class, LDKMessageSendEvent_SendFundingSigned_meth, node_id_ref, msg_ref);
1179 case LDKMessageSendEvent_SendFundingLocked: {
1180 long node_id_ref = (long)&obj->send_funding_locked.node_id;
1181 long msg_ref = (long)&obj->send_funding_locked.msg;
1182 return (*env)->NewObject(env, LDKMessageSendEvent_SendFundingLocked_class, LDKMessageSendEvent_SendFundingLocked_meth, node_id_ref, msg_ref);
1184 case LDKMessageSendEvent_SendAnnouncementSignatures: {
1185 long node_id_ref = (long)&obj->send_announcement_signatures.node_id;
1186 long msg_ref = (long)&obj->send_announcement_signatures.msg;
1187 return (*env)->NewObject(env, LDKMessageSendEvent_SendAnnouncementSignatures_class, LDKMessageSendEvent_SendAnnouncementSignatures_meth, node_id_ref, msg_ref);
1189 case LDKMessageSendEvent_UpdateHTLCs: {
1190 long node_id_ref = (long)&obj->update_htl_cs.node_id;
1191 long updates_ref = (long)&obj->update_htl_cs.updates;
1192 return (*env)->NewObject(env, LDKMessageSendEvent_UpdateHTLCs_class, LDKMessageSendEvent_UpdateHTLCs_meth, node_id_ref, updates_ref);
1194 case LDKMessageSendEvent_SendRevokeAndACK: {
1195 long node_id_ref = (long)&obj->send_revoke_and_ack.node_id;
1196 long msg_ref = (long)&obj->send_revoke_and_ack.msg;
1197 return (*env)->NewObject(env, LDKMessageSendEvent_SendRevokeAndACK_class, LDKMessageSendEvent_SendRevokeAndACK_meth, node_id_ref, msg_ref);
1199 case LDKMessageSendEvent_SendClosingSigned: {
1200 long node_id_ref = (long)&obj->send_closing_signed.node_id;
1201 long msg_ref = (long)&obj->send_closing_signed.msg;
1202 return (*env)->NewObject(env, LDKMessageSendEvent_SendClosingSigned_class, LDKMessageSendEvent_SendClosingSigned_meth, node_id_ref, msg_ref);
1204 case LDKMessageSendEvent_SendShutdown: {
1205 long node_id_ref = (long)&obj->send_shutdown.node_id;
1206 long msg_ref = (long)&obj->send_shutdown.msg;
1207 return (*env)->NewObject(env, LDKMessageSendEvent_SendShutdown_class, LDKMessageSendEvent_SendShutdown_meth, node_id_ref, msg_ref);
1209 case LDKMessageSendEvent_SendChannelReestablish: {
1210 long node_id_ref = (long)&obj->send_channel_reestablish.node_id;
1211 long msg_ref = (long)&obj->send_channel_reestablish.msg;
1212 return (*env)->NewObject(env, LDKMessageSendEvent_SendChannelReestablish_class, LDKMessageSendEvent_SendChannelReestablish_meth, node_id_ref, msg_ref);
1214 case LDKMessageSendEvent_BroadcastChannelAnnouncement: {
1215 long msg_ref = (long)&obj->broadcast_channel_announcement.msg;
1216 long update_msg_ref = (long)&obj->broadcast_channel_announcement.update_msg;
1217 return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastChannelAnnouncement_class, LDKMessageSendEvent_BroadcastChannelAnnouncement_meth, msg_ref, update_msg_ref);
1219 case LDKMessageSendEvent_BroadcastNodeAnnouncement: {
1220 long msg_ref = (long)&obj->broadcast_node_announcement.msg;
1221 return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastNodeAnnouncement_class, LDKMessageSendEvent_BroadcastNodeAnnouncement_meth, msg_ref);
1223 case LDKMessageSendEvent_BroadcastChannelUpdate: {
1224 long msg_ref = (long)&obj->broadcast_channel_update.msg;
1225 return (*env)->NewObject(env, LDKMessageSendEvent_BroadcastChannelUpdate_class, LDKMessageSendEvent_BroadcastChannelUpdate_meth, msg_ref);
1227 case LDKMessageSendEvent_HandleError: {
1228 long node_id_ref = (long)&obj->handle_error.node_id;
1229 long action_ref = (long)&obj->handle_error.action;
1230 return (*env)->NewObject(env, LDKMessageSendEvent_HandleError_class, LDKMessageSendEvent_HandleError_meth, node_id_ref, action_ref);
1232 case LDKMessageSendEvent_PaymentFailureNetworkUpdate: {
1233 long update_ref = (long)&obj->payment_failure_network_update.update;
1234 return (*env)->NewObject(env, LDKMessageSendEvent_PaymentFailureNetworkUpdate_class, LDKMessageSendEvent_PaymentFailureNetworkUpdate_meth, update_ref);
1239 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1MessageSendEvent_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
1240 LDKCVecTempl_MessageSendEvent *vec = (LDKCVecTempl_MessageSendEvent*)ptr;
1241 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKMessageSendEvent));
1243 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1MessageSendEvent_1new(JNIEnv *env, jclass _b, jlongArray elems){
1244 LDKCVecTempl_MessageSendEvent *ret = MALLOC(sizeof(LDKCVecTempl_MessageSendEvent), "LDKCVecTempl_MessageSendEvent");
1245 ret->datalen = (*env)->GetArrayLength(env, elems);
1246 if (ret->datalen == 0) {
1249 ret->data = malloc(sizeof(LDKMessageSendEvent) * ret->datalen); // often freed by rust directly
1250 jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
1251 for (size_t i = 0; i < ret->datalen; i++) {
1252 jlong arr_elem = java_elems[i];
1253 LDKMessageSendEvent arr_elem_conv = *(LDKMessageSendEvent*)arr_elem;
1254 FREE((void*)arr_elem);
1255 ret->data[i] = arr_elem_conv;
1257 (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
1261 typedef struct LDKMessageSendEventsProvider_JCalls {
1262 atomic_size_t refcnt;
1265 jmethodID get_and_clear_pending_msg_events_meth;
1266 } LDKMessageSendEventsProvider_JCalls;
1267 LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_jcall(const void* this_arg) {
1268 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
1270 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1271 LDKCVec_MessageSendEventZ* ret = (LDKCVec_MessageSendEventZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->get_and_clear_pending_msg_events_meth);
1272 LDKCVec_MessageSendEventZ res = *ret;
1276 static void LDKMessageSendEventsProvider_JCalls_free(void* this_arg) {
1277 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
1278 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1280 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1281 (*env)->DeleteGlobalRef(env, j_calls->o);
1285 static void* LDKMessageSendEventsProvider_JCalls_clone(const void* this_arg) {
1286 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
1287 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1288 return (void*) this_arg;
1290 static inline LDKMessageSendEventsProvider LDKMessageSendEventsProvider_init (JNIEnv * env, jclass _a, jobject o) {
1291 jclass c = (*env)->GetObjectClass(env, o);
1292 DO_ASSERT(c != NULL);
1293 LDKMessageSendEventsProvider_JCalls *calls = MALLOC(sizeof(LDKMessageSendEventsProvider_JCalls), "LDKMessageSendEventsProvider_JCalls");
1294 atomic_init(&calls->refcnt, 1);
1295 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
1296 calls->o = (*env)->NewGlobalRef(env, o);
1297 calls->get_and_clear_pending_msg_events_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_msg_events", "()J");
1298 DO_ASSERT(calls->get_and_clear_pending_msg_events_meth != NULL);
1300 LDKMessageSendEventsProvider ret = {
1301 .this_arg = (void*) calls,
1302 .get_and_clear_pending_msg_events = get_and_clear_pending_msg_events_jcall,
1303 .free = LDKMessageSendEventsProvider_JCalls_free,
1307 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1new (JNIEnv * env, jclass _a, jobject o) {
1308 LDKMessageSendEventsProvider *res_ptr = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
1309 *res_ptr = LDKMessageSendEventsProvider_init(env, _a, o);
1310 return (long)res_ptr;
1312 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
1313 return ((LDKMessageSendEventsProvider_JCalls*)val)->o;
1315 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1call_1get_1and_1clear_1pending_1msg_1events(JNIEnv * _env, jclass _b, jlong arg) {
1316 LDKMessageSendEventsProvider* arg_conv = (LDKMessageSendEventsProvider*)arg;
1317 LDKCVec_MessageSendEventZ* ret = MALLOC(sizeof(LDKCVec_MessageSendEventZ), "LDKCVec_MessageSendEventZ");
1318 *ret = (arg_conv->get_and_clear_pending_msg_events)(arg_conv->this_arg);
1322 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Event_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
1323 LDKCVecTempl_Event *vec = (LDKCVecTempl_Event*)ptr;
1324 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKEvent));
1326 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Event_1new(JNIEnv *env, jclass _b, jlongArray elems){
1327 LDKCVecTempl_Event *ret = MALLOC(sizeof(LDKCVecTempl_Event), "LDKCVecTempl_Event");
1328 ret->datalen = (*env)->GetArrayLength(env, elems);
1329 if (ret->datalen == 0) {
1332 ret->data = malloc(sizeof(LDKEvent) * ret->datalen); // often freed by rust directly
1333 jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
1334 for (size_t i = 0; i < ret->datalen; i++) {
1335 jlong arr_elem = java_elems[i];
1336 LDKEvent arr_elem_conv = *(LDKEvent*)arr_elem;
1337 FREE((void*)arr_elem);
1338 ret->data[i] = arr_elem_conv;
1340 (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
1344 typedef struct LDKEventsProvider_JCalls {
1345 atomic_size_t refcnt;
1348 jmethodID get_and_clear_pending_events_meth;
1349 } LDKEventsProvider_JCalls;
1350 LDKCVec_EventZ get_and_clear_pending_events_jcall(const void* this_arg) {
1351 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
1353 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1354 LDKCVec_EventZ* ret = (LDKCVec_EventZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->get_and_clear_pending_events_meth);
1355 LDKCVec_EventZ res = *ret;
1359 static void LDKEventsProvider_JCalls_free(void* this_arg) {
1360 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
1361 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1363 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1364 (*env)->DeleteGlobalRef(env, j_calls->o);
1368 static void* LDKEventsProvider_JCalls_clone(const void* this_arg) {
1369 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
1370 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1371 return (void*) this_arg;
1373 static inline LDKEventsProvider LDKEventsProvider_init (JNIEnv * env, jclass _a, jobject o) {
1374 jclass c = (*env)->GetObjectClass(env, o);
1375 DO_ASSERT(c != NULL);
1376 LDKEventsProvider_JCalls *calls = MALLOC(sizeof(LDKEventsProvider_JCalls), "LDKEventsProvider_JCalls");
1377 atomic_init(&calls->refcnt, 1);
1378 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
1379 calls->o = (*env)->NewGlobalRef(env, o);
1380 calls->get_and_clear_pending_events_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_events", "()J");
1381 DO_ASSERT(calls->get_and_clear_pending_events_meth != NULL);
1383 LDKEventsProvider ret = {
1384 .this_arg = (void*) calls,
1385 .get_and_clear_pending_events = get_and_clear_pending_events_jcall,
1386 .free = LDKEventsProvider_JCalls_free,
1390 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1new (JNIEnv * env, jclass _a, jobject o) {
1391 LDKEventsProvider *res_ptr = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
1392 *res_ptr = LDKEventsProvider_init(env, _a, o);
1393 return (long)res_ptr;
1395 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
1396 return ((LDKEventsProvider_JCalls*)val)->o;
1398 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1call_1get_1and_1clear_1pending_1events(JNIEnv * _env, jclass _b, jlong arg) {
1399 LDKEventsProvider* arg_conv = (LDKEventsProvider*)arg;
1400 LDKCVec_EventZ* ret = MALLOC(sizeof(LDKCVec_EventZ), "LDKCVec_EventZ");
1401 *ret = (arg_conv->get_and_clear_pending_events)(arg_conv->this_arg);
1405 typedef struct LDKLogger_JCalls {
1406 atomic_size_t refcnt;
1411 void log_jcall(const void* this_arg, const char *record) {
1412 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
1414 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1415 jstring record_conv = (*env)->NewStringUTF(env, record);
1416 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->log_meth, record_conv);
1418 static void LDKLogger_JCalls_free(void* this_arg) {
1419 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
1420 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1422 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1423 (*env)->DeleteGlobalRef(env, j_calls->o);
1427 static void* LDKLogger_JCalls_clone(const void* this_arg) {
1428 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
1429 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1430 return (void*) this_arg;
1432 static inline LDKLogger LDKLogger_init (JNIEnv * env, jclass _a, jobject o) {
1433 jclass c = (*env)->GetObjectClass(env, o);
1434 DO_ASSERT(c != NULL);
1435 LDKLogger_JCalls *calls = MALLOC(sizeof(LDKLogger_JCalls), "LDKLogger_JCalls");
1436 atomic_init(&calls->refcnt, 1);
1437 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
1438 calls->o = (*env)->NewGlobalRef(env, o);
1439 calls->log_meth = (*env)->GetMethodID(env, c, "log", "(Ljava/lang/String;)V");
1440 DO_ASSERT(calls->log_meth != NULL);
1443 .this_arg = (void*) calls,
1445 .free = LDKLogger_JCalls_free,
1449 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKLogger_1new (JNIEnv * env, jclass _a, jobject o) {
1450 LDKLogger *res_ptr = MALLOC(sizeof(LDKLogger), "LDKLogger");
1451 *res_ptr = LDKLogger_init(env, _a, o);
1452 return (long)res_ptr;
1454 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKLogger_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
1455 return ((LDKLogger_JCalls*)val)->o;
1457 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelHandshakeConfig_1optional_1none (JNIEnv * env, jclass _a) {
1458 LDKChannelHandshakeConfig *ret = MALLOC(sizeof(LDKChannelHandshakeConfig), "LDKChannelHandshakeConfig");
1462 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelHandshakeLimits_1optional_1none (JNIEnv * env, jclass _a) {
1463 LDKChannelHandshakeLimits *ret = MALLOC(sizeof(LDKChannelHandshakeLimits), "LDKChannelHandshakeLimits");
1467 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelConfig_1optional_1none (JNIEnv * env, jclass _a) {
1468 LDKChannelConfig *ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
1472 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKUserConfig_1optional_1none (JNIEnv * env, jclass _a) {
1473 LDKUserConfig *ret = MALLOC(sizeof(LDKUserConfig), "LDKUserConfig");
1477 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
1478 return ((LDKCResult_TxOutAccessErrorZ*)arg)->result_ok;
1480 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
1481 if (((LDKCResult_TxOutAccessErrorZ*)arg)->result_ok) {
1482 return (long)((LDKCResult_TxOutAccessErrorZ*)arg)->contents.result;
1484 return (long)((LDKCResult_TxOutAccessErrorZ*)arg)->contents.err;
1487 typedef struct LDKAccess_JCalls {
1488 atomic_size_t refcnt;
1491 jmethodID get_utxo_meth;
1493 LDKCResult_TxOutAccessErrorZ get_utxo_jcall(const void* this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id) {
1494 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
1496 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1497 jbyteArray genesis_hash_arr = (*env)->NewByteArray(env, 32);
1498 (*env)->SetByteArrayRegion(env, genesis_hash_arr, 0, 32, *genesis_hash);
1499 LDKCResult_TxOutAccessErrorZ* ret = (LDKCResult_TxOutAccessErrorZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->get_utxo_meth, genesis_hash_arr, short_channel_id);
1500 LDKCResult_TxOutAccessErrorZ res = *ret;
1504 static void LDKAccess_JCalls_free(void* this_arg) {
1505 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
1506 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1508 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1509 (*env)->DeleteGlobalRef(env, j_calls->o);
1513 static void* LDKAccess_JCalls_clone(const void* this_arg) {
1514 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
1515 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1516 return (void*) this_arg;
1518 static inline LDKAccess LDKAccess_init (JNIEnv * env, jclass _a, jobject o) {
1519 jclass c = (*env)->GetObjectClass(env, o);
1520 DO_ASSERT(c != NULL);
1521 LDKAccess_JCalls *calls = MALLOC(sizeof(LDKAccess_JCalls), "LDKAccess_JCalls");
1522 atomic_init(&calls->refcnt, 1);
1523 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
1524 calls->o = (*env)->NewGlobalRef(env, o);
1525 calls->get_utxo_meth = (*env)->GetMethodID(env, c, "get_utxo", "([BJ)J");
1526 DO_ASSERT(calls->get_utxo_meth != NULL);
1529 .this_arg = (void*) calls,
1530 .get_utxo = get_utxo_jcall,
1531 .free = LDKAccess_JCalls_free,
1535 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKAccess_1new (JNIEnv * env, jclass _a, jobject o) {
1536 LDKAccess *res_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess");
1537 *res_ptr = LDKAccess_init(env, _a, o);
1538 return (long)res_ptr;
1540 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAccess_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
1541 return ((LDKAccess_JCalls*)val)->o;
1543 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) {
1544 LDKAccess* arg_conv = (LDKAccess*)arg;
1545 unsigned char genesis_hash_arr[32];
1546 (*_env)->GetByteArrayRegion (_env, genesis_hash, 0, 32, genesis_hash_arr);
1547 unsigned char (*genesis_hash_ref)[32] = &genesis_hash_arr;
1548 LDKCResult_TxOutAccessErrorZ* ret = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
1549 *ret = (arg_conv->get_utxo)(arg_conv->this_arg, genesis_hash_ref, short_channel_id);
1553 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelPublicKeys_1optional_1none (JNIEnv * env, jclass _a) {
1554 LDKChannelPublicKeys *ret = MALLOC(sizeof(LDKChannelPublicKeys), "LDKChannelPublicKeys");
1558 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKPreCalculatedTxCreationKeys_1optional_1none (JNIEnv * env, jclass _a) {
1559 LDKPreCalculatedTxCreationKeys *ret = MALLOC(sizeof(LDKPreCalculatedTxCreationKeys), "LDKPreCalculatedTxCreationKeys");
1563 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1HTLCOutputInCommitment_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
1564 LDKCVecTempl_HTLCOutputInCommitment *vec = (LDKCVecTempl_HTLCOutputInCommitment*)ptr;
1565 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKHTLCOutputInCommitment));
1567 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1HTLCOutputInCommitment_1new(JNIEnv *env, jclass _b, jlongArray elems){
1568 LDKCVecTempl_HTLCOutputInCommitment *ret = MALLOC(sizeof(LDKCVecTempl_HTLCOutputInCommitment), "LDKCVecTempl_HTLCOutputInCommitment");
1569 ret->datalen = (*env)->GetArrayLength(env, elems);
1570 if (ret->datalen == 0) {
1573 ret->data = malloc(sizeof(LDKHTLCOutputInCommitment) * ret->datalen); // often freed by rust directly
1574 jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
1575 for (size_t i = 0; i < ret->datalen; i++) {
1576 jlong arr_elem = java_elems[i];
1577 LDKHTLCOutputInCommitment arr_elem_conv = *(LDKHTLCOutputInCommitment*)arr_elem;
1578 FREE((void*)arr_elem);
1579 arr_elem_conv.is_owned = true;
1580 ret->data[i] = arr_elem_conv;
1582 (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
1586 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKHolderCommitmentTransaction_1optional_1none (JNIEnv * env, jclass _a) {
1587 LDKHolderCommitmentTransaction *ret = MALLOC(sizeof(LDKHolderCommitmentTransaction), "LDKHolderCommitmentTransaction");
1591 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKUnsignedChannelAnnouncement_1optional_1none (JNIEnv * env, jclass _a) {
1592 LDKUnsignedChannelAnnouncement *ret = MALLOC(sizeof(LDKUnsignedChannelAnnouncement), "LDKUnsignedChannelAnnouncement");
1596 typedef struct LDKChannelKeys_JCalls {
1597 atomic_size_t refcnt;
1600 jmethodID get_per_commitment_point_meth;
1601 jmethodID release_commitment_secret_meth;
1602 jmethodID key_derivation_params_meth;
1603 jmethodID sign_counterparty_commitment_meth;
1604 jmethodID sign_holder_commitment_meth;
1605 jmethodID sign_holder_commitment_htlc_transactions_meth;
1606 jmethodID sign_justice_transaction_meth;
1607 jmethodID sign_counterparty_htlc_transaction_meth;
1608 jmethodID sign_closing_transaction_meth;
1609 jmethodID sign_channel_announcement_meth;
1610 jmethodID on_accept_meth;
1611 } LDKChannelKeys_JCalls;
1612 LDKPublicKey get_per_commitment_point_jcall(const void* this_arg, uint64_t idx) {
1613 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
1615 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1616 LDKPublicKey* ret = (LDKPublicKey*)(*env)->CallLongMethod(env, j_calls->o, j_calls->get_per_commitment_point_meth, idx);
1617 LDKPublicKey res = *ret;
1621 LDKThirtyTwoBytes release_commitment_secret_jcall(const void* this_arg, uint64_t idx) {
1622 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
1624 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1625 jbyteArray jret = (*env)->CallObjectMethod(env, j_calls->o, j_calls->release_commitment_secret_meth, idx);
1626 LDKThirtyTwoBytes ret;
1627 (*env)->GetByteArrayRegion(env, jret, 0, 32, ret.data);
1630 LDKC2Tuple_u64u64Z key_derivation_params_jcall(const void* this_arg) {
1631 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
1633 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1634 LDKC2Tuple_u64u64Z* ret = (LDKC2Tuple_u64u64Z*)(*env)->CallLongMethod(env, j_calls->o, j_calls->key_derivation_params_meth);
1635 LDKC2Tuple_u64u64Z res = *ret;
1639 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) {
1640 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
1642 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1643 long commitment_tx_ref = (long)&commitment_tx;
1644 long htlcs_ref = (long)&htlcs;
1645 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->sign_counterparty_commitment_meth, feerate_per_kw, commitment_tx_ref, keys, htlcs_ref);
1646 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ res = *ret;
1650 LDKCResult_SignatureNoneZ sign_holder_commitment_jcall(const void* this_arg, const LDKHolderCommitmentTransaction *holder_commitment_tx) {
1651 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
1653 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1654 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->sign_holder_commitment_meth, holder_commitment_tx);
1655 LDKCResult_SignatureNoneZ res = *ret;
1659 LDKCResult_CVec_SignatureZNoneZ sign_holder_commitment_htlc_transactions_jcall(const void* this_arg, const LDKHolderCommitmentTransaction *holder_commitment_tx) {
1660 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
1662 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1663 LDKCResult_CVec_SignatureZNoneZ* ret = (LDKCResult_CVec_SignatureZNoneZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->sign_holder_commitment_htlc_transactions_meth, holder_commitment_tx);
1664 LDKCResult_CVec_SignatureZNoneZ res = *ret;
1668 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) {
1669 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
1671 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1672 long justice_tx_ref = (long)&justice_tx;
1673 jbyteArray per_commitment_key_arr = (*env)->NewByteArray(env, 32);
1674 (*env)->SetByteArrayRegion(env, per_commitment_key_arr, 0, 32, *per_commitment_key);
1675 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->sign_justice_transaction_meth, justice_tx_ref, input, amount, per_commitment_key_arr, htlc);
1676 LDKCResult_SignatureNoneZ res = *ret;
1680 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) {
1681 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
1683 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1684 long htlc_tx_ref = (long)&htlc_tx;
1685 long per_commitment_point_ref = (long)&per_commitment_point;
1686 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->sign_counterparty_htlc_transaction_meth, htlc_tx_ref, input, amount, per_commitment_point_ref, htlc);
1687 LDKCResult_SignatureNoneZ res = *ret;
1691 LDKCResult_SignatureNoneZ sign_closing_transaction_jcall(const void* this_arg, LDKTransaction closing_tx) {
1692 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
1694 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1695 long closing_tx_ref = (long)&closing_tx;
1696 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->sign_closing_transaction_meth, closing_tx_ref);
1697 LDKCResult_SignatureNoneZ res = *ret;
1701 LDKCResult_SignatureNoneZ sign_channel_announcement_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement *msg) {
1702 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
1704 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1705 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->sign_channel_announcement_meth, msg);
1706 LDKCResult_SignatureNoneZ res = *ret;
1710 void on_accept_jcall(void* this_arg, const LDKChannelPublicKeys *channel_points, uint16_t counterparty_selected_contest_delay, uint16_t holder_selected_contest_delay) {
1711 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
1713 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1714 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->on_accept_meth, channel_points, counterparty_selected_contest_delay, holder_selected_contest_delay);
1716 static void LDKChannelKeys_JCalls_free(void* this_arg) {
1717 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
1718 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1720 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1721 (*env)->DeleteGlobalRef(env, j_calls->o);
1725 static void* LDKChannelKeys_JCalls_clone(const void* this_arg) {
1726 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
1727 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1728 return (void*) this_arg;
1730 static inline LDKChannelKeys LDKChannelKeys_init (JNIEnv * env, jclass _a, jobject o) {
1731 jclass c = (*env)->GetObjectClass(env, o);
1732 DO_ASSERT(c != NULL);
1733 LDKChannelKeys_JCalls *calls = MALLOC(sizeof(LDKChannelKeys_JCalls), "LDKChannelKeys_JCalls");
1734 atomic_init(&calls->refcnt, 1);
1735 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
1736 calls->o = (*env)->NewGlobalRef(env, o);
1737 calls->get_per_commitment_point_meth = (*env)->GetMethodID(env, c, "get_per_commitment_point", "(J)J");
1738 DO_ASSERT(calls->get_per_commitment_point_meth != NULL);
1739 calls->release_commitment_secret_meth = (*env)->GetMethodID(env, c, "release_commitment_secret", "(J)[B");
1740 DO_ASSERT(calls->release_commitment_secret_meth != NULL);
1741 calls->key_derivation_params_meth = (*env)->GetMethodID(env, c, "key_derivation_params", "()J");
1742 DO_ASSERT(calls->key_derivation_params_meth != NULL);
1743 calls->sign_counterparty_commitment_meth = (*env)->GetMethodID(env, c, "sign_counterparty_commitment", "(IJJJ)J");
1744 DO_ASSERT(calls->sign_counterparty_commitment_meth != NULL);
1745 calls->sign_holder_commitment_meth = (*env)->GetMethodID(env, c, "sign_holder_commitment", "(J)J");
1746 DO_ASSERT(calls->sign_holder_commitment_meth != NULL);
1747 calls->sign_holder_commitment_htlc_transactions_meth = (*env)->GetMethodID(env, c, "sign_holder_commitment_htlc_transactions", "(J)J");
1748 DO_ASSERT(calls->sign_holder_commitment_htlc_transactions_meth != NULL);
1749 calls->sign_justice_transaction_meth = (*env)->GetMethodID(env, c, "sign_justice_transaction", "(JJJ[BJ)J");
1750 DO_ASSERT(calls->sign_justice_transaction_meth != NULL);
1751 calls->sign_counterparty_htlc_transaction_meth = (*env)->GetMethodID(env, c, "sign_counterparty_htlc_transaction", "(JJJJJ)J");
1752 DO_ASSERT(calls->sign_counterparty_htlc_transaction_meth != NULL);
1753 calls->sign_closing_transaction_meth = (*env)->GetMethodID(env, c, "sign_closing_transaction", "(J)J");
1754 DO_ASSERT(calls->sign_closing_transaction_meth != NULL);
1755 calls->sign_channel_announcement_meth = (*env)->GetMethodID(env, c, "sign_channel_announcement", "(J)J");
1756 DO_ASSERT(calls->sign_channel_announcement_meth != NULL);
1757 calls->on_accept_meth = (*env)->GetMethodID(env, c, "on_accept", "(JSS)V");
1758 DO_ASSERT(calls->on_accept_meth != NULL);
1760 LDKChannelKeys ret = {
1761 .this_arg = (void*) calls,
1762 .get_per_commitment_point = get_per_commitment_point_jcall,
1763 .release_commitment_secret = release_commitment_secret_jcall,
1764 .key_derivation_params = key_derivation_params_jcall,
1765 .sign_counterparty_commitment = sign_counterparty_commitment_jcall,
1766 .sign_holder_commitment = sign_holder_commitment_jcall,
1767 .sign_holder_commitment_htlc_transactions = sign_holder_commitment_htlc_transactions_jcall,
1768 .sign_justice_transaction = sign_justice_transaction_jcall,
1769 .sign_counterparty_htlc_transaction = sign_counterparty_htlc_transaction_jcall,
1770 .sign_closing_transaction = sign_closing_transaction_jcall,
1771 .sign_channel_announcement = sign_channel_announcement_jcall,
1772 .on_accept = on_accept_jcall,
1773 .clone = LDKChannelKeys_JCalls_clone,
1774 .free = LDKChannelKeys_JCalls_free,
1778 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1new (JNIEnv * env, jclass _a, jobject o) {
1779 LDKChannelKeys *res_ptr = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys");
1780 *res_ptr = LDKChannelKeys_init(env, _a, o);
1781 return (long)res_ptr;
1783 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
1784 return ((LDKChannelKeys_JCalls*)val)->o;
1786 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1call_1get_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong arg, jlong idx) {
1787 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
1788 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
1789 *ret = (arg_conv->get_per_commitment_point)(arg_conv->this_arg, idx);
1793 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1call_1release_1commitment_1secret(JNIEnv * _env, jclass _b, jlong arg, jlong idx) {
1794 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
1795 jbyteArray _arr = (*_env)->NewByteArray(_env, 32);
1796 (*_env)->SetByteArrayRegion(_env, _arr, 0, 32, (arg_conv->release_commitment_secret)(arg_conv->this_arg, idx).data);
1800 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1call_1key_1derivation_1params(JNIEnv * _env, jclass _b, jlong arg) {
1801 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
1802 LDKC2Tuple_u64u64Z* ret = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
1803 *ret = (arg_conv->key_derivation_params)(arg_conv->this_arg);
1807 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) {
1808 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
1809 LDKTransaction commitment_tx_conv = *(LDKTransaction*)commitment_tx;
1810 FREE((void*)commitment_tx);
1811 LDKPreCalculatedTxCreationKeys* keys_conv = (LDKPreCalculatedTxCreationKeys*)keys;
1812 LDKCVec_HTLCOutputInCommitmentZ htlcs_conv = *(LDKCVec_HTLCOutputInCommitmentZ*)htlcs;
1814 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
1815 *ret = (arg_conv->sign_counterparty_commitment)(arg_conv->this_arg, feerate_per_kw, commitment_tx_conv, keys_conv, htlcs_conv);
1819 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1call_1sign_1holder_1commitment(JNIEnv * _env, jclass _b, jlong arg, jlong holder_commitment_tx) {
1820 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
1821 LDKHolderCommitmentTransaction* holder_commitment_tx_conv = (LDKHolderCommitmentTransaction*)holder_commitment_tx;
1822 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
1823 *ret = (arg_conv->sign_holder_commitment)(arg_conv->this_arg, holder_commitment_tx_conv);
1827 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) {
1828 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
1829 LDKHolderCommitmentTransaction* holder_commitment_tx_conv = (LDKHolderCommitmentTransaction*)holder_commitment_tx;
1830 LDKCResult_CVec_SignatureZNoneZ* ret = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
1831 *ret = (arg_conv->sign_holder_commitment_htlc_transactions)(arg_conv->this_arg, holder_commitment_tx_conv);
1835 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) {
1836 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
1837 LDKTransaction justice_tx_conv = *(LDKTransaction*)justice_tx;
1838 FREE((void*)justice_tx);
1839 unsigned char per_commitment_key_arr[32];
1840 (*_env)->GetByteArrayRegion (_env, per_commitment_key, 0, 32, per_commitment_key_arr);
1841 unsigned char (*per_commitment_key_ref)[32] = &per_commitment_key_arr;
1842 LDKHTLCOutputInCommitment* htlc_conv = (LDKHTLCOutputInCommitment*)htlc;
1843 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
1844 *ret = (arg_conv->sign_justice_transaction)(arg_conv->this_arg, justice_tx_conv, input, amount, per_commitment_key_ref, htlc_conv);
1848 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) {
1849 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
1850 LDKTransaction htlc_tx_conv = *(LDKTransaction*)htlc_tx;
1851 FREE((void*)htlc_tx);
1852 LDKPublicKey per_commitment_point_conv = *(LDKPublicKey*)per_commitment_point;
1853 FREE((void*)per_commitment_point);
1854 LDKHTLCOutputInCommitment* htlc_conv = (LDKHTLCOutputInCommitment*)htlc;
1855 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
1856 *ret = (arg_conv->sign_counterparty_htlc_transaction)(arg_conv->this_arg, htlc_tx_conv, input, amount, per_commitment_point_conv, htlc_conv);
1860 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1call_1sign_1closing_1transaction(JNIEnv * _env, jclass _b, jlong arg, jlong closing_tx) {
1861 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
1862 LDKTransaction closing_tx_conv = *(LDKTransaction*)closing_tx;
1863 FREE((void*)closing_tx);
1864 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
1865 *ret = (arg_conv->sign_closing_transaction)(arg_conv->this_arg, closing_tx_conv);
1869 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1call_1sign_1channel_1announcement(JNIEnv * _env, jclass _b, jlong arg, jlong msg) {
1870 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
1871 LDKUnsignedChannelAnnouncement* msg_conv = (LDKUnsignedChannelAnnouncement*)msg;
1872 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
1873 *ret = (arg_conv->sign_channel_announcement)(arg_conv->this_arg, msg_conv);
1877 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) {
1878 LDKChannelKeys* arg_conv = (LDKChannelKeys*)arg;
1879 LDKChannelPublicKeys* channel_points_conv = (LDKChannelPublicKeys*)channel_points;
1880 return (arg_conv->on_accept)(arg_conv->this_arg, channel_points_conv, counterparty_selected_contest_delay, holder_selected_contest_delay);
1883 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelMonitor_1optional_1none (JNIEnv * env, jclass _a) {
1884 LDKChannelMonitor *ret = MALLOC(sizeof(LDKChannelMonitor), "LDKChannelMonitor");
1888 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelMonitorUpdate_1optional_1none (JNIEnv * env, jclass _a) {
1889 LDKChannelMonitorUpdate *ret = MALLOC(sizeof(LDKChannelMonitorUpdate), "LDKChannelMonitorUpdate");
1893 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKMonitorEvent_1optional_1none (JNIEnv * env, jclass _a) {
1894 LDKMonitorEvent *ret = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
1898 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1MonitorEvent_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
1899 LDKCVecTempl_MonitorEvent *vec = (LDKCVecTempl_MonitorEvent*)ptr;
1900 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKMonitorEvent));
1902 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1MonitorEvent_1new(JNIEnv *env, jclass _b, jlongArray elems){
1903 LDKCVecTempl_MonitorEvent *ret = MALLOC(sizeof(LDKCVecTempl_MonitorEvent), "LDKCVecTempl_MonitorEvent");
1904 ret->datalen = (*env)->GetArrayLength(env, elems);
1905 if (ret->datalen == 0) {
1908 ret->data = malloc(sizeof(LDKMonitorEvent) * ret->datalen); // often freed by rust directly
1909 jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
1910 for (size_t i = 0; i < ret->datalen; i++) {
1911 jlong arr_elem = java_elems[i];
1912 LDKMonitorEvent arr_elem_conv = *(LDKMonitorEvent*)arr_elem;
1913 FREE((void*)arr_elem);
1914 arr_elem_conv.is_owned = true;
1915 ret->data[i] = arr_elem_conv;
1917 (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
1921 typedef struct LDKWatch_JCalls {
1922 atomic_size_t refcnt;
1925 jmethodID watch_channel_meth;
1926 jmethodID update_channel_meth;
1927 jmethodID release_pending_monitor_events_meth;
1929 LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) {
1930 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
1932 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1933 long funding_txo_ref = (long)&funding_txo;
1934 long monitor_ref = (long)&monitor;
1935 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->watch_channel_meth, funding_txo_ref, monitor_ref);
1936 LDKCResult_NoneChannelMonitorUpdateErrZ res = *ret;
1940 LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate update) {
1941 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
1943 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1944 long funding_txo_ref = (long)&funding_txo;
1945 long update_ref = (long)&update;
1946 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->update_channel_meth, funding_txo_ref, update_ref);
1947 LDKCResult_NoneChannelMonitorUpdateErrZ res = *ret;
1951 LDKCVec_MonitorEventZ release_pending_monitor_events_jcall(const void* this_arg) {
1952 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
1954 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1955 LDKCVec_MonitorEventZ* ret = (LDKCVec_MonitorEventZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->release_pending_monitor_events_meth);
1956 LDKCVec_MonitorEventZ res = *ret;
1960 static void LDKWatch_JCalls_free(void* this_arg) {
1961 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
1962 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1964 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
1965 (*env)->DeleteGlobalRef(env, j_calls->o);
1969 static void* LDKWatch_JCalls_clone(const void* this_arg) {
1970 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
1971 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1972 return (void*) this_arg;
1974 static inline LDKWatch LDKWatch_init (JNIEnv * env, jclass _a, jobject o) {
1975 jclass c = (*env)->GetObjectClass(env, o);
1976 DO_ASSERT(c != NULL);
1977 LDKWatch_JCalls *calls = MALLOC(sizeof(LDKWatch_JCalls), "LDKWatch_JCalls");
1978 atomic_init(&calls->refcnt, 1);
1979 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
1980 calls->o = (*env)->NewGlobalRef(env, o);
1981 calls->watch_channel_meth = (*env)->GetMethodID(env, c, "watch_channel", "(JJ)J");
1982 DO_ASSERT(calls->watch_channel_meth != NULL);
1983 calls->update_channel_meth = (*env)->GetMethodID(env, c, "update_channel", "(JJ)J");
1984 DO_ASSERT(calls->update_channel_meth != NULL);
1985 calls->release_pending_monitor_events_meth = (*env)->GetMethodID(env, c, "release_pending_monitor_events", "()J");
1986 DO_ASSERT(calls->release_pending_monitor_events_meth != NULL);
1989 .this_arg = (void*) calls,
1990 .watch_channel = watch_channel_jcall,
1991 .update_channel = update_channel_jcall,
1992 .release_pending_monitor_events = release_pending_monitor_events_jcall,
1993 .free = LDKWatch_JCalls_free,
1997 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKWatch_1new (JNIEnv * env, jclass _a, jobject o) {
1998 LDKWatch *res_ptr = MALLOC(sizeof(LDKWatch), "LDKWatch");
1999 *res_ptr = LDKWatch_init(env, _a, o);
2000 return (long)res_ptr;
2002 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKWatch_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
2003 return ((LDKWatch_JCalls*)val)->o;
2005 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKWatch_1call_1watch_1channel(JNIEnv * _env, jclass _b, jlong arg, jlong funding_txo, jlong monitor) {
2006 LDKWatch* arg_conv = (LDKWatch*)arg;
2007 LDKOutPoint funding_txo_conv = *(LDKOutPoint*)funding_txo;
2008 FREE((void*)funding_txo);
2009 funding_txo_conv.is_owned = true;
2010 LDKChannelMonitor monitor_conv = *(LDKChannelMonitor*)monitor;
2011 FREE((void*)monitor);
2012 monitor_conv.is_owned = true;
2013 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
2014 *ret = (arg_conv->watch_channel)(arg_conv->this_arg, funding_txo_conv, monitor_conv);
2018 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKWatch_1call_1update_1channel(JNIEnv * _env, jclass _b, jlong arg, jlong funding_txo, jlong update) {
2019 LDKWatch* arg_conv = (LDKWatch*)arg;
2020 LDKOutPoint funding_txo_conv = *(LDKOutPoint*)funding_txo;
2021 FREE((void*)funding_txo);
2022 funding_txo_conv.is_owned = true;
2023 LDKChannelMonitorUpdate update_conv = *(LDKChannelMonitorUpdate*)update;
2024 FREE((void*)update);
2025 update_conv.is_owned = true;
2026 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
2027 *ret = (arg_conv->update_channel)(arg_conv->this_arg, funding_txo_conv, update_conv);
2031 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKWatch_1call_1release_1pending_1monitor_1events(JNIEnv * _env, jclass _b, jlong arg) {
2032 LDKWatch* arg_conv = (LDKWatch*)arg;
2033 LDKCVec_MonitorEventZ* ret = MALLOC(sizeof(LDKCVec_MonitorEventZ), "LDKCVec_MonitorEventZ");
2034 *ret = (arg_conv->release_pending_monitor_events)(arg_conv->this_arg);
2038 typedef struct LDKFilter_JCalls {
2039 atomic_size_t refcnt;
2042 jmethodID register_tx_meth;
2043 jmethodID register_output_meth;
2045 void register_tx_jcall(const void* this_arg, const uint8_t (*txid)[32], LDKu8slice script_pubkey) {
2046 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
2048 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2049 jbyteArray txid_arr = (*env)->NewByteArray(env, 32);
2050 (*env)->SetByteArrayRegion(env, txid_arr, 0, 32, *txid);
2051 long script_pubkey_ref = (long)&script_pubkey;
2052 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->register_tx_meth, txid_arr, script_pubkey_ref);
2054 void register_output_jcall(const void* this_arg, const LDKOutPoint *outpoint, LDKu8slice script_pubkey) {
2055 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
2057 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2058 long script_pubkey_ref = (long)&script_pubkey;
2059 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->register_output_meth, outpoint, script_pubkey_ref);
2061 static void LDKFilter_JCalls_free(void* this_arg) {
2062 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
2063 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
2065 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2066 (*env)->DeleteGlobalRef(env, j_calls->o);
2070 static void* LDKFilter_JCalls_clone(const void* this_arg) {
2071 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
2072 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
2073 return (void*) this_arg;
2075 static inline LDKFilter LDKFilter_init (JNIEnv * env, jclass _a, jobject o) {
2076 jclass c = (*env)->GetObjectClass(env, o);
2077 DO_ASSERT(c != NULL);
2078 LDKFilter_JCalls *calls = MALLOC(sizeof(LDKFilter_JCalls), "LDKFilter_JCalls");
2079 atomic_init(&calls->refcnt, 1);
2080 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
2081 calls->o = (*env)->NewGlobalRef(env, o);
2082 calls->register_tx_meth = (*env)->GetMethodID(env, c, "register_tx", "([BJ)V");
2083 DO_ASSERT(calls->register_tx_meth != NULL);
2084 calls->register_output_meth = (*env)->GetMethodID(env, c, "register_output", "(JJ)V");
2085 DO_ASSERT(calls->register_output_meth != NULL);
2088 .this_arg = (void*) calls,
2089 .register_tx = register_tx_jcall,
2090 .register_output = register_output_jcall,
2091 .free = LDKFilter_JCalls_free,
2095 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKFilter_1new (JNIEnv * env, jclass _a, jobject o) {
2096 LDKFilter *res_ptr = MALLOC(sizeof(LDKFilter), "LDKFilter");
2097 *res_ptr = LDKFilter_init(env, _a, o);
2098 return (long)res_ptr;
2100 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFilter_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
2101 return ((LDKFilter_JCalls*)val)->o;
2103 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKFilter_1call_1register_1tx(JNIEnv * _env, jclass _b, jlong arg, jbyteArray txid, jlong script_pubkey) {
2104 LDKFilter* arg_conv = (LDKFilter*)arg;
2105 unsigned char txid_arr[32];
2106 (*_env)->GetByteArrayRegion (_env, txid, 0, 32, txid_arr);
2107 unsigned char (*txid_ref)[32] = &txid_arr;
2108 LDKu8slice script_pubkey_conv = *(LDKu8slice*)script_pubkey;
2109 return (arg_conv->register_tx)(arg_conv->this_arg, txid_ref, script_pubkey_conv);
2112 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKFilter_1call_1register_1output(JNIEnv * _env, jclass _b, jlong arg, jlong outpoint, jlong script_pubkey) {
2113 LDKFilter* arg_conv = (LDKFilter*)arg;
2114 LDKOutPoint* outpoint_conv = (LDKOutPoint*)outpoint;
2115 LDKu8slice script_pubkey_conv = *(LDKu8slice*)script_pubkey;
2116 return (arg_conv->register_output)(arg_conv->this_arg, outpoint_conv, script_pubkey_conv);
2119 typedef struct LDKBroadcasterInterface_JCalls {
2120 atomic_size_t refcnt;
2123 jmethodID broadcast_transaction_meth;
2124 } LDKBroadcasterInterface_JCalls;
2125 void broadcast_transaction_jcall(const void* this_arg, LDKTransaction tx) {
2126 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
2128 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2129 long tx_ref = (long)&tx;
2130 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->broadcast_transaction_meth, tx_ref);
2132 static void LDKBroadcasterInterface_JCalls_free(void* this_arg) {
2133 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
2134 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
2136 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2137 (*env)->DeleteGlobalRef(env, j_calls->o);
2141 static void* LDKBroadcasterInterface_JCalls_clone(const void* this_arg) {
2142 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
2143 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
2144 return (void*) this_arg;
2146 static inline LDKBroadcasterInterface LDKBroadcasterInterface_init (JNIEnv * env, jclass _a, jobject o) {
2147 jclass c = (*env)->GetObjectClass(env, o);
2148 DO_ASSERT(c != NULL);
2149 LDKBroadcasterInterface_JCalls *calls = MALLOC(sizeof(LDKBroadcasterInterface_JCalls), "LDKBroadcasterInterface_JCalls");
2150 atomic_init(&calls->refcnt, 1);
2151 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
2152 calls->o = (*env)->NewGlobalRef(env, o);
2153 calls->broadcast_transaction_meth = (*env)->GetMethodID(env, c, "broadcast_transaction", "(J)V");
2154 DO_ASSERT(calls->broadcast_transaction_meth != NULL);
2156 LDKBroadcasterInterface ret = {
2157 .this_arg = (void*) calls,
2158 .broadcast_transaction = broadcast_transaction_jcall,
2159 .free = LDKBroadcasterInterface_JCalls_free,
2163 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1new (JNIEnv * env, jclass _a, jobject o) {
2164 LDKBroadcasterInterface *res_ptr = MALLOC(sizeof(LDKBroadcasterInterface), "LDKBroadcasterInterface");
2165 *res_ptr = LDKBroadcasterInterface_init(env, _a, o);
2166 return (long)res_ptr;
2168 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
2169 return ((LDKBroadcasterInterface_JCalls*)val)->o;
2171 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1call_1broadcast_1transaction(JNIEnv * _env, jclass _b, jlong arg, jlong tx) {
2172 LDKBroadcasterInterface* arg_conv = (LDKBroadcasterInterface*)arg;
2173 LDKTransaction tx_conv = *(LDKTransaction*)tx;
2175 return (arg_conv->broadcast_transaction)(arg_conv->this_arg, tx_conv);
2178 typedef struct LDKFeeEstimator_JCalls {
2179 atomic_size_t refcnt;
2182 jmethodID get_est_sat_per_1000_weight_meth;
2183 } LDKFeeEstimator_JCalls;
2184 uint32_t get_est_sat_per_1000_weight_jcall(const void* this_arg, LDKConfirmationTarget confirmation_target) {
2185 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
2187 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2188 jclass confirmation_target_conv = LDKConfirmationTarget_to_java(env, confirmation_target);
2189 return (*env)->CallIntMethod(env, j_calls->o, j_calls->get_est_sat_per_1000_weight_meth, confirmation_target_conv);
2191 static void LDKFeeEstimator_JCalls_free(void* this_arg) {
2192 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
2193 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
2195 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2196 (*env)->DeleteGlobalRef(env, j_calls->o);
2200 static void* LDKFeeEstimator_JCalls_clone(const void* this_arg) {
2201 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
2202 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
2203 return (void*) this_arg;
2205 static inline LDKFeeEstimator LDKFeeEstimator_init (JNIEnv * env, jclass _a, jobject o) {
2206 jclass c = (*env)->GetObjectClass(env, o);
2207 DO_ASSERT(c != NULL);
2208 LDKFeeEstimator_JCalls *calls = MALLOC(sizeof(LDKFeeEstimator_JCalls), "LDKFeeEstimator_JCalls");
2209 atomic_init(&calls->refcnt, 1);
2210 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
2211 calls->o = (*env)->NewGlobalRef(env, o);
2212 calls->get_est_sat_per_1000_weight_meth = (*env)->GetMethodID(env, c, "get_est_sat_per_1000_weight", "(Lorg/ldk/enums/LDKConfirmationTarget;)I");
2213 DO_ASSERT(calls->get_est_sat_per_1000_weight_meth != NULL);
2215 LDKFeeEstimator ret = {
2216 .this_arg = (void*) calls,
2217 .get_est_sat_per_1000_weight = get_est_sat_per_1000_weight_jcall,
2218 .free = LDKFeeEstimator_JCalls_free,
2222 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1new (JNIEnv * env, jclass _a, jobject o) {
2223 LDKFeeEstimator *res_ptr = MALLOC(sizeof(LDKFeeEstimator), "LDKFeeEstimator");
2224 *res_ptr = LDKFeeEstimator_init(env, _a, o);
2225 return (long)res_ptr;
2227 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
2228 return ((LDKFeeEstimator_JCalls*)val)->o;
2230 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) {
2231 LDKFeeEstimator* arg_conv = (LDKFeeEstimator*)arg;
2232 LDKConfirmationTarget confirmation_target_conv = LDKConfirmationTarget_from_java(_env, confirmation_target);
2233 return (arg_conv->get_est_sat_per_1000_weight)(arg_conv->this_arg, confirmation_target_conv);
2236 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChainMonitor_1optional_1none (JNIEnv * env, jclass _a) {
2237 LDKChainMonitor *ret = MALLOC(sizeof(LDKChainMonitor), "LDKChainMonitor");
2241 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1usize_1_1Transaction_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
2242 LDKCVecTempl_C2TupleTempl_usize__Transaction *vec = (LDKCVecTempl_C2TupleTempl_usize__Transaction*)ptr;
2243 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKC2TupleTempl_usize__Transaction));
2245 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1usize_1_1Transaction_1new(JNIEnv *env, jclass _b, jlongArray elems){
2246 LDKCVecTempl_C2TupleTempl_usize__Transaction *ret = MALLOC(sizeof(LDKCVecTempl_C2TupleTempl_usize__Transaction), "LDKCVecTempl_C2TupleTempl_usize__Transaction");
2247 ret->datalen = (*env)->GetArrayLength(env, elems);
2248 if (ret->datalen == 0) {
2251 ret->data = malloc(sizeof(LDKC2TupleTempl_usize__Transaction) * ret->datalen); // often freed by rust directly
2252 jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
2253 for (size_t i = 0; i < ret->datalen; i++) {
2254 jlong arr_elem = java_elems[i];
2255 LDKC2TupleTempl_usize__Transaction arr_elem_conv = *(LDKC2TupleTempl_usize__Transaction*)arr_elem;
2256 FREE((void*)arr_elem);
2257 ret->data[i] = arr_elem_conv;
2259 (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
2263 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKHTLCUpdate_1optional_1none (JNIEnv * env, jclass _a) {
2264 LDKHTLCUpdate *ret = MALLOC(sizeof(LDKHTLCUpdate), "LDKHTLCUpdate");
2268 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Transaction_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
2269 LDKCVecTempl_Transaction *vec = (LDKCVecTempl_Transaction*)ptr;
2270 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKTransaction));
2272 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1Transaction_1new(JNIEnv *env, jclass _b, jlongArray elems){
2273 LDKCVecTempl_Transaction *ret = MALLOC(sizeof(LDKCVecTempl_Transaction), "LDKCVecTempl_Transaction");
2274 ret->datalen = (*env)->GetArrayLength(env, elems);
2275 if (ret->datalen == 0) {
2278 ret->data = malloc(sizeof(LDKTransaction) * ret->datalen); // often freed by rust directly
2279 jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
2280 for (size_t i = 0; i < ret->datalen; i++) {
2281 jlong arr_elem = java_elems[i];
2282 LDKTransaction arr_elem_conv = *(LDKTransaction*)arr_elem;
2283 FREE((void*)arr_elem);
2284 ret->data[i] = arr_elem_conv;
2286 (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
2290 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1ThirtyTwoBytes_1_1CVecTempl_1TxOut_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
2291 LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut *vec = (LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut*)ptr;
2292 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut));
2294 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1ThirtyTwoBytes_1_1CVecTempl_1TxOut_1new(JNIEnv *env, jclass _b, jlongArray elems){
2295 LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut *ret = MALLOC(sizeof(LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut), "LDKCVecTempl_C2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut");
2296 ret->datalen = (*env)->GetArrayLength(env, elems);
2297 if (ret->datalen == 0) {
2300 ret->data = malloc(sizeof(LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut) * ret->datalen); // often freed by rust directly
2301 jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
2302 for (size_t i = 0; i < ret->datalen; i++) {
2303 jlong arr_elem = java_elems[i];
2304 LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut arr_elem_conv = *(LDKC2TupleTempl_ThirtyTwoBytes__CVecTempl_TxOut*)arr_elem;
2305 FREE((void*)arr_elem);
2306 ret->data[i] = arr_elem_conv;
2308 (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
2312 typedef struct LDKKeysInterface_JCalls {
2313 atomic_size_t refcnt;
2316 jmethodID get_node_secret_meth;
2317 jmethodID get_destination_script_meth;
2318 jmethodID get_shutdown_pubkey_meth;
2319 jmethodID get_channel_keys_meth;
2320 jmethodID get_secure_random_bytes_meth;
2321 } LDKKeysInterface_JCalls;
2322 LDKSecretKey get_node_secret_jcall(const void* this_arg) {
2323 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
2325 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2326 LDKSecretKey* ret = (LDKSecretKey*)(*env)->CallLongMethod(env, j_calls->o, j_calls->get_node_secret_meth);
2327 LDKSecretKey res = *ret;
2331 LDKCVec_u8Z get_destination_script_jcall(const void* this_arg) {
2332 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
2334 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2335 LDKCVec_u8Z* ret = (LDKCVec_u8Z*)(*env)->CallLongMethod(env, j_calls->o, j_calls->get_destination_script_meth);
2336 LDKCVec_u8Z res = *ret;
2340 LDKPublicKey get_shutdown_pubkey_jcall(const void* this_arg) {
2341 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
2343 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2344 LDKPublicKey* ret = (LDKPublicKey*)(*env)->CallLongMethod(env, j_calls->o, j_calls->get_shutdown_pubkey_meth);
2345 LDKPublicKey res = *ret;
2349 LDKChannelKeys get_channel_keys_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) {
2350 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
2352 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2353 LDKChannelKeys* ret = (LDKChannelKeys*)(*env)->CallLongMethod(env, j_calls->o, j_calls->get_channel_keys_meth, inbound, channel_value_satoshis);
2354 LDKChannelKeys res = *ret;
2358 LDKThirtyTwoBytes get_secure_random_bytes_jcall(const void* this_arg) {
2359 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
2361 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2362 jbyteArray jret = (*env)->CallObjectMethod(env, j_calls->o, j_calls->get_secure_random_bytes_meth);
2363 LDKThirtyTwoBytes ret;
2364 (*env)->GetByteArrayRegion(env, jret, 0, 32, ret.data);
2367 static void LDKKeysInterface_JCalls_free(void* this_arg) {
2368 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
2369 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
2371 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2372 (*env)->DeleteGlobalRef(env, j_calls->o);
2376 static void* LDKKeysInterface_JCalls_clone(const void* this_arg) {
2377 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
2378 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
2379 return (void*) this_arg;
2381 static inline LDKKeysInterface LDKKeysInterface_init (JNIEnv * env, jclass _a, jobject o) {
2382 jclass c = (*env)->GetObjectClass(env, o);
2383 DO_ASSERT(c != NULL);
2384 LDKKeysInterface_JCalls *calls = MALLOC(sizeof(LDKKeysInterface_JCalls), "LDKKeysInterface_JCalls");
2385 atomic_init(&calls->refcnt, 1);
2386 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
2387 calls->o = (*env)->NewGlobalRef(env, o);
2388 calls->get_node_secret_meth = (*env)->GetMethodID(env, c, "get_node_secret", "()J");
2389 DO_ASSERT(calls->get_node_secret_meth != NULL);
2390 calls->get_destination_script_meth = (*env)->GetMethodID(env, c, "get_destination_script", "()J");
2391 DO_ASSERT(calls->get_destination_script_meth != NULL);
2392 calls->get_shutdown_pubkey_meth = (*env)->GetMethodID(env, c, "get_shutdown_pubkey", "()J");
2393 DO_ASSERT(calls->get_shutdown_pubkey_meth != NULL);
2394 calls->get_channel_keys_meth = (*env)->GetMethodID(env, c, "get_channel_keys", "(ZJ)J");
2395 DO_ASSERT(calls->get_channel_keys_meth != NULL);
2396 calls->get_secure_random_bytes_meth = (*env)->GetMethodID(env, c, "get_secure_random_bytes", "()[B");
2397 DO_ASSERT(calls->get_secure_random_bytes_meth != NULL);
2399 LDKKeysInterface ret = {
2400 .this_arg = (void*) calls,
2401 .get_node_secret = get_node_secret_jcall,
2402 .get_destination_script = get_destination_script_jcall,
2403 .get_shutdown_pubkey = get_shutdown_pubkey_jcall,
2404 .get_channel_keys = get_channel_keys_jcall,
2405 .get_secure_random_bytes = get_secure_random_bytes_jcall,
2406 .free = LDKKeysInterface_JCalls_free,
2410 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1new (JNIEnv * env, jclass _a, jobject o) {
2411 LDKKeysInterface *res_ptr = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
2412 *res_ptr = LDKKeysInterface_init(env, _a, o);
2413 return (long)res_ptr;
2415 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
2416 return ((LDKKeysInterface_JCalls*)val)->o;
2418 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1call_1get_1node_1secret(JNIEnv * _env, jclass _b, jlong arg) {
2419 LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg;
2420 LDKSecretKey* ret = MALLOC(sizeof(LDKSecretKey), "LDKSecretKey");
2421 *ret = (arg_conv->get_node_secret)(arg_conv->this_arg);
2425 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1call_1get_1destination_1script(JNIEnv * _env, jclass _b, jlong arg) {
2426 LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg;
2427 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
2428 *ret = (arg_conv->get_destination_script)(arg_conv->this_arg);
2432 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1call_1get_1shutdown_1pubkey(JNIEnv * _env, jclass _b, jlong arg) {
2433 LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg;
2434 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
2435 *ret = (arg_conv->get_shutdown_pubkey)(arg_conv->this_arg);
2439 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) {
2440 LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg;
2441 LDKChannelKeys* ret = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys");
2442 *ret = (arg_conv->get_channel_keys)(arg_conv->this_arg, inbound, channel_value_satoshis);
2446 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1call_1get_1secure_1random_1bytes(JNIEnv * _env, jclass _b, jlong arg) {
2447 LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg;
2448 jbyteArray _arr = (*_env)->NewByteArray(_env, 32);
2449 (*_env)->SetByteArrayRegion(_env, _arr, 0, 32, (arg_conv->get_secure_random_bytes)(arg_conv->this_arg).data);
2453 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKInMemoryChannelKeys_1optional_1none (JNIEnv * env, jclass _a) {
2454 LDKInMemoryChannelKeys *ret = MALLOC(sizeof(LDKInMemoryChannelKeys), "LDKInMemoryChannelKeys");
2458 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKKeysManager_1optional_1none (JNIEnv * env, jclass _a) {
2459 LDKKeysManager *ret = MALLOC(sizeof(LDKKeysManager), "LDKKeysManager");
2463 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelManager_1optional_1none (JNIEnv * env, jclass _a) {
2464 LDKChannelManager *ret = MALLOC(sizeof(LDKChannelManager), "LDKChannelManager");
2468 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelDetails_1optional_1none (JNIEnv * env, jclass _a) {
2469 LDKChannelDetails *ret = MALLOC(sizeof(LDKChannelDetails), "LDKChannelDetails");
2473 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKInitFeatures_1optional_1none (JNIEnv * env, jclass _a) {
2474 LDKInitFeatures *ret = MALLOC(sizeof(LDKInitFeatures), "LDKInitFeatures");
2478 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1ChannelDetails_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
2479 LDKCVecTempl_ChannelDetails *vec = (LDKCVecTempl_ChannelDetails*)ptr;
2480 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKChannelDetails));
2482 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1ChannelDetails_1new(JNIEnv *env, jclass _b, jlongArray elems){
2483 LDKCVecTempl_ChannelDetails *ret = MALLOC(sizeof(LDKCVecTempl_ChannelDetails), "LDKCVecTempl_ChannelDetails");
2484 ret->datalen = (*env)->GetArrayLength(env, elems);
2485 if (ret->datalen == 0) {
2488 ret->data = malloc(sizeof(LDKChannelDetails) * ret->datalen); // often freed by rust directly
2489 jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
2490 for (size_t i = 0; i < ret->datalen; i++) {
2491 jlong arr_elem = java_elems[i];
2492 LDKChannelDetails arr_elem_conv = *(LDKChannelDetails*)arr_elem;
2493 FREE((void*)arr_elem);
2494 arr_elem_conv.is_owned = true;
2495 ret->data[i] = arr_elem_conv;
2497 (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
2501 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRoute_1optional_1none (JNIEnv * env, jclass _a) {
2502 LDKRoute *ret = MALLOC(sizeof(LDKRoute), "LDKRoute");
2506 static jclass LDKNetAddress_IPv4_class = NULL;
2507 static jmethodID LDKNetAddress_IPv4_meth = NULL;
2508 static jclass LDKNetAddress_IPv6_class = NULL;
2509 static jmethodID LDKNetAddress_IPv6_meth = NULL;
2510 static jclass LDKNetAddress_OnionV2_class = NULL;
2511 static jmethodID LDKNetAddress_OnionV2_meth = NULL;
2512 static jclass LDKNetAddress_OnionV3_class = NULL;
2513 static jmethodID LDKNetAddress_OnionV3_meth = NULL;
2514 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_00024LDKNetAddress_init (JNIEnv * env, jclass _a) {
2515 LDKNetAddress_IPv4_class =
2516 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetAddress$IPv4;"));
2517 DO_ASSERT(LDKNetAddress_IPv4_class != NULL);
2518 LDKNetAddress_IPv4_meth = (*env)->GetMethodID(env, LDKNetAddress_IPv4_class, "<init>", "(JS)V");
2519 DO_ASSERT(LDKNetAddress_IPv4_meth != NULL);
2520 LDKNetAddress_IPv6_class =
2521 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetAddress$IPv6;"));
2522 DO_ASSERT(LDKNetAddress_IPv6_class != NULL);
2523 LDKNetAddress_IPv6_meth = (*env)->GetMethodID(env, LDKNetAddress_IPv6_class, "<init>", "(JS)V");
2524 DO_ASSERT(LDKNetAddress_IPv6_meth != NULL);
2525 LDKNetAddress_OnionV2_class =
2526 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetAddress$OnionV2;"));
2527 DO_ASSERT(LDKNetAddress_OnionV2_class != NULL);
2528 LDKNetAddress_OnionV2_meth = (*env)->GetMethodID(env, LDKNetAddress_OnionV2_class, "<init>", "(JS)V");
2529 DO_ASSERT(LDKNetAddress_OnionV2_meth != NULL);
2530 LDKNetAddress_OnionV3_class =
2531 (*env)->NewGlobalRef(env, (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetAddress$OnionV3;"));
2532 DO_ASSERT(LDKNetAddress_OnionV3_class != NULL);
2533 LDKNetAddress_OnionV3_meth = (*env)->GetMethodID(env, LDKNetAddress_OnionV3_class, "<init>", "([BSBS)V");
2534 DO_ASSERT(LDKNetAddress_OnionV3_meth != NULL);
2536 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKNetAddress_1ref_1from_1ptr (JNIEnv * env, jclass _c, jlong ptr) {
2537 LDKNetAddress *obj = (LDKNetAddress*)ptr;
2539 case LDKNetAddress_IPv4: {
2540 long addr_ref = (long)&obj->i_pv4.addr;
2541 return (*env)->NewObject(env, LDKNetAddress_IPv4_class, LDKNetAddress_IPv4_meth, addr_ref, obj->i_pv4.port);
2543 case LDKNetAddress_IPv6: {
2544 long addr_ref = (long)&obj->i_pv6.addr;
2545 return (*env)->NewObject(env, LDKNetAddress_IPv6_class, LDKNetAddress_IPv6_meth, addr_ref, obj->i_pv6.port);
2547 case LDKNetAddress_OnionV2: {
2548 long addr_ref = (long)&obj->onion_v2.addr;
2549 return (*env)->NewObject(env, LDKNetAddress_OnionV2_class, LDKNetAddress_OnionV2_meth, addr_ref, obj->onion_v2.port);
2551 case LDKNetAddress_OnionV3: {
2552 jbyteArray ed25519_pubkey_arr = (*env)->NewByteArray(env, 32);
2553 (*env)->SetByteArrayRegion(env, ed25519_pubkey_arr, 0, 32, obj->onion_v3.ed25519_pubkey.data);
2554 return (*env)->NewObject(env, LDKNetAddress_OnionV3_class, LDKNetAddress_OnionV3_meth, ed25519_pubkey_arr, obj->onion_v3.checksum, obj->onion_v3.version, obj->onion_v3.port);
2559 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1NetAddress_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
2560 LDKCVecTempl_NetAddress *vec = (LDKCVecTempl_NetAddress*)ptr;
2561 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKNetAddress));
2563 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1NetAddress_1new(JNIEnv *env, jclass _b, jlongArray elems){
2564 LDKCVecTempl_NetAddress *ret = MALLOC(sizeof(LDKCVecTempl_NetAddress), "LDKCVecTempl_NetAddress");
2565 ret->datalen = (*env)->GetArrayLength(env, elems);
2566 if (ret->datalen == 0) {
2569 ret->data = malloc(sizeof(LDKNetAddress) * ret->datalen); // often freed by rust directly
2570 jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
2571 for (size_t i = 0; i < ret->datalen; i++) {
2572 jlong arr_elem = java_elems[i];
2573 LDKNetAddress arr_elem_conv = *(LDKNetAddress*)arr_elem;
2574 FREE((void*)arr_elem);
2575 ret->data[i] = arr_elem_conv;
2577 (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
2581 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKUpdateAddHTLC_1optional_1none (JNIEnv * env, jclass _a) {
2582 LDKUpdateAddHTLC *ret = MALLOC(sizeof(LDKUpdateAddHTLC), "LDKUpdateAddHTLC");
2586 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKUpdateFulfillHTLC_1optional_1none (JNIEnv * env, jclass _a) {
2587 LDKUpdateFulfillHTLC *ret = MALLOC(sizeof(LDKUpdateFulfillHTLC), "LDKUpdateFulfillHTLC");
2591 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKUpdateFailHTLC_1optional_1none (JNIEnv * env, jclass _a) {
2592 LDKUpdateFailHTLC *ret = MALLOC(sizeof(LDKUpdateFailHTLC), "LDKUpdateFailHTLC");
2596 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKUpdateFailMalformedHTLC_1optional_1none (JNIEnv * env, jclass _a) {
2597 LDKUpdateFailMalformedHTLC *ret = MALLOC(sizeof(LDKUpdateFailMalformedHTLC), "LDKUpdateFailMalformedHTLC");
2601 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCommitmentSigned_1optional_1none (JNIEnv * env, jclass _a) {
2602 LDKCommitmentSigned *ret = MALLOC(sizeof(LDKCommitmentSigned), "LDKCommitmentSigned");
2606 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKUpdateFee_1optional_1none (JNIEnv * env, jclass _a) {
2607 LDKUpdateFee *ret = MALLOC(sizeof(LDKUpdateFee), "LDKUpdateFee");
2611 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKInit_1optional_1none (JNIEnv * env, jclass _a) {
2612 LDKInit *ret = MALLOC(sizeof(LDKInit), "LDKInit");
2616 typedef struct LDKChannelMessageHandler_JCalls {
2617 atomic_size_t refcnt;
2620 LDKMessageSendEventsProvider_JCalls* MessageSendEventsProvider;
2621 jmethodID handle_open_channel_meth;
2622 jmethodID handle_accept_channel_meth;
2623 jmethodID handle_funding_created_meth;
2624 jmethodID handle_funding_signed_meth;
2625 jmethodID handle_funding_locked_meth;
2626 jmethodID handle_shutdown_meth;
2627 jmethodID handle_closing_signed_meth;
2628 jmethodID handle_update_add_htlc_meth;
2629 jmethodID handle_update_fulfill_htlc_meth;
2630 jmethodID handle_update_fail_htlc_meth;
2631 jmethodID handle_update_fail_malformed_htlc_meth;
2632 jmethodID handle_commitment_signed_meth;
2633 jmethodID handle_revoke_and_ack_meth;
2634 jmethodID handle_update_fee_meth;
2635 jmethodID handle_announcement_signatures_meth;
2636 jmethodID peer_disconnected_meth;
2637 jmethodID peer_connected_meth;
2638 jmethodID handle_channel_reestablish_meth;
2639 jmethodID handle_error_meth;
2640 } LDKChannelMessageHandler_JCalls;
2641 void handle_open_channel_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKOpenChannel *msg) {
2642 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2644 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2645 long their_node_id_ref = (long)&their_node_id;
2646 long their_features_ref = (long)&their_features;
2647 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_open_channel_meth, their_node_id_ref, their_features_ref, msg);
2649 void handle_accept_channel_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKAcceptChannel *msg) {
2650 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2652 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2653 long their_node_id_ref = (long)&their_node_id;
2654 long their_features_ref = (long)&their_features;
2655 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_accept_channel_meth, their_node_id_ref, their_features_ref, msg);
2657 void handle_funding_created_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated *msg) {
2658 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2660 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2661 long their_node_id_ref = (long)&their_node_id;
2662 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_funding_created_meth, their_node_id_ref, msg);
2664 void handle_funding_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned *msg) {
2665 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2667 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2668 long their_node_id_ref = (long)&their_node_id;
2669 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_funding_signed_meth, their_node_id_ref, msg);
2671 void handle_funding_locked_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingLocked *msg) {
2672 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2674 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2675 long their_node_id_ref = (long)&their_node_id;
2676 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_funding_locked_meth, their_node_id_ref, msg);
2678 void handle_shutdown_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKShutdown *msg) {
2679 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2681 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2682 long their_node_id_ref = (long)&their_node_id;
2683 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_shutdown_meth, their_node_id_ref, msg);
2685 void handle_closing_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned *msg) {
2686 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2688 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2689 long their_node_id_ref = (long)&their_node_id;
2690 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_closing_signed_meth, their_node_id_ref, msg);
2692 void handle_update_add_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC *msg) {
2693 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2695 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2696 long their_node_id_ref = (long)&their_node_id;
2697 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_update_add_htlc_meth, their_node_id_ref, msg);
2699 void handle_update_fulfill_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC *msg) {
2700 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2702 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2703 long their_node_id_ref = (long)&their_node_id;
2704 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_update_fulfill_htlc_meth, their_node_id_ref, msg);
2706 void handle_update_fail_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC *msg) {
2707 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2709 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2710 long their_node_id_ref = (long)&their_node_id;
2711 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_update_fail_htlc_meth, their_node_id_ref, msg);
2713 void handle_update_fail_malformed_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC *msg) {
2714 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2716 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2717 long their_node_id_ref = (long)&their_node_id;
2718 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_update_fail_malformed_htlc_meth, their_node_id_ref, msg);
2720 void handle_commitment_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned *msg) {
2721 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2723 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2724 long their_node_id_ref = (long)&their_node_id;
2725 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_commitment_signed_meth, their_node_id_ref, msg);
2727 void handle_revoke_and_ack_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK *msg) {
2728 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2730 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2731 long their_node_id_ref = (long)&their_node_id;
2732 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_revoke_and_ack_meth, their_node_id_ref, msg);
2734 void handle_update_fee_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee *msg) {
2735 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2737 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2738 long their_node_id_ref = (long)&their_node_id;
2739 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_update_fee_meth, their_node_id_ref, msg);
2741 void handle_announcement_signatures_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures *msg) {
2742 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2744 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2745 long their_node_id_ref = (long)&their_node_id;
2746 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_announcement_signatures_meth, their_node_id_ref, msg);
2748 void peer_disconnected_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) {
2749 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2751 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2752 long their_node_id_ref = (long)&their_node_id;
2753 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->peer_disconnected_meth, their_node_id_ref, no_connection_possible);
2755 void peer_connected_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit *msg) {
2756 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2758 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2759 long their_node_id_ref = (long)&their_node_id;
2760 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->peer_connected_meth, their_node_id_ref, msg);
2762 void handle_channel_reestablish_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReestablish *msg) {
2763 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2765 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2766 long their_node_id_ref = (long)&their_node_id;
2767 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_channel_reestablish_meth, their_node_id_ref, msg);
2769 void handle_error_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage *msg) {
2770 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2772 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2773 long their_node_id_ref = (long)&their_node_id;
2774 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_error_meth, their_node_id_ref, msg);
2776 static void LDKChannelMessageHandler_JCalls_free(void* this_arg) {
2777 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2778 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
2780 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
2781 (*env)->DeleteGlobalRef(env, j_calls->o);
2785 static void* LDKChannelMessageHandler_JCalls_clone(const void* this_arg) {
2786 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
2787 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
2788 atomic_fetch_add_explicit(&j_calls->MessageSendEventsProvider->refcnt, 1, memory_order_release);
2789 return (void*) this_arg;
2791 static inline LDKChannelMessageHandler LDKChannelMessageHandler_init (JNIEnv * env, jclass _a, jobject o, jobject MessageSendEventsProvider) {
2792 jclass c = (*env)->GetObjectClass(env, o);
2793 DO_ASSERT(c != NULL);
2794 LDKChannelMessageHandler_JCalls *calls = MALLOC(sizeof(LDKChannelMessageHandler_JCalls), "LDKChannelMessageHandler_JCalls");
2795 atomic_init(&calls->refcnt, 1);
2796 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
2797 calls->o = (*env)->NewGlobalRef(env, o);
2798 calls->handle_open_channel_meth = (*env)->GetMethodID(env, c, "handle_open_channel", "(JJJ)V");
2799 DO_ASSERT(calls->handle_open_channel_meth != NULL);
2800 calls->handle_accept_channel_meth = (*env)->GetMethodID(env, c, "handle_accept_channel", "(JJJ)V");
2801 DO_ASSERT(calls->handle_accept_channel_meth != NULL);
2802 calls->handle_funding_created_meth = (*env)->GetMethodID(env, c, "handle_funding_created", "(JJ)V");
2803 DO_ASSERT(calls->handle_funding_created_meth != NULL);
2804 calls->handle_funding_signed_meth = (*env)->GetMethodID(env, c, "handle_funding_signed", "(JJ)V");
2805 DO_ASSERT(calls->handle_funding_signed_meth != NULL);
2806 calls->handle_funding_locked_meth = (*env)->GetMethodID(env, c, "handle_funding_locked", "(JJ)V");
2807 DO_ASSERT(calls->handle_funding_locked_meth != NULL);
2808 calls->handle_shutdown_meth = (*env)->GetMethodID(env, c, "handle_shutdown", "(JJ)V");
2809 DO_ASSERT(calls->handle_shutdown_meth != NULL);
2810 calls->handle_closing_signed_meth = (*env)->GetMethodID(env, c, "handle_closing_signed", "(JJ)V");
2811 DO_ASSERT(calls->handle_closing_signed_meth != NULL);
2812 calls->handle_update_add_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_add_htlc", "(JJ)V");
2813 DO_ASSERT(calls->handle_update_add_htlc_meth != NULL);
2814 calls->handle_update_fulfill_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fulfill_htlc", "(JJ)V");
2815 DO_ASSERT(calls->handle_update_fulfill_htlc_meth != NULL);
2816 calls->handle_update_fail_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fail_htlc", "(JJ)V");
2817 DO_ASSERT(calls->handle_update_fail_htlc_meth != NULL);
2818 calls->handle_update_fail_malformed_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fail_malformed_htlc", "(JJ)V");
2819 DO_ASSERT(calls->handle_update_fail_malformed_htlc_meth != NULL);
2820 calls->handle_commitment_signed_meth = (*env)->GetMethodID(env, c, "handle_commitment_signed", "(JJ)V");
2821 DO_ASSERT(calls->handle_commitment_signed_meth != NULL);
2822 calls->handle_revoke_and_ack_meth = (*env)->GetMethodID(env, c, "handle_revoke_and_ack", "(JJ)V");
2823 DO_ASSERT(calls->handle_revoke_and_ack_meth != NULL);
2824 calls->handle_update_fee_meth = (*env)->GetMethodID(env, c, "handle_update_fee", "(JJ)V");
2825 DO_ASSERT(calls->handle_update_fee_meth != NULL);
2826 calls->handle_announcement_signatures_meth = (*env)->GetMethodID(env, c, "handle_announcement_signatures", "(JJ)V");
2827 DO_ASSERT(calls->handle_announcement_signatures_meth != NULL);
2828 calls->peer_disconnected_meth = (*env)->GetMethodID(env, c, "peer_disconnected", "(JZ)V");
2829 DO_ASSERT(calls->peer_disconnected_meth != NULL);
2830 calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "(JJ)V");
2831 DO_ASSERT(calls->peer_connected_meth != NULL);
2832 calls->handle_channel_reestablish_meth = (*env)->GetMethodID(env, c, "handle_channel_reestablish", "(JJ)V");
2833 DO_ASSERT(calls->handle_channel_reestablish_meth != NULL);
2834 calls->handle_error_meth = (*env)->GetMethodID(env, c, "handle_error", "(JJ)V");
2835 DO_ASSERT(calls->handle_error_meth != NULL);
2837 LDKChannelMessageHandler ret = {
2838 .this_arg = (void*) calls,
2839 .handle_open_channel = handle_open_channel_jcall,
2840 .handle_accept_channel = handle_accept_channel_jcall,
2841 .handle_funding_created = handle_funding_created_jcall,
2842 .handle_funding_signed = handle_funding_signed_jcall,
2843 .handle_funding_locked = handle_funding_locked_jcall,
2844 .handle_shutdown = handle_shutdown_jcall,
2845 .handle_closing_signed = handle_closing_signed_jcall,
2846 .handle_update_add_htlc = handle_update_add_htlc_jcall,
2847 .handle_update_fulfill_htlc = handle_update_fulfill_htlc_jcall,
2848 .handle_update_fail_htlc = handle_update_fail_htlc_jcall,
2849 .handle_update_fail_malformed_htlc = handle_update_fail_malformed_htlc_jcall,
2850 .handle_commitment_signed = handle_commitment_signed_jcall,
2851 .handle_revoke_and_ack = handle_revoke_and_ack_jcall,
2852 .handle_update_fee = handle_update_fee_jcall,
2853 .handle_announcement_signatures = handle_announcement_signatures_jcall,
2854 .peer_disconnected = peer_disconnected_jcall,
2855 .peer_connected = peer_connected_jcall,
2856 .handle_channel_reestablish = handle_channel_reestablish_jcall,
2857 .handle_error = handle_error_jcall,
2858 .free = LDKChannelMessageHandler_JCalls_free,
2859 .MessageSendEventsProvider = LDKMessageSendEventsProvider_init(env, _a, MessageSendEventsProvider),
2861 calls->MessageSendEventsProvider = ret.MessageSendEventsProvider.this_arg;
2864 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1new (JNIEnv * env, jclass _a, jobject o, jobject MessageSendEventsProvider) {
2865 LDKChannelMessageHandler *res_ptr = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
2866 *res_ptr = LDKChannelMessageHandler_init(env, _a, o, MessageSendEventsProvider);
2867 return (long)res_ptr;
2869 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
2870 return ((LDKChannelMessageHandler_JCalls*)val)->o;
2872 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) {
2873 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2874 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2875 FREE((void*)their_node_id);
2876 LDKInitFeatures their_features_conv = *(LDKInitFeatures*)their_features;
2877 FREE((void*)their_features);
2878 their_features_conv.is_owned = true;
2879 LDKOpenChannel* msg_conv = (LDKOpenChannel*)msg;
2880 return (arg_conv->handle_open_channel)(arg_conv->this_arg, their_node_id_conv, their_features_conv, msg_conv);
2883 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) {
2884 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2885 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2886 FREE((void*)their_node_id);
2887 LDKInitFeatures their_features_conv = *(LDKInitFeatures*)their_features;
2888 FREE((void*)their_features);
2889 their_features_conv.is_owned = true;
2890 LDKAcceptChannel* msg_conv = (LDKAcceptChannel*)msg;
2891 return (arg_conv->handle_accept_channel)(arg_conv->this_arg, their_node_id_conv, their_features_conv, msg_conv);
2894 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) {
2895 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2896 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2897 FREE((void*)their_node_id);
2898 LDKFundingCreated* msg_conv = (LDKFundingCreated*)msg;
2899 return (arg_conv->handle_funding_created)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2902 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) {
2903 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2904 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2905 FREE((void*)their_node_id);
2906 LDKFundingSigned* msg_conv = (LDKFundingSigned*)msg;
2907 return (arg_conv->handle_funding_signed)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2910 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) {
2911 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2912 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2913 FREE((void*)their_node_id);
2914 LDKFundingLocked* msg_conv = (LDKFundingLocked*)msg;
2915 return (arg_conv->handle_funding_locked)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2918 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1shutdown(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
2919 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2920 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2921 FREE((void*)their_node_id);
2922 LDKShutdown* msg_conv = (LDKShutdown*)msg;
2923 return (arg_conv->handle_shutdown)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2926 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) {
2927 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2928 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2929 FREE((void*)their_node_id);
2930 LDKClosingSigned* msg_conv = (LDKClosingSigned*)msg;
2931 return (arg_conv->handle_closing_signed)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2934 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) {
2935 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2936 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2937 FREE((void*)their_node_id);
2938 LDKUpdateAddHTLC* msg_conv = (LDKUpdateAddHTLC*)msg;
2939 return (arg_conv->handle_update_add_htlc)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2942 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) {
2943 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2944 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2945 FREE((void*)their_node_id);
2946 LDKUpdateFulfillHTLC* msg_conv = (LDKUpdateFulfillHTLC*)msg;
2947 return (arg_conv->handle_update_fulfill_htlc)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2950 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) {
2951 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2952 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2953 FREE((void*)their_node_id);
2954 LDKUpdateFailHTLC* msg_conv = (LDKUpdateFailHTLC*)msg;
2955 return (arg_conv->handle_update_fail_htlc)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2958 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) {
2959 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2960 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2961 FREE((void*)their_node_id);
2962 LDKUpdateFailMalformedHTLC* msg_conv = (LDKUpdateFailMalformedHTLC*)msg;
2963 return (arg_conv->handle_update_fail_malformed_htlc)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2966 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) {
2967 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2968 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2969 FREE((void*)their_node_id);
2970 LDKCommitmentSigned* msg_conv = (LDKCommitmentSigned*)msg;
2971 return (arg_conv->handle_commitment_signed)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2974 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) {
2975 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2976 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2977 FREE((void*)their_node_id);
2978 LDKRevokeAndACK* msg_conv = (LDKRevokeAndACK*)msg;
2979 return (arg_conv->handle_revoke_and_ack)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2982 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) {
2983 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2984 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2985 FREE((void*)their_node_id);
2986 LDKUpdateFee* msg_conv = (LDKUpdateFee*)msg;
2987 return (arg_conv->handle_update_fee)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2990 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) {
2991 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
2992 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
2993 FREE((void*)their_node_id);
2994 LDKAnnouncementSignatures* msg_conv = (LDKAnnouncementSignatures*)msg;
2995 return (arg_conv->handle_announcement_signatures)(arg_conv->this_arg, their_node_id_conv, msg_conv);
2998 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) {
2999 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
3000 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
3001 FREE((void*)their_node_id);
3002 return (arg_conv->peer_disconnected)(arg_conv->this_arg, their_node_id_conv, no_connection_possible);
3005 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1peer_1connected(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
3006 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
3007 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
3008 FREE((void*)their_node_id);
3009 LDKInit* msg_conv = (LDKInit*)msg;
3010 return (arg_conv->peer_connected)(arg_conv->this_arg, their_node_id_conv, msg_conv);
3013 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) {
3014 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
3015 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
3016 FREE((void*)their_node_id);
3017 LDKChannelReestablish* msg_conv = (LDKChannelReestablish*)msg;
3018 return (arg_conv->handle_channel_reestablish)(arg_conv->this_arg, their_node_id_conv, msg_conv);
3021 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1call_1handle_1error(JNIEnv * _env, jclass _b, jlong arg, jlong their_node_id, jlong msg) {
3022 LDKChannelMessageHandler* arg_conv = (LDKChannelMessageHandler*)arg;
3023 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
3024 FREE((void*)their_node_id);
3025 LDKErrorMessage* msg_conv = (LDKErrorMessage*)msg;
3026 return (arg_conv->handle_error)(arg_conv->this_arg, their_node_id_conv, msg_conv);
3029 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelManagerReadArgs_1optional_1none (JNIEnv * env, jclass _a) {
3030 LDKChannelManagerReadArgs *ret = MALLOC(sizeof(LDKChannelManagerReadArgs), "LDKChannelManagerReadArgs");
3034 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1ChannelMonitor_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
3035 LDKCVecTempl_ChannelMonitor *vec = (LDKCVecTempl_ChannelMonitor*)ptr;
3036 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKChannelMonitor));
3038 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1ChannelMonitor_1new(JNIEnv *env, jclass _b, jlongArray elems){
3039 LDKCVecTempl_ChannelMonitor *ret = MALLOC(sizeof(LDKCVecTempl_ChannelMonitor), "LDKCVecTempl_ChannelMonitor");
3040 ret->datalen = (*env)->GetArrayLength(env, elems);
3041 if (ret->datalen == 0) {
3044 ret->data = malloc(sizeof(LDKChannelMonitor) * ret->datalen); // often freed by rust directly
3045 jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
3046 for (size_t i = 0; i < ret->datalen; i++) {
3047 jlong arr_elem = java_elems[i];
3048 LDKChannelMonitor arr_elem_conv = *(LDKChannelMonitor*)arr_elem;
3049 FREE((void*)arr_elem);
3050 arr_elem_conv.is_owned = true;
3051 ret->data[i] = arr_elem_conv;
3053 (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
3057 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKDecodeError_1optional_1none (JNIEnv * env, jclass _a) {
3058 LDKDecodeError *ret = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError");
3062 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKPing_1optional_1none (JNIEnv * env, jclass _a) {
3063 LDKPing *ret = MALLOC(sizeof(LDKPing), "LDKPing");
3067 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKPong_1optional_1none (JNIEnv * env, jclass _a) {
3068 LDKPong *ret = MALLOC(sizeof(LDKPong), "LDKPong");
3072 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKDataLossProtect_1optional_1none (JNIEnv * env, jclass _a) {
3073 LDKDataLossProtect *ret = MALLOC(sizeof(LDKDataLossProtect), "LDKDataLossProtect");
3077 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKUnsignedNodeAnnouncement_1optional_1none (JNIEnv * env, jclass _a) {
3078 LDKUnsignedNodeAnnouncement *ret = MALLOC(sizeof(LDKUnsignedNodeAnnouncement), "LDKUnsignedNodeAnnouncement");
3082 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKNodeFeatures_1optional_1none (JNIEnv * env, jclass _a) {
3083 LDKNodeFeatures *ret = MALLOC(sizeof(LDKNodeFeatures), "LDKNodeFeatures");
3087 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelFeatures_1optional_1none (JNIEnv * env, jclass _a) {
3088 LDKChannelFeatures *ret = MALLOC(sizeof(LDKChannelFeatures), "LDKChannelFeatures");
3092 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKUnsignedChannelUpdate_1optional_1none (JNIEnv * env, jclass _a) {
3093 LDKUnsignedChannelUpdate *ret = MALLOC(sizeof(LDKUnsignedChannelUpdate), "LDKUnsignedChannelUpdate");
3097 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKQueryChannelRange_1optional_1none (JNIEnv * env, jclass _a) {
3098 LDKQueryChannelRange *ret = MALLOC(sizeof(LDKQueryChannelRange), "LDKQueryChannelRange");
3102 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKReplyChannelRange_1optional_1none (JNIEnv * env, jclass _a) {
3103 LDKReplyChannelRange *ret = MALLOC(sizeof(LDKReplyChannelRange), "LDKReplyChannelRange");
3107 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1u64_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
3108 LDKCVecTempl_u64 *vec = (LDKCVecTempl_u64*)ptr;
3109 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(uint64_t));
3111 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1u64_1new(JNIEnv *env, jclass _b, jlongArray elems){
3112 LDKCVecTempl_u64 *ret = MALLOC(sizeof(LDKCVecTempl_u64), "LDKCVecTempl_u64");
3113 ret->datalen = (*env)->GetArrayLength(env, elems);
3114 if (ret->datalen == 0) {
3117 ret->data = malloc(sizeof(uint64_t) * ret->datalen); // often freed by rust directly
3118 jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
3119 for (size_t i = 0; i < ret->datalen; i++) {
3120 ret->data[i] = java_elems[i];
3122 (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
3126 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKQueryShortChannelIds_1optional_1none (JNIEnv * env, jclass _a) {
3127 LDKQueryShortChannelIds *ret = MALLOC(sizeof(LDKQueryShortChannelIds), "LDKQueryShortChannelIds");
3131 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKReplyShortChannelIdsEnd_1optional_1none (JNIEnv * env, jclass _a) {
3132 LDKReplyShortChannelIdsEnd *ret = MALLOC(sizeof(LDKReplyShortChannelIdsEnd), "LDKReplyShortChannelIdsEnd");
3136 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKGossipTimestampFilter_1optional_1none (JNIEnv * env, jclass _a) {
3137 LDKGossipTimestampFilter *ret = MALLOC(sizeof(LDKGossipTimestampFilter), "LDKGossipTimestampFilter");
3141 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKLightningError_1optional_1none (JNIEnv * env, jclass _a) {
3142 LDKLightningError *ret = MALLOC(sizeof(LDKLightningError), "LDKLightningError");
3146 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateAddHTLC_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
3147 LDKCVecTempl_UpdateAddHTLC *vec = (LDKCVecTempl_UpdateAddHTLC*)ptr;
3148 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKUpdateAddHTLC));
3150 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateAddHTLC_1new(JNIEnv *env, jclass _b, jlongArray elems){
3151 LDKCVecTempl_UpdateAddHTLC *ret = MALLOC(sizeof(LDKCVecTempl_UpdateAddHTLC), "LDKCVecTempl_UpdateAddHTLC");
3152 ret->datalen = (*env)->GetArrayLength(env, elems);
3153 if (ret->datalen == 0) {
3156 ret->data = malloc(sizeof(LDKUpdateAddHTLC) * ret->datalen); // often freed by rust directly
3157 jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
3158 for (size_t i = 0; i < ret->datalen; i++) {
3159 jlong arr_elem = java_elems[i];
3160 LDKUpdateAddHTLC arr_elem_conv = *(LDKUpdateAddHTLC*)arr_elem;
3161 FREE((void*)arr_elem);
3162 arr_elem_conv.is_owned = true;
3163 ret->data[i] = arr_elem_conv;
3165 (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
3169 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFulfillHTLC_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
3170 LDKCVecTempl_UpdateFulfillHTLC *vec = (LDKCVecTempl_UpdateFulfillHTLC*)ptr;
3171 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKUpdateFulfillHTLC));
3173 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFulfillHTLC_1new(JNIEnv *env, jclass _b, jlongArray elems){
3174 LDKCVecTempl_UpdateFulfillHTLC *ret = MALLOC(sizeof(LDKCVecTempl_UpdateFulfillHTLC), "LDKCVecTempl_UpdateFulfillHTLC");
3175 ret->datalen = (*env)->GetArrayLength(env, elems);
3176 if (ret->datalen == 0) {
3179 ret->data = malloc(sizeof(LDKUpdateFulfillHTLC) * ret->datalen); // often freed by rust directly
3180 jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
3181 for (size_t i = 0; i < ret->datalen; i++) {
3182 jlong arr_elem = java_elems[i];
3183 LDKUpdateFulfillHTLC arr_elem_conv = *(LDKUpdateFulfillHTLC*)arr_elem;
3184 FREE((void*)arr_elem);
3185 arr_elem_conv.is_owned = true;
3186 ret->data[i] = arr_elem_conv;
3188 (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
3192 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFailHTLC_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
3193 LDKCVecTempl_UpdateFailHTLC *vec = (LDKCVecTempl_UpdateFailHTLC*)ptr;
3194 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKUpdateFailHTLC));
3196 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFailHTLC_1new(JNIEnv *env, jclass _b, jlongArray elems){
3197 LDKCVecTempl_UpdateFailHTLC *ret = MALLOC(sizeof(LDKCVecTempl_UpdateFailHTLC), "LDKCVecTempl_UpdateFailHTLC");
3198 ret->datalen = (*env)->GetArrayLength(env, elems);
3199 if (ret->datalen == 0) {
3202 ret->data = malloc(sizeof(LDKUpdateFailHTLC) * ret->datalen); // often freed by rust directly
3203 jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
3204 for (size_t i = 0; i < ret->datalen; i++) {
3205 jlong arr_elem = java_elems[i];
3206 LDKUpdateFailHTLC arr_elem_conv = *(LDKUpdateFailHTLC*)arr_elem;
3207 FREE((void*)arr_elem);
3208 arr_elem_conv.is_owned = true;
3209 ret->data[i] = arr_elem_conv;
3211 (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
3215 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFailMalformedHTLC_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
3216 LDKCVecTempl_UpdateFailMalformedHTLC *vec = (LDKCVecTempl_UpdateFailMalformedHTLC*)ptr;
3217 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKUpdateFailMalformedHTLC));
3219 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1UpdateFailMalformedHTLC_1new(JNIEnv *env, jclass _b, jlongArray elems){
3220 LDKCVecTempl_UpdateFailMalformedHTLC *ret = MALLOC(sizeof(LDKCVecTempl_UpdateFailMalformedHTLC), "LDKCVecTempl_UpdateFailMalformedHTLC");
3221 ret->datalen = (*env)->GetArrayLength(env, elems);
3222 if (ret->datalen == 0) {
3225 ret->data = malloc(sizeof(LDKUpdateFailMalformedHTLC) * ret->datalen); // often freed by rust directly
3226 jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
3227 for (size_t i = 0; i < ret->datalen; i++) {
3228 jlong arr_elem = java_elems[i];
3229 LDKUpdateFailMalformedHTLC arr_elem_conv = *(LDKUpdateFailMalformedHTLC*)arr_elem;
3230 FREE((void*)arr_elem);
3231 arr_elem_conv.is_owned = true;
3232 ret->data[i] = arr_elem_conv;
3234 (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
3238 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
3239 return ((LDKCResult_boolLightningErrorZ*)arg)->result_ok;
3241 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
3242 if (((LDKCResult_boolLightningErrorZ*)arg)->result_ok) {
3243 return (long)((LDKCResult_boolLightningErrorZ*)arg)->contents.result;
3245 return (long)((LDKCResult_boolLightningErrorZ*)arg)->contents.err;
3248 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C3TupleTempl_1ChannelAnnouncement_1_1ChannelUpdate_1_1ChannelUpdate_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
3249 LDKCVecTempl_C3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate *vec = (LDKCVecTempl_C3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate*)ptr;
3250 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate));
3252 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C3TupleTempl_1ChannelAnnouncement_1_1ChannelUpdate_1_1ChannelUpdate_1new(JNIEnv *env, jclass _b, jlongArray elems){
3253 LDKCVecTempl_C3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate *ret = MALLOC(sizeof(LDKCVecTempl_C3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate), "LDKCVecTempl_C3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate");
3254 ret->datalen = (*env)->GetArrayLength(env, elems);
3255 if (ret->datalen == 0) {
3258 ret->data = malloc(sizeof(LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate) * ret->datalen); // often freed by rust directly
3259 jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
3260 for (size_t i = 0; i < ret->datalen; i++) {
3261 jlong arr_elem = java_elems[i];
3262 LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate arr_elem_conv = *(LDKC3TupleTempl_ChannelAnnouncement__ChannelUpdate__ChannelUpdate*)arr_elem;
3263 FREE((void*)arr_elem);
3264 ret->data[i] = arr_elem_conv;
3266 (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
3270 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1NodeAnnouncement_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
3271 LDKCVecTempl_NodeAnnouncement *vec = (LDKCVecTempl_NodeAnnouncement*)ptr;
3272 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKNodeAnnouncement));
3274 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1NodeAnnouncement_1new(JNIEnv *env, jclass _b, jlongArray elems){
3275 LDKCVecTempl_NodeAnnouncement *ret = MALLOC(sizeof(LDKCVecTempl_NodeAnnouncement), "LDKCVecTempl_NodeAnnouncement");
3276 ret->datalen = (*env)->GetArrayLength(env, elems);
3277 if (ret->datalen == 0) {
3280 ret->data = malloc(sizeof(LDKNodeAnnouncement) * ret->datalen); // often freed by rust directly
3281 jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
3282 for (size_t i = 0; i < ret->datalen; i++) {
3283 jlong arr_elem = java_elems[i];
3284 LDKNodeAnnouncement arr_elem_conv = *(LDKNodeAnnouncement*)arr_elem;
3285 FREE((void*)arr_elem);
3286 arr_elem_conv.is_owned = true;
3287 ret->data[i] = arr_elem_conv;
3289 (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
3293 typedef struct LDKRoutingMessageHandler_JCalls {
3294 atomic_size_t refcnt;
3297 jmethodID handle_node_announcement_meth;
3298 jmethodID handle_channel_announcement_meth;
3299 jmethodID handle_channel_update_meth;
3300 jmethodID handle_htlc_fail_channel_update_meth;
3301 jmethodID get_next_channel_announcements_meth;
3302 jmethodID get_next_node_announcements_meth;
3303 jmethodID should_request_full_sync_meth;
3304 } LDKRoutingMessageHandler_JCalls;
3305 LDKCResult_boolLightningErrorZ handle_node_announcement_jcall(const void* this_arg, const LDKNodeAnnouncement *msg) {
3306 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
3308 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
3309 LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->handle_node_announcement_meth, msg);
3310 LDKCResult_boolLightningErrorZ res = *ret;
3314 LDKCResult_boolLightningErrorZ handle_channel_announcement_jcall(const void* this_arg, const LDKChannelAnnouncement *msg) {
3315 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
3317 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
3318 LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->handle_channel_announcement_meth, msg);
3319 LDKCResult_boolLightningErrorZ res = *ret;
3323 LDKCResult_boolLightningErrorZ handle_channel_update_jcall(const void* this_arg, const LDKChannelUpdate *msg) {
3324 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
3326 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
3327 LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->handle_channel_update_meth, msg);
3328 LDKCResult_boolLightningErrorZ res = *ret;
3332 void handle_htlc_fail_channel_update_jcall(const void* this_arg, const LDKHTLCFailChannelUpdate *update) {
3333 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
3335 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
3336 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->handle_htlc_fail_channel_update_meth, update);
3338 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcements_jcall(const void* this_arg, uint64_t starting_point, uint8_t batch_amount) {
3339 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
3341 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
3342 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* ret = (LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->get_next_channel_announcements_meth, starting_point, batch_amount);
3343 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ res = *ret;
3347 LDKCVec_NodeAnnouncementZ get_next_node_announcements_jcall(const void* this_arg, LDKPublicKey starting_point, uint8_t batch_amount) {
3348 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
3350 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
3351 long starting_point_ref = (long)&starting_point;
3352 LDKCVec_NodeAnnouncementZ* ret = (LDKCVec_NodeAnnouncementZ*)(*env)->CallLongMethod(env, j_calls->o, j_calls->get_next_node_announcements_meth, starting_point_ref, batch_amount);
3353 LDKCVec_NodeAnnouncementZ res = *ret;
3357 bool should_request_full_sync_jcall(const void* this_arg, LDKPublicKey node_id) {
3358 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
3360 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
3361 long node_id_ref = (long)&node_id;
3362 return (*env)->CallBooleanMethod(env, j_calls->o, j_calls->should_request_full_sync_meth, node_id_ref);
3364 static void LDKRoutingMessageHandler_JCalls_free(void* this_arg) {
3365 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
3366 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
3368 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
3369 (*env)->DeleteGlobalRef(env, j_calls->o);
3373 static void* LDKRoutingMessageHandler_JCalls_clone(const void* this_arg) {
3374 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
3375 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
3376 return (void*) this_arg;
3378 static inline LDKRoutingMessageHandler LDKRoutingMessageHandler_init (JNIEnv * env, jclass _a, jobject o) {
3379 jclass c = (*env)->GetObjectClass(env, o);
3380 DO_ASSERT(c != NULL);
3381 LDKRoutingMessageHandler_JCalls *calls = MALLOC(sizeof(LDKRoutingMessageHandler_JCalls), "LDKRoutingMessageHandler_JCalls");
3382 atomic_init(&calls->refcnt, 1);
3383 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
3384 calls->o = (*env)->NewGlobalRef(env, o);
3385 calls->handle_node_announcement_meth = (*env)->GetMethodID(env, c, "handle_node_announcement", "(J)J");
3386 DO_ASSERT(calls->handle_node_announcement_meth != NULL);
3387 calls->handle_channel_announcement_meth = (*env)->GetMethodID(env, c, "handle_channel_announcement", "(J)J");
3388 DO_ASSERT(calls->handle_channel_announcement_meth != NULL);
3389 calls->handle_channel_update_meth = (*env)->GetMethodID(env, c, "handle_channel_update", "(J)J");
3390 DO_ASSERT(calls->handle_channel_update_meth != NULL);
3391 calls->handle_htlc_fail_channel_update_meth = (*env)->GetMethodID(env, c, "handle_htlc_fail_channel_update", "(J)V");
3392 DO_ASSERT(calls->handle_htlc_fail_channel_update_meth != NULL);
3393 calls->get_next_channel_announcements_meth = (*env)->GetMethodID(env, c, "get_next_channel_announcements", "(JB)J");
3394 DO_ASSERT(calls->get_next_channel_announcements_meth != NULL);
3395 calls->get_next_node_announcements_meth = (*env)->GetMethodID(env, c, "get_next_node_announcements", "(JB)J");
3396 DO_ASSERT(calls->get_next_node_announcements_meth != NULL);
3397 calls->should_request_full_sync_meth = (*env)->GetMethodID(env, c, "should_request_full_sync", "(J)Z");
3398 DO_ASSERT(calls->should_request_full_sync_meth != NULL);
3400 LDKRoutingMessageHandler ret = {
3401 .this_arg = (void*) calls,
3402 .handle_node_announcement = handle_node_announcement_jcall,
3403 .handle_channel_announcement = handle_channel_announcement_jcall,
3404 .handle_channel_update = handle_channel_update_jcall,
3405 .handle_htlc_fail_channel_update = handle_htlc_fail_channel_update_jcall,
3406 .get_next_channel_announcements = get_next_channel_announcements_jcall,
3407 .get_next_node_announcements = get_next_node_announcements_jcall,
3408 .should_request_full_sync = should_request_full_sync_jcall,
3409 .free = LDKRoutingMessageHandler_JCalls_free,
3413 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1new (JNIEnv * env, jclass _a, jobject o) {
3414 LDKRoutingMessageHandler *res_ptr = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
3415 *res_ptr = LDKRoutingMessageHandler_init(env, _a, o);
3416 return (long)res_ptr;
3418 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
3419 return ((LDKRoutingMessageHandler_JCalls*)val)->o;
3421 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1call_1handle_1node_1announcement(JNIEnv * _env, jclass _b, jlong arg, jlong msg) {
3422 LDKRoutingMessageHandler* arg_conv = (LDKRoutingMessageHandler*)arg;
3423 LDKNodeAnnouncement* msg_conv = (LDKNodeAnnouncement*)msg;
3424 LDKCResult_boolLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
3425 *ret = (arg_conv->handle_node_announcement)(arg_conv->this_arg, msg_conv);
3429 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1call_1handle_1channel_1announcement(JNIEnv * _env, jclass _b, jlong arg, jlong msg) {
3430 LDKRoutingMessageHandler* arg_conv = (LDKRoutingMessageHandler*)arg;
3431 LDKChannelAnnouncement* msg_conv = (LDKChannelAnnouncement*)msg;
3432 LDKCResult_boolLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
3433 *ret = (arg_conv->handle_channel_announcement)(arg_conv->this_arg, msg_conv);
3437 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1call_1handle_1channel_1update(JNIEnv * _env, jclass _b, jlong arg, jlong msg) {
3438 LDKRoutingMessageHandler* arg_conv = (LDKRoutingMessageHandler*)arg;
3439 LDKChannelUpdate* msg_conv = (LDKChannelUpdate*)msg;
3440 LDKCResult_boolLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
3441 *ret = (arg_conv->handle_channel_update)(arg_conv->this_arg, msg_conv);
3445 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1call_1handle_1htlc_1fail_1channel_1update(JNIEnv * _env, jclass _b, jlong arg, jlong update) {
3446 LDKRoutingMessageHandler* arg_conv = (LDKRoutingMessageHandler*)arg;
3447 LDKHTLCFailChannelUpdate* update_conv = (LDKHTLCFailChannelUpdate*)update;
3448 return (arg_conv->handle_htlc_fail_channel_update)(arg_conv->this_arg, update_conv);
3451 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) {
3452 LDKRoutingMessageHandler* arg_conv = (LDKRoutingMessageHandler*)arg;
3453 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* ret = MALLOC(sizeof(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ");
3454 *ret = (arg_conv->get_next_channel_announcements)(arg_conv->this_arg, starting_point, batch_amount);
3458 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) {
3459 LDKRoutingMessageHandler* arg_conv = (LDKRoutingMessageHandler*)arg;
3460 LDKPublicKey starting_point_conv = *(LDKPublicKey*)starting_point;
3461 FREE((void*)starting_point);
3462 LDKCVec_NodeAnnouncementZ* ret = MALLOC(sizeof(LDKCVec_NodeAnnouncementZ), "LDKCVec_NodeAnnouncementZ");
3463 *ret = (arg_conv->get_next_node_announcements)(arg_conv->this_arg, starting_point_conv, batch_amount);
3467 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1call_1should_1request_1full_1sync(JNIEnv * _env, jclass _b, jlong arg, jlong node_id) {
3468 LDKRoutingMessageHandler* arg_conv = (LDKRoutingMessageHandler*)arg;
3469 LDKPublicKey node_id_conv = *(LDKPublicKey*)node_id;
3470 FREE((void*)node_id);
3471 return (arg_conv->should_request_full_sync)(arg_conv->this_arg, node_id_conv);
3474 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKMessageHandler_1optional_1none (JNIEnv * env, jclass _a) {
3475 LDKMessageHandler *ret = MALLOC(sizeof(LDKMessageHandler), "LDKMessageHandler");
3479 typedef struct LDKSocketDescriptor_JCalls {
3480 atomic_size_t refcnt;
3483 jmethodID send_data_meth;
3484 jmethodID disconnect_socket_meth;
3486 jmethodID hash_meth;
3487 } LDKSocketDescriptor_JCalls;
3488 uintptr_t send_data_jcall(void* this_arg, LDKu8slice data, bool resume_read) {
3489 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
3491 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
3492 long data_ref = (long)&data;
3493 return (*env)->CallLongMethod(env, j_calls->o, j_calls->send_data_meth, data_ref, resume_read);
3495 void disconnect_socket_jcall(void* this_arg) {
3496 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
3498 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
3499 return (*env)->CallVoidMethod(env, j_calls->o, j_calls->disconnect_socket_meth);
3501 bool eq_jcall(const void* this_arg, const void *other_arg) {
3502 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
3504 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
3505 return (*env)->CallBooleanMethod(env, j_calls->o, j_calls->eq_meth, other_arg);
3507 uint64_t hash_jcall(const void* this_arg) {
3508 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
3510 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
3511 return (*env)->CallLongMethod(env, j_calls->o, j_calls->hash_meth);
3513 static void LDKSocketDescriptor_JCalls_free(void* this_arg) {
3514 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
3515 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
3517 DO_ASSERT((*j_calls->vm)->GetEnv(j_calls->vm, (void**)&env, JNI_VERSION_1_8) == JNI_OK);
3518 (*env)->DeleteGlobalRef(env, j_calls->o);
3522 static void* LDKSocketDescriptor_JCalls_clone(const void* this_arg) {
3523 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
3524 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
3525 return (void*) this_arg;
3527 static inline LDKSocketDescriptor LDKSocketDescriptor_init (JNIEnv * env, jclass _a, jobject o) {
3528 jclass c = (*env)->GetObjectClass(env, o);
3529 DO_ASSERT(c != NULL);
3530 LDKSocketDescriptor_JCalls *calls = MALLOC(sizeof(LDKSocketDescriptor_JCalls), "LDKSocketDescriptor_JCalls");
3531 atomic_init(&calls->refcnt, 1);
3532 DO_ASSERT((*env)->GetJavaVM(env, &calls->vm) == 0);
3533 calls->o = (*env)->NewGlobalRef(env, o);
3534 calls->send_data_meth = (*env)->GetMethodID(env, c, "send_data", "(JZ)J");
3535 DO_ASSERT(calls->send_data_meth != NULL);
3536 calls->disconnect_socket_meth = (*env)->GetMethodID(env, c, "disconnect_socket", "()V");
3537 DO_ASSERT(calls->disconnect_socket_meth != NULL);
3538 calls->eq_meth = (*env)->GetMethodID(env, c, "eq", "(J)Z");
3539 DO_ASSERT(calls->eq_meth != NULL);
3540 calls->hash_meth = (*env)->GetMethodID(env, c, "hash", "()J");
3541 DO_ASSERT(calls->hash_meth != NULL);
3543 LDKSocketDescriptor ret = {
3544 .this_arg = (void*) calls,
3545 .send_data = send_data_jcall,
3546 .disconnect_socket = disconnect_socket_jcall,
3549 .clone = LDKSocketDescriptor_JCalls_clone,
3550 .free = LDKSocketDescriptor_JCalls_free,
3554 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1new (JNIEnv * env, jclass _a, jobject o) {
3555 LDKSocketDescriptor *res_ptr = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
3556 *res_ptr = LDKSocketDescriptor_init(env, _a, o);
3557 return (long)res_ptr;
3559 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
3560 return ((LDKSocketDescriptor_JCalls*)val)->o;
3562 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1call_1send_1data(JNIEnv * _env, jclass _b, jlong arg, jlong data, jboolean resume_read) {
3563 LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg;
3564 LDKu8slice data_conv = *(LDKu8slice*)data;
3565 return (arg_conv->send_data)(arg_conv->this_arg, data_conv, resume_read);
3568 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1call_1disconnect_1socket(JNIEnv * _env, jclass _b, jlong arg) {
3569 LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg;
3570 return (arg_conv->disconnect_socket)(arg_conv->this_arg);
3573 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1call_1hash(JNIEnv * _env, jclass _b, jlong arg) {
3574 LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg;
3575 return (arg_conv->hash)(arg_conv->this_arg);
3578 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKPeerManager_1optional_1none (JNIEnv * env, jclass _a) {
3579 LDKPeerManager *ret = MALLOC(sizeof(LDKPeerManager), "LDKPeerManager");
3583 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1PublicKey_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
3584 LDKCVecTempl_PublicKey *vec = (LDKCVecTempl_PublicKey*)ptr;
3585 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKPublicKey));
3587 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1PublicKey_1new(JNIEnv *env, jclass _b, jlongArray elems){
3588 LDKCVecTempl_PublicKey *ret = MALLOC(sizeof(LDKCVecTempl_PublicKey), "LDKCVecTempl_PublicKey");
3589 ret->datalen = (*env)->GetArrayLength(env, elems);
3590 if (ret->datalen == 0) {
3593 ret->data = malloc(sizeof(LDKPublicKey) * ret->datalen); // often freed by rust directly
3594 jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
3595 for (size_t i = 0; i < ret->datalen; i++) {
3596 jlong arr_elem = java_elems[i];
3597 LDKPublicKey arr_elem_conv = *(LDKPublicKey*)arr_elem;
3598 FREE((void*)arr_elem);
3599 ret->data[i] = arr_elem_conv;
3601 (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
3605 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
3606 return ((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->result_ok;
3608 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
3609 if (((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->result_ok) {
3610 return (long)((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->contents.result;
3612 return (long)((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->contents.err;
3615 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
3616 return ((LDKCResult_boolPeerHandleErrorZ*)arg)->result_ok;
3618 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
3619 if (((LDKCResult_boolPeerHandleErrorZ*)arg)->result_ok) {
3620 return (long)((LDKCResult_boolPeerHandleErrorZ*)arg)->contents.result;
3622 return (long)((LDKCResult_boolPeerHandleErrorZ*)arg)->contents.err;
3625 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeySecpErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
3626 return ((LDKCResult_SecretKeySecpErrorZ*)arg)->result_ok;
3628 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeySecpErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
3629 if (((LDKCResult_SecretKeySecpErrorZ*)arg)->result_ok) {
3630 return (long)((LDKCResult_SecretKeySecpErrorZ*)arg)->contents.result;
3632 return (long)((LDKCResult_SecretKeySecpErrorZ*)arg)->contents.err;
3635 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeySecpErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
3636 return ((LDKCResult_PublicKeySecpErrorZ*)arg)->result_ok;
3638 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeySecpErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
3639 if (((LDKCResult_PublicKeySecpErrorZ*)arg)->result_ok) {
3640 return (long)((LDKCResult_PublicKeySecpErrorZ*)arg)->contents.result;
3642 return (long)((LDKCResult_PublicKeySecpErrorZ*)arg)->contents.err;
3645 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKTxCreationKeys_1optional_1none (JNIEnv * env, jclass _a) {
3646 LDKTxCreationKeys *ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
3650 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysSecpErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
3651 return ((LDKCResult_TxCreationKeysSecpErrorZ*)arg)->result_ok;
3653 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysSecpErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
3654 if (((LDKCResult_TxCreationKeysSecpErrorZ*)arg)->result_ok) {
3655 return (long)((LDKCResult_TxCreationKeysSecpErrorZ*)arg)->contents.result;
3657 return (long)((LDKCResult_TxCreationKeysSecpErrorZ*)arg)->contents.err;
3660 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1HTLCOutputInCommitment_1_1Signature_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
3661 LDKCVecTempl_C2TupleTempl_HTLCOutputInCommitment__Signature *vec = (LDKCVecTempl_C2TupleTempl_HTLCOutputInCommitment__Signature*)ptr;
3662 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKC2TupleTempl_HTLCOutputInCommitment__Signature));
3664 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1C2TupleTempl_1HTLCOutputInCommitment_1_1Signature_1new(JNIEnv *env, jclass _b, jlongArray elems){
3665 LDKCVecTempl_C2TupleTempl_HTLCOutputInCommitment__Signature *ret = MALLOC(sizeof(LDKCVecTempl_C2TupleTempl_HTLCOutputInCommitment__Signature), "LDKCVecTempl_C2TupleTempl_HTLCOutputInCommitment__Signature");
3666 ret->datalen = (*env)->GetArrayLength(env, elems);
3667 if (ret->datalen == 0) {
3670 ret->data = malloc(sizeof(LDKC2TupleTempl_HTLCOutputInCommitment__Signature) * ret->datalen); // often freed by rust directly
3671 jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
3672 for (size_t i = 0; i < ret->datalen; i++) {
3673 jlong arr_elem = java_elems[i];
3674 LDKC2TupleTempl_HTLCOutputInCommitment__Signature arr_elem_conv = *(LDKC2TupleTempl_HTLCOutputInCommitment__Signature*)arr_elem;
3675 FREE((void*)arr_elem);
3676 ret->data[i] = arr_elem_conv;
3678 (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
3682 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRouteHop_1optional_1none (JNIEnv * env, jclass _a) {
3683 LDKRouteHop *ret = MALLOC(sizeof(LDKRouteHop), "LDKRouteHop");
3687 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1RouteHop_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
3688 LDKCVecTempl_RouteHop *vec = (LDKCVecTempl_RouteHop*)ptr;
3689 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKRouteHop));
3691 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1RouteHop_1new(JNIEnv *env, jclass _b, jlongArray elems){
3692 LDKCVecTempl_RouteHop *ret = MALLOC(sizeof(LDKCVecTempl_RouteHop), "LDKCVecTempl_RouteHop");
3693 ret->datalen = (*env)->GetArrayLength(env, elems);
3694 if (ret->datalen == 0) {
3697 ret->data = malloc(sizeof(LDKRouteHop) * ret->datalen); // often freed by rust directly
3698 jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
3699 for (size_t i = 0; i < ret->datalen; i++) {
3700 jlong arr_elem = java_elems[i];
3701 LDKRouteHop arr_elem_conv = *(LDKRouteHop*)arr_elem;
3702 FREE((void*)arr_elem);
3703 arr_elem_conv.is_owned = true;
3704 ret->data[i] = arr_elem_conv;
3706 (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
3710 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1CVecTempl_1RouteHop_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
3711 LDKCVecTempl_CVecTempl_RouteHop *vec = (LDKCVecTempl_CVecTempl_RouteHop*)ptr;
3712 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKCVecTempl_RouteHop));
3714 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1CVecTempl_1RouteHop_1new(JNIEnv *env, jclass _b, jlongArray elems){
3715 LDKCVecTempl_CVecTempl_RouteHop *ret = MALLOC(sizeof(LDKCVecTempl_CVecTempl_RouteHop), "LDKCVecTempl_CVecTempl_RouteHop");
3716 ret->datalen = (*env)->GetArrayLength(env, elems);
3717 if (ret->datalen == 0) {
3720 ret->data = malloc(sizeof(LDKCVecTempl_RouteHop) * ret->datalen); // often freed by rust directly
3721 jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
3722 for (size_t i = 0; i < ret->datalen; i++) {
3723 jlong arr_elem = java_elems[i];
3724 LDKCVecTempl_RouteHop arr_elem_conv = *(LDKCVecTempl_RouteHop*)arr_elem;
3725 FREE((void*)arr_elem);
3726 ret->data[i] = arr_elem_conv;
3728 (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
3732 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRouteHint_1optional_1none (JNIEnv * env, jclass _a) {
3733 LDKRouteHint *ret = MALLOC(sizeof(LDKRouteHint), "LDKRouteHint");
3737 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKRoutingFees_1optional_1none (JNIEnv * env, jclass _a) {
3738 LDKRoutingFees *ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
3742 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
3743 return ((LDKCResult_RouteLightningErrorZ*)arg)->result_ok;
3745 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
3746 if (((LDKCResult_RouteLightningErrorZ*)arg)->result_ok) {
3747 return (long)((LDKCResult_RouteLightningErrorZ*)arg)->contents.result;
3749 return (long)((LDKCResult_RouteLightningErrorZ*)arg)->contents.err;
3752 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKNetworkGraph_1optional_1none (JNIEnv * env, jclass _a) {
3753 LDKNetworkGraph *ret = MALLOC(sizeof(LDKNetworkGraph), "LDKNetworkGraph");
3757 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1RouteHint_1arr_1info(JNIEnv *env, jclass _b, jlong ptr) {
3758 LDKCVecTempl_RouteHint *vec = (LDKCVecTempl_RouteHint*)ptr;
3759 return (*env)->NewObject(env, slicedef_cls, slicedef_meth, (long)vec->data, (long)vec->datalen, sizeof(LDKRouteHint));
3761 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCVecTempl_1RouteHint_1new(JNIEnv *env, jclass _b, jlongArray elems){
3762 LDKCVecTempl_RouteHint *ret = MALLOC(sizeof(LDKCVecTempl_RouteHint), "LDKCVecTempl_RouteHint");
3763 ret->datalen = (*env)->GetArrayLength(env, elems);
3764 if (ret->datalen == 0) {
3767 ret->data = malloc(sizeof(LDKRouteHint) * ret->datalen); // often freed by rust directly
3768 jlong *java_elems = (*env)->GetPrimitiveArrayCritical(env, elems, NULL);
3769 for (size_t i = 0; i < ret->datalen; i++) {
3770 jlong arr_elem = java_elems[i];
3771 LDKRouteHint arr_elem_conv = *(LDKRouteHint*)arr_elem;
3772 FREE((void*)arr_elem);
3773 arr_elem_conv.is_owned = true;
3774 ret->data[i] = arr_elem_conv;
3776 (*env)->ReleasePrimitiveArrayCritical(env, elems, java_elems, 0);
3780 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKLockedNetworkGraph_1optional_1none (JNIEnv * env, jclass _a) {
3781 LDKLockedNetworkGraph *ret = MALLOC(sizeof(LDKLockedNetworkGraph), "LDKLockedNetworkGraph");
3785 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKNetGraphMsgHandler_1optional_1none (JNIEnv * env, jclass _a) {
3786 LDKNetGraphMsgHandler *ret = MALLOC(sizeof(LDKNetGraphMsgHandler), "LDKNetGraphMsgHandler");
3790 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKDirectionalChannelInfo_1optional_1none (JNIEnv * env, jclass _a) {
3791 LDKDirectionalChannelInfo *ret = MALLOC(sizeof(LDKDirectionalChannelInfo), "LDKDirectionalChannelInfo");
3795 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKChannelInfo_1optional_1none (JNIEnv * env, jclass _a) {
3796 LDKChannelInfo *ret = MALLOC(sizeof(LDKChannelInfo), "LDKChannelInfo");
3800 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKNodeAnnouncementInfo_1optional_1none (JNIEnv * env, jclass _a) {
3801 LDKNodeAnnouncementInfo *ret = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo");
3805 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKNodeInfo_1optional_1none (JNIEnv * env, jclass _a) {
3806 LDKNodeInfo *ret = MALLOC(sizeof(LDKNodeInfo), "LDKNodeInfo");
3810 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HTLCOutputInCommitmentSignatureZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3811 LDKC2Tuple_HTLCOutputInCommitmentSignatureZ arg_conv = *(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ*)arg;
3813 return C2Tuple_HTLCOutputInCommitmentSignatureZ_free(arg_conv);
3816 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3817 LDKC2Tuple_OutPointScriptZ arg_conv = *(LDKC2Tuple_OutPointScriptZ*)arg;
3819 return C2Tuple_OutPointScriptZ_free(arg_conv);
3822 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3823 LDKC2Tuple_SignatureCVec_SignatureZZ arg_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)arg;
3825 return C2Tuple_SignatureCVec_SignatureZZ_free(arg_conv);
3828 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1TxOutZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3829 LDKC2Tuple_TxidCVec_TxOutZZ arg_conv = *(LDKC2Tuple_TxidCVec_TxOutZZ*)arg;
3831 return C2Tuple_TxidCVec_TxOutZZ_free(arg_conv);
3834 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
3835 LDKC2Tuple_u64u64Z arg_conv = *(LDKC2Tuple_u64u64Z*)arg;
3837 return C2Tuple_u64u64Z_free(arg_conv);
3840 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3841 LDKC2Tuple_usizeTransactionZ arg_conv = *(LDKC2Tuple_usizeTransactionZ*)arg;
3843 return C2Tuple_usizeTransactionZ_free(arg_conv);
3846 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3847 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arg_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)arg;
3849 return C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(arg_conv);
3852 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3853 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ arg_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg;
3855 return CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(arg_conv);
3858 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
3859 LDKC2Tuple_SignatureCVec_SignatureZZ arg_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)arg;
3861 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
3862 *ret = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(arg_conv);
3866 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3867 LDKCResult_CVec_SignatureZNoneZ arg_conv = *(LDKCResult_CVec_SignatureZNoneZ*)arg;
3869 return CResult_CVec_SignatureZNoneZ_free(arg_conv);
3872 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
3873 LDKCVec_SignatureZ arg_conv = *(LDKCVec_SignatureZ*)arg;
3875 LDKCResult_CVec_SignatureZNoneZ* ret = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
3876 *ret = CResult_CVec_SignatureZNoneZ_ok(arg_conv);
3880 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
3881 LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg;
3883 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
3884 *ret = CResult_CVec_u8ZPeerHandleErrorZ_err(arg_conv);
3888 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3889 LDKCResult_CVec_u8ZPeerHandleErrorZ arg_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg;
3891 return CResult_CVec_u8ZPeerHandleErrorZ_free(arg_conv);
3894 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
3895 LDKCVec_u8Z arg_conv = *(LDKCVec_u8Z*)arg;
3897 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
3898 *ret = CResult_CVec_u8ZPeerHandleErrorZ_ok(arg_conv);
3902 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
3903 LDKAPIError arg_conv = *(LDKAPIError*)arg;
3905 LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
3906 *ret = CResult_NoneAPIErrorZ_err(arg_conv);
3910 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3911 LDKCResult_NoneAPIErrorZ arg_conv = *(LDKCResult_NoneAPIErrorZ*)arg;
3913 return CResult_NoneAPIErrorZ_free(arg_conv);
3916 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
3917 LDKChannelMonitorUpdateErr arg_conv = *(LDKChannelMonitorUpdateErr*)arg;
3919 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
3920 *ret = CResult_NoneChannelMonitorUpdateErrZ_err(arg_conv);
3924 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3925 LDKCResult_NoneChannelMonitorUpdateErrZ arg_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)arg;
3927 return CResult_NoneChannelMonitorUpdateErrZ_free(arg_conv);
3930 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
3931 LDKMonitorUpdateError arg_conv = *(LDKMonitorUpdateError*)arg;
3933 LDKCResult_NoneMonitorUpdateErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
3934 *ret = CResult_NoneMonitorUpdateErrorZ_err(arg_conv);
3938 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3939 LDKCResult_NoneMonitorUpdateErrorZ arg_conv = *(LDKCResult_NoneMonitorUpdateErrorZ*)arg;
3941 return CResult_NoneMonitorUpdateErrorZ_free(arg_conv);
3944 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
3945 LDKPaymentSendFailure arg_conv = *(LDKPaymentSendFailure*)arg;
3947 LDKCResult_NonePaymentSendFailureZ* ret = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
3948 *ret = CResult_NonePaymentSendFailureZ_err(arg_conv);
3952 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3953 LDKCResult_NonePaymentSendFailureZ arg_conv = *(LDKCResult_NonePaymentSendFailureZ*)arg;
3955 return CResult_NonePaymentSendFailureZ_free(arg_conv);
3958 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
3959 LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg;
3961 LDKCResult_NonePeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
3962 *ret = CResult_NonePeerHandleErrorZ_err(arg_conv);
3966 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3967 LDKCResult_NonePeerHandleErrorZ arg_conv = *(LDKCResult_NonePeerHandleErrorZ*)arg;
3969 return CResult_NonePeerHandleErrorZ_free(arg_conv);
3972 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
3973 LDKSecp256k1Error arg_conv = *(LDKSecp256k1Error*)arg;
3975 LDKCResult_PublicKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ");
3976 *ret = CResult_PublicKeySecpErrorZ_err(arg_conv);
3980 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
3981 LDKCResult_PublicKeySecpErrorZ arg_conv = *(LDKCResult_PublicKeySecpErrorZ*)arg;
3983 return CResult_PublicKeySecpErrorZ_free(arg_conv);
3986 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
3987 LDKPublicKey arg_conv = *(LDKPublicKey*)arg;
3989 LDKCResult_PublicKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ");
3990 *ret = CResult_PublicKeySecpErrorZ_ok(arg_conv);
3994 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
3995 LDKLightningError arg_conv = *(LDKLightningError*)arg;
3997 LDKCResult_RouteLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
3998 *ret = CResult_RouteLightningErrorZ_err(arg_conv);
4002 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
4003 LDKCResult_RouteLightningErrorZ arg_conv = *(LDKCResult_RouteLightningErrorZ*)arg;
4005 return CResult_RouteLightningErrorZ_free(arg_conv);
4008 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
4009 LDKRoute arg_conv = *(LDKRoute*)arg;
4011 LDKCResult_RouteLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
4012 *ret = CResult_RouteLightningErrorZ_ok(arg_conv);
4016 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
4017 LDKSecp256k1Error arg_conv = *(LDKSecp256k1Error*)arg;
4019 LDKCResult_SecretKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ");
4020 *ret = CResult_SecretKeySecpErrorZ_err(arg_conv);
4024 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
4025 LDKCResult_SecretKeySecpErrorZ arg_conv = *(LDKCResult_SecretKeySecpErrorZ*)arg;
4027 return CResult_SecretKeySecpErrorZ_free(arg_conv);
4030 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
4031 LDKSecretKey arg_conv = *(LDKSecretKey*)arg;
4033 LDKCResult_SecretKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ");
4034 *ret = CResult_SecretKeySecpErrorZ_ok(arg_conv);
4038 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
4039 LDKCResult_SignatureNoneZ arg_conv = *(LDKCResult_SignatureNoneZ*)arg;
4041 return CResult_SignatureNoneZ_free(arg_conv);
4044 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
4045 LDKSignature arg_conv = *(LDKSignature*)arg;
4047 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
4048 *ret = CResult_SignatureNoneZ_ok(arg_conv);
4052 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
4053 LDKSecp256k1Error arg_conv = *(LDKSecp256k1Error*)arg;
4055 LDKCResult_TxCreationKeysSecpErrorZ* ret = MALLOC(sizeof(LDKCResult_TxCreationKeysSecpErrorZ), "LDKCResult_TxCreationKeysSecpErrorZ");
4056 *ret = CResult_TxCreationKeysSecpErrorZ_err(arg_conv);
4060 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
4061 LDKCResult_TxCreationKeysSecpErrorZ arg_conv = *(LDKCResult_TxCreationKeysSecpErrorZ*)arg;
4063 return CResult_TxCreationKeysSecpErrorZ_free(arg_conv);
4066 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
4067 LDKTxCreationKeys arg_conv = *(LDKTxCreationKeys*)arg;
4069 LDKCResult_TxCreationKeysSecpErrorZ* ret = MALLOC(sizeof(LDKCResult_TxCreationKeysSecpErrorZ), "LDKCResult_TxCreationKeysSecpErrorZ");
4070 *ret = CResult_TxCreationKeysSecpErrorZ_ok(arg_conv);
4074 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
4075 LDKAccessError arg_conv = *(LDKAccessError*)arg;
4077 LDKCResult_TxOutAccessErrorZ* ret = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
4078 *ret = CResult_TxOutAccessErrorZ_err(arg_conv);
4082 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
4083 LDKCResult_TxOutAccessErrorZ arg_conv = *(LDKCResult_TxOutAccessErrorZ*)arg;
4085 return CResult_TxOutAccessErrorZ_free(arg_conv);
4088 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
4089 LDKTxOut arg_conv = *(LDKTxOut*)arg;
4091 LDKCResult_TxOutAccessErrorZ* ret = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
4092 *ret = CResult_TxOutAccessErrorZ_ok(arg_conv);
4096 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
4097 LDKLightningError arg_conv = *(LDKLightningError*)arg;
4099 LDKCResult_boolLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
4100 *ret = CResult_boolLightningErrorZ_err(arg_conv);
4104 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
4105 LDKCResult_boolLightningErrorZ arg_conv = *(LDKCResult_boolLightningErrorZ*)arg;
4107 return CResult_boolLightningErrorZ_free(arg_conv);
4110 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1ok(JNIEnv * _env, jclass _b, jboolean arg) {
4111 LDKCResult_boolLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
4112 *ret = CResult_boolLightningErrorZ_ok(arg);
4116 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
4117 LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg;
4119 LDKCResult_boolPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
4120 *ret = CResult_boolPeerHandleErrorZ_err(arg_conv);
4124 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
4125 LDKCResult_boolPeerHandleErrorZ arg_conv = *(LDKCResult_boolPeerHandleErrorZ*)arg;
4127 return CResult_boolPeerHandleErrorZ_free(arg_conv);
4130 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b, jboolean arg) {
4131 LDKCResult_boolPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
4132 *ret = CResult_boolPeerHandleErrorZ_ok(arg);
4136 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1HTLCOutputInCommitmentSignatureZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
4137 LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ arg_conv = *(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ*)arg;
4139 return CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ_free(arg_conv);
4142 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1TxOutZZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
4143 LDKCVec_C2Tuple_TxidCVec_TxOutZZZ arg_conv = *(LDKCVec_C2Tuple_TxidCVec_TxOutZZZ*)arg;
4145 return CVec_C2Tuple_TxidCVec_TxOutZZZ_free(arg_conv);
4148 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1usizeTransactionZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
4149 LDKCVec_C2Tuple_usizeTransactionZZ arg_conv = *(LDKCVec_C2Tuple_usizeTransactionZZ*)arg;
4151 return CVec_C2Tuple_usizeTransactionZZ_free(arg_conv);
4154 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
4155 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ arg_conv = *(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)arg;
4157 return CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(arg_conv);
4160 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1RouteHopZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
4161 LDKCVec_CVec_RouteHopZZ arg_conv = *(LDKCVec_CVec_RouteHopZZ*)arg;
4163 return CVec_CVec_RouteHopZZ_free(arg_conv);
4166 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
4167 LDKCVec_ChannelDetailsZ arg_conv = *(LDKCVec_ChannelDetailsZ*)arg;
4169 return CVec_ChannelDetailsZ_free(arg_conv);
4172 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelMonitorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
4173 LDKCVec_ChannelMonitorZ arg_conv = *(LDKCVec_ChannelMonitorZ*)arg;
4175 return CVec_ChannelMonitorZ_free(arg_conv);
4178 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1EventZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
4179 LDKCVec_EventZ arg_conv = *(LDKCVec_EventZ*)arg;
4181 return CVec_EventZ_free(arg_conv);
4184 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1HTLCOutputInCommitmentZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
4185 LDKCVec_HTLCOutputInCommitmentZ arg_conv = *(LDKCVec_HTLCOutputInCommitmentZ*)arg;
4187 return CVec_HTLCOutputInCommitmentZ_free(arg_conv);
4190 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MessageSendEventZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
4191 LDKCVec_MessageSendEventZ arg_conv = *(LDKCVec_MessageSendEventZ*)arg;
4193 return CVec_MessageSendEventZ_free(arg_conv);
4196 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorEventZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
4197 LDKCVec_MonitorEventZ arg_conv = *(LDKCVec_MonitorEventZ*)arg;
4199 return CVec_MonitorEventZ_free(arg_conv);
4202 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NetAddressZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
4203 LDKCVec_NetAddressZ arg_conv = *(LDKCVec_NetAddressZ*)arg;
4205 return CVec_NetAddressZ_free(arg_conv);
4208 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NodeAnnouncementZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
4209 LDKCVec_NodeAnnouncementZ arg_conv = *(LDKCVec_NodeAnnouncementZ*)arg;
4211 return CVec_NodeAnnouncementZ_free(arg_conv);
4214 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PublicKeyZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
4215 LDKCVec_PublicKeyZ arg_conv = *(LDKCVec_PublicKeyZ*)arg;
4217 return CVec_PublicKeyZ_free(arg_conv);
4220 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
4221 LDKCVec_RouteHintZ arg_conv = *(LDKCVec_RouteHintZ*)arg;
4223 return CVec_RouteHintZ_free(arg_conv);
4226 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHopZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
4227 LDKCVec_RouteHopZ arg_conv = *(LDKCVec_RouteHopZ*)arg;
4229 return CVec_RouteHopZ_free(arg_conv);
4232 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SignatureZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
4233 LDKCVec_SignatureZ arg_conv = *(LDKCVec_SignatureZ*)arg;
4235 return CVec_SignatureZ_free(arg_conv);
4238 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SpendableOutputDescriptorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
4239 LDKCVec_SpendableOutputDescriptorZ arg_conv = *(LDKCVec_SpendableOutputDescriptorZ*)arg;
4241 return CVec_SpendableOutputDescriptorZ_free(arg_conv);
4244 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
4245 LDKCVec_TransactionZ arg_conv = *(LDKCVec_TransactionZ*)arg;
4247 return CVec_TransactionZ_free(arg_conv);
4250 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TxOutZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
4251 LDKCVec_TxOutZ arg_conv = *(LDKCVec_TxOutZ*)arg;
4253 return CVec_TxOutZ_free(arg_conv);
4256 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateAddHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
4257 LDKCVec_UpdateAddHTLCZ arg_conv = *(LDKCVec_UpdateAddHTLCZ*)arg;
4259 return CVec_UpdateAddHTLCZ_free(arg_conv);
4262 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
4263 LDKCVec_UpdateFailHTLCZ arg_conv = *(LDKCVec_UpdateFailHTLCZ*)arg;
4265 return CVec_UpdateFailHTLCZ_free(arg_conv);
4268 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailMalformedHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
4269 LDKCVec_UpdateFailMalformedHTLCZ arg_conv = *(LDKCVec_UpdateFailMalformedHTLCZ*)arg;
4271 return CVec_UpdateFailMalformedHTLCZ_free(arg_conv);
4274 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFulfillHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
4275 LDKCVec_UpdateFulfillHTLCZ arg_conv = *(LDKCVec_UpdateFulfillHTLCZ*)arg;
4277 return CVec_UpdateFulfillHTLCZ_free(arg_conv);
4280 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u64Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
4281 LDKCVec_u64Z arg_conv = *(LDKCVec_u64Z*)arg;
4283 return CVec_u64Z_free(arg_conv);
4286 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u8Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
4287 LDKCVec_u8Z arg_conv = *(LDKCVec_u8Z*)arg;
4289 return CVec_u8Z_free(arg_conv);
4292 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Transaction_1free(JNIEnv * _env, jclass _b, jlong _res) {
4293 LDKTransaction _res_conv = *(LDKTransaction*)_res;
4295 return Transaction_free(_res_conv);
4298 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_1free(JNIEnv * _env, jclass _b, jlong _res) {
4299 LDKTxOut _res_conv = *(LDKTxOut*)_res;
4301 return TxOut_free(_res_conv);
4304 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
4305 LDKTransaction b_conv = *(LDKTransaction*)b;
4307 LDKC2Tuple_usizeTransactionZ* ret = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
4308 *ret = C2Tuple_usizeTransactionZ_new(a, b_conv);
4312 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1ok(JNIEnv * _env, jclass _b) {
4313 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
4314 *ret = CResult_NoneChannelMonitorUpdateErrZ_ok();
4318 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1ok(JNIEnv * _env, jclass _b) {
4319 LDKCResult_NoneMonitorUpdateErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
4320 *ret = CResult_NoneMonitorUpdateErrorZ_ok();
4324 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
4325 LDKOutPoint a_conv = *(LDKOutPoint*)a;
4327 a_conv.is_owned = true;
4328 LDKCVec_u8Z b_conv = *(LDKCVec_u8Z*)b;
4330 LDKC2Tuple_OutPointScriptZ* ret = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
4331 *ret = C2Tuple_OutPointScriptZ_new(a_conv, b_conv);
4335 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1TxOutZZ_1new(JNIEnv * _env, jclass _b, jbyteArray a, jlong b) {
4336 LDKThirtyTwoBytes a_ref;
4337 (*_env)->GetByteArrayRegion (_env, a, 0, 32, a_ref.data);
4338 LDKCVec_TxOutZ b_conv = *(LDKCVec_TxOutZ*)b;
4340 LDKC2Tuple_TxidCVec_TxOutZZ* ret = MALLOC(sizeof(LDKC2Tuple_TxidCVec_TxOutZZ), "LDKC2Tuple_TxidCVec_TxOutZZ");
4341 *ret = C2Tuple_TxidCVec_TxOutZZ_new(a_ref, b_conv);
4345 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
4346 LDKC2Tuple_u64u64Z* ret = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
4347 *ret = C2Tuple_u64u64Z_new(a, b);
4351 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
4352 LDKSignature a_conv = *(LDKSignature*)a;
4354 LDKCVec_SignatureZ b_conv = *(LDKCVec_SignatureZ*)b;
4356 LDKC2Tuple_SignatureCVec_SignatureZZ* ret = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
4357 *ret = C2Tuple_SignatureCVec_SignatureZZ_new(a_conv, b_conv);
4361 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1err(JNIEnv * _env, jclass _b) {
4362 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
4363 *ret = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err();
4367 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1err(JNIEnv * _env, jclass _b) {
4368 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
4369 *ret = CResult_SignatureNoneZ_err();
4373 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1err(JNIEnv * _env, jclass _b) {
4374 LDKCResult_CVec_SignatureZNoneZ* ret = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
4375 *ret = CResult_CVec_SignatureZNoneZ_err();
4379 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1ok(JNIEnv * _env, jclass _b) {
4380 LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
4381 *ret = CResult_NoneAPIErrorZ_ok();
4385 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1ok(JNIEnv * _env, jclass _b) {
4386 LDKCResult_NonePaymentSendFailureZ* ret = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
4387 *ret = CResult_NonePaymentSendFailureZ_ok();
4391 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b, jlong c) {
4392 LDKChannelAnnouncement a_conv = *(LDKChannelAnnouncement*)a;
4394 a_conv.is_owned = true;
4395 LDKChannelUpdate b_conv = *(LDKChannelUpdate*)b;
4397 b_conv.is_owned = true;
4398 LDKChannelUpdate c_conv = *(LDKChannelUpdate*)c;
4400 c_conv.is_owned = true;
4401 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
4402 *ret = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a_conv, b_conv, c_conv);
4406 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b) {
4407 LDKCResult_NonePeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
4408 *ret = CResult_NonePeerHandleErrorZ_ok();
4412 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HTLCOutputInCommitmentSignatureZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
4413 LDKHTLCOutputInCommitment a_conv = *(LDKHTLCOutputInCommitment*)a;
4415 a_conv.is_owned = true;
4416 LDKSignature b_conv = *(LDKSignature*)b;
4418 LDKC2Tuple_HTLCOutputInCommitmentSignatureZ* ret = MALLOC(sizeof(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ), "LDKC2Tuple_HTLCOutputInCommitmentSignatureZ");
4419 *ret = C2Tuple_HTLCOutputInCommitmentSignatureZ_new(a_conv, b_conv);
4423 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4424 LDKEvent this_ptr_conv = *(LDKEvent*)this_ptr;
4425 FREE((void*)this_ptr);
4426 return Event_free(this_ptr_conv);
4429 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4430 LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)this_ptr;
4431 FREE((void*)this_ptr);
4432 return MessageSendEvent_free(this_ptr_conv);
4435 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4436 LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)this_ptr;
4437 FREE((void*)this_ptr);
4438 return MessageSendEventsProvider_free(this_ptr_conv);
4441 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4442 LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)this_ptr;
4443 FREE((void*)this_ptr);
4444 return EventsProvider_free(this_ptr_conv);
4447 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_APIError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4448 LDKAPIError this_ptr_conv = *(LDKAPIError*)this_ptr;
4449 FREE((void*)this_ptr);
4450 return APIError_free(this_ptr_conv);
4453 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1max(JNIEnv * _env, jclass _b) {
4454 jclass ret = LDKLevel_to_java(_env, Level_max());
4458 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Logger_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4459 LDKLogger this_ptr_conv = *(LDKLogger*)this_ptr;
4460 FREE((void*)this_ptr);
4461 return Logger_free(this_ptr_conv);
4464 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4465 LDKChannelHandshakeConfig this_ptr_conv = *(LDKChannelHandshakeConfig*)this_ptr;
4466 FREE((void*)this_ptr);
4467 this_ptr_conv.is_owned = true;
4468 return ChannelHandshakeConfig_free(this_ptr_conv);
4471 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr) {
4472 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
4473 return ChannelHandshakeConfig_get_minimum_depth(this_ptr_conv);
4476 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
4477 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
4478 return ChannelHandshakeConfig_set_minimum_depth(this_ptr_conv, val);
4481 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
4482 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
4483 return ChannelHandshakeConfig_get_our_to_self_delay(this_ptr_conv);
4486 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
4487 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
4488 return ChannelHandshakeConfig_set_our_to_self_delay(this_ptr_conv, val);
4491 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
4492 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
4493 return ChannelHandshakeConfig_get_our_htlc_minimum_msat(this_ptr_conv);
4496 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4497 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
4498 return ChannelHandshakeConfig_set_our_htlc_minimum_msat(this_ptr_conv, val);
4501 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) {
4502 LDKChannelHandshakeConfig* ret = MALLOC(sizeof(LDKChannelHandshakeConfig), "LDKChannelHandshakeConfig");
4503 *ret = ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg);
4504 DO_ASSERT(ret->is_owned);
4505 ret->is_owned = false;
4509 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1default(JNIEnv * _env, jclass _b) {
4510 LDKChannelHandshakeConfig* ret = MALLOC(sizeof(LDKChannelHandshakeConfig), "LDKChannelHandshakeConfig");
4511 *ret = ChannelHandshakeConfig_default();
4512 DO_ASSERT(ret->is_owned);
4513 ret->is_owned = false;
4517 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4518 LDKChannelHandshakeLimits this_ptr_conv = *(LDKChannelHandshakeLimits*)this_ptr;
4519 FREE((void*)this_ptr);
4520 this_ptr_conv.is_owned = true;
4521 return ChannelHandshakeLimits_free(this_ptr_conv);
4524 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
4525 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
4526 return ChannelHandshakeLimits_get_min_funding_satoshis(this_ptr_conv);
4529 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4530 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
4531 return ChannelHandshakeLimits_set_min_funding_satoshis(this_ptr_conv, val);
4534 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
4535 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
4536 return ChannelHandshakeLimits_get_max_htlc_minimum_msat(this_ptr_conv);
4539 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4540 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
4541 return ChannelHandshakeLimits_set_max_htlc_minimum_msat(this_ptr_conv, val);
4544 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
4545 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
4546 return ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(this_ptr_conv);
4549 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) {
4550 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
4551 return ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(this_ptr_conv, val);
4554 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
4555 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
4556 return ChannelHandshakeLimits_get_max_channel_reserve_satoshis(this_ptr_conv);
4559 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4560 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
4561 return ChannelHandshakeLimits_set_max_channel_reserve_satoshis(this_ptr_conv, val);
4564 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr) {
4565 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
4566 return ChannelHandshakeLimits_get_min_max_accepted_htlcs(this_ptr_conv);
4569 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
4570 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
4571 return ChannelHandshakeLimits_set_min_max_accepted_htlcs(this_ptr_conv, val);
4574 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
4575 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
4576 return ChannelHandshakeLimits_get_min_dust_limit_satoshis(this_ptr_conv);
4579 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4580 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
4581 return ChannelHandshakeLimits_set_min_dust_limit_satoshis(this_ptr_conv, val);
4584 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
4585 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
4586 return ChannelHandshakeLimits_get_max_dust_limit_satoshis(this_ptr_conv);
4589 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4590 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
4591 return ChannelHandshakeLimits_set_max_dust_limit_satoshis(this_ptr_conv, val);
4594 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr) {
4595 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
4596 return ChannelHandshakeLimits_get_max_minimum_depth(this_ptr_conv);
4599 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
4600 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
4601 return ChannelHandshakeLimits_set_max_minimum_depth(this_ptr_conv, val);
4604 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1force_1announced_1channel_1preference(JNIEnv * _env, jclass _b, jlong this_ptr) {
4605 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
4606 return ChannelHandshakeLimits_get_force_announced_channel_preference(this_ptr_conv);
4609 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1force_1announced_1channel_1preference(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
4610 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
4611 return ChannelHandshakeLimits_set_force_announced_channel_preference(this_ptr_conv, val);
4614 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1their_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
4615 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
4616 return ChannelHandshakeLimits_get_their_to_self_delay(this_ptr_conv);
4619 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1their_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
4620 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
4621 return ChannelHandshakeLimits_set_their_to_self_delay(this_ptr_conv, val);
4624 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) {
4625 LDKChannelHandshakeLimits* ret = MALLOC(sizeof(LDKChannelHandshakeLimits), "LDKChannelHandshakeLimits");
4626 *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);
4627 DO_ASSERT(ret->is_owned);
4628 ret->is_owned = false;
4632 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1default(JNIEnv * _env, jclass _b) {
4633 LDKChannelHandshakeLimits* ret = MALLOC(sizeof(LDKChannelHandshakeLimits), "LDKChannelHandshakeLimits");
4634 *ret = ChannelHandshakeLimits_default();
4635 DO_ASSERT(ret->is_owned);
4636 ret->is_owned = false;
4640 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4641 LDKChannelConfig this_ptr_conv = *(LDKChannelConfig*)this_ptr;
4642 FREE((void*)this_ptr);
4643 this_ptr_conv.is_owned = true;
4644 return ChannelConfig_free(this_ptr_conv);
4647 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr) {
4648 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
4649 return ChannelConfig_get_fee_proportional_millionths(this_ptr_conv);
4652 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
4653 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
4654 return ChannelConfig_set_fee_proportional_millionths(this_ptr_conv, val);
4657 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1announced_1channel(JNIEnv * _env, jclass _b, jlong this_ptr) {
4658 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
4659 return ChannelConfig_get_announced_channel(this_ptr_conv);
4662 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1announced_1channel(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
4663 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
4664 return ChannelConfig_set_announced_channel(this_ptr_conv, val);
4667 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1commit_1upfront_1shutdown_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
4668 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
4669 return ChannelConfig_get_commit_upfront_shutdown_pubkey(this_ptr_conv);
4672 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1commit_1upfront_1shutdown_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
4673 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
4674 return ChannelConfig_set_commit_upfront_shutdown_pubkey(this_ptr_conv, val);
4677 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) {
4678 LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
4679 *ret = ChannelConfig_new(fee_proportional_millionths_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg);
4680 DO_ASSERT(ret->is_owned);
4681 ret->is_owned = false;
4685 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1default(JNIEnv * _env, jclass _b) {
4686 LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
4687 *ret = ChannelConfig_default();
4688 DO_ASSERT(ret->is_owned);
4689 ret->is_owned = false;
4693 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1write(JNIEnv * _env, jclass _b, jlong obj) {
4694 LDKChannelConfig* obj_conv = (LDKChannelConfig*)obj;
4695 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
4696 *ret = ChannelConfig_write(obj_conv);
4700 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1read(JNIEnv * _env, jclass _b, jlong ser) {
4701 LDKu8slice ser_conv = *(LDKu8slice*)ser;
4702 LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
4703 *ret = ChannelConfig_read(ser_conv);
4704 DO_ASSERT(ret->is_owned);
4705 ret->is_owned = false;
4709 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4710 LDKUserConfig this_ptr_conv = *(LDKUserConfig*)this_ptr;
4711 FREE((void*)this_ptr);
4712 this_ptr_conv.is_owned = true;
4713 return UserConfig_free(this_ptr_conv);
4716 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1own_1channel_1config(JNIEnv * _env, jclass _b, jlong this_ptr) {
4717 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
4718 LDKChannelHandshakeConfig* ret = MALLOC(sizeof(LDKChannelHandshakeConfig), "LDKChannelHandshakeConfig");
4719 *ret = UserConfig_get_own_channel_config(this_ptr_conv);
4720 DO_ASSERT(ret->is_owned);
4721 ret->is_owned = false;
4725 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1own_1channel_1config(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4726 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
4727 LDKChannelHandshakeConfig val_conv = *(LDKChannelHandshakeConfig*)val;
4729 val_conv.is_owned = true;
4730 return UserConfig_set_own_channel_config(this_ptr_conv, val_conv);
4733 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1peer_1channel_1config_1limits(JNIEnv * _env, jclass _b, jlong this_ptr) {
4734 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
4735 LDKChannelHandshakeLimits* ret = MALLOC(sizeof(LDKChannelHandshakeLimits), "LDKChannelHandshakeLimits");
4736 *ret = UserConfig_get_peer_channel_config_limits(this_ptr_conv);
4737 DO_ASSERT(ret->is_owned);
4738 ret->is_owned = false;
4742 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1peer_1channel_1config_1limits(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4743 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
4744 LDKChannelHandshakeLimits val_conv = *(LDKChannelHandshakeLimits*)val;
4746 val_conv.is_owned = true;
4747 return UserConfig_set_peer_channel_config_limits(this_ptr_conv, val_conv);
4750 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1channel_1options(JNIEnv * _env, jclass _b, jlong this_ptr) {
4751 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
4752 LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
4753 *ret = UserConfig_get_channel_options(this_ptr_conv);
4754 DO_ASSERT(ret->is_owned);
4755 ret->is_owned = false;
4759 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1channel_1options(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4760 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
4761 LDKChannelConfig val_conv = *(LDKChannelConfig*)val;
4763 val_conv.is_owned = true;
4764 return UserConfig_set_channel_options(this_ptr_conv, val_conv);
4767 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) {
4768 LDKChannelHandshakeConfig own_channel_config_arg_conv = *(LDKChannelHandshakeConfig*)own_channel_config_arg;
4769 FREE((void*)own_channel_config_arg);
4770 own_channel_config_arg_conv.is_owned = true;
4771 LDKChannelHandshakeLimits peer_channel_config_limits_arg_conv = *(LDKChannelHandshakeLimits*)peer_channel_config_limits_arg;
4772 FREE((void*)peer_channel_config_limits_arg);
4773 peer_channel_config_limits_arg_conv.is_owned = true;
4774 LDKChannelConfig channel_options_arg_conv = *(LDKChannelConfig*)channel_options_arg;
4775 FREE((void*)channel_options_arg);
4776 channel_options_arg_conv.is_owned = true;
4777 LDKUserConfig* ret = MALLOC(sizeof(LDKUserConfig), "LDKUserConfig");
4778 *ret = UserConfig_new(own_channel_config_arg_conv, peer_channel_config_limits_arg_conv, channel_options_arg_conv);
4779 DO_ASSERT(ret->is_owned);
4780 ret->is_owned = false;
4784 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1default(JNIEnv * _env, jclass _b) {
4785 LDKUserConfig* ret = MALLOC(sizeof(LDKUserConfig), "LDKUserConfig");
4786 *ret = UserConfig_default();
4787 DO_ASSERT(ret->is_owned);
4788 ret->is_owned = false;
4792 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Access_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4793 LDKAccess this_ptr_conv = *(LDKAccess*)this_ptr;
4794 FREE((void*)this_ptr);
4795 return Access_free(this_ptr_conv);
4798 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Watch_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4799 LDKWatch this_ptr_conv = *(LDKWatch*)this_ptr;
4800 FREE((void*)this_ptr);
4801 return Watch_free(this_ptr_conv);
4804 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4805 LDKFilter this_ptr_conv = *(LDKFilter*)this_ptr;
4806 FREE((void*)this_ptr);
4807 return Filter_free(this_ptr_conv);
4810 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4811 LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)this_ptr;
4812 FREE((void*)this_ptr);
4813 return BroadcasterInterface_free(this_ptr_conv);
4816 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4817 LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)this_ptr;
4818 FREE((void*)this_ptr);
4819 return FeeEstimator_free(this_ptr_conv);
4822 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4823 LDKChainMonitor this_ptr_conv = *(LDKChainMonitor*)this_ptr;
4824 FREE((void*)this_ptr);
4825 this_ptr_conv.is_owned = true;
4826 return ChainMonitor_free(this_ptr_conv);
4829 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1block_1connected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jlong txdata, jint height) {
4830 LDKChainMonitor* this_arg_conv = (LDKChainMonitor*)this_arg;
4831 unsigned char header_arr[80];
4832 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
4833 unsigned char (*header_ref)[80] = &header_arr;
4834 LDKCVec_C2Tuple_usizeTransactionZZ txdata_conv = *(LDKCVec_C2Tuple_usizeTransactionZZ*)txdata;
4835 FREE((void*)txdata);
4836 return ChainMonitor_block_connected(this_arg_conv, header_ref, txdata_conv, height);
4839 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1block_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jint disconnected_height) {
4840 LDKChainMonitor* this_arg_conv = (LDKChainMonitor*)this_arg;
4841 unsigned char header_arr[80];
4842 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
4843 unsigned char (*header_ref)[80] = &header_arr;
4844 return ChainMonitor_block_disconnected(this_arg_conv, header_ref, disconnected_height);
4847 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1new(JNIEnv * _env, jclass _b, jlong chain_source, jlong broadcaster, jlong logger, jlong feeest) {
4848 LDKFilter* chain_source_conv = (LDKFilter*)chain_source;
4849 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)broadcaster;
4850 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
4851 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
4852 LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
4854 LDKLogger logger_conv = *(LDKLogger*)logger;
4855 if (logger_conv.free == LDKLogger_JCalls_free) {
4856 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
4857 LDKLogger_JCalls_clone(logger_conv.this_arg);
4859 LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)feeest;
4860 if (feeest_conv.free == LDKFeeEstimator_JCalls_free) {
4861 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
4862 LDKFeeEstimator_JCalls_clone(feeest_conv.this_arg);
4864 LDKChainMonitor* ret = MALLOC(sizeof(LDKChainMonitor), "LDKChainMonitor");
4865 *ret = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv);
4866 DO_ASSERT(ret->is_owned);
4867 ret->is_owned = false;
4871 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Watch(JNIEnv * _env, jclass _b, jlong this_arg) {
4872 LDKChainMonitor* this_arg_conv = (LDKChainMonitor*)this_arg;
4873 LDKWatch* ret = MALLOC(sizeof(LDKWatch), "LDKWatch");
4874 *ret = ChainMonitor_as_Watch(this_arg_conv);
4878 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1EventsProvider(JNIEnv * _env, jclass _b, jlong this_arg) {
4879 LDKChainMonitor* this_arg_conv = (LDKChainMonitor*)this_arg;
4880 LDKEventsProvider* ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
4881 *ret = ChainMonitor_as_EventsProvider(this_arg_conv);
4885 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4886 LDKChannelMonitorUpdate this_ptr_conv = *(LDKChannelMonitorUpdate*)this_ptr;
4887 FREE((void*)this_ptr);
4888 this_ptr_conv.is_owned = true;
4889 return ChannelMonitorUpdate_free(this_ptr_conv);
4892 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1get_1update_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4893 LDKChannelMonitorUpdate* this_ptr_conv = (LDKChannelMonitorUpdate*)this_ptr;
4894 return ChannelMonitorUpdate_get_update_id(this_ptr_conv);
4897 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1set_1update_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4898 LDKChannelMonitorUpdate* this_ptr_conv = (LDKChannelMonitorUpdate*)this_ptr;
4899 return ChannelMonitorUpdate_set_update_id(this_ptr_conv, val);
4902 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
4903 LDKChannelMonitorUpdate* obj_conv = (LDKChannelMonitorUpdate*)obj;
4904 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
4905 *ret = ChannelMonitorUpdate_write(obj_conv);
4909 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
4910 LDKu8slice ser_conv = *(LDKu8slice*)ser;
4911 LDKChannelMonitorUpdate* ret = MALLOC(sizeof(LDKChannelMonitorUpdate), "LDKChannelMonitorUpdate");
4912 *ret = ChannelMonitorUpdate_read(ser_conv);
4913 DO_ASSERT(ret->is_owned);
4914 ret->is_owned = false;
4918 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4919 LDKMonitorUpdateError this_ptr_conv = *(LDKMonitorUpdateError*)this_ptr;
4920 FREE((void*)this_ptr);
4921 this_ptr_conv.is_owned = true;
4922 return MonitorUpdateError_free(this_ptr_conv);
4925 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4926 LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)this_ptr;
4927 FREE((void*)this_ptr);
4928 this_ptr_conv.is_owned = true;
4929 return MonitorEvent_free(this_ptr_conv);
4932 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4933 LDKHTLCUpdate this_ptr_conv = *(LDKHTLCUpdate*)this_ptr;
4934 FREE((void*)this_ptr);
4935 this_ptr_conv.is_owned = true;
4936 return HTLCUpdate_free(this_ptr_conv);
4939 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
4940 LDKHTLCUpdate* obj_conv = (LDKHTLCUpdate*)obj;
4941 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
4942 *ret = HTLCUpdate_write(obj_conv);
4946 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
4947 LDKu8slice ser_conv = *(LDKu8slice*)ser;
4948 LDKHTLCUpdate* ret = MALLOC(sizeof(LDKHTLCUpdate), "LDKHTLCUpdate");
4949 *ret = HTLCUpdate_read(ser_conv);
4950 DO_ASSERT(ret->is_owned);
4951 ret->is_owned = false;
4955 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4956 LDKChannelMonitor this_ptr_conv = *(LDKChannelMonitor*)this_ptr;
4957 FREE((void*)this_ptr);
4958 this_ptr_conv.is_owned = true;
4959 return ChannelMonitor_free(this_ptr_conv);
4962 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1update_1monitor(JNIEnv * _env, jclass _b, jlong this_arg, jlong updates, jlong broadcaster, jlong logger) {
4963 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
4964 LDKChannelMonitorUpdate updates_conv = *(LDKChannelMonitorUpdate*)updates;
4965 FREE((void*)updates);
4966 updates_conv.is_owned = true;
4967 LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster;
4968 LDKLogger* logger_conv = (LDKLogger*)logger;
4969 LDKCResult_NoneMonitorUpdateErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
4970 *ret = ChannelMonitor_update_monitor(this_arg_conv, updates_conv, broadcaster_conv, logger_conv);
4974 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1update_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
4975 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
4976 return ChannelMonitor_get_latest_update_id(this_arg_conv);
4979 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1funding_1txo(JNIEnv * _env, jclass _b, jlong this_arg) {
4980 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
4981 LDKC2Tuple_OutPointScriptZ* ret = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
4982 *ret = ChannelMonitor_get_funding_txo(this_arg_conv);
4986 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1monitor_1events(JNIEnv * _env, jclass _b, jlong this_arg) {
4987 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
4988 LDKCVec_MonitorEventZ* ret = MALLOC(sizeof(LDKCVec_MonitorEventZ), "LDKCVec_MonitorEventZ");
4989 *ret = ChannelMonitor_get_and_clear_pending_monitor_events(this_arg_conv);
4993 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1events(JNIEnv * _env, jclass _b, jlong this_arg) {
4994 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
4995 LDKCVec_EventZ* ret = MALLOC(sizeof(LDKCVec_EventZ), "LDKCVec_EventZ");
4996 *ret = ChannelMonitor_get_and_clear_pending_events(this_arg_conv);
5000 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1holder_1commitment_1txn(JNIEnv * _env, jclass _b, jlong this_arg, jlong logger) {
5001 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
5002 LDKLogger* logger_conv = (LDKLogger*)logger;
5003 LDKCVec_TransactionZ* ret = MALLOC(sizeof(LDKCVec_TransactionZ), "LDKCVec_TransactionZ");
5004 *ret = ChannelMonitor_get_latest_holder_commitment_txn(this_arg_conv, logger_conv);
5008 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) {
5009 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
5010 unsigned char header_arr[80];
5011 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
5012 unsigned char (*header_ref)[80] = &header_arr;
5013 LDKCVec_C2Tuple_usizeTransactionZZ txdata_conv = *(LDKCVec_C2Tuple_usizeTransactionZZ*)txdata;
5014 FREE((void*)txdata);
5015 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)broadcaster;
5016 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
5017 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
5018 LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
5020 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)fee_estimator;
5021 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
5022 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
5023 LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
5025 LDKLogger logger_conv = *(LDKLogger*)logger;
5026 if (logger_conv.free == LDKLogger_JCalls_free) {
5027 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
5028 LDKLogger_JCalls_clone(logger_conv.this_arg);
5030 LDKCVec_C2Tuple_TxidCVec_TxOutZZZ* ret = MALLOC(sizeof(LDKCVec_C2Tuple_TxidCVec_TxOutZZZ), "LDKCVec_C2Tuple_TxidCVec_TxOutZZZ");
5031 *ret = ChannelMonitor_block_connected(this_arg_conv, header_ref, txdata_conv, height, broadcaster_conv, fee_estimator_conv, logger_conv);
5035 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) {
5036 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
5037 unsigned char header_arr[80];
5038 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
5039 unsigned char (*header_ref)[80] = &header_arr;
5040 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)broadcaster;
5041 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
5042 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
5043 LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
5045 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)fee_estimator;
5046 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
5047 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
5048 LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
5050 LDKLogger logger_conv = *(LDKLogger*)logger;
5051 if (logger_conv.free == LDKLogger_JCalls_free) {
5052 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
5053 LDKLogger_JCalls_clone(logger_conv.this_arg);
5055 return ChannelMonitor_block_disconnected(this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
5058 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5059 LDKOutPoint this_ptr_conv = *(LDKOutPoint*)this_ptr;
5060 FREE((void*)this_ptr);
5061 this_ptr_conv.is_owned = true;
5062 return OutPoint_free(this_ptr_conv);
5065 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1txid(JNIEnv * _env, jclass _b, jlong this_ptr) {
5066 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
5067 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5068 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OutPoint_get_txid(this_ptr_conv));
5072 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1txid(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
5073 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
5074 LDKThirtyTwoBytes val_ref;
5075 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
5076 return OutPoint_set_txid(this_ptr_conv, val_ref);
5079 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1index(JNIEnv * _env, jclass _b, jlong this_ptr) {
5080 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
5081 return OutPoint_get_index(this_ptr_conv);
5084 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1index(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
5085 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
5086 return OutPoint_set_index(this_ptr_conv, val);
5089 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1new(JNIEnv * _env, jclass _b, jbyteArray txid_arg, jshort index_arg) {
5090 LDKThirtyTwoBytes txid_arg_ref;
5091 (*_env)->GetByteArrayRegion (_env, txid_arg, 0, 32, txid_arg_ref.data);
5092 LDKOutPoint* ret = MALLOC(sizeof(LDKOutPoint), "LDKOutPoint");
5093 *ret = OutPoint_new(txid_arg_ref, index_arg);
5094 DO_ASSERT(ret->is_owned);
5095 ret->is_owned = false;
5099 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1to_1channel_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
5100 LDKOutPoint* this_arg_conv = (LDKOutPoint*)this_arg;
5101 jbyteArray _arr = (*_env)->NewByteArray(_env, 32);
5102 (*_env)->SetByteArrayRegion(_env, _arr, 0, 32, OutPoint_to_channel_id(this_arg_conv).data);
5106 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1write(JNIEnv * _env, jclass _b, jlong obj) {
5107 LDKOutPoint* obj_conv = (LDKOutPoint*)obj;
5108 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5109 *ret = OutPoint_write(obj_conv);
5113 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1read(JNIEnv * _env, jclass _b, jlong ser) {
5114 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5115 LDKOutPoint* ret = MALLOC(sizeof(LDKOutPoint), "LDKOutPoint");
5116 *ret = OutPoint_read(ser_conv);
5117 DO_ASSERT(ret->is_owned);
5118 ret->is_owned = false;
5122 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5123 LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)this_ptr;
5124 FREE((void*)this_ptr);
5125 return SpendableOutputDescriptor_free(this_ptr_conv);
5128 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5129 LDKChannelKeys this_ptr_conv = *(LDKChannelKeys*)this_ptr;
5130 FREE((void*)this_ptr);
5131 return ChannelKeys_free(this_ptr_conv);
5134 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysInterface_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5135 LDKKeysInterface this_ptr_conv = *(LDKKeysInterface*)this_ptr;
5136 FREE((void*)this_ptr);
5137 return KeysInterface_free(this_ptr_conv);
5140 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5141 LDKInMemoryChannelKeys this_ptr_conv = *(LDKInMemoryChannelKeys*)this_ptr;
5142 FREE((void*)this_ptr);
5143 this_ptr_conv.is_owned = true;
5144 return InMemoryChannelKeys_free(this_ptr_conv);
5147 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1funding_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
5148 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
5149 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5150 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_funding_key(this_ptr_conv));
5154 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1funding_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5155 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
5156 LDKSecretKey val_conv = *(LDKSecretKey*)val;
5158 return InMemoryChannelKeys_set_funding_key(this_ptr_conv, val_conv);
5161 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1revocation_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
5162 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
5163 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5164 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_revocation_base_key(this_ptr_conv));
5168 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1revocation_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5169 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
5170 LDKSecretKey val_conv = *(LDKSecretKey*)val;
5172 return InMemoryChannelKeys_set_revocation_base_key(this_ptr_conv, val_conv);
5175 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
5176 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
5177 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5178 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_payment_key(this_ptr_conv));
5182 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5183 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
5184 LDKSecretKey val_conv = *(LDKSecretKey*)val;
5186 return InMemoryChannelKeys_set_payment_key(this_ptr_conv, val_conv);
5189 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1delayed_1payment_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
5190 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
5191 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5192 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_delayed_payment_base_key(this_ptr_conv));
5196 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1delayed_1payment_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5197 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
5198 LDKSecretKey val_conv = *(LDKSecretKey*)val;
5200 return InMemoryChannelKeys_set_delayed_payment_base_key(this_ptr_conv, val_conv);
5203 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1htlc_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
5204 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
5205 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5206 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_htlc_base_key(this_ptr_conv));
5210 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1htlc_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5211 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
5212 LDKSecretKey val_conv = *(LDKSecretKey*)val;
5214 return InMemoryChannelKeys_set_htlc_base_key(this_ptr_conv, val_conv);
5217 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1commitment_1seed(JNIEnv * _env, jclass _b, jlong this_ptr) {
5218 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
5219 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5220 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_commitment_seed(this_ptr_conv));
5224 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1commitment_1seed(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
5225 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
5226 LDKThirtyTwoBytes val_ref;
5227 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
5228 return InMemoryChannelKeys_set_commitment_seed(this_ptr_conv, val_ref);
5231 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, jbyteArray commitment_seed, jlong channel_value_satoshis, jlong key_derivation_params) {
5232 LDKSecretKey funding_key_conv = *(LDKSecretKey*)funding_key;
5233 FREE((void*)funding_key);
5234 LDKSecretKey revocation_base_key_conv = *(LDKSecretKey*)revocation_base_key;
5235 FREE((void*)revocation_base_key);
5236 LDKSecretKey payment_key_conv = *(LDKSecretKey*)payment_key;
5237 FREE((void*)payment_key);
5238 LDKSecretKey delayed_payment_base_key_conv = *(LDKSecretKey*)delayed_payment_base_key;
5239 FREE((void*)delayed_payment_base_key);
5240 LDKSecretKey htlc_base_key_conv = *(LDKSecretKey*)htlc_base_key;
5241 FREE((void*)htlc_base_key);
5242 LDKThirtyTwoBytes commitment_seed_ref;
5243 (*_env)->GetByteArrayRegion (_env, commitment_seed, 0, 32, commitment_seed_ref.data);
5244 LDKC2Tuple_u64u64Z key_derivation_params_conv = *(LDKC2Tuple_u64u64Z*)key_derivation_params;
5245 FREE((void*)key_derivation_params);
5246 LDKInMemoryChannelKeys* ret = MALLOC(sizeof(LDKInMemoryChannelKeys), "LDKInMemoryChannelKeys");
5247 *ret = InMemoryChannelKeys_new(funding_key_conv, revocation_base_key_conv, payment_key_conv, delayed_payment_base_key_conv, htlc_base_key_conv, commitment_seed_ref, channel_value_satoshis, key_derivation_params_conv);
5248 DO_ASSERT(ret->is_owned);
5249 ret->is_owned = false;
5253 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1counterparty_1pubkeys(JNIEnv * _env, jclass _b, jlong this_arg) {
5254 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
5255 LDKChannelPublicKeys* ret = MALLOC(sizeof(LDKChannelPublicKeys), "LDKChannelPublicKeys");
5256 *ret = InMemoryChannelKeys_counterparty_pubkeys(this_arg_conv);
5257 DO_ASSERT(ret->is_owned);
5258 ret->is_owned = false;
5262 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1counterparty_1selected_1contest_1delay(JNIEnv * _env, jclass _b, jlong this_arg) {
5263 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
5264 return InMemoryChannelKeys_counterparty_selected_contest_delay(this_arg_conv);
5267 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1holder_1selected_1contest_1delay(JNIEnv * _env, jclass _b, jlong this_arg) {
5268 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
5269 return InMemoryChannelKeys_holder_selected_contest_delay(this_arg_conv);
5272 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1as_1ChannelKeys(JNIEnv * _env, jclass _b, jlong this_arg) {
5273 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
5274 LDKChannelKeys* ret = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys");
5275 *ret = InMemoryChannelKeys_as_ChannelKeys(this_arg_conv);
5279 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1write(JNIEnv * _env, jclass _b, jlong obj) {
5280 LDKInMemoryChannelKeys* obj_conv = (LDKInMemoryChannelKeys*)obj;
5281 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5282 *ret = InMemoryChannelKeys_write(obj_conv);
5286 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1read(JNIEnv * _env, jclass _b, jlong ser) {
5287 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5288 LDKInMemoryChannelKeys* ret = MALLOC(sizeof(LDKInMemoryChannelKeys), "LDKInMemoryChannelKeys");
5289 *ret = InMemoryChannelKeys_read(ser_conv);
5290 DO_ASSERT(ret->is_owned);
5291 ret->is_owned = false;
5295 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysManager_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5296 LDKKeysManager this_ptr_conv = *(LDKKeysManager*)this_ptr;
5297 FREE((void*)this_ptr);
5298 this_ptr_conv.is_owned = true;
5299 return KeysManager_free(this_ptr_conv);
5302 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) {
5303 unsigned char seed_arr[32];
5304 (*_env)->GetByteArrayRegion (_env, seed, 0, 32, seed_arr);
5305 unsigned char (*seed_ref)[32] = &seed_arr;
5306 LDKNetwork network_conv = LDKNetwork_from_java(_env, network);
5307 LDKKeysManager* ret = MALLOC(sizeof(LDKKeysManager), "LDKKeysManager");
5308 *ret = KeysManager_new(seed_ref, network_conv, starting_time_secs, starting_time_nanos);
5309 DO_ASSERT(ret->is_owned);
5310 ret->is_owned = false;
5314 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) {
5315 LDKKeysManager* this_arg_conv = (LDKKeysManager*)this_arg;
5316 LDKInMemoryChannelKeys* ret = MALLOC(sizeof(LDKInMemoryChannelKeys), "LDKInMemoryChannelKeys");
5317 *ret = KeysManager_derive_channel_keys(this_arg_conv, channel_value_satoshis, params_1, params_2);
5318 DO_ASSERT(ret->is_owned);
5319 ret->is_owned = false;
5323 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1KeysInterface(JNIEnv * _env, jclass _b, jlong this_arg) {
5324 LDKKeysManager* this_arg_conv = (LDKKeysManager*)this_arg;
5325 LDKKeysInterface* ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
5326 *ret = KeysManager_as_KeysInterface(this_arg_conv);
5330 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5331 LDKChannelManager this_ptr_conv = *(LDKChannelManager*)this_ptr;
5332 FREE((void*)this_ptr);
5333 this_ptr_conv.is_owned = true;
5334 return ChannelManager_free(this_ptr_conv);
5337 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5338 LDKChannelDetails this_ptr_conv = *(LDKChannelDetails*)this_ptr;
5339 FREE((void*)this_ptr);
5340 this_ptr_conv.is_owned = true;
5341 return ChannelDetails_free(this_ptr_conv);
5344 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5345 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
5346 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5347 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ChannelDetails_get_channel_id(this_ptr_conv));
5351 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
5352 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
5353 LDKThirtyTwoBytes val_ref;
5354 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
5355 return ChannelDetails_set_channel_id(this_ptr_conv, val_ref);
5358 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1remote_1network_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5359 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
5360 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5361 *ret = ChannelDetails_get_remote_network_id(this_ptr_conv);
5365 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1remote_1network_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5366 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
5367 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5369 return ChannelDetails_set_remote_network_id(this_ptr_conv, val_conv);
5372 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1counterparty_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
5373 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
5374 LDKInitFeatures* ret = MALLOC(sizeof(LDKInitFeatures), "LDKInitFeatures");
5375 *ret = ChannelDetails_get_counterparty_features(this_ptr_conv);
5376 DO_ASSERT(ret->is_owned);
5377 ret->is_owned = false;
5381 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1counterparty_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5382 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
5383 LDKInitFeatures val_conv = *(LDKInitFeatures*)val;
5385 val_conv.is_owned = true;
5386 return ChannelDetails_set_counterparty_features(this_ptr_conv, val_conv);
5389 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1value_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
5390 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
5391 return ChannelDetails_get_channel_value_satoshis(this_ptr_conv);
5394 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1value_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5395 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
5396 return ChannelDetails_set_channel_value_satoshis(this_ptr_conv, val);
5399 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1user_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5400 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
5401 return ChannelDetails_get_user_id(this_ptr_conv);
5404 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1user_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5405 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
5406 return ChannelDetails_set_user_id(this_ptr_conv, val);
5409 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
5410 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
5411 return ChannelDetails_get_outbound_capacity_msat(this_ptr_conv);
5414 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1outbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5415 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
5416 return ChannelDetails_set_outbound_capacity_msat(this_ptr_conv, val);
5419 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
5420 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
5421 return ChannelDetails_get_inbound_capacity_msat(this_ptr_conv);
5424 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5425 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
5426 return ChannelDetails_set_inbound_capacity_msat(this_ptr_conv, val);
5429 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1live(JNIEnv * _env, jclass _b, jlong this_ptr) {
5430 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
5431 return ChannelDetails_get_is_live(this_ptr_conv);
5434 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1live(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
5435 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
5436 return ChannelDetails_set_is_live(this_ptr_conv, val);
5439 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5440 LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)this_ptr;
5441 FREE((void*)this_ptr);
5442 this_ptr_conv.is_owned = true;
5443 return PaymentSendFailure_free(this_ptr_conv);
5446 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) {
5447 LDKNetwork network_conv = LDKNetwork_from_java(_env, network);
5448 LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)fee_est;
5449 if (fee_est_conv.free == LDKFeeEstimator_JCalls_free) {
5450 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
5451 LDKFeeEstimator_JCalls_clone(fee_est_conv.this_arg);
5453 LDKWatch chain_monitor_conv = *(LDKWatch*)chain_monitor;
5454 if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
5455 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
5456 LDKWatch_JCalls_clone(chain_monitor_conv.this_arg);
5458 LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)tx_broadcaster;
5459 if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
5460 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
5461 LDKBroadcasterInterface_JCalls_clone(tx_broadcaster_conv.this_arg);
5463 LDKLogger logger_conv = *(LDKLogger*)logger;
5464 if (logger_conv.free == LDKLogger_JCalls_free) {
5465 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
5466 LDKLogger_JCalls_clone(logger_conv.this_arg);
5468 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)keys_manager;
5469 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
5470 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
5471 LDKKeysInterface_JCalls_clone(keys_manager_conv.this_arg);
5473 LDKUserConfig config_conv = *(LDKUserConfig*)config;
5474 FREE((void*)config);
5475 config_conv.is_owned = true;
5476 LDKChannelManager* ret = MALLOC(sizeof(LDKChannelManager), "LDKChannelManager");
5477 *ret = ChannelManager_new(network_conv, fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, keys_manager_conv, config_conv, current_blockchain_height);
5478 DO_ASSERT(ret->is_owned);
5479 ret->is_owned = false;
5483 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) {
5484 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
5485 LDKPublicKey their_network_key_conv = *(LDKPublicKey*)their_network_key;
5486 FREE((void*)their_network_key);
5487 LDKUserConfig override_config_conv = *(LDKUserConfig*)override_config;
5488 FREE((void*)override_config);
5489 override_config_conv.is_owned = true;
5490 LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
5491 *ret = ChannelManager_create_channel(this_arg_conv, their_network_key_conv, channel_value_satoshis, push_msat, user_id, override_config_conv);
5495 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
5496 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
5497 LDKCVec_ChannelDetailsZ* ret = MALLOC(sizeof(LDKCVec_ChannelDetailsZ), "LDKCVec_ChannelDetailsZ");
5498 *ret = ChannelManager_list_channels(this_arg_conv);
5502 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1usable_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
5503 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
5504 LDKCVec_ChannelDetailsZ* ret = MALLOC(sizeof(LDKCVec_ChannelDetailsZ), "LDKCVec_ChannelDetailsZ");
5505 *ret = ChannelManager_list_usable_channels(this_arg_conv);
5509 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray channel_id) {
5510 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
5511 unsigned char channel_id_arr[32];
5512 (*_env)->GetByteArrayRegion (_env, channel_id, 0, 32, channel_id_arr);
5513 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
5514 LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
5515 *ret = ChannelManager_close_channel(this_arg_conv, channel_id_ref);
5519 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray channel_id) {
5520 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
5521 unsigned char channel_id_arr[32];
5522 (*_env)->GetByteArrayRegion (_env, channel_id, 0, 32, channel_id_arr);
5523 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
5524 return ChannelManager_force_close_channel(this_arg_conv, channel_id_ref);
5527 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1all_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
5528 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
5529 return ChannelManager_force_close_all_channels(this_arg_conv);
5532 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payment(JNIEnv * _env, jclass _b, jlong this_arg, jlong route, jbyteArray payment_hash, jbyteArray payment_secret) {
5533 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
5534 LDKRoute* route_conv = (LDKRoute*)route;
5535 LDKThirtyTwoBytes payment_hash_ref;
5536 (*_env)->GetByteArrayRegion (_env, payment_hash, 0, 32, payment_hash_ref.data);
5537 LDKThirtyTwoBytes payment_secret_ref;
5538 (*_env)->GetByteArrayRegion (_env, payment_secret, 0, 32, payment_secret_ref.data);
5539 LDKCResult_NonePaymentSendFailureZ* ret = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
5540 *ret = ChannelManager_send_payment(this_arg_conv, route_conv, payment_hash_ref, payment_secret_ref);
5544 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) {
5545 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
5546 unsigned char temporary_channel_id_arr[32];
5547 (*_env)->GetByteArrayRegion (_env, temporary_channel_id, 0, 32, temporary_channel_id_arr);
5548 unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
5549 LDKOutPoint funding_txo_conv = *(LDKOutPoint*)funding_txo;
5550 FREE((void*)funding_txo);
5551 funding_txo_conv.is_owned = true;
5552 return ChannelManager_funding_transaction_generated(this_arg_conv, temporary_channel_id_ref, funding_txo_conv);
5555 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1broadcast_1node_1announcement(JNIEnv * _env, jclass _b, jlong this_arg, jlong rgb, jbyteArray alias, jlong addresses) {
5556 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
5557 LDKThreeBytes rgb_conv = *(LDKThreeBytes*)rgb;
5559 LDKThirtyTwoBytes alias_ref;
5560 (*_env)->GetByteArrayRegion (_env, alias, 0, 32, alias_ref.data);
5561 LDKCVec_NetAddressZ addresses_conv = *(LDKCVec_NetAddressZ*)addresses;
5562 FREE((void*)addresses);
5563 return ChannelManager_broadcast_node_announcement(this_arg_conv, rgb_conv, alias_ref, addresses_conv);
5566 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1process_1pending_1htlc_1forwards(JNIEnv * _env, jclass _b, jlong this_arg) {
5567 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
5568 return ChannelManager_process_pending_htlc_forwards(this_arg_conv);
5571 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1timer_1chan_1freshness_1every_1min(JNIEnv * _env, jclass _b, jlong this_arg) {
5572 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
5573 return ChannelManager_timer_chan_freshness_every_min(this_arg_conv);
5576 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1fail_1htlc_1backwards(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray payment_hash, jbyteArray payment_secret) {
5577 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
5578 unsigned char payment_hash_arr[32];
5579 (*_env)->GetByteArrayRegion (_env, payment_hash, 0, 32, payment_hash_arr);
5580 unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
5581 LDKThirtyTwoBytes payment_secret_ref;
5582 (*_env)->GetByteArrayRegion (_env, payment_secret, 0, 32, payment_secret_ref.data);
5583 return ChannelManager_fail_htlc_backwards(this_arg_conv, payment_hash_ref, payment_secret_ref);
5586 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1claim_1funds(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray payment_preimage, jbyteArray payment_secret, jlong expected_amount) {
5587 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
5588 LDKThirtyTwoBytes payment_preimage_ref;
5589 (*_env)->GetByteArrayRegion (_env, payment_preimage, 0, 32, payment_preimage_ref.data);
5590 LDKThirtyTwoBytes payment_secret_ref;
5591 (*_env)->GetByteArrayRegion (_env, payment_secret, 0, 32, payment_secret_ref.data);
5592 return ChannelManager_claim_funds(this_arg_conv, payment_preimage_ref, payment_secret_ref, expected_amount);
5595 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1our_1node_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
5596 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
5597 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5598 *ret = ChannelManager_get_our_node_id(this_arg_conv);
5602 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) {
5603 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
5604 LDKOutPoint* funding_txo_conv = (LDKOutPoint*)funding_txo;
5605 return ChannelManager_channel_monitor_updated(this_arg_conv, funding_txo_conv, highest_applied_update_id);
5608 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1MessageSendEventsProvider(JNIEnv * _env, jclass _b, jlong this_arg) {
5609 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
5610 LDKMessageSendEventsProvider* ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
5611 *ret = ChannelManager_as_MessageSendEventsProvider(this_arg_conv);
5615 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1EventsProvider(JNIEnv * _env, jclass _b, jlong this_arg) {
5616 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
5617 LDKEventsProvider* ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
5618 *ret = ChannelManager_as_EventsProvider(this_arg_conv);
5622 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1block_1connected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jlong txdata, jint height) {
5623 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
5624 unsigned char header_arr[80];
5625 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
5626 unsigned char (*header_ref)[80] = &header_arr;
5627 LDKCVec_C2Tuple_usizeTransactionZZ txdata_conv = *(LDKCVec_C2Tuple_usizeTransactionZZ*)txdata;
5628 FREE((void*)txdata);
5629 return ChannelManager_block_connected(this_arg_conv, header_ref, txdata_conv, height);
5632 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1block_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header) {
5633 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
5634 unsigned char header_arr[80];
5635 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
5636 unsigned char (*header_ref)[80] = &header_arr;
5637 return ChannelManager_block_disconnected(this_arg_conv, header_ref);
5640 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1ChannelMessageHandler(JNIEnv * _env, jclass _b, jlong this_arg) {
5641 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
5642 LDKChannelMessageHandler* ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
5643 *ret = ChannelManager_as_ChannelMessageHandler(this_arg_conv);
5647 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5648 LDKChannelManagerReadArgs this_ptr_conv = *(LDKChannelManagerReadArgs*)this_ptr;
5649 FREE((void*)this_ptr);
5650 this_ptr_conv.is_owned = true;
5651 return ChannelManagerReadArgs_free(this_ptr_conv);
5654 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1keys_1manager(JNIEnv * _env, jclass _b, jlong this_ptr) {
5655 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
5656 long ret = (long)ChannelManagerReadArgs_get_keys_manager(this_ptr_conv);
5660 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1keys_1manager(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5661 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
5662 LDKKeysInterface val_conv = *(LDKKeysInterface*)val;
5663 if (val_conv.free == LDKKeysInterface_JCalls_free) {
5664 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
5665 LDKKeysInterface_JCalls_clone(val_conv.this_arg);
5667 return ChannelManagerReadArgs_set_keys_manager(this_ptr_conv, val_conv);
5670 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1fee_1estimator(JNIEnv * _env, jclass _b, jlong this_ptr) {
5671 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
5672 long ret = (long)ChannelManagerReadArgs_get_fee_estimator(this_ptr_conv);
5676 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1fee_1estimator(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5677 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
5678 LDKFeeEstimator val_conv = *(LDKFeeEstimator*)val;
5679 if (val_conv.free == LDKFeeEstimator_JCalls_free) {
5680 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
5681 LDKFeeEstimator_JCalls_clone(val_conv.this_arg);
5683 return ChannelManagerReadArgs_set_fee_estimator(this_ptr_conv, val_conv);
5686 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1chain_1monitor(JNIEnv * _env, jclass _b, jlong this_ptr) {
5687 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
5688 long ret = (long)ChannelManagerReadArgs_get_chain_monitor(this_ptr_conv);
5692 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1chain_1monitor(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5693 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
5694 LDKWatch val_conv = *(LDKWatch*)val;
5695 if (val_conv.free == LDKWatch_JCalls_free) {
5696 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
5697 LDKWatch_JCalls_clone(val_conv.this_arg);
5699 return ChannelManagerReadArgs_set_chain_monitor(this_ptr_conv, val_conv);
5702 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1tx_1broadcaster(JNIEnv * _env, jclass _b, jlong this_ptr) {
5703 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
5704 long ret = (long)ChannelManagerReadArgs_get_tx_broadcaster(this_ptr_conv);
5708 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1tx_1broadcaster(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5709 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
5710 LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)val;
5711 if (val_conv.free == LDKBroadcasterInterface_JCalls_free) {
5712 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
5713 LDKBroadcasterInterface_JCalls_clone(val_conv.this_arg);
5715 return ChannelManagerReadArgs_set_tx_broadcaster(this_ptr_conv, val_conv);
5718 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1logger(JNIEnv * _env, jclass _b, jlong this_ptr) {
5719 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
5720 long ret = (long)ChannelManagerReadArgs_get_logger(this_ptr_conv);
5724 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1logger(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5725 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
5726 LDKLogger val_conv = *(LDKLogger*)val;
5727 if (val_conv.free == LDKLogger_JCalls_free) {
5728 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
5729 LDKLogger_JCalls_clone(val_conv.this_arg);
5731 return ChannelManagerReadArgs_set_logger(this_ptr_conv, val_conv);
5734 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1default_1config(JNIEnv * _env, jclass _b, jlong this_ptr) {
5735 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
5736 LDKUserConfig* ret = MALLOC(sizeof(LDKUserConfig), "LDKUserConfig");
5737 *ret = ChannelManagerReadArgs_get_default_config(this_ptr_conv);
5738 DO_ASSERT(ret->is_owned);
5739 ret->is_owned = false;
5743 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1default_1config(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5744 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
5745 LDKUserConfig val_conv = *(LDKUserConfig*)val;
5747 val_conv.is_owned = true;
5748 return ChannelManagerReadArgs_set_default_config(this_ptr_conv, val_conv);
5751 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) {
5752 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)keys_manager;
5753 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
5754 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
5755 LDKKeysInterface_JCalls_clone(keys_manager_conv.this_arg);
5757 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)fee_estimator;
5758 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
5759 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
5760 LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
5762 LDKWatch chain_monitor_conv = *(LDKWatch*)chain_monitor;
5763 if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
5764 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
5765 LDKWatch_JCalls_clone(chain_monitor_conv.this_arg);
5767 LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)tx_broadcaster;
5768 if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
5769 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
5770 LDKBroadcasterInterface_JCalls_clone(tx_broadcaster_conv.this_arg);
5772 LDKLogger logger_conv = *(LDKLogger*)logger;
5773 if (logger_conv.free == LDKLogger_JCalls_free) {
5774 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
5775 LDKLogger_JCalls_clone(logger_conv.this_arg);
5777 LDKUserConfig default_config_conv = *(LDKUserConfig*)default_config;
5778 FREE((void*)default_config);
5779 default_config_conv.is_owned = true;
5780 LDKCVec_ChannelMonitorZ channel_monitors_conv = *(LDKCVec_ChannelMonitorZ*)channel_monitors;
5781 FREE((void*)channel_monitors);
5782 LDKChannelManagerReadArgs* ret = MALLOC(sizeof(LDKChannelManagerReadArgs), "LDKChannelManagerReadArgs");
5783 *ret = ChannelManagerReadArgs_new(keys_manager_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, default_config_conv, channel_monitors_conv);
5784 DO_ASSERT(ret->is_owned);
5785 ret->is_owned = false;
5789 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DecodeError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5790 LDKDecodeError this_ptr_conv = *(LDKDecodeError*)this_ptr;
5791 FREE((void*)this_ptr);
5792 this_ptr_conv.is_owned = true;
5793 return DecodeError_free(this_ptr_conv);
5796 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5797 LDKInit this_ptr_conv = *(LDKInit*)this_ptr;
5798 FREE((void*)this_ptr);
5799 this_ptr_conv.is_owned = true;
5800 return Init_free(this_ptr_conv);
5803 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5804 LDKErrorMessage this_ptr_conv = *(LDKErrorMessage*)this_ptr;
5805 FREE((void*)this_ptr);
5806 this_ptr_conv.is_owned = true;
5807 return ErrorMessage_free(this_ptr_conv);
5810 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5811 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
5812 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5813 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ErrorMessage_get_channel_id(this_ptr_conv));
5817 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
5818 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
5819 LDKThirtyTwoBytes val_ref;
5820 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
5821 return ErrorMessage_set_channel_id(this_ptr_conv, val_ref);
5824 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1data(JNIEnv * _env, jclass _b, jlong this_ptr) {
5825 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
5826 LDKStr* ret = MALLOC(sizeof(LDKStr), "LDKStr");
5827 *ret = ErrorMessage_get_data(this_ptr_conv);
5831 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1data(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5832 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
5833 LDKCVec_u8Z val_conv = *(LDKCVec_u8Z*)val;
5835 return ErrorMessage_set_data(this_ptr_conv, val_conv);
5838 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1new(JNIEnv * _env, jclass _b, jbyteArray channel_id_arg, jlong data_arg) {
5839 LDKThirtyTwoBytes channel_id_arg_ref;
5840 (*_env)->GetByteArrayRegion (_env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
5841 LDKCVec_u8Z data_arg_conv = *(LDKCVec_u8Z*)data_arg;
5842 FREE((void*)data_arg);
5843 LDKErrorMessage* ret = MALLOC(sizeof(LDKErrorMessage), "LDKErrorMessage");
5844 *ret = ErrorMessage_new(channel_id_arg_ref, data_arg_conv);
5845 DO_ASSERT(ret->is_owned);
5846 ret->is_owned = false;
5850 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5851 LDKPing this_ptr_conv = *(LDKPing*)this_ptr;
5852 FREE((void*)this_ptr);
5853 this_ptr_conv.is_owned = true;
5854 return Ping_free(this_ptr_conv);
5857 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Ping_1get_1ponglen(JNIEnv * _env, jclass _b, jlong this_ptr) {
5858 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
5859 return Ping_get_ponglen(this_ptr_conv);
5862 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1ponglen(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
5863 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
5864 return Ping_set_ponglen(this_ptr_conv, val);
5867 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Ping_1get_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr) {
5868 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
5869 return Ping_get_byteslen(this_ptr_conv);
5872 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
5873 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
5874 return Ping_set_byteslen(this_ptr_conv, val);
5877 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1new(JNIEnv * _env, jclass _b, jshort ponglen_arg, jshort byteslen_arg) {
5878 LDKPing* ret = MALLOC(sizeof(LDKPing), "LDKPing");
5879 *ret = Ping_new(ponglen_arg, byteslen_arg);
5880 DO_ASSERT(ret->is_owned);
5881 ret->is_owned = false;
5885 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5886 LDKPong this_ptr_conv = *(LDKPong*)this_ptr;
5887 FREE((void*)this_ptr);
5888 this_ptr_conv.is_owned = true;
5889 return Pong_free(this_ptr_conv);
5892 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Pong_1get_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr) {
5893 LDKPong* this_ptr_conv = (LDKPong*)this_ptr;
5894 return Pong_get_byteslen(this_ptr_conv);
5897 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1set_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
5898 LDKPong* this_ptr_conv = (LDKPong*)this_ptr;
5899 return Pong_set_byteslen(this_ptr_conv, val);
5902 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1new(JNIEnv * _env, jclass _b, jshort byteslen_arg) {
5903 LDKPong* ret = MALLOC(sizeof(LDKPong), "LDKPong");
5904 *ret = Pong_new(byteslen_arg);
5905 DO_ASSERT(ret->is_owned);
5906 ret->is_owned = false;
5910 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5911 LDKOpenChannel this_ptr_conv = *(LDKOpenChannel*)this_ptr;
5912 FREE((void*)this_ptr);
5913 this_ptr_conv.is_owned = true;
5914 return OpenChannel_free(this_ptr_conv);
5917 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
5918 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5919 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5920 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OpenChannel_get_chain_hash(this_ptr_conv));
5924 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
5925 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5926 LDKThirtyTwoBytes val_ref;
5927 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
5928 return OpenChannel_set_chain_hash(this_ptr_conv, val_ref);
5931 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5932 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5933 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5934 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OpenChannel_get_temporary_channel_id(this_ptr_conv));
5938 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
5939 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5940 LDKThirtyTwoBytes val_ref;
5941 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
5942 return OpenChannel_set_temporary_channel_id(this_ptr_conv, val_ref);
5945 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
5946 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5947 return OpenChannel_get_funding_satoshis(this_ptr_conv);
5950 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5951 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5952 return OpenChannel_set_funding_satoshis(this_ptr_conv, val);
5955 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1push_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
5956 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5957 return OpenChannel_get_push_msat(this_ptr_conv);
5960 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1push_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5961 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5962 return OpenChannel_set_push_msat(this_ptr_conv, val);
5965 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
5966 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5967 return OpenChannel_get_dust_limit_satoshis(this_ptr_conv);
5970 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5971 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5972 return OpenChannel_set_dust_limit_satoshis(this_ptr_conv, val);
5975 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
5976 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5977 return OpenChannel_get_max_htlc_value_in_flight_msat(this_ptr_conv);
5980 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) {
5981 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5982 return OpenChannel_set_max_htlc_value_in_flight_msat(this_ptr_conv, val);
5985 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
5986 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5987 return OpenChannel_get_channel_reserve_satoshis(this_ptr_conv);
5990 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5991 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5992 return OpenChannel_set_channel_reserve_satoshis(this_ptr_conv, val);
5995 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
5996 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
5997 return OpenChannel_get_htlc_minimum_msat(this_ptr_conv);
6000 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6001 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
6002 return OpenChannel_set_htlc_minimum_msat(this_ptr_conv, val);
6005 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr) {
6006 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
6007 return OpenChannel_get_feerate_per_kw(this_ptr_conv);
6010 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6011 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
6012 return OpenChannel_set_feerate_per_kw(this_ptr_conv, val);
6015 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
6016 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
6017 return OpenChannel_get_to_self_delay(this_ptr_conv);
6020 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
6021 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
6022 return OpenChannel_set_to_self_delay(this_ptr_conv, val);
6025 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr) {
6026 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
6027 return OpenChannel_get_max_accepted_htlcs(this_ptr_conv);
6030 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
6031 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
6032 return OpenChannel_set_max_accepted_htlcs(this_ptr_conv, val);
6035 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
6036 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
6037 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6038 *ret = OpenChannel_get_funding_pubkey(this_ptr_conv);
6042 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6043 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
6044 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6046 return OpenChannel_set_funding_pubkey(this_ptr_conv, val_conv);
6049 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
6050 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
6051 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6052 *ret = OpenChannel_get_revocation_basepoint(this_ptr_conv);
6056 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6057 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
6058 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6060 return OpenChannel_set_revocation_basepoint(this_ptr_conv, val_conv);
6063 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
6064 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
6065 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6066 *ret = OpenChannel_get_payment_point(this_ptr_conv);
6070 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6071 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
6072 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6074 return OpenChannel_set_payment_point(this_ptr_conv, val_conv);
6077 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
6078 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
6079 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6080 *ret = OpenChannel_get_delayed_payment_basepoint(this_ptr_conv);
6084 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6085 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
6086 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6088 return OpenChannel_set_delayed_payment_basepoint(this_ptr_conv, val_conv);
6091 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
6092 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
6093 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6094 *ret = OpenChannel_get_htlc_basepoint(this_ptr_conv);
6098 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6099 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
6100 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6102 return OpenChannel_set_htlc_basepoint(this_ptr_conv, val_conv);
6105 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
6106 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
6107 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6108 *ret = OpenChannel_get_first_per_commitment_point(this_ptr_conv);
6112 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6113 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
6114 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6116 return OpenChannel_set_first_per_commitment_point(this_ptr_conv, val_conv);
6119 JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1flags(JNIEnv * _env, jclass _b, jlong this_ptr) {
6120 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
6121 return OpenChannel_get_channel_flags(this_ptr_conv);
6124 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1flags(JNIEnv * _env, jclass _b, jlong this_ptr, jbyte val) {
6125 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
6126 return OpenChannel_set_channel_flags(this_ptr_conv, val);
6129 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6130 LDKAcceptChannel this_ptr_conv = *(LDKAcceptChannel*)this_ptr;
6131 FREE((void*)this_ptr);
6132 this_ptr_conv.is_owned = true;
6133 return AcceptChannel_free(this_ptr_conv);
6136 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6137 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
6138 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6139 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *AcceptChannel_get_temporary_channel_id(this_ptr_conv));
6143 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
6144 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
6145 LDKThirtyTwoBytes val_ref;
6146 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
6147 return AcceptChannel_set_temporary_channel_id(this_ptr_conv, val_ref);
6150 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
6151 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
6152 return AcceptChannel_get_dust_limit_satoshis(this_ptr_conv);
6155 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6156 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
6157 return AcceptChannel_set_dust_limit_satoshis(this_ptr_conv, val);
6160 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
6161 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
6162 return AcceptChannel_get_max_htlc_value_in_flight_msat(this_ptr_conv);
6165 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) {
6166 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
6167 return AcceptChannel_set_max_htlc_value_in_flight_msat(this_ptr_conv, val);
6170 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
6171 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
6172 return AcceptChannel_get_channel_reserve_satoshis(this_ptr_conv);
6175 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6176 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
6177 return AcceptChannel_set_channel_reserve_satoshis(this_ptr_conv, val);
6180 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
6181 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
6182 return AcceptChannel_get_htlc_minimum_msat(this_ptr_conv);
6185 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6186 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
6187 return AcceptChannel_set_htlc_minimum_msat(this_ptr_conv, val);
6190 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr) {
6191 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
6192 return AcceptChannel_get_minimum_depth(this_ptr_conv);
6195 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6196 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
6197 return AcceptChannel_set_minimum_depth(this_ptr_conv, val);
6200 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
6201 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
6202 return AcceptChannel_get_to_self_delay(this_ptr_conv);
6205 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
6206 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
6207 return AcceptChannel_set_to_self_delay(this_ptr_conv, val);
6210 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr) {
6211 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
6212 return AcceptChannel_get_max_accepted_htlcs(this_ptr_conv);
6215 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
6216 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
6217 return AcceptChannel_set_max_accepted_htlcs(this_ptr_conv, val);
6220 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
6221 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
6222 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6223 *ret = AcceptChannel_get_funding_pubkey(this_ptr_conv);
6227 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6228 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
6229 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6231 return AcceptChannel_set_funding_pubkey(this_ptr_conv, val_conv);
6234 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
6235 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
6236 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6237 *ret = AcceptChannel_get_revocation_basepoint(this_ptr_conv);
6241 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6242 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
6243 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6245 return AcceptChannel_set_revocation_basepoint(this_ptr_conv, val_conv);
6248 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
6249 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
6250 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6251 *ret = AcceptChannel_get_payment_point(this_ptr_conv);
6255 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6256 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
6257 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6259 return AcceptChannel_set_payment_point(this_ptr_conv, val_conv);
6262 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
6263 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
6264 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6265 *ret = AcceptChannel_get_delayed_payment_basepoint(this_ptr_conv);
6269 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6270 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
6271 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6273 return AcceptChannel_set_delayed_payment_basepoint(this_ptr_conv, val_conv);
6276 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
6277 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
6278 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6279 *ret = AcceptChannel_get_htlc_basepoint(this_ptr_conv);
6283 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6284 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
6285 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6287 return AcceptChannel_set_htlc_basepoint(this_ptr_conv, val_conv);
6290 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
6291 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
6292 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6293 *ret = AcceptChannel_get_first_per_commitment_point(this_ptr_conv);
6297 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6298 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
6299 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6301 return AcceptChannel_set_first_per_commitment_point(this_ptr_conv, val_conv);
6304 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6305 LDKFundingCreated this_ptr_conv = *(LDKFundingCreated*)this_ptr;
6306 FREE((void*)this_ptr);
6307 this_ptr_conv.is_owned = true;
6308 return FundingCreated_free(this_ptr_conv);
6311 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6312 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
6313 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6314 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingCreated_get_temporary_channel_id(this_ptr_conv));
6318 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
6319 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
6320 LDKThirtyTwoBytes val_ref;
6321 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
6322 return FundingCreated_set_temporary_channel_id(this_ptr_conv, val_ref);
6325 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1txid(JNIEnv * _env, jclass _b, jlong this_ptr) {
6326 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
6327 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6328 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingCreated_get_funding_txid(this_ptr_conv));
6332 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1txid(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
6333 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
6334 LDKThirtyTwoBytes val_ref;
6335 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
6336 return FundingCreated_set_funding_txid(this_ptr_conv, val_ref);
6339 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1output_1index(JNIEnv * _env, jclass _b, jlong this_ptr) {
6340 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
6341 return FundingCreated_get_funding_output_index(this_ptr_conv);
6344 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1output_1index(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
6345 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
6346 return FundingCreated_set_funding_output_index(this_ptr_conv, val);
6349 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
6350 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
6351 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
6352 *ret = FundingCreated_get_signature(this_ptr_conv);
6356 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6357 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
6358 LDKSignature val_conv = *(LDKSignature*)val;
6360 return FundingCreated_set_signature(this_ptr_conv, val_conv);
6363 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1new(JNIEnv * _env, jclass _b, jbyteArray temporary_channel_id_arg, jbyteArray funding_txid_arg, jshort funding_output_index_arg, jlong signature_arg) {
6364 LDKThirtyTwoBytes temporary_channel_id_arg_ref;
6365 (*_env)->GetByteArrayRegion (_env, temporary_channel_id_arg, 0, 32, temporary_channel_id_arg_ref.data);
6366 LDKThirtyTwoBytes funding_txid_arg_ref;
6367 (*_env)->GetByteArrayRegion (_env, funding_txid_arg, 0, 32, funding_txid_arg_ref.data);
6368 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
6369 FREE((void*)signature_arg);
6370 LDKFundingCreated* ret = MALLOC(sizeof(LDKFundingCreated), "LDKFundingCreated");
6371 *ret = FundingCreated_new(temporary_channel_id_arg_ref, funding_txid_arg_ref, funding_output_index_arg, signature_arg_conv);
6372 DO_ASSERT(ret->is_owned);
6373 ret->is_owned = false;
6377 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6378 LDKFundingSigned this_ptr_conv = *(LDKFundingSigned*)this_ptr;
6379 FREE((void*)this_ptr);
6380 this_ptr_conv.is_owned = true;
6381 return FundingSigned_free(this_ptr_conv);
6384 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6385 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
6386 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6387 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingSigned_get_channel_id(this_ptr_conv));
6391 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
6392 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
6393 LDKThirtyTwoBytes val_ref;
6394 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
6395 return FundingSigned_set_channel_id(this_ptr_conv, val_ref);
6398 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
6399 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
6400 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
6401 *ret = FundingSigned_get_signature(this_ptr_conv);
6405 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6406 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
6407 LDKSignature val_conv = *(LDKSignature*)val;
6409 return FundingSigned_set_signature(this_ptr_conv, val_conv);
6412 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1new(JNIEnv * _env, jclass _b, jbyteArray channel_id_arg, jlong signature_arg) {
6413 LDKThirtyTwoBytes channel_id_arg_ref;
6414 (*_env)->GetByteArrayRegion (_env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
6415 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
6416 FREE((void*)signature_arg);
6417 LDKFundingSigned* ret = MALLOC(sizeof(LDKFundingSigned), "LDKFundingSigned");
6418 *ret = FundingSigned_new(channel_id_arg_ref, signature_arg_conv);
6419 DO_ASSERT(ret->is_owned);
6420 ret->is_owned = false;
6424 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6425 LDKFundingLocked this_ptr_conv = *(LDKFundingLocked*)this_ptr;
6426 FREE((void*)this_ptr);
6427 this_ptr_conv.is_owned = true;
6428 return FundingLocked_free(this_ptr_conv);
6431 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6432 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
6433 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6434 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingLocked_get_channel_id(this_ptr_conv));
6438 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
6439 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
6440 LDKThirtyTwoBytes val_ref;
6441 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
6442 return FundingLocked_set_channel_id(this_ptr_conv, val_ref);
6445 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
6446 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
6447 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6448 *ret = FundingLocked_get_next_per_commitment_point(this_ptr_conv);
6452 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6453 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
6454 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6456 return FundingLocked_set_next_per_commitment_point(this_ptr_conv, val_conv);
6459 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1new(JNIEnv * _env, jclass _b, jbyteArray channel_id_arg, jlong next_per_commitment_point_arg) {
6460 LDKThirtyTwoBytes channel_id_arg_ref;
6461 (*_env)->GetByteArrayRegion (_env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
6462 LDKPublicKey next_per_commitment_point_arg_conv = *(LDKPublicKey*)next_per_commitment_point_arg;
6463 FREE((void*)next_per_commitment_point_arg);
6464 LDKFundingLocked* ret = MALLOC(sizeof(LDKFundingLocked), "LDKFundingLocked");
6465 *ret = FundingLocked_new(channel_id_arg_ref, next_per_commitment_point_arg_conv);
6466 DO_ASSERT(ret->is_owned);
6467 ret->is_owned = false;
6471 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6472 LDKShutdown this_ptr_conv = *(LDKShutdown*)this_ptr;
6473 FREE((void*)this_ptr);
6474 this_ptr_conv.is_owned = true;
6475 return Shutdown_free(this_ptr_conv);
6478 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6479 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
6480 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6481 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *Shutdown_get_channel_id(this_ptr_conv));
6485 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
6486 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
6487 LDKThirtyTwoBytes val_ref;
6488 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
6489 return Shutdown_set_channel_id(this_ptr_conv, val_ref);
6492 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1scriptpubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
6493 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
6494 LDKu8slice* ret = MALLOC(sizeof(LDKu8slice), "LDKu8slice");
6495 *ret = Shutdown_get_scriptpubkey(this_ptr_conv);
6499 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1scriptpubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6500 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
6501 LDKCVec_u8Z val_conv = *(LDKCVec_u8Z*)val;
6503 return Shutdown_set_scriptpubkey(this_ptr_conv, val_conv);
6506 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1new(JNIEnv * _env, jclass _b, jbyteArray channel_id_arg, jlong scriptpubkey_arg) {
6507 LDKThirtyTwoBytes channel_id_arg_ref;
6508 (*_env)->GetByteArrayRegion (_env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
6509 LDKCVec_u8Z scriptpubkey_arg_conv = *(LDKCVec_u8Z*)scriptpubkey_arg;
6510 FREE((void*)scriptpubkey_arg);
6511 LDKShutdown* ret = MALLOC(sizeof(LDKShutdown), "LDKShutdown");
6512 *ret = Shutdown_new(channel_id_arg_ref, scriptpubkey_arg_conv);
6513 DO_ASSERT(ret->is_owned);
6514 ret->is_owned = false;
6518 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6519 LDKClosingSigned this_ptr_conv = *(LDKClosingSigned*)this_ptr;
6520 FREE((void*)this_ptr);
6521 this_ptr_conv.is_owned = true;
6522 return ClosingSigned_free(this_ptr_conv);
6525 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6526 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
6527 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6528 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ClosingSigned_get_channel_id(this_ptr_conv));
6532 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
6533 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
6534 LDKThirtyTwoBytes val_ref;
6535 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
6536 return ClosingSigned_set_channel_id(this_ptr_conv, val_ref);
6539 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
6540 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
6541 return ClosingSigned_get_fee_satoshis(this_ptr_conv);
6544 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6545 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
6546 return ClosingSigned_set_fee_satoshis(this_ptr_conv, val);
6549 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
6550 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
6551 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
6552 *ret = ClosingSigned_get_signature(this_ptr_conv);
6556 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6557 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
6558 LDKSignature val_conv = *(LDKSignature*)val;
6560 return ClosingSigned_set_signature(this_ptr_conv, val_conv);
6563 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1new(JNIEnv * _env, jclass _b, jbyteArray channel_id_arg, jlong fee_satoshis_arg, jlong signature_arg) {
6564 LDKThirtyTwoBytes channel_id_arg_ref;
6565 (*_env)->GetByteArrayRegion (_env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
6566 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
6567 FREE((void*)signature_arg);
6568 LDKClosingSigned* ret = MALLOC(sizeof(LDKClosingSigned), "LDKClosingSigned");
6569 *ret = ClosingSigned_new(channel_id_arg_ref, fee_satoshis_arg, signature_arg_conv);
6570 DO_ASSERT(ret->is_owned);
6571 ret->is_owned = false;
6575 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6576 LDKUpdateAddHTLC this_ptr_conv = *(LDKUpdateAddHTLC*)this_ptr;
6577 FREE((void*)this_ptr);
6578 this_ptr_conv.is_owned = true;
6579 return UpdateAddHTLC_free(this_ptr_conv);
6582 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6583 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
6584 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6585 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateAddHTLC_get_channel_id(this_ptr_conv));
6589 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
6590 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
6591 LDKThirtyTwoBytes val_ref;
6592 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
6593 return UpdateAddHTLC_set_channel_id(this_ptr_conv, val_ref);
6596 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6597 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
6598 return UpdateAddHTLC_get_htlc_id(this_ptr_conv);
6601 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6602 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
6603 return UpdateAddHTLC_set_htlc_id(this_ptr_conv, val);
6606 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
6607 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
6608 return UpdateAddHTLC_get_amount_msat(this_ptr_conv);
6611 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6612 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
6613 return UpdateAddHTLC_set_amount_msat(this_ptr_conv, val);
6616 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
6617 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
6618 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6619 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateAddHTLC_get_payment_hash(this_ptr_conv));
6623 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
6624 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
6625 LDKThirtyTwoBytes val_ref;
6626 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
6627 return UpdateAddHTLC_set_payment_hash(this_ptr_conv, val_ref);
6630 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr) {
6631 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
6632 return UpdateAddHTLC_get_cltv_expiry(this_ptr_conv);
6635 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6636 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
6637 return UpdateAddHTLC_set_cltv_expiry(this_ptr_conv, val);
6640 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6641 LDKUpdateFulfillHTLC this_ptr_conv = *(LDKUpdateFulfillHTLC*)this_ptr;
6642 FREE((void*)this_ptr);
6643 this_ptr_conv.is_owned = true;
6644 return UpdateFulfillHTLC_free(this_ptr_conv);
6647 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6648 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
6649 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6650 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_channel_id(this_ptr_conv));
6654 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
6655 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
6656 LDKThirtyTwoBytes val_ref;
6657 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
6658 return UpdateFulfillHTLC_set_channel_id(this_ptr_conv, val_ref);
6661 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6662 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
6663 return UpdateFulfillHTLC_get_htlc_id(this_ptr_conv);
6666 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6667 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
6668 return UpdateFulfillHTLC_set_htlc_id(this_ptr_conv, val);
6671 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1payment_1preimage(JNIEnv * _env, jclass _b, jlong this_ptr) {
6672 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
6673 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6674 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_payment_preimage(this_ptr_conv));
6678 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1payment_1preimage(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
6679 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
6680 LDKThirtyTwoBytes val_ref;
6681 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
6682 return UpdateFulfillHTLC_set_payment_preimage(this_ptr_conv, val_ref);
6685 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1new(JNIEnv * _env, jclass _b, jbyteArray channel_id_arg, jlong htlc_id_arg, jbyteArray payment_preimage_arg) {
6686 LDKThirtyTwoBytes channel_id_arg_ref;
6687 (*_env)->GetByteArrayRegion (_env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
6688 LDKThirtyTwoBytes payment_preimage_arg_ref;
6689 (*_env)->GetByteArrayRegion (_env, payment_preimage_arg, 0, 32, payment_preimage_arg_ref.data);
6690 LDKUpdateFulfillHTLC* ret = MALLOC(sizeof(LDKUpdateFulfillHTLC), "LDKUpdateFulfillHTLC");
6691 *ret = UpdateFulfillHTLC_new(channel_id_arg_ref, htlc_id_arg, payment_preimage_arg_ref);
6692 DO_ASSERT(ret->is_owned);
6693 ret->is_owned = false;
6697 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6698 LDKUpdateFailHTLC this_ptr_conv = *(LDKUpdateFailHTLC*)this_ptr;
6699 FREE((void*)this_ptr);
6700 this_ptr_conv.is_owned = true;
6701 return UpdateFailHTLC_free(this_ptr_conv);
6704 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6705 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
6706 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6707 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFailHTLC_get_channel_id(this_ptr_conv));
6711 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
6712 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
6713 LDKThirtyTwoBytes val_ref;
6714 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
6715 return UpdateFailHTLC_set_channel_id(this_ptr_conv, val_ref);
6718 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6719 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
6720 return UpdateFailHTLC_get_htlc_id(this_ptr_conv);
6723 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6724 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
6725 return UpdateFailHTLC_set_htlc_id(this_ptr_conv, val);
6728 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6729 LDKUpdateFailMalformedHTLC this_ptr_conv = *(LDKUpdateFailMalformedHTLC*)this_ptr;
6730 FREE((void*)this_ptr);
6731 this_ptr_conv.is_owned = true;
6732 return UpdateFailMalformedHTLC_free(this_ptr_conv);
6735 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6736 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
6737 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6738 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFailMalformedHTLC_get_channel_id(this_ptr_conv));
6742 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
6743 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
6744 LDKThirtyTwoBytes val_ref;
6745 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
6746 return UpdateFailMalformedHTLC_set_channel_id(this_ptr_conv, val_ref);
6749 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6750 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
6751 return UpdateFailMalformedHTLC_get_htlc_id(this_ptr_conv);
6754 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6755 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
6756 return UpdateFailMalformedHTLC_set_htlc_id(this_ptr_conv, val);
6759 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1failure_1code(JNIEnv * _env, jclass _b, jlong this_ptr) {
6760 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
6761 return UpdateFailMalformedHTLC_get_failure_code(this_ptr_conv);
6764 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1failure_1code(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
6765 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
6766 return UpdateFailMalformedHTLC_set_failure_code(this_ptr_conv, val);
6769 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6770 LDKCommitmentSigned this_ptr_conv = *(LDKCommitmentSigned*)this_ptr;
6771 FREE((void*)this_ptr);
6772 this_ptr_conv.is_owned = true;
6773 return CommitmentSigned_free(this_ptr_conv);
6776 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6777 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
6778 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6779 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *CommitmentSigned_get_channel_id(this_ptr_conv));
6783 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
6784 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
6785 LDKThirtyTwoBytes val_ref;
6786 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
6787 return CommitmentSigned_set_channel_id(this_ptr_conv, val_ref);
6790 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
6791 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
6792 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
6793 *ret = CommitmentSigned_get_signature(this_ptr_conv);
6797 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6798 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
6799 LDKSignature val_conv = *(LDKSignature*)val;
6801 return CommitmentSigned_set_signature(this_ptr_conv, val_conv);
6804 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1htlc_1signatures(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6805 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
6806 LDKCVec_SignatureZ val_conv = *(LDKCVec_SignatureZ*)val;
6808 return CommitmentSigned_set_htlc_signatures(this_ptr_conv, val_conv);
6811 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1new(JNIEnv * _env, jclass _b, jbyteArray channel_id_arg, jlong signature_arg, jlong htlc_signatures_arg) {
6812 LDKThirtyTwoBytes channel_id_arg_ref;
6813 (*_env)->GetByteArrayRegion (_env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
6814 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
6815 FREE((void*)signature_arg);
6816 LDKCVec_SignatureZ htlc_signatures_arg_conv = *(LDKCVec_SignatureZ*)htlc_signatures_arg;
6817 FREE((void*)htlc_signatures_arg);
6818 LDKCommitmentSigned* ret = MALLOC(sizeof(LDKCommitmentSigned), "LDKCommitmentSigned");
6819 *ret = CommitmentSigned_new(channel_id_arg_ref, signature_arg_conv, htlc_signatures_arg_conv);
6820 DO_ASSERT(ret->is_owned);
6821 ret->is_owned = false;
6825 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6826 LDKRevokeAndACK this_ptr_conv = *(LDKRevokeAndACK*)this_ptr;
6827 FREE((void*)this_ptr);
6828 this_ptr_conv.is_owned = true;
6829 return RevokeAndACK_free(this_ptr_conv);
6832 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6833 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
6834 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6835 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *RevokeAndACK_get_channel_id(this_ptr_conv));
6839 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
6840 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
6841 LDKThirtyTwoBytes val_ref;
6842 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
6843 return RevokeAndACK_set_channel_id(this_ptr_conv, val_ref);
6846 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr) {
6847 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
6848 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6849 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *RevokeAndACK_get_per_commitment_secret(this_ptr_conv));
6853 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
6854 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
6855 LDKThirtyTwoBytes val_ref;
6856 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
6857 return RevokeAndACK_set_per_commitment_secret(this_ptr_conv, val_ref);
6860 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
6861 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
6862 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6863 *ret = RevokeAndACK_get_next_per_commitment_point(this_ptr_conv);
6867 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6868 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
6869 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6871 return RevokeAndACK_set_next_per_commitment_point(this_ptr_conv, val_conv);
6874 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1new(JNIEnv * _env, jclass _b, jbyteArray channel_id_arg, jbyteArray per_commitment_secret_arg, jlong next_per_commitment_point_arg) {
6875 LDKThirtyTwoBytes channel_id_arg_ref;
6876 (*_env)->GetByteArrayRegion (_env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
6877 LDKThirtyTwoBytes per_commitment_secret_arg_ref;
6878 (*_env)->GetByteArrayRegion (_env, per_commitment_secret_arg, 0, 32, per_commitment_secret_arg_ref.data);
6879 LDKPublicKey next_per_commitment_point_arg_conv = *(LDKPublicKey*)next_per_commitment_point_arg;
6880 FREE((void*)next_per_commitment_point_arg);
6881 LDKRevokeAndACK* ret = MALLOC(sizeof(LDKRevokeAndACK), "LDKRevokeAndACK");
6882 *ret = RevokeAndACK_new(channel_id_arg_ref, per_commitment_secret_arg_ref, next_per_commitment_point_arg_conv);
6883 DO_ASSERT(ret->is_owned);
6884 ret->is_owned = false;
6888 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6889 LDKUpdateFee this_ptr_conv = *(LDKUpdateFee*)this_ptr;
6890 FREE((void*)this_ptr);
6891 this_ptr_conv.is_owned = true;
6892 return UpdateFee_free(this_ptr_conv);
6895 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6896 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
6897 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6898 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFee_get_channel_id(this_ptr_conv));
6902 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
6903 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
6904 LDKThirtyTwoBytes val_ref;
6905 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
6906 return UpdateFee_set_channel_id(this_ptr_conv, val_ref);
6909 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr) {
6910 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
6911 return UpdateFee_get_feerate_per_kw(this_ptr_conv);
6914 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6915 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
6916 return UpdateFee_set_feerate_per_kw(this_ptr_conv, val);
6919 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1new(JNIEnv * _env, jclass _b, jbyteArray channel_id_arg, jint feerate_per_kw_arg) {
6920 LDKThirtyTwoBytes channel_id_arg_ref;
6921 (*_env)->GetByteArrayRegion (_env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
6922 LDKUpdateFee* ret = MALLOC(sizeof(LDKUpdateFee), "LDKUpdateFee");
6923 *ret = UpdateFee_new(channel_id_arg_ref, feerate_per_kw_arg);
6924 DO_ASSERT(ret->is_owned);
6925 ret->is_owned = false;
6929 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6930 LDKDataLossProtect this_ptr_conv = *(LDKDataLossProtect*)this_ptr;
6931 FREE((void*)this_ptr);
6932 this_ptr_conv.is_owned = true;
6933 return DataLossProtect_free(this_ptr_conv);
6936 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1your_1last_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr) {
6937 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
6938 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6939 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *DataLossProtect_get_your_last_per_commitment_secret(this_ptr_conv));
6943 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1your_1last_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
6944 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
6945 LDKThirtyTwoBytes val_ref;
6946 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
6947 return DataLossProtect_set_your_last_per_commitment_secret(this_ptr_conv, val_ref);
6950 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1my_1current_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
6951 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
6952 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6953 *ret = DataLossProtect_get_my_current_per_commitment_point(this_ptr_conv);
6957 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1my_1current_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6958 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
6959 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6961 return DataLossProtect_set_my_current_per_commitment_point(this_ptr_conv, val_conv);
6964 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1new(JNIEnv * _env, jclass _b, jbyteArray your_last_per_commitment_secret_arg, jlong my_current_per_commitment_point_arg) {
6965 LDKThirtyTwoBytes your_last_per_commitment_secret_arg_ref;
6966 (*_env)->GetByteArrayRegion (_env, your_last_per_commitment_secret_arg, 0, 32, your_last_per_commitment_secret_arg_ref.data);
6967 LDKPublicKey my_current_per_commitment_point_arg_conv = *(LDKPublicKey*)my_current_per_commitment_point_arg;
6968 FREE((void*)my_current_per_commitment_point_arg);
6969 LDKDataLossProtect* ret = MALLOC(sizeof(LDKDataLossProtect), "LDKDataLossProtect");
6970 *ret = DataLossProtect_new(your_last_per_commitment_secret_arg_ref, my_current_per_commitment_point_arg_conv);
6971 DO_ASSERT(ret->is_owned);
6972 ret->is_owned = false;
6976 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6977 LDKChannelReestablish this_ptr_conv = *(LDKChannelReestablish*)this_ptr;
6978 FREE((void*)this_ptr);
6979 this_ptr_conv.is_owned = true;
6980 return ChannelReestablish_free(this_ptr_conv);
6983 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6984 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
6985 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6986 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ChannelReestablish_get_channel_id(this_ptr_conv));
6990 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
6991 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
6992 LDKThirtyTwoBytes val_ref;
6993 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
6994 return ChannelReestablish_set_channel_id(this_ptr_conv, val_ref);
6997 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1local_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr) {
6998 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
6999 return ChannelReestablish_get_next_local_commitment_number(this_ptr_conv);
7002 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1local_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7003 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
7004 return ChannelReestablish_set_next_local_commitment_number(this_ptr_conv, val);
7007 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1remote_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr) {
7008 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
7009 return ChannelReestablish_get_next_remote_commitment_number(this_ptr_conv);
7012 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1remote_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7013 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
7014 return ChannelReestablish_set_next_remote_commitment_number(this_ptr_conv, val);
7017 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7018 LDKAnnouncementSignatures this_ptr_conv = *(LDKAnnouncementSignatures*)this_ptr;
7019 FREE((void*)this_ptr);
7020 this_ptr_conv.is_owned = true;
7021 return AnnouncementSignatures_free(this_ptr_conv);
7024 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
7025 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
7026 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
7027 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *AnnouncementSignatures_get_channel_id(this_ptr_conv));
7031 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
7032 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
7033 LDKThirtyTwoBytes val_ref;
7034 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
7035 return AnnouncementSignatures_set_channel_id(this_ptr_conv, val_ref);
7038 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
7039 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
7040 return AnnouncementSignatures_get_short_channel_id(this_ptr_conv);
7043 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7044 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
7045 return AnnouncementSignatures_set_short_channel_id(this_ptr_conv, val);
7048 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1node_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
7049 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
7050 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
7051 *ret = AnnouncementSignatures_get_node_signature(this_ptr_conv);
7055 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1node_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7056 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
7057 LDKSignature val_conv = *(LDKSignature*)val;
7059 return AnnouncementSignatures_set_node_signature(this_ptr_conv, val_conv);
7062 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1bitcoin_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
7063 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
7064 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
7065 *ret = AnnouncementSignatures_get_bitcoin_signature(this_ptr_conv);
7069 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1bitcoin_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7070 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
7071 LDKSignature val_conv = *(LDKSignature*)val;
7073 return AnnouncementSignatures_set_bitcoin_signature(this_ptr_conv, val_conv);
7076 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1new(JNIEnv * _env, jclass _b, jbyteArray channel_id_arg, jlong short_channel_id_arg, jlong node_signature_arg, jlong bitcoin_signature_arg) {
7077 LDKThirtyTwoBytes channel_id_arg_ref;
7078 (*_env)->GetByteArrayRegion (_env, channel_id_arg, 0, 32, channel_id_arg_ref.data);
7079 LDKSignature node_signature_arg_conv = *(LDKSignature*)node_signature_arg;
7080 FREE((void*)node_signature_arg);
7081 LDKSignature bitcoin_signature_arg_conv = *(LDKSignature*)bitcoin_signature_arg;
7082 FREE((void*)bitcoin_signature_arg);
7083 LDKAnnouncementSignatures* ret = MALLOC(sizeof(LDKAnnouncementSignatures), "LDKAnnouncementSignatures");
7084 *ret = AnnouncementSignatures_new(channel_id_arg_ref, short_channel_id_arg, node_signature_arg_conv, bitcoin_signature_arg_conv);
7085 DO_ASSERT(ret->is_owned);
7086 ret->is_owned = false;
7090 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetAddress_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7091 LDKNetAddress this_ptr_conv = *(LDKNetAddress*)this_ptr;
7092 FREE((void*)this_ptr);
7093 return NetAddress_free(this_ptr_conv);
7096 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7097 LDKUnsignedNodeAnnouncement this_ptr_conv = *(LDKUnsignedNodeAnnouncement*)this_ptr;
7098 FREE((void*)this_ptr);
7099 this_ptr_conv.is_owned = true;
7100 return UnsignedNodeAnnouncement_free(this_ptr_conv);
7103 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
7104 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
7105 LDKNodeFeatures* ret = MALLOC(sizeof(LDKNodeFeatures), "LDKNodeFeatures");
7106 *ret = UnsignedNodeAnnouncement_get_features(this_ptr_conv);
7107 DO_ASSERT(ret->is_owned);
7108 ret->is_owned = false;
7112 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7113 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
7114 LDKNodeFeatures val_conv = *(LDKNodeFeatures*)val;
7116 val_conv.is_owned = true;
7117 return UnsignedNodeAnnouncement_set_features(this_ptr_conv, val_conv);
7120 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr) {
7121 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
7122 return UnsignedNodeAnnouncement_get_timestamp(this_ptr_conv);
7125 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
7126 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
7127 return UnsignedNodeAnnouncement_set_timestamp(this_ptr_conv, val);
7130 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
7131 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
7132 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
7133 *ret = UnsignedNodeAnnouncement_get_node_id(this_ptr_conv);
7137 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7138 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
7139 LDKPublicKey val_conv = *(LDKPublicKey*)val;
7141 return UnsignedNodeAnnouncement_set_node_id(this_ptr_conv, val_conv);
7144 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr) {
7145 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
7146 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 3);
7147 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 3, *UnsignedNodeAnnouncement_get_rgb(this_ptr_conv));
7151 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7152 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
7153 LDKThreeBytes val_conv = *(LDKThreeBytes*)val;
7155 return UnsignedNodeAnnouncement_set_rgb(this_ptr_conv, val_conv);
7158 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1alias(JNIEnv * _env, jclass _b, jlong this_ptr) {
7159 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
7160 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
7161 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedNodeAnnouncement_get_alias(this_ptr_conv));
7165 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1alias(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
7166 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
7167 LDKThirtyTwoBytes val_ref;
7168 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
7169 return UnsignedNodeAnnouncement_set_alias(this_ptr_conv, val_ref);
7172 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1addresses(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7173 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
7174 LDKCVec_NetAddressZ val_conv = *(LDKCVec_NetAddressZ*)val;
7176 return UnsignedNodeAnnouncement_set_addresses(this_ptr_conv, val_conv);
7179 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7180 LDKNodeAnnouncement this_ptr_conv = *(LDKNodeAnnouncement*)this_ptr;
7181 FREE((void*)this_ptr);
7182 this_ptr_conv.is_owned = true;
7183 return NodeAnnouncement_free(this_ptr_conv);
7186 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
7187 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
7188 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
7189 *ret = NodeAnnouncement_get_signature(this_ptr_conv);
7193 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7194 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
7195 LDKSignature val_conv = *(LDKSignature*)val;
7197 return NodeAnnouncement_set_signature(this_ptr_conv, val_conv);
7200 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1contents(JNIEnv * _env, jclass _b, jlong this_ptr) {
7201 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
7202 LDKUnsignedNodeAnnouncement* ret = MALLOC(sizeof(LDKUnsignedNodeAnnouncement), "LDKUnsignedNodeAnnouncement");
7203 *ret = NodeAnnouncement_get_contents(this_ptr_conv);
7204 DO_ASSERT(ret->is_owned);
7205 ret->is_owned = false;
7209 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1contents(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7210 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
7211 LDKUnsignedNodeAnnouncement val_conv = *(LDKUnsignedNodeAnnouncement*)val;
7213 val_conv.is_owned = true;
7214 return NodeAnnouncement_set_contents(this_ptr_conv, val_conv);
7217 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1new(JNIEnv * _env, jclass _b, jlong signature_arg, jlong contents_arg) {
7218 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
7219 FREE((void*)signature_arg);
7220 LDKUnsignedNodeAnnouncement contents_arg_conv = *(LDKUnsignedNodeAnnouncement*)contents_arg;
7221 FREE((void*)contents_arg);
7222 contents_arg_conv.is_owned = true;
7223 LDKNodeAnnouncement* ret = MALLOC(sizeof(LDKNodeAnnouncement), "LDKNodeAnnouncement");
7224 *ret = NodeAnnouncement_new(signature_arg_conv, contents_arg_conv);
7225 DO_ASSERT(ret->is_owned);
7226 ret->is_owned = false;
7230 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7231 LDKUnsignedChannelAnnouncement this_ptr_conv = *(LDKUnsignedChannelAnnouncement*)this_ptr;
7232 FREE((void*)this_ptr);
7233 this_ptr_conv.is_owned = true;
7234 return UnsignedChannelAnnouncement_free(this_ptr_conv);
7237 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
7238 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
7239 LDKChannelFeatures* ret = MALLOC(sizeof(LDKChannelFeatures), "LDKChannelFeatures");
7240 *ret = UnsignedChannelAnnouncement_get_features(this_ptr_conv);
7241 DO_ASSERT(ret->is_owned);
7242 ret->is_owned = false;
7246 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7247 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
7248 LDKChannelFeatures val_conv = *(LDKChannelFeatures*)val;
7250 val_conv.is_owned = true;
7251 return UnsignedChannelAnnouncement_set_features(this_ptr_conv, val_conv);
7254 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
7255 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
7256 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
7257 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedChannelAnnouncement_get_chain_hash(this_ptr_conv));
7261 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
7262 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
7263 LDKThirtyTwoBytes val_ref;
7264 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
7265 return UnsignedChannelAnnouncement_set_chain_hash(this_ptr_conv, val_ref);
7268 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
7269 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
7270 return UnsignedChannelAnnouncement_get_short_channel_id(this_ptr_conv);
7273 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7274 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
7275 return UnsignedChannelAnnouncement_set_short_channel_id(this_ptr_conv, val);
7278 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
7279 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
7280 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
7281 *ret = UnsignedChannelAnnouncement_get_node_id_1(this_ptr_conv);
7285 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7286 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
7287 LDKPublicKey val_conv = *(LDKPublicKey*)val;
7289 return UnsignedChannelAnnouncement_set_node_id_1(this_ptr_conv, val_conv);
7292 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
7293 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
7294 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
7295 *ret = UnsignedChannelAnnouncement_get_node_id_2(this_ptr_conv);
7299 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7300 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
7301 LDKPublicKey val_conv = *(LDKPublicKey*)val;
7303 return UnsignedChannelAnnouncement_set_node_id_2(this_ptr_conv, val_conv);
7306 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
7307 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
7308 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
7309 *ret = UnsignedChannelAnnouncement_get_bitcoin_key_1(this_ptr_conv);
7313 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7314 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
7315 LDKPublicKey val_conv = *(LDKPublicKey*)val;
7317 return UnsignedChannelAnnouncement_set_bitcoin_key_1(this_ptr_conv, val_conv);
7320 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
7321 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
7322 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
7323 *ret = UnsignedChannelAnnouncement_get_bitcoin_key_2(this_ptr_conv);
7327 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7328 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
7329 LDKPublicKey val_conv = *(LDKPublicKey*)val;
7331 return UnsignedChannelAnnouncement_set_bitcoin_key_2(this_ptr_conv, val_conv);
7334 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7335 LDKChannelAnnouncement this_ptr_conv = *(LDKChannelAnnouncement*)this_ptr;
7336 FREE((void*)this_ptr);
7337 this_ptr_conv.is_owned = true;
7338 return ChannelAnnouncement_free(this_ptr_conv);
7341 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
7342 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
7343 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
7344 *ret = ChannelAnnouncement_get_node_signature_1(this_ptr_conv);
7348 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7349 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
7350 LDKSignature val_conv = *(LDKSignature*)val;
7352 return ChannelAnnouncement_set_node_signature_1(this_ptr_conv, val_conv);
7355 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
7356 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
7357 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
7358 *ret = ChannelAnnouncement_get_node_signature_2(this_ptr_conv);
7362 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7363 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
7364 LDKSignature val_conv = *(LDKSignature*)val;
7366 return ChannelAnnouncement_set_node_signature_2(this_ptr_conv, val_conv);
7369 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
7370 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
7371 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
7372 *ret = ChannelAnnouncement_get_bitcoin_signature_1(this_ptr_conv);
7376 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7377 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
7378 LDKSignature val_conv = *(LDKSignature*)val;
7380 return ChannelAnnouncement_set_bitcoin_signature_1(this_ptr_conv, val_conv);
7383 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
7384 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
7385 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
7386 *ret = ChannelAnnouncement_get_bitcoin_signature_2(this_ptr_conv);
7390 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7391 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
7392 LDKSignature val_conv = *(LDKSignature*)val;
7394 return ChannelAnnouncement_set_bitcoin_signature_2(this_ptr_conv, val_conv);
7397 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1contents(JNIEnv * _env, jclass _b, jlong this_ptr) {
7398 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
7399 LDKUnsignedChannelAnnouncement* ret = MALLOC(sizeof(LDKUnsignedChannelAnnouncement), "LDKUnsignedChannelAnnouncement");
7400 *ret = ChannelAnnouncement_get_contents(this_ptr_conv);
7401 DO_ASSERT(ret->is_owned);
7402 ret->is_owned = false;
7406 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1contents(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7407 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
7408 LDKUnsignedChannelAnnouncement val_conv = *(LDKUnsignedChannelAnnouncement*)val;
7410 val_conv.is_owned = true;
7411 return ChannelAnnouncement_set_contents(this_ptr_conv, val_conv);
7414 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) {
7415 LDKSignature node_signature_1_arg_conv = *(LDKSignature*)node_signature_1_arg;
7416 FREE((void*)node_signature_1_arg);
7417 LDKSignature node_signature_2_arg_conv = *(LDKSignature*)node_signature_2_arg;
7418 FREE((void*)node_signature_2_arg);
7419 LDKSignature bitcoin_signature_1_arg_conv = *(LDKSignature*)bitcoin_signature_1_arg;
7420 FREE((void*)bitcoin_signature_1_arg);
7421 LDKSignature bitcoin_signature_2_arg_conv = *(LDKSignature*)bitcoin_signature_2_arg;
7422 FREE((void*)bitcoin_signature_2_arg);
7423 LDKUnsignedChannelAnnouncement contents_arg_conv = *(LDKUnsignedChannelAnnouncement*)contents_arg;
7424 FREE((void*)contents_arg);
7425 contents_arg_conv.is_owned = true;
7426 LDKChannelAnnouncement* ret = MALLOC(sizeof(LDKChannelAnnouncement), "LDKChannelAnnouncement");
7427 *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);
7428 DO_ASSERT(ret->is_owned);
7429 ret->is_owned = false;
7433 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7434 LDKUnsignedChannelUpdate this_ptr_conv = *(LDKUnsignedChannelUpdate*)this_ptr;
7435 FREE((void*)this_ptr);
7436 this_ptr_conv.is_owned = true;
7437 return UnsignedChannelUpdate_free(this_ptr_conv);
7440 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
7441 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
7442 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
7443 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedChannelUpdate_get_chain_hash(this_ptr_conv));
7447 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
7448 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
7449 LDKThirtyTwoBytes val_ref;
7450 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
7451 return UnsignedChannelUpdate_set_chain_hash(this_ptr_conv, val_ref);
7454 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
7455 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
7456 return UnsignedChannelUpdate_get_short_channel_id(this_ptr_conv);
7459 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7460 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
7461 return UnsignedChannelUpdate_set_short_channel_id(this_ptr_conv, val);
7464 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr) {
7465 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
7466 return UnsignedChannelUpdate_get_timestamp(this_ptr_conv);
7469 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
7470 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
7471 return UnsignedChannelUpdate_set_timestamp(this_ptr_conv, val);
7474 JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1flags(JNIEnv * _env, jclass _b, jlong this_ptr) {
7475 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
7476 return UnsignedChannelUpdate_get_flags(this_ptr_conv);
7479 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1flags(JNIEnv * _env, jclass _b, jlong this_ptr, jbyte val) {
7480 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
7481 return UnsignedChannelUpdate_set_flags(this_ptr_conv, val);
7484 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
7485 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
7486 return UnsignedChannelUpdate_get_cltv_expiry_delta(this_ptr_conv);
7489 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
7490 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
7491 return UnsignedChannelUpdate_set_cltv_expiry_delta(this_ptr_conv, val);
7494 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
7495 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
7496 return UnsignedChannelUpdate_get_htlc_minimum_msat(this_ptr_conv);
7499 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7500 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
7501 return UnsignedChannelUpdate_set_htlc_minimum_msat(this_ptr_conv, val);
7504 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
7505 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
7506 return UnsignedChannelUpdate_get_fee_base_msat(this_ptr_conv);
7509 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
7510 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
7511 return UnsignedChannelUpdate_set_fee_base_msat(this_ptr_conv, val);
7514 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr) {
7515 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
7516 return UnsignedChannelUpdate_get_fee_proportional_millionths(this_ptr_conv);
7519 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
7520 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
7521 return UnsignedChannelUpdate_set_fee_proportional_millionths(this_ptr_conv, val);
7524 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7525 LDKChannelUpdate this_ptr_conv = *(LDKChannelUpdate*)this_ptr;
7526 FREE((void*)this_ptr);
7527 this_ptr_conv.is_owned = true;
7528 return ChannelUpdate_free(this_ptr_conv);
7531 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
7532 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
7533 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
7534 *ret = ChannelUpdate_get_signature(this_ptr_conv);
7538 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7539 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
7540 LDKSignature val_conv = *(LDKSignature*)val;
7542 return ChannelUpdate_set_signature(this_ptr_conv, val_conv);
7545 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1contents(JNIEnv * _env, jclass _b, jlong this_ptr) {
7546 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
7547 LDKUnsignedChannelUpdate* ret = MALLOC(sizeof(LDKUnsignedChannelUpdate), "LDKUnsignedChannelUpdate");
7548 *ret = ChannelUpdate_get_contents(this_ptr_conv);
7549 DO_ASSERT(ret->is_owned);
7550 ret->is_owned = false;
7554 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1contents(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7555 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
7556 LDKUnsignedChannelUpdate val_conv = *(LDKUnsignedChannelUpdate*)val;
7558 val_conv.is_owned = true;
7559 return ChannelUpdate_set_contents(this_ptr_conv, val_conv);
7562 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1new(JNIEnv * _env, jclass _b, jlong signature_arg, jlong contents_arg) {
7563 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
7564 FREE((void*)signature_arg);
7565 LDKUnsignedChannelUpdate contents_arg_conv = *(LDKUnsignedChannelUpdate*)contents_arg;
7566 FREE((void*)contents_arg);
7567 contents_arg_conv.is_owned = true;
7568 LDKChannelUpdate* ret = MALLOC(sizeof(LDKChannelUpdate), "LDKChannelUpdate");
7569 *ret = ChannelUpdate_new(signature_arg_conv, contents_arg_conv);
7570 DO_ASSERT(ret->is_owned);
7571 ret->is_owned = false;
7575 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7576 LDKQueryChannelRange this_ptr_conv = *(LDKQueryChannelRange*)this_ptr;
7577 FREE((void*)this_ptr);
7578 this_ptr_conv.is_owned = true;
7579 return QueryChannelRange_free(this_ptr_conv);
7582 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
7583 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
7584 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
7585 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *QueryChannelRange_get_chain_hash(this_ptr_conv));
7589 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
7590 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
7591 LDKThirtyTwoBytes val_ref;
7592 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
7593 return QueryChannelRange_set_chain_hash(this_ptr_conv, val_ref);
7596 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1first_1blocknum(JNIEnv * _env, jclass _b, jlong this_ptr) {
7597 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
7598 return QueryChannelRange_get_first_blocknum(this_ptr_conv);
7601 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1first_1blocknum(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
7602 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
7603 return QueryChannelRange_set_first_blocknum(this_ptr_conv, val);
7606 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1number_1of_1blocks(JNIEnv * _env, jclass _b, jlong this_ptr) {
7607 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
7608 return QueryChannelRange_get_number_of_blocks(this_ptr_conv);
7611 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1number_1of_1blocks(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
7612 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
7613 return QueryChannelRange_set_number_of_blocks(this_ptr_conv, val);
7616 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1new(JNIEnv * _env, jclass _b, jbyteArray chain_hash_arg, jint first_blocknum_arg, jint number_of_blocks_arg) {
7617 LDKThirtyTwoBytes chain_hash_arg_ref;
7618 (*_env)->GetByteArrayRegion (_env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
7619 LDKQueryChannelRange* ret = MALLOC(sizeof(LDKQueryChannelRange), "LDKQueryChannelRange");
7620 *ret = QueryChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg);
7621 DO_ASSERT(ret->is_owned);
7622 ret->is_owned = false;
7626 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7627 LDKReplyChannelRange this_ptr_conv = *(LDKReplyChannelRange*)this_ptr;
7628 FREE((void*)this_ptr);
7629 this_ptr_conv.is_owned = true;
7630 return ReplyChannelRange_free(this_ptr_conv);
7633 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
7634 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
7635 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
7636 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ReplyChannelRange_get_chain_hash(this_ptr_conv));
7640 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
7641 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
7642 LDKThirtyTwoBytes val_ref;
7643 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
7644 return ReplyChannelRange_set_chain_hash(this_ptr_conv, val_ref);
7647 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1first_1blocknum(JNIEnv * _env, jclass _b, jlong this_ptr) {
7648 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
7649 return ReplyChannelRange_get_first_blocknum(this_ptr_conv);
7652 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1first_1blocknum(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
7653 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
7654 return ReplyChannelRange_set_first_blocknum(this_ptr_conv, val);
7657 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1number_1of_1blocks(JNIEnv * _env, jclass _b, jlong this_ptr) {
7658 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
7659 return ReplyChannelRange_get_number_of_blocks(this_ptr_conv);
7662 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1number_1of_1blocks(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
7663 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
7664 return ReplyChannelRange_set_number_of_blocks(this_ptr_conv, val);
7667 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1full_1information(JNIEnv * _env, jclass _b, jlong this_ptr) {
7668 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
7669 return ReplyChannelRange_get_full_information(this_ptr_conv);
7672 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1full_1information(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
7673 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
7674 return ReplyChannelRange_set_full_information(this_ptr_conv, val);
7677 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1short_1channel_1ids(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7678 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
7679 LDKCVec_u64Z val_conv = *(LDKCVec_u64Z*)val;
7681 return ReplyChannelRange_set_short_channel_ids(this_ptr_conv, val_conv);
7684 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1new(JNIEnv * _env, jclass _b, jbyteArray chain_hash_arg, jint first_blocknum_arg, jint number_of_blocks_arg, jboolean full_information_arg, jlong short_channel_ids_arg) {
7685 LDKThirtyTwoBytes chain_hash_arg_ref;
7686 (*_env)->GetByteArrayRegion (_env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
7687 LDKCVec_u64Z short_channel_ids_arg_conv = *(LDKCVec_u64Z*)short_channel_ids_arg;
7688 FREE((void*)short_channel_ids_arg);
7689 LDKReplyChannelRange* ret = MALLOC(sizeof(LDKReplyChannelRange), "LDKReplyChannelRange");
7690 *ret = ReplyChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg, full_information_arg, short_channel_ids_arg_conv);
7691 DO_ASSERT(ret->is_owned);
7692 ret->is_owned = false;
7696 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7697 LDKQueryShortChannelIds this_ptr_conv = *(LDKQueryShortChannelIds*)this_ptr;
7698 FREE((void*)this_ptr);
7699 this_ptr_conv.is_owned = true;
7700 return QueryShortChannelIds_free(this_ptr_conv);
7703 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
7704 LDKQueryShortChannelIds* this_ptr_conv = (LDKQueryShortChannelIds*)this_ptr;
7705 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
7706 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *QueryShortChannelIds_get_chain_hash(this_ptr_conv));
7710 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
7711 LDKQueryShortChannelIds* this_ptr_conv = (LDKQueryShortChannelIds*)this_ptr;
7712 LDKThirtyTwoBytes val_ref;
7713 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
7714 return QueryShortChannelIds_set_chain_hash(this_ptr_conv, val_ref);
7717 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1short_1channel_1ids(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7718 LDKQueryShortChannelIds* this_ptr_conv = (LDKQueryShortChannelIds*)this_ptr;
7719 LDKCVec_u64Z val_conv = *(LDKCVec_u64Z*)val;
7721 return QueryShortChannelIds_set_short_channel_ids(this_ptr_conv, val_conv);
7724 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1new(JNIEnv * _env, jclass _b, jbyteArray chain_hash_arg, jlong short_channel_ids_arg) {
7725 LDKThirtyTwoBytes chain_hash_arg_ref;
7726 (*_env)->GetByteArrayRegion (_env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
7727 LDKCVec_u64Z short_channel_ids_arg_conv = *(LDKCVec_u64Z*)short_channel_ids_arg;
7728 FREE((void*)short_channel_ids_arg);
7729 LDKQueryShortChannelIds* ret = MALLOC(sizeof(LDKQueryShortChannelIds), "LDKQueryShortChannelIds");
7730 *ret = QueryShortChannelIds_new(chain_hash_arg_ref, short_channel_ids_arg_conv);
7731 DO_ASSERT(ret->is_owned);
7732 ret->is_owned = false;
7736 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7737 LDKReplyShortChannelIdsEnd this_ptr_conv = *(LDKReplyShortChannelIdsEnd*)this_ptr;
7738 FREE((void*)this_ptr);
7739 this_ptr_conv.is_owned = true;
7740 return ReplyShortChannelIdsEnd_free(this_ptr_conv);
7743 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
7744 LDKReplyShortChannelIdsEnd* this_ptr_conv = (LDKReplyShortChannelIdsEnd*)this_ptr;
7745 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
7746 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ReplyShortChannelIdsEnd_get_chain_hash(this_ptr_conv));
7750 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
7751 LDKReplyShortChannelIdsEnd* this_ptr_conv = (LDKReplyShortChannelIdsEnd*)this_ptr;
7752 LDKThirtyTwoBytes val_ref;
7753 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
7754 return ReplyShortChannelIdsEnd_set_chain_hash(this_ptr_conv, val_ref);
7757 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1full_1information(JNIEnv * _env, jclass _b, jlong this_ptr) {
7758 LDKReplyShortChannelIdsEnd* this_ptr_conv = (LDKReplyShortChannelIdsEnd*)this_ptr;
7759 return ReplyShortChannelIdsEnd_get_full_information(this_ptr_conv);
7762 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1full_1information(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
7763 LDKReplyShortChannelIdsEnd* this_ptr_conv = (LDKReplyShortChannelIdsEnd*)this_ptr;
7764 return ReplyShortChannelIdsEnd_set_full_information(this_ptr_conv, val);
7767 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1new(JNIEnv * _env, jclass _b, jbyteArray chain_hash_arg, jboolean full_information_arg) {
7768 LDKThirtyTwoBytes chain_hash_arg_ref;
7769 (*_env)->GetByteArrayRegion (_env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
7770 LDKReplyShortChannelIdsEnd* ret = MALLOC(sizeof(LDKReplyShortChannelIdsEnd), "LDKReplyShortChannelIdsEnd");
7771 *ret = ReplyShortChannelIdsEnd_new(chain_hash_arg_ref, full_information_arg);
7772 DO_ASSERT(ret->is_owned);
7773 ret->is_owned = false;
7777 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7778 LDKGossipTimestampFilter this_ptr_conv = *(LDKGossipTimestampFilter*)this_ptr;
7779 FREE((void*)this_ptr);
7780 this_ptr_conv.is_owned = true;
7781 return GossipTimestampFilter_free(this_ptr_conv);
7784 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
7785 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
7786 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
7787 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *GossipTimestampFilter_get_chain_hash(this_ptr_conv));
7791 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
7792 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
7793 LDKThirtyTwoBytes val_ref;
7794 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
7795 return GossipTimestampFilter_set_chain_hash(this_ptr_conv, val_ref);
7798 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1first_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr) {
7799 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
7800 return GossipTimestampFilter_get_first_timestamp(this_ptr_conv);
7803 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1first_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
7804 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
7805 return GossipTimestampFilter_set_first_timestamp(this_ptr_conv, val);
7808 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1timestamp_1range(JNIEnv * _env, jclass _b, jlong this_ptr) {
7809 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
7810 return GossipTimestampFilter_get_timestamp_range(this_ptr_conv);
7813 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1timestamp_1range(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
7814 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
7815 return GossipTimestampFilter_set_timestamp_range(this_ptr_conv, val);
7818 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1new(JNIEnv * _env, jclass _b, jbyteArray chain_hash_arg, jint first_timestamp_arg, jint timestamp_range_arg) {
7819 LDKThirtyTwoBytes chain_hash_arg_ref;
7820 (*_env)->GetByteArrayRegion (_env, chain_hash_arg, 0, 32, chain_hash_arg_ref.data);
7821 LDKGossipTimestampFilter* ret = MALLOC(sizeof(LDKGossipTimestampFilter), "LDKGossipTimestampFilter");
7822 *ret = GossipTimestampFilter_new(chain_hash_arg_ref, first_timestamp_arg, timestamp_range_arg);
7823 DO_ASSERT(ret->is_owned);
7824 ret->is_owned = false;
7828 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorAction_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7829 LDKErrorAction this_ptr_conv = *(LDKErrorAction*)this_ptr;
7830 FREE((void*)this_ptr);
7831 return ErrorAction_free(this_ptr_conv);
7834 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7835 LDKLightningError this_ptr_conv = *(LDKLightningError*)this_ptr;
7836 FREE((void*)this_ptr);
7837 this_ptr_conv.is_owned = true;
7838 return LightningError_free(this_ptr_conv);
7841 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1err(JNIEnv * _env, jclass _b, jlong this_ptr) {
7842 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
7843 LDKStr* ret = MALLOC(sizeof(LDKStr), "LDKStr");
7844 *ret = LightningError_get_err(this_ptr_conv);
7848 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1err(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7849 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
7850 LDKCVec_u8Z val_conv = *(LDKCVec_u8Z*)val;
7852 return LightningError_set_err(this_ptr_conv, val_conv);
7855 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1action(JNIEnv * _env, jclass _b, jlong this_ptr) {
7856 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
7857 LDKErrorAction* ret = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
7858 *ret = LightningError_get_action(this_ptr_conv);
7862 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1action(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7863 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
7864 LDKErrorAction val_conv = *(LDKErrorAction*)val;
7866 return LightningError_set_action(this_ptr_conv, val_conv);
7869 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1new(JNIEnv * _env, jclass _b, jlong err_arg, jlong action_arg) {
7870 LDKCVec_u8Z err_arg_conv = *(LDKCVec_u8Z*)err_arg;
7871 FREE((void*)err_arg);
7872 LDKErrorAction action_arg_conv = *(LDKErrorAction*)action_arg;
7873 FREE((void*)action_arg);
7874 LDKLightningError* ret = MALLOC(sizeof(LDKLightningError), "LDKLightningError");
7875 *ret = LightningError_new(err_arg_conv, action_arg_conv);
7876 DO_ASSERT(ret->is_owned);
7877 ret->is_owned = false;
7881 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7882 LDKCommitmentUpdate this_ptr_conv = *(LDKCommitmentUpdate*)this_ptr;
7883 FREE((void*)this_ptr);
7884 this_ptr_conv.is_owned = true;
7885 return CommitmentUpdate_free(this_ptr_conv);
7888 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1add_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7889 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
7890 LDKCVec_UpdateAddHTLCZ val_conv = *(LDKCVec_UpdateAddHTLCZ*)val;
7892 return CommitmentUpdate_set_update_add_htlcs(this_ptr_conv, val_conv);
7895 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fulfill_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7896 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
7897 LDKCVec_UpdateFulfillHTLCZ val_conv = *(LDKCVec_UpdateFulfillHTLCZ*)val;
7899 return CommitmentUpdate_set_update_fulfill_htlcs(this_ptr_conv, val_conv);
7902 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7903 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
7904 LDKCVec_UpdateFailHTLCZ val_conv = *(LDKCVec_UpdateFailHTLCZ*)val;
7906 return CommitmentUpdate_set_update_fail_htlcs(this_ptr_conv, val_conv);
7909 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1malformed_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7910 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
7911 LDKCVec_UpdateFailMalformedHTLCZ val_conv = *(LDKCVec_UpdateFailMalformedHTLCZ*)val;
7913 return CommitmentUpdate_set_update_fail_malformed_htlcs(this_ptr_conv, val_conv);
7916 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fee(JNIEnv * _env, jclass _b, jlong this_ptr) {
7917 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
7918 LDKUpdateFee* ret = MALLOC(sizeof(LDKUpdateFee), "LDKUpdateFee");
7919 *ret = CommitmentUpdate_get_update_fee(this_ptr_conv);
7920 DO_ASSERT(ret->is_owned);
7921 ret->is_owned = false;
7925 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fee(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7926 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
7927 LDKUpdateFee val_conv = *(LDKUpdateFee*)val;
7929 val_conv.is_owned = true;
7930 return CommitmentUpdate_set_update_fee(this_ptr_conv, val_conv);
7933 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1commitment_1signed(JNIEnv * _env, jclass _b, jlong this_ptr) {
7934 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
7935 LDKCommitmentSigned* ret = MALLOC(sizeof(LDKCommitmentSigned), "LDKCommitmentSigned");
7936 *ret = CommitmentUpdate_get_commitment_signed(this_ptr_conv);
7937 DO_ASSERT(ret->is_owned);
7938 ret->is_owned = false;
7942 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1commitment_1signed(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7943 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
7944 LDKCommitmentSigned val_conv = *(LDKCommitmentSigned*)val;
7946 val_conv.is_owned = true;
7947 return CommitmentUpdate_set_commitment_signed(this_ptr_conv, val_conv);
7950 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) {
7951 LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg_conv = *(LDKCVec_UpdateAddHTLCZ*)update_add_htlcs_arg;
7952 FREE((void*)update_add_htlcs_arg);
7953 LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg_conv = *(LDKCVec_UpdateFulfillHTLCZ*)update_fulfill_htlcs_arg;
7954 FREE((void*)update_fulfill_htlcs_arg);
7955 LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg_conv = *(LDKCVec_UpdateFailHTLCZ*)update_fail_htlcs_arg;
7956 FREE((void*)update_fail_htlcs_arg);
7957 LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg_conv = *(LDKCVec_UpdateFailMalformedHTLCZ*)update_fail_malformed_htlcs_arg;
7958 FREE((void*)update_fail_malformed_htlcs_arg);
7959 LDKUpdateFee update_fee_arg_conv = *(LDKUpdateFee*)update_fee_arg;
7960 FREE((void*)update_fee_arg);
7961 update_fee_arg_conv.is_owned = true;
7962 LDKCommitmentSigned commitment_signed_arg_conv = *(LDKCommitmentSigned*)commitment_signed_arg;
7963 FREE((void*)commitment_signed_arg);
7964 commitment_signed_arg_conv.is_owned = true;
7965 LDKCommitmentUpdate* ret = MALLOC(sizeof(LDKCommitmentUpdate), "LDKCommitmentUpdate");
7966 *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);
7967 DO_ASSERT(ret->is_owned);
7968 ret->is_owned = false;
7972 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCFailChannelUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7973 LDKHTLCFailChannelUpdate this_ptr_conv = *(LDKHTLCFailChannelUpdate*)this_ptr;
7974 FREE((void*)this_ptr);
7975 return HTLCFailChannelUpdate_free(this_ptr_conv);
7978 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7979 LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)this_ptr;
7980 FREE((void*)this_ptr);
7981 return ChannelMessageHandler_free(this_ptr_conv);
7984 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7985 LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)this_ptr;
7986 FREE((void*)this_ptr);
7987 return RoutingMessageHandler_free(this_ptr_conv);
7990 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1write(JNIEnv * _env, jclass _b, jlong obj) {
7991 LDKAcceptChannel* obj_conv = (LDKAcceptChannel*)obj;
7992 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7993 *ret = AcceptChannel_write(obj_conv);
7997 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1read(JNIEnv * _env, jclass _b, jlong ser) {
7998 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7999 LDKAcceptChannel* ret = MALLOC(sizeof(LDKAcceptChannel), "LDKAcceptChannel");
8000 *ret = AcceptChannel_read(ser_conv);
8001 DO_ASSERT(ret->is_owned);
8002 ret->is_owned = false;
8006 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1write(JNIEnv * _env, jclass _b, jlong obj) {
8007 LDKAnnouncementSignatures* obj_conv = (LDKAnnouncementSignatures*)obj;
8008 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8009 *ret = AnnouncementSignatures_write(obj_conv);
8013 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1read(JNIEnv * _env, jclass _b, jlong ser) {
8014 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8015 LDKAnnouncementSignatures* ret = MALLOC(sizeof(LDKAnnouncementSignatures), "LDKAnnouncementSignatures");
8016 *ret = AnnouncementSignatures_read(ser_conv);
8017 DO_ASSERT(ret->is_owned);
8018 ret->is_owned = false;
8022 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1write(JNIEnv * _env, jclass _b, jlong obj) {
8023 LDKChannelReestablish* obj_conv = (LDKChannelReestablish*)obj;
8024 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8025 *ret = ChannelReestablish_write(obj_conv);
8029 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1read(JNIEnv * _env, jclass _b, jlong ser) {
8030 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8031 LDKChannelReestablish* ret = MALLOC(sizeof(LDKChannelReestablish), "LDKChannelReestablish");
8032 *ret = ChannelReestablish_read(ser_conv);
8033 DO_ASSERT(ret->is_owned);
8034 ret->is_owned = false;
8038 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
8039 LDKClosingSigned* obj_conv = (LDKClosingSigned*)obj;
8040 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8041 *ret = ClosingSigned_write(obj_conv);
8045 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1read(JNIEnv * _env, jclass _b, jlong ser) {
8046 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8047 LDKClosingSigned* ret = MALLOC(sizeof(LDKClosingSigned), "LDKClosingSigned");
8048 *ret = ClosingSigned_read(ser_conv);
8049 DO_ASSERT(ret->is_owned);
8050 ret->is_owned = false;
8054 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
8055 LDKCommitmentSigned* obj_conv = (LDKCommitmentSigned*)obj;
8056 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8057 *ret = CommitmentSigned_write(obj_conv);
8061 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1read(JNIEnv * _env, jclass _b, jlong ser) {
8062 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8063 LDKCommitmentSigned* ret = MALLOC(sizeof(LDKCommitmentSigned), "LDKCommitmentSigned");
8064 *ret = CommitmentSigned_read(ser_conv);
8065 DO_ASSERT(ret->is_owned);
8066 ret->is_owned = false;
8070 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1write(JNIEnv * _env, jclass _b, jlong obj) {
8071 LDKFundingCreated* obj_conv = (LDKFundingCreated*)obj;
8072 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8073 *ret = FundingCreated_write(obj_conv);
8077 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1read(JNIEnv * _env, jclass _b, jlong ser) {
8078 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8079 LDKFundingCreated* ret = MALLOC(sizeof(LDKFundingCreated), "LDKFundingCreated");
8080 *ret = FundingCreated_read(ser_conv);
8081 DO_ASSERT(ret->is_owned);
8082 ret->is_owned = false;
8086 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
8087 LDKFundingSigned* obj_conv = (LDKFundingSigned*)obj;
8088 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8089 *ret = FundingSigned_write(obj_conv);
8093 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1read(JNIEnv * _env, jclass _b, jlong ser) {
8094 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8095 LDKFundingSigned* ret = MALLOC(sizeof(LDKFundingSigned), "LDKFundingSigned");
8096 *ret = FundingSigned_read(ser_conv);
8097 DO_ASSERT(ret->is_owned);
8098 ret->is_owned = false;
8102 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1write(JNIEnv * _env, jclass _b, jlong obj) {
8103 LDKFundingLocked* obj_conv = (LDKFundingLocked*)obj;
8104 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8105 *ret = FundingLocked_write(obj_conv);
8109 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1read(JNIEnv * _env, jclass _b, jlong ser) {
8110 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8111 LDKFundingLocked* ret = MALLOC(sizeof(LDKFundingLocked), "LDKFundingLocked");
8112 *ret = FundingLocked_read(ser_conv);
8113 DO_ASSERT(ret->is_owned);
8114 ret->is_owned = false;
8118 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1write(JNIEnv * _env, jclass _b, jlong obj) {
8119 LDKInit* obj_conv = (LDKInit*)obj;
8120 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8121 *ret = Init_write(obj_conv);
8125 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1read(JNIEnv * _env, jclass _b, jlong ser) {
8126 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8127 LDKInit* ret = MALLOC(sizeof(LDKInit), "LDKInit");
8128 *ret = Init_read(ser_conv);
8129 DO_ASSERT(ret->is_owned);
8130 ret->is_owned = false;
8134 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1write(JNIEnv * _env, jclass _b, jlong obj) {
8135 LDKOpenChannel* obj_conv = (LDKOpenChannel*)obj;
8136 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8137 *ret = OpenChannel_write(obj_conv);
8141 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1read(JNIEnv * _env, jclass _b, jlong ser) {
8142 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8143 LDKOpenChannel* ret = MALLOC(sizeof(LDKOpenChannel), "LDKOpenChannel");
8144 *ret = OpenChannel_read(ser_conv);
8145 DO_ASSERT(ret->is_owned);
8146 ret->is_owned = false;
8150 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1write(JNIEnv * _env, jclass _b, jlong obj) {
8151 LDKRevokeAndACK* obj_conv = (LDKRevokeAndACK*)obj;
8152 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8153 *ret = RevokeAndACK_write(obj_conv);
8157 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1read(JNIEnv * _env, jclass _b, jlong ser) {
8158 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8159 LDKRevokeAndACK* ret = MALLOC(sizeof(LDKRevokeAndACK), "LDKRevokeAndACK");
8160 *ret = RevokeAndACK_read(ser_conv);
8161 DO_ASSERT(ret->is_owned);
8162 ret->is_owned = false;
8166 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1write(JNIEnv * _env, jclass _b, jlong obj) {
8167 LDKShutdown* obj_conv = (LDKShutdown*)obj;
8168 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8169 *ret = Shutdown_write(obj_conv);
8173 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1read(JNIEnv * _env, jclass _b, jlong ser) {
8174 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8175 LDKShutdown* ret = MALLOC(sizeof(LDKShutdown), "LDKShutdown");
8176 *ret = Shutdown_read(ser_conv);
8177 DO_ASSERT(ret->is_owned);
8178 ret->is_owned = false;
8182 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
8183 LDKUpdateFailHTLC* obj_conv = (LDKUpdateFailHTLC*)obj;
8184 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8185 *ret = UpdateFailHTLC_write(obj_conv);
8189 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
8190 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8191 LDKUpdateFailHTLC* ret = MALLOC(sizeof(LDKUpdateFailHTLC), "LDKUpdateFailHTLC");
8192 *ret = UpdateFailHTLC_read(ser_conv);
8193 DO_ASSERT(ret->is_owned);
8194 ret->is_owned = false;
8198 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
8199 LDKUpdateFailMalformedHTLC* obj_conv = (LDKUpdateFailMalformedHTLC*)obj;
8200 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8201 *ret = UpdateFailMalformedHTLC_write(obj_conv);
8205 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
8206 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8207 LDKUpdateFailMalformedHTLC* ret = MALLOC(sizeof(LDKUpdateFailMalformedHTLC), "LDKUpdateFailMalformedHTLC");
8208 *ret = UpdateFailMalformedHTLC_read(ser_conv);
8209 DO_ASSERT(ret->is_owned);
8210 ret->is_owned = false;
8214 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1write(JNIEnv * _env, jclass _b, jlong obj) {
8215 LDKUpdateFee* obj_conv = (LDKUpdateFee*)obj;
8216 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8217 *ret = UpdateFee_write(obj_conv);
8221 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1read(JNIEnv * _env, jclass _b, jlong ser) {
8222 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8223 LDKUpdateFee* ret = MALLOC(sizeof(LDKUpdateFee), "LDKUpdateFee");
8224 *ret = UpdateFee_read(ser_conv);
8225 DO_ASSERT(ret->is_owned);
8226 ret->is_owned = false;
8230 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
8231 LDKUpdateFulfillHTLC* obj_conv = (LDKUpdateFulfillHTLC*)obj;
8232 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8233 *ret = UpdateFulfillHTLC_write(obj_conv);
8237 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
8238 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8239 LDKUpdateFulfillHTLC* ret = MALLOC(sizeof(LDKUpdateFulfillHTLC), "LDKUpdateFulfillHTLC");
8240 *ret = UpdateFulfillHTLC_read(ser_conv);
8241 DO_ASSERT(ret->is_owned);
8242 ret->is_owned = false;
8246 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
8247 LDKUpdateAddHTLC* obj_conv = (LDKUpdateAddHTLC*)obj;
8248 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8249 *ret = UpdateAddHTLC_write(obj_conv);
8253 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
8254 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8255 LDKUpdateAddHTLC* ret = MALLOC(sizeof(LDKUpdateAddHTLC), "LDKUpdateAddHTLC");
8256 *ret = UpdateAddHTLC_read(ser_conv);
8257 DO_ASSERT(ret->is_owned);
8258 ret->is_owned = false;
8262 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1write(JNIEnv * _env, jclass _b, jlong obj) {
8263 LDKPing* obj_conv = (LDKPing*)obj;
8264 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8265 *ret = Ping_write(obj_conv);
8269 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1read(JNIEnv * _env, jclass _b, jlong ser) {
8270 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8271 LDKPing* ret = MALLOC(sizeof(LDKPing), "LDKPing");
8272 *ret = Ping_read(ser_conv);
8273 DO_ASSERT(ret->is_owned);
8274 ret->is_owned = false;
8278 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1write(JNIEnv * _env, jclass _b, jlong obj) {
8279 LDKPong* obj_conv = (LDKPong*)obj;
8280 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8281 *ret = Pong_write(obj_conv);
8285 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1read(JNIEnv * _env, jclass _b, jlong ser) {
8286 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8287 LDKPong* ret = MALLOC(sizeof(LDKPong), "LDKPong");
8288 *ret = Pong_read(ser_conv);
8289 DO_ASSERT(ret->is_owned);
8290 ret->is_owned = false;
8294 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
8295 LDKUnsignedChannelAnnouncement* obj_conv = (LDKUnsignedChannelAnnouncement*)obj;
8296 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8297 *ret = UnsignedChannelAnnouncement_write(obj_conv);
8301 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
8302 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8303 LDKUnsignedChannelAnnouncement* ret = MALLOC(sizeof(LDKUnsignedChannelAnnouncement), "LDKUnsignedChannelAnnouncement");
8304 *ret = UnsignedChannelAnnouncement_read(ser_conv);
8305 DO_ASSERT(ret->is_owned);
8306 ret->is_owned = false;
8310 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
8311 LDKChannelAnnouncement* obj_conv = (LDKChannelAnnouncement*)obj;
8312 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8313 *ret = ChannelAnnouncement_write(obj_conv);
8317 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
8318 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8319 LDKChannelAnnouncement* ret = MALLOC(sizeof(LDKChannelAnnouncement), "LDKChannelAnnouncement");
8320 *ret = ChannelAnnouncement_read(ser_conv);
8321 DO_ASSERT(ret->is_owned);
8322 ret->is_owned = false;
8326 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
8327 LDKUnsignedChannelUpdate* obj_conv = (LDKUnsignedChannelUpdate*)obj;
8328 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8329 *ret = UnsignedChannelUpdate_write(obj_conv);
8333 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
8334 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8335 LDKUnsignedChannelUpdate* ret = MALLOC(sizeof(LDKUnsignedChannelUpdate), "LDKUnsignedChannelUpdate");
8336 *ret = UnsignedChannelUpdate_read(ser_conv);
8337 DO_ASSERT(ret->is_owned);
8338 ret->is_owned = false;
8342 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
8343 LDKChannelUpdate* obj_conv = (LDKChannelUpdate*)obj;
8344 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8345 *ret = ChannelUpdate_write(obj_conv);
8349 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
8350 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8351 LDKChannelUpdate* ret = MALLOC(sizeof(LDKChannelUpdate), "LDKChannelUpdate");
8352 *ret = ChannelUpdate_read(ser_conv);
8353 DO_ASSERT(ret->is_owned);
8354 ret->is_owned = false;
8358 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1write(JNIEnv * _env, jclass _b, jlong obj) {
8359 LDKErrorMessage* obj_conv = (LDKErrorMessage*)obj;
8360 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8361 *ret = ErrorMessage_write(obj_conv);
8365 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1read(JNIEnv * _env, jclass _b, jlong ser) {
8366 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8367 LDKErrorMessage* ret = MALLOC(sizeof(LDKErrorMessage), "LDKErrorMessage");
8368 *ret = ErrorMessage_read(ser_conv);
8369 DO_ASSERT(ret->is_owned);
8370 ret->is_owned = false;
8374 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
8375 LDKUnsignedNodeAnnouncement* obj_conv = (LDKUnsignedNodeAnnouncement*)obj;
8376 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8377 *ret = UnsignedNodeAnnouncement_write(obj_conv);
8381 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
8382 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8383 LDKUnsignedNodeAnnouncement* ret = MALLOC(sizeof(LDKUnsignedNodeAnnouncement), "LDKUnsignedNodeAnnouncement");
8384 *ret = UnsignedNodeAnnouncement_read(ser_conv);
8385 DO_ASSERT(ret->is_owned);
8386 ret->is_owned = false;
8390 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
8391 LDKNodeAnnouncement* obj_conv = (LDKNodeAnnouncement*)obj;
8392 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8393 *ret = NodeAnnouncement_write(obj_conv);
8397 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
8398 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8399 LDKNodeAnnouncement* ret = MALLOC(sizeof(LDKNodeAnnouncement), "LDKNodeAnnouncement");
8400 *ret = NodeAnnouncement_read(ser_conv);
8401 DO_ASSERT(ret->is_owned);
8402 ret->is_owned = false;
8406 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1read(JNIEnv * _env, jclass _b, jlong ser) {
8407 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8408 LDKQueryShortChannelIds* ret = MALLOC(sizeof(LDKQueryShortChannelIds), "LDKQueryShortChannelIds");
8409 *ret = QueryShortChannelIds_read(ser_conv);
8410 DO_ASSERT(ret->is_owned);
8411 ret->is_owned = false;
8415 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1write(JNIEnv * _env, jclass _b, jlong obj) {
8416 LDKQueryShortChannelIds* obj_conv = (LDKQueryShortChannelIds*)obj;
8417 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8418 *ret = QueryShortChannelIds_write(obj_conv);
8422 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1read(JNIEnv * _env, jclass _b, jlong ser) {
8423 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8424 LDKReplyShortChannelIdsEnd* ret = MALLOC(sizeof(LDKReplyShortChannelIdsEnd), "LDKReplyShortChannelIdsEnd");
8425 *ret = ReplyShortChannelIdsEnd_read(ser_conv);
8426 DO_ASSERT(ret->is_owned);
8427 ret->is_owned = false;
8431 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1write(JNIEnv * _env, jclass _b, jlong obj) {
8432 LDKReplyShortChannelIdsEnd* obj_conv = (LDKReplyShortChannelIdsEnd*)obj;
8433 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8434 *ret = ReplyShortChannelIdsEnd_write(obj_conv);
8438 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1read(JNIEnv * _env, jclass _b, jlong ser) {
8439 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8440 LDKQueryChannelRange* ret = MALLOC(sizeof(LDKQueryChannelRange), "LDKQueryChannelRange");
8441 *ret = QueryChannelRange_read(ser_conv);
8442 DO_ASSERT(ret->is_owned);
8443 ret->is_owned = false;
8447 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1write(JNIEnv * _env, jclass _b, jlong obj) {
8448 LDKQueryChannelRange* obj_conv = (LDKQueryChannelRange*)obj;
8449 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8450 *ret = QueryChannelRange_write(obj_conv);
8454 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1read(JNIEnv * _env, jclass _b, jlong ser) {
8455 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8456 LDKReplyChannelRange* ret = MALLOC(sizeof(LDKReplyChannelRange), "LDKReplyChannelRange");
8457 *ret = ReplyChannelRange_read(ser_conv);
8458 DO_ASSERT(ret->is_owned);
8459 ret->is_owned = false;
8463 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1write(JNIEnv * _env, jclass _b, jlong obj) {
8464 LDKReplyChannelRange* obj_conv = (LDKReplyChannelRange*)obj;
8465 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8466 *ret = ReplyChannelRange_write(obj_conv);
8470 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1read(JNIEnv * _env, jclass _b, jlong ser) {
8471 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8472 LDKGossipTimestampFilter* ret = MALLOC(sizeof(LDKGossipTimestampFilter), "LDKGossipTimestampFilter");
8473 *ret = GossipTimestampFilter_read(ser_conv);
8474 DO_ASSERT(ret->is_owned);
8475 ret->is_owned = false;
8479 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1write(JNIEnv * _env, jclass _b, jlong obj) {
8480 LDKGossipTimestampFilter* obj_conv = (LDKGossipTimestampFilter*)obj;
8481 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8482 *ret = GossipTimestampFilter_write(obj_conv);
8486 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8487 LDKMessageHandler this_ptr_conv = *(LDKMessageHandler*)this_ptr;
8488 FREE((void*)this_ptr);
8489 this_ptr_conv.is_owned = true;
8490 return MessageHandler_free(this_ptr_conv);
8493 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1chan_1handler(JNIEnv * _env, jclass _b, jlong this_ptr) {
8494 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
8495 long ret = (long)MessageHandler_get_chan_handler(this_ptr_conv);
8499 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1chan_1handler(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8500 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
8501 LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)val;
8502 if (val_conv.free == LDKChannelMessageHandler_JCalls_free) {
8503 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
8504 LDKChannelMessageHandler_JCalls_clone(val_conv.this_arg);
8506 return MessageHandler_set_chan_handler(this_ptr_conv, val_conv);
8509 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1route_1handler(JNIEnv * _env, jclass _b, jlong this_ptr) {
8510 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
8511 long ret = (long)MessageHandler_get_route_handler(this_ptr_conv);
8515 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1route_1handler(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8516 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
8517 LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)val;
8518 if (val_conv.free == LDKRoutingMessageHandler_JCalls_free) {
8519 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
8520 LDKRoutingMessageHandler_JCalls_clone(val_conv.this_arg);
8522 return MessageHandler_set_route_handler(this_ptr_conv, val_conv);
8525 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new(JNIEnv * _env, jclass _b, jlong chan_handler_arg, jlong route_handler_arg) {
8526 LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)chan_handler_arg;
8527 if (chan_handler_arg_conv.free == LDKChannelMessageHandler_JCalls_free) {
8528 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
8529 LDKChannelMessageHandler_JCalls_clone(chan_handler_arg_conv.this_arg);
8531 LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)route_handler_arg;
8532 if (route_handler_arg_conv.free == LDKRoutingMessageHandler_JCalls_free) {
8533 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
8534 LDKRoutingMessageHandler_JCalls_clone(route_handler_arg_conv.this_arg);
8536 LDKMessageHandler* ret = MALLOC(sizeof(LDKMessageHandler), "LDKMessageHandler");
8537 *ret = MessageHandler_new(chan_handler_arg_conv, route_handler_arg_conv);
8538 DO_ASSERT(ret->is_owned);
8539 ret->is_owned = false;
8543 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8544 LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)this_ptr;
8545 FREE((void*)this_ptr);
8546 return SocketDescriptor_free(this_ptr_conv);
8549 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8550 LDKPeerHandleError this_ptr_conv = *(LDKPeerHandleError*)this_ptr;
8551 FREE((void*)this_ptr);
8552 this_ptr_conv.is_owned = true;
8553 return PeerHandleError_free(this_ptr_conv);
8556 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1get_1no_1connection_1possible(JNIEnv * _env, jclass _b, jlong this_ptr) {
8557 LDKPeerHandleError* this_ptr_conv = (LDKPeerHandleError*)this_ptr;
8558 return PeerHandleError_get_no_connection_possible(this_ptr_conv);
8561 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1set_1no_1connection_1possible(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
8562 LDKPeerHandleError* this_ptr_conv = (LDKPeerHandleError*)this_ptr;
8563 return PeerHandleError_set_no_connection_possible(this_ptr_conv, val);
8566 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new(JNIEnv * _env, jclass _b, jboolean no_connection_possible_arg) {
8567 LDKPeerHandleError* ret = MALLOC(sizeof(LDKPeerHandleError), "LDKPeerHandleError");
8568 *ret = PeerHandleError_new(no_connection_possible_arg);
8569 DO_ASSERT(ret->is_owned);
8570 ret->is_owned = false;
8574 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8575 LDKPeerManager this_ptr_conv = *(LDKPeerManager*)this_ptr;
8576 FREE((void*)this_ptr);
8577 this_ptr_conv.is_owned = true;
8578 return PeerManager_free(this_ptr_conv);
8581 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) {
8582 LDKMessageHandler message_handler_conv = *(LDKMessageHandler*)message_handler;
8583 FREE((void*)message_handler);
8584 message_handler_conv.is_owned = true;
8585 LDKSecretKey our_node_secret_conv = *(LDKSecretKey*)our_node_secret;
8586 FREE((void*)our_node_secret);
8587 unsigned char ephemeral_random_data_arr[32];
8588 (*_env)->GetByteArrayRegion (_env, ephemeral_random_data, 0, 32, ephemeral_random_data_arr);
8589 unsigned char (*ephemeral_random_data_ref)[32] = &ephemeral_random_data_arr;
8590 LDKLogger logger_conv = *(LDKLogger*)logger;
8591 if (logger_conv.free == LDKLogger_JCalls_free) {
8592 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
8593 LDKLogger_JCalls_clone(logger_conv.this_arg);
8595 LDKPeerManager* ret = MALLOC(sizeof(LDKPeerManager), "LDKPeerManager");
8596 *ret = PeerManager_new(message_handler_conv, our_node_secret_conv, ephemeral_random_data_ref, logger_conv);
8597 DO_ASSERT(ret->is_owned);
8598 ret->is_owned = false;
8602 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1get_1peer_1node_1ids(JNIEnv * _env, jclass _b, jlong this_arg) {
8603 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
8604 LDKCVec_PublicKeyZ* ret = MALLOC(sizeof(LDKCVec_PublicKeyZ), "LDKCVec_PublicKeyZ");
8605 *ret = PeerManager_get_peer_node_ids(this_arg_conv);
8609 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) {
8610 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
8611 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
8612 FREE((void*)their_node_id);
8613 LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)descriptor;
8614 if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
8615 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
8616 LDKSocketDescriptor_JCalls_clone(descriptor_conv.this_arg);
8618 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
8619 *ret = PeerManager_new_outbound_connection(this_arg_conv, their_node_id_conv, descriptor_conv);
8623 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1inbound_1connection(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) {
8624 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
8625 LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)descriptor;
8626 if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
8627 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
8628 LDKSocketDescriptor_JCalls_clone(descriptor_conv.this_arg);
8630 LDKCResult_NonePeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
8631 *ret = PeerManager_new_inbound_connection(this_arg_conv, descriptor_conv);
8635 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1write_1buffer_1space_1avail(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) {
8636 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
8637 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor;
8638 LDKCResult_NonePeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
8639 *ret = PeerManager_write_buffer_space_avail(this_arg_conv, descriptor_conv);
8643 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1read_1event(JNIEnv * _env, jclass _b, jlong this_arg, jlong peer_descriptor, jlong data) {
8644 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
8645 LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor;
8646 LDKu8slice data_conv = *(LDKu8slice*)data;
8647 LDKCResult_boolPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
8648 *ret = PeerManager_read_event(this_arg_conv, peer_descriptor_conv, data_conv);
8652 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1process_1events(JNIEnv * _env, jclass _b, jlong this_arg) {
8653 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
8654 return PeerManager_process_events(this_arg_conv);
8657 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1socket_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) {
8658 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
8659 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor;
8660 return PeerManager_socket_disconnected(this_arg_conv, descriptor_conv);
8663 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1timer_1tick_1occured(JNIEnv * _env, jclass _b, jlong this_arg) {
8664 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
8665 return PeerManager_timer_tick_occured(this_arg_conv);
8668 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_build_1commitment_1secret(JNIEnv * _env, jclass _b, jbyteArray commitment_seed, jlong idx) {
8669 unsigned char commitment_seed_arr[32];
8670 (*_env)->GetByteArrayRegion (_env, commitment_seed, 0, 32, commitment_seed_arr);
8671 unsigned char (*commitment_seed_ref)[32] = &commitment_seed_arr;
8672 jbyteArray _arr = (*_env)->NewByteArray(_env, 32);
8673 (*_env)->SetByteArrayRegion(_env, _arr, 0, 32, build_commitment_secret(commitment_seed_ref, idx).data);
8677 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1private_1key(JNIEnv * _env, jclass _b, jlong per_commitment_point, jbyteArray base_secret) {
8678 LDKPublicKey per_commitment_point_conv = *(LDKPublicKey*)per_commitment_point;
8679 FREE((void*)per_commitment_point);
8680 unsigned char base_secret_arr[32];
8681 (*_env)->GetByteArrayRegion (_env, base_secret, 0, 32, base_secret_arr);
8682 unsigned char (*base_secret_ref)[32] = &base_secret_arr;
8683 LDKCResult_SecretKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ");
8684 *ret = derive_private_key(per_commitment_point_conv, base_secret_ref);
8688 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1public_1key(JNIEnv * _env, jclass _b, jlong per_commitment_point, jlong base_point) {
8689 LDKPublicKey per_commitment_point_conv = *(LDKPublicKey*)per_commitment_point;
8690 FREE((void*)per_commitment_point);
8691 LDKPublicKey base_point_conv = *(LDKPublicKey*)base_point;
8692 FREE((void*)base_point);
8693 LDKCResult_PublicKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ");
8694 *ret = derive_public_key(per_commitment_point_conv, base_point_conv);
8698 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) {
8699 unsigned char per_commitment_secret_arr[32];
8700 (*_env)->GetByteArrayRegion (_env, per_commitment_secret, 0, 32, per_commitment_secret_arr);
8701 unsigned char (*per_commitment_secret_ref)[32] = &per_commitment_secret_arr;
8702 unsigned char countersignatory_revocation_base_secret_arr[32];
8703 (*_env)->GetByteArrayRegion (_env, countersignatory_revocation_base_secret, 0, 32, countersignatory_revocation_base_secret_arr);
8704 unsigned char (*countersignatory_revocation_base_secret_ref)[32] = &countersignatory_revocation_base_secret_arr;
8705 LDKCResult_SecretKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ");
8706 *ret = derive_private_revocation_key(per_commitment_secret_ref, countersignatory_revocation_base_secret_ref);
8710 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) {
8711 LDKPublicKey per_commitment_point_conv = *(LDKPublicKey*)per_commitment_point;
8712 FREE((void*)per_commitment_point);
8713 LDKPublicKey countersignatory_revocation_base_point_conv = *(LDKPublicKey*)countersignatory_revocation_base_point;
8714 FREE((void*)countersignatory_revocation_base_point);
8715 LDKCResult_PublicKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ");
8716 *ret = derive_public_revocation_key(per_commitment_point_conv, countersignatory_revocation_base_point_conv);
8720 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8721 LDKTxCreationKeys this_ptr_conv = *(LDKTxCreationKeys*)this_ptr;
8722 FREE((void*)this_ptr);
8723 this_ptr_conv.is_owned = true;
8724 return TxCreationKeys_free(this_ptr_conv);
8727 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
8728 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
8729 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
8730 *ret = TxCreationKeys_get_per_commitment_point(this_ptr_conv);
8734 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8735 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
8736 LDKPublicKey val_conv = *(LDKPublicKey*)val;
8738 return TxCreationKeys_set_per_commitment_point(this_ptr_conv, val_conv);
8741 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1revocation_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
8742 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
8743 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
8744 *ret = TxCreationKeys_get_revocation_key(this_ptr_conv);
8748 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1revocation_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8749 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
8750 LDKPublicKey val_conv = *(LDKPublicKey*)val;
8752 return TxCreationKeys_set_revocation_key(this_ptr_conv, val_conv);
8755 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
8756 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
8757 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
8758 *ret = TxCreationKeys_get_broadcaster_htlc_key(this_ptr_conv);
8762 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8763 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
8764 LDKPublicKey val_conv = *(LDKPublicKey*)val;
8766 return TxCreationKeys_set_broadcaster_htlc_key(this_ptr_conv, val_conv);
8769 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1countersignatory_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
8770 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
8771 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
8772 *ret = TxCreationKeys_get_countersignatory_htlc_key(this_ptr_conv);
8776 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1countersignatory_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8777 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
8778 LDKPublicKey val_conv = *(LDKPublicKey*)val;
8780 return TxCreationKeys_set_countersignatory_htlc_key(this_ptr_conv, val_conv);
8783 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1delayed_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
8784 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
8785 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
8786 *ret = TxCreationKeys_get_broadcaster_delayed_payment_key(this_ptr_conv);
8790 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1delayed_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8791 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
8792 LDKPublicKey val_conv = *(LDKPublicKey*)val;
8794 return TxCreationKeys_set_broadcaster_delayed_payment_key(this_ptr_conv, val_conv);
8797 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) {
8798 LDKPublicKey per_commitment_point_arg_conv = *(LDKPublicKey*)per_commitment_point_arg;
8799 FREE((void*)per_commitment_point_arg);
8800 LDKPublicKey revocation_key_arg_conv = *(LDKPublicKey*)revocation_key_arg;
8801 FREE((void*)revocation_key_arg);
8802 LDKPublicKey broadcaster_htlc_key_arg_conv = *(LDKPublicKey*)broadcaster_htlc_key_arg;
8803 FREE((void*)broadcaster_htlc_key_arg);
8804 LDKPublicKey countersignatory_htlc_key_arg_conv = *(LDKPublicKey*)countersignatory_htlc_key_arg;
8805 FREE((void*)countersignatory_htlc_key_arg);
8806 LDKPublicKey broadcaster_delayed_payment_key_arg_conv = *(LDKPublicKey*)broadcaster_delayed_payment_key_arg;
8807 FREE((void*)broadcaster_delayed_payment_key_arg);
8808 LDKTxCreationKeys* ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
8809 *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);
8810 DO_ASSERT(ret->is_owned);
8811 ret->is_owned = false;
8815 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1write(JNIEnv * _env, jclass _b, jlong obj) {
8816 LDKTxCreationKeys* obj_conv = (LDKTxCreationKeys*)obj;
8817 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8818 *ret = TxCreationKeys_write(obj_conv);
8822 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1read(JNIEnv * _env, jclass _b, jlong ser) {
8823 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8824 LDKTxCreationKeys* ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
8825 *ret = TxCreationKeys_read(ser_conv);
8826 DO_ASSERT(ret->is_owned);
8827 ret->is_owned = false;
8831 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8832 LDKPreCalculatedTxCreationKeys this_ptr_conv = *(LDKPreCalculatedTxCreationKeys*)this_ptr;
8833 FREE((void*)this_ptr);
8834 this_ptr_conv.is_owned = true;
8835 return PreCalculatedTxCreationKeys_free(this_ptr_conv);
8838 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1new(JNIEnv * _env, jclass _b, jlong keys) {
8839 LDKTxCreationKeys keys_conv = *(LDKTxCreationKeys*)keys;
8841 keys_conv.is_owned = true;
8842 LDKPreCalculatedTxCreationKeys* ret = MALLOC(sizeof(LDKPreCalculatedTxCreationKeys), "LDKPreCalculatedTxCreationKeys");
8843 *ret = PreCalculatedTxCreationKeys_new(keys_conv);
8844 DO_ASSERT(ret->is_owned);
8845 ret->is_owned = false;
8849 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1trust_1key_1derivation(JNIEnv * _env, jclass _b, jlong this_arg) {
8850 LDKPreCalculatedTxCreationKeys* this_arg_conv = (LDKPreCalculatedTxCreationKeys*)this_arg;
8851 LDKTxCreationKeys* ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
8852 *ret = PreCalculatedTxCreationKeys_trust_key_derivation(this_arg_conv);
8853 DO_ASSERT(ret->is_owned);
8854 ret->is_owned = false;
8858 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_arg) {
8859 LDKPreCalculatedTxCreationKeys* this_arg_conv = (LDKPreCalculatedTxCreationKeys*)this_arg;
8860 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
8861 *ret = PreCalculatedTxCreationKeys_per_commitment_point(this_arg_conv);
8865 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
8866 LDKChannelPublicKeys this_ptr_conv = *(LDKChannelPublicKeys*)this_ptr;
8867 FREE((void*)this_ptr);
8868 this_ptr_conv.is_owned = true;
8869 return ChannelPublicKeys_free(this_ptr_conv);
8872 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
8873 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
8874 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
8875 *ret = ChannelPublicKeys_get_funding_pubkey(this_ptr_conv);
8879 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8880 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
8881 LDKPublicKey val_conv = *(LDKPublicKey*)val;
8883 return ChannelPublicKeys_set_funding_pubkey(this_ptr_conv, val_conv);
8886 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
8887 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
8888 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
8889 *ret = ChannelPublicKeys_get_revocation_basepoint(this_ptr_conv);
8893 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8894 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
8895 LDKPublicKey val_conv = *(LDKPublicKey*)val;
8897 return ChannelPublicKeys_set_revocation_basepoint(this_ptr_conv, val_conv);
8900 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
8901 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
8902 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
8903 *ret = ChannelPublicKeys_get_payment_point(this_ptr_conv);
8907 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8908 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
8909 LDKPublicKey val_conv = *(LDKPublicKey*)val;
8911 return ChannelPublicKeys_set_payment_point(this_ptr_conv, val_conv);
8914 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
8915 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
8916 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
8917 *ret = ChannelPublicKeys_get_delayed_payment_basepoint(this_ptr_conv);
8921 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8922 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
8923 LDKPublicKey val_conv = *(LDKPublicKey*)val;
8925 return ChannelPublicKeys_set_delayed_payment_basepoint(this_ptr_conv, val_conv);
8928 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
8929 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
8930 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
8931 *ret = ChannelPublicKeys_get_htlc_basepoint(this_ptr_conv);
8935 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
8936 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
8937 LDKPublicKey val_conv = *(LDKPublicKey*)val;
8939 return ChannelPublicKeys_set_htlc_basepoint(this_ptr_conv, val_conv);
8942 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) {
8943 LDKPublicKey funding_pubkey_arg_conv = *(LDKPublicKey*)funding_pubkey_arg;
8944 FREE((void*)funding_pubkey_arg);
8945 LDKPublicKey revocation_basepoint_arg_conv = *(LDKPublicKey*)revocation_basepoint_arg;
8946 FREE((void*)revocation_basepoint_arg);
8947 LDKPublicKey payment_point_arg_conv = *(LDKPublicKey*)payment_point_arg;
8948 FREE((void*)payment_point_arg);
8949 LDKPublicKey delayed_payment_basepoint_arg_conv = *(LDKPublicKey*)delayed_payment_basepoint_arg;
8950 FREE((void*)delayed_payment_basepoint_arg);
8951 LDKPublicKey htlc_basepoint_arg_conv = *(LDKPublicKey*)htlc_basepoint_arg;
8952 FREE((void*)htlc_basepoint_arg);
8953 LDKChannelPublicKeys* ret = MALLOC(sizeof(LDKChannelPublicKeys), "LDKChannelPublicKeys");
8954 *ret = ChannelPublicKeys_new(funding_pubkey_arg_conv, revocation_basepoint_arg_conv, payment_point_arg_conv, delayed_payment_basepoint_arg_conv, htlc_basepoint_arg_conv);
8955 DO_ASSERT(ret->is_owned);
8956 ret->is_owned = false;
8960 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1write(JNIEnv * _env, jclass _b, jlong obj) {
8961 LDKChannelPublicKeys* obj_conv = (LDKChannelPublicKeys*)obj;
8962 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8963 *ret = ChannelPublicKeys_write(obj_conv);
8967 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1read(JNIEnv * _env, jclass _b, jlong ser) {
8968 LDKu8slice ser_conv = *(LDKu8slice*)ser;
8969 LDKChannelPublicKeys* ret = MALLOC(sizeof(LDKChannelPublicKeys), "LDKChannelPublicKeys");
8970 *ret = ChannelPublicKeys_read(ser_conv);
8971 DO_ASSERT(ret->is_owned);
8972 ret->is_owned = false;
8976 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) {
8977 LDKPublicKey per_commitment_point_conv = *(LDKPublicKey*)per_commitment_point;
8978 FREE((void*)per_commitment_point);
8979 LDKPublicKey broadcaster_delayed_payment_base_conv = *(LDKPublicKey*)broadcaster_delayed_payment_base;
8980 FREE((void*)broadcaster_delayed_payment_base);
8981 LDKPublicKey broadcaster_htlc_base_conv = *(LDKPublicKey*)broadcaster_htlc_base;
8982 FREE((void*)broadcaster_htlc_base);
8983 LDKPublicKey countersignatory_revocation_base_conv = *(LDKPublicKey*)countersignatory_revocation_base;
8984 FREE((void*)countersignatory_revocation_base);
8985 LDKPublicKey countersignatory_htlc_base_conv = *(LDKPublicKey*)countersignatory_htlc_base;
8986 FREE((void*)countersignatory_htlc_base);
8987 LDKCResult_TxCreationKeysSecpErrorZ* ret = MALLOC(sizeof(LDKCResult_TxCreationKeysSecpErrorZ), "LDKCResult_TxCreationKeysSecpErrorZ");
8988 *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);
8992 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) {
8993 LDKPublicKey revocation_key_conv = *(LDKPublicKey*)revocation_key;
8994 FREE((void*)revocation_key);
8995 LDKPublicKey broadcaster_delayed_payment_key_conv = *(LDKPublicKey*)broadcaster_delayed_payment_key;
8996 FREE((void*)broadcaster_delayed_payment_key);
8997 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
8998 *ret = get_revokeable_redeemscript(revocation_key_conv, contest_delay, broadcaster_delayed_payment_key_conv);
9002 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
9003 LDKHTLCOutputInCommitment this_ptr_conv = *(LDKHTLCOutputInCommitment*)this_ptr;
9004 FREE((void*)this_ptr);
9005 this_ptr_conv.is_owned = true;
9006 return HTLCOutputInCommitment_free(this_ptr_conv);
9009 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1offered(JNIEnv * _env, jclass _b, jlong this_ptr) {
9010 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
9011 return HTLCOutputInCommitment_get_offered(this_ptr_conv);
9014 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1offered(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
9015 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
9016 return HTLCOutputInCommitment_set_offered(this_ptr_conv, val);
9019 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
9020 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
9021 return HTLCOutputInCommitment_get_amount_msat(this_ptr_conv);
9024 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9025 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
9026 return HTLCOutputInCommitment_set_amount_msat(this_ptr_conv, val);
9029 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr) {
9030 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
9031 return HTLCOutputInCommitment_get_cltv_expiry(this_ptr_conv);
9034 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
9035 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
9036 return HTLCOutputInCommitment_set_cltv_expiry(this_ptr_conv, val);
9039 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
9040 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
9041 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
9042 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *HTLCOutputInCommitment_get_payment_hash(this_ptr_conv));
9046 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
9047 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
9048 LDKThirtyTwoBytes val_ref;
9049 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
9050 return HTLCOutputInCommitment_set_payment_hash(this_ptr_conv, val_ref);
9053 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1write(JNIEnv * _env, jclass _b, jlong obj) {
9054 LDKHTLCOutputInCommitment* obj_conv = (LDKHTLCOutputInCommitment*)obj;
9055 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
9056 *ret = HTLCOutputInCommitment_write(obj_conv);
9060 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1read(JNIEnv * _env, jclass _b, jlong ser) {
9061 LDKu8slice ser_conv = *(LDKu8slice*)ser;
9062 LDKHTLCOutputInCommitment* ret = MALLOC(sizeof(LDKHTLCOutputInCommitment), "LDKHTLCOutputInCommitment");
9063 *ret = HTLCOutputInCommitment_read(ser_conv);
9064 DO_ASSERT(ret->is_owned);
9065 ret->is_owned = false;
9069 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_get_1htlc_1redeemscript(JNIEnv * _env, jclass _b, jlong htlc, jlong keys) {
9070 LDKHTLCOutputInCommitment* htlc_conv = (LDKHTLCOutputInCommitment*)htlc;
9071 LDKTxCreationKeys* keys_conv = (LDKTxCreationKeys*)keys;
9072 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
9073 *ret = get_htlc_redeemscript(htlc_conv, keys_conv);
9077 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_make_1funding_1redeemscript(JNIEnv * _env, jclass _b, jlong broadcaster, jlong countersignatory) {
9078 LDKPublicKey broadcaster_conv = *(LDKPublicKey*)broadcaster;
9079 FREE((void*)broadcaster);
9080 LDKPublicKey countersignatory_conv = *(LDKPublicKey*)countersignatory;
9081 FREE((void*)countersignatory);
9082 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
9083 *ret = make_funding_redeemscript(broadcaster_conv, countersignatory_conv);
9087 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) {
9088 unsigned char prev_hash_arr[32];
9089 (*_env)->GetByteArrayRegion (_env, prev_hash, 0, 32, prev_hash_arr);
9090 unsigned char (*prev_hash_ref)[32] = &prev_hash_arr;
9091 LDKHTLCOutputInCommitment* htlc_conv = (LDKHTLCOutputInCommitment*)htlc;
9092 LDKPublicKey broadcaster_delayed_payment_key_conv = *(LDKPublicKey*)broadcaster_delayed_payment_key;
9093 FREE((void*)broadcaster_delayed_payment_key);
9094 LDKPublicKey revocation_key_conv = *(LDKPublicKey*)revocation_key;
9095 FREE((void*)revocation_key);
9096 LDKTransaction* ret = MALLOC(sizeof(LDKTransaction), "LDKTransaction");
9097 *ret = build_htlc_transaction(prev_hash_ref, feerate_per_kw, contest_delay, htlc_conv, broadcaster_delayed_payment_key_conv, revocation_key_conv);
9101 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
9102 LDKHolderCommitmentTransaction this_ptr_conv = *(LDKHolderCommitmentTransaction*)this_ptr;
9103 FREE((void*)this_ptr);
9104 this_ptr_conv.is_owned = true;
9105 return HolderCommitmentTransaction_free(this_ptr_conv);
9108 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1unsigned_1tx(JNIEnv * _env, jclass _b, jlong this_ptr) {
9109 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
9110 LDKTransaction* ret = MALLOC(sizeof(LDKTransaction), "LDKTransaction");
9111 *ret = HolderCommitmentTransaction_get_unsigned_tx(this_ptr_conv);
9115 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1unsigned_1tx(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9116 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
9117 LDKTransaction val_conv = *(LDKTransaction*)val;
9119 return HolderCommitmentTransaction_set_unsigned_tx(this_ptr_conv, val_conv);
9122 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1counterparty_1sig(JNIEnv * _env, jclass _b, jlong this_ptr) {
9123 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
9124 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
9125 *ret = HolderCommitmentTransaction_get_counterparty_sig(this_ptr_conv);
9129 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1sig(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9130 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
9131 LDKSignature val_conv = *(LDKSignature*)val;
9133 return HolderCommitmentTransaction_set_counterparty_sig(this_ptr_conv, val_conv);
9136 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr) {
9137 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
9138 return HolderCommitmentTransaction_get_feerate_per_kw(this_ptr_conv);
9141 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
9142 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
9143 return HolderCommitmentTransaction_set_feerate_per_kw(this_ptr_conv, val);
9146 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1per_1htlc(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9147 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
9148 LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ val_conv = *(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ*)val;
9150 return HolderCommitmentTransaction_set_per_htlc(this_ptr_conv, val_conv);
9153 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) {
9154 LDKTransaction unsigned_tx_conv = *(LDKTransaction*)unsigned_tx;
9155 FREE((void*)unsigned_tx);
9156 LDKSignature counterparty_sig_conv = *(LDKSignature*)counterparty_sig;
9157 FREE((void*)counterparty_sig);
9158 LDKPublicKey holder_funding_key_conv = *(LDKPublicKey*)holder_funding_key;
9159 FREE((void*)holder_funding_key);
9160 LDKPublicKey counterparty_funding_key_conv = *(LDKPublicKey*)counterparty_funding_key;
9161 FREE((void*)counterparty_funding_key);
9162 LDKTxCreationKeys keys_conv = *(LDKTxCreationKeys*)keys;
9164 keys_conv.is_owned = true;
9165 LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ htlc_data_conv = *(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ*)htlc_data;
9166 FREE((void*)htlc_data);
9167 LDKHolderCommitmentTransaction* ret = MALLOC(sizeof(LDKHolderCommitmentTransaction), "LDKHolderCommitmentTransaction");
9168 *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);
9169 DO_ASSERT(ret->is_owned);
9170 ret->is_owned = false;
9174 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1trust_1key_1derivation(JNIEnv * _env, jclass _b, jlong this_arg) {
9175 LDKHolderCommitmentTransaction* this_arg_conv = (LDKHolderCommitmentTransaction*)this_arg;
9176 LDKTxCreationKeys* ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
9177 *ret = HolderCommitmentTransaction_trust_key_derivation(this_arg_conv);
9178 DO_ASSERT(ret->is_owned);
9179 ret->is_owned = false;
9183 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1txid(JNIEnv * _env, jclass _b, jlong this_arg) {
9184 LDKHolderCommitmentTransaction* this_arg_conv = (LDKHolderCommitmentTransaction*)this_arg;
9185 jbyteArray _arr = (*_env)->NewByteArray(_env, 32);
9186 (*_env)->SetByteArrayRegion(_env, _arr, 0, 32, HolderCommitmentTransaction_txid(this_arg_conv).data);
9190 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) {
9191 LDKHolderCommitmentTransaction* this_arg_conv = (LDKHolderCommitmentTransaction*)this_arg;
9192 unsigned char funding_key_arr[32];
9193 (*_env)->GetByteArrayRegion (_env, funding_key, 0, 32, funding_key_arr);
9194 unsigned char (*funding_key_ref)[32] = &funding_key_arr;
9195 LDKu8slice funding_redeemscript_conv = *(LDKu8slice*)funding_redeemscript;
9196 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
9197 *ret = HolderCommitmentTransaction_get_holder_sig(this_arg_conv, funding_key_ref, funding_redeemscript_conv, channel_value_satoshis);
9201 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) {
9202 LDKHolderCommitmentTransaction* this_arg_conv = (LDKHolderCommitmentTransaction*)this_arg;
9203 unsigned char htlc_base_key_arr[32];
9204 (*_env)->GetByteArrayRegion (_env, htlc_base_key, 0, 32, htlc_base_key_arr);
9205 unsigned char (*htlc_base_key_ref)[32] = &htlc_base_key_arr;
9206 LDKCResult_CVec_SignatureZNoneZ* ret = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
9207 *ret = HolderCommitmentTransaction_get_htlc_sigs(this_arg_conv, htlc_base_key_ref, counterparty_selected_contest_delay);
9211 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1write(JNIEnv * _env, jclass _b, jlong obj) {
9212 LDKHolderCommitmentTransaction* obj_conv = (LDKHolderCommitmentTransaction*)obj;
9213 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
9214 *ret = HolderCommitmentTransaction_write(obj_conv);
9218 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1read(JNIEnv * _env, jclass _b, jlong ser) {
9219 LDKu8slice ser_conv = *(LDKu8slice*)ser;
9220 LDKHolderCommitmentTransaction* ret = MALLOC(sizeof(LDKHolderCommitmentTransaction), "LDKHolderCommitmentTransaction");
9221 *ret = HolderCommitmentTransaction_read(ser_conv);
9222 DO_ASSERT(ret->is_owned);
9223 ret->is_owned = false;
9227 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
9228 LDKInitFeatures this_ptr_conv = *(LDKInitFeatures*)this_ptr;
9229 FREE((void*)this_ptr);
9230 this_ptr_conv.is_owned = true;
9231 return InitFeatures_free(this_ptr_conv);
9234 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
9235 LDKNodeFeatures this_ptr_conv = *(LDKNodeFeatures*)this_ptr;
9236 FREE((void*)this_ptr);
9237 this_ptr_conv.is_owned = true;
9238 return NodeFeatures_free(this_ptr_conv);
9241 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
9242 LDKChannelFeatures this_ptr_conv = *(LDKChannelFeatures*)this_ptr;
9243 FREE((void*)this_ptr);
9244 this_ptr_conv.is_owned = true;
9245 return ChannelFeatures_free(this_ptr_conv);
9248 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
9249 LDKRouteHop this_ptr_conv = *(LDKRouteHop*)this_ptr;
9250 FREE((void*)this_ptr);
9251 this_ptr_conv.is_owned = true;
9252 return RouteHop_free(this_ptr_conv);
9255 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
9256 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
9257 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
9258 *ret = RouteHop_get_pubkey(this_ptr_conv);
9262 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9263 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
9264 LDKPublicKey val_conv = *(LDKPublicKey*)val;
9266 return RouteHop_set_pubkey(this_ptr_conv, val_conv);
9269 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1node_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
9270 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
9271 LDKNodeFeatures* ret = MALLOC(sizeof(LDKNodeFeatures), "LDKNodeFeatures");
9272 *ret = RouteHop_get_node_features(this_ptr_conv);
9273 DO_ASSERT(ret->is_owned);
9274 ret->is_owned = false;
9278 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1node_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9279 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
9280 LDKNodeFeatures val_conv = *(LDKNodeFeatures*)val;
9282 val_conv.is_owned = true;
9283 return RouteHop_set_node_features(this_ptr_conv, val_conv);
9286 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
9287 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
9288 return RouteHop_get_short_channel_id(this_ptr_conv);
9291 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9292 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
9293 return RouteHop_set_short_channel_id(this_ptr_conv, val);
9296 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1channel_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
9297 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
9298 LDKChannelFeatures* ret = MALLOC(sizeof(LDKChannelFeatures), "LDKChannelFeatures");
9299 *ret = RouteHop_get_channel_features(this_ptr_conv);
9300 DO_ASSERT(ret->is_owned);
9301 ret->is_owned = false;
9305 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1channel_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9306 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
9307 LDKChannelFeatures val_conv = *(LDKChannelFeatures*)val;
9309 val_conv.is_owned = true;
9310 return RouteHop_set_channel_features(this_ptr_conv, val_conv);
9313 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1fee_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
9314 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
9315 return RouteHop_get_fee_msat(this_ptr_conv);
9318 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1fee_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9319 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
9320 return RouteHop_set_fee_msat(this_ptr_conv, val);
9323 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
9324 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
9325 return RouteHop_get_cltv_expiry_delta(this_ptr_conv);
9328 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
9329 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
9330 return RouteHop_set_cltv_expiry_delta(this_ptr_conv, val);
9333 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) {
9334 LDKPublicKey pubkey_arg_conv = *(LDKPublicKey*)pubkey_arg;
9335 FREE((void*)pubkey_arg);
9336 LDKNodeFeatures node_features_arg_conv = *(LDKNodeFeatures*)node_features_arg;
9337 FREE((void*)node_features_arg);
9338 node_features_arg_conv.is_owned = true;
9339 LDKChannelFeatures channel_features_arg_conv = *(LDKChannelFeatures*)channel_features_arg;
9340 FREE((void*)channel_features_arg);
9341 channel_features_arg_conv.is_owned = true;
9342 LDKRouteHop* ret = MALLOC(sizeof(LDKRouteHop), "LDKRouteHop");
9343 *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);
9344 DO_ASSERT(ret->is_owned);
9345 ret->is_owned = false;
9349 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
9350 LDKRoute this_ptr_conv = *(LDKRoute*)this_ptr;
9351 FREE((void*)this_ptr);
9352 this_ptr_conv.is_owned = true;
9353 return Route_free(this_ptr_conv);
9356 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1paths(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9357 LDKRoute* this_ptr_conv = (LDKRoute*)this_ptr;
9358 LDKCVec_CVec_RouteHopZZ val_conv = *(LDKCVec_CVec_RouteHopZZ*)val;
9360 return Route_set_paths(this_ptr_conv, val_conv);
9363 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv * _env, jclass _b, jlong paths_arg) {
9364 LDKCVec_CVec_RouteHopZZ paths_arg_conv = *(LDKCVec_CVec_RouteHopZZ*)paths_arg;
9365 FREE((void*)paths_arg);
9366 LDKRoute* ret = MALLOC(sizeof(LDKRoute), "LDKRoute");
9367 *ret = Route_new(paths_arg_conv);
9368 DO_ASSERT(ret->is_owned);
9369 ret->is_owned = false;
9373 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1write(JNIEnv * _env, jclass _b, jlong obj) {
9374 LDKRoute* obj_conv = (LDKRoute*)obj;
9375 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
9376 *ret = Route_write(obj_conv);
9380 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1read(JNIEnv * _env, jclass _b, jlong ser) {
9381 LDKu8slice ser_conv = *(LDKu8slice*)ser;
9382 LDKRoute* ret = MALLOC(sizeof(LDKRoute), "LDKRoute");
9383 *ret = Route_read(ser_conv);
9384 DO_ASSERT(ret->is_owned);
9385 ret->is_owned = false;
9389 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
9390 LDKRouteHint this_ptr_conv = *(LDKRouteHint*)this_ptr;
9391 FREE((void*)this_ptr);
9392 this_ptr_conv.is_owned = true;
9393 return RouteHint_free(this_ptr_conv);
9396 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1src_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
9397 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
9398 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
9399 *ret = RouteHint_get_src_node_id(this_ptr_conv);
9403 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1src_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9404 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
9405 LDKPublicKey val_conv = *(LDKPublicKey*)val;
9407 return RouteHint_set_src_node_id(this_ptr_conv, val_conv);
9410 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
9411 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
9412 return RouteHint_get_short_channel_id(this_ptr_conv);
9415 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9416 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
9417 return RouteHint_set_short_channel_id(this_ptr_conv, val);
9420 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1fees(JNIEnv * _env, jclass _b, jlong this_ptr) {
9421 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
9422 LDKRoutingFees* ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
9423 *ret = RouteHint_get_fees(this_ptr_conv);
9424 DO_ASSERT(ret->is_owned);
9425 ret->is_owned = false;
9429 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1fees(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9430 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
9431 LDKRoutingFees val_conv = *(LDKRoutingFees*)val;
9433 val_conv.is_owned = true;
9434 return RouteHint_set_fees(this_ptr_conv, val_conv);
9437 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
9438 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
9439 return RouteHint_get_cltv_expiry_delta(this_ptr_conv);
9442 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
9443 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
9444 return RouteHint_set_cltv_expiry_delta(this_ptr_conv, val);
9447 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
9448 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
9449 return RouteHint_get_htlc_minimum_msat(this_ptr_conv);
9452 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9453 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
9454 return RouteHint_set_htlc_minimum_msat(this_ptr_conv, val);
9457 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) {
9458 LDKPublicKey src_node_id_arg_conv = *(LDKPublicKey*)src_node_id_arg;
9459 FREE((void*)src_node_id_arg);
9460 LDKRoutingFees fees_arg_conv = *(LDKRoutingFees*)fees_arg;
9461 FREE((void*)fees_arg);
9462 fees_arg_conv.is_owned = true;
9463 LDKRouteHint* ret = MALLOC(sizeof(LDKRouteHint), "LDKRouteHint");
9464 *ret = RouteHint_new(src_node_id_arg_conv, short_channel_id_arg, fees_arg_conv, cltv_expiry_delta_arg, htlc_minimum_msat_arg);
9465 DO_ASSERT(ret->is_owned);
9466 ret->is_owned = false;
9470 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) {
9471 LDKPublicKey our_node_id_conv = *(LDKPublicKey*)our_node_id;
9472 FREE((void*)our_node_id);
9473 LDKNetworkGraph* network_conv = (LDKNetworkGraph*)network;
9474 LDKPublicKey target_conv = *(LDKPublicKey*)target;
9475 FREE((void*)target);
9476 LDKCVec_ChannelDetailsZ* first_hops_conv = (LDKCVec_ChannelDetailsZ*)first_hops;
9477 LDKCVec_RouteHintZ last_hops_conv = *(LDKCVec_RouteHintZ*)last_hops;
9478 FREE((void*)last_hops);
9479 LDKLogger logger_conv = *(LDKLogger*)logger;
9480 if (logger_conv.free == LDKLogger_JCalls_free) {
9481 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
9482 LDKLogger_JCalls_clone(logger_conv.this_arg);
9484 LDKCResult_RouteLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
9485 *ret = get_route(our_node_id_conv, network_conv, target_conv, first_hops_conv, last_hops_conv, final_value_msat, final_cltv, logger_conv);
9489 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
9490 LDKNetworkGraph this_ptr_conv = *(LDKNetworkGraph*)this_ptr;
9491 FREE((void*)this_ptr);
9492 this_ptr_conv.is_owned = true;
9493 return NetworkGraph_free(this_ptr_conv);
9496 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockedNetworkGraph_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
9497 LDKLockedNetworkGraph this_ptr_conv = *(LDKLockedNetworkGraph*)this_ptr;
9498 FREE((void*)this_ptr);
9499 this_ptr_conv.is_owned = true;
9500 return LockedNetworkGraph_free(this_ptr_conv);
9503 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
9504 LDKNetGraphMsgHandler this_ptr_conv = *(LDKNetGraphMsgHandler*)this_ptr;
9505 FREE((void*)this_ptr);
9506 this_ptr_conv.is_owned = true;
9507 return NetGraphMsgHandler_free(this_ptr_conv);
9510 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new(JNIEnv * _env, jclass _b, jlong chain_access, jlong logger) {
9511 LDKAccess* chain_access_conv = (LDKAccess*)chain_access;
9512 LDKLogger logger_conv = *(LDKLogger*)logger;
9513 if (logger_conv.free == LDKLogger_JCalls_free) {
9514 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
9515 LDKLogger_JCalls_clone(logger_conv.this_arg);
9517 LDKNetGraphMsgHandler* ret = MALLOC(sizeof(LDKNetGraphMsgHandler), "LDKNetGraphMsgHandler");
9518 *ret = NetGraphMsgHandler_new(chain_access_conv, logger_conv);
9519 DO_ASSERT(ret->is_owned);
9520 ret->is_owned = false;
9524 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1from_1net_1graph(JNIEnv * _env, jclass _b, jlong chain_access, jlong logger, jlong network_graph) {
9525 LDKAccess* chain_access_conv = (LDKAccess*)chain_access;
9526 LDKLogger logger_conv = *(LDKLogger*)logger;
9527 if (logger_conv.free == LDKLogger_JCalls_free) {
9528 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
9529 LDKLogger_JCalls_clone(logger_conv.this_arg);
9531 LDKNetworkGraph network_graph_conv = *(LDKNetworkGraph*)network_graph;
9532 FREE((void*)network_graph);
9533 network_graph_conv.is_owned = true;
9534 LDKNetGraphMsgHandler* ret = MALLOC(sizeof(LDKNetGraphMsgHandler), "LDKNetGraphMsgHandler");
9535 *ret = NetGraphMsgHandler_from_net_graph(chain_access_conv, logger_conv, network_graph_conv);
9536 DO_ASSERT(ret->is_owned);
9537 ret->is_owned = false;
9541 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1read_1locked_1graph(JNIEnv * _env, jclass _b, jlong this_arg) {
9542 LDKNetGraphMsgHandler* this_arg_conv = (LDKNetGraphMsgHandler*)this_arg;
9543 LDKLockedNetworkGraph* ret = MALLOC(sizeof(LDKLockedNetworkGraph), "LDKLockedNetworkGraph");
9544 *ret = NetGraphMsgHandler_read_locked_graph(this_arg_conv);
9545 DO_ASSERT(ret->is_owned);
9546 ret->is_owned = false;
9550 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LockedNetworkGraph_1graph(JNIEnv * _env, jclass _b, jlong this_arg) {
9551 LDKLockedNetworkGraph* this_arg_conv = (LDKLockedNetworkGraph*)this_arg;
9552 LDKNetworkGraph* ret = MALLOC(sizeof(LDKNetworkGraph), "LDKNetworkGraph");
9553 *ret = LockedNetworkGraph_graph(this_arg_conv);
9554 DO_ASSERT(ret->is_owned);
9555 ret->is_owned = false;
9559 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1RoutingMessageHandler(JNIEnv * _env, jclass _b, jlong this_arg) {
9560 LDKNetGraphMsgHandler* this_arg_conv = (LDKNetGraphMsgHandler*)this_arg;
9561 LDKRoutingMessageHandler* ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
9562 *ret = NetGraphMsgHandler_as_RoutingMessageHandler(this_arg_conv);
9566 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
9567 LDKDirectionalChannelInfo this_ptr_conv = *(LDKDirectionalChannelInfo*)this_ptr;
9568 FREE((void*)this_ptr);
9569 this_ptr_conv.is_owned = true;
9570 return DirectionalChannelInfo_free(this_ptr_conv);
9573 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr) {
9574 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
9575 return DirectionalChannelInfo_get_last_update(this_ptr_conv);
9578 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
9579 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
9580 return DirectionalChannelInfo_set_last_update(this_ptr_conv, val);
9583 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1enabled(JNIEnv * _env, jclass _b, jlong this_ptr) {
9584 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
9585 return DirectionalChannelInfo_get_enabled(this_ptr_conv);
9588 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1enabled(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
9589 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
9590 return DirectionalChannelInfo_set_enabled(this_ptr_conv, val);
9593 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
9594 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
9595 return DirectionalChannelInfo_get_cltv_expiry_delta(this_ptr_conv);
9598 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
9599 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
9600 return DirectionalChannelInfo_set_cltv_expiry_delta(this_ptr_conv, val);
9603 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
9604 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
9605 return DirectionalChannelInfo_get_htlc_minimum_msat(this_ptr_conv);
9608 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9609 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
9610 return DirectionalChannelInfo_set_htlc_minimum_msat(this_ptr_conv, val);
9613 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1last_1update_1message(JNIEnv * _env, jclass _b, jlong this_ptr) {
9614 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
9615 LDKChannelUpdate* ret = MALLOC(sizeof(LDKChannelUpdate), "LDKChannelUpdate");
9616 *ret = DirectionalChannelInfo_get_last_update_message(this_ptr_conv);
9617 DO_ASSERT(ret->is_owned);
9618 ret->is_owned = false;
9622 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1last_1update_1message(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9623 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
9624 LDKChannelUpdate val_conv = *(LDKChannelUpdate*)val;
9626 val_conv.is_owned = true;
9627 return DirectionalChannelInfo_set_last_update_message(this_ptr_conv, val_conv);
9630 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
9631 LDKDirectionalChannelInfo* obj_conv = (LDKDirectionalChannelInfo*)obj;
9632 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
9633 *ret = DirectionalChannelInfo_write(obj_conv);
9637 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
9638 LDKu8slice ser_conv = *(LDKu8slice*)ser;
9639 LDKDirectionalChannelInfo* ret = MALLOC(sizeof(LDKDirectionalChannelInfo), "LDKDirectionalChannelInfo");
9640 *ret = DirectionalChannelInfo_read(ser_conv);
9641 DO_ASSERT(ret->is_owned);
9642 ret->is_owned = false;
9646 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
9647 LDKChannelInfo this_ptr_conv = *(LDKChannelInfo*)this_ptr;
9648 FREE((void*)this_ptr);
9649 this_ptr_conv.is_owned = true;
9650 return ChannelInfo_free(this_ptr_conv);
9653 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
9654 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
9655 LDKChannelFeatures* ret = MALLOC(sizeof(LDKChannelFeatures), "LDKChannelFeatures");
9656 *ret = ChannelInfo_get_features(this_ptr_conv);
9657 DO_ASSERT(ret->is_owned);
9658 ret->is_owned = false;
9662 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9663 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
9664 LDKChannelFeatures val_conv = *(LDKChannelFeatures*)val;
9666 val_conv.is_owned = true;
9667 return ChannelInfo_set_features(this_ptr_conv, val_conv);
9670 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1one(JNIEnv * _env, jclass _b, jlong this_ptr) {
9671 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
9672 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
9673 *ret = ChannelInfo_get_node_one(this_ptr_conv);
9677 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1one(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9678 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
9679 LDKPublicKey val_conv = *(LDKPublicKey*)val;
9681 return ChannelInfo_set_node_one(this_ptr_conv, val_conv);
9684 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1one_1to_1two(JNIEnv * _env, jclass _b, jlong this_ptr) {
9685 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
9686 LDKDirectionalChannelInfo* ret = MALLOC(sizeof(LDKDirectionalChannelInfo), "LDKDirectionalChannelInfo");
9687 *ret = ChannelInfo_get_one_to_two(this_ptr_conv);
9688 DO_ASSERT(ret->is_owned);
9689 ret->is_owned = false;
9693 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1one_1to_1two(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9694 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
9695 LDKDirectionalChannelInfo val_conv = *(LDKDirectionalChannelInfo*)val;
9697 val_conv.is_owned = true;
9698 return ChannelInfo_set_one_to_two(this_ptr_conv, val_conv);
9701 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1two(JNIEnv * _env, jclass _b, jlong this_ptr) {
9702 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
9703 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
9704 *ret = ChannelInfo_get_node_two(this_ptr_conv);
9708 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1two(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9709 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
9710 LDKPublicKey val_conv = *(LDKPublicKey*)val;
9712 return ChannelInfo_set_node_two(this_ptr_conv, val_conv);
9715 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1two_1to_1one(JNIEnv * _env, jclass _b, jlong this_ptr) {
9716 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
9717 LDKDirectionalChannelInfo* ret = MALLOC(sizeof(LDKDirectionalChannelInfo), "LDKDirectionalChannelInfo");
9718 *ret = ChannelInfo_get_two_to_one(this_ptr_conv);
9719 DO_ASSERT(ret->is_owned);
9720 ret->is_owned = false;
9724 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1two_1to_1one(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9725 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
9726 LDKDirectionalChannelInfo val_conv = *(LDKDirectionalChannelInfo*)val;
9728 val_conv.is_owned = true;
9729 return ChannelInfo_set_two_to_one(this_ptr_conv, val_conv);
9732 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1announcement_1message(JNIEnv * _env, jclass _b, jlong this_ptr) {
9733 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
9734 LDKChannelAnnouncement* ret = MALLOC(sizeof(LDKChannelAnnouncement), "LDKChannelAnnouncement");
9735 *ret = ChannelInfo_get_announcement_message(this_ptr_conv);
9736 DO_ASSERT(ret->is_owned);
9737 ret->is_owned = false;
9741 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1announcement_1message(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9742 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
9743 LDKChannelAnnouncement val_conv = *(LDKChannelAnnouncement*)val;
9745 val_conv.is_owned = true;
9746 return ChannelInfo_set_announcement_message(this_ptr_conv, val_conv);
9749 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
9750 LDKChannelInfo* obj_conv = (LDKChannelInfo*)obj;
9751 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
9752 *ret = ChannelInfo_write(obj_conv);
9756 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
9757 LDKu8slice ser_conv = *(LDKu8slice*)ser;
9758 LDKChannelInfo* ret = MALLOC(sizeof(LDKChannelInfo), "LDKChannelInfo");
9759 *ret = ChannelInfo_read(ser_conv);
9760 DO_ASSERT(ret->is_owned);
9761 ret->is_owned = false;
9765 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
9766 LDKRoutingFees this_ptr_conv = *(LDKRoutingFees*)this_ptr;
9767 FREE((void*)this_ptr);
9768 this_ptr_conv.is_owned = true;
9769 return RoutingFees_free(this_ptr_conv);
9772 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
9773 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
9774 return RoutingFees_get_base_msat(this_ptr_conv);
9777 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
9778 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
9779 return RoutingFees_set_base_msat(this_ptr_conv, val);
9782 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr) {
9783 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
9784 return RoutingFees_get_proportional_millionths(this_ptr_conv);
9787 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
9788 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
9789 return RoutingFees_set_proportional_millionths(this_ptr_conv, val);
9792 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1new(JNIEnv * _env, jclass _b, jint base_msat_arg, jint proportional_millionths_arg) {
9793 LDKRoutingFees* ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
9794 *ret = RoutingFees_new(base_msat_arg, proportional_millionths_arg);
9795 DO_ASSERT(ret->is_owned);
9796 ret->is_owned = false;
9800 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1read(JNIEnv * _env, jclass _b, jlong ser) {
9801 LDKu8slice ser_conv = *(LDKu8slice*)ser;
9802 LDKRoutingFees* ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
9803 *ret = RoutingFees_read(ser_conv);
9804 DO_ASSERT(ret->is_owned);
9805 ret->is_owned = false;
9809 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1write(JNIEnv * _env, jclass _b, jlong obj) {
9810 LDKRoutingFees* obj_conv = (LDKRoutingFees*)obj;
9811 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
9812 *ret = RoutingFees_write(obj_conv);
9816 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
9817 LDKNodeAnnouncementInfo this_ptr_conv = *(LDKNodeAnnouncementInfo*)this_ptr;
9818 FREE((void*)this_ptr);
9819 this_ptr_conv.is_owned = true;
9820 return NodeAnnouncementInfo_free(this_ptr_conv);
9823 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
9824 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
9825 LDKNodeFeatures* ret = MALLOC(sizeof(LDKNodeFeatures), "LDKNodeFeatures");
9826 *ret = NodeAnnouncementInfo_get_features(this_ptr_conv);
9827 DO_ASSERT(ret->is_owned);
9828 ret->is_owned = false;
9832 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9833 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
9834 LDKNodeFeatures val_conv = *(LDKNodeFeatures*)val;
9836 val_conv.is_owned = true;
9837 return NodeAnnouncementInfo_set_features(this_ptr_conv, val_conv);
9840 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr) {
9841 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
9842 return NodeAnnouncementInfo_get_last_update(this_ptr_conv);
9845 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
9846 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
9847 return NodeAnnouncementInfo_set_last_update(this_ptr_conv, val);
9850 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr) {
9851 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
9852 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 3);
9853 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 3, *NodeAnnouncementInfo_get_rgb(this_ptr_conv));
9857 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9858 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
9859 LDKThreeBytes val_conv = *(LDKThreeBytes*)val;
9861 return NodeAnnouncementInfo_set_rgb(this_ptr_conv, val_conv);
9864 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1alias(JNIEnv * _env, jclass _b, jlong this_ptr) {
9865 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
9866 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
9867 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *NodeAnnouncementInfo_get_alias(this_ptr_conv));
9871 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1alias(JNIEnv * _env, jclass _b, jlong this_ptr, jbyteArray val) {
9872 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
9873 LDKThirtyTwoBytes val_ref;
9874 (*_env)->GetByteArrayRegion (_env, val, 0, 32, val_ref.data);
9875 return NodeAnnouncementInfo_set_alias(this_ptr_conv, val_ref);
9878 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1addresses(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9879 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
9880 LDKCVec_NetAddressZ val_conv = *(LDKCVec_NetAddressZ*)val;
9882 return NodeAnnouncementInfo_set_addresses(this_ptr_conv, val_conv);
9885 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1announcement_1message(JNIEnv * _env, jclass _b, jlong this_ptr) {
9886 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
9887 LDKNodeAnnouncement* ret = MALLOC(sizeof(LDKNodeAnnouncement), "LDKNodeAnnouncement");
9888 *ret = NodeAnnouncementInfo_get_announcement_message(this_ptr_conv);
9889 DO_ASSERT(ret->is_owned);
9890 ret->is_owned = false;
9894 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1announcement_1message(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9895 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
9896 LDKNodeAnnouncement val_conv = *(LDKNodeAnnouncement*)val;
9898 val_conv.is_owned = true;
9899 return NodeAnnouncementInfo_set_announcement_message(this_ptr_conv, val_conv);
9902 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1new(JNIEnv * _env, jclass _b, jlong features_arg, jint last_update_arg, jlong rgb_arg, jbyteArray alias_arg, jlong addresses_arg, jlong announcement_message_arg) {
9903 LDKNodeFeatures features_arg_conv = *(LDKNodeFeatures*)features_arg;
9904 FREE((void*)features_arg);
9905 features_arg_conv.is_owned = true;
9906 LDKThreeBytes rgb_arg_conv = *(LDKThreeBytes*)rgb_arg;
9907 FREE((void*)rgb_arg);
9908 LDKThirtyTwoBytes alias_arg_ref;
9909 (*_env)->GetByteArrayRegion (_env, alias_arg, 0, 32, alias_arg_ref.data);
9910 LDKCVec_NetAddressZ addresses_arg_conv = *(LDKCVec_NetAddressZ*)addresses_arg;
9911 FREE((void*)addresses_arg);
9912 LDKNodeAnnouncement announcement_message_arg_conv = *(LDKNodeAnnouncement*)announcement_message_arg;
9913 FREE((void*)announcement_message_arg);
9914 announcement_message_arg_conv.is_owned = true;
9915 LDKNodeAnnouncementInfo* ret = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo");
9916 *ret = NodeAnnouncementInfo_new(features_arg_conv, last_update_arg, rgb_arg_conv, alias_arg_ref, addresses_arg_conv, announcement_message_arg_conv);
9917 DO_ASSERT(ret->is_owned);
9918 ret->is_owned = false;
9922 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
9923 LDKNodeAnnouncementInfo* obj_conv = (LDKNodeAnnouncementInfo*)obj;
9924 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
9925 *ret = NodeAnnouncementInfo_write(obj_conv);
9929 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
9930 LDKu8slice ser_conv = *(LDKu8slice*)ser;
9931 LDKNodeAnnouncementInfo* ret = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo");
9932 *ret = NodeAnnouncementInfo_read(ser_conv);
9933 DO_ASSERT(ret->is_owned);
9934 ret->is_owned = false;
9938 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
9939 LDKNodeInfo this_ptr_conv = *(LDKNodeInfo*)this_ptr;
9940 FREE((void*)this_ptr);
9941 this_ptr_conv.is_owned = true;
9942 return NodeInfo_free(this_ptr_conv);
9945 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1channels(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9946 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
9947 LDKCVec_u64Z val_conv = *(LDKCVec_u64Z*)val;
9949 return NodeInfo_set_channels(this_ptr_conv, val_conv);
9952 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1lowest_1inbound_1channel_1fees(JNIEnv * _env, jclass _b, jlong this_ptr) {
9953 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
9954 LDKRoutingFees* ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
9955 *ret = NodeInfo_get_lowest_inbound_channel_fees(this_ptr_conv);
9956 DO_ASSERT(ret->is_owned);
9957 ret->is_owned = false;
9961 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1lowest_1inbound_1channel_1fees(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9962 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
9963 LDKRoutingFees val_conv = *(LDKRoutingFees*)val;
9965 val_conv.is_owned = true;
9966 return NodeInfo_set_lowest_inbound_channel_fees(this_ptr_conv, val_conv);
9969 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1announcement_1info(JNIEnv * _env, jclass _b, jlong this_ptr) {
9970 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
9971 LDKNodeAnnouncementInfo* ret = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo");
9972 *ret = NodeInfo_get_announcement_info(this_ptr_conv);
9973 DO_ASSERT(ret->is_owned);
9974 ret->is_owned = false;
9978 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1announcement_1info(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
9979 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
9980 LDKNodeAnnouncementInfo val_conv = *(LDKNodeAnnouncementInfo*)val;
9982 val_conv.is_owned = true;
9983 return NodeInfo_set_announcement_info(this_ptr_conv, val_conv);
9986 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) {
9987 LDKCVec_u64Z channels_arg_conv = *(LDKCVec_u64Z*)channels_arg;
9988 FREE((void*)channels_arg);
9989 LDKRoutingFees lowest_inbound_channel_fees_arg_conv = *(LDKRoutingFees*)lowest_inbound_channel_fees_arg;
9990 FREE((void*)lowest_inbound_channel_fees_arg);
9991 lowest_inbound_channel_fees_arg_conv.is_owned = true;
9992 LDKNodeAnnouncementInfo announcement_info_arg_conv = *(LDKNodeAnnouncementInfo*)announcement_info_arg;
9993 FREE((void*)announcement_info_arg);
9994 announcement_info_arg_conv.is_owned = true;
9995 LDKNodeInfo* ret = MALLOC(sizeof(LDKNodeInfo), "LDKNodeInfo");
9996 *ret = NodeInfo_new(channels_arg_conv, lowest_inbound_channel_fees_arg_conv, announcement_info_arg_conv);
9997 DO_ASSERT(ret->is_owned);
9998 ret->is_owned = false;
10002 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
10003 LDKNodeInfo* obj_conv = (LDKNodeInfo*)obj;
10004 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
10005 *ret = NodeInfo_write(obj_conv);
10009 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
10010 LDKu8slice ser_conv = *(LDKu8slice*)ser;
10011 LDKNodeInfo* ret = MALLOC(sizeof(LDKNodeInfo), "LDKNodeInfo");
10012 *ret = NodeInfo_read(ser_conv);
10013 DO_ASSERT(ret->is_owned);
10014 ret->is_owned = false;
10018 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1write(JNIEnv * _env, jclass _b, jlong obj) {
10019 LDKNetworkGraph* obj_conv = (LDKNetworkGraph*)obj;
10020 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
10021 *ret = NetworkGraph_write(obj_conv);
10025 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read(JNIEnv * _env, jclass _b, jlong ser) {
10026 LDKu8slice ser_conv = *(LDKu8slice*)ser;
10027 LDKNetworkGraph* ret = MALLOC(sizeof(LDKNetworkGraph), "LDKNetworkGraph");
10028 *ret = NetworkGraph_read(ser_conv);
10029 DO_ASSERT(ret->is_owned);
10030 ret->is_owned = false;
10034 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new(JNIEnv * _env, jclass _b) {
10035 LDKNetworkGraph* ret = MALLOC(sizeof(LDKNetworkGraph), "LDKNetworkGraph");
10036 *ret = NetworkGraph_new();
10037 DO_ASSERT(ret->is_owned);
10038 ret->is_owned = false;
10042 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) {
10043 LDKNetworkGraph* this_arg_conv = (LDKNetworkGraph*)this_arg;
10044 return NetworkGraph_close_channel_from_update(this_arg_conv, short_channel_id, is_permanent);