1 #include "org_ldk_impl_bindings.h"
2 #include <rust_types.h>
9 static mtx_t allocation_mtx;
11 void __attribute__((constructor)) init_mtx() {
12 assert(mtx_init(&allocation_mtx, mtx_plain) == thrd_success);
15 typedef struct allocation {
16 struct allocation* next;
18 const char* struct_name;
20 static allocation* allocation_ll = NULL;
22 void* MALLOC(size_t len, const char* struct_name) {
23 void* res = malloc(len);
24 allocation* new_alloc = malloc(sizeof(allocation));
26 new_alloc->struct_name = struct_name;
27 assert(mtx_lock(&allocation_mtx) == thrd_success);
28 new_alloc->next = allocation_ll;
29 allocation_ll = new_alloc;
30 assert(mtx_unlock(&allocation_mtx) == thrd_success);
34 void FREE(void* ptr) {
36 assert(mtx_lock(&allocation_mtx) == thrd_success);
37 allocation* it = allocation_ll;
38 while (it->ptr != ptr) { p = it; it = it->next; }
39 if (p) { p->next = it->next; } else { allocation_ll = it->next; }
40 assert(mtx_unlock(&allocation_mtx) == thrd_success);
41 assert(it->ptr == ptr);
46 void __attribute__((destructor)) check_leaks() {
47 for (allocation* a = allocation_ll; a != NULL; a = a->next) { fprintf(stderr, "%s %p remains\n", a->struct_name, a->ptr); }
48 assert(allocation_ll == NULL);
51 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKSecretKey_1new(JNIEnv * _env, jclass _b) {
52 LDKSecretKey* key = (LDKSecretKey*)MALLOC(sizeof(LDKSecretKey), "LDKSecretKey");
55 typedef struct LDKMessageSendEventsProvider_JCalls {
59 jmethodID get_and_clear_pending_msg_events_meth;
60 } LDKMessageSendEventsProvider_JCalls;
61 LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_jcall(const void* this_arg) {
62 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
63 LDKCVec_MessageSendEventZ* ret = (LDKCVec_MessageSendEventZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_and_clear_pending_msg_events_meth);
64 LDKCVec_MessageSendEventZ res = *ret;
68 static void LDKMessageSendEventsProvider_JCalls_free(void* this_arg) {
69 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
70 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
71 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
75 static void* LDKMessageSendEventsProvider_JCalls_clone(const void* this_arg) {
76 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
77 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
78 return (void*) this_arg;
80 static inline LDKMessageSendEventsProvider LDKMessageSendEventsProvider_init (JNIEnv * env, jclass _a, jobject o) {
81 jclass c = (*env)->GetObjectClass(env, o);
83 LDKMessageSendEventsProvider_JCalls *calls = MALLOC(sizeof(LDKMessageSendEventsProvider_JCalls), "LDKMessageSendEventsProvider_JCalls");
84 atomic_init(&calls->refcnt, 1);
86 calls->o = (*env)->NewGlobalRef(env, o);
87 calls->get_and_clear_pending_msg_events_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_msg_events", "()J");
88 assert(calls->get_and_clear_pending_msg_events_meth != NULL);
90 LDKMessageSendEventsProvider ret = {
91 .this_arg = (void*) calls,
92 .get_and_clear_pending_msg_events = get_and_clear_pending_msg_events_jcall,
93 .free = LDKMessageSendEventsProvider_JCalls_free,
97 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1new (JNIEnv * env, jclass _a, jobject o) {
98 LDKMessageSendEventsProvider *res_ptr = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
99 *res_ptr = LDKMessageSendEventsProvider_init(env, _a, o);
100 return (long)res_ptr;
102 typedef struct LDKEventsProvider_JCalls {
103 atomic_size_t refcnt;
106 jmethodID get_and_clear_pending_events_meth;
107 } LDKEventsProvider_JCalls;
108 LDKCVec_EventZ get_and_clear_pending_events_jcall(const void* this_arg) {
109 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
110 LDKCVec_EventZ* ret = (LDKCVec_EventZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_and_clear_pending_events_meth);
111 LDKCVec_EventZ res = *ret;
115 static void LDKEventsProvider_JCalls_free(void* this_arg) {
116 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
117 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
118 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
122 static void* LDKEventsProvider_JCalls_clone(const void* this_arg) {
123 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
124 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
125 return (void*) this_arg;
127 static inline LDKEventsProvider LDKEventsProvider_init (JNIEnv * env, jclass _a, jobject o) {
128 jclass c = (*env)->GetObjectClass(env, o);
130 LDKEventsProvider_JCalls *calls = MALLOC(sizeof(LDKEventsProvider_JCalls), "LDKEventsProvider_JCalls");
131 atomic_init(&calls->refcnt, 1);
133 calls->o = (*env)->NewGlobalRef(env, o);
134 calls->get_and_clear_pending_events_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_events", "()J");
135 assert(calls->get_and_clear_pending_events_meth != NULL);
137 LDKEventsProvider ret = {
138 .this_arg = (void*) calls,
139 .get_and_clear_pending_events = get_and_clear_pending_events_jcall,
140 .free = LDKEventsProvider_JCalls_free,
144 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1new (JNIEnv * env, jclass _a, jobject o) {
145 LDKEventsProvider *res_ptr = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
146 *res_ptr = LDKEventsProvider_init(env, _a, o);
147 return (long)res_ptr;
149 typedef struct LDKLogger_JCalls {
150 atomic_size_t refcnt;
155 void log_jcall(const void* this_arg, const char *record) {
156 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
157 jstring record_conv = (*j_calls->env)->NewStringUTF(j_calls->env, record);
158 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->log_meth, record_conv);
160 static void LDKLogger_JCalls_free(void* this_arg) {
161 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
162 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
163 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
167 static void* LDKLogger_JCalls_clone(const void* this_arg) {
168 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
169 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
170 return (void*) this_arg;
172 static inline LDKLogger LDKLogger_init (JNIEnv * env, jclass _a, jobject o) {
173 jclass c = (*env)->GetObjectClass(env, o);
175 LDKLogger_JCalls *calls = MALLOC(sizeof(LDKLogger_JCalls), "LDKLogger_JCalls");
176 atomic_init(&calls->refcnt, 1);
178 calls->o = (*env)->NewGlobalRef(env, o);
179 calls->log_meth = (*env)->GetMethodID(env, c, "log", "(Ljava/lang/String;)V");
180 assert(calls->log_meth != NULL);
183 .this_arg = (void*) calls,
185 .free = LDKLogger_JCalls_free,
189 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKLogger_1new (JNIEnv * env, jclass _a, jobject o) {
190 LDKLogger *res_ptr = MALLOC(sizeof(LDKLogger), "LDKLogger");
191 *res_ptr = LDKLogger_init(env, _a, o);
192 return (long)res_ptr;
194 typedef struct LDKChainWatchInterface_JCalls {
195 atomic_size_t refcnt;
198 jmethodID install_watch_tx_meth;
199 jmethodID install_watch_outpoint_meth;
200 jmethodID watch_all_txn_meth;
201 jmethodID get_chain_utxo_meth;
202 jmethodID filter_block_meth;
203 jmethodID reentered_meth;
204 } LDKChainWatchInterface_JCalls;
205 void install_watch_tx_jcall(const void* this_arg, const uint8_t (*txid)[32], LDKu8slice script_pub_key) {
206 LDKChainWatchInterface_JCalls *j_calls = (LDKChainWatchInterface_JCalls*) this_arg;
207 jbyteArray txid_arr = (*j_calls->env)->NewByteArray(j_calls->env, 32);
208 (*j_calls->env)->SetByteArrayRegion(j_calls->env, txid_arr, 0, 32, *txid);
209 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->install_watch_tx_meth, txid_arr, script_pub_key);
211 void install_watch_outpoint_jcall(const void* this_arg, LDKC2Tuple_Txidu32Z outpoint, LDKu8slice out_script) {
212 LDKChainWatchInterface_JCalls *j_calls = (LDKChainWatchInterface_JCalls*) this_arg;
213 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->install_watch_outpoint_meth, outpoint, out_script);
215 void watch_all_txn_jcall(const void* this_arg) {
216 LDKChainWatchInterface_JCalls *j_calls = (LDKChainWatchInterface_JCalls*) this_arg;
217 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->watch_all_txn_meth);
219 LDKCResult_C2Tuple_Scriptu64ZChainErrorZ get_chain_utxo_jcall(const void* this_arg, LDKThirtyTwoBytes genesis_hash, uint64_t unspent_tx_output_identifier) {
220 LDKChainWatchInterface_JCalls *j_calls = (LDKChainWatchInterface_JCalls*) this_arg;
221 LDKCResult_C2Tuple_Scriptu64ZChainErrorZ* ret = (LDKCResult_C2Tuple_Scriptu64ZChainErrorZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_chain_utxo_meth, genesis_hash, unspent_tx_output_identifier);
222 LDKCResult_C2Tuple_Scriptu64ZChainErrorZ res = *ret;
226 LDKCVec_usizeZ filter_block_jcall(const void* this_arg, LDKu8slice block) {
227 LDKChainWatchInterface_JCalls *j_calls = (LDKChainWatchInterface_JCalls*) this_arg;
228 LDKCVec_usizeZ* ret = (LDKCVec_usizeZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->filter_block_meth, block);
229 LDKCVec_usizeZ res = *ret;
233 uintptr_t reentered_jcall(const void* this_arg) {
234 LDKChainWatchInterface_JCalls *j_calls = (LDKChainWatchInterface_JCalls*) this_arg;
235 uintptr_t* ret = (uintptr_t*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->reentered_meth);
236 uintptr_t res = *ret;
240 static void LDKChainWatchInterface_JCalls_free(void* this_arg) {
241 LDKChainWatchInterface_JCalls *j_calls = (LDKChainWatchInterface_JCalls*) this_arg;
242 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
243 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
247 static void* LDKChainWatchInterface_JCalls_clone(const void* this_arg) {
248 LDKChainWatchInterface_JCalls *j_calls = (LDKChainWatchInterface_JCalls*) this_arg;
249 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
250 return (void*) this_arg;
252 static inline LDKChainWatchInterface LDKChainWatchInterface_init (JNIEnv * env, jclass _a, jobject o) {
253 jclass c = (*env)->GetObjectClass(env, o);
255 LDKChainWatchInterface_JCalls *calls = MALLOC(sizeof(LDKChainWatchInterface_JCalls), "LDKChainWatchInterface_JCalls");
256 atomic_init(&calls->refcnt, 1);
258 calls->o = (*env)->NewGlobalRef(env, o);
259 calls->install_watch_tx_meth = (*env)->GetMethodID(env, c, "install_watch_tx", "([BJ)V");
260 assert(calls->install_watch_tx_meth != NULL);
261 calls->install_watch_outpoint_meth = (*env)->GetMethodID(env, c, "install_watch_outpoint", "(JJ)V");
262 assert(calls->install_watch_outpoint_meth != NULL);
263 calls->watch_all_txn_meth = (*env)->GetMethodID(env, c, "watch_all_txn", "()V");
264 assert(calls->watch_all_txn_meth != NULL);
265 calls->get_chain_utxo_meth = (*env)->GetMethodID(env, c, "get_chain_utxo", "(JJ)J");
266 assert(calls->get_chain_utxo_meth != NULL);
267 calls->filter_block_meth = (*env)->GetMethodID(env, c, "filter_block", "(J)J");
268 assert(calls->filter_block_meth != NULL);
269 calls->reentered_meth = (*env)->GetMethodID(env, c, "reentered", "()J");
270 assert(calls->reentered_meth != NULL);
272 LDKChainWatchInterface ret = {
273 .this_arg = (void*) calls,
274 .install_watch_tx = install_watch_tx_jcall,
275 .install_watch_outpoint = install_watch_outpoint_jcall,
276 .watch_all_txn = watch_all_txn_jcall,
277 .get_chain_utxo = get_chain_utxo_jcall,
278 .filter_block = filter_block_jcall,
279 .reentered = reentered_jcall,
280 .free = LDKChainWatchInterface_JCalls_free,
284 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKChainWatchInterface_1new (JNIEnv * env, jclass _a, jobject o) {
285 LDKChainWatchInterface *res_ptr = MALLOC(sizeof(LDKChainWatchInterface), "LDKChainWatchInterface");
286 *res_ptr = LDKChainWatchInterface_init(env, _a, o);
287 return (long)res_ptr;
289 typedef struct LDKBroadcasterInterface_JCalls {
290 atomic_size_t refcnt;
293 jmethodID broadcast_transaction_meth;
294 } LDKBroadcasterInterface_JCalls;
295 void broadcast_transaction_jcall(const void* this_arg, LDKTransaction tx) {
296 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
297 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->broadcast_transaction_meth, tx);
299 static void LDKBroadcasterInterface_JCalls_free(void* this_arg) {
300 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
301 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
302 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
306 static void* LDKBroadcasterInterface_JCalls_clone(const void* this_arg) {
307 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
308 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
309 return (void*) this_arg;
311 static inline LDKBroadcasterInterface LDKBroadcasterInterface_init (JNIEnv * env, jclass _a, jobject o) {
312 jclass c = (*env)->GetObjectClass(env, o);
314 LDKBroadcasterInterface_JCalls *calls = MALLOC(sizeof(LDKBroadcasterInterface_JCalls), "LDKBroadcasterInterface_JCalls");
315 atomic_init(&calls->refcnt, 1);
317 calls->o = (*env)->NewGlobalRef(env, o);
318 calls->broadcast_transaction_meth = (*env)->GetMethodID(env, c, "broadcast_transaction", "(J)V");
319 assert(calls->broadcast_transaction_meth != NULL);
321 LDKBroadcasterInterface ret = {
322 .this_arg = (void*) calls,
323 .broadcast_transaction = broadcast_transaction_jcall,
324 .free = LDKBroadcasterInterface_JCalls_free,
328 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1new (JNIEnv * env, jclass _a, jobject o) {
329 LDKBroadcasterInterface *res_ptr = MALLOC(sizeof(LDKBroadcasterInterface), "LDKBroadcasterInterface");
330 *res_ptr = LDKBroadcasterInterface_init(env, _a, o);
331 return (long)res_ptr;
333 typedef struct LDKChainListener_JCalls {
334 atomic_size_t refcnt;
337 jmethodID block_connected_meth;
338 jmethodID block_disconnected_meth;
339 } LDKChainListener_JCalls;
340 void block_connected_jcall(const void* this_arg, const uint8_t (*header)[80], uint32_t height, LDKCVec_TransactionZ txn_matched, LDKusizeslice indexes_of_txn_matched) {
341 LDKChainListener_JCalls *j_calls = (LDKChainListener_JCalls*) this_arg;
342 jbyteArray header_arr = (*j_calls->env)->NewByteArray(j_calls->env, 80);
343 (*j_calls->env)->SetByteArrayRegion(j_calls->env, header_arr, 0, 80, *header);
344 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->block_connected_meth, header_arr, height, txn_matched, indexes_of_txn_matched);
346 void block_disconnected_jcall(const void* this_arg, const uint8_t (*header)[80], uint32_t disconnected_height) {
347 LDKChainListener_JCalls *j_calls = (LDKChainListener_JCalls*) this_arg;
348 jbyteArray header_arr = (*j_calls->env)->NewByteArray(j_calls->env, 80);
349 (*j_calls->env)->SetByteArrayRegion(j_calls->env, header_arr, 0, 80, *header);
350 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->block_disconnected_meth, header_arr, disconnected_height);
352 static void LDKChainListener_JCalls_free(void* this_arg) {
353 LDKChainListener_JCalls *j_calls = (LDKChainListener_JCalls*) this_arg;
354 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
355 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
359 static void* LDKChainListener_JCalls_clone(const void* this_arg) {
360 LDKChainListener_JCalls *j_calls = (LDKChainListener_JCalls*) this_arg;
361 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
362 return (void*) this_arg;
364 static inline LDKChainListener LDKChainListener_init (JNIEnv * env, jclass _a, jobject o) {
365 jclass c = (*env)->GetObjectClass(env, o);
367 LDKChainListener_JCalls *calls = MALLOC(sizeof(LDKChainListener_JCalls), "LDKChainListener_JCalls");
368 atomic_init(&calls->refcnt, 1);
370 calls->o = (*env)->NewGlobalRef(env, o);
371 calls->block_connected_meth = (*env)->GetMethodID(env, c, "block_connected", "([BIJJ)V");
372 assert(calls->block_connected_meth != NULL);
373 calls->block_disconnected_meth = (*env)->GetMethodID(env, c, "block_disconnected", "([BI)V");
374 assert(calls->block_disconnected_meth != NULL);
376 LDKChainListener ret = {
377 .this_arg = (void*) calls,
378 .block_connected = block_connected_jcall,
379 .block_disconnected = block_disconnected_jcall,
380 .free = LDKChainListener_JCalls_free,
384 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKChainListener_1new (JNIEnv * env, jclass _a, jobject o) {
385 LDKChainListener *res_ptr = MALLOC(sizeof(LDKChainListener), "LDKChainListener");
386 *res_ptr = LDKChainListener_init(env, _a, o);
387 return (long)res_ptr;
389 typedef struct LDKFeeEstimator_JCalls {
390 atomic_size_t refcnt;
393 jmethodID get_est_sat_per_1000_weight_meth;
394 } LDKFeeEstimator_JCalls;
395 uint32_t get_est_sat_per_1000_weight_jcall(const void* this_arg, LDKConfirmationTarget confirmation_target) {
396 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
397 return (*j_calls->env)->CallIntMethod(j_calls->env, j_calls->o, j_calls->get_est_sat_per_1000_weight_meth, confirmation_target);
399 static void LDKFeeEstimator_JCalls_free(void* this_arg) {
400 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
401 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
402 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
406 static void* LDKFeeEstimator_JCalls_clone(const void* this_arg) {
407 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
408 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
409 return (void*) this_arg;
411 static inline LDKFeeEstimator LDKFeeEstimator_init (JNIEnv * env, jclass _a, jobject o) {
412 jclass c = (*env)->GetObjectClass(env, o);
414 LDKFeeEstimator_JCalls *calls = MALLOC(sizeof(LDKFeeEstimator_JCalls), "LDKFeeEstimator_JCalls");
415 atomic_init(&calls->refcnt, 1);
417 calls->o = (*env)->NewGlobalRef(env, o);
418 calls->get_est_sat_per_1000_weight_meth = (*env)->GetMethodID(env, c, "get_est_sat_per_1000_weight", "(J)I");
419 assert(calls->get_est_sat_per_1000_weight_meth != NULL);
421 LDKFeeEstimator ret = {
422 .this_arg = (void*) calls,
423 .get_est_sat_per_1000_weight = get_est_sat_per_1000_weight_jcall,
424 .free = LDKFeeEstimator_JCalls_free,
428 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1new (JNIEnv * env, jclass _a, jobject o) {
429 LDKFeeEstimator *res_ptr = MALLOC(sizeof(LDKFeeEstimator), "LDKFeeEstimator");
430 *res_ptr = LDKFeeEstimator_init(env, _a, o);
431 return (long)res_ptr;
433 typedef struct LDKChannelKeys_JCalls {
434 atomic_size_t refcnt;
437 jmethodID get_per_commitment_point_meth;
438 jmethodID release_commitment_secret_meth;
439 jmethodID key_derivation_params_meth;
440 jmethodID sign_remote_commitment_meth;
441 jmethodID sign_local_commitment_meth;
442 jmethodID sign_local_commitment_htlc_transactions_meth;
443 jmethodID sign_justice_transaction_meth;
444 jmethodID sign_remote_htlc_transaction_meth;
445 jmethodID sign_closing_transaction_meth;
446 jmethodID sign_channel_announcement_meth;
447 jmethodID on_accept_meth;
448 } LDKChannelKeys_JCalls;
449 LDKPublicKey get_per_commitment_point_jcall(const void* this_arg, uint64_t idx) {
450 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
451 LDKPublicKey* ret = (LDKPublicKey*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_per_commitment_point_meth, idx);
452 LDKPublicKey res = *ret;
456 LDKThirtyTwoBytes release_commitment_secret_jcall(const void* this_arg, uint64_t idx) {
457 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
458 LDKThirtyTwoBytes* ret = (LDKThirtyTwoBytes*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->release_commitment_secret_meth, idx);
459 LDKThirtyTwoBytes res = *ret;
463 LDKC2Tuple_u64u64Z key_derivation_params_jcall(const void* this_arg) {
464 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
465 LDKC2Tuple_u64u64Z* ret = (LDKC2Tuple_u64u64Z*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->key_derivation_params_meth);
466 LDKC2Tuple_u64u64Z res = *ret;
470 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_remote_commitment_jcall(const void* this_arg, uint32_t feerate_per_kw, LDKTransaction commitment_tx, const LDKPreCalculatedTxCreationKeys *keys, LDKCVec_HTLCOutputInCommitmentZ htlcs) {
471 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
472 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->sign_remote_commitment_meth, feerate_per_kw, commitment_tx, keys, htlcs);
473 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ res = *ret;
477 LDKCResult_SignatureNoneZ sign_local_commitment_jcall(const void* this_arg, const LDKLocalCommitmentTransaction *local_commitment_tx) {
478 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
479 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->sign_local_commitment_meth, local_commitment_tx);
480 LDKCResult_SignatureNoneZ res = *ret;
484 LDKCResult_CVec_SignatureZNoneZ sign_local_commitment_htlc_transactions_jcall(const void* this_arg, const LDKLocalCommitmentTransaction *local_commitment_tx) {
485 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
486 LDKCResult_CVec_SignatureZNoneZ* ret = (LDKCResult_CVec_SignatureZNoneZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->sign_local_commitment_htlc_transactions_meth, local_commitment_tx);
487 LDKCResult_CVec_SignatureZNoneZ res = *ret;
491 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) {
492 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
493 jbyteArray per_commitment_key_arr = (*j_calls->env)->NewByteArray(j_calls->env, 32);
494 (*j_calls->env)->SetByteArrayRegion(j_calls->env, per_commitment_key_arr, 0, 32, *per_commitment_key);
495 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->sign_justice_transaction_meth, justice_tx, input, amount, per_commitment_key_arr, htlc);
496 LDKCResult_SignatureNoneZ res = *ret;
500 LDKCResult_SignatureNoneZ sign_remote_htlc_transaction_jcall(const void* this_arg, LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, LDKPublicKey per_commitment_point, const LDKHTLCOutputInCommitment *htlc) {
501 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
502 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->sign_remote_htlc_transaction_meth, htlc_tx, input, amount, per_commitment_point, htlc);
503 LDKCResult_SignatureNoneZ res = *ret;
507 LDKCResult_SignatureNoneZ sign_closing_transaction_jcall(const void* this_arg, LDKTransaction closing_tx) {
508 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
509 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->sign_closing_transaction_meth, closing_tx);
510 LDKCResult_SignatureNoneZ res = *ret;
514 LDKCResult_SignatureNoneZ sign_channel_announcement_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement *msg) {
515 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
516 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->sign_channel_announcement_meth, msg);
517 LDKCResult_SignatureNoneZ res = *ret;
521 void on_accept_jcall(void* this_arg, const LDKChannelPublicKeys *channel_points, uint16_t remote_to_self_delay, uint16_t local_to_self_delay) {
522 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
523 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->on_accept_meth, channel_points, remote_to_self_delay, local_to_self_delay);
525 static void LDKChannelKeys_JCalls_free(void* this_arg) {
526 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
527 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
528 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
532 static void* LDKChannelKeys_JCalls_clone(const void* this_arg) {
533 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
534 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
535 return (void*) this_arg;
537 static inline LDKChannelKeys LDKChannelKeys_init (JNIEnv * env, jclass _a, jobject o) {
538 jclass c = (*env)->GetObjectClass(env, o);
540 LDKChannelKeys_JCalls *calls = MALLOC(sizeof(LDKChannelKeys_JCalls), "LDKChannelKeys_JCalls");
541 atomic_init(&calls->refcnt, 1);
543 calls->o = (*env)->NewGlobalRef(env, o);
544 calls->get_per_commitment_point_meth = (*env)->GetMethodID(env, c, "get_per_commitment_point", "(J)J");
545 assert(calls->get_per_commitment_point_meth != NULL);
546 calls->release_commitment_secret_meth = (*env)->GetMethodID(env, c, "release_commitment_secret", "(J)J");
547 assert(calls->release_commitment_secret_meth != NULL);
548 calls->key_derivation_params_meth = (*env)->GetMethodID(env, c, "key_derivation_params", "()J");
549 assert(calls->key_derivation_params_meth != NULL);
550 calls->sign_remote_commitment_meth = (*env)->GetMethodID(env, c, "sign_remote_commitment", "(IJJJ)J");
551 assert(calls->sign_remote_commitment_meth != NULL);
552 calls->sign_local_commitment_meth = (*env)->GetMethodID(env, c, "sign_local_commitment", "(J)J");
553 assert(calls->sign_local_commitment_meth != NULL);
554 calls->sign_local_commitment_htlc_transactions_meth = (*env)->GetMethodID(env, c, "sign_local_commitment_htlc_transactions", "(J)J");
555 assert(calls->sign_local_commitment_htlc_transactions_meth != NULL);
556 calls->sign_justice_transaction_meth = (*env)->GetMethodID(env, c, "sign_justice_transaction", "(JJJ[BJ)J");
557 assert(calls->sign_justice_transaction_meth != NULL);
558 calls->sign_remote_htlc_transaction_meth = (*env)->GetMethodID(env, c, "sign_remote_htlc_transaction", "(JJJJJ)J");
559 assert(calls->sign_remote_htlc_transaction_meth != NULL);
560 calls->sign_closing_transaction_meth = (*env)->GetMethodID(env, c, "sign_closing_transaction", "(J)J");
561 assert(calls->sign_closing_transaction_meth != NULL);
562 calls->sign_channel_announcement_meth = (*env)->GetMethodID(env, c, "sign_channel_announcement", "(J)J");
563 assert(calls->sign_channel_announcement_meth != NULL);
564 calls->on_accept_meth = (*env)->GetMethodID(env, c, "on_accept", "(JSS)V");
565 assert(calls->on_accept_meth != NULL);
567 LDKChannelKeys ret = {
568 .this_arg = (void*) calls,
569 .get_per_commitment_point = get_per_commitment_point_jcall,
570 .release_commitment_secret = release_commitment_secret_jcall,
571 .key_derivation_params = key_derivation_params_jcall,
572 .sign_remote_commitment = sign_remote_commitment_jcall,
573 .sign_local_commitment = sign_local_commitment_jcall,
574 .sign_local_commitment_htlc_transactions = sign_local_commitment_htlc_transactions_jcall,
575 .sign_justice_transaction = sign_justice_transaction_jcall,
576 .sign_remote_htlc_transaction = sign_remote_htlc_transaction_jcall,
577 .sign_closing_transaction = sign_closing_transaction_jcall,
578 .sign_channel_announcement = sign_channel_announcement_jcall,
579 .on_accept = on_accept_jcall,
580 .clone = LDKChannelKeys_JCalls_clone,
581 .free = LDKChannelKeys_JCalls_free,
585 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1new (JNIEnv * env, jclass _a, jobject o) {
586 LDKChannelKeys *res_ptr = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys");
587 *res_ptr = LDKChannelKeys_init(env, _a, o);
588 return (long)res_ptr;
590 typedef struct LDKKeysInterface_JCalls {
591 atomic_size_t refcnt;
594 jmethodID get_node_secret_meth;
595 jmethodID get_destination_script_meth;
596 jmethodID get_shutdown_pubkey_meth;
597 jmethodID get_channel_keys_meth;
598 jmethodID get_secure_random_bytes_meth;
599 } LDKKeysInterface_JCalls;
600 LDKSecretKey get_node_secret_jcall(const void* this_arg) {
601 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
602 LDKSecretKey* ret = (LDKSecretKey*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_node_secret_meth);
603 LDKSecretKey res = *ret;
607 LDKCVec_u8Z get_destination_script_jcall(const void* this_arg) {
608 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
609 LDKCVec_u8Z* ret = (LDKCVec_u8Z*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_destination_script_meth);
610 LDKCVec_u8Z res = *ret;
614 LDKPublicKey get_shutdown_pubkey_jcall(const void* this_arg) {
615 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
616 LDKPublicKey* ret = (LDKPublicKey*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_shutdown_pubkey_meth);
617 LDKPublicKey res = *ret;
621 LDKChannelKeys get_channel_keys_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) {
622 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
623 LDKChannelKeys* ret = (LDKChannelKeys*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_channel_keys_meth, inbound, channel_value_satoshis);
624 LDKChannelKeys res = *ret;
628 LDKThirtyTwoBytes get_secure_random_bytes_jcall(const void* this_arg) {
629 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
630 LDKThirtyTwoBytes* ret = (LDKThirtyTwoBytes*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_secure_random_bytes_meth);
631 LDKThirtyTwoBytes res = *ret;
635 static void LDKKeysInterface_JCalls_free(void* this_arg) {
636 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
637 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
638 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
642 static void* LDKKeysInterface_JCalls_clone(const void* this_arg) {
643 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
644 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
645 return (void*) this_arg;
647 static inline LDKKeysInterface LDKKeysInterface_init (JNIEnv * env, jclass _a, jobject o) {
648 jclass c = (*env)->GetObjectClass(env, o);
650 LDKKeysInterface_JCalls *calls = MALLOC(sizeof(LDKKeysInterface_JCalls), "LDKKeysInterface_JCalls");
651 atomic_init(&calls->refcnt, 1);
653 calls->o = (*env)->NewGlobalRef(env, o);
654 calls->get_node_secret_meth = (*env)->GetMethodID(env, c, "get_node_secret", "()J");
655 assert(calls->get_node_secret_meth != NULL);
656 calls->get_destination_script_meth = (*env)->GetMethodID(env, c, "get_destination_script", "()J");
657 assert(calls->get_destination_script_meth != NULL);
658 calls->get_shutdown_pubkey_meth = (*env)->GetMethodID(env, c, "get_shutdown_pubkey", "()J");
659 assert(calls->get_shutdown_pubkey_meth != NULL);
660 calls->get_channel_keys_meth = (*env)->GetMethodID(env, c, "get_channel_keys", "(ZJ)J");
661 assert(calls->get_channel_keys_meth != NULL);
662 calls->get_secure_random_bytes_meth = (*env)->GetMethodID(env, c, "get_secure_random_bytes", "()J");
663 assert(calls->get_secure_random_bytes_meth != NULL);
665 LDKKeysInterface ret = {
666 .this_arg = (void*) calls,
667 .get_node_secret = get_node_secret_jcall,
668 .get_destination_script = get_destination_script_jcall,
669 .get_shutdown_pubkey = get_shutdown_pubkey_jcall,
670 .get_channel_keys = get_channel_keys_jcall,
671 .get_secure_random_bytes = get_secure_random_bytes_jcall,
672 .free = LDKKeysInterface_JCalls_free,
676 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1new (JNIEnv * env, jclass _a, jobject o) {
677 LDKKeysInterface *res_ptr = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
678 *res_ptr = LDKKeysInterface_init(env, _a, o);
679 return (long)res_ptr;
681 typedef struct LDKManyChannelMonitor_JCalls {
682 atomic_size_t refcnt;
685 jmethodID add_monitor_meth;
686 jmethodID update_monitor_meth;
687 jmethodID get_and_clear_pending_monitor_events_meth;
688 } LDKManyChannelMonitor_JCalls;
689 LDKCResult_NoneChannelMonitorUpdateErrZ add_monitor_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) {
690 LDKManyChannelMonitor_JCalls *j_calls = (LDKManyChannelMonitor_JCalls*) this_arg;
691 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->add_monitor_meth, funding_txo, monitor);
692 LDKCResult_NoneChannelMonitorUpdateErrZ res = *ret;
696 LDKCResult_NoneChannelMonitorUpdateErrZ update_monitor_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate monitor) {
697 LDKManyChannelMonitor_JCalls *j_calls = (LDKManyChannelMonitor_JCalls*) this_arg;
698 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->update_monitor_meth, funding_txo, monitor);
699 LDKCResult_NoneChannelMonitorUpdateErrZ res = *ret;
703 LDKCVec_MonitorEventZ get_and_clear_pending_monitor_events_jcall(const void* this_arg) {
704 LDKManyChannelMonitor_JCalls *j_calls = (LDKManyChannelMonitor_JCalls*) this_arg;
705 LDKCVec_MonitorEventZ* ret = (LDKCVec_MonitorEventZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_and_clear_pending_monitor_events_meth);
706 LDKCVec_MonitorEventZ res = *ret;
710 static void LDKManyChannelMonitor_JCalls_free(void* this_arg) {
711 LDKManyChannelMonitor_JCalls *j_calls = (LDKManyChannelMonitor_JCalls*) this_arg;
712 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
713 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
717 static void* LDKManyChannelMonitor_JCalls_clone(const void* this_arg) {
718 LDKManyChannelMonitor_JCalls *j_calls = (LDKManyChannelMonitor_JCalls*) this_arg;
719 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
720 return (void*) this_arg;
722 static inline LDKManyChannelMonitor LDKManyChannelMonitor_init (JNIEnv * env, jclass _a, jobject o) {
723 jclass c = (*env)->GetObjectClass(env, o);
725 LDKManyChannelMonitor_JCalls *calls = MALLOC(sizeof(LDKManyChannelMonitor_JCalls), "LDKManyChannelMonitor_JCalls");
726 atomic_init(&calls->refcnt, 1);
728 calls->o = (*env)->NewGlobalRef(env, o);
729 calls->add_monitor_meth = (*env)->GetMethodID(env, c, "add_monitor", "(JJ)J");
730 assert(calls->add_monitor_meth != NULL);
731 calls->update_monitor_meth = (*env)->GetMethodID(env, c, "update_monitor", "(JJ)J");
732 assert(calls->update_monitor_meth != NULL);
733 calls->get_and_clear_pending_monitor_events_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_monitor_events", "()J");
734 assert(calls->get_and_clear_pending_monitor_events_meth != NULL);
736 LDKManyChannelMonitor ret = {
737 .this_arg = (void*) calls,
738 .add_monitor = add_monitor_jcall,
739 .update_monitor = update_monitor_jcall,
740 .get_and_clear_pending_monitor_events = get_and_clear_pending_monitor_events_jcall,
741 .free = LDKManyChannelMonitor_JCalls_free,
745 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKManyChannelMonitor_1new (JNIEnv * env, jclass _a, jobject o) {
746 LDKManyChannelMonitor *res_ptr = MALLOC(sizeof(LDKManyChannelMonitor), "LDKManyChannelMonitor");
747 *res_ptr = LDKManyChannelMonitor_init(env, _a, o);
748 return (long)res_ptr;
750 typedef struct LDKChannelMessageHandler_JCalls {
751 atomic_size_t refcnt;
754 LDKMessageSendEventsProvider_JCalls* MessageSendEventsProvider;
755 jmethodID handle_open_channel_meth;
756 jmethodID handle_accept_channel_meth;
757 jmethodID handle_funding_created_meth;
758 jmethodID handle_funding_signed_meth;
759 jmethodID handle_funding_locked_meth;
760 jmethodID handle_shutdown_meth;
761 jmethodID handle_closing_signed_meth;
762 jmethodID handle_update_add_htlc_meth;
763 jmethodID handle_update_fulfill_htlc_meth;
764 jmethodID handle_update_fail_htlc_meth;
765 jmethodID handle_update_fail_malformed_htlc_meth;
766 jmethodID handle_commitment_signed_meth;
767 jmethodID handle_revoke_and_ack_meth;
768 jmethodID handle_update_fee_meth;
769 jmethodID handle_announcement_signatures_meth;
770 jmethodID peer_disconnected_meth;
771 jmethodID peer_connected_meth;
772 jmethodID handle_channel_reestablish_meth;
773 jmethodID handle_error_meth;
774 } LDKChannelMessageHandler_JCalls;
775 void handle_open_channel_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKOpenChannel *msg) {
776 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
777 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_open_channel_meth, their_node_id, their_features, msg);
779 void handle_accept_channel_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKAcceptChannel *msg) {
780 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
781 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_accept_channel_meth, their_node_id, their_features, msg);
783 void handle_funding_created_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated *msg) {
784 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
785 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_funding_created_meth, their_node_id, msg);
787 void handle_funding_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned *msg) {
788 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
789 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_funding_signed_meth, their_node_id, msg);
791 void handle_funding_locked_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingLocked *msg) {
792 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
793 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_funding_locked_meth, their_node_id, msg);
795 void handle_shutdown_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKShutdown *msg) {
796 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
797 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_shutdown_meth, their_node_id, msg);
799 void handle_closing_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned *msg) {
800 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
801 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_closing_signed_meth, their_node_id, msg);
803 void handle_update_add_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC *msg) {
804 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
805 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_update_add_htlc_meth, their_node_id, msg);
807 void handle_update_fulfill_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC *msg) {
808 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
809 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_update_fulfill_htlc_meth, their_node_id, msg);
811 void handle_update_fail_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC *msg) {
812 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
813 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_update_fail_htlc_meth, their_node_id, msg);
815 void handle_update_fail_malformed_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC *msg) {
816 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
817 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_update_fail_malformed_htlc_meth, their_node_id, msg);
819 void handle_commitment_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned *msg) {
820 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
821 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_commitment_signed_meth, their_node_id, msg);
823 void handle_revoke_and_ack_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK *msg) {
824 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
825 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_revoke_and_ack_meth, their_node_id, msg);
827 void handle_update_fee_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee *msg) {
828 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
829 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_update_fee_meth, their_node_id, msg);
831 void handle_announcement_signatures_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures *msg) {
832 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
833 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_announcement_signatures_meth, their_node_id, msg);
835 void peer_disconnected_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) {
836 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
837 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->peer_disconnected_meth, their_node_id, no_connection_possible);
839 void peer_connected_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit *msg) {
840 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
841 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->peer_connected_meth, their_node_id, msg);
843 void handle_channel_reestablish_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReestablish *msg) {
844 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
845 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_channel_reestablish_meth, their_node_id, msg);
847 void handle_error_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage *msg) {
848 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
849 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_error_meth, their_node_id, msg);
851 static void LDKChannelMessageHandler_JCalls_free(void* this_arg) {
852 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
853 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
854 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
858 static void* LDKChannelMessageHandler_JCalls_clone(const void* this_arg) {
859 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
860 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
861 atomic_fetch_add_explicit(&j_calls->MessageSendEventsProvider->refcnt, 1, memory_order_release);
862 return (void*) this_arg;
864 static inline LDKChannelMessageHandler LDKChannelMessageHandler_init (JNIEnv * env, jclass _a, jobject o, jobject MessageSendEventsProvider) {
865 jclass c = (*env)->GetObjectClass(env, o);
867 LDKChannelMessageHandler_JCalls *calls = MALLOC(sizeof(LDKChannelMessageHandler_JCalls), "LDKChannelMessageHandler_JCalls");
868 atomic_init(&calls->refcnt, 1);
870 calls->o = (*env)->NewGlobalRef(env, o);
871 calls->handle_open_channel_meth = (*env)->GetMethodID(env, c, "handle_open_channel", "(JJJ)V");
872 assert(calls->handle_open_channel_meth != NULL);
873 calls->handle_accept_channel_meth = (*env)->GetMethodID(env, c, "handle_accept_channel", "(JJJ)V");
874 assert(calls->handle_accept_channel_meth != NULL);
875 calls->handle_funding_created_meth = (*env)->GetMethodID(env, c, "handle_funding_created", "(JJ)V");
876 assert(calls->handle_funding_created_meth != NULL);
877 calls->handle_funding_signed_meth = (*env)->GetMethodID(env, c, "handle_funding_signed", "(JJ)V");
878 assert(calls->handle_funding_signed_meth != NULL);
879 calls->handle_funding_locked_meth = (*env)->GetMethodID(env, c, "handle_funding_locked", "(JJ)V");
880 assert(calls->handle_funding_locked_meth != NULL);
881 calls->handle_shutdown_meth = (*env)->GetMethodID(env, c, "handle_shutdown", "(JJ)V");
882 assert(calls->handle_shutdown_meth != NULL);
883 calls->handle_closing_signed_meth = (*env)->GetMethodID(env, c, "handle_closing_signed", "(JJ)V");
884 assert(calls->handle_closing_signed_meth != NULL);
885 calls->handle_update_add_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_add_htlc", "(JJ)V");
886 assert(calls->handle_update_add_htlc_meth != NULL);
887 calls->handle_update_fulfill_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fulfill_htlc", "(JJ)V");
888 assert(calls->handle_update_fulfill_htlc_meth != NULL);
889 calls->handle_update_fail_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fail_htlc", "(JJ)V");
890 assert(calls->handle_update_fail_htlc_meth != NULL);
891 calls->handle_update_fail_malformed_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fail_malformed_htlc", "(JJ)V");
892 assert(calls->handle_update_fail_malformed_htlc_meth != NULL);
893 calls->handle_commitment_signed_meth = (*env)->GetMethodID(env, c, "handle_commitment_signed", "(JJ)V");
894 assert(calls->handle_commitment_signed_meth != NULL);
895 calls->handle_revoke_and_ack_meth = (*env)->GetMethodID(env, c, "handle_revoke_and_ack", "(JJ)V");
896 assert(calls->handle_revoke_and_ack_meth != NULL);
897 calls->handle_update_fee_meth = (*env)->GetMethodID(env, c, "handle_update_fee", "(JJ)V");
898 assert(calls->handle_update_fee_meth != NULL);
899 calls->handle_announcement_signatures_meth = (*env)->GetMethodID(env, c, "handle_announcement_signatures", "(JJ)V");
900 assert(calls->handle_announcement_signatures_meth != NULL);
901 calls->peer_disconnected_meth = (*env)->GetMethodID(env, c, "peer_disconnected", "(JZ)V");
902 assert(calls->peer_disconnected_meth != NULL);
903 calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "(JJ)V");
904 assert(calls->peer_connected_meth != NULL);
905 calls->handle_channel_reestablish_meth = (*env)->GetMethodID(env, c, "handle_channel_reestablish", "(JJ)V");
906 assert(calls->handle_channel_reestablish_meth != NULL);
907 calls->handle_error_meth = (*env)->GetMethodID(env, c, "handle_error", "(JJ)V");
908 assert(calls->handle_error_meth != NULL);
910 LDKChannelMessageHandler ret = {
911 .this_arg = (void*) calls,
912 .handle_open_channel = handle_open_channel_jcall,
913 .handle_accept_channel = handle_accept_channel_jcall,
914 .handle_funding_created = handle_funding_created_jcall,
915 .handle_funding_signed = handle_funding_signed_jcall,
916 .handle_funding_locked = handle_funding_locked_jcall,
917 .handle_shutdown = handle_shutdown_jcall,
918 .handle_closing_signed = handle_closing_signed_jcall,
919 .handle_update_add_htlc = handle_update_add_htlc_jcall,
920 .handle_update_fulfill_htlc = handle_update_fulfill_htlc_jcall,
921 .handle_update_fail_htlc = handle_update_fail_htlc_jcall,
922 .handle_update_fail_malformed_htlc = handle_update_fail_malformed_htlc_jcall,
923 .handle_commitment_signed = handle_commitment_signed_jcall,
924 .handle_revoke_and_ack = handle_revoke_and_ack_jcall,
925 .handle_update_fee = handle_update_fee_jcall,
926 .handle_announcement_signatures = handle_announcement_signatures_jcall,
927 .peer_disconnected = peer_disconnected_jcall,
928 .peer_connected = peer_connected_jcall,
929 .handle_channel_reestablish = handle_channel_reestablish_jcall,
930 .handle_error = handle_error_jcall,
931 .free = LDKChannelMessageHandler_JCalls_free,
932 .MessageSendEventsProvider = LDKMessageSendEventsProvider_init(env, _a, MessageSendEventsProvider),
934 calls->MessageSendEventsProvider = ret.MessageSendEventsProvider.this_arg;
937 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1new (JNIEnv * env, jclass _a, jobject o, jobject MessageSendEventsProvider) {
938 LDKChannelMessageHandler *res_ptr = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
939 *res_ptr = LDKChannelMessageHandler_init(env, _a, o, MessageSendEventsProvider);
940 return (long)res_ptr;
942 typedef struct LDKRoutingMessageHandler_JCalls {
943 atomic_size_t refcnt;
946 jmethodID handle_node_announcement_meth;
947 jmethodID handle_channel_announcement_meth;
948 jmethodID handle_channel_update_meth;
949 jmethodID handle_htlc_fail_channel_update_meth;
950 jmethodID get_next_channel_announcements_meth;
951 jmethodID get_next_node_announcements_meth;
952 jmethodID should_request_full_sync_meth;
953 } LDKRoutingMessageHandler_JCalls;
954 LDKCResult_boolLightningErrorZ handle_node_announcement_jcall(const void* this_arg, const LDKNodeAnnouncement *msg) {
955 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
956 LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->handle_node_announcement_meth, msg);
957 LDKCResult_boolLightningErrorZ res = *ret;
961 LDKCResult_boolLightningErrorZ handle_channel_announcement_jcall(const void* this_arg, const LDKChannelAnnouncement *msg) {
962 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
963 LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->handle_channel_announcement_meth, msg);
964 LDKCResult_boolLightningErrorZ res = *ret;
968 LDKCResult_boolLightningErrorZ handle_channel_update_jcall(const void* this_arg, const LDKChannelUpdate *msg) {
969 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
970 LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->handle_channel_update_meth, msg);
971 LDKCResult_boolLightningErrorZ res = *ret;
975 void handle_htlc_fail_channel_update_jcall(const void* this_arg, const LDKHTLCFailChannelUpdate *update) {
976 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
977 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_htlc_fail_channel_update_meth, update);
979 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcements_jcall(const void* this_arg, uint64_t starting_point, uint8_t batch_amount) {
980 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
981 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ* ret = (LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_next_channel_announcements_meth, starting_point, batch_amount);
982 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ res = *ret;
986 LDKCVec_NodeAnnouncementZ get_next_node_announcements_jcall(const void* this_arg, LDKPublicKey starting_point, uint8_t batch_amount) {
987 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
988 LDKCVec_NodeAnnouncementZ* ret = (LDKCVec_NodeAnnouncementZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_next_node_announcements_meth, starting_point, batch_amount);
989 LDKCVec_NodeAnnouncementZ res = *ret;
993 bool should_request_full_sync_jcall(const void* this_arg, LDKPublicKey node_id) {
994 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
995 return (*j_calls->env)->CallBooleanMethod(j_calls->env, j_calls->o, j_calls->should_request_full_sync_meth, node_id);
997 static void LDKRoutingMessageHandler_JCalls_free(void* this_arg) {
998 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
999 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1000 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
1004 static void* LDKRoutingMessageHandler_JCalls_clone(const void* this_arg) {
1005 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1006 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1007 return (void*) this_arg;
1009 static inline LDKRoutingMessageHandler LDKRoutingMessageHandler_init (JNIEnv * env, jclass _a, jobject o) {
1010 jclass c = (*env)->GetObjectClass(env, o);
1012 LDKRoutingMessageHandler_JCalls *calls = MALLOC(sizeof(LDKRoutingMessageHandler_JCalls), "LDKRoutingMessageHandler_JCalls");
1013 atomic_init(&calls->refcnt, 1);
1015 calls->o = (*env)->NewGlobalRef(env, o);
1016 calls->handle_node_announcement_meth = (*env)->GetMethodID(env, c, "handle_node_announcement", "(J)J");
1017 assert(calls->handle_node_announcement_meth != NULL);
1018 calls->handle_channel_announcement_meth = (*env)->GetMethodID(env, c, "handle_channel_announcement", "(J)J");
1019 assert(calls->handle_channel_announcement_meth != NULL);
1020 calls->handle_channel_update_meth = (*env)->GetMethodID(env, c, "handle_channel_update", "(J)J");
1021 assert(calls->handle_channel_update_meth != NULL);
1022 calls->handle_htlc_fail_channel_update_meth = (*env)->GetMethodID(env, c, "handle_htlc_fail_channel_update", "(J)V");
1023 assert(calls->handle_htlc_fail_channel_update_meth != NULL);
1024 calls->get_next_channel_announcements_meth = (*env)->GetMethodID(env, c, "get_next_channel_announcements", "(JB)J");
1025 assert(calls->get_next_channel_announcements_meth != NULL);
1026 calls->get_next_node_announcements_meth = (*env)->GetMethodID(env, c, "get_next_node_announcements", "(JB)J");
1027 assert(calls->get_next_node_announcements_meth != NULL);
1028 calls->should_request_full_sync_meth = (*env)->GetMethodID(env, c, "should_request_full_sync", "(J)Z");
1029 assert(calls->should_request_full_sync_meth != NULL);
1031 LDKRoutingMessageHandler ret = {
1032 .this_arg = (void*) calls,
1033 .handle_node_announcement = handle_node_announcement_jcall,
1034 .handle_channel_announcement = handle_channel_announcement_jcall,
1035 .handle_channel_update = handle_channel_update_jcall,
1036 .handle_htlc_fail_channel_update = handle_htlc_fail_channel_update_jcall,
1037 .get_next_channel_announcements = get_next_channel_announcements_jcall,
1038 .get_next_node_announcements = get_next_node_announcements_jcall,
1039 .should_request_full_sync = should_request_full_sync_jcall,
1040 .free = LDKRoutingMessageHandler_JCalls_free,
1044 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1new (JNIEnv * env, jclass _a, jobject o) {
1045 LDKRoutingMessageHandler *res_ptr = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
1046 *res_ptr = LDKRoutingMessageHandler_init(env, _a, o);
1047 return (long)res_ptr;
1049 typedef struct LDKSocketDescriptor_JCalls {
1050 atomic_size_t refcnt;
1053 jmethodID send_data_meth;
1054 jmethodID disconnect_socket_meth;
1056 jmethodID hash_meth;
1057 } LDKSocketDescriptor_JCalls;
1058 uintptr_t send_data_jcall(void* this_arg, LDKu8slice data, bool resume_read) {
1059 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
1060 uintptr_t* ret = (uintptr_t*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->send_data_meth, data, resume_read);
1061 uintptr_t res = *ret;
1065 void disconnect_socket_jcall(void* this_arg) {
1066 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
1067 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->disconnect_socket_meth);
1069 bool eq_jcall(const void* this_arg, const void *other_arg) {
1070 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
1071 return (*j_calls->env)->CallBooleanMethod(j_calls->env, j_calls->o, j_calls->eq_meth, other_arg);
1073 uint64_t hash_jcall(const void* this_arg) {
1074 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
1075 return (*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->hash_meth);
1077 static void LDKSocketDescriptor_JCalls_free(void* this_arg) {
1078 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
1079 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1080 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
1084 static void* LDKSocketDescriptor_JCalls_clone(const void* this_arg) {
1085 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
1086 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1087 return (void*) this_arg;
1089 static inline LDKSocketDescriptor LDKSocketDescriptor_init (JNIEnv * env, jclass _a, jobject o) {
1090 jclass c = (*env)->GetObjectClass(env, o);
1092 LDKSocketDescriptor_JCalls *calls = MALLOC(sizeof(LDKSocketDescriptor_JCalls), "LDKSocketDescriptor_JCalls");
1093 atomic_init(&calls->refcnt, 1);
1095 calls->o = (*env)->NewGlobalRef(env, o);
1096 calls->send_data_meth = (*env)->GetMethodID(env, c, "send_data", "(JZ)J");
1097 assert(calls->send_data_meth != NULL);
1098 calls->disconnect_socket_meth = (*env)->GetMethodID(env, c, "disconnect_socket", "()V");
1099 assert(calls->disconnect_socket_meth != NULL);
1100 calls->eq_meth = (*env)->GetMethodID(env, c, "eq", "(V)Z");
1101 assert(calls->eq_meth != NULL);
1102 calls->hash_meth = (*env)->GetMethodID(env, c, "hash", "()J");
1103 assert(calls->hash_meth != NULL);
1105 LDKSocketDescriptor ret = {
1106 .this_arg = (void*) calls,
1107 .send_data = send_data_jcall,
1108 .disconnect_socket = disconnect_socket_jcall,
1111 .clone = LDKSocketDescriptor_JCalls_clone,
1112 .free = LDKSocketDescriptor_JCalls_free,
1116 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1new (JNIEnv * env, jclass _a, jobject o) {
1117 LDKSocketDescriptor *res_ptr = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
1118 *res_ptr = LDKSocketDescriptor_init(env, _a, o);
1119 return (long)res_ptr;
1121 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HTLCOutputInCommitmentSignatureZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1122 LDKC2Tuple_HTLCOutputInCommitmentSignatureZ arg_conv = *(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ*)arg;
1124 return C2Tuple_HTLCOutputInCommitmentSignatureZ_free(arg_conv);
1127 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1128 LDKC2Tuple_OutPointScriptZ arg_conv = *(LDKC2Tuple_OutPointScriptZ*)arg;
1130 return C2Tuple_OutPointScriptZ_free(arg_conv);
1133 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1Scriptu64Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
1134 LDKC2Tuple_Scriptu64Z arg_conv = *(LDKC2Tuple_Scriptu64Z*)arg;
1136 return C2Tuple_Scriptu64Z_free(arg_conv);
1139 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1140 LDKC2Tuple_SignatureCVec_SignatureZZ arg_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)arg;
1142 return C2Tuple_SignatureCVec_SignatureZZ_free(arg_conv);
1145 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1Txidu32Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
1146 LDKC2Tuple_Txidu32Z arg_conv = *(LDKC2Tuple_Txidu32Z*)arg;
1148 return C2Tuple_Txidu32Z_free(arg_conv);
1151 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
1152 LDKC2Tuple_u64u64Z arg_conv = *(LDKC2Tuple_u64u64Z*)arg;
1154 return C2Tuple_u64u64Z_free(arg_conv);
1157 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1158 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arg_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)arg;
1160 return C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(arg_conv);
1163 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1Scriptu64ZChainErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1164 LDKChainError arg_conv = *(LDKChainError*)arg;
1166 LDKCResult_C2Tuple_Scriptu64ZChainErrorZ* ret = MALLOC(sizeof(LDKCResult_C2Tuple_Scriptu64ZChainErrorZ), "LDKCResult_C2Tuple_Scriptu64ZChainErrorZ");
1167 *ret = CResult_C2Tuple_Scriptu64ZChainErrorZ_err(arg_conv);
1171 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1Scriptu64ZChainErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1172 LDKCResult_C2Tuple_Scriptu64ZChainErrorZ arg_conv = *(LDKCResult_C2Tuple_Scriptu64ZChainErrorZ*)arg;
1174 return CResult_C2Tuple_Scriptu64ZChainErrorZ_free(arg_conv);
1177 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1Scriptu64ZChainErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1178 LDKC2Tuple_Scriptu64Z arg_conv = *(LDKC2Tuple_Scriptu64Z*)arg;
1180 LDKCResult_C2Tuple_Scriptu64ZChainErrorZ* ret = MALLOC(sizeof(LDKCResult_C2Tuple_Scriptu64ZChainErrorZ), "LDKCResult_C2Tuple_Scriptu64ZChainErrorZ");
1181 *ret = CResult_C2Tuple_Scriptu64ZChainErrorZ_ok(arg_conv);
1185 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1186 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ arg_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg;
1188 return CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(arg_conv);
1191 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1192 LDKC2Tuple_SignatureCVec_SignatureZZ arg_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)arg;
1194 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
1195 *ret = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(arg_conv);
1199 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1200 LDKCResult_CVec_SignatureZNoneZ arg_conv = *(LDKCResult_CVec_SignatureZNoneZ*)arg;
1202 return CResult_CVec_SignatureZNoneZ_free(arg_conv);
1205 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1206 LDKCVec_SignatureZ arg_conv = *(LDKCVec_SignatureZ*)arg;
1208 LDKCResult_CVec_SignatureZNoneZ* ret = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
1209 *ret = CResult_CVec_SignatureZNoneZ_ok(arg_conv);
1213 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1214 LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg;
1216 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
1217 *ret = CResult_CVec_u8ZPeerHandleErrorZ_err(arg_conv);
1221 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1222 LDKCResult_CVec_u8ZPeerHandleErrorZ arg_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg;
1224 return CResult_CVec_u8ZPeerHandleErrorZ_free(arg_conv);
1227 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1228 LDKCVec_u8Z arg_conv = *(LDKCVec_u8Z*)arg;
1230 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
1231 *ret = CResult_CVec_u8ZPeerHandleErrorZ_ok(arg_conv);
1235 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1236 LDKAPIError arg_conv = *(LDKAPIError*)arg;
1238 LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
1239 *ret = CResult_NoneAPIErrorZ_err(arg_conv);
1243 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1244 LDKCResult_NoneAPIErrorZ arg_conv = *(LDKCResult_NoneAPIErrorZ*)arg;
1246 return CResult_NoneAPIErrorZ_free(arg_conv);
1249 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1250 LDKChannelMonitorUpdateErr arg_conv = *(LDKChannelMonitorUpdateErr*)arg;
1252 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
1253 *ret = CResult_NoneChannelMonitorUpdateErrZ_err(arg_conv);
1257 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1258 LDKCResult_NoneChannelMonitorUpdateErrZ arg_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)arg;
1260 return CResult_NoneChannelMonitorUpdateErrZ_free(arg_conv);
1263 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1264 LDKMonitorUpdateError arg_conv = *(LDKMonitorUpdateError*)arg;
1266 LDKCResult_NoneMonitorUpdateErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
1267 *ret = CResult_NoneMonitorUpdateErrorZ_err(arg_conv);
1271 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1272 LDKCResult_NoneMonitorUpdateErrorZ arg_conv = *(LDKCResult_NoneMonitorUpdateErrorZ*)arg;
1274 return CResult_NoneMonitorUpdateErrorZ_free(arg_conv);
1277 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1278 LDKPaymentSendFailure arg_conv = *(LDKPaymentSendFailure*)arg;
1280 LDKCResult_NonePaymentSendFailureZ* ret = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
1281 *ret = CResult_NonePaymentSendFailureZ_err(arg_conv);
1285 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1286 LDKCResult_NonePaymentSendFailureZ arg_conv = *(LDKCResult_NonePaymentSendFailureZ*)arg;
1288 return CResult_NonePaymentSendFailureZ_free(arg_conv);
1291 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1292 LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg;
1294 LDKCResult_NonePeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
1295 *ret = CResult_NonePeerHandleErrorZ_err(arg_conv);
1299 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1300 LDKCResult_NonePeerHandleErrorZ arg_conv = *(LDKCResult_NonePeerHandleErrorZ*)arg;
1302 return CResult_NonePeerHandleErrorZ_free(arg_conv);
1305 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1306 LDKLightningError arg_conv = *(LDKLightningError*)arg;
1308 LDKCResult_RouteLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
1309 *ret = CResult_RouteLightningErrorZ_err(arg_conv);
1313 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1314 LDKCResult_RouteLightningErrorZ arg_conv = *(LDKCResult_RouteLightningErrorZ*)arg;
1316 return CResult_RouteLightningErrorZ_free(arg_conv);
1319 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1320 LDKRoute arg_conv = *(LDKRoute*)arg;
1322 LDKCResult_RouteLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
1323 *ret = CResult_RouteLightningErrorZ_ok(arg_conv);
1327 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1328 LDKCResult_SignatureNoneZ arg_conv = *(LDKCResult_SignatureNoneZ*)arg;
1330 return CResult_SignatureNoneZ_free(arg_conv);
1333 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1334 LDKSignature arg_conv = *(LDKSignature*)arg;
1336 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
1337 *ret = CResult_SignatureNoneZ_ok(arg_conv);
1341 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1342 LDKSecp256k1Error arg_conv = *(LDKSecp256k1Error*)arg;
1344 LDKCResult_TxCreationKeysSecpErrorZ* ret = MALLOC(sizeof(LDKCResult_TxCreationKeysSecpErrorZ), "LDKCResult_TxCreationKeysSecpErrorZ");
1345 *ret = CResult_TxCreationKeysSecpErrorZ_err(arg_conv);
1349 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1350 LDKCResult_TxCreationKeysSecpErrorZ arg_conv = *(LDKCResult_TxCreationKeysSecpErrorZ*)arg;
1352 return CResult_TxCreationKeysSecpErrorZ_free(arg_conv);
1355 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1356 LDKTxCreationKeys arg_conv = *(LDKTxCreationKeys*)arg;
1358 LDKCResult_TxCreationKeysSecpErrorZ* ret = MALLOC(sizeof(LDKCResult_TxCreationKeysSecpErrorZ), "LDKCResult_TxCreationKeysSecpErrorZ");
1359 *ret = CResult_TxCreationKeysSecpErrorZ_ok(arg_conv);
1363 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1364 LDKLightningError arg_conv = *(LDKLightningError*)arg;
1366 LDKCResult_boolLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
1367 *ret = CResult_boolLightningErrorZ_err(arg_conv);
1371 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1372 LDKCResult_boolLightningErrorZ arg_conv = *(LDKCResult_boolLightningErrorZ*)arg;
1374 return CResult_boolLightningErrorZ_free(arg_conv);
1377 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1ok(JNIEnv * _env, jclass _b, jboolean arg) {
1378 LDKCResult_boolLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
1379 *ret = CResult_boolLightningErrorZ_ok(arg);
1383 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1384 LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg;
1386 LDKCResult_boolPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
1387 *ret = CResult_boolPeerHandleErrorZ_err(arg_conv);
1391 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1392 LDKCResult_boolPeerHandleErrorZ arg_conv = *(LDKCResult_boolPeerHandleErrorZ*)arg;
1394 return CResult_boolPeerHandleErrorZ_free(arg_conv);
1397 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b, jboolean arg) {
1398 LDKCResult_boolPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
1399 *ret = CResult_boolPeerHandleErrorZ_ok(arg);
1403 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1HTLCOutputInCommitmentSignatureZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1404 LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ arg_conv = *(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ*)arg;
1406 return CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ_free(arg_conv);
1409 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1410 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ arg_conv = *(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)arg;
1412 return CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(arg_conv);
1415 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1RouteHopZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1416 LDKCVec_CVec_RouteHopZZ arg_conv = *(LDKCVec_CVec_RouteHopZZ*)arg;
1418 return CVec_CVec_RouteHopZZ_free(arg_conv);
1421 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1422 LDKCVec_ChannelDetailsZ arg_conv = *(LDKCVec_ChannelDetailsZ*)arg;
1424 return CVec_ChannelDetailsZ_free(arg_conv);
1427 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelMonitorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1428 LDKCVec_ChannelMonitorZ arg_conv = *(LDKCVec_ChannelMonitorZ*)arg;
1430 return CVec_ChannelMonitorZ_free(arg_conv);
1433 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1EventZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1434 LDKCVec_EventZ arg_conv = *(LDKCVec_EventZ*)arg;
1436 return CVec_EventZ_free(arg_conv);
1439 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1HTLCOutputInCommitmentZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1440 LDKCVec_HTLCOutputInCommitmentZ arg_conv = *(LDKCVec_HTLCOutputInCommitmentZ*)arg;
1442 return CVec_HTLCOutputInCommitmentZ_free(arg_conv);
1445 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MessageSendEventZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1446 LDKCVec_MessageSendEventZ arg_conv = *(LDKCVec_MessageSendEventZ*)arg;
1448 return CVec_MessageSendEventZ_free(arg_conv);
1451 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorEventZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1452 LDKCVec_MonitorEventZ arg_conv = *(LDKCVec_MonitorEventZ*)arg;
1454 return CVec_MonitorEventZ_free(arg_conv);
1457 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NetAddressZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1458 LDKCVec_NetAddressZ arg_conv = *(LDKCVec_NetAddressZ*)arg;
1460 return CVec_NetAddressZ_free(arg_conv);
1463 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NodeAnnouncementZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1464 LDKCVec_NodeAnnouncementZ arg_conv = *(LDKCVec_NodeAnnouncementZ*)arg;
1466 return CVec_NodeAnnouncementZ_free(arg_conv);
1469 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PublicKeyZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1470 LDKCVec_PublicKeyZ arg_conv = *(LDKCVec_PublicKeyZ*)arg;
1472 return CVec_PublicKeyZ_free(arg_conv);
1475 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1476 LDKCVec_RouteHintZ arg_conv = *(LDKCVec_RouteHintZ*)arg;
1478 return CVec_RouteHintZ_free(arg_conv);
1481 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHopZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1482 LDKCVec_RouteHopZ arg_conv = *(LDKCVec_RouteHopZ*)arg;
1484 return CVec_RouteHopZ_free(arg_conv);
1487 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SignatureZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1488 LDKCVec_SignatureZ arg_conv = *(LDKCVec_SignatureZ*)arg;
1490 return CVec_SignatureZ_free(arg_conv);
1493 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SpendableOutputDescriptorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1494 LDKCVec_SpendableOutputDescriptorZ arg_conv = *(LDKCVec_SpendableOutputDescriptorZ*)arg;
1496 return CVec_SpendableOutputDescriptorZ_free(arg_conv);
1499 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1500 LDKCVec_TransactionZ arg_conv = *(LDKCVec_TransactionZ*)arg;
1502 return CVec_TransactionZ_free(arg_conv);
1505 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateAddHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1506 LDKCVec_UpdateAddHTLCZ arg_conv = *(LDKCVec_UpdateAddHTLCZ*)arg;
1508 return CVec_UpdateAddHTLCZ_free(arg_conv);
1511 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1512 LDKCVec_UpdateFailHTLCZ arg_conv = *(LDKCVec_UpdateFailHTLCZ*)arg;
1514 return CVec_UpdateFailHTLCZ_free(arg_conv);
1517 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailMalformedHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1518 LDKCVec_UpdateFailMalformedHTLCZ arg_conv = *(LDKCVec_UpdateFailMalformedHTLCZ*)arg;
1520 return CVec_UpdateFailMalformedHTLCZ_free(arg_conv);
1523 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFulfillHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1524 LDKCVec_UpdateFulfillHTLCZ arg_conv = *(LDKCVec_UpdateFulfillHTLCZ*)arg;
1526 return CVec_UpdateFulfillHTLCZ_free(arg_conv);
1529 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u64Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
1530 LDKCVec_u64Z arg_conv = *(LDKCVec_u64Z*)arg;
1532 return CVec_u64Z_free(arg_conv);
1535 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u8Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
1536 LDKCVec_u8Z arg_conv = *(LDKCVec_u8Z*)arg;
1538 return CVec_u8Z_free(arg_conv);
1541 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1usizeZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1542 LDKCVec_usizeZ arg_conv = *(LDKCVec_usizeZ*)arg;
1544 return CVec_usizeZ_free(arg_conv);
1547 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_1free(JNIEnv * _env, jclass _b, jlong _res) {
1548 LDKTxOut _res_conv = *(LDKTxOut*)_res;
1550 return TxOut_free(_res_conv);
1553 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1Txidu32Z_1new(JNIEnv * _env, jclass _b, jlong a, jint b) {
1554 LDKThirtyTwoBytes a_conv = *(LDKThirtyTwoBytes*)a;
1556 LDKC2Tuple_Txidu32Z* ret = MALLOC(sizeof(LDKC2Tuple_Txidu32Z), "LDKC2Tuple_Txidu32Z");
1557 *ret = C2Tuple_Txidu32Z_new(a_conv, b);
1561 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1Scriptu64Z_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
1562 LDKCVec_u8Z a_conv = *(LDKCVec_u8Z*)a;
1564 LDKC2Tuple_Scriptu64Z* ret = MALLOC(sizeof(LDKC2Tuple_Scriptu64Z), "LDKC2Tuple_Scriptu64Z");
1565 *ret = C2Tuple_Scriptu64Z_new(a_conv, b);
1569 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
1570 LDKC2Tuple_u64u64Z* ret = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
1571 *ret = C2Tuple_u64u64Z_new(a, b);
1575 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
1576 LDKSignature a_conv = *(LDKSignature*)a;
1578 LDKCVec_SignatureZ b_conv = *(LDKCVec_SignatureZ*)b;
1580 LDKC2Tuple_SignatureCVec_SignatureZZ* ret = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
1581 *ret = C2Tuple_SignatureCVec_SignatureZZ_new(a_conv, b_conv);
1585 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1err(JNIEnv * _env, jclass _b) {
1586 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
1587 *ret = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err();
1591 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1err(JNIEnv * _env, jclass _b) {
1592 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
1593 *ret = CResult_SignatureNoneZ_err();
1597 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1err(JNIEnv * _env, jclass _b) {
1598 LDKCResult_CVec_SignatureZNoneZ* ret = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
1599 *ret = CResult_CVec_SignatureZNoneZ_err();
1603 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1ok(JNIEnv * _env, jclass _b) {
1604 LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
1605 *ret = CResult_NoneAPIErrorZ_ok();
1609 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1ok(JNIEnv * _env, jclass _b) {
1610 LDKCResult_NonePaymentSendFailureZ* ret = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
1611 *ret = CResult_NonePaymentSendFailureZ_ok();
1615 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1ok(JNIEnv * _env, jclass _b) {
1616 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
1617 *ret = CResult_NoneChannelMonitorUpdateErrZ_ok();
1621 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1ok(JNIEnv * _env, jclass _b) {
1622 LDKCResult_NoneMonitorUpdateErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
1623 *ret = CResult_NoneMonitorUpdateErrorZ_ok();
1627 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
1628 LDKOutPoint a_conv = *(LDKOutPoint*)a;
1630 a_conv._underlying_ref = false;
1631 LDKCVec_u8Z b_conv = *(LDKCVec_u8Z*)b;
1633 LDKC2Tuple_OutPointScriptZ* ret = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
1634 *ret = C2Tuple_OutPointScriptZ_new(a_conv, b_conv);
1638 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b, jlong c) {
1639 LDKChannelAnnouncement a_conv = *(LDKChannelAnnouncement*)a;
1641 a_conv._underlying_ref = false;
1642 LDKChannelUpdate b_conv = *(LDKChannelUpdate*)b;
1644 b_conv._underlying_ref = false;
1645 LDKChannelUpdate c_conv = *(LDKChannelUpdate*)c;
1647 c_conv._underlying_ref = false;
1648 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
1649 *ret = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a_conv, b_conv, c_conv);
1653 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b) {
1654 LDKCResult_NonePeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
1655 *ret = CResult_NonePeerHandleErrorZ_ok();
1659 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HTLCOutputInCommitmentSignatureZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
1660 LDKHTLCOutputInCommitment a_conv = *(LDKHTLCOutputInCommitment*)a;
1662 a_conv._underlying_ref = false;
1663 LDKSignature b_conv = *(LDKSignature*)b;
1665 LDKC2Tuple_HTLCOutputInCommitmentSignatureZ* ret = MALLOC(sizeof(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ), "LDKC2Tuple_HTLCOutputInCommitmentSignatureZ");
1666 *ret = C2Tuple_HTLCOutputInCommitmentSignatureZ_new(a_conv, b_conv);
1670 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1671 LDKEvent this_ptr_conv = *(LDKEvent*)this_ptr;
1672 FREE((void*)this_ptr);
1673 return Event_free(this_ptr_conv);
1676 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1677 LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)this_ptr;
1678 FREE((void*)this_ptr);
1679 return MessageSendEvent_free(this_ptr_conv);
1682 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1683 LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)this_ptr;
1684 FREE((void*)this_ptr);
1685 return MessageSendEventsProvider_free(this_ptr_conv);
1688 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1689 LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)this_ptr;
1690 FREE((void*)this_ptr);
1691 return EventsProvider_free(this_ptr_conv);
1694 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_APIError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1695 LDKAPIError this_ptr_conv = *(LDKAPIError*)this_ptr;
1696 FREE((void*)this_ptr);
1697 return APIError_free(this_ptr_conv);
1700 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Level_1max(JNIEnv * _env, jclass _b) {
1701 LDKLevel* ret = MALLOC(sizeof(LDKLevel), "LDKLevel");
1706 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Logger_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1707 LDKLogger this_ptr_conv = *(LDKLogger*)this_ptr;
1708 FREE((void*)this_ptr);
1709 return Logger_free(this_ptr_conv);
1712 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1713 LDKChannelHandshakeConfig this_ptr_conv = *(LDKChannelHandshakeConfig*)this_ptr;
1714 FREE((void*)this_ptr);
1715 this_ptr_conv._underlying_ref = false;
1716 return ChannelHandshakeConfig_free(this_ptr_conv);
1719 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr) {
1720 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
1721 return ChannelHandshakeConfig_get_minimum_depth(this_ptr_conv);
1724 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
1725 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
1726 return ChannelHandshakeConfig_set_minimum_depth(this_ptr_conv, val);
1729 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
1730 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
1731 return ChannelHandshakeConfig_get_our_to_self_delay(this_ptr_conv);
1734 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
1735 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
1736 return ChannelHandshakeConfig_set_our_to_self_delay(this_ptr_conv, val);
1739 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
1740 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
1741 return ChannelHandshakeConfig_get_our_htlc_minimum_msat(this_ptr_conv);
1744 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1745 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
1746 return ChannelHandshakeConfig_set_our_htlc_minimum_msat(this_ptr_conv, val);
1749 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) {
1750 LDKChannelHandshakeConfig* ret = MALLOC(sizeof(LDKChannelHandshakeConfig), "LDKChannelHandshakeConfig");
1751 *ret = ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg);
1752 assert(!ret->_underlying_ref);
1753 ret->_underlying_ref = true;
1757 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1default(JNIEnv * _env, jclass _b) {
1758 LDKChannelHandshakeConfig* ret = MALLOC(sizeof(LDKChannelHandshakeConfig), "LDKChannelHandshakeConfig");
1759 *ret = ChannelHandshakeConfig_default();
1760 assert(!ret->_underlying_ref);
1761 ret->_underlying_ref = true;
1765 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1766 LDKChannelHandshakeLimits this_ptr_conv = *(LDKChannelHandshakeLimits*)this_ptr;
1767 FREE((void*)this_ptr);
1768 this_ptr_conv._underlying_ref = false;
1769 return ChannelHandshakeLimits_free(this_ptr_conv);
1772 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
1773 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1774 return ChannelHandshakeLimits_get_min_funding_satoshis(this_ptr_conv);
1777 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1778 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1779 return ChannelHandshakeLimits_set_min_funding_satoshis(this_ptr_conv, val);
1782 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
1783 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1784 return ChannelHandshakeLimits_get_max_htlc_minimum_msat(this_ptr_conv);
1787 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1788 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1789 return ChannelHandshakeLimits_set_max_htlc_minimum_msat(this_ptr_conv, val);
1792 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
1793 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1794 return ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(this_ptr_conv);
1797 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) {
1798 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1799 return ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(this_ptr_conv, val);
1802 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
1803 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1804 return ChannelHandshakeLimits_get_max_channel_reserve_satoshis(this_ptr_conv);
1807 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1808 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1809 return ChannelHandshakeLimits_set_max_channel_reserve_satoshis(this_ptr_conv, val);
1812 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr) {
1813 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1814 return ChannelHandshakeLimits_get_min_max_accepted_htlcs(this_ptr_conv);
1817 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
1818 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1819 return ChannelHandshakeLimits_set_min_max_accepted_htlcs(this_ptr_conv, val);
1822 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
1823 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1824 return ChannelHandshakeLimits_get_min_dust_limit_satoshis(this_ptr_conv);
1827 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1828 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1829 return ChannelHandshakeLimits_set_min_dust_limit_satoshis(this_ptr_conv, val);
1832 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
1833 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1834 return ChannelHandshakeLimits_get_max_dust_limit_satoshis(this_ptr_conv);
1837 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1838 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1839 return ChannelHandshakeLimits_set_max_dust_limit_satoshis(this_ptr_conv, val);
1842 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr) {
1843 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1844 return ChannelHandshakeLimits_get_max_minimum_depth(this_ptr_conv);
1847 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
1848 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1849 return ChannelHandshakeLimits_set_max_minimum_depth(this_ptr_conv, val);
1852 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1force_1announced_1channel_1preference(JNIEnv * _env, jclass _b, jlong this_ptr) {
1853 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1854 return ChannelHandshakeLimits_get_force_announced_channel_preference(this_ptr_conv);
1857 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1force_1announced_1channel_1preference(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
1858 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1859 return ChannelHandshakeLimits_set_force_announced_channel_preference(this_ptr_conv, val);
1862 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1their_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
1863 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1864 return ChannelHandshakeLimits_get_their_to_self_delay(this_ptr_conv);
1867 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1their_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
1868 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1869 return ChannelHandshakeLimits_set_their_to_self_delay(this_ptr_conv, val);
1872 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) {
1873 LDKChannelHandshakeLimits* ret = MALLOC(sizeof(LDKChannelHandshakeLimits), "LDKChannelHandshakeLimits");
1874 *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);
1875 assert(!ret->_underlying_ref);
1876 ret->_underlying_ref = true;
1880 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1default(JNIEnv * _env, jclass _b) {
1881 LDKChannelHandshakeLimits* ret = MALLOC(sizeof(LDKChannelHandshakeLimits), "LDKChannelHandshakeLimits");
1882 *ret = ChannelHandshakeLimits_default();
1883 assert(!ret->_underlying_ref);
1884 ret->_underlying_ref = true;
1888 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1889 LDKChannelConfig this_ptr_conv = *(LDKChannelConfig*)this_ptr;
1890 FREE((void*)this_ptr);
1891 this_ptr_conv._underlying_ref = false;
1892 return ChannelConfig_free(this_ptr_conv);
1895 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr) {
1896 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
1897 return ChannelConfig_get_fee_proportional_millionths(this_ptr_conv);
1900 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
1901 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
1902 return ChannelConfig_set_fee_proportional_millionths(this_ptr_conv, val);
1905 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1announced_1channel(JNIEnv * _env, jclass _b, jlong this_ptr) {
1906 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
1907 return ChannelConfig_get_announced_channel(this_ptr_conv);
1910 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1announced_1channel(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
1911 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
1912 return ChannelConfig_set_announced_channel(this_ptr_conv, val);
1915 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1commit_1upfront_1shutdown_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
1916 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
1917 return ChannelConfig_get_commit_upfront_shutdown_pubkey(this_ptr_conv);
1920 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1commit_1upfront_1shutdown_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
1921 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
1922 return ChannelConfig_set_commit_upfront_shutdown_pubkey(this_ptr_conv, val);
1925 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) {
1926 LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
1927 *ret = ChannelConfig_new(fee_proportional_millionths_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg);
1928 assert(!ret->_underlying_ref);
1929 ret->_underlying_ref = true;
1933 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1default(JNIEnv * _env, jclass _b) {
1934 LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
1935 *ret = ChannelConfig_default();
1936 assert(!ret->_underlying_ref);
1937 ret->_underlying_ref = true;
1941 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1write(JNIEnv * _env, jclass _b, jlong obj) {
1942 LDKChannelConfig* obj_conv = (LDKChannelConfig*)obj;
1943 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
1944 *ret = ChannelConfig_write(obj_conv);
1948 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1read(JNIEnv * _env, jclass _b, jlong ser) {
1949 LDKu8slice ser_conv = *(LDKu8slice*)ser;
1951 LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
1952 *ret = ChannelConfig_read(ser_conv);
1953 assert(!ret->_underlying_ref);
1954 ret->_underlying_ref = true;
1958 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1959 LDKUserConfig this_ptr_conv = *(LDKUserConfig*)this_ptr;
1960 FREE((void*)this_ptr);
1961 this_ptr_conv._underlying_ref = false;
1962 return UserConfig_free(this_ptr_conv);
1965 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1own_1channel_1config(JNIEnv * _env, jclass _b, jlong this_ptr) {
1966 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
1967 LDKChannelHandshakeConfig* ret = MALLOC(sizeof(LDKChannelHandshakeConfig), "LDKChannelHandshakeConfig");
1968 *ret = UserConfig_get_own_channel_config(this_ptr_conv);
1969 assert(!ret->_underlying_ref);
1970 ret->_underlying_ref = true;
1974 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1own_1channel_1config(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1975 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
1976 LDKChannelHandshakeConfig val_conv = *(LDKChannelHandshakeConfig*)val;
1978 val_conv._underlying_ref = false;
1979 return UserConfig_set_own_channel_config(this_ptr_conv, val_conv);
1982 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1peer_1channel_1config_1limits(JNIEnv * _env, jclass _b, jlong this_ptr) {
1983 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
1984 LDKChannelHandshakeLimits* ret = MALLOC(sizeof(LDKChannelHandshakeLimits), "LDKChannelHandshakeLimits");
1985 *ret = UserConfig_get_peer_channel_config_limits(this_ptr_conv);
1986 assert(!ret->_underlying_ref);
1987 ret->_underlying_ref = true;
1991 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1peer_1channel_1config_1limits(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1992 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
1993 LDKChannelHandshakeLimits val_conv = *(LDKChannelHandshakeLimits*)val;
1995 val_conv._underlying_ref = false;
1996 return UserConfig_set_peer_channel_config_limits(this_ptr_conv, val_conv);
1999 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1channel_1options(JNIEnv * _env, jclass _b, jlong this_ptr) {
2000 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
2001 LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
2002 *ret = UserConfig_get_channel_options(this_ptr_conv);
2003 assert(!ret->_underlying_ref);
2004 ret->_underlying_ref = true;
2008 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1channel_1options(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2009 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
2010 LDKChannelConfig val_conv = *(LDKChannelConfig*)val;
2012 val_conv._underlying_ref = false;
2013 return UserConfig_set_channel_options(this_ptr_conv, val_conv);
2016 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) {
2017 LDKChannelHandshakeConfig own_channel_config_arg_conv = *(LDKChannelHandshakeConfig*)own_channel_config_arg;
2018 FREE((void*)own_channel_config_arg);
2019 own_channel_config_arg_conv._underlying_ref = false;
2020 LDKChannelHandshakeLimits peer_channel_config_limits_arg_conv = *(LDKChannelHandshakeLimits*)peer_channel_config_limits_arg;
2021 FREE((void*)peer_channel_config_limits_arg);
2022 peer_channel_config_limits_arg_conv._underlying_ref = false;
2023 LDKChannelConfig channel_options_arg_conv = *(LDKChannelConfig*)channel_options_arg;
2024 FREE((void*)channel_options_arg);
2025 channel_options_arg_conv._underlying_ref = false;
2026 LDKUserConfig* ret = MALLOC(sizeof(LDKUserConfig), "LDKUserConfig");
2027 *ret = UserConfig_new(own_channel_config_arg_conv, peer_channel_config_limits_arg_conv, channel_options_arg_conv);
2028 assert(!ret->_underlying_ref);
2029 ret->_underlying_ref = true;
2033 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1default(JNIEnv * _env, jclass _b) {
2034 LDKUserConfig* ret = MALLOC(sizeof(LDKUserConfig), "LDKUserConfig");
2035 *ret = UserConfig_default();
2036 assert(!ret->_underlying_ref);
2037 ret->_underlying_ref = true;
2041 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainWatchInterface_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2042 LDKChainWatchInterface this_ptr_conv = *(LDKChainWatchInterface*)this_ptr;
2043 FREE((void*)this_ptr);
2044 return ChainWatchInterface_free(this_ptr_conv);
2047 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2048 LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)this_ptr;
2049 FREE((void*)this_ptr);
2050 return BroadcasterInterface_free(this_ptr_conv);
2053 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainListener_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2054 LDKChainListener this_ptr_conv = *(LDKChainListener*)this_ptr;
2055 FREE((void*)this_ptr);
2056 return ChainListener_free(this_ptr_conv);
2059 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2060 LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)this_ptr;
2061 FREE((void*)this_ptr);
2062 return FeeEstimator_free(this_ptr_conv);
2065 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainWatchedUtil_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2066 LDKChainWatchedUtil this_ptr_conv = *(LDKChainWatchedUtil*)this_ptr;
2067 FREE((void*)this_ptr);
2068 this_ptr_conv._underlying_ref = false;
2069 return ChainWatchedUtil_free(this_ptr_conv);
2072 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainWatchedUtil_1new(JNIEnv * _env, jclass _b) {
2073 LDKChainWatchedUtil* ret = MALLOC(sizeof(LDKChainWatchedUtil), "LDKChainWatchedUtil");
2074 *ret = ChainWatchedUtil_new();
2075 assert(!ret->_underlying_ref);
2076 ret->_underlying_ref = true;
2080 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChainWatchedUtil_1register_1tx(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray txid, jlong script_pub_key) {
2081 LDKChainWatchedUtil* this_arg_conv = (LDKChainWatchedUtil*)this_arg;
2082 unsigned char txid_arr[32];
2083 (*_env)->GetByteArrayRegion (_env, txid, 0, 32, txid_arr);
2084 unsigned char (*txid_ref)[32] = &txid_arr;
2085 LDKu8slice script_pub_key_conv = *(LDKu8slice*)script_pub_key;
2086 FREE((void*)script_pub_key);
2087 return ChainWatchedUtil_register_tx(this_arg_conv, txid_ref, script_pub_key_conv);
2090 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChainWatchedUtil_1register_1outpoint(JNIEnv * _env, jclass _b, jlong this_arg, jlong outpoint, jlong _script_pub_key) {
2091 LDKChainWatchedUtil* this_arg_conv = (LDKChainWatchedUtil*)this_arg;
2092 LDKC2Tuple_Txidu32Z outpoint_conv = *(LDKC2Tuple_Txidu32Z*)outpoint;
2093 FREE((void*)outpoint);
2094 LDKu8slice _script_pub_key_conv = *(LDKu8slice*)_script_pub_key;
2095 FREE((void*)_script_pub_key);
2096 return ChainWatchedUtil_register_outpoint(this_arg_conv, outpoint_conv, _script_pub_key_conv);
2099 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChainWatchedUtil_1watch_1all(JNIEnv * _env, jclass _b, jlong this_arg) {
2100 LDKChainWatchedUtil* this_arg_conv = (LDKChainWatchedUtil*)this_arg;
2101 return ChainWatchedUtil_watch_all(this_arg_conv);
2104 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChainWatchedUtil_1does_1match_1tx(JNIEnv * _env, jclass _b, jlong this_arg, jlong tx) {
2105 LDKChainWatchedUtil* this_arg_conv = (LDKChainWatchedUtil*)this_arg;
2106 LDKTransaction tx_conv = *(LDKTransaction*)tx;
2108 return ChainWatchedUtil_does_match_tx(this_arg_conv, tx_conv);
2111 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlockNotifier_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2112 LDKBlockNotifier this_ptr_conv = *(LDKBlockNotifier*)this_ptr;
2113 FREE((void*)this_ptr);
2114 this_ptr_conv._underlying_ref = false;
2115 return BlockNotifier_free(this_ptr_conv);
2118 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlockNotifier_1new(JNIEnv * _env, jclass _b, jlong chain_monitor) {
2119 LDKChainWatchInterface chain_monitor_conv = *(LDKChainWatchInterface*)chain_monitor;
2120 LDKChainWatchInterface_JCalls_clone(chain_monitor_conv.this_arg);
2121 LDKBlockNotifier* ret = MALLOC(sizeof(LDKBlockNotifier), "LDKBlockNotifier");
2122 *ret = BlockNotifier_new(chain_monitor_conv);
2123 assert(!ret->_underlying_ref);
2124 ret->_underlying_ref = true;
2128 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlockNotifier_1register_1listener(JNIEnv * _env, jclass _b, jlong this_arg, jlong listener) {
2129 LDKBlockNotifier* this_arg_conv = (LDKBlockNotifier*)this_arg;
2130 LDKChainListener listener_conv = *(LDKChainListener*)listener;
2131 LDKChainListener_JCalls_clone(listener_conv.this_arg);
2132 return BlockNotifier_register_listener(this_arg_conv, listener_conv);
2135 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlockNotifier_1block_1connected(JNIEnv * _env, jclass _b, jlong this_arg, jlong block, jint height) {
2136 LDKBlockNotifier* this_arg_conv = (LDKBlockNotifier*)this_arg;
2137 LDKu8slice block_conv = *(LDKu8slice*)block;
2139 return BlockNotifier_block_connected(this_arg_conv, block_conv, height);
2142 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_BlockNotifier_1block_1connected_1checked(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jint height, jlong txn_matched, jlong indexes_of_txn_matched) {
2143 LDKBlockNotifier* this_arg_conv = (LDKBlockNotifier*)this_arg;
2144 unsigned char header_arr[80];
2145 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
2146 unsigned char (*header_ref)[80] = &header_arr;
2147 LDKCVec_TransactionZ txn_matched_conv = *(LDKCVec_TransactionZ*)txn_matched;
2148 FREE((void*)txn_matched);
2149 LDKusizeslice indexes_of_txn_matched_conv = *(LDKusizeslice*)indexes_of_txn_matched;
2150 FREE((void*)indexes_of_txn_matched);
2151 return BlockNotifier_block_connected_checked(this_arg_conv, header_ref, height, txn_matched_conv, indexes_of_txn_matched_conv);
2154 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlockNotifier_1block_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jint disconnected_height) {
2155 LDKBlockNotifier* this_arg_conv = (LDKBlockNotifier*)this_arg;
2156 unsigned char header_arr[80];
2157 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
2158 unsigned char (*header_ref)[80] = &header_arr;
2159 return BlockNotifier_block_disconnected(this_arg_conv, header_ref, disconnected_height);
2162 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainWatchInterfaceUtil_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2163 LDKChainWatchInterfaceUtil this_ptr_conv = *(LDKChainWatchInterfaceUtil*)this_ptr;
2164 FREE((void*)this_ptr);
2165 this_ptr_conv._underlying_ref = false;
2166 return ChainWatchInterfaceUtil_free(this_ptr_conv);
2169 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainWatchInterfaceUtil_1as_1ChainWatchInterface(JNIEnv * _env, jclass _b, jlong this_arg) {
2170 LDKChainWatchInterfaceUtil* this_arg_conv = (LDKChainWatchInterfaceUtil*)this_arg;
2171 LDKChainWatchInterface* ret = MALLOC(sizeof(LDKChainWatchInterface), "LDKChainWatchInterface");
2172 *ret = ChainWatchInterfaceUtil_as_ChainWatchInterface(this_arg_conv);
2176 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainWatchInterfaceUtil_1new(JNIEnv * _env, jclass _b, jlong network) {
2177 LDKNetwork network_conv = *(LDKNetwork*)network;
2178 FREE((void*)network);
2179 LDKChainWatchInterfaceUtil* ret = MALLOC(sizeof(LDKChainWatchInterfaceUtil), "LDKChainWatchInterfaceUtil");
2180 *ret = ChainWatchInterfaceUtil_new(network_conv);
2181 assert(!ret->_underlying_ref);
2182 ret->_underlying_ref = true;
2186 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChainWatchInterfaceUtil_1does_1match_1tx(JNIEnv * _env, jclass _b, jlong this_arg, jlong tx) {
2187 LDKChainWatchInterfaceUtil* this_arg_conv = (LDKChainWatchInterfaceUtil*)this_arg;
2188 LDKTransaction tx_conv = *(LDKTransaction*)tx;
2190 return ChainWatchInterfaceUtil_does_match_tx(this_arg_conv, tx_conv);
2193 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2194 LDKOutPoint this_ptr_conv = *(LDKOutPoint*)this_ptr;
2195 FREE((void*)this_ptr);
2196 this_ptr_conv._underlying_ref = false;
2197 return OutPoint_free(this_ptr_conv);
2200 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1txid(JNIEnv * _env, jclass _b, jlong this_ptr) {
2201 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
2202 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2203 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OutPoint_get_txid(this_ptr_conv));
2207 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1txid(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2208 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
2209 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
2211 return OutPoint_set_txid(this_ptr_conv, val_conv);
2214 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1index(JNIEnv * _env, jclass _b, jlong this_ptr) {
2215 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
2216 return OutPoint_get_index(this_ptr_conv);
2219 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1index(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
2220 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
2221 return OutPoint_set_index(this_ptr_conv, val);
2224 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1new(JNIEnv * _env, jclass _b, jlong txid_arg, jshort index_arg) {
2225 LDKThirtyTwoBytes txid_arg_conv = *(LDKThirtyTwoBytes*)txid_arg;
2226 FREE((void*)txid_arg);
2227 LDKOutPoint* ret = MALLOC(sizeof(LDKOutPoint), "LDKOutPoint");
2228 *ret = OutPoint_new(txid_arg_conv, index_arg);
2229 assert(!ret->_underlying_ref);
2230 ret->_underlying_ref = true;
2234 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1to_1channel_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
2235 LDKOutPoint* this_arg_conv = (LDKOutPoint*)this_arg;
2236 LDKThirtyTwoBytes* ret = MALLOC(sizeof(LDKThirtyTwoBytes), "LDKThirtyTwoBytes");
2237 *ret = OutPoint_to_channel_id(this_arg_conv);
2241 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1write(JNIEnv * _env, jclass _b, jlong obj) {
2242 LDKOutPoint* obj_conv = (LDKOutPoint*)obj;
2243 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
2244 *ret = OutPoint_write(obj_conv);
2248 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1read(JNIEnv * _env, jclass _b, jlong ser) {
2249 LDKu8slice ser_conv = *(LDKu8slice*)ser;
2251 LDKOutPoint* ret = MALLOC(sizeof(LDKOutPoint), "LDKOutPoint");
2252 *ret = OutPoint_read(ser_conv);
2253 assert(!ret->_underlying_ref);
2254 ret->_underlying_ref = true;
2258 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2259 LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)this_ptr;
2260 FREE((void*)this_ptr);
2261 return SpendableOutputDescriptor_free(this_ptr_conv);
2264 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2265 LDKChannelKeys this_ptr_conv = *(LDKChannelKeys*)this_ptr;
2266 FREE((void*)this_ptr);
2267 return ChannelKeys_free(this_ptr_conv);
2270 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysInterface_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2271 LDKKeysInterface this_ptr_conv = *(LDKKeysInterface*)this_ptr;
2272 FREE((void*)this_ptr);
2273 return KeysInterface_free(this_ptr_conv);
2276 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2277 LDKInMemoryChannelKeys this_ptr_conv = *(LDKInMemoryChannelKeys*)this_ptr;
2278 FREE((void*)this_ptr);
2279 this_ptr_conv._underlying_ref = false;
2280 return InMemoryChannelKeys_free(this_ptr_conv);
2283 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1funding_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
2284 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2285 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2286 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_funding_key(this_ptr_conv));
2290 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1funding_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2291 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2292 LDKSecretKey val_conv = *(LDKSecretKey*)val;
2294 return InMemoryChannelKeys_set_funding_key(this_ptr_conv, val_conv);
2297 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1revocation_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
2298 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2299 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2300 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_revocation_base_key(this_ptr_conv));
2304 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1revocation_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2305 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2306 LDKSecretKey val_conv = *(LDKSecretKey*)val;
2308 return InMemoryChannelKeys_set_revocation_base_key(this_ptr_conv, val_conv);
2311 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
2312 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2313 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2314 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_payment_key(this_ptr_conv));
2318 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2319 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2320 LDKSecretKey val_conv = *(LDKSecretKey*)val;
2322 return InMemoryChannelKeys_set_payment_key(this_ptr_conv, val_conv);
2325 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1delayed_1payment_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
2326 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2327 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2328 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_delayed_payment_base_key(this_ptr_conv));
2332 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1delayed_1payment_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2333 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2334 LDKSecretKey val_conv = *(LDKSecretKey*)val;
2336 return InMemoryChannelKeys_set_delayed_payment_base_key(this_ptr_conv, val_conv);
2339 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1htlc_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
2340 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2341 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2342 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_htlc_base_key(this_ptr_conv));
2346 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1htlc_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2347 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2348 LDKSecretKey val_conv = *(LDKSecretKey*)val;
2350 return InMemoryChannelKeys_set_htlc_base_key(this_ptr_conv, val_conv);
2353 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1commitment_1seed(JNIEnv * _env, jclass _b, jlong this_ptr) {
2354 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2355 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2356 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_commitment_seed(this_ptr_conv));
2360 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1commitment_1seed(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2361 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2362 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
2364 return InMemoryChannelKeys_set_commitment_seed(this_ptr_conv, val_conv);
2367 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1new(JNIEnv * _env, jclass _b, jlong funding_key, jlong revocation_base_key, jlong payment_key, jlong delayed_payment_base_key, jlong htlc_base_key, jlong commitment_seed, jlong channel_value_satoshis, jlong key_derivation_params) {
2368 LDKSecretKey funding_key_conv = *(LDKSecretKey*)funding_key;
2369 FREE((void*)funding_key);
2370 LDKSecretKey revocation_base_key_conv = *(LDKSecretKey*)revocation_base_key;
2371 FREE((void*)revocation_base_key);
2372 LDKSecretKey payment_key_conv = *(LDKSecretKey*)payment_key;
2373 FREE((void*)payment_key);
2374 LDKSecretKey delayed_payment_base_key_conv = *(LDKSecretKey*)delayed_payment_base_key;
2375 FREE((void*)delayed_payment_base_key);
2376 LDKSecretKey htlc_base_key_conv = *(LDKSecretKey*)htlc_base_key;
2377 FREE((void*)htlc_base_key);
2378 LDKThirtyTwoBytes commitment_seed_conv = *(LDKThirtyTwoBytes*)commitment_seed;
2379 FREE((void*)commitment_seed);
2380 LDKC2Tuple_u64u64Z key_derivation_params_conv = *(LDKC2Tuple_u64u64Z*)key_derivation_params;
2381 FREE((void*)key_derivation_params);
2382 LDKInMemoryChannelKeys* ret = MALLOC(sizeof(LDKInMemoryChannelKeys), "LDKInMemoryChannelKeys");
2383 *ret = InMemoryChannelKeys_new(funding_key_conv, revocation_base_key_conv, payment_key_conv, delayed_payment_base_key_conv, htlc_base_key_conv, commitment_seed_conv, channel_value_satoshis, key_derivation_params_conv);
2384 assert(!ret->_underlying_ref);
2385 ret->_underlying_ref = true;
2389 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1remote_1pubkeys(JNIEnv * _env, jclass _b, jlong this_arg) {
2390 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
2391 LDKChannelPublicKeys* ret = MALLOC(sizeof(LDKChannelPublicKeys), "LDKChannelPublicKeys");
2392 *ret = InMemoryChannelKeys_remote_pubkeys(this_arg_conv);
2393 assert(!ret->_underlying_ref);
2394 ret->_underlying_ref = true;
2398 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1remote_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_arg) {
2399 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
2400 return InMemoryChannelKeys_remote_to_self_delay(this_arg_conv);
2403 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1local_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_arg) {
2404 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
2405 return InMemoryChannelKeys_local_to_self_delay(this_arg_conv);
2408 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1as_1ChannelKeys(JNIEnv * _env, jclass _b, jlong this_arg) {
2409 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
2410 LDKChannelKeys* ret = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys");
2411 *ret = InMemoryChannelKeys_as_ChannelKeys(this_arg_conv);
2415 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1write(JNIEnv * _env, jclass _b, jlong obj) {
2416 LDKInMemoryChannelKeys* obj_conv = (LDKInMemoryChannelKeys*)obj;
2417 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
2418 *ret = InMemoryChannelKeys_write(obj_conv);
2422 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1read(JNIEnv * _env, jclass _b, jlong ser) {
2423 LDKu8slice ser_conv = *(LDKu8slice*)ser;
2425 LDKInMemoryChannelKeys* ret = MALLOC(sizeof(LDKInMemoryChannelKeys), "LDKInMemoryChannelKeys");
2426 *ret = InMemoryChannelKeys_read(ser_conv);
2427 assert(!ret->_underlying_ref);
2428 ret->_underlying_ref = true;
2432 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysManager_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2433 LDKKeysManager this_ptr_conv = *(LDKKeysManager*)this_ptr;
2434 FREE((void*)this_ptr);
2435 this_ptr_conv._underlying_ref = false;
2436 return KeysManager_free(this_ptr_conv);
2439 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1new(JNIEnv * _env, jclass _b, jbyteArray seed, jlong network, jlong starting_time_secs, jint starting_time_nanos) {
2440 unsigned char seed_arr[32];
2441 (*_env)->GetByteArrayRegion (_env, seed, 0, 32, seed_arr);
2442 unsigned char (*seed_ref)[32] = &seed_arr;
2443 LDKNetwork network_conv = *(LDKNetwork*)network;
2444 FREE((void*)network);
2445 LDKKeysManager* ret = MALLOC(sizeof(LDKKeysManager), "LDKKeysManager");
2446 *ret = KeysManager_new(seed_ref, network_conv, starting_time_secs, starting_time_nanos);
2447 assert(!ret->_underlying_ref);
2448 ret->_underlying_ref = true;
2452 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) {
2453 LDKKeysManager* this_arg_conv = (LDKKeysManager*)this_arg;
2454 LDKInMemoryChannelKeys* ret = MALLOC(sizeof(LDKInMemoryChannelKeys), "LDKInMemoryChannelKeys");
2455 *ret = KeysManager_derive_channel_keys(this_arg_conv, channel_value_satoshis, params_1, params_2);
2456 assert(!ret->_underlying_ref);
2457 ret->_underlying_ref = true;
2461 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1KeysInterface(JNIEnv * _env, jclass _b, jlong this_arg) {
2462 LDKKeysManager* this_arg_conv = (LDKKeysManager*)this_arg;
2463 LDKKeysInterface* ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
2464 *ret = KeysManager_as_KeysInterface(this_arg_conv);
2468 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2469 LDKChannelManager this_ptr_conv = *(LDKChannelManager*)this_ptr;
2470 FREE((void*)this_ptr);
2471 this_ptr_conv._underlying_ref = false;
2472 return ChannelManager_free(this_ptr_conv);
2475 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2476 LDKChannelDetails this_ptr_conv = *(LDKChannelDetails*)this_ptr;
2477 FREE((void*)this_ptr);
2478 this_ptr_conv._underlying_ref = false;
2479 return ChannelDetails_free(this_ptr_conv);
2482 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
2483 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2484 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2485 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ChannelDetails_get_channel_id(this_ptr_conv));
2489 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2490 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2491 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
2493 return ChannelDetails_set_channel_id(this_ptr_conv, val_conv);
2496 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1remote_1network_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
2497 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2498 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
2499 *ret = ChannelDetails_get_remote_network_id(this_ptr_conv);
2503 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1remote_1network_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2504 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2505 LDKPublicKey val_conv = *(LDKPublicKey*)val;
2507 return ChannelDetails_set_remote_network_id(this_ptr_conv, val_conv);
2510 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1counterparty_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
2511 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2512 LDKInitFeatures* ret = MALLOC(sizeof(LDKInitFeatures), "LDKInitFeatures");
2513 *ret = ChannelDetails_get_counterparty_features(this_ptr_conv);
2514 assert(!ret->_underlying_ref);
2515 ret->_underlying_ref = true;
2519 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1counterparty_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2520 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2521 LDKInitFeatures val_conv = *(LDKInitFeatures*)val;
2523 val_conv._underlying_ref = false;
2524 return ChannelDetails_set_counterparty_features(this_ptr_conv, val_conv);
2527 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1value_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
2528 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2529 return ChannelDetails_get_channel_value_satoshis(this_ptr_conv);
2532 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1value_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2533 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2534 return ChannelDetails_set_channel_value_satoshis(this_ptr_conv, val);
2537 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1user_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
2538 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2539 return ChannelDetails_get_user_id(this_ptr_conv);
2542 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1user_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2543 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2544 return ChannelDetails_set_user_id(this_ptr_conv, val);
2547 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
2548 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2549 return ChannelDetails_get_outbound_capacity_msat(this_ptr_conv);
2552 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1outbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2553 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2554 return ChannelDetails_set_outbound_capacity_msat(this_ptr_conv, val);
2557 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
2558 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2559 return ChannelDetails_get_inbound_capacity_msat(this_ptr_conv);
2562 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2563 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2564 return ChannelDetails_set_inbound_capacity_msat(this_ptr_conv, val);
2567 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1live(JNIEnv * _env, jclass _b, jlong this_ptr) {
2568 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2569 return ChannelDetails_get_is_live(this_ptr_conv);
2572 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1live(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
2573 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2574 return ChannelDetails_set_is_live(this_ptr_conv, val);
2577 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2578 LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)this_ptr;
2579 FREE((void*)this_ptr);
2580 this_ptr_conv._underlying_ref = false;
2581 return PaymentSendFailure_free(this_ptr_conv);
2584 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1new(JNIEnv * _env, jclass _b, jlong network, jlong fee_est, jlong monitor, jlong tx_broadcaster, jlong logger, jlong keys_manager, jlong config, jlong current_blockchain_height) {
2585 LDKNetwork network_conv = *(LDKNetwork*)network;
2586 FREE((void*)network);
2587 LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)fee_est;
2588 LDKFeeEstimator_JCalls_clone(fee_est_conv.this_arg);
2589 LDKManyChannelMonitor monitor_conv = *(LDKManyChannelMonitor*)monitor;
2590 LDKManyChannelMonitor_JCalls_clone(monitor_conv.this_arg);
2591 LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)tx_broadcaster;
2592 LDKBroadcasterInterface_JCalls_clone(tx_broadcaster_conv.this_arg);
2593 LDKLogger logger_conv = *(LDKLogger*)logger;
2594 LDKLogger_JCalls_clone(logger_conv.this_arg);
2595 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)keys_manager;
2596 LDKKeysInterface_JCalls_clone(keys_manager_conv.this_arg);
2597 LDKUserConfig config_conv = *(LDKUserConfig*)config;
2598 FREE((void*)config);
2599 config_conv._underlying_ref = false;
2600 uintptr_t current_blockchain_height_conv = *(uintptr_t*)current_blockchain_height;
2601 FREE((void*)current_blockchain_height);
2602 LDKChannelManager* ret = MALLOC(sizeof(LDKChannelManager), "LDKChannelManager");
2603 *ret = ChannelManager_new(network_conv, fee_est_conv, monitor_conv, tx_broadcaster_conv, logger_conv, keys_manager_conv, config_conv, current_blockchain_height_conv);
2604 assert(!ret->_underlying_ref);
2605 ret->_underlying_ref = true;
2609 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) {
2610 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2611 LDKPublicKey their_network_key_conv = *(LDKPublicKey*)their_network_key;
2612 FREE((void*)their_network_key);
2613 LDKUserConfig override_config_conv = *(LDKUserConfig*)override_config;
2614 FREE((void*)override_config);
2615 override_config_conv._underlying_ref = false;
2616 LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
2617 *ret = ChannelManager_create_channel(this_arg_conv, their_network_key_conv, channel_value_satoshis, push_msat, user_id, override_config_conv);
2621 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
2622 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2623 LDKCVec_ChannelDetailsZ* ret = MALLOC(sizeof(LDKCVec_ChannelDetailsZ), "LDKCVec_ChannelDetailsZ");
2624 *ret = ChannelManager_list_channels(this_arg_conv);
2628 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1usable_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
2629 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2630 LDKCVec_ChannelDetailsZ* ret = MALLOC(sizeof(LDKCVec_ChannelDetailsZ), "LDKCVec_ChannelDetailsZ");
2631 *ret = ChannelManager_list_usable_channels(this_arg_conv);
2635 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray channel_id) {
2636 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2637 unsigned char channel_id_arr[32];
2638 (*_env)->GetByteArrayRegion (_env, channel_id, 0, 32, channel_id_arr);
2639 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
2640 LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
2641 *ret = ChannelManager_close_channel(this_arg_conv, channel_id_ref);
2645 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray channel_id) {
2646 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2647 unsigned char channel_id_arr[32];
2648 (*_env)->GetByteArrayRegion (_env, channel_id, 0, 32, channel_id_arr);
2649 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
2650 return ChannelManager_force_close_channel(this_arg_conv, channel_id_ref);
2653 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1all_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
2654 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2655 return ChannelManager_force_close_all_channels(this_arg_conv);
2658 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1send_1payment(JNIEnv * _env, jclass _b, jlong this_arg, jlong route, jlong payment_hash, jlong payment_secret) {
2659 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2660 LDKRoute* route_conv = (LDKRoute*)route;
2661 LDKThirtyTwoBytes payment_hash_conv = *(LDKThirtyTwoBytes*)payment_hash;
2662 FREE((void*)payment_hash);
2663 LDKThirtyTwoBytes payment_secret_conv = *(LDKThirtyTwoBytes*)payment_secret;
2664 FREE((void*)payment_secret);
2665 LDKCResult_NonePaymentSendFailureZ* ret = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
2666 *ret = ChannelManager_send_payment(this_arg_conv, route_conv, payment_hash_conv, payment_secret_conv);
2670 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) {
2671 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2672 unsigned char temporary_channel_id_arr[32];
2673 (*_env)->GetByteArrayRegion (_env, temporary_channel_id, 0, 32, temporary_channel_id_arr);
2674 unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
2675 LDKOutPoint funding_txo_conv = *(LDKOutPoint*)funding_txo;
2676 FREE((void*)funding_txo);
2677 funding_txo_conv._underlying_ref = false;
2678 return ChannelManager_funding_transaction_generated(this_arg_conv, temporary_channel_id_ref, funding_txo_conv);
2681 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1broadcast_1node_1announcement(JNIEnv * _env, jclass _b, jlong this_arg, jlong rgb, jlong alias, jlong addresses) {
2682 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2683 LDKThreeBytes rgb_conv = *(LDKThreeBytes*)rgb;
2685 LDKThirtyTwoBytes alias_conv = *(LDKThirtyTwoBytes*)alias;
2687 LDKCVec_NetAddressZ addresses_conv = *(LDKCVec_NetAddressZ*)addresses;
2688 FREE((void*)addresses);
2689 return ChannelManager_broadcast_node_announcement(this_arg_conv, rgb_conv, alias_conv, addresses_conv);
2692 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1process_1pending_1htlc_1forwards(JNIEnv * _env, jclass _b, jlong this_arg) {
2693 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2694 return ChannelManager_process_pending_htlc_forwards(this_arg_conv);
2697 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1timer_1chan_1freshness_1every_1min(JNIEnv * _env, jclass _b, jlong this_arg) {
2698 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2699 return ChannelManager_timer_chan_freshness_every_min(this_arg_conv);
2702 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1fail_1htlc_1backwards(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray payment_hash, jlong payment_secret) {
2703 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2704 unsigned char payment_hash_arr[32];
2705 (*_env)->GetByteArrayRegion (_env, payment_hash, 0, 32, payment_hash_arr);
2706 unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
2707 LDKThirtyTwoBytes payment_secret_conv = *(LDKThirtyTwoBytes*)payment_secret;
2708 FREE((void*)payment_secret);
2709 return ChannelManager_fail_htlc_backwards(this_arg_conv, payment_hash_ref, payment_secret_conv);
2712 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelManager_1claim_1funds(JNIEnv * _env, jclass _b, jlong this_arg, jlong payment_preimage, jlong payment_secret, jlong expected_amount) {
2713 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2714 LDKThirtyTwoBytes payment_preimage_conv = *(LDKThirtyTwoBytes*)payment_preimage;
2715 FREE((void*)payment_preimage);
2716 LDKThirtyTwoBytes payment_secret_conv = *(LDKThirtyTwoBytes*)payment_secret;
2717 FREE((void*)payment_secret);
2718 return ChannelManager_claim_funds(this_arg_conv, payment_preimage_conv, payment_secret_conv, expected_amount);
2721 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1our_1node_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
2722 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2723 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
2724 *ret = ChannelManager_get_our_node_id(this_arg_conv);
2728 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) {
2729 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2730 LDKOutPoint* funding_txo_conv = (LDKOutPoint*)funding_txo;
2731 return ChannelManager_channel_monitor_updated(this_arg_conv, funding_txo_conv, highest_applied_update_id);
2734 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1MessageSendEventsProvider(JNIEnv * _env, jclass _b, jlong this_arg) {
2735 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2736 LDKMessageSendEventsProvider* ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
2737 *ret = ChannelManager_as_MessageSendEventsProvider(this_arg_conv);
2741 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1EventsProvider(JNIEnv * _env, jclass _b, jlong this_arg) {
2742 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2743 LDKEventsProvider* ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
2744 *ret = ChannelManager_as_EventsProvider(this_arg_conv);
2748 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1ChainListener(JNIEnv * _env, jclass _b, jlong this_arg) {
2749 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2750 LDKChainListener* ret = MALLOC(sizeof(LDKChainListener), "LDKChainListener");
2751 *ret = ChannelManager_as_ChainListener(this_arg_conv);
2755 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1ChannelMessageHandler(JNIEnv * _env, jclass _b, jlong this_arg) {
2756 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2757 LDKChannelMessageHandler* ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
2758 *ret = ChannelManager_as_ChannelMessageHandler(this_arg_conv);
2762 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2763 LDKChannelManagerReadArgs this_ptr_conv = *(LDKChannelManagerReadArgs*)this_ptr;
2764 FREE((void*)this_ptr);
2765 this_ptr_conv._underlying_ref = false;
2766 return ChannelManagerReadArgs_free(this_ptr_conv);
2769 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1keys_1manager(JNIEnv * _env, jclass _b, jlong this_ptr) {
2770 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2771 long ret = (long)ChannelManagerReadArgs_get_keys_manager(this_ptr_conv);
2775 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1keys_1manager(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2776 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2777 LDKKeysInterface val_conv = *(LDKKeysInterface*)val;
2778 LDKKeysInterface_JCalls_clone(val_conv.this_arg);
2779 return ChannelManagerReadArgs_set_keys_manager(this_ptr_conv, val_conv);
2782 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1fee_1estimator(JNIEnv * _env, jclass _b, jlong this_ptr) {
2783 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2784 long ret = (long)ChannelManagerReadArgs_get_fee_estimator(this_ptr_conv);
2788 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1fee_1estimator(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2789 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2790 LDKFeeEstimator val_conv = *(LDKFeeEstimator*)val;
2791 LDKFeeEstimator_JCalls_clone(val_conv.this_arg);
2792 return ChannelManagerReadArgs_set_fee_estimator(this_ptr_conv, val_conv);
2795 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1monitor(JNIEnv * _env, jclass _b, jlong this_ptr) {
2796 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2797 long ret = (long)ChannelManagerReadArgs_get_monitor(this_ptr_conv);
2801 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1monitor(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2802 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2803 LDKManyChannelMonitor val_conv = *(LDKManyChannelMonitor*)val;
2804 LDKManyChannelMonitor_JCalls_clone(val_conv.this_arg);
2805 return ChannelManagerReadArgs_set_monitor(this_ptr_conv, val_conv);
2808 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1tx_1broadcaster(JNIEnv * _env, jclass _b, jlong this_ptr) {
2809 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2810 long ret = (long)ChannelManagerReadArgs_get_tx_broadcaster(this_ptr_conv);
2814 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1tx_1broadcaster(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2815 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2816 LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)val;
2817 LDKBroadcasterInterface_JCalls_clone(val_conv.this_arg);
2818 return ChannelManagerReadArgs_set_tx_broadcaster(this_ptr_conv, val_conv);
2821 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1logger(JNIEnv * _env, jclass _b, jlong this_ptr) {
2822 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2823 long ret = (long)ChannelManagerReadArgs_get_logger(this_ptr_conv);
2827 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1logger(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2828 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2829 LDKLogger val_conv = *(LDKLogger*)val;
2830 LDKLogger_JCalls_clone(val_conv.this_arg);
2831 return ChannelManagerReadArgs_set_logger(this_ptr_conv, val_conv);
2834 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1default_1config(JNIEnv * _env, jclass _b, jlong this_ptr) {
2835 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2836 LDKUserConfig* ret = MALLOC(sizeof(LDKUserConfig), "LDKUserConfig");
2837 *ret = ChannelManagerReadArgs_get_default_config(this_ptr_conv);
2838 assert(!ret->_underlying_ref);
2839 ret->_underlying_ref = true;
2843 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1default_1config(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2844 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2845 LDKUserConfig val_conv = *(LDKUserConfig*)val;
2847 val_conv._underlying_ref = false;
2848 return ChannelManagerReadArgs_set_default_config(this_ptr_conv, val_conv);
2851 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new(JNIEnv * _env, jclass _b, jlong keys_manager, jlong fee_estimator, jlong monitor, jlong tx_broadcaster, jlong logger, jlong default_config, jlong channel_monitors) {
2852 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)keys_manager;
2853 LDKKeysInterface_JCalls_clone(keys_manager_conv.this_arg);
2854 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)fee_estimator;
2855 LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
2856 LDKManyChannelMonitor monitor_conv = *(LDKManyChannelMonitor*)monitor;
2857 LDKManyChannelMonitor_JCalls_clone(monitor_conv.this_arg);
2858 LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)tx_broadcaster;
2859 LDKBroadcasterInterface_JCalls_clone(tx_broadcaster_conv.this_arg);
2860 LDKLogger logger_conv = *(LDKLogger*)logger;
2861 LDKLogger_JCalls_clone(logger_conv.this_arg);
2862 LDKUserConfig default_config_conv = *(LDKUserConfig*)default_config;
2863 FREE((void*)default_config);
2864 default_config_conv._underlying_ref = false;
2865 LDKCVec_ChannelMonitorZ channel_monitors_conv = *(LDKCVec_ChannelMonitorZ*)channel_monitors;
2866 FREE((void*)channel_monitors);
2867 LDKChannelManagerReadArgs* ret = MALLOC(sizeof(LDKChannelManagerReadArgs), "LDKChannelManagerReadArgs");
2868 *ret = ChannelManagerReadArgs_new(keys_manager_conv, fee_estimator_conv, monitor_conv, tx_broadcaster_conv, logger_conv, default_config_conv, channel_monitors_conv);
2869 assert(!ret->_underlying_ref);
2870 ret->_underlying_ref = true;
2874 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2875 LDKChannelMonitorUpdate this_ptr_conv = *(LDKChannelMonitorUpdate*)this_ptr;
2876 FREE((void*)this_ptr);
2877 this_ptr_conv._underlying_ref = false;
2878 return ChannelMonitorUpdate_free(this_ptr_conv);
2881 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1get_1update_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
2882 LDKChannelMonitorUpdate* this_ptr_conv = (LDKChannelMonitorUpdate*)this_ptr;
2883 return ChannelMonitorUpdate_get_update_id(this_ptr_conv);
2886 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1set_1update_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2887 LDKChannelMonitorUpdate* this_ptr_conv = (LDKChannelMonitorUpdate*)this_ptr;
2888 return ChannelMonitorUpdate_set_update_id(this_ptr_conv, val);
2891 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
2892 LDKChannelMonitorUpdate* obj_conv = (LDKChannelMonitorUpdate*)obj;
2893 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
2894 *ret = ChannelMonitorUpdate_write(obj_conv);
2898 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
2899 LDKu8slice ser_conv = *(LDKu8slice*)ser;
2901 LDKChannelMonitorUpdate* ret = MALLOC(sizeof(LDKChannelMonitorUpdate), "LDKChannelMonitorUpdate");
2902 *ret = ChannelMonitorUpdate_read(ser_conv);
2903 assert(!ret->_underlying_ref);
2904 ret->_underlying_ref = true;
2908 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2909 LDKMonitorUpdateError this_ptr_conv = *(LDKMonitorUpdateError*)this_ptr;
2910 FREE((void*)this_ptr);
2911 this_ptr_conv._underlying_ref = false;
2912 return MonitorUpdateError_free(this_ptr_conv);
2915 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2916 LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)this_ptr;
2917 FREE((void*)this_ptr);
2918 this_ptr_conv._underlying_ref = false;
2919 return MonitorEvent_free(this_ptr_conv);
2922 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2923 LDKHTLCUpdate this_ptr_conv = *(LDKHTLCUpdate*)this_ptr;
2924 FREE((void*)this_ptr);
2925 this_ptr_conv._underlying_ref = false;
2926 return HTLCUpdate_free(this_ptr_conv);
2929 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
2930 LDKHTLCUpdate* obj_conv = (LDKHTLCUpdate*)obj;
2931 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
2932 *ret = HTLCUpdate_write(obj_conv);
2936 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
2937 LDKu8slice ser_conv = *(LDKu8slice*)ser;
2939 LDKHTLCUpdate* ret = MALLOC(sizeof(LDKHTLCUpdate), "LDKHTLCUpdate");
2940 *ret = HTLCUpdate_read(ser_conv);
2941 assert(!ret->_underlying_ref);
2942 ret->_underlying_ref = true;
2946 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2947 LDKChannelMonitor this_ptr_conv = *(LDKChannelMonitor*)this_ptr;
2948 FREE((void*)this_ptr);
2949 this_ptr_conv._underlying_ref = false;
2950 return ChannelMonitor_free(this_ptr_conv);
2953 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ManyChannelMonitor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2954 LDKManyChannelMonitor this_ptr_conv = *(LDKManyChannelMonitor*)this_ptr;
2955 FREE((void*)this_ptr);
2956 return ManyChannelMonitor_free(this_ptr_conv);
2959 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1update_1monitor(JNIEnv * _env, jclass _b, jlong this_arg, jlong updates, jlong broadcaster, jlong logger) {
2960 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2961 LDKChannelMonitorUpdate updates_conv = *(LDKChannelMonitorUpdate*)updates;
2962 FREE((void*)updates);
2963 updates_conv._underlying_ref = false;
2964 LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster;
2965 LDKLogger* logger_conv = (LDKLogger*)logger;
2966 LDKCResult_NoneMonitorUpdateErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
2967 *ret = ChannelMonitor_update_monitor(this_arg_conv, updates_conv, broadcaster_conv, logger_conv);
2971 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1update_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
2972 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2973 return ChannelMonitor_get_latest_update_id(this_arg_conv);
2976 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1funding_1txo(JNIEnv * _env, jclass _b, jlong this_arg) {
2977 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2978 LDKC2Tuple_OutPointScriptZ* ret = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
2979 *ret = ChannelMonitor_get_funding_txo(this_arg_conv);
2983 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1monitor_1events(JNIEnv * _env, jclass _b, jlong this_arg) {
2984 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2985 LDKCVec_MonitorEventZ* ret = MALLOC(sizeof(LDKCVec_MonitorEventZ), "LDKCVec_MonitorEventZ");
2986 *ret = ChannelMonitor_get_and_clear_pending_monitor_events(this_arg_conv);
2990 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1events(JNIEnv * _env, jclass _b, jlong this_arg) {
2991 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2992 LDKCVec_EventZ* ret = MALLOC(sizeof(LDKCVec_EventZ), "LDKCVec_EventZ");
2993 *ret = ChannelMonitor_get_and_clear_pending_events(this_arg_conv);
2997 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1local_1commitment_1txn(JNIEnv * _env, jclass _b, jlong this_arg, jlong logger) {
2998 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2999 LDKLogger* logger_conv = (LDKLogger*)logger;
3000 LDKCVec_TransactionZ* ret = MALLOC(sizeof(LDKCVec_TransactionZ), "LDKCVec_TransactionZ");
3001 *ret = ChannelMonitor_get_latest_local_commitment_txn(this_arg_conv, logger_conv);
3005 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DecodeError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3006 LDKDecodeError this_ptr_conv = *(LDKDecodeError*)this_ptr;
3007 FREE((void*)this_ptr);
3008 this_ptr_conv._underlying_ref = false;
3009 return DecodeError_free(this_ptr_conv);
3012 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3013 LDKInit this_ptr_conv = *(LDKInit*)this_ptr;
3014 FREE((void*)this_ptr);
3015 this_ptr_conv._underlying_ref = false;
3016 return Init_free(this_ptr_conv);
3019 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3020 LDKErrorMessage this_ptr_conv = *(LDKErrorMessage*)this_ptr;
3021 FREE((void*)this_ptr);
3022 this_ptr_conv._underlying_ref = false;
3023 return ErrorMessage_free(this_ptr_conv);
3026 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3027 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
3028 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3029 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ErrorMessage_get_channel_id(this_ptr_conv));
3033 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3034 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
3035 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3037 return ErrorMessage_set_channel_id(this_ptr_conv, val_conv);
3040 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1data(JNIEnv * _env, jclass _b, jlong this_ptr) {
3041 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
3042 LDKStr* ret = MALLOC(sizeof(LDKStr), "LDKStr");
3043 *ret = ErrorMessage_get_data(this_ptr_conv);
3047 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1data(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3048 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
3049 LDKCVec_u8Z val_conv = *(LDKCVec_u8Z*)val;
3051 return ErrorMessage_set_data(this_ptr_conv, val_conv);
3054 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong data_arg) {
3055 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
3056 FREE((void*)channel_id_arg);
3057 LDKCVec_u8Z data_arg_conv = *(LDKCVec_u8Z*)data_arg;
3058 FREE((void*)data_arg);
3059 LDKErrorMessage* ret = MALLOC(sizeof(LDKErrorMessage), "LDKErrorMessage");
3060 *ret = ErrorMessage_new(channel_id_arg_conv, data_arg_conv);
3061 assert(!ret->_underlying_ref);
3062 ret->_underlying_ref = true;
3066 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3067 LDKPing this_ptr_conv = *(LDKPing*)this_ptr;
3068 FREE((void*)this_ptr);
3069 this_ptr_conv._underlying_ref = false;
3070 return Ping_free(this_ptr_conv);
3073 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Ping_1get_1ponglen(JNIEnv * _env, jclass _b, jlong this_ptr) {
3074 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
3075 return Ping_get_ponglen(this_ptr_conv);
3078 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1ponglen(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3079 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
3080 return Ping_set_ponglen(this_ptr_conv, val);
3083 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Ping_1get_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr) {
3084 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
3085 return Ping_get_byteslen(this_ptr_conv);
3088 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3089 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
3090 return Ping_set_byteslen(this_ptr_conv, val);
3093 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1new(JNIEnv * _env, jclass _b, jshort ponglen_arg, jshort byteslen_arg) {
3094 LDKPing* ret = MALLOC(sizeof(LDKPing), "LDKPing");
3095 *ret = Ping_new(ponglen_arg, byteslen_arg);
3096 assert(!ret->_underlying_ref);
3097 ret->_underlying_ref = true;
3101 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3102 LDKPong this_ptr_conv = *(LDKPong*)this_ptr;
3103 FREE((void*)this_ptr);
3104 this_ptr_conv._underlying_ref = false;
3105 return Pong_free(this_ptr_conv);
3108 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Pong_1get_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr) {
3109 LDKPong* this_ptr_conv = (LDKPong*)this_ptr;
3110 return Pong_get_byteslen(this_ptr_conv);
3113 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1set_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3114 LDKPong* this_ptr_conv = (LDKPong*)this_ptr;
3115 return Pong_set_byteslen(this_ptr_conv, val);
3118 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1new(JNIEnv * _env, jclass _b, jshort byteslen_arg) {
3119 LDKPong* ret = MALLOC(sizeof(LDKPong), "LDKPong");
3120 *ret = Pong_new(byteslen_arg);
3121 assert(!ret->_underlying_ref);
3122 ret->_underlying_ref = true;
3126 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3127 LDKOpenChannel this_ptr_conv = *(LDKOpenChannel*)this_ptr;
3128 FREE((void*)this_ptr);
3129 this_ptr_conv._underlying_ref = false;
3130 return OpenChannel_free(this_ptr_conv);
3133 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
3134 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3135 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3136 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OpenChannel_get_chain_hash(this_ptr_conv));
3140 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3141 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3142 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3144 return OpenChannel_set_chain_hash(this_ptr_conv, val_conv);
3147 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3148 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3149 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3150 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OpenChannel_get_temporary_channel_id(this_ptr_conv));
3154 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3155 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3156 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3158 return OpenChannel_set_temporary_channel_id(this_ptr_conv, val_conv);
3161 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3162 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3163 return OpenChannel_get_funding_satoshis(this_ptr_conv);
3166 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3167 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3168 return OpenChannel_set_funding_satoshis(this_ptr_conv, val);
3171 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1push_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3172 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3173 return OpenChannel_get_push_msat(this_ptr_conv);
3176 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1push_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3177 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3178 return OpenChannel_set_push_msat(this_ptr_conv, val);
3181 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3182 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3183 return OpenChannel_get_dust_limit_satoshis(this_ptr_conv);
3186 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3187 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3188 return OpenChannel_set_dust_limit_satoshis(this_ptr_conv, val);
3191 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3192 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3193 return OpenChannel_get_max_htlc_value_in_flight_msat(this_ptr_conv);
3196 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) {
3197 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3198 return OpenChannel_set_max_htlc_value_in_flight_msat(this_ptr_conv, val);
3201 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3202 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3203 return OpenChannel_get_channel_reserve_satoshis(this_ptr_conv);
3206 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3207 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3208 return OpenChannel_set_channel_reserve_satoshis(this_ptr_conv, val);
3211 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3212 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3213 return OpenChannel_get_htlc_minimum_msat(this_ptr_conv);
3216 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3217 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3218 return OpenChannel_set_htlc_minimum_msat(this_ptr_conv, val);
3221 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr) {
3222 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3223 return OpenChannel_get_feerate_per_kw(this_ptr_conv);
3226 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
3227 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3228 return OpenChannel_set_feerate_per_kw(this_ptr_conv, val);
3231 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
3232 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3233 return OpenChannel_get_to_self_delay(this_ptr_conv);
3236 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3237 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3238 return OpenChannel_set_to_self_delay(this_ptr_conv, val);
3241 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr) {
3242 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3243 return OpenChannel_get_max_accepted_htlcs(this_ptr_conv);
3246 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3247 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3248 return OpenChannel_set_max_accepted_htlcs(this_ptr_conv, val);
3251 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
3252 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3253 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3254 *ret = OpenChannel_get_funding_pubkey(this_ptr_conv);
3258 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3259 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3260 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3262 return OpenChannel_set_funding_pubkey(this_ptr_conv, val_conv);
3265 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
3266 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3267 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3268 *ret = OpenChannel_get_revocation_basepoint(this_ptr_conv);
3272 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3273 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3274 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3276 return OpenChannel_set_revocation_basepoint(this_ptr_conv, val_conv);
3279 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
3280 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3281 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3282 *ret = OpenChannel_get_payment_point(this_ptr_conv);
3286 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3287 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3288 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3290 return OpenChannel_set_payment_point(this_ptr_conv, val_conv);
3293 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
3294 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3295 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3296 *ret = OpenChannel_get_delayed_payment_basepoint(this_ptr_conv);
3300 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3301 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3302 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3304 return OpenChannel_set_delayed_payment_basepoint(this_ptr_conv, val_conv);
3307 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
3308 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3309 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3310 *ret = OpenChannel_get_htlc_basepoint(this_ptr_conv);
3314 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3315 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3316 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3318 return OpenChannel_set_htlc_basepoint(this_ptr_conv, val_conv);
3321 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
3322 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3323 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3324 *ret = OpenChannel_get_first_per_commitment_point(this_ptr_conv);
3328 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3329 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3330 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3332 return OpenChannel_set_first_per_commitment_point(this_ptr_conv, val_conv);
3335 JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1flags(JNIEnv * _env, jclass _b, jlong this_ptr) {
3336 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3337 return OpenChannel_get_channel_flags(this_ptr_conv);
3340 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1flags(JNIEnv * _env, jclass _b, jlong this_ptr, jbyte val) {
3341 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3342 return OpenChannel_set_channel_flags(this_ptr_conv, val);
3345 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3346 LDKAcceptChannel this_ptr_conv = *(LDKAcceptChannel*)this_ptr;
3347 FREE((void*)this_ptr);
3348 this_ptr_conv._underlying_ref = false;
3349 return AcceptChannel_free(this_ptr_conv);
3352 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3353 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3354 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3355 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *AcceptChannel_get_temporary_channel_id(this_ptr_conv));
3359 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3360 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3361 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3363 return AcceptChannel_set_temporary_channel_id(this_ptr_conv, val_conv);
3366 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3367 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3368 return AcceptChannel_get_dust_limit_satoshis(this_ptr_conv);
3371 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3372 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3373 return AcceptChannel_set_dust_limit_satoshis(this_ptr_conv, val);
3376 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3377 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3378 return AcceptChannel_get_max_htlc_value_in_flight_msat(this_ptr_conv);
3381 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) {
3382 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3383 return AcceptChannel_set_max_htlc_value_in_flight_msat(this_ptr_conv, val);
3386 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3387 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3388 return AcceptChannel_get_channel_reserve_satoshis(this_ptr_conv);
3391 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3392 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3393 return AcceptChannel_set_channel_reserve_satoshis(this_ptr_conv, val);
3396 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3397 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3398 return AcceptChannel_get_htlc_minimum_msat(this_ptr_conv);
3401 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3402 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3403 return AcceptChannel_set_htlc_minimum_msat(this_ptr_conv, val);
3406 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr) {
3407 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3408 return AcceptChannel_get_minimum_depth(this_ptr_conv);
3411 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
3412 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3413 return AcceptChannel_set_minimum_depth(this_ptr_conv, val);
3416 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
3417 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3418 return AcceptChannel_get_to_self_delay(this_ptr_conv);
3421 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3422 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3423 return AcceptChannel_set_to_self_delay(this_ptr_conv, val);
3426 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr) {
3427 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3428 return AcceptChannel_get_max_accepted_htlcs(this_ptr_conv);
3431 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3432 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3433 return AcceptChannel_set_max_accepted_htlcs(this_ptr_conv, val);
3436 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
3437 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3438 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3439 *ret = AcceptChannel_get_funding_pubkey(this_ptr_conv);
3443 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3444 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3445 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3447 return AcceptChannel_set_funding_pubkey(this_ptr_conv, val_conv);
3450 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
3451 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3452 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3453 *ret = AcceptChannel_get_revocation_basepoint(this_ptr_conv);
3457 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3458 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3459 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3461 return AcceptChannel_set_revocation_basepoint(this_ptr_conv, val_conv);
3464 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
3465 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3466 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3467 *ret = AcceptChannel_get_payment_point(this_ptr_conv);
3471 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3472 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3473 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3475 return AcceptChannel_set_payment_point(this_ptr_conv, val_conv);
3478 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
3479 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3480 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3481 *ret = AcceptChannel_get_delayed_payment_basepoint(this_ptr_conv);
3485 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3486 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3487 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3489 return AcceptChannel_set_delayed_payment_basepoint(this_ptr_conv, val_conv);
3492 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
3493 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3494 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3495 *ret = AcceptChannel_get_htlc_basepoint(this_ptr_conv);
3499 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3500 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3501 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3503 return AcceptChannel_set_htlc_basepoint(this_ptr_conv, val_conv);
3506 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
3507 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3508 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3509 *ret = AcceptChannel_get_first_per_commitment_point(this_ptr_conv);
3513 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3514 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3515 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3517 return AcceptChannel_set_first_per_commitment_point(this_ptr_conv, val_conv);
3520 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3521 LDKFundingCreated this_ptr_conv = *(LDKFundingCreated*)this_ptr;
3522 FREE((void*)this_ptr);
3523 this_ptr_conv._underlying_ref = false;
3524 return FundingCreated_free(this_ptr_conv);
3527 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3528 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3529 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3530 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingCreated_get_temporary_channel_id(this_ptr_conv));
3534 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3535 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3536 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3538 return FundingCreated_set_temporary_channel_id(this_ptr_conv, val_conv);
3541 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1txid(JNIEnv * _env, jclass _b, jlong this_ptr) {
3542 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3543 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3544 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingCreated_get_funding_txid(this_ptr_conv));
3548 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1txid(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3549 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3550 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3552 return FundingCreated_set_funding_txid(this_ptr_conv, val_conv);
3555 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1output_1index(JNIEnv * _env, jclass _b, jlong this_ptr) {
3556 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3557 return FundingCreated_get_funding_output_index(this_ptr_conv);
3560 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1output_1index(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3561 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3562 return FundingCreated_set_funding_output_index(this_ptr_conv, val);
3565 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
3566 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3567 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
3568 *ret = FundingCreated_get_signature(this_ptr_conv);
3572 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3573 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3574 LDKSignature val_conv = *(LDKSignature*)val;
3576 return FundingCreated_set_signature(this_ptr_conv, val_conv);
3579 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1new(JNIEnv * _env, jclass _b, jlong temporary_channel_id_arg, jlong funding_txid_arg, jshort funding_output_index_arg, jlong signature_arg) {
3580 LDKThirtyTwoBytes temporary_channel_id_arg_conv = *(LDKThirtyTwoBytes*)temporary_channel_id_arg;
3581 FREE((void*)temporary_channel_id_arg);
3582 LDKThirtyTwoBytes funding_txid_arg_conv = *(LDKThirtyTwoBytes*)funding_txid_arg;
3583 FREE((void*)funding_txid_arg);
3584 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
3585 FREE((void*)signature_arg);
3586 LDKFundingCreated* ret = MALLOC(sizeof(LDKFundingCreated), "LDKFundingCreated");
3587 *ret = FundingCreated_new(temporary_channel_id_arg_conv, funding_txid_arg_conv, funding_output_index_arg, signature_arg_conv);
3588 assert(!ret->_underlying_ref);
3589 ret->_underlying_ref = true;
3593 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3594 LDKFundingSigned this_ptr_conv = *(LDKFundingSigned*)this_ptr;
3595 FREE((void*)this_ptr);
3596 this_ptr_conv._underlying_ref = false;
3597 return FundingSigned_free(this_ptr_conv);
3600 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3601 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
3602 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3603 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingSigned_get_channel_id(this_ptr_conv));
3607 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3608 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
3609 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3611 return FundingSigned_set_channel_id(this_ptr_conv, val_conv);
3614 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
3615 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
3616 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
3617 *ret = FundingSigned_get_signature(this_ptr_conv);
3621 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3622 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
3623 LDKSignature val_conv = *(LDKSignature*)val;
3625 return FundingSigned_set_signature(this_ptr_conv, val_conv);
3628 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong signature_arg) {
3629 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
3630 FREE((void*)channel_id_arg);
3631 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
3632 FREE((void*)signature_arg);
3633 LDKFundingSigned* ret = MALLOC(sizeof(LDKFundingSigned), "LDKFundingSigned");
3634 *ret = FundingSigned_new(channel_id_arg_conv, signature_arg_conv);
3635 assert(!ret->_underlying_ref);
3636 ret->_underlying_ref = true;
3640 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3641 LDKFundingLocked this_ptr_conv = *(LDKFundingLocked*)this_ptr;
3642 FREE((void*)this_ptr);
3643 this_ptr_conv._underlying_ref = false;
3644 return FundingLocked_free(this_ptr_conv);
3647 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3648 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
3649 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3650 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingLocked_get_channel_id(this_ptr_conv));
3654 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3655 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
3656 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3658 return FundingLocked_set_channel_id(this_ptr_conv, val_conv);
3661 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
3662 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
3663 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3664 *ret = FundingLocked_get_next_per_commitment_point(this_ptr_conv);
3668 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3669 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
3670 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3672 return FundingLocked_set_next_per_commitment_point(this_ptr_conv, val_conv);
3675 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong next_per_commitment_point_arg) {
3676 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
3677 FREE((void*)channel_id_arg);
3678 LDKPublicKey next_per_commitment_point_arg_conv = *(LDKPublicKey*)next_per_commitment_point_arg;
3679 FREE((void*)next_per_commitment_point_arg);
3680 LDKFundingLocked* ret = MALLOC(sizeof(LDKFundingLocked), "LDKFundingLocked");
3681 *ret = FundingLocked_new(channel_id_arg_conv, next_per_commitment_point_arg_conv);
3682 assert(!ret->_underlying_ref);
3683 ret->_underlying_ref = true;
3687 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3688 LDKShutdown this_ptr_conv = *(LDKShutdown*)this_ptr;
3689 FREE((void*)this_ptr);
3690 this_ptr_conv._underlying_ref = false;
3691 return Shutdown_free(this_ptr_conv);
3694 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3695 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
3696 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3697 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *Shutdown_get_channel_id(this_ptr_conv));
3701 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3702 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
3703 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3705 return Shutdown_set_channel_id(this_ptr_conv, val_conv);
3708 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1scriptpubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
3709 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
3710 LDKu8slice* ret = MALLOC(sizeof(LDKu8slice), "LDKu8slice");
3711 *ret = Shutdown_get_scriptpubkey(this_ptr_conv);
3715 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1scriptpubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3716 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
3717 LDKCVec_u8Z val_conv = *(LDKCVec_u8Z*)val;
3719 return Shutdown_set_scriptpubkey(this_ptr_conv, val_conv);
3722 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong scriptpubkey_arg) {
3723 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
3724 FREE((void*)channel_id_arg);
3725 LDKCVec_u8Z scriptpubkey_arg_conv = *(LDKCVec_u8Z*)scriptpubkey_arg;
3726 FREE((void*)scriptpubkey_arg);
3727 LDKShutdown* ret = MALLOC(sizeof(LDKShutdown), "LDKShutdown");
3728 *ret = Shutdown_new(channel_id_arg_conv, scriptpubkey_arg_conv);
3729 assert(!ret->_underlying_ref);
3730 ret->_underlying_ref = true;
3734 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3735 LDKClosingSigned this_ptr_conv = *(LDKClosingSigned*)this_ptr;
3736 FREE((void*)this_ptr);
3737 this_ptr_conv._underlying_ref = false;
3738 return ClosingSigned_free(this_ptr_conv);
3741 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3742 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
3743 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3744 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ClosingSigned_get_channel_id(this_ptr_conv));
3748 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3749 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
3750 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3752 return ClosingSigned_set_channel_id(this_ptr_conv, val_conv);
3755 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3756 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
3757 return ClosingSigned_get_fee_satoshis(this_ptr_conv);
3760 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3761 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
3762 return ClosingSigned_set_fee_satoshis(this_ptr_conv, val);
3765 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
3766 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
3767 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
3768 *ret = ClosingSigned_get_signature(this_ptr_conv);
3772 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3773 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
3774 LDKSignature val_conv = *(LDKSignature*)val;
3776 return ClosingSigned_set_signature(this_ptr_conv, val_conv);
3779 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong fee_satoshis_arg, jlong signature_arg) {
3780 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
3781 FREE((void*)channel_id_arg);
3782 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
3783 FREE((void*)signature_arg);
3784 LDKClosingSigned* ret = MALLOC(sizeof(LDKClosingSigned), "LDKClosingSigned");
3785 *ret = ClosingSigned_new(channel_id_arg_conv, fee_satoshis_arg, signature_arg_conv);
3786 assert(!ret->_underlying_ref);
3787 ret->_underlying_ref = true;
3791 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3792 LDKUpdateAddHTLC this_ptr_conv = *(LDKUpdateAddHTLC*)this_ptr;
3793 FREE((void*)this_ptr);
3794 this_ptr_conv._underlying_ref = false;
3795 return UpdateAddHTLC_free(this_ptr_conv);
3798 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3799 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
3800 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3801 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateAddHTLC_get_channel_id(this_ptr_conv));
3805 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3806 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
3807 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3809 return UpdateAddHTLC_set_channel_id(this_ptr_conv, val_conv);
3812 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3813 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
3814 return UpdateAddHTLC_get_htlc_id(this_ptr_conv);
3817 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3818 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
3819 return UpdateAddHTLC_set_htlc_id(this_ptr_conv, val);
3822 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3823 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
3824 return UpdateAddHTLC_get_amount_msat(this_ptr_conv);
3827 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3828 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
3829 return UpdateAddHTLC_set_amount_msat(this_ptr_conv, val);
3832 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
3833 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
3834 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3835 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateAddHTLC_get_payment_hash(this_ptr_conv));
3839 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3840 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
3841 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3843 return UpdateAddHTLC_set_payment_hash(this_ptr_conv, val_conv);
3846 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr) {
3847 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
3848 return UpdateAddHTLC_get_cltv_expiry(this_ptr_conv);
3851 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
3852 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
3853 return UpdateAddHTLC_set_cltv_expiry(this_ptr_conv, val);
3856 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3857 LDKUpdateFulfillHTLC this_ptr_conv = *(LDKUpdateFulfillHTLC*)this_ptr;
3858 FREE((void*)this_ptr);
3859 this_ptr_conv._underlying_ref = false;
3860 return UpdateFulfillHTLC_free(this_ptr_conv);
3863 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3864 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
3865 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3866 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_channel_id(this_ptr_conv));
3870 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3871 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
3872 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3874 return UpdateFulfillHTLC_set_channel_id(this_ptr_conv, val_conv);
3877 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3878 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
3879 return UpdateFulfillHTLC_get_htlc_id(this_ptr_conv);
3882 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3883 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
3884 return UpdateFulfillHTLC_set_htlc_id(this_ptr_conv, val);
3887 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1payment_1preimage(JNIEnv * _env, jclass _b, jlong this_ptr) {
3888 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
3889 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3890 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_payment_preimage(this_ptr_conv));
3894 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1payment_1preimage(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3895 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
3896 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3898 return UpdateFulfillHTLC_set_payment_preimage(this_ptr_conv, val_conv);
3901 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong htlc_id_arg, jlong payment_preimage_arg) {
3902 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
3903 FREE((void*)channel_id_arg);
3904 LDKThirtyTwoBytes payment_preimage_arg_conv = *(LDKThirtyTwoBytes*)payment_preimage_arg;
3905 FREE((void*)payment_preimage_arg);
3906 LDKUpdateFulfillHTLC* ret = MALLOC(sizeof(LDKUpdateFulfillHTLC), "LDKUpdateFulfillHTLC");
3907 *ret = UpdateFulfillHTLC_new(channel_id_arg_conv, htlc_id_arg, payment_preimage_arg_conv);
3908 assert(!ret->_underlying_ref);
3909 ret->_underlying_ref = true;
3913 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3914 LDKUpdateFailHTLC this_ptr_conv = *(LDKUpdateFailHTLC*)this_ptr;
3915 FREE((void*)this_ptr);
3916 this_ptr_conv._underlying_ref = false;
3917 return UpdateFailHTLC_free(this_ptr_conv);
3920 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3921 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
3922 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3923 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFailHTLC_get_channel_id(this_ptr_conv));
3927 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3928 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
3929 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3931 return UpdateFailHTLC_set_channel_id(this_ptr_conv, val_conv);
3934 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3935 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
3936 return UpdateFailHTLC_get_htlc_id(this_ptr_conv);
3939 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3940 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
3941 return UpdateFailHTLC_set_htlc_id(this_ptr_conv, val);
3944 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3945 LDKUpdateFailMalformedHTLC this_ptr_conv = *(LDKUpdateFailMalformedHTLC*)this_ptr;
3946 FREE((void*)this_ptr);
3947 this_ptr_conv._underlying_ref = false;
3948 return UpdateFailMalformedHTLC_free(this_ptr_conv);
3951 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3952 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
3953 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3954 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFailMalformedHTLC_get_channel_id(this_ptr_conv));
3958 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3959 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
3960 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3962 return UpdateFailMalformedHTLC_set_channel_id(this_ptr_conv, val_conv);
3965 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3966 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
3967 return UpdateFailMalformedHTLC_get_htlc_id(this_ptr_conv);
3970 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3971 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
3972 return UpdateFailMalformedHTLC_set_htlc_id(this_ptr_conv, val);
3975 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1failure_1code(JNIEnv * _env, jclass _b, jlong this_ptr) {
3976 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
3977 return UpdateFailMalformedHTLC_get_failure_code(this_ptr_conv);
3980 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1failure_1code(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3981 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
3982 return UpdateFailMalformedHTLC_set_failure_code(this_ptr_conv, val);
3985 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3986 LDKCommitmentSigned this_ptr_conv = *(LDKCommitmentSigned*)this_ptr;
3987 FREE((void*)this_ptr);
3988 this_ptr_conv._underlying_ref = false;
3989 return CommitmentSigned_free(this_ptr_conv);
3992 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3993 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
3994 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3995 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *CommitmentSigned_get_channel_id(this_ptr_conv));
3999 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4000 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
4001 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4003 return CommitmentSigned_set_channel_id(this_ptr_conv, val_conv);
4006 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
4007 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
4008 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4009 *ret = CommitmentSigned_get_signature(this_ptr_conv);
4013 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4014 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
4015 LDKSignature val_conv = *(LDKSignature*)val;
4017 return CommitmentSigned_set_signature(this_ptr_conv, val_conv);
4020 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1htlc_1signatures(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4021 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
4022 LDKCVec_SignatureZ val_conv = *(LDKCVec_SignatureZ*)val;
4024 return CommitmentSigned_set_htlc_signatures(this_ptr_conv, val_conv);
4027 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong signature_arg, jlong htlc_signatures_arg) {
4028 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4029 FREE((void*)channel_id_arg);
4030 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
4031 FREE((void*)signature_arg);
4032 LDKCVec_SignatureZ htlc_signatures_arg_conv = *(LDKCVec_SignatureZ*)htlc_signatures_arg;
4033 FREE((void*)htlc_signatures_arg);
4034 LDKCommitmentSigned* ret = MALLOC(sizeof(LDKCommitmentSigned), "LDKCommitmentSigned");
4035 *ret = CommitmentSigned_new(channel_id_arg_conv, signature_arg_conv, htlc_signatures_arg_conv);
4036 assert(!ret->_underlying_ref);
4037 ret->_underlying_ref = true;
4041 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4042 LDKRevokeAndACK this_ptr_conv = *(LDKRevokeAndACK*)this_ptr;
4043 FREE((void*)this_ptr);
4044 this_ptr_conv._underlying_ref = false;
4045 return RevokeAndACK_free(this_ptr_conv);
4048 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4049 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
4050 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4051 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *RevokeAndACK_get_channel_id(this_ptr_conv));
4055 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4056 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
4057 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4059 return RevokeAndACK_set_channel_id(this_ptr_conv, val_conv);
4062 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr) {
4063 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
4064 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4065 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *RevokeAndACK_get_per_commitment_secret(this_ptr_conv));
4069 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4070 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
4071 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4073 return RevokeAndACK_set_per_commitment_secret(this_ptr_conv, val_conv);
4076 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
4077 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
4078 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4079 *ret = RevokeAndACK_get_next_per_commitment_point(this_ptr_conv);
4083 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4084 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
4085 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4087 return RevokeAndACK_set_next_per_commitment_point(this_ptr_conv, val_conv);
4090 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong per_commitment_secret_arg, jlong next_per_commitment_point_arg) {
4091 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4092 FREE((void*)channel_id_arg);
4093 LDKThirtyTwoBytes per_commitment_secret_arg_conv = *(LDKThirtyTwoBytes*)per_commitment_secret_arg;
4094 FREE((void*)per_commitment_secret_arg);
4095 LDKPublicKey next_per_commitment_point_arg_conv = *(LDKPublicKey*)next_per_commitment_point_arg;
4096 FREE((void*)next_per_commitment_point_arg);
4097 LDKRevokeAndACK* ret = MALLOC(sizeof(LDKRevokeAndACK), "LDKRevokeAndACK");
4098 *ret = RevokeAndACK_new(channel_id_arg_conv, per_commitment_secret_arg_conv, next_per_commitment_point_arg_conv);
4099 assert(!ret->_underlying_ref);
4100 ret->_underlying_ref = true;
4104 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4105 LDKUpdateFee this_ptr_conv = *(LDKUpdateFee*)this_ptr;
4106 FREE((void*)this_ptr);
4107 this_ptr_conv._underlying_ref = false;
4108 return UpdateFee_free(this_ptr_conv);
4111 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4112 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
4113 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4114 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFee_get_channel_id(this_ptr_conv));
4118 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4119 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
4120 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4122 return UpdateFee_set_channel_id(this_ptr_conv, val_conv);
4125 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr) {
4126 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
4127 return UpdateFee_get_feerate_per_kw(this_ptr_conv);
4130 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
4131 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
4132 return UpdateFee_set_feerate_per_kw(this_ptr_conv, val);
4135 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jint feerate_per_kw_arg) {
4136 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4137 FREE((void*)channel_id_arg);
4138 LDKUpdateFee* ret = MALLOC(sizeof(LDKUpdateFee), "LDKUpdateFee");
4139 *ret = UpdateFee_new(channel_id_arg_conv, feerate_per_kw_arg);
4140 assert(!ret->_underlying_ref);
4141 ret->_underlying_ref = true;
4145 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4146 LDKDataLossProtect this_ptr_conv = *(LDKDataLossProtect*)this_ptr;
4147 FREE((void*)this_ptr);
4148 this_ptr_conv._underlying_ref = false;
4149 return DataLossProtect_free(this_ptr_conv);
4152 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1your_1last_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr) {
4153 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
4154 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4155 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *DataLossProtect_get_your_last_per_commitment_secret(this_ptr_conv));
4159 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1your_1last_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4160 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
4161 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4163 return DataLossProtect_set_your_last_per_commitment_secret(this_ptr_conv, val_conv);
4166 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1my_1current_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
4167 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
4168 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4169 *ret = DataLossProtect_get_my_current_per_commitment_point(this_ptr_conv);
4173 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1my_1current_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4174 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
4175 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4177 return DataLossProtect_set_my_current_per_commitment_point(this_ptr_conv, val_conv);
4180 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1new(JNIEnv * _env, jclass _b, jlong your_last_per_commitment_secret_arg, jlong my_current_per_commitment_point_arg) {
4181 LDKThirtyTwoBytes your_last_per_commitment_secret_arg_conv = *(LDKThirtyTwoBytes*)your_last_per_commitment_secret_arg;
4182 FREE((void*)your_last_per_commitment_secret_arg);
4183 LDKPublicKey my_current_per_commitment_point_arg_conv = *(LDKPublicKey*)my_current_per_commitment_point_arg;
4184 FREE((void*)my_current_per_commitment_point_arg);
4185 LDKDataLossProtect* ret = MALLOC(sizeof(LDKDataLossProtect), "LDKDataLossProtect");
4186 *ret = DataLossProtect_new(your_last_per_commitment_secret_arg_conv, my_current_per_commitment_point_arg_conv);
4187 assert(!ret->_underlying_ref);
4188 ret->_underlying_ref = true;
4192 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4193 LDKChannelReestablish this_ptr_conv = *(LDKChannelReestablish*)this_ptr;
4194 FREE((void*)this_ptr);
4195 this_ptr_conv._underlying_ref = false;
4196 return ChannelReestablish_free(this_ptr_conv);
4199 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4200 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
4201 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4202 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ChannelReestablish_get_channel_id(this_ptr_conv));
4206 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4207 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
4208 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4210 return ChannelReestablish_set_channel_id(this_ptr_conv, val_conv);
4213 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1local_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr) {
4214 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
4215 return ChannelReestablish_get_next_local_commitment_number(this_ptr_conv);
4218 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1local_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4219 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
4220 return ChannelReestablish_set_next_local_commitment_number(this_ptr_conv, val);
4223 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1remote_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr) {
4224 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
4225 return ChannelReestablish_get_next_remote_commitment_number(this_ptr_conv);
4228 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1remote_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4229 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
4230 return ChannelReestablish_set_next_remote_commitment_number(this_ptr_conv, val);
4233 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4234 LDKAnnouncementSignatures this_ptr_conv = *(LDKAnnouncementSignatures*)this_ptr;
4235 FREE((void*)this_ptr);
4236 this_ptr_conv._underlying_ref = false;
4237 return AnnouncementSignatures_free(this_ptr_conv);
4240 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4241 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4242 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4243 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *AnnouncementSignatures_get_channel_id(this_ptr_conv));
4247 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4248 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4249 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4251 return AnnouncementSignatures_set_channel_id(this_ptr_conv, val_conv);
4254 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4255 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4256 return AnnouncementSignatures_get_short_channel_id(this_ptr_conv);
4259 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4260 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4261 return AnnouncementSignatures_set_short_channel_id(this_ptr_conv, val);
4264 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1node_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
4265 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4266 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4267 *ret = AnnouncementSignatures_get_node_signature(this_ptr_conv);
4271 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1node_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4272 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4273 LDKSignature val_conv = *(LDKSignature*)val;
4275 return AnnouncementSignatures_set_node_signature(this_ptr_conv, val_conv);
4278 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1bitcoin_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
4279 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4280 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4281 *ret = AnnouncementSignatures_get_bitcoin_signature(this_ptr_conv);
4285 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1bitcoin_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4286 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4287 LDKSignature val_conv = *(LDKSignature*)val;
4289 return AnnouncementSignatures_set_bitcoin_signature(this_ptr_conv, val_conv);
4292 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong short_channel_id_arg, jlong node_signature_arg, jlong bitcoin_signature_arg) {
4293 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4294 FREE((void*)channel_id_arg);
4295 LDKSignature node_signature_arg_conv = *(LDKSignature*)node_signature_arg;
4296 FREE((void*)node_signature_arg);
4297 LDKSignature bitcoin_signature_arg_conv = *(LDKSignature*)bitcoin_signature_arg;
4298 FREE((void*)bitcoin_signature_arg);
4299 LDKAnnouncementSignatures* ret = MALLOC(sizeof(LDKAnnouncementSignatures), "LDKAnnouncementSignatures");
4300 *ret = AnnouncementSignatures_new(channel_id_arg_conv, short_channel_id_arg, node_signature_arg_conv, bitcoin_signature_arg_conv);
4301 assert(!ret->_underlying_ref);
4302 ret->_underlying_ref = true;
4306 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetAddress_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4307 LDKNetAddress this_ptr_conv = *(LDKNetAddress*)this_ptr;
4308 FREE((void*)this_ptr);
4309 return NetAddress_free(this_ptr_conv);
4312 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4313 LDKUnsignedNodeAnnouncement this_ptr_conv = *(LDKUnsignedNodeAnnouncement*)this_ptr;
4314 FREE((void*)this_ptr);
4315 this_ptr_conv._underlying_ref = false;
4316 return UnsignedNodeAnnouncement_free(this_ptr_conv);
4319 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr) {
4320 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4321 return UnsignedNodeAnnouncement_get_timestamp(this_ptr_conv);
4324 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
4325 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4326 return UnsignedNodeAnnouncement_set_timestamp(this_ptr_conv, val);
4329 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4330 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4331 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4332 *ret = UnsignedNodeAnnouncement_get_node_id(this_ptr_conv);
4336 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4337 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4338 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4340 return UnsignedNodeAnnouncement_set_node_id(this_ptr_conv, val_conv);
4343 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr) {
4344 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4345 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 3);
4346 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 3, *UnsignedNodeAnnouncement_get_rgb(this_ptr_conv));
4350 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4351 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4352 LDKThreeBytes val_conv = *(LDKThreeBytes*)val;
4354 return UnsignedNodeAnnouncement_set_rgb(this_ptr_conv, val_conv);
4357 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1alias(JNIEnv * _env, jclass _b, jlong this_ptr) {
4358 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4359 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4360 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedNodeAnnouncement_get_alias(this_ptr_conv));
4364 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1alias(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4365 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4366 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4368 return UnsignedNodeAnnouncement_set_alias(this_ptr_conv, val_conv);
4371 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1addresses(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4372 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4373 LDKCVec_NetAddressZ val_conv = *(LDKCVec_NetAddressZ*)val;
4375 return UnsignedNodeAnnouncement_set_addresses(this_ptr_conv, val_conv);
4378 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4379 LDKNodeAnnouncement this_ptr_conv = *(LDKNodeAnnouncement*)this_ptr;
4380 FREE((void*)this_ptr);
4381 this_ptr_conv._underlying_ref = false;
4382 return NodeAnnouncement_free(this_ptr_conv);
4385 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
4386 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
4387 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4388 *ret = NodeAnnouncement_get_signature(this_ptr_conv);
4392 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4393 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
4394 LDKSignature val_conv = *(LDKSignature*)val;
4396 return NodeAnnouncement_set_signature(this_ptr_conv, val_conv);
4399 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1contents(JNIEnv * _env, jclass _b, jlong this_ptr) {
4400 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
4401 LDKUnsignedNodeAnnouncement* ret = MALLOC(sizeof(LDKUnsignedNodeAnnouncement), "LDKUnsignedNodeAnnouncement");
4402 *ret = NodeAnnouncement_get_contents(this_ptr_conv);
4403 assert(!ret->_underlying_ref);
4404 ret->_underlying_ref = true;
4408 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1contents(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4409 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
4410 LDKUnsignedNodeAnnouncement val_conv = *(LDKUnsignedNodeAnnouncement*)val;
4412 val_conv._underlying_ref = false;
4413 return NodeAnnouncement_set_contents(this_ptr_conv, val_conv);
4416 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1new(JNIEnv * _env, jclass _b, jlong signature_arg, jlong contents_arg) {
4417 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
4418 FREE((void*)signature_arg);
4419 LDKUnsignedNodeAnnouncement contents_arg_conv = *(LDKUnsignedNodeAnnouncement*)contents_arg;
4420 FREE((void*)contents_arg);
4421 contents_arg_conv._underlying_ref = false;
4422 LDKNodeAnnouncement* ret = MALLOC(sizeof(LDKNodeAnnouncement), "LDKNodeAnnouncement");
4423 *ret = NodeAnnouncement_new(signature_arg_conv, contents_arg_conv);
4424 assert(!ret->_underlying_ref);
4425 ret->_underlying_ref = true;
4429 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4430 LDKUnsignedChannelAnnouncement this_ptr_conv = *(LDKUnsignedChannelAnnouncement*)this_ptr;
4431 FREE((void*)this_ptr);
4432 this_ptr_conv._underlying_ref = false;
4433 return UnsignedChannelAnnouncement_free(this_ptr_conv);
4436 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
4437 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4438 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4439 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedChannelAnnouncement_get_chain_hash(this_ptr_conv));
4443 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4444 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4445 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4447 return UnsignedChannelAnnouncement_set_chain_hash(this_ptr_conv, val_conv);
4450 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4451 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4452 return UnsignedChannelAnnouncement_get_short_channel_id(this_ptr_conv);
4455 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4456 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4457 return UnsignedChannelAnnouncement_set_short_channel_id(this_ptr_conv, val);
4460 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
4461 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4462 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4463 *ret = UnsignedChannelAnnouncement_get_node_id_1(this_ptr_conv);
4467 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4468 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4469 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4471 return UnsignedChannelAnnouncement_set_node_id_1(this_ptr_conv, val_conv);
4474 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
4475 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4476 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4477 *ret = UnsignedChannelAnnouncement_get_node_id_2(this_ptr_conv);
4481 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4482 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4483 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4485 return UnsignedChannelAnnouncement_set_node_id_2(this_ptr_conv, val_conv);
4488 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
4489 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4490 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4491 *ret = UnsignedChannelAnnouncement_get_bitcoin_key_1(this_ptr_conv);
4495 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4496 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4497 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4499 return UnsignedChannelAnnouncement_set_bitcoin_key_1(this_ptr_conv, val_conv);
4502 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
4503 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4504 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4505 *ret = UnsignedChannelAnnouncement_get_bitcoin_key_2(this_ptr_conv);
4509 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4510 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4511 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4513 return UnsignedChannelAnnouncement_set_bitcoin_key_2(this_ptr_conv, val_conv);
4516 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4517 LDKChannelAnnouncement this_ptr_conv = *(LDKChannelAnnouncement*)this_ptr;
4518 FREE((void*)this_ptr);
4519 this_ptr_conv._underlying_ref = false;
4520 return ChannelAnnouncement_free(this_ptr_conv);
4523 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
4524 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4525 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4526 *ret = ChannelAnnouncement_get_node_signature_1(this_ptr_conv);
4530 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4531 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4532 LDKSignature val_conv = *(LDKSignature*)val;
4534 return ChannelAnnouncement_set_node_signature_1(this_ptr_conv, val_conv);
4537 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
4538 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4539 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4540 *ret = ChannelAnnouncement_get_node_signature_2(this_ptr_conv);
4544 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4545 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4546 LDKSignature val_conv = *(LDKSignature*)val;
4548 return ChannelAnnouncement_set_node_signature_2(this_ptr_conv, val_conv);
4551 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
4552 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4553 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4554 *ret = ChannelAnnouncement_get_bitcoin_signature_1(this_ptr_conv);
4558 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4559 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4560 LDKSignature val_conv = *(LDKSignature*)val;
4562 return ChannelAnnouncement_set_bitcoin_signature_1(this_ptr_conv, val_conv);
4565 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
4566 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4567 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4568 *ret = ChannelAnnouncement_get_bitcoin_signature_2(this_ptr_conv);
4572 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4573 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4574 LDKSignature val_conv = *(LDKSignature*)val;
4576 return ChannelAnnouncement_set_bitcoin_signature_2(this_ptr_conv, val_conv);
4579 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1contents(JNIEnv * _env, jclass _b, jlong this_ptr) {
4580 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4581 LDKUnsignedChannelAnnouncement* ret = MALLOC(sizeof(LDKUnsignedChannelAnnouncement), "LDKUnsignedChannelAnnouncement");
4582 *ret = ChannelAnnouncement_get_contents(this_ptr_conv);
4583 assert(!ret->_underlying_ref);
4584 ret->_underlying_ref = true;
4588 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1contents(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4589 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4590 LDKUnsignedChannelAnnouncement val_conv = *(LDKUnsignedChannelAnnouncement*)val;
4592 val_conv._underlying_ref = false;
4593 return ChannelAnnouncement_set_contents(this_ptr_conv, val_conv);
4596 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) {
4597 LDKSignature node_signature_1_arg_conv = *(LDKSignature*)node_signature_1_arg;
4598 FREE((void*)node_signature_1_arg);
4599 LDKSignature node_signature_2_arg_conv = *(LDKSignature*)node_signature_2_arg;
4600 FREE((void*)node_signature_2_arg);
4601 LDKSignature bitcoin_signature_1_arg_conv = *(LDKSignature*)bitcoin_signature_1_arg;
4602 FREE((void*)bitcoin_signature_1_arg);
4603 LDKSignature bitcoin_signature_2_arg_conv = *(LDKSignature*)bitcoin_signature_2_arg;
4604 FREE((void*)bitcoin_signature_2_arg);
4605 LDKUnsignedChannelAnnouncement contents_arg_conv = *(LDKUnsignedChannelAnnouncement*)contents_arg;
4606 FREE((void*)contents_arg);
4607 contents_arg_conv._underlying_ref = false;
4608 LDKChannelAnnouncement* ret = MALLOC(sizeof(LDKChannelAnnouncement), "LDKChannelAnnouncement");
4609 *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);
4610 assert(!ret->_underlying_ref);
4611 ret->_underlying_ref = true;
4615 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4616 LDKUnsignedChannelUpdate this_ptr_conv = *(LDKUnsignedChannelUpdate*)this_ptr;
4617 FREE((void*)this_ptr);
4618 this_ptr_conv._underlying_ref = false;
4619 return UnsignedChannelUpdate_free(this_ptr_conv);
4622 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
4623 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4624 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4625 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedChannelUpdate_get_chain_hash(this_ptr_conv));
4629 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4630 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4631 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4633 return UnsignedChannelUpdate_set_chain_hash(this_ptr_conv, val_conv);
4636 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4637 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4638 return UnsignedChannelUpdate_get_short_channel_id(this_ptr_conv);
4641 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4642 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4643 return UnsignedChannelUpdate_set_short_channel_id(this_ptr_conv, val);
4646 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr) {
4647 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4648 return UnsignedChannelUpdate_get_timestamp(this_ptr_conv);
4651 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
4652 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4653 return UnsignedChannelUpdate_set_timestamp(this_ptr_conv, val);
4656 JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1flags(JNIEnv * _env, jclass _b, jlong this_ptr) {
4657 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4658 return UnsignedChannelUpdate_get_flags(this_ptr_conv);
4661 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1flags(JNIEnv * _env, jclass _b, jlong this_ptr, jbyte val) {
4662 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4663 return UnsignedChannelUpdate_set_flags(this_ptr_conv, val);
4666 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
4667 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4668 return UnsignedChannelUpdate_get_cltv_expiry_delta(this_ptr_conv);
4671 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
4672 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4673 return UnsignedChannelUpdate_set_cltv_expiry_delta(this_ptr_conv, val);
4676 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
4677 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4678 return UnsignedChannelUpdate_get_htlc_minimum_msat(this_ptr_conv);
4681 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4682 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4683 return UnsignedChannelUpdate_set_htlc_minimum_msat(this_ptr_conv, val);
4686 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
4687 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4688 return UnsignedChannelUpdate_get_fee_base_msat(this_ptr_conv);
4691 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
4692 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4693 return UnsignedChannelUpdate_set_fee_base_msat(this_ptr_conv, val);
4696 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr) {
4697 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4698 return UnsignedChannelUpdate_get_fee_proportional_millionths(this_ptr_conv);
4701 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
4702 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4703 return UnsignedChannelUpdate_set_fee_proportional_millionths(this_ptr_conv, val);
4706 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4707 LDKChannelUpdate this_ptr_conv = *(LDKChannelUpdate*)this_ptr;
4708 FREE((void*)this_ptr);
4709 this_ptr_conv._underlying_ref = false;
4710 return ChannelUpdate_free(this_ptr_conv);
4713 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
4714 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
4715 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4716 *ret = ChannelUpdate_get_signature(this_ptr_conv);
4720 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4721 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
4722 LDKSignature val_conv = *(LDKSignature*)val;
4724 return ChannelUpdate_set_signature(this_ptr_conv, val_conv);
4727 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1contents(JNIEnv * _env, jclass _b, jlong this_ptr) {
4728 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
4729 LDKUnsignedChannelUpdate* ret = MALLOC(sizeof(LDKUnsignedChannelUpdate), "LDKUnsignedChannelUpdate");
4730 *ret = ChannelUpdate_get_contents(this_ptr_conv);
4731 assert(!ret->_underlying_ref);
4732 ret->_underlying_ref = true;
4736 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1contents(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4737 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
4738 LDKUnsignedChannelUpdate val_conv = *(LDKUnsignedChannelUpdate*)val;
4740 val_conv._underlying_ref = false;
4741 return ChannelUpdate_set_contents(this_ptr_conv, val_conv);
4744 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1new(JNIEnv * _env, jclass _b, jlong signature_arg, jlong contents_arg) {
4745 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
4746 FREE((void*)signature_arg);
4747 LDKUnsignedChannelUpdate contents_arg_conv = *(LDKUnsignedChannelUpdate*)contents_arg;
4748 FREE((void*)contents_arg);
4749 contents_arg_conv._underlying_ref = false;
4750 LDKChannelUpdate* ret = MALLOC(sizeof(LDKChannelUpdate), "LDKChannelUpdate");
4751 *ret = ChannelUpdate_new(signature_arg_conv, contents_arg_conv);
4752 assert(!ret->_underlying_ref);
4753 ret->_underlying_ref = true;
4757 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorAction_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4758 LDKErrorAction this_ptr_conv = *(LDKErrorAction*)this_ptr;
4759 FREE((void*)this_ptr);
4760 return ErrorAction_free(this_ptr_conv);
4763 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4764 LDKLightningError this_ptr_conv = *(LDKLightningError*)this_ptr;
4765 FREE((void*)this_ptr);
4766 this_ptr_conv._underlying_ref = false;
4767 return LightningError_free(this_ptr_conv);
4770 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1err(JNIEnv * _env, jclass _b, jlong this_ptr) {
4771 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
4772 LDKStr* ret = MALLOC(sizeof(LDKStr), "LDKStr");
4773 *ret = LightningError_get_err(this_ptr_conv);
4777 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1err(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4778 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
4779 LDKCVec_u8Z val_conv = *(LDKCVec_u8Z*)val;
4781 return LightningError_set_err(this_ptr_conv, val_conv);
4784 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1action(JNIEnv * _env, jclass _b, jlong this_ptr) {
4785 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
4786 LDKErrorAction* ret = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
4787 *ret = LightningError_get_action(this_ptr_conv);
4791 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1action(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4792 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
4793 LDKErrorAction val_conv = *(LDKErrorAction*)val;
4795 return LightningError_set_action(this_ptr_conv, val_conv);
4798 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1new(JNIEnv * _env, jclass _b, jlong err_arg, jlong action_arg) {
4799 LDKCVec_u8Z err_arg_conv = *(LDKCVec_u8Z*)err_arg;
4800 FREE((void*)err_arg);
4801 LDKErrorAction action_arg_conv = *(LDKErrorAction*)action_arg;
4802 FREE((void*)action_arg);
4803 LDKLightningError* ret = MALLOC(sizeof(LDKLightningError), "LDKLightningError");
4804 *ret = LightningError_new(err_arg_conv, action_arg_conv);
4805 assert(!ret->_underlying_ref);
4806 ret->_underlying_ref = true;
4810 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4811 LDKCommitmentUpdate this_ptr_conv = *(LDKCommitmentUpdate*)this_ptr;
4812 FREE((void*)this_ptr);
4813 this_ptr_conv._underlying_ref = false;
4814 return CommitmentUpdate_free(this_ptr_conv);
4817 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1add_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4818 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
4819 LDKCVec_UpdateAddHTLCZ val_conv = *(LDKCVec_UpdateAddHTLCZ*)val;
4821 return CommitmentUpdate_set_update_add_htlcs(this_ptr_conv, val_conv);
4824 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fulfill_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4825 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
4826 LDKCVec_UpdateFulfillHTLCZ val_conv = *(LDKCVec_UpdateFulfillHTLCZ*)val;
4828 return CommitmentUpdate_set_update_fulfill_htlcs(this_ptr_conv, val_conv);
4831 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4832 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
4833 LDKCVec_UpdateFailHTLCZ val_conv = *(LDKCVec_UpdateFailHTLCZ*)val;
4835 return CommitmentUpdate_set_update_fail_htlcs(this_ptr_conv, val_conv);
4838 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1malformed_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4839 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
4840 LDKCVec_UpdateFailMalformedHTLCZ val_conv = *(LDKCVec_UpdateFailMalformedHTLCZ*)val;
4842 return CommitmentUpdate_set_update_fail_malformed_htlcs(this_ptr_conv, val_conv);
4845 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fee(JNIEnv * _env, jclass _b, jlong this_ptr) {
4846 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
4847 LDKUpdateFee* ret = MALLOC(sizeof(LDKUpdateFee), "LDKUpdateFee");
4848 *ret = CommitmentUpdate_get_update_fee(this_ptr_conv);
4849 assert(!ret->_underlying_ref);
4850 ret->_underlying_ref = true;
4854 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fee(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4855 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
4856 LDKUpdateFee val_conv = *(LDKUpdateFee*)val;
4858 val_conv._underlying_ref = false;
4859 return CommitmentUpdate_set_update_fee(this_ptr_conv, val_conv);
4862 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1commitment_1signed(JNIEnv * _env, jclass _b, jlong this_ptr) {
4863 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
4864 LDKCommitmentSigned* ret = MALLOC(sizeof(LDKCommitmentSigned), "LDKCommitmentSigned");
4865 *ret = CommitmentUpdate_get_commitment_signed(this_ptr_conv);
4866 assert(!ret->_underlying_ref);
4867 ret->_underlying_ref = true;
4871 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1commitment_1signed(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4872 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
4873 LDKCommitmentSigned val_conv = *(LDKCommitmentSigned*)val;
4875 val_conv._underlying_ref = false;
4876 return CommitmentUpdate_set_commitment_signed(this_ptr_conv, val_conv);
4879 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) {
4880 LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg_conv = *(LDKCVec_UpdateAddHTLCZ*)update_add_htlcs_arg;
4881 FREE((void*)update_add_htlcs_arg);
4882 LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg_conv = *(LDKCVec_UpdateFulfillHTLCZ*)update_fulfill_htlcs_arg;
4883 FREE((void*)update_fulfill_htlcs_arg);
4884 LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg_conv = *(LDKCVec_UpdateFailHTLCZ*)update_fail_htlcs_arg;
4885 FREE((void*)update_fail_htlcs_arg);
4886 LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg_conv = *(LDKCVec_UpdateFailMalformedHTLCZ*)update_fail_malformed_htlcs_arg;
4887 FREE((void*)update_fail_malformed_htlcs_arg);
4888 LDKUpdateFee update_fee_arg_conv = *(LDKUpdateFee*)update_fee_arg;
4889 FREE((void*)update_fee_arg);
4890 update_fee_arg_conv._underlying_ref = false;
4891 LDKCommitmentSigned commitment_signed_arg_conv = *(LDKCommitmentSigned*)commitment_signed_arg;
4892 FREE((void*)commitment_signed_arg);
4893 commitment_signed_arg_conv._underlying_ref = false;
4894 LDKCommitmentUpdate* ret = MALLOC(sizeof(LDKCommitmentUpdate), "LDKCommitmentUpdate");
4895 *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);
4896 assert(!ret->_underlying_ref);
4897 ret->_underlying_ref = true;
4901 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCFailChannelUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4902 LDKHTLCFailChannelUpdate this_ptr_conv = *(LDKHTLCFailChannelUpdate*)this_ptr;
4903 FREE((void*)this_ptr);
4904 return HTLCFailChannelUpdate_free(this_ptr_conv);
4907 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4908 LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)this_ptr;
4909 FREE((void*)this_ptr);
4910 return ChannelMessageHandler_free(this_ptr_conv);
4913 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4914 LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)this_ptr;
4915 FREE((void*)this_ptr);
4916 return RoutingMessageHandler_free(this_ptr_conv);
4919 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1write(JNIEnv * _env, jclass _b, jlong obj) {
4920 LDKAcceptChannel* obj_conv = (LDKAcceptChannel*)obj;
4921 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
4922 *ret = AcceptChannel_write(obj_conv);
4926 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1read(JNIEnv * _env, jclass _b, jlong ser) {
4927 LDKu8slice ser_conv = *(LDKu8slice*)ser;
4929 LDKAcceptChannel* ret = MALLOC(sizeof(LDKAcceptChannel), "LDKAcceptChannel");
4930 *ret = AcceptChannel_read(ser_conv);
4931 assert(!ret->_underlying_ref);
4932 ret->_underlying_ref = true;
4936 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1write(JNIEnv * _env, jclass _b, jlong obj) {
4937 LDKAnnouncementSignatures* obj_conv = (LDKAnnouncementSignatures*)obj;
4938 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
4939 *ret = AnnouncementSignatures_write(obj_conv);
4943 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1read(JNIEnv * _env, jclass _b, jlong ser) {
4944 LDKu8slice ser_conv = *(LDKu8slice*)ser;
4946 LDKAnnouncementSignatures* ret = MALLOC(sizeof(LDKAnnouncementSignatures), "LDKAnnouncementSignatures");
4947 *ret = AnnouncementSignatures_read(ser_conv);
4948 assert(!ret->_underlying_ref);
4949 ret->_underlying_ref = true;
4953 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1write(JNIEnv * _env, jclass _b, jlong obj) {
4954 LDKChannelReestablish* obj_conv = (LDKChannelReestablish*)obj;
4955 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
4956 *ret = ChannelReestablish_write(obj_conv);
4960 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1read(JNIEnv * _env, jclass _b, jlong ser) {
4961 LDKu8slice ser_conv = *(LDKu8slice*)ser;
4963 LDKChannelReestablish* ret = MALLOC(sizeof(LDKChannelReestablish), "LDKChannelReestablish");
4964 *ret = ChannelReestablish_read(ser_conv);
4965 assert(!ret->_underlying_ref);
4966 ret->_underlying_ref = true;
4970 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
4971 LDKClosingSigned* obj_conv = (LDKClosingSigned*)obj;
4972 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
4973 *ret = ClosingSigned_write(obj_conv);
4977 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1read(JNIEnv * _env, jclass _b, jlong ser) {
4978 LDKu8slice ser_conv = *(LDKu8slice*)ser;
4980 LDKClosingSigned* ret = MALLOC(sizeof(LDKClosingSigned), "LDKClosingSigned");
4981 *ret = ClosingSigned_read(ser_conv);
4982 assert(!ret->_underlying_ref);
4983 ret->_underlying_ref = true;
4987 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
4988 LDKCommitmentSigned* obj_conv = (LDKCommitmentSigned*)obj;
4989 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
4990 *ret = CommitmentSigned_write(obj_conv);
4994 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1read(JNIEnv * _env, jclass _b, jlong ser) {
4995 LDKu8slice ser_conv = *(LDKu8slice*)ser;
4997 LDKCommitmentSigned* ret = MALLOC(sizeof(LDKCommitmentSigned), "LDKCommitmentSigned");
4998 *ret = CommitmentSigned_read(ser_conv);
4999 assert(!ret->_underlying_ref);
5000 ret->_underlying_ref = true;
5004 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1write(JNIEnv * _env, jclass _b, jlong obj) {
5005 LDKFundingCreated* obj_conv = (LDKFundingCreated*)obj;
5006 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5007 *ret = FundingCreated_write(obj_conv);
5011 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1read(JNIEnv * _env, jclass _b, jlong ser) {
5012 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5014 LDKFundingCreated* ret = MALLOC(sizeof(LDKFundingCreated), "LDKFundingCreated");
5015 *ret = FundingCreated_read(ser_conv);
5016 assert(!ret->_underlying_ref);
5017 ret->_underlying_ref = true;
5021 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
5022 LDKFundingSigned* obj_conv = (LDKFundingSigned*)obj;
5023 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5024 *ret = FundingSigned_write(obj_conv);
5028 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1read(JNIEnv * _env, jclass _b, jlong ser) {
5029 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5031 LDKFundingSigned* ret = MALLOC(sizeof(LDKFundingSigned), "LDKFundingSigned");
5032 *ret = FundingSigned_read(ser_conv);
5033 assert(!ret->_underlying_ref);
5034 ret->_underlying_ref = true;
5038 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1write(JNIEnv * _env, jclass _b, jlong obj) {
5039 LDKFundingLocked* obj_conv = (LDKFundingLocked*)obj;
5040 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5041 *ret = FundingLocked_write(obj_conv);
5045 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1read(JNIEnv * _env, jclass _b, jlong ser) {
5046 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5048 LDKFundingLocked* ret = MALLOC(sizeof(LDKFundingLocked), "LDKFundingLocked");
5049 *ret = FundingLocked_read(ser_conv);
5050 assert(!ret->_underlying_ref);
5051 ret->_underlying_ref = true;
5055 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1write(JNIEnv * _env, jclass _b, jlong obj) {
5056 LDKInit* obj_conv = (LDKInit*)obj;
5057 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5058 *ret = Init_write(obj_conv);
5062 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1read(JNIEnv * _env, jclass _b, jlong ser) {
5063 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5065 LDKInit* ret = MALLOC(sizeof(LDKInit), "LDKInit");
5066 *ret = Init_read(ser_conv);
5067 assert(!ret->_underlying_ref);
5068 ret->_underlying_ref = true;
5072 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1write(JNIEnv * _env, jclass _b, jlong obj) {
5073 LDKOpenChannel* obj_conv = (LDKOpenChannel*)obj;
5074 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5075 *ret = OpenChannel_write(obj_conv);
5079 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1read(JNIEnv * _env, jclass _b, jlong ser) {
5080 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5082 LDKOpenChannel* ret = MALLOC(sizeof(LDKOpenChannel), "LDKOpenChannel");
5083 *ret = OpenChannel_read(ser_conv);
5084 assert(!ret->_underlying_ref);
5085 ret->_underlying_ref = true;
5089 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1write(JNIEnv * _env, jclass _b, jlong obj) {
5090 LDKRevokeAndACK* obj_conv = (LDKRevokeAndACK*)obj;
5091 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5092 *ret = RevokeAndACK_write(obj_conv);
5096 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1read(JNIEnv * _env, jclass _b, jlong ser) {
5097 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5099 LDKRevokeAndACK* ret = MALLOC(sizeof(LDKRevokeAndACK), "LDKRevokeAndACK");
5100 *ret = RevokeAndACK_read(ser_conv);
5101 assert(!ret->_underlying_ref);
5102 ret->_underlying_ref = true;
5106 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1write(JNIEnv * _env, jclass _b, jlong obj) {
5107 LDKShutdown* obj_conv = (LDKShutdown*)obj;
5108 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5109 *ret = Shutdown_write(obj_conv);
5113 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1read(JNIEnv * _env, jclass _b, jlong ser) {
5114 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5116 LDKShutdown* ret = MALLOC(sizeof(LDKShutdown), "LDKShutdown");
5117 *ret = Shutdown_read(ser_conv);
5118 assert(!ret->_underlying_ref);
5119 ret->_underlying_ref = true;
5123 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
5124 LDKUpdateFailHTLC* obj_conv = (LDKUpdateFailHTLC*)obj;
5125 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5126 *ret = UpdateFailHTLC_write(obj_conv);
5130 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
5131 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5133 LDKUpdateFailHTLC* ret = MALLOC(sizeof(LDKUpdateFailHTLC), "LDKUpdateFailHTLC");
5134 *ret = UpdateFailHTLC_read(ser_conv);
5135 assert(!ret->_underlying_ref);
5136 ret->_underlying_ref = true;
5140 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
5141 LDKUpdateFailMalformedHTLC* obj_conv = (LDKUpdateFailMalformedHTLC*)obj;
5142 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5143 *ret = UpdateFailMalformedHTLC_write(obj_conv);
5147 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
5148 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5150 LDKUpdateFailMalformedHTLC* ret = MALLOC(sizeof(LDKUpdateFailMalformedHTLC), "LDKUpdateFailMalformedHTLC");
5151 *ret = UpdateFailMalformedHTLC_read(ser_conv);
5152 assert(!ret->_underlying_ref);
5153 ret->_underlying_ref = true;
5157 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1write(JNIEnv * _env, jclass _b, jlong obj) {
5158 LDKUpdateFee* obj_conv = (LDKUpdateFee*)obj;
5159 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5160 *ret = UpdateFee_write(obj_conv);
5164 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1read(JNIEnv * _env, jclass _b, jlong ser) {
5165 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5167 LDKUpdateFee* ret = MALLOC(sizeof(LDKUpdateFee), "LDKUpdateFee");
5168 *ret = UpdateFee_read(ser_conv);
5169 assert(!ret->_underlying_ref);
5170 ret->_underlying_ref = true;
5174 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
5175 LDKUpdateFulfillHTLC* obj_conv = (LDKUpdateFulfillHTLC*)obj;
5176 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5177 *ret = UpdateFulfillHTLC_write(obj_conv);
5181 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
5182 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5184 LDKUpdateFulfillHTLC* ret = MALLOC(sizeof(LDKUpdateFulfillHTLC), "LDKUpdateFulfillHTLC");
5185 *ret = UpdateFulfillHTLC_read(ser_conv);
5186 assert(!ret->_underlying_ref);
5187 ret->_underlying_ref = true;
5191 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
5192 LDKUpdateAddHTLC* obj_conv = (LDKUpdateAddHTLC*)obj;
5193 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5194 *ret = UpdateAddHTLC_write(obj_conv);
5198 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
5199 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5201 LDKUpdateAddHTLC* ret = MALLOC(sizeof(LDKUpdateAddHTLC), "LDKUpdateAddHTLC");
5202 *ret = UpdateAddHTLC_read(ser_conv);
5203 assert(!ret->_underlying_ref);
5204 ret->_underlying_ref = true;
5208 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1write(JNIEnv * _env, jclass _b, jlong obj) {
5209 LDKPing* obj_conv = (LDKPing*)obj;
5210 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5211 *ret = Ping_write(obj_conv);
5215 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1read(JNIEnv * _env, jclass _b, jlong ser) {
5216 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5218 LDKPing* ret = MALLOC(sizeof(LDKPing), "LDKPing");
5219 *ret = Ping_read(ser_conv);
5220 assert(!ret->_underlying_ref);
5221 ret->_underlying_ref = true;
5225 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1write(JNIEnv * _env, jclass _b, jlong obj) {
5226 LDKPong* obj_conv = (LDKPong*)obj;
5227 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5228 *ret = Pong_write(obj_conv);
5232 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1read(JNIEnv * _env, jclass _b, jlong ser) {
5233 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5235 LDKPong* ret = MALLOC(sizeof(LDKPong), "LDKPong");
5236 *ret = Pong_read(ser_conv);
5237 assert(!ret->_underlying_ref);
5238 ret->_underlying_ref = true;
5242 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
5243 LDKUnsignedChannelAnnouncement* obj_conv = (LDKUnsignedChannelAnnouncement*)obj;
5244 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5245 *ret = UnsignedChannelAnnouncement_write(obj_conv);
5249 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
5250 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5252 LDKUnsignedChannelAnnouncement* ret = MALLOC(sizeof(LDKUnsignedChannelAnnouncement), "LDKUnsignedChannelAnnouncement");
5253 *ret = UnsignedChannelAnnouncement_read(ser_conv);
5254 assert(!ret->_underlying_ref);
5255 ret->_underlying_ref = true;
5259 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
5260 LDKChannelAnnouncement* obj_conv = (LDKChannelAnnouncement*)obj;
5261 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5262 *ret = ChannelAnnouncement_write(obj_conv);
5266 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
5267 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5269 LDKChannelAnnouncement* ret = MALLOC(sizeof(LDKChannelAnnouncement), "LDKChannelAnnouncement");
5270 *ret = ChannelAnnouncement_read(ser_conv);
5271 assert(!ret->_underlying_ref);
5272 ret->_underlying_ref = true;
5276 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
5277 LDKUnsignedChannelUpdate* obj_conv = (LDKUnsignedChannelUpdate*)obj;
5278 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5279 *ret = UnsignedChannelUpdate_write(obj_conv);
5283 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
5284 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5286 LDKUnsignedChannelUpdate* ret = MALLOC(sizeof(LDKUnsignedChannelUpdate), "LDKUnsignedChannelUpdate");
5287 *ret = UnsignedChannelUpdate_read(ser_conv);
5288 assert(!ret->_underlying_ref);
5289 ret->_underlying_ref = true;
5293 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
5294 LDKChannelUpdate* obj_conv = (LDKChannelUpdate*)obj;
5295 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5296 *ret = ChannelUpdate_write(obj_conv);
5300 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
5301 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5303 LDKChannelUpdate* ret = MALLOC(sizeof(LDKChannelUpdate), "LDKChannelUpdate");
5304 *ret = ChannelUpdate_read(ser_conv);
5305 assert(!ret->_underlying_ref);
5306 ret->_underlying_ref = true;
5310 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1write(JNIEnv * _env, jclass _b, jlong obj) {
5311 LDKErrorMessage* obj_conv = (LDKErrorMessage*)obj;
5312 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5313 *ret = ErrorMessage_write(obj_conv);
5317 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1read(JNIEnv * _env, jclass _b, jlong ser) {
5318 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5320 LDKErrorMessage* ret = MALLOC(sizeof(LDKErrorMessage), "LDKErrorMessage");
5321 *ret = ErrorMessage_read(ser_conv);
5322 assert(!ret->_underlying_ref);
5323 ret->_underlying_ref = true;
5327 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
5328 LDKUnsignedNodeAnnouncement* obj_conv = (LDKUnsignedNodeAnnouncement*)obj;
5329 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5330 *ret = UnsignedNodeAnnouncement_write(obj_conv);
5334 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
5335 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5337 LDKUnsignedNodeAnnouncement* ret = MALLOC(sizeof(LDKUnsignedNodeAnnouncement), "LDKUnsignedNodeAnnouncement");
5338 *ret = UnsignedNodeAnnouncement_read(ser_conv);
5339 assert(!ret->_underlying_ref);
5340 ret->_underlying_ref = true;
5344 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
5345 LDKNodeAnnouncement* obj_conv = (LDKNodeAnnouncement*)obj;
5346 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5347 *ret = NodeAnnouncement_write(obj_conv);
5351 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
5352 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5354 LDKNodeAnnouncement* ret = MALLOC(sizeof(LDKNodeAnnouncement), "LDKNodeAnnouncement");
5355 *ret = NodeAnnouncement_read(ser_conv);
5356 assert(!ret->_underlying_ref);
5357 ret->_underlying_ref = true;
5361 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5362 LDKMessageHandler this_ptr_conv = *(LDKMessageHandler*)this_ptr;
5363 FREE((void*)this_ptr);
5364 this_ptr_conv._underlying_ref = false;
5365 return MessageHandler_free(this_ptr_conv);
5368 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1chan_1handler(JNIEnv * _env, jclass _b, jlong this_ptr) {
5369 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
5370 long ret = (long)MessageHandler_get_chan_handler(this_ptr_conv);
5374 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1chan_1handler(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5375 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
5376 LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)val;
5377 LDKChannelMessageHandler_JCalls_clone(val_conv.this_arg);
5378 return MessageHandler_set_chan_handler(this_ptr_conv, val_conv);
5381 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1route_1handler(JNIEnv * _env, jclass _b, jlong this_ptr) {
5382 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
5383 long ret = (long)MessageHandler_get_route_handler(this_ptr_conv);
5387 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1route_1handler(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5388 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
5389 LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)val;
5390 LDKRoutingMessageHandler_JCalls_clone(val_conv.this_arg);
5391 return MessageHandler_set_route_handler(this_ptr_conv, val_conv);
5394 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new(JNIEnv * _env, jclass _b, jlong chan_handler_arg, jlong route_handler_arg) {
5395 LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)chan_handler_arg;
5396 LDKChannelMessageHandler_JCalls_clone(chan_handler_arg_conv.this_arg);
5397 LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)route_handler_arg;
5398 LDKRoutingMessageHandler_JCalls_clone(route_handler_arg_conv.this_arg);
5399 LDKMessageHandler* ret = MALLOC(sizeof(LDKMessageHandler), "LDKMessageHandler");
5400 *ret = MessageHandler_new(chan_handler_arg_conv, route_handler_arg_conv);
5401 assert(!ret->_underlying_ref);
5402 ret->_underlying_ref = true;
5406 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5407 LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)this_ptr;
5408 FREE((void*)this_ptr);
5409 return SocketDescriptor_free(this_ptr_conv);
5412 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5413 LDKPeerHandleError this_ptr_conv = *(LDKPeerHandleError*)this_ptr;
5414 FREE((void*)this_ptr);
5415 this_ptr_conv._underlying_ref = false;
5416 return PeerHandleError_free(this_ptr_conv);
5419 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1get_1no_1connection_1possible(JNIEnv * _env, jclass _b, jlong this_ptr) {
5420 LDKPeerHandleError* this_ptr_conv = (LDKPeerHandleError*)this_ptr;
5421 return PeerHandleError_get_no_connection_possible(this_ptr_conv);
5424 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1set_1no_1connection_1possible(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
5425 LDKPeerHandleError* this_ptr_conv = (LDKPeerHandleError*)this_ptr;
5426 return PeerHandleError_set_no_connection_possible(this_ptr_conv, val);
5429 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new(JNIEnv * _env, jclass _b, jboolean no_connection_possible_arg) {
5430 LDKPeerHandleError* ret = MALLOC(sizeof(LDKPeerHandleError), "LDKPeerHandleError");
5431 *ret = PeerHandleError_new(no_connection_possible_arg);
5432 assert(!ret->_underlying_ref);
5433 ret->_underlying_ref = true;
5437 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5438 LDKPeerManager this_ptr_conv = *(LDKPeerManager*)this_ptr;
5439 FREE((void*)this_ptr);
5440 this_ptr_conv._underlying_ref = false;
5441 return PeerManager_free(this_ptr_conv);
5444 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) {
5445 LDKMessageHandler message_handler_conv = *(LDKMessageHandler*)message_handler;
5446 FREE((void*)message_handler);
5447 message_handler_conv._underlying_ref = false;
5448 LDKSecretKey our_node_secret_conv = *(LDKSecretKey*)our_node_secret;
5449 FREE((void*)our_node_secret);
5450 unsigned char ephemeral_random_data_arr[32];
5451 (*_env)->GetByteArrayRegion (_env, ephemeral_random_data, 0, 32, ephemeral_random_data_arr);
5452 unsigned char (*ephemeral_random_data_ref)[32] = &ephemeral_random_data_arr;
5453 LDKLogger logger_conv = *(LDKLogger*)logger;
5454 LDKLogger_JCalls_clone(logger_conv.this_arg);
5455 LDKPeerManager* ret = MALLOC(sizeof(LDKPeerManager), "LDKPeerManager");
5456 *ret = PeerManager_new(message_handler_conv, our_node_secret_conv, ephemeral_random_data_ref, logger_conv);
5457 assert(!ret->_underlying_ref);
5458 ret->_underlying_ref = true;
5462 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1get_1peer_1node_1ids(JNIEnv * _env, jclass _b, jlong this_arg) {
5463 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
5464 LDKCVec_PublicKeyZ* ret = MALLOC(sizeof(LDKCVec_PublicKeyZ), "LDKCVec_PublicKeyZ");
5465 *ret = PeerManager_get_peer_node_ids(this_arg_conv);
5469 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) {
5470 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
5471 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
5472 FREE((void*)their_node_id);
5473 LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)descriptor;
5474 LDKSocketDescriptor_JCalls_clone(descriptor_conv.this_arg);
5475 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
5476 *ret = PeerManager_new_outbound_connection(this_arg_conv, their_node_id_conv, descriptor_conv);
5480 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1inbound_1connection(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) {
5481 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
5482 LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)descriptor;
5483 LDKSocketDescriptor_JCalls_clone(descriptor_conv.this_arg);
5484 LDKCResult_NonePeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
5485 *ret = PeerManager_new_inbound_connection(this_arg_conv, descriptor_conv);
5489 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1write_1buffer_1space_1avail(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) {
5490 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
5491 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor;
5492 LDKCResult_NonePeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
5493 *ret = PeerManager_write_buffer_space_avail(this_arg_conv, descriptor_conv);
5497 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1read_1event(JNIEnv * _env, jclass _b, jlong this_arg, jlong peer_descriptor, jlong data) {
5498 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
5499 LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor;
5500 LDKu8slice data_conv = *(LDKu8slice*)data;
5502 LDKCResult_boolPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
5503 *ret = PeerManager_read_event(this_arg_conv, peer_descriptor_conv, data_conv);
5507 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1process_1events(JNIEnv * _env, jclass _b, jlong this_arg) {
5508 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
5509 return PeerManager_process_events(this_arg_conv);
5512 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1socket_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) {
5513 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
5514 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor;
5515 return PeerManager_socket_disconnected(this_arg_conv, descriptor_conv);
5518 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1timer_1tick_1occured(JNIEnv * _env, jclass _b, jlong this_arg) {
5519 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
5520 return PeerManager_timer_tick_occured(this_arg_conv);
5523 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_build_1commitment_1secret(JNIEnv * _env, jclass _b, jbyteArray commitment_seed, jlong idx) {
5524 unsigned char commitment_seed_arr[32];
5525 (*_env)->GetByteArrayRegion (_env, commitment_seed, 0, 32, commitment_seed_arr);
5526 unsigned char (*commitment_seed_ref)[32] = &commitment_seed_arr;
5527 LDKThirtyTwoBytes* ret = MALLOC(sizeof(LDKThirtyTwoBytes), "LDKThirtyTwoBytes");
5528 *ret = build_commitment_secret(commitment_seed_ref, idx);
5532 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5533 LDKTxCreationKeys this_ptr_conv = *(LDKTxCreationKeys*)this_ptr;
5534 FREE((void*)this_ptr);
5535 this_ptr_conv._underlying_ref = false;
5536 return TxCreationKeys_free(this_ptr_conv);
5539 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
5540 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
5541 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5542 *ret = TxCreationKeys_get_per_commitment_point(this_ptr_conv);
5546 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5547 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
5548 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5550 return TxCreationKeys_set_per_commitment_point(this_ptr_conv, val_conv);
5553 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1revocation_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
5554 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
5555 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5556 *ret = TxCreationKeys_get_revocation_key(this_ptr_conv);
5560 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1revocation_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5561 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
5562 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5564 return TxCreationKeys_set_revocation_key(this_ptr_conv, val_conv);
5567 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1a_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
5568 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
5569 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5570 *ret = TxCreationKeys_get_a_htlc_key(this_ptr_conv);
5574 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1a_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5575 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
5576 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5578 return TxCreationKeys_set_a_htlc_key(this_ptr_conv, val_conv);
5581 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1b_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
5582 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
5583 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5584 *ret = TxCreationKeys_get_b_htlc_key(this_ptr_conv);
5588 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1b_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5589 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
5590 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5592 return TxCreationKeys_set_b_htlc_key(this_ptr_conv, val_conv);
5595 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1a_1delayed_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
5596 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
5597 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5598 *ret = TxCreationKeys_get_a_delayed_payment_key(this_ptr_conv);
5602 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1a_1delayed_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5603 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
5604 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5606 return TxCreationKeys_set_a_delayed_payment_key(this_ptr_conv, val_conv);
5609 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1new(JNIEnv * _env, jclass _b, jlong per_commitment_point_arg, jlong revocation_key_arg, jlong a_htlc_key_arg, jlong b_htlc_key_arg, jlong a_delayed_payment_key_arg) {
5610 LDKPublicKey per_commitment_point_arg_conv = *(LDKPublicKey*)per_commitment_point_arg;
5611 FREE((void*)per_commitment_point_arg);
5612 LDKPublicKey revocation_key_arg_conv = *(LDKPublicKey*)revocation_key_arg;
5613 FREE((void*)revocation_key_arg);
5614 LDKPublicKey a_htlc_key_arg_conv = *(LDKPublicKey*)a_htlc_key_arg;
5615 FREE((void*)a_htlc_key_arg);
5616 LDKPublicKey b_htlc_key_arg_conv = *(LDKPublicKey*)b_htlc_key_arg;
5617 FREE((void*)b_htlc_key_arg);
5618 LDKPublicKey a_delayed_payment_key_arg_conv = *(LDKPublicKey*)a_delayed_payment_key_arg;
5619 FREE((void*)a_delayed_payment_key_arg);
5620 LDKTxCreationKeys* ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
5621 *ret = TxCreationKeys_new(per_commitment_point_arg_conv, revocation_key_arg_conv, a_htlc_key_arg_conv, b_htlc_key_arg_conv, a_delayed_payment_key_arg_conv);
5622 assert(!ret->_underlying_ref);
5623 ret->_underlying_ref = true;
5627 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1write(JNIEnv * _env, jclass _b, jlong obj) {
5628 LDKTxCreationKeys* obj_conv = (LDKTxCreationKeys*)obj;
5629 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5630 *ret = TxCreationKeys_write(obj_conv);
5634 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1read(JNIEnv * _env, jclass _b, jlong ser) {
5635 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5637 LDKTxCreationKeys* ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
5638 *ret = TxCreationKeys_read(ser_conv);
5639 assert(!ret->_underlying_ref);
5640 ret->_underlying_ref = true;
5644 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5645 LDKPreCalculatedTxCreationKeys this_ptr_conv = *(LDKPreCalculatedTxCreationKeys*)this_ptr;
5646 FREE((void*)this_ptr);
5647 this_ptr_conv._underlying_ref = false;
5648 return PreCalculatedTxCreationKeys_free(this_ptr_conv);
5651 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1new(JNIEnv * _env, jclass _b, jlong keys) {
5652 LDKTxCreationKeys keys_conv = *(LDKTxCreationKeys*)keys;
5654 keys_conv._underlying_ref = false;
5655 LDKPreCalculatedTxCreationKeys* ret = MALLOC(sizeof(LDKPreCalculatedTxCreationKeys), "LDKPreCalculatedTxCreationKeys");
5656 *ret = PreCalculatedTxCreationKeys_new(keys_conv);
5657 assert(!ret->_underlying_ref);
5658 ret->_underlying_ref = true;
5662 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1trust_1key_1derivation(JNIEnv * _env, jclass _b, jlong this_arg) {
5663 LDKPreCalculatedTxCreationKeys* this_arg_conv = (LDKPreCalculatedTxCreationKeys*)this_arg;
5664 LDKTxCreationKeys* ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
5665 *ret = PreCalculatedTxCreationKeys_trust_key_derivation(this_arg_conv);
5666 assert(!ret->_underlying_ref);
5667 ret->_underlying_ref = true;
5671 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_arg) {
5672 LDKPreCalculatedTxCreationKeys* this_arg_conv = (LDKPreCalculatedTxCreationKeys*)this_arg;
5673 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5674 *ret = PreCalculatedTxCreationKeys_per_commitment_point(this_arg_conv);
5678 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5679 LDKChannelPublicKeys this_ptr_conv = *(LDKChannelPublicKeys*)this_ptr;
5680 FREE((void*)this_ptr);
5681 this_ptr_conv._underlying_ref = false;
5682 return ChannelPublicKeys_free(this_ptr_conv);
5685 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
5686 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
5687 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5688 *ret = ChannelPublicKeys_get_funding_pubkey(this_ptr_conv);
5692 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5693 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
5694 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5696 return ChannelPublicKeys_set_funding_pubkey(this_ptr_conv, val_conv);
5699 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
5700 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
5701 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5702 *ret = ChannelPublicKeys_get_revocation_basepoint(this_ptr_conv);
5706 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5707 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
5708 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5710 return ChannelPublicKeys_set_revocation_basepoint(this_ptr_conv, val_conv);
5713 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
5714 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
5715 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5716 *ret = ChannelPublicKeys_get_payment_point(this_ptr_conv);
5720 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5721 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
5722 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5724 return ChannelPublicKeys_set_payment_point(this_ptr_conv, val_conv);
5727 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
5728 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
5729 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5730 *ret = ChannelPublicKeys_get_delayed_payment_basepoint(this_ptr_conv);
5734 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5735 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
5736 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5738 return ChannelPublicKeys_set_delayed_payment_basepoint(this_ptr_conv, val_conv);
5741 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
5742 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
5743 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
5744 *ret = ChannelPublicKeys_get_htlc_basepoint(this_ptr_conv);
5748 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5749 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
5750 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5752 return ChannelPublicKeys_set_htlc_basepoint(this_ptr_conv, val_conv);
5755 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) {
5756 LDKPublicKey funding_pubkey_arg_conv = *(LDKPublicKey*)funding_pubkey_arg;
5757 FREE((void*)funding_pubkey_arg);
5758 LDKPublicKey revocation_basepoint_arg_conv = *(LDKPublicKey*)revocation_basepoint_arg;
5759 FREE((void*)revocation_basepoint_arg);
5760 LDKPublicKey payment_point_arg_conv = *(LDKPublicKey*)payment_point_arg;
5761 FREE((void*)payment_point_arg);
5762 LDKPublicKey delayed_payment_basepoint_arg_conv = *(LDKPublicKey*)delayed_payment_basepoint_arg;
5763 FREE((void*)delayed_payment_basepoint_arg);
5764 LDKPublicKey htlc_basepoint_arg_conv = *(LDKPublicKey*)htlc_basepoint_arg;
5765 FREE((void*)htlc_basepoint_arg);
5766 LDKChannelPublicKeys* ret = MALLOC(sizeof(LDKChannelPublicKeys), "LDKChannelPublicKeys");
5767 *ret = ChannelPublicKeys_new(funding_pubkey_arg_conv, revocation_basepoint_arg_conv, payment_point_arg_conv, delayed_payment_basepoint_arg_conv, htlc_basepoint_arg_conv);
5768 assert(!ret->_underlying_ref);
5769 ret->_underlying_ref = true;
5773 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1write(JNIEnv * _env, jclass _b, jlong obj) {
5774 LDKChannelPublicKeys* obj_conv = (LDKChannelPublicKeys*)obj;
5775 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5776 *ret = ChannelPublicKeys_write(obj_conv);
5780 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1read(JNIEnv * _env, jclass _b, jlong ser) {
5781 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5783 LDKChannelPublicKeys* ret = MALLOC(sizeof(LDKChannelPublicKeys), "LDKChannelPublicKeys");
5784 *ret = ChannelPublicKeys_read(ser_conv);
5785 assert(!ret->_underlying_ref);
5786 ret->_underlying_ref = true;
5790 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1derive_1new(JNIEnv * _env, jclass _b, jlong per_commitment_point, jlong a_delayed_payment_base, jlong a_htlc_base, jlong b_revocation_base, jlong b_htlc_base) {
5791 LDKPublicKey per_commitment_point_conv = *(LDKPublicKey*)per_commitment_point;
5792 FREE((void*)per_commitment_point);
5793 LDKPublicKey a_delayed_payment_base_conv = *(LDKPublicKey*)a_delayed_payment_base;
5794 FREE((void*)a_delayed_payment_base);
5795 LDKPublicKey a_htlc_base_conv = *(LDKPublicKey*)a_htlc_base;
5796 FREE((void*)a_htlc_base);
5797 LDKPublicKey b_revocation_base_conv = *(LDKPublicKey*)b_revocation_base;
5798 FREE((void*)b_revocation_base);
5799 LDKPublicKey b_htlc_base_conv = *(LDKPublicKey*)b_htlc_base;
5800 FREE((void*)b_htlc_base);
5801 LDKCResult_TxCreationKeysSecpErrorZ* ret = MALLOC(sizeof(LDKCResult_TxCreationKeysSecpErrorZ), "LDKCResult_TxCreationKeysSecpErrorZ");
5802 *ret = TxCreationKeys_derive_new(per_commitment_point_conv, a_delayed_payment_base_conv, a_htlc_base_conv, b_revocation_base_conv, b_htlc_base_conv);
5806 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_get_1revokeable_1redeemscript(JNIEnv * _env, jclass _b, jlong revocation_key, jshort to_self_delay, jlong delayed_payment_key) {
5807 LDKPublicKey revocation_key_conv = *(LDKPublicKey*)revocation_key;
5808 FREE((void*)revocation_key);
5809 LDKPublicKey delayed_payment_key_conv = *(LDKPublicKey*)delayed_payment_key;
5810 FREE((void*)delayed_payment_key);
5811 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5812 *ret = get_revokeable_redeemscript(revocation_key_conv, to_self_delay, delayed_payment_key_conv);
5816 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5817 LDKHTLCOutputInCommitment this_ptr_conv = *(LDKHTLCOutputInCommitment*)this_ptr;
5818 FREE((void*)this_ptr);
5819 this_ptr_conv._underlying_ref = false;
5820 return HTLCOutputInCommitment_free(this_ptr_conv);
5823 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1offered(JNIEnv * _env, jclass _b, jlong this_ptr) {
5824 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
5825 return HTLCOutputInCommitment_get_offered(this_ptr_conv);
5828 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1offered(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
5829 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
5830 return HTLCOutputInCommitment_set_offered(this_ptr_conv, val);
5833 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
5834 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
5835 return HTLCOutputInCommitment_get_amount_msat(this_ptr_conv);
5838 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5839 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
5840 return HTLCOutputInCommitment_set_amount_msat(this_ptr_conv, val);
5843 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr) {
5844 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
5845 return HTLCOutputInCommitment_get_cltv_expiry(this_ptr_conv);
5848 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5849 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
5850 return HTLCOutputInCommitment_set_cltv_expiry(this_ptr_conv, val);
5853 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
5854 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
5855 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5856 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *HTLCOutputInCommitment_get_payment_hash(this_ptr_conv));
5860 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5861 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
5862 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5864 return HTLCOutputInCommitment_set_payment_hash(this_ptr_conv, val_conv);
5867 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1write(JNIEnv * _env, jclass _b, jlong obj) {
5868 LDKHTLCOutputInCommitment* obj_conv = (LDKHTLCOutputInCommitment*)obj;
5869 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5870 *ret = HTLCOutputInCommitment_write(obj_conv);
5874 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1read(JNIEnv * _env, jclass _b, jlong ser) {
5875 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5877 LDKHTLCOutputInCommitment* ret = MALLOC(sizeof(LDKHTLCOutputInCommitment), "LDKHTLCOutputInCommitment");
5878 *ret = HTLCOutputInCommitment_read(ser_conv);
5879 assert(!ret->_underlying_ref);
5880 ret->_underlying_ref = true;
5884 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_get_1htlc_1redeemscript(JNIEnv * _env, jclass _b, jlong htlc, jlong keys) {
5885 LDKHTLCOutputInCommitment* htlc_conv = (LDKHTLCOutputInCommitment*)htlc;
5886 LDKTxCreationKeys* keys_conv = (LDKTxCreationKeys*)keys;
5887 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5888 *ret = get_htlc_redeemscript(htlc_conv, keys_conv);
5892 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_make_1funding_1redeemscript(JNIEnv * _env, jclass _b, jlong a, jlong b) {
5893 LDKPublicKey a_conv = *(LDKPublicKey*)a;
5895 LDKPublicKey b_conv = *(LDKPublicKey*)b;
5897 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5898 *ret = make_funding_redeemscript(a_conv, b_conv);
5902 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_build_1htlc_1transaction(JNIEnv * _env, jclass _b, jbyteArray prev_hash, jint feerate_per_kw, jshort to_self_delay, jlong htlc, jlong a_delayed_payment_key, jlong revocation_key) {
5903 unsigned char prev_hash_arr[32];
5904 (*_env)->GetByteArrayRegion (_env, prev_hash, 0, 32, prev_hash_arr);
5905 unsigned char (*prev_hash_ref)[32] = &prev_hash_arr;
5906 LDKHTLCOutputInCommitment* htlc_conv = (LDKHTLCOutputInCommitment*)htlc;
5907 LDKPublicKey a_delayed_payment_key_conv = *(LDKPublicKey*)a_delayed_payment_key;
5908 FREE((void*)a_delayed_payment_key);
5909 LDKPublicKey revocation_key_conv = *(LDKPublicKey*)revocation_key;
5910 FREE((void*)revocation_key);
5911 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5912 *ret = build_htlc_transaction(prev_hash_ref, feerate_per_kw, to_self_delay, htlc_conv, a_delayed_payment_key_conv, revocation_key_conv);
5916 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5917 LDKLocalCommitmentTransaction this_ptr_conv = *(LDKLocalCommitmentTransaction*)this_ptr;
5918 FREE((void*)this_ptr);
5919 this_ptr_conv._underlying_ref = false;
5920 return LocalCommitmentTransaction_free(this_ptr_conv);
5923 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1get_1unsigned_1tx(JNIEnv * _env, jclass _b, jlong this_ptr) {
5924 LDKLocalCommitmentTransaction* this_ptr_conv = (LDKLocalCommitmentTransaction*)this_ptr;
5925 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5926 *ret = LocalCommitmentTransaction_get_unsigned_tx(this_ptr_conv);
5930 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1set_1unsigned_1tx(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5931 LDKLocalCommitmentTransaction* this_ptr_conv = (LDKLocalCommitmentTransaction*)this_ptr;
5932 LDKCVec_u8Z val_conv = *(LDKCVec_u8Z*)val;
5934 return LocalCommitmentTransaction_set_unsigned_tx(this_ptr_conv, val_conv);
5937 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1get_1their_1sig(JNIEnv * _env, jclass _b, jlong this_ptr) {
5938 LDKLocalCommitmentTransaction* this_ptr_conv = (LDKLocalCommitmentTransaction*)this_ptr;
5939 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
5940 *ret = LocalCommitmentTransaction_get_their_sig(this_ptr_conv);
5944 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1set_1their_1sig(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5945 LDKLocalCommitmentTransaction* this_ptr_conv = (LDKLocalCommitmentTransaction*)this_ptr;
5946 LDKSignature val_conv = *(LDKSignature*)val;
5948 return LocalCommitmentTransaction_set_their_sig(this_ptr_conv, val_conv);
5951 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1get_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr) {
5952 LDKLocalCommitmentTransaction* this_ptr_conv = (LDKLocalCommitmentTransaction*)this_ptr;
5953 return LocalCommitmentTransaction_get_feerate_per_kw(this_ptr_conv);
5956 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1set_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5957 LDKLocalCommitmentTransaction* this_ptr_conv = (LDKLocalCommitmentTransaction*)this_ptr;
5958 return LocalCommitmentTransaction_set_feerate_per_kw(this_ptr_conv, val);
5961 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1set_1per_1htlc(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5962 LDKLocalCommitmentTransaction* this_ptr_conv = (LDKLocalCommitmentTransaction*)this_ptr;
5963 LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ val_conv = *(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ*)val;
5965 return LocalCommitmentTransaction_set_per_htlc(this_ptr_conv, val_conv);
5968 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1new_1missing_1local_1sig(JNIEnv * _env, jclass _b, jlong unsigned_tx, jlong their_sig, jlong our_funding_key, jlong their_funding_key, jlong local_keys, jint feerate_per_kw, jlong htlc_data) {
5969 LDKCVec_u8Z unsigned_tx_conv = *(LDKCVec_u8Z*)unsigned_tx;
5970 FREE((void*)unsigned_tx);
5971 LDKSignature their_sig_conv = *(LDKSignature*)their_sig;
5972 FREE((void*)their_sig);
5973 LDKPublicKey our_funding_key_conv = *(LDKPublicKey*)our_funding_key;
5974 FREE((void*)our_funding_key);
5975 LDKPublicKey their_funding_key_conv = *(LDKPublicKey*)their_funding_key;
5976 FREE((void*)their_funding_key);
5977 LDKTxCreationKeys local_keys_conv = *(LDKTxCreationKeys*)local_keys;
5978 FREE((void*)local_keys);
5979 local_keys_conv._underlying_ref = false;
5980 LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ htlc_data_conv = *(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ*)htlc_data;
5981 FREE((void*)htlc_data);
5982 LDKLocalCommitmentTransaction* ret = MALLOC(sizeof(LDKLocalCommitmentTransaction), "LDKLocalCommitmentTransaction");
5983 *ret = LocalCommitmentTransaction_new_missing_local_sig(unsigned_tx_conv, their_sig_conv, our_funding_key_conv, their_funding_key_conv, local_keys_conv, feerate_per_kw, htlc_data_conv);
5984 assert(!ret->_underlying_ref);
5985 ret->_underlying_ref = true;
5989 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1trust_1key_1derivation(JNIEnv * _env, jclass _b, jlong this_arg) {
5990 LDKLocalCommitmentTransaction* this_arg_conv = (LDKLocalCommitmentTransaction*)this_arg;
5991 LDKTxCreationKeys* ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
5992 *ret = LocalCommitmentTransaction_trust_key_derivation(this_arg_conv);
5993 assert(!ret->_underlying_ref);
5994 ret->_underlying_ref = true;
5998 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1txid(JNIEnv * _env, jclass _b, jlong this_arg) {
5999 LDKLocalCommitmentTransaction* this_arg_conv = (LDKLocalCommitmentTransaction*)this_arg;
6000 LDKThirtyTwoBytes* ret = MALLOC(sizeof(LDKThirtyTwoBytes), "LDKThirtyTwoBytes");
6001 *ret = LocalCommitmentTransaction_txid(this_arg_conv);
6005 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1get_1local_1sig(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray funding_key, jlong funding_redeemscript, jlong channel_value_satoshis) {
6006 LDKLocalCommitmentTransaction* this_arg_conv = (LDKLocalCommitmentTransaction*)this_arg;
6007 unsigned char funding_key_arr[32];
6008 (*_env)->GetByteArrayRegion (_env, funding_key, 0, 32, funding_key_arr);
6009 unsigned char (*funding_key_ref)[32] = &funding_key_arr;
6010 LDKu8slice funding_redeemscript_conv = *(LDKu8slice*)funding_redeemscript;
6011 FREE((void*)funding_redeemscript);
6012 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
6013 *ret = LocalCommitmentTransaction_get_local_sig(this_arg_conv, funding_key_ref, funding_redeemscript_conv, channel_value_satoshis);
6017 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1get_1htlc_1sigs(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray htlc_base_key, jshort local_csv) {
6018 LDKLocalCommitmentTransaction* this_arg_conv = (LDKLocalCommitmentTransaction*)this_arg;
6019 unsigned char htlc_base_key_arr[32];
6020 (*_env)->GetByteArrayRegion (_env, htlc_base_key, 0, 32, htlc_base_key_arr);
6021 unsigned char (*htlc_base_key_ref)[32] = &htlc_base_key_arr;
6022 LDKCResult_CVec_SignatureZNoneZ* ret = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
6023 *ret = LocalCommitmentTransaction_get_htlc_sigs(this_arg_conv, htlc_base_key_ref, local_csv);
6027 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1write(JNIEnv * _env, jclass _b, jlong obj) {
6028 LDKLocalCommitmentTransaction* obj_conv = (LDKLocalCommitmentTransaction*)obj;
6029 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6030 *ret = LocalCommitmentTransaction_write(obj_conv);
6034 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1read(JNIEnv * _env, jclass _b, jlong ser) {
6035 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6037 LDKLocalCommitmentTransaction* ret = MALLOC(sizeof(LDKLocalCommitmentTransaction), "LDKLocalCommitmentTransaction");
6038 *ret = LocalCommitmentTransaction_read(ser_conv);
6039 assert(!ret->_underlying_ref);
6040 ret->_underlying_ref = true;
6044 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6045 LDKInitFeatures this_ptr_conv = *(LDKInitFeatures*)this_ptr;
6046 FREE((void*)this_ptr);
6047 this_ptr_conv._underlying_ref = false;
6048 return InitFeatures_free(this_ptr_conv);
6051 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6052 LDKNodeFeatures this_ptr_conv = *(LDKNodeFeatures*)this_ptr;
6053 FREE((void*)this_ptr);
6054 this_ptr_conv._underlying_ref = false;
6055 return NodeFeatures_free(this_ptr_conv);
6058 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6059 LDKChannelFeatures this_ptr_conv = *(LDKChannelFeatures*)this_ptr;
6060 FREE((void*)this_ptr);
6061 this_ptr_conv._underlying_ref = false;
6062 return ChannelFeatures_free(this_ptr_conv);
6065 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6066 LDKRouteHop this_ptr_conv = *(LDKRouteHop*)this_ptr;
6067 FREE((void*)this_ptr);
6068 this_ptr_conv._underlying_ref = false;
6069 return RouteHop_free(this_ptr_conv);
6072 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
6073 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6074 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6075 *ret = RouteHop_get_pubkey(this_ptr_conv);
6079 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6080 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6081 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6083 return RouteHop_set_pubkey(this_ptr_conv, val_conv);
6086 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6087 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6088 return RouteHop_get_short_channel_id(this_ptr_conv);
6091 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6092 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6093 return RouteHop_set_short_channel_id(this_ptr_conv, val);
6096 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1fee_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
6097 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6098 return RouteHop_get_fee_msat(this_ptr_conv);
6101 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1fee_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6102 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6103 return RouteHop_set_fee_msat(this_ptr_conv, val);
6106 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
6107 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6108 return RouteHop_get_cltv_expiry_delta(this_ptr_conv);
6111 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6112 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6113 return RouteHop_set_cltv_expiry_delta(this_ptr_conv, val);
6116 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6117 LDKRoute this_ptr_conv = *(LDKRoute*)this_ptr;
6118 FREE((void*)this_ptr);
6119 this_ptr_conv._underlying_ref = false;
6120 return Route_free(this_ptr_conv);
6123 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1paths(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6124 LDKRoute* this_ptr_conv = (LDKRoute*)this_ptr;
6125 LDKCVec_CVec_RouteHopZZ val_conv = *(LDKCVec_CVec_RouteHopZZ*)val;
6127 return Route_set_paths(this_ptr_conv, val_conv);
6130 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv * _env, jclass _b, jlong paths_arg) {
6131 LDKCVec_CVec_RouteHopZZ paths_arg_conv = *(LDKCVec_CVec_RouteHopZZ*)paths_arg;
6132 FREE((void*)paths_arg);
6133 LDKRoute* ret = MALLOC(sizeof(LDKRoute), "LDKRoute");
6134 *ret = Route_new(paths_arg_conv);
6135 assert(!ret->_underlying_ref);
6136 ret->_underlying_ref = true;
6140 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1write(JNIEnv * _env, jclass _b, jlong obj) {
6141 LDKRoute* obj_conv = (LDKRoute*)obj;
6142 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6143 *ret = Route_write(obj_conv);
6147 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1read(JNIEnv * _env, jclass _b, jlong ser) {
6148 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6150 LDKRoute* ret = MALLOC(sizeof(LDKRoute), "LDKRoute");
6151 *ret = Route_read(ser_conv);
6152 assert(!ret->_underlying_ref);
6153 ret->_underlying_ref = true;
6157 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6158 LDKRouteHint this_ptr_conv = *(LDKRouteHint*)this_ptr;
6159 FREE((void*)this_ptr);
6160 this_ptr_conv._underlying_ref = false;
6161 return RouteHint_free(this_ptr_conv);
6164 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1src_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6165 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6166 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6167 *ret = RouteHint_get_src_node_id(this_ptr_conv);
6171 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1src_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6172 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6173 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6175 return RouteHint_set_src_node_id(this_ptr_conv, val_conv);
6178 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6179 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6180 return RouteHint_get_short_channel_id(this_ptr_conv);
6183 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6184 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6185 return RouteHint_set_short_channel_id(this_ptr_conv, val);
6188 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1fees(JNIEnv * _env, jclass _b, jlong this_ptr) {
6189 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6190 LDKRoutingFees* ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
6191 *ret = RouteHint_get_fees(this_ptr_conv);
6192 assert(!ret->_underlying_ref);
6193 ret->_underlying_ref = true;
6197 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1fees(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6198 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6199 LDKRoutingFees val_conv = *(LDKRoutingFees*)val;
6201 val_conv._underlying_ref = false;
6202 return RouteHint_set_fees(this_ptr_conv, val_conv);
6205 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
6206 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6207 return RouteHint_get_cltv_expiry_delta(this_ptr_conv);
6210 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
6211 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6212 return RouteHint_set_cltv_expiry_delta(this_ptr_conv, val);
6215 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
6216 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6217 return RouteHint_get_htlc_minimum_msat(this_ptr_conv);
6220 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6221 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6222 return RouteHint_set_htlc_minimum_msat(this_ptr_conv, val);
6225 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) {
6226 LDKPublicKey src_node_id_arg_conv = *(LDKPublicKey*)src_node_id_arg;
6227 FREE((void*)src_node_id_arg);
6228 LDKRoutingFees fees_arg_conv = *(LDKRoutingFees*)fees_arg;
6229 FREE((void*)fees_arg);
6230 fees_arg_conv._underlying_ref = false;
6231 LDKRouteHint* ret = MALLOC(sizeof(LDKRouteHint), "LDKRouteHint");
6232 *ret = RouteHint_new(src_node_id_arg_conv, short_channel_id_arg, fees_arg_conv, cltv_expiry_delta_arg, htlc_minimum_msat_arg);
6233 assert(!ret->_underlying_ref);
6234 ret->_underlying_ref = true;
6238 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) {
6239 LDKPublicKey our_node_id_conv = *(LDKPublicKey*)our_node_id;
6240 FREE((void*)our_node_id);
6241 LDKNetworkGraph* network_conv = (LDKNetworkGraph*)network;
6242 LDKPublicKey target_conv = *(LDKPublicKey*)target;
6243 FREE((void*)target);
6244 LDKCVec_ChannelDetailsZ* first_hops_conv = (LDKCVec_ChannelDetailsZ*)first_hops;
6245 LDKCVec_RouteHintZ last_hops_conv = *(LDKCVec_RouteHintZ*)last_hops;
6246 FREE((void*)last_hops);
6247 LDKLogger logger_conv = *(LDKLogger*)logger;
6248 LDKLogger_JCalls_clone(logger_conv.this_arg);
6249 LDKCResult_RouteLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
6250 *ret = get_route(our_node_id_conv, network_conv, target_conv, first_hops_conv, last_hops_conv, final_value_msat, final_cltv, logger_conv);
6254 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6255 LDKNetworkGraph this_ptr_conv = *(LDKNetworkGraph*)this_ptr;
6256 FREE((void*)this_ptr);
6257 this_ptr_conv._underlying_ref = false;
6258 return NetworkGraph_free(this_ptr_conv);
6261 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockedNetworkGraph_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6262 LDKLockedNetworkGraph this_ptr_conv = *(LDKLockedNetworkGraph*)this_ptr;
6263 FREE((void*)this_ptr);
6264 this_ptr_conv._underlying_ref = false;
6265 return LockedNetworkGraph_free(this_ptr_conv);
6268 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6269 LDKNetGraphMsgHandler this_ptr_conv = *(LDKNetGraphMsgHandler*)this_ptr;
6270 FREE((void*)this_ptr);
6271 this_ptr_conv._underlying_ref = false;
6272 return NetGraphMsgHandler_free(this_ptr_conv);
6275 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new(JNIEnv * _env, jclass _b, jlong chain_monitor, jlong logger) {
6276 LDKChainWatchInterface chain_monitor_conv = *(LDKChainWatchInterface*)chain_monitor;
6277 LDKChainWatchInterface_JCalls_clone(chain_monitor_conv.this_arg);
6278 LDKLogger logger_conv = *(LDKLogger*)logger;
6279 LDKLogger_JCalls_clone(logger_conv.this_arg);
6280 LDKNetGraphMsgHandler* ret = MALLOC(sizeof(LDKNetGraphMsgHandler), "LDKNetGraphMsgHandler");
6281 *ret = NetGraphMsgHandler_new(chain_monitor_conv, logger_conv);
6282 assert(!ret->_underlying_ref);
6283 ret->_underlying_ref = true;
6287 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1from_1net_1graph(JNIEnv * _env, jclass _b, jlong chain_monitor, jlong logger, jlong network_graph) {
6288 LDKChainWatchInterface chain_monitor_conv = *(LDKChainWatchInterface*)chain_monitor;
6289 LDKChainWatchInterface_JCalls_clone(chain_monitor_conv.this_arg);
6290 LDKLogger logger_conv = *(LDKLogger*)logger;
6291 LDKLogger_JCalls_clone(logger_conv.this_arg);
6292 LDKNetworkGraph network_graph_conv = *(LDKNetworkGraph*)network_graph;
6293 FREE((void*)network_graph);
6294 network_graph_conv._underlying_ref = false;
6295 LDKNetGraphMsgHandler* ret = MALLOC(sizeof(LDKNetGraphMsgHandler), "LDKNetGraphMsgHandler");
6296 *ret = NetGraphMsgHandler_from_net_graph(chain_monitor_conv, logger_conv, network_graph_conv);
6297 assert(!ret->_underlying_ref);
6298 ret->_underlying_ref = true;
6302 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1read_1locked_1graph(JNIEnv * _env, jclass _b, jlong this_arg) {
6303 LDKNetGraphMsgHandler* this_arg_conv = (LDKNetGraphMsgHandler*)this_arg;
6304 LDKLockedNetworkGraph* ret = MALLOC(sizeof(LDKLockedNetworkGraph), "LDKLockedNetworkGraph");
6305 *ret = NetGraphMsgHandler_read_locked_graph(this_arg_conv);
6306 assert(!ret->_underlying_ref);
6307 ret->_underlying_ref = true;
6311 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LockedNetworkGraph_1graph(JNIEnv * _env, jclass _b, jlong this_arg) {
6312 LDKLockedNetworkGraph* this_arg_conv = (LDKLockedNetworkGraph*)this_arg;
6313 LDKNetworkGraph* ret = MALLOC(sizeof(LDKNetworkGraph), "LDKNetworkGraph");
6314 *ret = LockedNetworkGraph_graph(this_arg_conv);
6315 assert(!ret->_underlying_ref);
6316 ret->_underlying_ref = true;
6320 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1RoutingMessageHandler(JNIEnv * _env, jclass _b, jlong this_arg) {
6321 LDKNetGraphMsgHandler* this_arg_conv = (LDKNetGraphMsgHandler*)this_arg;
6322 LDKRoutingMessageHandler* ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
6323 *ret = NetGraphMsgHandler_as_RoutingMessageHandler(this_arg_conv);
6327 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6328 LDKDirectionalChannelInfo this_ptr_conv = *(LDKDirectionalChannelInfo*)this_ptr;
6329 FREE((void*)this_ptr);
6330 this_ptr_conv._underlying_ref = false;
6331 return DirectionalChannelInfo_free(this_ptr_conv);
6334 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr) {
6335 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
6336 return DirectionalChannelInfo_get_last_update(this_ptr_conv);
6339 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6340 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
6341 return DirectionalChannelInfo_set_last_update(this_ptr_conv, val);
6344 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1enabled(JNIEnv * _env, jclass _b, jlong this_ptr) {
6345 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
6346 return DirectionalChannelInfo_get_enabled(this_ptr_conv);
6349 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1enabled(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
6350 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
6351 return DirectionalChannelInfo_set_enabled(this_ptr_conv, val);
6354 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
6355 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
6356 return DirectionalChannelInfo_get_cltv_expiry_delta(this_ptr_conv);
6359 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
6360 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
6361 return DirectionalChannelInfo_set_cltv_expiry_delta(this_ptr_conv, val);
6364 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
6365 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
6366 return DirectionalChannelInfo_get_htlc_minimum_msat(this_ptr_conv);
6369 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6370 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
6371 return DirectionalChannelInfo_set_htlc_minimum_msat(this_ptr_conv, val);
6374 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
6375 LDKDirectionalChannelInfo* obj_conv = (LDKDirectionalChannelInfo*)obj;
6376 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6377 *ret = DirectionalChannelInfo_write(obj_conv);
6381 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
6382 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6384 LDKDirectionalChannelInfo* ret = MALLOC(sizeof(LDKDirectionalChannelInfo), "LDKDirectionalChannelInfo");
6385 *ret = DirectionalChannelInfo_read(ser_conv);
6386 assert(!ret->_underlying_ref);
6387 ret->_underlying_ref = true;
6391 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6392 LDKChannelInfo this_ptr_conv = *(LDKChannelInfo*)this_ptr;
6393 FREE((void*)this_ptr);
6394 this_ptr_conv._underlying_ref = false;
6395 return ChannelInfo_free(this_ptr_conv);
6398 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1one(JNIEnv * _env, jclass _b, jlong this_ptr) {
6399 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
6400 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6401 *ret = ChannelInfo_get_node_one(this_ptr_conv);
6405 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1one(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6406 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
6407 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6409 return ChannelInfo_set_node_one(this_ptr_conv, val_conv);
6412 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1one_1to_1two(JNIEnv * _env, jclass _b, jlong this_ptr) {
6413 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
6414 LDKDirectionalChannelInfo* ret = MALLOC(sizeof(LDKDirectionalChannelInfo), "LDKDirectionalChannelInfo");
6415 *ret = ChannelInfo_get_one_to_two(this_ptr_conv);
6416 assert(!ret->_underlying_ref);
6417 ret->_underlying_ref = true;
6421 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1one_1to_1two(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6422 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
6423 LDKDirectionalChannelInfo val_conv = *(LDKDirectionalChannelInfo*)val;
6425 val_conv._underlying_ref = false;
6426 return ChannelInfo_set_one_to_two(this_ptr_conv, val_conv);
6429 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1two(JNIEnv * _env, jclass _b, jlong this_ptr) {
6430 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
6431 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6432 *ret = ChannelInfo_get_node_two(this_ptr_conv);
6436 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1two(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6437 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
6438 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6440 return ChannelInfo_set_node_two(this_ptr_conv, val_conv);
6443 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1two_1to_1one(JNIEnv * _env, jclass _b, jlong this_ptr) {
6444 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
6445 LDKDirectionalChannelInfo* ret = MALLOC(sizeof(LDKDirectionalChannelInfo), "LDKDirectionalChannelInfo");
6446 *ret = ChannelInfo_get_two_to_one(this_ptr_conv);
6447 assert(!ret->_underlying_ref);
6448 ret->_underlying_ref = true;
6452 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1two_1to_1one(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6453 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
6454 LDKDirectionalChannelInfo val_conv = *(LDKDirectionalChannelInfo*)val;
6456 val_conv._underlying_ref = false;
6457 return ChannelInfo_set_two_to_one(this_ptr_conv, val_conv);
6460 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
6461 LDKChannelInfo* obj_conv = (LDKChannelInfo*)obj;
6462 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6463 *ret = ChannelInfo_write(obj_conv);
6467 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
6468 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6470 LDKChannelInfo* ret = MALLOC(sizeof(LDKChannelInfo), "LDKChannelInfo");
6471 *ret = ChannelInfo_read(ser_conv);
6472 assert(!ret->_underlying_ref);
6473 ret->_underlying_ref = true;
6477 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6478 LDKRoutingFees this_ptr_conv = *(LDKRoutingFees*)this_ptr;
6479 FREE((void*)this_ptr);
6480 this_ptr_conv._underlying_ref = false;
6481 return RoutingFees_free(this_ptr_conv);
6484 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
6485 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
6486 return RoutingFees_get_base_msat(this_ptr_conv);
6489 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6490 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
6491 return RoutingFees_set_base_msat(this_ptr_conv, val);
6494 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr) {
6495 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
6496 return RoutingFees_get_proportional_millionths(this_ptr_conv);
6499 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6500 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
6501 return RoutingFees_set_proportional_millionths(this_ptr_conv, val);
6504 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1new(JNIEnv * _env, jclass _b, jint base_msat_arg, jint proportional_millionths_arg) {
6505 LDKRoutingFees* ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
6506 *ret = RoutingFees_new(base_msat_arg, proportional_millionths_arg);
6507 assert(!ret->_underlying_ref);
6508 ret->_underlying_ref = true;
6512 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1read(JNIEnv * _env, jclass _b, jlong ser) {
6513 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6515 LDKRoutingFees* ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
6516 *ret = RoutingFees_read(ser_conv);
6517 assert(!ret->_underlying_ref);
6518 ret->_underlying_ref = true;
6522 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1write(JNIEnv * _env, jclass _b, jlong obj) {
6523 LDKRoutingFees* obj_conv = (LDKRoutingFees*)obj;
6524 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6525 *ret = RoutingFees_write(obj_conv);
6529 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6530 LDKNodeAnnouncementInfo this_ptr_conv = *(LDKNodeAnnouncementInfo*)this_ptr;
6531 FREE((void*)this_ptr);
6532 this_ptr_conv._underlying_ref = false;
6533 return NodeAnnouncementInfo_free(this_ptr_conv);
6536 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr) {
6537 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
6538 return NodeAnnouncementInfo_get_last_update(this_ptr_conv);
6541 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6542 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
6543 return NodeAnnouncementInfo_set_last_update(this_ptr_conv, val);
6546 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr) {
6547 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
6548 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 3);
6549 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 3, *NodeAnnouncementInfo_get_rgb(this_ptr_conv));
6553 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6554 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
6555 LDKThreeBytes val_conv = *(LDKThreeBytes*)val;
6557 return NodeAnnouncementInfo_set_rgb(this_ptr_conv, val_conv);
6560 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1alias(JNIEnv * _env, jclass _b, jlong this_ptr) {
6561 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
6562 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6563 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *NodeAnnouncementInfo_get_alias(this_ptr_conv));
6567 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1alias(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6568 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
6569 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
6571 return NodeAnnouncementInfo_set_alias(this_ptr_conv, val_conv);
6574 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1addresses(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6575 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
6576 LDKCVec_NetAddressZ val_conv = *(LDKCVec_NetAddressZ*)val;
6578 return NodeAnnouncementInfo_set_addresses(this_ptr_conv, val_conv);
6581 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
6582 LDKNodeAnnouncementInfo* obj_conv = (LDKNodeAnnouncementInfo*)obj;
6583 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6584 *ret = NodeAnnouncementInfo_write(obj_conv);
6588 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
6589 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6591 LDKNodeAnnouncementInfo* ret = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo");
6592 *ret = NodeAnnouncementInfo_read(ser_conv);
6593 assert(!ret->_underlying_ref);
6594 ret->_underlying_ref = true;
6598 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6599 LDKNodeInfo this_ptr_conv = *(LDKNodeInfo*)this_ptr;
6600 FREE((void*)this_ptr);
6601 this_ptr_conv._underlying_ref = false;
6602 return NodeInfo_free(this_ptr_conv);
6605 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1channels(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6606 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
6607 LDKCVec_u64Z val_conv = *(LDKCVec_u64Z*)val;
6609 return NodeInfo_set_channels(this_ptr_conv, val_conv);
6612 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1lowest_1inbound_1channel_1fees(JNIEnv * _env, jclass _b, jlong this_ptr) {
6613 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
6614 LDKRoutingFees* ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
6615 *ret = NodeInfo_get_lowest_inbound_channel_fees(this_ptr_conv);
6616 assert(!ret->_underlying_ref);
6617 ret->_underlying_ref = true;
6621 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1lowest_1inbound_1channel_1fees(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6622 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
6623 LDKRoutingFees val_conv = *(LDKRoutingFees*)val;
6625 val_conv._underlying_ref = false;
6626 return NodeInfo_set_lowest_inbound_channel_fees(this_ptr_conv, val_conv);
6629 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1announcement_1info(JNIEnv * _env, jclass _b, jlong this_ptr) {
6630 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
6631 LDKNodeAnnouncementInfo* ret = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo");
6632 *ret = NodeInfo_get_announcement_info(this_ptr_conv);
6633 assert(!ret->_underlying_ref);
6634 ret->_underlying_ref = true;
6638 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1announcement_1info(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6639 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
6640 LDKNodeAnnouncementInfo val_conv = *(LDKNodeAnnouncementInfo*)val;
6642 val_conv._underlying_ref = false;
6643 return NodeInfo_set_announcement_info(this_ptr_conv, val_conv);
6646 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) {
6647 LDKCVec_u64Z channels_arg_conv = *(LDKCVec_u64Z*)channels_arg;
6648 FREE((void*)channels_arg);
6649 LDKRoutingFees lowest_inbound_channel_fees_arg_conv = *(LDKRoutingFees*)lowest_inbound_channel_fees_arg;
6650 FREE((void*)lowest_inbound_channel_fees_arg);
6651 lowest_inbound_channel_fees_arg_conv._underlying_ref = false;
6652 LDKNodeAnnouncementInfo announcement_info_arg_conv = *(LDKNodeAnnouncementInfo*)announcement_info_arg;
6653 FREE((void*)announcement_info_arg);
6654 announcement_info_arg_conv._underlying_ref = false;
6655 LDKNodeInfo* ret = MALLOC(sizeof(LDKNodeInfo), "LDKNodeInfo");
6656 *ret = NodeInfo_new(channels_arg_conv, lowest_inbound_channel_fees_arg_conv, announcement_info_arg_conv);
6657 assert(!ret->_underlying_ref);
6658 ret->_underlying_ref = true;
6662 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
6663 LDKNodeInfo* obj_conv = (LDKNodeInfo*)obj;
6664 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6665 *ret = NodeInfo_write(obj_conv);
6669 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
6670 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6672 LDKNodeInfo* ret = MALLOC(sizeof(LDKNodeInfo), "LDKNodeInfo");
6673 *ret = NodeInfo_read(ser_conv);
6674 assert(!ret->_underlying_ref);
6675 ret->_underlying_ref = true;
6679 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1write(JNIEnv * _env, jclass _b, jlong obj) {
6680 LDKNetworkGraph* obj_conv = (LDKNetworkGraph*)obj;
6681 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6682 *ret = NetworkGraph_write(obj_conv);
6686 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read(JNIEnv * _env, jclass _b, jlong ser) {
6687 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6689 LDKNetworkGraph* ret = MALLOC(sizeof(LDKNetworkGraph), "LDKNetworkGraph");
6690 *ret = NetworkGraph_read(ser_conv);
6691 assert(!ret->_underlying_ref);
6692 ret->_underlying_ref = true;
6696 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new(JNIEnv * _env, jclass _b) {
6697 LDKNetworkGraph* ret = MALLOC(sizeof(LDKNetworkGraph), "LDKNetworkGraph");
6698 *ret = NetworkGraph_new();
6699 assert(!ret->_underlying_ref);
6700 ret->_underlying_ref = true;
6704 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) {
6705 LDKNetworkGraph* this_arg_conv = (LDKNetworkGraph*)this_arg;
6706 return NetworkGraph_close_channel_from_update(this_arg_conv, short_channel_id, is_permanent);