1 #include "org_ldk_impl_bindings.h"
2 #include <rust_types.h>
8 typedef struct LDKMessageSendEventsProvider_JCalls {
12 jmethodID get_and_clear_pending_msg_events_meth;
13 } LDKMessageSendEventsProvider_JCalls;
14 LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_jcall(const void* this_arg) {
15 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
16 LDKCVec_MessageSendEventZ* ret = (LDKCVec_MessageSendEventZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_and_clear_pending_msg_events_meth);
17 LDKCVec_MessageSendEventZ res = *ret;
21 void LDKMessageSendEventsProvider_JCalls_free(void* this_arg) {
22 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
23 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
24 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
28 void* LDKMessageSendEventsProvider_JCalls_clone(const void* this_arg) {
29 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
30 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
31 return (void*) this_arg;
33 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1new (JNIEnv * env, jclass _a, jobject o) {
34 jclass c = (*env)->GetObjectClass(env, o);
36 LDKMessageSendEventsProvider_JCalls *calls = malloc(sizeof(LDKMessageSendEventsProvider_JCalls));
37 atomic_init(&calls->refcnt, 1);
39 calls->o = (*env)->NewGlobalRef(env, o);
40 calls->get_and_clear_pending_msg_events_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_msg_events", "()J");
41 assert(calls->get_and_clear_pending_msg_events_meth != NULL);
43 LDKMessageSendEventsProvider *ret = malloc(sizeof(LDKMessageSendEventsProvider));
44 ret->this_arg = (void*) calls;
45 ret->get_and_clear_pending_msg_events = get_and_clear_pending_msg_events_jcall;
46 ret->free = LDKMessageSendEventsProvider_JCalls_free;
50 typedef struct LDKEventsProvider_JCalls {
54 jmethodID get_and_clear_pending_events_meth;
55 } LDKEventsProvider_JCalls;
56 LDKCVec_EventZ get_and_clear_pending_events_jcall(const void* this_arg) {
57 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
58 LDKCVec_EventZ* ret = (LDKCVec_EventZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_and_clear_pending_events_meth);
59 LDKCVec_EventZ res = *ret;
63 void LDKEventsProvider_JCalls_free(void* this_arg) {
64 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
65 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
66 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
70 void* LDKEventsProvider_JCalls_clone(const void* this_arg) {
71 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
72 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
73 return (void*) this_arg;
75 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1new (JNIEnv * env, jclass _a, jobject o) {
76 jclass c = (*env)->GetObjectClass(env, o);
78 LDKEventsProvider_JCalls *calls = malloc(sizeof(LDKEventsProvider_JCalls));
79 atomic_init(&calls->refcnt, 1);
81 calls->o = (*env)->NewGlobalRef(env, o);
82 calls->get_and_clear_pending_events_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_events", "()J");
83 assert(calls->get_and_clear_pending_events_meth != NULL);
85 LDKEventsProvider *ret = malloc(sizeof(LDKEventsProvider));
86 ret->this_arg = (void*) calls;
87 ret->get_and_clear_pending_events = get_and_clear_pending_events_jcall;
88 ret->free = LDKEventsProvider_JCalls_free;
92 typedef struct LDKLogger_JCalls {
98 void log_jcall(const void* this_arg, const char *record) {
99 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
100 jstring record_conv = (*j_calls->env)->NewStringUTF(j_calls->env, record);
101 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->log_meth, record_conv);
103 void LDKLogger_JCalls_free(void* this_arg) {
104 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
105 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
106 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
110 void* LDKLogger_JCalls_clone(const void* this_arg) {
111 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
112 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
113 return (void*) this_arg;
115 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKLogger_1new (JNIEnv * env, jclass _a, jobject o) {
116 jclass c = (*env)->GetObjectClass(env, o);
118 LDKLogger_JCalls *calls = malloc(sizeof(LDKLogger_JCalls));
119 atomic_init(&calls->refcnt, 1);
121 calls->o = (*env)->NewGlobalRef(env, o);
122 calls->log_meth = (*env)->GetMethodID(env, c, "log", "(Ljava/lang/String;)V");
123 assert(calls->log_meth != NULL);
125 LDKLogger *ret = malloc(sizeof(LDKLogger));
126 ret->this_arg = (void*) calls;
127 ret->log = log_jcall;
128 ret->free = LDKLogger_JCalls_free;
132 typedef struct LDKChainWatchInterface_JCalls {
133 atomic_size_t refcnt;
136 jmethodID install_watch_tx_meth;
137 jmethodID install_watch_outpoint_meth;
138 jmethodID watch_all_txn_meth;
139 jmethodID get_chain_utxo_meth;
140 jmethodID filter_block_meth;
141 jmethodID reentered_meth;
142 } LDKChainWatchInterface_JCalls;
143 void install_watch_tx_jcall(const void* this_arg, const uint8_t (*txid)[32], LDKu8slice script_pub_key) {
144 LDKChainWatchInterface_JCalls *j_calls = (LDKChainWatchInterface_JCalls*) this_arg;
145 jbyteArray txid_arr = (*j_calls->env)->NewByteArray(j_calls->env, 32);
146 (*j_calls->env)->SetByteArrayRegion(j_calls->env, txid_arr, 0, 32, *txid);
147 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->install_watch_tx_meth, txid_arr, script_pub_key);
149 void install_watch_outpoint_jcall(const void* this_arg, LDKC2Tuple_Txidu32Z outpoint, LDKu8slice out_script) {
150 LDKChainWatchInterface_JCalls *j_calls = (LDKChainWatchInterface_JCalls*) this_arg;
151 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->install_watch_outpoint_meth, outpoint, out_script);
153 void watch_all_txn_jcall(const void* this_arg) {
154 LDKChainWatchInterface_JCalls *j_calls = (LDKChainWatchInterface_JCalls*) this_arg;
155 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->watch_all_txn_meth);
157 LDKCResult_C2Tuple_Scriptu64ZChainErrorZ get_chain_utxo_jcall(const void* this_arg, LDKThirtyTwoBytes genesis_hash, uint64_t unspent_tx_output_identifier) {
158 LDKChainWatchInterface_JCalls *j_calls = (LDKChainWatchInterface_JCalls*) this_arg;
159 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);
160 LDKCResult_C2Tuple_Scriptu64ZChainErrorZ res = *ret;
164 LDKCVec_usizeZ filter_block_jcall(const void* this_arg, LDKu8slice block) {
165 LDKChainWatchInterface_JCalls *j_calls = (LDKChainWatchInterface_JCalls*) this_arg;
166 LDKCVec_usizeZ* ret = (LDKCVec_usizeZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->filter_block_meth, block);
167 LDKCVec_usizeZ res = *ret;
171 uintptr_t reentered_jcall(const void* this_arg) {
172 LDKChainWatchInterface_JCalls *j_calls = (LDKChainWatchInterface_JCalls*) this_arg;
173 uintptr_t* ret = (uintptr_t*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->reentered_meth);
174 uintptr_t res = *ret;
178 void LDKChainWatchInterface_JCalls_free(void* this_arg) {
179 LDKChainWatchInterface_JCalls *j_calls = (LDKChainWatchInterface_JCalls*) this_arg;
180 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
181 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
185 void* LDKChainWatchInterface_JCalls_clone(const void* this_arg) {
186 LDKChainWatchInterface_JCalls *j_calls = (LDKChainWatchInterface_JCalls*) this_arg;
187 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
188 return (void*) this_arg;
190 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKChainWatchInterface_1new (JNIEnv * env, jclass _a, jobject o) {
191 jclass c = (*env)->GetObjectClass(env, o);
193 LDKChainWatchInterface_JCalls *calls = malloc(sizeof(LDKChainWatchInterface_JCalls));
194 atomic_init(&calls->refcnt, 1);
196 calls->o = (*env)->NewGlobalRef(env, o);
197 calls->install_watch_tx_meth = (*env)->GetMethodID(env, c, "install_watch_tx", "([BJ)V");
198 assert(calls->install_watch_tx_meth != NULL);
199 calls->install_watch_outpoint_meth = (*env)->GetMethodID(env, c, "install_watch_outpoint", "(JJ)V");
200 assert(calls->install_watch_outpoint_meth != NULL);
201 calls->watch_all_txn_meth = (*env)->GetMethodID(env, c, "watch_all_txn", "()V");
202 assert(calls->watch_all_txn_meth != NULL);
203 calls->get_chain_utxo_meth = (*env)->GetMethodID(env, c, "get_chain_utxo", "(JJ)J");
204 assert(calls->get_chain_utxo_meth != NULL);
205 calls->filter_block_meth = (*env)->GetMethodID(env, c, "filter_block", "(J)J");
206 assert(calls->filter_block_meth != NULL);
207 calls->reentered_meth = (*env)->GetMethodID(env, c, "reentered", "()J");
208 assert(calls->reentered_meth != NULL);
210 LDKChainWatchInterface *ret = malloc(sizeof(LDKChainWatchInterface));
211 ret->this_arg = (void*) calls;
212 ret->install_watch_tx = install_watch_tx_jcall;
213 ret->install_watch_outpoint = install_watch_outpoint_jcall;
214 ret->watch_all_txn = watch_all_txn_jcall;
215 ret->get_chain_utxo = get_chain_utxo_jcall;
216 ret->filter_block = filter_block_jcall;
217 ret->reentered = reentered_jcall;
218 ret->free = LDKChainWatchInterface_JCalls_free;
222 typedef struct LDKBroadcasterInterface_JCalls {
223 atomic_size_t refcnt;
226 jmethodID broadcast_transaction_meth;
227 } LDKBroadcasterInterface_JCalls;
228 void broadcast_transaction_jcall(const void* this_arg, LDKTransaction tx) {
229 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
230 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->broadcast_transaction_meth, tx);
232 void LDKBroadcasterInterface_JCalls_free(void* this_arg) {
233 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
234 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
235 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
239 void* LDKBroadcasterInterface_JCalls_clone(const void* this_arg) {
240 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
241 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
242 return (void*) this_arg;
244 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1new (JNIEnv * env, jclass _a, jobject o) {
245 jclass c = (*env)->GetObjectClass(env, o);
247 LDKBroadcasterInterface_JCalls *calls = malloc(sizeof(LDKBroadcasterInterface_JCalls));
248 atomic_init(&calls->refcnt, 1);
250 calls->o = (*env)->NewGlobalRef(env, o);
251 calls->broadcast_transaction_meth = (*env)->GetMethodID(env, c, "broadcast_transaction", "(J)V");
252 assert(calls->broadcast_transaction_meth != NULL);
254 LDKBroadcasterInterface *ret = malloc(sizeof(LDKBroadcasterInterface));
255 ret->this_arg = (void*) calls;
256 ret->broadcast_transaction = broadcast_transaction_jcall;
257 ret->free = LDKBroadcasterInterface_JCalls_free;
261 typedef struct LDKChainListener_JCalls {
262 atomic_size_t refcnt;
265 jmethodID block_connected_meth;
266 jmethodID block_disconnected_meth;
267 } LDKChainListener_JCalls;
268 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) {
269 LDKChainListener_JCalls *j_calls = (LDKChainListener_JCalls*) this_arg;
270 jbyteArray header_arr = (*j_calls->env)->NewByteArray(j_calls->env, 80);
271 (*j_calls->env)->SetByteArrayRegion(j_calls->env, header_arr, 0, 80, *header);
272 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);
274 void block_disconnected_jcall(const void* this_arg, const uint8_t (*header)[80], uint32_t disconnected_height) {
275 LDKChainListener_JCalls *j_calls = (LDKChainListener_JCalls*) this_arg;
276 jbyteArray header_arr = (*j_calls->env)->NewByteArray(j_calls->env, 80);
277 (*j_calls->env)->SetByteArrayRegion(j_calls->env, header_arr, 0, 80, *header);
278 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->block_disconnected_meth, header_arr, disconnected_height);
280 void LDKChainListener_JCalls_free(void* this_arg) {
281 LDKChainListener_JCalls *j_calls = (LDKChainListener_JCalls*) this_arg;
282 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
283 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
287 void* LDKChainListener_JCalls_clone(const void* this_arg) {
288 LDKChainListener_JCalls *j_calls = (LDKChainListener_JCalls*) this_arg;
289 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
290 return (void*) this_arg;
292 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKChainListener_1new (JNIEnv * env, jclass _a, jobject o) {
293 jclass c = (*env)->GetObjectClass(env, o);
295 LDKChainListener_JCalls *calls = malloc(sizeof(LDKChainListener_JCalls));
296 atomic_init(&calls->refcnt, 1);
298 calls->o = (*env)->NewGlobalRef(env, o);
299 calls->block_connected_meth = (*env)->GetMethodID(env, c, "block_connected", "([BIJJ)V");
300 assert(calls->block_connected_meth != NULL);
301 calls->block_disconnected_meth = (*env)->GetMethodID(env, c, "block_disconnected", "([BI)V");
302 assert(calls->block_disconnected_meth != NULL);
304 LDKChainListener *ret = malloc(sizeof(LDKChainListener));
305 ret->this_arg = (void*) calls;
306 ret->block_connected = block_connected_jcall;
307 ret->block_disconnected = block_disconnected_jcall;
308 ret->free = LDKChainListener_JCalls_free;
312 typedef struct LDKFeeEstimator_JCalls {
313 atomic_size_t refcnt;
316 jmethodID get_est_sat_per_1000_weight_meth;
317 } LDKFeeEstimator_JCalls;
318 uint32_t get_est_sat_per_1000_weight_jcall(const void* this_arg, LDKConfirmationTarget confirmation_target) {
319 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
320 return (*j_calls->env)->CallIntMethod(j_calls->env, j_calls->o, j_calls->get_est_sat_per_1000_weight_meth, confirmation_target);
322 void LDKFeeEstimator_JCalls_free(void* this_arg) {
323 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
324 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
325 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
329 void* LDKFeeEstimator_JCalls_clone(const void* this_arg) {
330 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
331 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
332 return (void*) this_arg;
334 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1new (JNIEnv * env, jclass _a, jobject o) {
335 jclass c = (*env)->GetObjectClass(env, o);
337 LDKFeeEstimator_JCalls *calls = malloc(sizeof(LDKFeeEstimator_JCalls));
338 atomic_init(&calls->refcnt, 1);
340 calls->o = (*env)->NewGlobalRef(env, o);
341 calls->get_est_sat_per_1000_weight_meth = (*env)->GetMethodID(env, c, "get_est_sat_per_1000_weight", "(J)I");
342 assert(calls->get_est_sat_per_1000_weight_meth != NULL);
344 LDKFeeEstimator *ret = malloc(sizeof(LDKFeeEstimator));
345 ret->this_arg = (void*) calls;
346 ret->get_est_sat_per_1000_weight = get_est_sat_per_1000_weight_jcall;
347 ret->free = LDKFeeEstimator_JCalls_free;
351 typedef struct LDKChannelKeys_JCalls {
352 atomic_size_t refcnt;
355 jmethodID get_per_commitment_point_meth;
356 jmethodID release_commitment_secret_meth;
357 jmethodID key_derivation_params_meth;
358 jmethodID sign_remote_commitment_meth;
359 jmethodID sign_local_commitment_meth;
360 jmethodID sign_local_commitment_htlc_transactions_meth;
361 jmethodID sign_justice_transaction_meth;
362 jmethodID sign_remote_htlc_transaction_meth;
363 jmethodID sign_closing_transaction_meth;
364 jmethodID sign_channel_announcement_meth;
365 jmethodID on_accept_meth;
366 } LDKChannelKeys_JCalls;
367 LDKPublicKey get_per_commitment_point_jcall(const void* this_arg, uint64_t idx) {
368 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
369 LDKPublicKey* ret = (LDKPublicKey*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_per_commitment_point_meth, idx);
370 LDKPublicKey res = *ret;
374 LDKThirtyTwoBytes release_commitment_secret_jcall(const void* this_arg, uint64_t idx) {
375 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
376 LDKThirtyTwoBytes* ret = (LDKThirtyTwoBytes*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->release_commitment_secret_meth, idx);
377 LDKThirtyTwoBytes res = *ret;
381 LDKC2Tuple_u64u64Z key_derivation_params_jcall(const void* this_arg) {
382 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
383 LDKC2Tuple_u64u64Z* ret = (LDKC2Tuple_u64u64Z*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->key_derivation_params_meth);
384 LDKC2Tuple_u64u64Z res = *ret;
388 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) {
389 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
390 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);
391 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ res = *ret;
395 LDKCResult_SignatureNoneZ sign_local_commitment_jcall(const void* this_arg, const LDKLocalCommitmentTransaction *local_commitment_tx) {
396 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
397 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->sign_local_commitment_meth, local_commitment_tx);
398 LDKCResult_SignatureNoneZ res = *ret;
402 LDKCResult_CVec_SignatureZNoneZ sign_local_commitment_htlc_transactions_jcall(const void* this_arg, const LDKLocalCommitmentTransaction *local_commitment_tx) {
403 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
404 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);
405 LDKCResult_CVec_SignatureZNoneZ res = *ret;
409 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) {
410 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
411 jbyteArray per_commitment_key_arr = (*j_calls->env)->NewByteArray(j_calls->env, 32);
412 (*j_calls->env)->SetByteArrayRegion(j_calls->env, per_commitment_key_arr, 0, 32, *per_commitment_key);
413 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);
414 LDKCResult_SignatureNoneZ res = *ret;
418 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) {
419 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
420 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);
421 LDKCResult_SignatureNoneZ res = *ret;
425 LDKCResult_SignatureNoneZ sign_closing_transaction_jcall(const void* this_arg, LDKTransaction closing_tx) {
426 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
427 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->sign_closing_transaction_meth, closing_tx);
428 LDKCResult_SignatureNoneZ res = *ret;
432 LDKCResult_SignatureNoneZ sign_channel_announcement_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement *msg) {
433 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
434 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->sign_channel_announcement_meth, msg);
435 LDKCResult_SignatureNoneZ res = *ret;
439 void on_accept_jcall(void* this_arg, const LDKChannelPublicKeys *channel_points, uint16_t remote_to_self_delay, uint16_t local_to_self_delay) {
440 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
441 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);
443 void LDKChannelKeys_JCalls_free(void* this_arg) {
444 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
445 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
446 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
450 void* LDKChannelKeys_JCalls_clone(const void* this_arg) {
451 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
452 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
453 return (void*) this_arg;
455 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1new (JNIEnv * env, jclass _a, jobject o) {
456 jclass c = (*env)->GetObjectClass(env, o);
458 LDKChannelKeys_JCalls *calls = malloc(sizeof(LDKChannelKeys_JCalls));
459 atomic_init(&calls->refcnt, 1);
461 calls->o = (*env)->NewGlobalRef(env, o);
462 calls->get_per_commitment_point_meth = (*env)->GetMethodID(env, c, "get_per_commitment_point", "(J)J");
463 assert(calls->get_per_commitment_point_meth != NULL);
464 calls->release_commitment_secret_meth = (*env)->GetMethodID(env, c, "release_commitment_secret", "(J)J");
465 assert(calls->release_commitment_secret_meth != NULL);
466 calls->key_derivation_params_meth = (*env)->GetMethodID(env, c, "key_derivation_params", "()J");
467 assert(calls->key_derivation_params_meth != NULL);
468 calls->sign_remote_commitment_meth = (*env)->GetMethodID(env, c, "sign_remote_commitment", "(IJJJ)J");
469 assert(calls->sign_remote_commitment_meth != NULL);
470 calls->sign_local_commitment_meth = (*env)->GetMethodID(env, c, "sign_local_commitment", "(J)J");
471 assert(calls->sign_local_commitment_meth != NULL);
472 calls->sign_local_commitment_htlc_transactions_meth = (*env)->GetMethodID(env, c, "sign_local_commitment_htlc_transactions", "(J)J");
473 assert(calls->sign_local_commitment_htlc_transactions_meth != NULL);
474 calls->sign_justice_transaction_meth = (*env)->GetMethodID(env, c, "sign_justice_transaction", "(JJJ[BJ)J");
475 assert(calls->sign_justice_transaction_meth != NULL);
476 calls->sign_remote_htlc_transaction_meth = (*env)->GetMethodID(env, c, "sign_remote_htlc_transaction", "(JJJJJ)J");
477 assert(calls->sign_remote_htlc_transaction_meth != NULL);
478 calls->sign_closing_transaction_meth = (*env)->GetMethodID(env, c, "sign_closing_transaction", "(J)J");
479 assert(calls->sign_closing_transaction_meth != NULL);
480 calls->sign_channel_announcement_meth = (*env)->GetMethodID(env, c, "sign_channel_announcement", "(J)J");
481 assert(calls->sign_channel_announcement_meth != NULL);
482 calls->on_accept_meth = (*env)->GetMethodID(env, c, "on_accept", "(JSS)V");
483 assert(calls->on_accept_meth != NULL);
485 LDKChannelKeys *ret = malloc(sizeof(LDKChannelKeys));
486 ret->this_arg = (void*) calls;
487 ret->get_per_commitment_point = get_per_commitment_point_jcall;
488 ret->release_commitment_secret = release_commitment_secret_jcall;
489 ret->key_derivation_params = key_derivation_params_jcall;
490 ret->sign_remote_commitment = sign_remote_commitment_jcall;
491 ret->sign_local_commitment = sign_local_commitment_jcall;
492 ret->sign_local_commitment_htlc_transactions = sign_local_commitment_htlc_transactions_jcall;
493 ret->sign_justice_transaction = sign_justice_transaction_jcall;
494 ret->sign_remote_htlc_transaction = sign_remote_htlc_transaction_jcall;
495 ret->sign_closing_transaction = sign_closing_transaction_jcall;
496 ret->sign_channel_announcement = sign_channel_announcement_jcall;
497 ret->on_accept = on_accept_jcall;
498 ret->clone = LDKChannelKeys_JCalls_clone;
499 ret->free = LDKChannelKeys_JCalls_free;
503 typedef struct LDKKeysInterface_JCalls {
504 atomic_size_t refcnt;
507 jmethodID get_node_secret_meth;
508 jmethodID get_destination_script_meth;
509 jmethodID get_shutdown_pubkey_meth;
510 jmethodID get_channel_keys_meth;
511 jmethodID get_secure_random_bytes_meth;
512 } LDKKeysInterface_JCalls;
513 LDKSecretKey get_node_secret_jcall(const void* this_arg) {
514 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
515 LDKSecretKey* ret = (LDKSecretKey*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_node_secret_meth);
516 LDKSecretKey res = *ret;
520 LDKCVec_u8Z get_destination_script_jcall(const void* this_arg) {
521 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
522 LDKCVec_u8Z* ret = (LDKCVec_u8Z*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_destination_script_meth);
523 LDKCVec_u8Z res = *ret;
527 LDKPublicKey get_shutdown_pubkey_jcall(const void* this_arg) {
528 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
529 LDKPublicKey* ret = (LDKPublicKey*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_shutdown_pubkey_meth);
530 LDKPublicKey res = *ret;
534 LDKChannelKeys get_channel_keys_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) {
535 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
536 LDKChannelKeys* ret = (LDKChannelKeys*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_channel_keys_meth, inbound, channel_value_satoshis);
537 LDKChannelKeys res = *ret;
541 LDKThirtyTwoBytes get_secure_random_bytes_jcall(const void* this_arg) {
542 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
543 LDKThirtyTwoBytes* ret = (LDKThirtyTwoBytes*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_secure_random_bytes_meth);
544 LDKThirtyTwoBytes res = *ret;
548 void LDKKeysInterface_JCalls_free(void* this_arg) {
549 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
550 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
551 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
555 void* LDKKeysInterface_JCalls_clone(const void* this_arg) {
556 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
557 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
558 return (void*) this_arg;
560 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1new (JNIEnv * env, jclass _a, jobject o) {
561 jclass c = (*env)->GetObjectClass(env, o);
563 LDKKeysInterface_JCalls *calls = malloc(sizeof(LDKKeysInterface_JCalls));
564 atomic_init(&calls->refcnt, 1);
566 calls->o = (*env)->NewGlobalRef(env, o);
567 calls->get_node_secret_meth = (*env)->GetMethodID(env, c, "get_node_secret", "()J");
568 assert(calls->get_node_secret_meth != NULL);
569 calls->get_destination_script_meth = (*env)->GetMethodID(env, c, "get_destination_script", "()J");
570 assert(calls->get_destination_script_meth != NULL);
571 calls->get_shutdown_pubkey_meth = (*env)->GetMethodID(env, c, "get_shutdown_pubkey", "()J");
572 assert(calls->get_shutdown_pubkey_meth != NULL);
573 calls->get_channel_keys_meth = (*env)->GetMethodID(env, c, "get_channel_keys", "(ZJ)J");
574 assert(calls->get_channel_keys_meth != NULL);
575 calls->get_secure_random_bytes_meth = (*env)->GetMethodID(env, c, "get_secure_random_bytes", "()J");
576 assert(calls->get_secure_random_bytes_meth != NULL);
578 LDKKeysInterface *ret = malloc(sizeof(LDKKeysInterface));
579 ret->this_arg = (void*) calls;
580 ret->get_node_secret = get_node_secret_jcall;
581 ret->get_destination_script = get_destination_script_jcall;
582 ret->get_shutdown_pubkey = get_shutdown_pubkey_jcall;
583 ret->get_channel_keys = get_channel_keys_jcall;
584 ret->get_secure_random_bytes = get_secure_random_bytes_jcall;
585 ret->free = LDKKeysInterface_JCalls_free;
589 typedef struct LDKManyChannelMonitor_JCalls {
590 atomic_size_t refcnt;
593 jmethodID add_monitor_meth;
594 jmethodID update_monitor_meth;
595 jmethodID get_and_clear_pending_monitor_events_meth;
596 } LDKManyChannelMonitor_JCalls;
597 LDKCResult_NoneChannelMonitorUpdateErrZ add_monitor_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) {
598 LDKManyChannelMonitor_JCalls *j_calls = (LDKManyChannelMonitor_JCalls*) this_arg;
599 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->add_monitor_meth, funding_txo, monitor);
600 LDKCResult_NoneChannelMonitorUpdateErrZ res = *ret;
604 LDKCResult_NoneChannelMonitorUpdateErrZ update_monitor_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate monitor) {
605 LDKManyChannelMonitor_JCalls *j_calls = (LDKManyChannelMonitor_JCalls*) this_arg;
606 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->update_monitor_meth, funding_txo, monitor);
607 LDKCResult_NoneChannelMonitorUpdateErrZ res = *ret;
611 LDKCVec_MonitorEventZ get_and_clear_pending_monitor_events_jcall(const void* this_arg) {
612 LDKManyChannelMonitor_JCalls *j_calls = (LDKManyChannelMonitor_JCalls*) this_arg;
613 LDKCVec_MonitorEventZ* ret = (LDKCVec_MonitorEventZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_and_clear_pending_monitor_events_meth);
614 LDKCVec_MonitorEventZ res = *ret;
618 void LDKManyChannelMonitor_JCalls_free(void* this_arg) {
619 LDKManyChannelMonitor_JCalls *j_calls = (LDKManyChannelMonitor_JCalls*) this_arg;
620 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
621 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
625 void* LDKManyChannelMonitor_JCalls_clone(const void* this_arg) {
626 LDKManyChannelMonitor_JCalls *j_calls = (LDKManyChannelMonitor_JCalls*) this_arg;
627 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
628 return (void*) this_arg;
630 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKManyChannelMonitor_1new (JNIEnv * env, jclass _a, jobject o) {
631 jclass c = (*env)->GetObjectClass(env, o);
633 LDKManyChannelMonitor_JCalls *calls = malloc(sizeof(LDKManyChannelMonitor_JCalls));
634 atomic_init(&calls->refcnt, 1);
636 calls->o = (*env)->NewGlobalRef(env, o);
637 calls->add_monitor_meth = (*env)->GetMethodID(env, c, "add_monitor", "(JJ)J");
638 assert(calls->add_monitor_meth != NULL);
639 calls->update_monitor_meth = (*env)->GetMethodID(env, c, "update_monitor", "(JJ)J");
640 assert(calls->update_monitor_meth != NULL);
641 calls->get_and_clear_pending_monitor_events_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_monitor_events", "()J");
642 assert(calls->get_and_clear_pending_monitor_events_meth != NULL);
644 LDKManyChannelMonitor *ret = malloc(sizeof(LDKManyChannelMonitor));
645 ret->this_arg = (void*) calls;
646 ret->add_monitor = add_monitor_jcall;
647 ret->update_monitor = update_monitor_jcall;
648 ret->get_and_clear_pending_monitor_events = get_and_clear_pending_monitor_events_jcall;
649 ret->free = LDKManyChannelMonitor_JCalls_free;
653 typedef struct LDKChannelMessageHandler_JCalls {
654 atomic_size_t refcnt;
657 LDKMessageSendEventsProvider_JCalls* MessageSendEventsProvider;
658 jmethodID handle_open_channel_meth;
659 jmethodID handle_accept_channel_meth;
660 jmethodID handle_funding_created_meth;
661 jmethodID handle_funding_signed_meth;
662 jmethodID handle_funding_locked_meth;
663 jmethodID handle_shutdown_meth;
664 jmethodID handle_closing_signed_meth;
665 jmethodID handle_update_add_htlc_meth;
666 jmethodID handle_update_fulfill_htlc_meth;
667 jmethodID handle_update_fail_htlc_meth;
668 jmethodID handle_update_fail_malformed_htlc_meth;
669 jmethodID handle_commitment_signed_meth;
670 jmethodID handle_revoke_and_ack_meth;
671 jmethodID handle_update_fee_meth;
672 jmethodID handle_announcement_signatures_meth;
673 jmethodID peer_disconnected_meth;
674 jmethodID peer_connected_meth;
675 jmethodID handle_channel_reestablish_meth;
676 jmethodID handle_error_meth;
677 } LDKChannelMessageHandler_JCalls;
678 void handle_open_channel_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKOpenChannel *msg) {
679 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
680 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_open_channel_meth, their_node_id, their_features, msg);
682 void handle_accept_channel_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKAcceptChannel *msg) {
683 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
684 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_accept_channel_meth, their_node_id, their_features, msg);
686 void handle_funding_created_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated *msg) {
687 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
688 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_funding_created_meth, their_node_id, msg);
690 void handle_funding_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned *msg) {
691 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
692 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_funding_signed_meth, their_node_id, msg);
694 void handle_funding_locked_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingLocked *msg) {
695 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
696 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_funding_locked_meth, their_node_id, msg);
698 void handle_shutdown_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKShutdown *msg) {
699 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
700 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_shutdown_meth, their_node_id, msg);
702 void handle_closing_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned *msg) {
703 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
704 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_closing_signed_meth, their_node_id, msg);
706 void handle_update_add_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC *msg) {
707 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
708 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_update_add_htlc_meth, their_node_id, msg);
710 void handle_update_fulfill_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC *msg) {
711 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
712 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_update_fulfill_htlc_meth, their_node_id, msg);
714 void handle_update_fail_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC *msg) {
715 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
716 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_update_fail_htlc_meth, their_node_id, msg);
718 void handle_update_fail_malformed_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC *msg) {
719 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
720 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_update_fail_malformed_htlc_meth, their_node_id, msg);
722 void handle_commitment_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned *msg) {
723 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
724 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_commitment_signed_meth, their_node_id, msg);
726 void handle_revoke_and_ack_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK *msg) {
727 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
728 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_revoke_and_ack_meth, their_node_id, msg);
730 void handle_update_fee_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee *msg) {
731 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
732 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_update_fee_meth, their_node_id, msg);
734 void handle_announcement_signatures_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures *msg) {
735 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
736 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_announcement_signatures_meth, their_node_id, msg);
738 void peer_disconnected_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) {
739 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
740 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->peer_disconnected_meth, their_node_id, no_connection_possible);
742 void peer_connected_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit *msg) {
743 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
744 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->peer_connected_meth, their_node_id, msg);
746 void handle_channel_reestablish_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReestablish *msg) {
747 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
748 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_channel_reestablish_meth, their_node_id, msg);
750 void handle_error_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage *msg) {
751 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
752 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_error_meth, their_node_id, msg);
754 void LDKChannelMessageHandler_JCalls_free(void* this_arg) {
755 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
756 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
757 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
761 void* LDKChannelMessageHandler_JCalls_clone(const void* this_arg) {
762 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
763 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
764 atomic_fetch_add_explicit(&j_calls->MessageSendEventsProvider->refcnt, 1, memory_order_release);
765 return (void*) this_arg;
767 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1new (JNIEnv * env, jclass _a, jobject o, jobject MessageSendEventsProvider) {
768 jclass c = (*env)->GetObjectClass(env, o);
770 LDKChannelMessageHandler_JCalls *calls = malloc(sizeof(LDKChannelMessageHandler_JCalls));
771 atomic_init(&calls->refcnt, 1);
773 calls->o = (*env)->NewGlobalRef(env, o);
774 calls->handle_open_channel_meth = (*env)->GetMethodID(env, c, "handle_open_channel", "(JJJ)V");
775 assert(calls->handle_open_channel_meth != NULL);
776 calls->handle_accept_channel_meth = (*env)->GetMethodID(env, c, "handle_accept_channel", "(JJJ)V");
777 assert(calls->handle_accept_channel_meth != NULL);
778 calls->handle_funding_created_meth = (*env)->GetMethodID(env, c, "handle_funding_created", "(JJ)V");
779 assert(calls->handle_funding_created_meth != NULL);
780 calls->handle_funding_signed_meth = (*env)->GetMethodID(env, c, "handle_funding_signed", "(JJ)V");
781 assert(calls->handle_funding_signed_meth != NULL);
782 calls->handle_funding_locked_meth = (*env)->GetMethodID(env, c, "handle_funding_locked", "(JJ)V");
783 assert(calls->handle_funding_locked_meth != NULL);
784 calls->handle_shutdown_meth = (*env)->GetMethodID(env, c, "handle_shutdown", "(JJ)V");
785 assert(calls->handle_shutdown_meth != NULL);
786 calls->handle_closing_signed_meth = (*env)->GetMethodID(env, c, "handle_closing_signed", "(JJ)V");
787 assert(calls->handle_closing_signed_meth != NULL);
788 calls->handle_update_add_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_add_htlc", "(JJ)V");
789 assert(calls->handle_update_add_htlc_meth != NULL);
790 calls->handle_update_fulfill_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fulfill_htlc", "(JJ)V");
791 assert(calls->handle_update_fulfill_htlc_meth != NULL);
792 calls->handle_update_fail_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fail_htlc", "(JJ)V");
793 assert(calls->handle_update_fail_htlc_meth != NULL);
794 calls->handle_update_fail_malformed_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fail_malformed_htlc", "(JJ)V");
795 assert(calls->handle_update_fail_malformed_htlc_meth != NULL);
796 calls->handle_commitment_signed_meth = (*env)->GetMethodID(env, c, "handle_commitment_signed", "(JJ)V");
797 assert(calls->handle_commitment_signed_meth != NULL);
798 calls->handle_revoke_and_ack_meth = (*env)->GetMethodID(env, c, "handle_revoke_and_ack", "(JJ)V");
799 assert(calls->handle_revoke_and_ack_meth != NULL);
800 calls->handle_update_fee_meth = (*env)->GetMethodID(env, c, "handle_update_fee", "(JJ)V");
801 assert(calls->handle_update_fee_meth != NULL);
802 calls->handle_announcement_signatures_meth = (*env)->GetMethodID(env, c, "handle_announcement_signatures", "(JJ)V");
803 assert(calls->handle_announcement_signatures_meth != NULL);
804 calls->peer_disconnected_meth = (*env)->GetMethodID(env, c, "peer_disconnected", "(JZ)V");
805 assert(calls->peer_disconnected_meth != NULL);
806 calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "(JJ)V");
807 assert(calls->peer_connected_meth != NULL);
808 calls->handle_channel_reestablish_meth = (*env)->GetMethodID(env, c, "handle_channel_reestablish", "(JJ)V");
809 assert(calls->handle_channel_reestablish_meth != NULL);
810 calls->handle_error_meth = (*env)->GetMethodID(env, c, "handle_error", "(JJ)V");
811 assert(calls->handle_error_meth != NULL);
813 LDKChannelMessageHandler *ret = malloc(sizeof(LDKChannelMessageHandler));
814 ret->this_arg = (void*) calls;
815 ret->handle_open_channel = handle_open_channel_jcall;
816 ret->handle_accept_channel = handle_accept_channel_jcall;
817 ret->handle_funding_created = handle_funding_created_jcall;
818 ret->handle_funding_signed = handle_funding_signed_jcall;
819 ret->handle_funding_locked = handle_funding_locked_jcall;
820 ret->handle_shutdown = handle_shutdown_jcall;
821 ret->handle_closing_signed = handle_closing_signed_jcall;
822 ret->handle_update_add_htlc = handle_update_add_htlc_jcall;
823 ret->handle_update_fulfill_htlc = handle_update_fulfill_htlc_jcall;
824 ret->handle_update_fail_htlc = handle_update_fail_htlc_jcall;
825 ret->handle_update_fail_malformed_htlc = handle_update_fail_malformed_htlc_jcall;
826 ret->handle_commitment_signed = handle_commitment_signed_jcall;
827 ret->handle_revoke_and_ack = handle_revoke_and_ack_jcall;
828 ret->handle_update_fee = handle_update_fee_jcall;
829 ret->handle_announcement_signatures = handle_announcement_signatures_jcall;
830 ret->peer_disconnected = peer_disconnected_jcall;
831 ret->peer_connected = peer_connected_jcall;
832 ret->handle_channel_reestablish = handle_channel_reestablish_jcall;
833 ret->handle_error = handle_error_jcall;
834 ret->free = LDKChannelMessageHandler_JCalls_free;
835 ret->MessageSendEventsProvider = *(LDKMessageSendEventsProvider*)Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1new(env, _a, MessageSendEventsProvider);
836 calls->MessageSendEventsProvider = ret->MessageSendEventsProvider.this_arg;
840 typedef struct LDKRoutingMessageHandler_JCalls {
841 atomic_size_t refcnt;
844 jmethodID handle_node_announcement_meth;
845 jmethodID handle_channel_announcement_meth;
846 jmethodID handle_channel_update_meth;
847 jmethodID handle_htlc_fail_channel_update_meth;
848 jmethodID get_next_channel_announcements_meth;
849 jmethodID get_next_node_announcements_meth;
850 jmethodID should_request_full_sync_meth;
851 } LDKRoutingMessageHandler_JCalls;
852 LDKCResult_boolLightningErrorZ handle_node_announcement_jcall(const void* this_arg, const LDKNodeAnnouncement *msg) {
853 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
854 LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->handle_node_announcement_meth, msg);
855 LDKCResult_boolLightningErrorZ res = *ret;
859 LDKCResult_boolLightningErrorZ handle_channel_announcement_jcall(const void* this_arg, const LDKChannelAnnouncement *msg) {
860 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
861 LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->handle_channel_announcement_meth, msg);
862 LDKCResult_boolLightningErrorZ res = *ret;
866 LDKCResult_boolLightningErrorZ handle_channel_update_jcall(const void* this_arg, const LDKChannelUpdate *msg) {
867 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
868 LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->handle_channel_update_meth, msg);
869 LDKCResult_boolLightningErrorZ res = *ret;
873 void handle_htlc_fail_channel_update_jcall(const void* this_arg, const LDKHTLCFailChannelUpdate *update) {
874 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
875 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_htlc_fail_channel_update_meth, update);
877 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcements_jcall(const void* this_arg, uint64_t starting_point, uint8_t batch_amount) {
878 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
879 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);
880 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ res = *ret;
884 LDKCVec_NodeAnnouncementZ get_next_node_announcements_jcall(const void* this_arg, LDKPublicKey starting_point, uint8_t batch_amount) {
885 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
886 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);
887 LDKCVec_NodeAnnouncementZ res = *ret;
891 bool should_request_full_sync_jcall(const void* this_arg, LDKPublicKey node_id) {
892 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
893 return (*j_calls->env)->CallBooleanMethod(j_calls->env, j_calls->o, j_calls->should_request_full_sync_meth, node_id);
895 void LDKRoutingMessageHandler_JCalls_free(void* this_arg) {
896 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
897 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
898 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
902 void* LDKRoutingMessageHandler_JCalls_clone(const void* this_arg) {
903 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
904 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
905 return (void*) this_arg;
907 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1new (JNIEnv * env, jclass _a, jobject o) {
908 jclass c = (*env)->GetObjectClass(env, o);
910 LDKRoutingMessageHandler_JCalls *calls = malloc(sizeof(LDKRoutingMessageHandler_JCalls));
911 atomic_init(&calls->refcnt, 1);
913 calls->o = (*env)->NewGlobalRef(env, o);
914 calls->handle_node_announcement_meth = (*env)->GetMethodID(env, c, "handle_node_announcement", "(J)J");
915 assert(calls->handle_node_announcement_meth != NULL);
916 calls->handle_channel_announcement_meth = (*env)->GetMethodID(env, c, "handle_channel_announcement", "(J)J");
917 assert(calls->handle_channel_announcement_meth != NULL);
918 calls->handle_channel_update_meth = (*env)->GetMethodID(env, c, "handle_channel_update", "(J)J");
919 assert(calls->handle_channel_update_meth != NULL);
920 calls->handle_htlc_fail_channel_update_meth = (*env)->GetMethodID(env, c, "handle_htlc_fail_channel_update", "(J)V");
921 assert(calls->handle_htlc_fail_channel_update_meth != NULL);
922 calls->get_next_channel_announcements_meth = (*env)->GetMethodID(env, c, "get_next_channel_announcements", "(JB)J");
923 assert(calls->get_next_channel_announcements_meth != NULL);
924 calls->get_next_node_announcements_meth = (*env)->GetMethodID(env, c, "get_next_node_announcements", "(JB)J");
925 assert(calls->get_next_node_announcements_meth != NULL);
926 calls->should_request_full_sync_meth = (*env)->GetMethodID(env, c, "should_request_full_sync", "(J)Z");
927 assert(calls->should_request_full_sync_meth != NULL);
929 LDKRoutingMessageHandler *ret = malloc(sizeof(LDKRoutingMessageHandler));
930 ret->this_arg = (void*) calls;
931 ret->handle_node_announcement = handle_node_announcement_jcall;
932 ret->handle_channel_announcement = handle_channel_announcement_jcall;
933 ret->handle_channel_update = handle_channel_update_jcall;
934 ret->handle_htlc_fail_channel_update = handle_htlc_fail_channel_update_jcall;
935 ret->get_next_channel_announcements = get_next_channel_announcements_jcall;
936 ret->get_next_node_announcements = get_next_node_announcements_jcall;
937 ret->should_request_full_sync = should_request_full_sync_jcall;
938 ret->free = LDKRoutingMessageHandler_JCalls_free;
942 typedef struct LDKSocketDescriptor_JCalls {
943 atomic_size_t refcnt;
946 jmethodID send_data_meth;
947 jmethodID disconnect_socket_meth;
950 } LDKSocketDescriptor_JCalls;
951 uintptr_t send_data_jcall(void* this_arg, LDKu8slice data, bool resume_read) {
952 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
953 uintptr_t* ret = (uintptr_t*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->send_data_meth, data, resume_read);
954 uintptr_t res = *ret;
958 void disconnect_socket_jcall(void* this_arg) {
959 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
960 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->disconnect_socket_meth);
962 bool eq_jcall(const void* this_arg, const void *other_arg) {
963 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
964 return (*j_calls->env)->CallBooleanMethod(j_calls->env, j_calls->o, j_calls->eq_meth, other_arg);
966 uint64_t hash_jcall(const void* this_arg) {
967 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
968 return (*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->hash_meth);
970 void LDKSocketDescriptor_JCalls_free(void* this_arg) {
971 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
972 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
973 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
977 void* LDKSocketDescriptor_JCalls_clone(const void* this_arg) {
978 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
979 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
980 return (void*) this_arg;
982 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1new (JNIEnv * env, jclass _a, jobject o) {
983 jclass c = (*env)->GetObjectClass(env, o);
985 LDKSocketDescriptor_JCalls *calls = malloc(sizeof(LDKSocketDescriptor_JCalls));
986 atomic_init(&calls->refcnt, 1);
988 calls->o = (*env)->NewGlobalRef(env, o);
989 calls->send_data_meth = (*env)->GetMethodID(env, c, "send_data", "(JZ)J");
990 assert(calls->send_data_meth != NULL);
991 calls->disconnect_socket_meth = (*env)->GetMethodID(env, c, "disconnect_socket", "()V");
992 assert(calls->disconnect_socket_meth != NULL);
993 calls->eq_meth = (*env)->GetMethodID(env, c, "eq", "(V)Z");
994 assert(calls->eq_meth != NULL);
995 calls->hash_meth = (*env)->GetMethodID(env, c, "hash", "()J");
996 assert(calls->hash_meth != NULL);
998 LDKSocketDescriptor *ret = malloc(sizeof(LDKSocketDescriptor));
999 ret->this_arg = (void*) calls;
1000 ret->send_data = send_data_jcall;
1001 ret->disconnect_socket = disconnect_socket_jcall;
1003 ret->hash = hash_jcall;
1004 ret->clone = LDKSocketDescriptor_JCalls_clone;
1005 ret->free = LDKSocketDescriptor_JCalls_free;
1009 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HTLCOutputInCommitmentSignatureZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1010 LDKC2Tuple_HTLCOutputInCommitmentSignatureZ arg_conv = *(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ*)arg;
1012 return C2Tuple_HTLCOutputInCommitmentSignatureZ_free(arg_conv);
1015 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1016 LDKC2Tuple_OutPointScriptZ arg_conv = *(LDKC2Tuple_OutPointScriptZ*)arg;
1018 return C2Tuple_OutPointScriptZ_free(arg_conv);
1021 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1Scriptu64Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
1022 LDKC2Tuple_Scriptu64Z arg_conv = *(LDKC2Tuple_Scriptu64Z*)arg;
1024 return C2Tuple_Scriptu64Z_free(arg_conv);
1027 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1028 LDKC2Tuple_SignatureCVec_SignatureZZ arg_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)arg;
1030 return C2Tuple_SignatureCVec_SignatureZZ_free(arg_conv);
1033 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1Txidu32Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
1034 LDKC2Tuple_Txidu32Z arg_conv = *(LDKC2Tuple_Txidu32Z*)arg;
1036 return C2Tuple_Txidu32Z_free(arg_conv);
1039 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
1040 LDKC2Tuple_u64u64Z arg_conv = *(LDKC2Tuple_u64u64Z*)arg;
1042 return C2Tuple_u64u64Z_free(arg_conv);
1045 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1046 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arg_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)arg;
1048 return C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(arg_conv);
1051 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1Scriptu64ZChainErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1052 LDKChainError arg_conv = *(LDKChainError*)arg;
1054 LDKCResult_C2Tuple_Scriptu64ZChainErrorZ* ret = malloc(sizeof(LDKCResult_C2Tuple_Scriptu64ZChainErrorZ));
1055 *ret = CResult_C2Tuple_Scriptu64ZChainErrorZ_err(arg_conv);
1059 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1Scriptu64ZChainErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1060 LDKCResult_C2Tuple_Scriptu64ZChainErrorZ arg_conv = *(LDKCResult_C2Tuple_Scriptu64ZChainErrorZ*)arg;
1062 return CResult_C2Tuple_Scriptu64ZChainErrorZ_free(arg_conv);
1065 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1Scriptu64ZChainErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1066 LDKC2Tuple_Scriptu64Z arg_conv = *(LDKC2Tuple_Scriptu64Z*)arg;
1068 LDKCResult_C2Tuple_Scriptu64ZChainErrorZ* ret = malloc(sizeof(LDKCResult_C2Tuple_Scriptu64ZChainErrorZ));
1069 *ret = CResult_C2Tuple_Scriptu64ZChainErrorZ_ok(arg_conv);
1073 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1074 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ arg_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg;
1076 return CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(arg_conv);
1079 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1080 LDKC2Tuple_SignatureCVec_SignatureZZ arg_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)arg;
1082 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = malloc(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ));
1083 *ret = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(arg_conv);
1087 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1088 LDKCResult_CVec_SignatureZNoneZ arg_conv = *(LDKCResult_CVec_SignatureZNoneZ*)arg;
1090 return CResult_CVec_SignatureZNoneZ_free(arg_conv);
1093 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1094 LDKCVec_SignatureZ arg_conv = *(LDKCVec_SignatureZ*)arg;
1096 LDKCResult_CVec_SignatureZNoneZ* ret = malloc(sizeof(LDKCResult_CVec_SignatureZNoneZ));
1097 *ret = CResult_CVec_SignatureZNoneZ_ok(arg_conv);
1101 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1102 LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg;
1104 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret = malloc(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ));
1105 *ret = CResult_CVec_u8ZPeerHandleErrorZ_err(arg_conv);
1109 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1110 LDKCResult_CVec_u8ZPeerHandleErrorZ arg_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg;
1112 return CResult_CVec_u8ZPeerHandleErrorZ_free(arg_conv);
1115 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1116 LDKCVec_u8Z arg_conv = *(LDKCVec_u8Z*)arg;
1118 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret = malloc(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ));
1119 *ret = CResult_CVec_u8ZPeerHandleErrorZ_ok(arg_conv);
1123 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1124 LDKAPIError arg_conv = *(LDKAPIError*)arg;
1126 LDKCResult_NoneAPIErrorZ* ret = malloc(sizeof(LDKCResult_NoneAPIErrorZ));
1127 *ret = CResult_NoneAPIErrorZ_err(arg_conv);
1131 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1132 LDKCResult_NoneAPIErrorZ arg_conv = *(LDKCResult_NoneAPIErrorZ*)arg;
1134 return CResult_NoneAPIErrorZ_free(arg_conv);
1137 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1138 LDKChannelMonitorUpdateErr arg_conv = *(LDKChannelMonitorUpdateErr*)arg;
1140 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = malloc(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ));
1141 *ret = CResult_NoneChannelMonitorUpdateErrZ_err(arg_conv);
1145 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1146 LDKCResult_NoneChannelMonitorUpdateErrZ arg_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)arg;
1148 return CResult_NoneChannelMonitorUpdateErrZ_free(arg_conv);
1151 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1152 LDKMonitorUpdateError arg_conv = *(LDKMonitorUpdateError*)arg;
1154 LDKCResult_NoneMonitorUpdateErrorZ* ret = malloc(sizeof(LDKCResult_NoneMonitorUpdateErrorZ));
1155 *ret = CResult_NoneMonitorUpdateErrorZ_err(arg_conv);
1159 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1160 LDKCResult_NoneMonitorUpdateErrorZ arg_conv = *(LDKCResult_NoneMonitorUpdateErrorZ*)arg;
1162 return CResult_NoneMonitorUpdateErrorZ_free(arg_conv);
1165 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1166 LDKPaymentSendFailure arg_conv = *(LDKPaymentSendFailure*)arg;
1168 LDKCResult_NonePaymentSendFailureZ* ret = malloc(sizeof(LDKCResult_NonePaymentSendFailureZ));
1169 *ret = CResult_NonePaymentSendFailureZ_err(arg_conv);
1173 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1174 LDKCResult_NonePaymentSendFailureZ arg_conv = *(LDKCResult_NonePaymentSendFailureZ*)arg;
1176 return CResult_NonePaymentSendFailureZ_free(arg_conv);
1179 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1180 LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg;
1182 LDKCResult_NonePeerHandleErrorZ* ret = malloc(sizeof(LDKCResult_NonePeerHandleErrorZ));
1183 *ret = CResult_NonePeerHandleErrorZ_err(arg_conv);
1187 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1188 LDKCResult_NonePeerHandleErrorZ arg_conv = *(LDKCResult_NonePeerHandleErrorZ*)arg;
1190 return CResult_NonePeerHandleErrorZ_free(arg_conv);
1193 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1194 LDKLightningError arg_conv = *(LDKLightningError*)arg;
1196 LDKCResult_RouteLightningErrorZ* ret = malloc(sizeof(LDKCResult_RouteLightningErrorZ));
1197 *ret = CResult_RouteLightningErrorZ_err(arg_conv);
1201 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1202 LDKCResult_RouteLightningErrorZ arg_conv = *(LDKCResult_RouteLightningErrorZ*)arg;
1204 return CResult_RouteLightningErrorZ_free(arg_conv);
1207 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1208 LDKRoute arg_conv = *(LDKRoute*)arg;
1210 LDKCResult_RouteLightningErrorZ* ret = malloc(sizeof(LDKCResult_RouteLightningErrorZ));
1211 *ret = CResult_RouteLightningErrorZ_ok(arg_conv);
1215 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1216 LDKCResult_SignatureNoneZ arg_conv = *(LDKCResult_SignatureNoneZ*)arg;
1218 return CResult_SignatureNoneZ_free(arg_conv);
1221 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1222 LDKSignature arg_conv = *(LDKSignature*)arg;
1224 LDKCResult_SignatureNoneZ* ret = malloc(sizeof(LDKCResult_SignatureNoneZ));
1225 *ret = CResult_SignatureNoneZ_ok(arg_conv);
1229 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1230 LDKSecp256k1Error arg_conv = *(LDKSecp256k1Error*)arg;
1232 LDKCResult_TxCreationKeysSecpErrorZ* ret = malloc(sizeof(LDKCResult_TxCreationKeysSecpErrorZ));
1233 *ret = CResult_TxCreationKeysSecpErrorZ_err(arg_conv);
1237 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1238 LDKCResult_TxCreationKeysSecpErrorZ arg_conv = *(LDKCResult_TxCreationKeysSecpErrorZ*)arg;
1240 return CResult_TxCreationKeysSecpErrorZ_free(arg_conv);
1243 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1244 LDKTxCreationKeys arg_conv = *(LDKTxCreationKeys*)arg;
1246 LDKCResult_TxCreationKeysSecpErrorZ* ret = malloc(sizeof(LDKCResult_TxCreationKeysSecpErrorZ));
1247 *ret = CResult_TxCreationKeysSecpErrorZ_ok(arg_conv);
1251 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1252 LDKLightningError arg_conv = *(LDKLightningError*)arg;
1254 LDKCResult_boolLightningErrorZ* ret = malloc(sizeof(LDKCResult_boolLightningErrorZ));
1255 *ret = CResult_boolLightningErrorZ_err(arg_conv);
1259 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1260 LDKCResult_boolLightningErrorZ arg_conv = *(LDKCResult_boolLightningErrorZ*)arg;
1262 return CResult_boolLightningErrorZ_free(arg_conv);
1265 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1ok(JNIEnv * _env, jclass _b, jboolean arg) {
1266 LDKCResult_boolLightningErrorZ* ret = malloc(sizeof(LDKCResult_boolLightningErrorZ));
1267 *ret = CResult_boolLightningErrorZ_ok(arg);
1271 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1272 LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg;
1274 LDKCResult_boolPeerHandleErrorZ* ret = malloc(sizeof(LDKCResult_boolPeerHandleErrorZ));
1275 *ret = CResult_boolPeerHandleErrorZ_err(arg_conv);
1279 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1280 LDKCResult_boolPeerHandleErrorZ arg_conv = *(LDKCResult_boolPeerHandleErrorZ*)arg;
1282 return CResult_boolPeerHandleErrorZ_free(arg_conv);
1285 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b, jboolean arg) {
1286 LDKCResult_boolPeerHandleErrorZ* ret = malloc(sizeof(LDKCResult_boolPeerHandleErrorZ));
1287 *ret = CResult_boolPeerHandleErrorZ_ok(arg);
1291 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1HTLCOutputInCommitmentSignatureZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1292 LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ arg_conv = *(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ*)arg;
1294 return CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ_free(arg_conv);
1297 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1298 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ arg_conv = *(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)arg;
1300 return CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(arg_conv);
1303 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1RouteHopZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1304 LDKCVec_CVec_RouteHopZZ arg_conv = *(LDKCVec_CVec_RouteHopZZ*)arg;
1306 return CVec_CVec_RouteHopZZ_free(arg_conv);
1309 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1310 LDKCVec_ChannelDetailsZ arg_conv = *(LDKCVec_ChannelDetailsZ*)arg;
1312 return CVec_ChannelDetailsZ_free(arg_conv);
1315 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelMonitorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1316 LDKCVec_ChannelMonitorZ arg_conv = *(LDKCVec_ChannelMonitorZ*)arg;
1318 return CVec_ChannelMonitorZ_free(arg_conv);
1321 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1EventZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1322 LDKCVec_EventZ arg_conv = *(LDKCVec_EventZ*)arg;
1324 return CVec_EventZ_free(arg_conv);
1327 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1HTLCOutputInCommitmentZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1328 LDKCVec_HTLCOutputInCommitmentZ arg_conv = *(LDKCVec_HTLCOutputInCommitmentZ*)arg;
1330 return CVec_HTLCOutputInCommitmentZ_free(arg_conv);
1333 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MessageSendEventZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1334 LDKCVec_MessageSendEventZ arg_conv = *(LDKCVec_MessageSendEventZ*)arg;
1336 return CVec_MessageSendEventZ_free(arg_conv);
1339 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorEventZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1340 LDKCVec_MonitorEventZ arg_conv = *(LDKCVec_MonitorEventZ*)arg;
1342 return CVec_MonitorEventZ_free(arg_conv);
1345 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NetAddressZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1346 LDKCVec_NetAddressZ arg_conv = *(LDKCVec_NetAddressZ*)arg;
1348 return CVec_NetAddressZ_free(arg_conv);
1351 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NodeAnnouncementZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1352 LDKCVec_NodeAnnouncementZ arg_conv = *(LDKCVec_NodeAnnouncementZ*)arg;
1354 return CVec_NodeAnnouncementZ_free(arg_conv);
1357 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PublicKeyZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1358 LDKCVec_PublicKeyZ arg_conv = *(LDKCVec_PublicKeyZ*)arg;
1360 return CVec_PublicKeyZ_free(arg_conv);
1363 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1364 LDKCVec_RouteHintZ arg_conv = *(LDKCVec_RouteHintZ*)arg;
1366 return CVec_RouteHintZ_free(arg_conv);
1369 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHopZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1370 LDKCVec_RouteHopZ arg_conv = *(LDKCVec_RouteHopZ*)arg;
1372 return CVec_RouteHopZ_free(arg_conv);
1375 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SignatureZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1376 LDKCVec_SignatureZ arg_conv = *(LDKCVec_SignatureZ*)arg;
1378 return CVec_SignatureZ_free(arg_conv);
1381 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SpendableOutputDescriptorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1382 LDKCVec_SpendableOutputDescriptorZ arg_conv = *(LDKCVec_SpendableOutputDescriptorZ*)arg;
1384 return CVec_SpendableOutputDescriptorZ_free(arg_conv);
1387 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1388 LDKCVec_TransactionZ arg_conv = *(LDKCVec_TransactionZ*)arg;
1390 return CVec_TransactionZ_free(arg_conv);
1393 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateAddHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1394 LDKCVec_UpdateAddHTLCZ arg_conv = *(LDKCVec_UpdateAddHTLCZ*)arg;
1396 return CVec_UpdateAddHTLCZ_free(arg_conv);
1399 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1400 LDKCVec_UpdateFailHTLCZ arg_conv = *(LDKCVec_UpdateFailHTLCZ*)arg;
1402 return CVec_UpdateFailHTLCZ_free(arg_conv);
1405 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailMalformedHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1406 LDKCVec_UpdateFailMalformedHTLCZ arg_conv = *(LDKCVec_UpdateFailMalformedHTLCZ*)arg;
1408 return CVec_UpdateFailMalformedHTLCZ_free(arg_conv);
1411 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFulfillHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1412 LDKCVec_UpdateFulfillHTLCZ arg_conv = *(LDKCVec_UpdateFulfillHTLCZ*)arg;
1414 return CVec_UpdateFulfillHTLCZ_free(arg_conv);
1417 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u64Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
1418 LDKCVec_u64Z arg_conv = *(LDKCVec_u64Z*)arg;
1420 return CVec_u64Z_free(arg_conv);
1423 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u8Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
1424 LDKCVec_u8Z arg_conv = *(LDKCVec_u8Z*)arg;
1426 return CVec_u8Z_free(arg_conv);
1429 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1usizeZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1430 LDKCVec_usizeZ arg_conv = *(LDKCVec_usizeZ*)arg;
1432 return CVec_usizeZ_free(arg_conv);
1435 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_1free(JNIEnv * _env, jclass _b, jlong _res) {
1436 LDKTxOut _res_conv = *(LDKTxOut*)_res;
1438 return TxOut_free(_res_conv);
1441 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1Txidu32Z_1new(JNIEnv * _env, jclass _b, jlong a, jint b) {
1442 LDKThirtyTwoBytes a_conv = *(LDKThirtyTwoBytes*)a;
1444 LDKC2Tuple_Txidu32Z* ret = malloc(sizeof(LDKC2Tuple_Txidu32Z));
1445 *ret = C2Tuple_Txidu32Z_new(a_conv, b);
1449 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1Scriptu64Z_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
1450 LDKCVec_u8Z a_conv = *(LDKCVec_u8Z*)a;
1452 LDKC2Tuple_Scriptu64Z* ret = malloc(sizeof(LDKC2Tuple_Scriptu64Z));
1453 *ret = C2Tuple_Scriptu64Z_new(a_conv, b);
1457 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
1458 LDKC2Tuple_u64u64Z* ret = malloc(sizeof(LDKC2Tuple_u64u64Z));
1459 *ret = C2Tuple_u64u64Z_new(a, b);
1463 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
1464 LDKSignature a_conv = *(LDKSignature*)a;
1466 LDKCVec_SignatureZ b_conv = *(LDKCVec_SignatureZ*)b;
1468 LDKC2Tuple_SignatureCVec_SignatureZZ* ret = malloc(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ));
1469 *ret = C2Tuple_SignatureCVec_SignatureZZ_new(a_conv, b_conv);
1473 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1err(JNIEnv * _env, jclass _b) {
1474 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = malloc(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ));
1475 *ret = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err();
1479 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1err(JNIEnv * _env, jclass _b) {
1480 LDKCResult_SignatureNoneZ* ret = malloc(sizeof(LDKCResult_SignatureNoneZ));
1481 *ret = CResult_SignatureNoneZ_err();
1485 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1err(JNIEnv * _env, jclass _b) {
1486 LDKCResult_CVec_SignatureZNoneZ* ret = malloc(sizeof(LDKCResult_CVec_SignatureZNoneZ));
1487 *ret = CResult_CVec_SignatureZNoneZ_err();
1491 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1ok(JNIEnv * _env, jclass _b) {
1492 LDKCResult_NoneAPIErrorZ* ret = malloc(sizeof(LDKCResult_NoneAPIErrorZ));
1493 *ret = CResult_NoneAPIErrorZ_ok();
1497 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1ok(JNIEnv * _env, jclass _b) {
1498 LDKCResult_NonePaymentSendFailureZ* ret = malloc(sizeof(LDKCResult_NonePaymentSendFailureZ));
1499 *ret = CResult_NonePaymentSendFailureZ_ok();
1503 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1ok(JNIEnv * _env, jclass _b) {
1504 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = malloc(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ));
1505 *ret = CResult_NoneChannelMonitorUpdateErrZ_ok();
1509 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1ok(JNIEnv * _env, jclass _b) {
1510 LDKCResult_NoneMonitorUpdateErrorZ* ret = malloc(sizeof(LDKCResult_NoneMonitorUpdateErrorZ));
1511 *ret = CResult_NoneMonitorUpdateErrorZ_ok();
1515 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
1516 LDKOutPoint a_conv = *(LDKOutPoint*)a;
1518 a_conv._underlying_ref = false;
1519 LDKCVec_u8Z b_conv = *(LDKCVec_u8Z*)b;
1521 LDKC2Tuple_OutPointScriptZ* ret = malloc(sizeof(LDKC2Tuple_OutPointScriptZ));
1522 *ret = C2Tuple_OutPointScriptZ_new(a_conv, b_conv);
1526 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b, jlong c) {
1527 LDKChannelAnnouncement a_conv = *(LDKChannelAnnouncement*)a;
1529 a_conv._underlying_ref = false;
1530 LDKChannelUpdate b_conv = *(LDKChannelUpdate*)b;
1532 b_conv._underlying_ref = false;
1533 LDKChannelUpdate c_conv = *(LDKChannelUpdate*)c;
1535 c_conv._underlying_ref = false;
1536 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret = malloc(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ));
1537 *ret = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a_conv, b_conv, c_conv);
1541 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b) {
1542 LDKCResult_NonePeerHandleErrorZ* ret = malloc(sizeof(LDKCResult_NonePeerHandleErrorZ));
1543 *ret = CResult_NonePeerHandleErrorZ_ok();
1547 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HTLCOutputInCommitmentSignatureZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
1548 LDKHTLCOutputInCommitment a_conv = *(LDKHTLCOutputInCommitment*)a;
1550 a_conv._underlying_ref = false;
1551 LDKSignature b_conv = *(LDKSignature*)b;
1553 LDKC2Tuple_HTLCOutputInCommitmentSignatureZ* ret = malloc(sizeof(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ));
1554 *ret = C2Tuple_HTLCOutputInCommitmentSignatureZ_new(a_conv, b_conv);
1558 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1559 LDKEvent this_ptr_conv = *(LDKEvent*)this_ptr;
1560 free((void*)this_ptr);
1561 return Event_free(this_ptr_conv);
1564 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1565 LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)this_ptr;
1566 free((void*)this_ptr);
1567 return MessageSendEvent_free(this_ptr_conv);
1570 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1571 LDKMessageSendEventsProvider *this_ptr_conv = (LDKMessageSendEventsProvider*)this_ptr;
1572 return MessageSendEventsProvider_free(*this_ptr_conv);
1575 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1576 LDKEventsProvider *this_ptr_conv = (LDKEventsProvider*)this_ptr;
1577 return EventsProvider_free(*this_ptr_conv);
1580 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_APIError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1581 LDKAPIError this_ptr_conv = *(LDKAPIError*)this_ptr;
1582 free((void*)this_ptr);
1583 return APIError_free(this_ptr_conv);
1586 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Level_1max(JNIEnv * _env, jclass _b) {
1587 LDKLevel* ret = malloc(sizeof(LDKLevel));
1592 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Logger_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1593 LDKLogger *this_ptr_conv = (LDKLogger*)this_ptr;
1594 return Logger_free(*this_ptr_conv);
1597 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1598 LDKChannelHandshakeConfig this_ptr_conv = *(LDKChannelHandshakeConfig*)this_ptr;
1599 free((void*)this_ptr);
1600 this_ptr_conv._underlying_ref = false;
1601 return ChannelHandshakeConfig_free(this_ptr_conv);
1604 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr) {
1605 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
1606 return ChannelHandshakeConfig_get_minimum_depth(this_ptr_conv);
1609 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
1610 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
1611 return ChannelHandshakeConfig_set_minimum_depth(this_ptr_conv, val);
1614 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
1615 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
1616 return ChannelHandshakeConfig_get_our_to_self_delay(this_ptr_conv);
1619 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
1620 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
1621 return ChannelHandshakeConfig_set_our_to_self_delay(this_ptr_conv, val);
1624 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
1625 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
1626 return ChannelHandshakeConfig_get_our_htlc_minimum_msat(this_ptr_conv);
1629 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1630 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
1631 return ChannelHandshakeConfig_set_our_htlc_minimum_msat(this_ptr_conv, val);
1634 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) {
1635 LDKChannelHandshakeConfig* ret = malloc(sizeof(LDKChannelHandshakeConfig));
1636 *ret = ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg);
1637 assert(!ret->_underlying_ref);
1638 ret->_underlying_ref = true;
1642 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1default(JNIEnv * _env, jclass _b) {
1643 LDKChannelHandshakeConfig* ret = malloc(sizeof(LDKChannelHandshakeConfig));
1644 *ret = ChannelHandshakeConfig_default();
1645 assert(!ret->_underlying_ref);
1646 ret->_underlying_ref = true;
1650 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1651 LDKChannelHandshakeLimits this_ptr_conv = *(LDKChannelHandshakeLimits*)this_ptr;
1652 free((void*)this_ptr);
1653 this_ptr_conv._underlying_ref = false;
1654 return ChannelHandshakeLimits_free(this_ptr_conv);
1657 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
1658 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1659 return ChannelHandshakeLimits_get_min_funding_satoshis(this_ptr_conv);
1662 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1663 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1664 return ChannelHandshakeLimits_set_min_funding_satoshis(this_ptr_conv, val);
1667 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
1668 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1669 return ChannelHandshakeLimits_get_max_htlc_minimum_msat(this_ptr_conv);
1672 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1673 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1674 return ChannelHandshakeLimits_set_max_htlc_minimum_msat(this_ptr_conv, val);
1677 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
1678 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1679 return ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(this_ptr_conv);
1682 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) {
1683 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1684 return ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(this_ptr_conv, val);
1687 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
1688 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1689 return ChannelHandshakeLimits_get_max_channel_reserve_satoshis(this_ptr_conv);
1692 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1693 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1694 return ChannelHandshakeLimits_set_max_channel_reserve_satoshis(this_ptr_conv, val);
1697 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr) {
1698 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1699 return ChannelHandshakeLimits_get_min_max_accepted_htlcs(this_ptr_conv);
1702 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
1703 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1704 return ChannelHandshakeLimits_set_min_max_accepted_htlcs(this_ptr_conv, val);
1707 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
1708 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1709 return ChannelHandshakeLimits_get_min_dust_limit_satoshis(this_ptr_conv);
1712 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1713 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1714 return ChannelHandshakeLimits_set_min_dust_limit_satoshis(this_ptr_conv, val);
1717 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
1718 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1719 return ChannelHandshakeLimits_get_max_dust_limit_satoshis(this_ptr_conv);
1722 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1723 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1724 return ChannelHandshakeLimits_set_max_dust_limit_satoshis(this_ptr_conv, val);
1727 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr) {
1728 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1729 return ChannelHandshakeLimits_get_max_minimum_depth(this_ptr_conv);
1732 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
1733 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1734 return ChannelHandshakeLimits_set_max_minimum_depth(this_ptr_conv, val);
1737 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1force_1announced_1channel_1preference(JNIEnv * _env, jclass _b, jlong this_ptr) {
1738 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1739 return ChannelHandshakeLimits_get_force_announced_channel_preference(this_ptr_conv);
1742 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1force_1announced_1channel_1preference(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
1743 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1744 return ChannelHandshakeLimits_set_force_announced_channel_preference(this_ptr_conv, val);
1747 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1their_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
1748 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1749 return ChannelHandshakeLimits_get_their_to_self_delay(this_ptr_conv);
1752 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1their_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
1753 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1754 return ChannelHandshakeLimits_set_their_to_self_delay(this_ptr_conv, val);
1757 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) {
1758 LDKChannelHandshakeLimits* ret = malloc(sizeof(LDKChannelHandshakeLimits));
1759 *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);
1760 assert(!ret->_underlying_ref);
1761 ret->_underlying_ref = true;
1765 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1default(JNIEnv * _env, jclass _b) {
1766 LDKChannelHandshakeLimits* ret = malloc(sizeof(LDKChannelHandshakeLimits));
1767 *ret = ChannelHandshakeLimits_default();
1768 assert(!ret->_underlying_ref);
1769 ret->_underlying_ref = true;
1773 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1774 LDKChannelConfig this_ptr_conv = *(LDKChannelConfig*)this_ptr;
1775 free((void*)this_ptr);
1776 this_ptr_conv._underlying_ref = false;
1777 return ChannelConfig_free(this_ptr_conv);
1780 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr) {
1781 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
1782 return ChannelConfig_get_fee_proportional_millionths(this_ptr_conv);
1785 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
1786 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
1787 return ChannelConfig_set_fee_proportional_millionths(this_ptr_conv, val);
1790 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1announced_1channel(JNIEnv * _env, jclass _b, jlong this_ptr) {
1791 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
1792 return ChannelConfig_get_announced_channel(this_ptr_conv);
1795 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1announced_1channel(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
1796 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
1797 return ChannelConfig_set_announced_channel(this_ptr_conv, val);
1800 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1commit_1upfront_1shutdown_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
1801 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
1802 return ChannelConfig_get_commit_upfront_shutdown_pubkey(this_ptr_conv);
1805 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1commit_1upfront_1shutdown_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
1806 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
1807 return ChannelConfig_set_commit_upfront_shutdown_pubkey(this_ptr_conv, val);
1810 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) {
1811 LDKChannelConfig* ret = malloc(sizeof(LDKChannelConfig));
1812 *ret = ChannelConfig_new(fee_proportional_millionths_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg);
1813 assert(!ret->_underlying_ref);
1814 ret->_underlying_ref = true;
1818 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1default(JNIEnv * _env, jclass _b) {
1819 LDKChannelConfig* ret = malloc(sizeof(LDKChannelConfig));
1820 *ret = ChannelConfig_default();
1821 assert(!ret->_underlying_ref);
1822 ret->_underlying_ref = true;
1826 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1write(JNIEnv * _env, jclass _b, jlong obj) {
1827 LDKChannelConfig* obj_conv = (LDKChannelConfig*)obj;
1828 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
1829 *ret = ChannelConfig_write(obj_conv);
1833 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1read(JNIEnv * _env, jclass _b, jlong ser) {
1834 LDKu8slice ser_conv = *(LDKu8slice*)ser;
1836 LDKChannelConfig* ret = malloc(sizeof(LDKChannelConfig));
1837 *ret = ChannelConfig_read(ser_conv);
1838 assert(!ret->_underlying_ref);
1839 ret->_underlying_ref = true;
1843 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1844 LDKUserConfig this_ptr_conv = *(LDKUserConfig*)this_ptr;
1845 free((void*)this_ptr);
1846 this_ptr_conv._underlying_ref = false;
1847 return UserConfig_free(this_ptr_conv);
1850 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1own_1channel_1config(JNIEnv * _env, jclass _b, jlong this_ptr) {
1851 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
1852 LDKChannelHandshakeConfig* ret = malloc(sizeof(LDKChannelHandshakeConfig));
1853 *ret = UserConfig_get_own_channel_config(this_ptr_conv);
1854 assert(!ret->_underlying_ref);
1855 ret->_underlying_ref = true;
1859 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1own_1channel_1config(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1860 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
1861 LDKChannelHandshakeConfig val_conv = *(LDKChannelHandshakeConfig*)val;
1863 val_conv._underlying_ref = false;
1864 return UserConfig_set_own_channel_config(this_ptr_conv, val_conv);
1867 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1peer_1channel_1config_1limits(JNIEnv * _env, jclass _b, jlong this_ptr) {
1868 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
1869 LDKChannelHandshakeLimits* ret = malloc(sizeof(LDKChannelHandshakeLimits));
1870 *ret = UserConfig_get_peer_channel_config_limits(this_ptr_conv);
1871 assert(!ret->_underlying_ref);
1872 ret->_underlying_ref = true;
1876 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1peer_1channel_1config_1limits(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1877 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
1878 LDKChannelHandshakeLimits val_conv = *(LDKChannelHandshakeLimits*)val;
1880 val_conv._underlying_ref = false;
1881 return UserConfig_set_peer_channel_config_limits(this_ptr_conv, val_conv);
1884 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1channel_1options(JNIEnv * _env, jclass _b, jlong this_ptr) {
1885 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
1886 LDKChannelConfig* ret = malloc(sizeof(LDKChannelConfig));
1887 *ret = UserConfig_get_channel_options(this_ptr_conv);
1888 assert(!ret->_underlying_ref);
1889 ret->_underlying_ref = true;
1893 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1channel_1options(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1894 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
1895 LDKChannelConfig val_conv = *(LDKChannelConfig*)val;
1897 val_conv._underlying_ref = false;
1898 return UserConfig_set_channel_options(this_ptr_conv, val_conv);
1901 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) {
1902 LDKChannelHandshakeConfig own_channel_config_arg_conv = *(LDKChannelHandshakeConfig*)own_channel_config_arg;
1903 free((void*)own_channel_config_arg);
1904 own_channel_config_arg_conv._underlying_ref = false;
1905 LDKChannelHandshakeLimits peer_channel_config_limits_arg_conv = *(LDKChannelHandshakeLimits*)peer_channel_config_limits_arg;
1906 free((void*)peer_channel_config_limits_arg);
1907 peer_channel_config_limits_arg_conv._underlying_ref = false;
1908 LDKChannelConfig channel_options_arg_conv = *(LDKChannelConfig*)channel_options_arg;
1909 free((void*)channel_options_arg);
1910 channel_options_arg_conv._underlying_ref = false;
1911 LDKUserConfig* ret = malloc(sizeof(LDKUserConfig));
1912 *ret = UserConfig_new(own_channel_config_arg_conv, peer_channel_config_limits_arg_conv, channel_options_arg_conv);
1913 assert(!ret->_underlying_ref);
1914 ret->_underlying_ref = true;
1918 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1default(JNIEnv * _env, jclass _b) {
1919 LDKUserConfig* ret = malloc(sizeof(LDKUserConfig));
1920 *ret = UserConfig_default();
1921 assert(!ret->_underlying_ref);
1922 ret->_underlying_ref = true;
1926 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainWatchInterface_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1927 LDKChainWatchInterface *this_ptr_conv = (LDKChainWatchInterface*)this_ptr;
1928 return ChainWatchInterface_free(*this_ptr_conv);
1931 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1932 LDKBroadcasterInterface *this_ptr_conv = (LDKBroadcasterInterface*)this_ptr;
1933 return BroadcasterInterface_free(*this_ptr_conv);
1936 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainListener_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1937 LDKChainListener *this_ptr_conv = (LDKChainListener*)this_ptr;
1938 return ChainListener_free(*this_ptr_conv);
1941 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1942 LDKFeeEstimator *this_ptr_conv = (LDKFeeEstimator*)this_ptr;
1943 return FeeEstimator_free(*this_ptr_conv);
1946 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainWatchedUtil_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1947 LDKChainWatchedUtil this_ptr_conv = *(LDKChainWatchedUtil*)this_ptr;
1948 free((void*)this_ptr);
1949 this_ptr_conv._underlying_ref = false;
1950 return ChainWatchedUtil_free(this_ptr_conv);
1953 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainWatchedUtil_1new(JNIEnv * _env, jclass _b) {
1954 LDKChainWatchedUtil* ret = malloc(sizeof(LDKChainWatchedUtil));
1955 *ret = ChainWatchedUtil_new();
1956 assert(!ret->_underlying_ref);
1957 ret->_underlying_ref = true;
1961 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChainWatchedUtil_1register_1tx(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray txid, jlong script_pub_key) {
1962 LDKChainWatchedUtil* this_arg_conv = (LDKChainWatchedUtil*)this_arg;
1963 unsigned char txid_arr[32];
1964 (*_env)->GetByteArrayRegion (_env, txid, 0, 32, txid_arr);
1965 unsigned char (*txid_ref)[32] = &txid_arr;
1966 LDKu8slice script_pub_key_conv = *(LDKu8slice*)script_pub_key;
1967 free((void*)script_pub_key);
1968 return ChainWatchedUtil_register_tx(this_arg_conv, txid_ref, script_pub_key_conv);
1971 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChainWatchedUtil_1register_1outpoint(JNIEnv * _env, jclass _b, jlong this_arg, jlong outpoint, jlong _script_pub_key) {
1972 LDKChainWatchedUtil* this_arg_conv = (LDKChainWatchedUtil*)this_arg;
1973 LDKC2Tuple_Txidu32Z outpoint_conv = *(LDKC2Tuple_Txidu32Z*)outpoint;
1974 free((void*)outpoint);
1975 LDKu8slice _script_pub_key_conv = *(LDKu8slice*)_script_pub_key;
1976 free((void*)_script_pub_key);
1977 return ChainWatchedUtil_register_outpoint(this_arg_conv, outpoint_conv, _script_pub_key_conv);
1980 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChainWatchedUtil_1watch_1all(JNIEnv * _env, jclass _b, jlong this_arg) {
1981 LDKChainWatchedUtil* this_arg_conv = (LDKChainWatchedUtil*)this_arg;
1982 return ChainWatchedUtil_watch_all(this_arg_conv);
1985 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChainWatchedUtil_1does_1match_1tx(JNIEnv * _env, jclass _b, jlong this_arg, jlong tx) {
1986 LDKChainWatchedUtil* this_arg_conv = (LDKChainWatchedUtil*)this_arg;
1987 LDKTransaction tx_conv = *(LDKTransaction*)tx;
1989 return ChainWatchedUtil_does_match_tx(this_arg_conv, tx_conv);
1992 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlockNotifier_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1993 LDKBlockNotifier this_ptr_conv = *(LDKBlockNotifier*)this_ptr;
1994 free((void*)this_ptr);
1995 this_ptr_conv._underlying_ref = false;
1996 return BlockNotifier_free(this_ptr_conv);
1999 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_BlockNotifier_1new(JNIEnv * _env, jclass _b, jlong chain_monitor) {
2000 LDKChainWatchInterface *chain_monitor_conv = (LDKChainWatchInterface*)chain_monitor;
2001 LDKChainWatchInterface_JCalls_clone(chain_monitor_conv->this_arg);
2002 LDKBlockNotifier* ret = malloc(sizeof(LDKBlockNotifier));
2003 *ret = BlockNotifier_new(*chain_monitor_conv);
2004 assert(!ret->_underlying_ref);
2005 ret->_underlying_ref = true;
2009 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlockNotifier_1register_1listener(JNIEnv * _env, jclass _b, jlong this_arg, jlong listener) {
2010 LDKBlockNotifier* this_arg_conv = (LDKBlockNotifier*)this_arg;
2011 LDKChainListener *listener_conv = (LDKChainListener*)listener;
2012 LDKChainListener_JCalls_clone(listener_conv->this_arg);
2013 return BlockNotifier_register_listener(this_arg_conv, *listener_conv);
2016 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlockNotifier_1block_1connected(JNIEnv * _env, jclass _b, jlong this_arg, jlong block, jint height) {
2017 LDKBlockNotifier* this_arg_conv = (LDKBlockNotifier*)this_arg;
2018 LDKu8slice block_conv = *(LDKu8slice*)block;
2020 return BlockNotifier_block_connected(this_arg_conv, block_conv, height);
2023 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) {
2024 LDKBlockNotifier* this_arg_conv = (LDKBlockNotifier*)this_arg;
2025 unsigned char header_arr[80];
2026 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
2027 unsigned char (*header_ref)[80] = &header_arr;
2028 LDKCVec_TransactionZ txn_matched_conv = *(LDKCVec_TransactionZ*)txn_matched;
2029 free((void*)txn_matched);
2030 LDKusizeslice indexes_of_txn_matched_conv = *(LDKusizeslice*)indexes_of_txn_matched;
2031 free((void*)indexes_of_txn_matched);
2032 return BlockNotifier_block_connected_checked(this_arg_conv, header_ref, height, txn_matched_conv, indexes_of_txn_matched_conv);
2035 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BlockNotifier_1block_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jint disconnected_height) {
2036 LDKBlockNotifier* this_arg_conv = (LDKBlockNotifier*)this_arg;
2037 unsigned char header_arr[80];
2038 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
2039 unsigned char (*header_ref)[80] = &header_arr;
2040 return BlockNotifier_block_disconnected(this_arg_conv, header_ref, disconnected_height);
2043 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainWatchInterfaceUtil_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2044 LDKChainWatchInterfaceUtil this_ptr_conv = *(LDKChainWatchInterfaceUtil*)this_ptr;
2045 free((void*)this_ptr);
2046 this_ptr_conv._underlying_ref = false;
2047 return ChainWatchInterfaceUtil_free(this_ptr_conv);
2050 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainWatchInterfaceUtil_1as_1ChainWatchInterface(JNIEnv * _env, jclass _b, jlong this_arg) {
2051 LDKChainWatchInterfaceUtil* this_arg_conv = (LDKChainWatchInterfaceUtil*)this_arg;
2052 LDKChainWatchInterface* ret = malloc(sizeof(LDKChainWatchInterface));
2053 *ret = ChainWatchInterfaceUtil_as_ChainWatchInterface(this_arg_conv);
2057 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainWatchInterfaceUtil_1new(JNIEnv * _env, jclass _b, jlong network) {
2058 LDKNetwork network_conv = *(LDKNetwork*)network;
2059 free((void*)network);
2060 LDKChainWatchInterfaceUtil* ret = malloc(sizeof(LDKChainWatchInterfaceUtil));
2061 *ret = ChainWatchInterfaceUtil_new(network_conv);
2062 assert(!ret->_underlying_ref);
2063 ret->_underlying_ref = true;
2067 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChainWatchInterfaceUtil_1does_1match_1tx(JNIEnv * _env, jclass _b, jlong this_arg, jlong tx) {
2068 LDKChainWatchInterfaceUtil* this_arg_conv = (LDKChainWatchInterfaceUtil*)this_arg;
2069 LDKTransaction tx_conv = *(LDKTransaction*)tx;
2071 return ChainWatchInterfaceUtil_does_match_tx(this_arg_conv, tx_conv);
2074 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2075 LDKOutPoint this_ptr_conv = *(LDKOutPoint*)this_ptr;
2076 free((void*)this_ptr);
2077 this_ptr_conv._underlying_ref = false;
2078 return OutPoint_free(this_ptr_conv);
2081 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1txid(JNIEnv * _env, jclass _b, jlong this_ptr) {
2082 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
2083 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2084 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OutPoint_get_txid(this_ptr_conv));
2088 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1txid(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2089 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
2090 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
2092 return OutPoint_set_txid(this_ptr_conv, val_conv);
2095 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1index(JNIEnv * _env, jclass _b, jlong this_ptr) {
2096 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
2097 return OutPoint_get_index(this_ptr_conv);
2100 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1index(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
2101 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
2102 return OutPoint_set_index(this_ptr_conv, val);
2105 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1new(JNIEnv * _env, jclass _b, jlong txid_arg, jshort index_arg) {
2106 LDKThirtyTwoBytes txid_arg_conv = *(LDKThirtyTwoBytes*)txid_arg;
2107 free((void*)txid_arg);
2108 LDKOutPoint* ret = malloc(sizeof(LDKOutPoint));
2109 *ret = OutPoint_new(txid_arg_conv, index_arg);
2110 assert(!ret->_underlying_ref);
2111 ret->_underlying_ref = true;
2115 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1to_1channel_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
2116 LDKOutPoint* this_arg_conv = (LDKOutPoint*)this_arg;
2117 LDKThirtyTwoBytes* ret = malloc(sizeof(LDKThirtyTwoBytes));
2118 *ret = OutPoint_to_channel_id(this_arg_conv);
2122 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1write(JNIEnv * _env, jclass _b, jlong obj) {
2123 LDKOutPoint* obj_conv = (LDKOutPoint*)obj;
2124 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
2125 *ret = OutPoint_write(obj_conv);
2129 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1read(JNIEnv * _env, jclass _b, jlong ser) {
2130 LDKu8slice ser_conv = *(LDKu8slice*)ser;
2132 LDKOutPoint* ret = malloc(sizeof(LDKOutPoint));
2133 *ret = OutPoint_read(ser_conv);
2134 assert(!ret->_underlying_ref);
2135 ret->_underlying_ref = true;
2139 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2140 LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)this_ptr;
2141 free((void*)this_ptr);
2142 return SpendableOutputDescriptor_free(this_ptr_conv);
2145 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2146 LDKChannelKeys *this_ptr_conv = (LDKChannelKeys*)this_ptr;
2147 return ChannelKeys_free(*this_ptr_conv);
2150 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysInterface_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2151 LDKKeysInterface *this_ptr_conv = (LDKKeysInterface*)this_ptr;
2152 return KeysInterface_free(*this_ptr_conv);
2155 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2156 LDKInMemoryChannelKeys this_ptr_conv = *(LDKInMemoryChannelKeys*)this_ptr;
2157 free((void*)this_ptr);
2158 this_ptr_conv._underlying_ref = false;
2159 return InMemoryChannelKeys_free(this_ptr_conv);
2162 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1funding_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
2163 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2164 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2165 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_funding_key(this_ptr_conv));
2169 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1funding_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2170 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2171 LDKSecretKey val_conv = *(LDKSecretKey*)val;
2173 return InMemoryChannelKeys_set_funding_key(this_ptr_conv, val_conv);
2176 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1revocation_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
2177 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2178 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2179 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_revocation_base_key(this_ptr_conv));
2183 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1revocation_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2184 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2185 LDKSecretKey val_conv = *(LDKSecretKey*)val;
2187 return InMemoryChannelKeys_set_revocation_base_key(this_ptr_conv, val_conv);
2190 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
2191 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2192 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2193 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_payment_key(this_ptr_conv));
2197 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2198 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2199 LDKSecretKey val_conv = *(LDKSecretKey*)val;
2201 return InMemoryChannelKeys_set_payment_key(this_ptr_conv, val_conv);
2204 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1delayed_1payment_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
2205 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2206 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2207 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_delayed_payment_base_key(this_ptr_conv));
2211 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1delayed_1payment_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2212 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2213 LDKSecretKey val_conv = *(LDKSecretKey*)val;
2215 return InMemoryChannelKeys_set_delayed_payment_base_key(this_ptr_conv, val_conv);
2218 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1htlc_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
2219 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2220 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2221 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_htlc_base_key(this_ptr_conv));
2225 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1htlc_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2226 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2227 LDKSecretKey val_conv = *(LDKSecretKey*)val;
2229 return InMemoryChannelKeys_set_htlc_base_key(this_ptr_conv, val_conv);
2232 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1commitment_1seed(JNIEnv * _env, jclass _b, jlong this_ptr) {
2233 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2234 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2235 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_commitment_seed(this_ptr_conv));
2239 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1commitment_1seed(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2240 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2241 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
2243 return InMemoryChannelKeys_set_commitment_seed(this_ptr_conv, val_conv);
2246 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) {
2247 LDKSecretKey funding_key_conv = *(LDKSecretKey*)funding_key;
2248 free((void*)funding_key);
2249 LDKSecretKey revocation_base_key_conv = *(LDKSecretKey*)revocation_base_key;
2250 free((void*)revocation_base_key);
2251 LDKSecretKey payment_key_conv = *(LDKSecretKey*)payment_key;
2252 free((void*)payment_key);
2253 LDKSecretKey delayed_payment_base_key_conv = *(LDKSecretKey*)delayed_payment_base_key;
2254 free((void*)delayed_payment_base_key);
2255 LDKSecretKey htlc_base_key_conv = *(LDKSecretKey*)htlc_base_key;
2256 free((void*)htlc_base_key);
2257 LDKThirtyTwoBytes commitment_seed_conv = *(LDKThirtyTwoBytes*)commitment_seed;
2258 free((void*)commitment_seed);
2259 LDKC2Tuple_u64u64Z key_derivation_params_conv = *(LDKC2Tuple_u64u64Z*)key_derivation_params;
2260 free((void*)key_derivation_params);
2261 LDKInMemoryChannelKeys* ret = malloc(sizeof(LDKInMemoryChannelKeys));
2262 *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);
2263 assert(!ret->_underlying_ref);
2264 ret->_underlying_ref = true;
2268 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1remote_1pubkeys(JNIEnv * _env, jclass _b, jlong this_arg) {
2269 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
2270 LDKChannelPublicKeys* ret = malloc(sizeof(LDKChannelPublicKeys));
2271 *ret = InMemoryChannelKeys_remote_pubkeys(this_arg_conv);
2272 assert(!ret->_underlying_ref);
2273 ret->_underlying_ref = true;
2277 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1remote_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_arg) {
2278 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
2279 return InMemoryChannelKeys_remote_to_self_delay(this_arg_conv);
2282 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1local_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_arg) {
2283 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
2284 return InMemoryChannelKeys_local_to_self_delay(this_arg_conv);
2287 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1as_1ChannelKeys(JNIEnv * _env, jclass _b, jlong this_arg) {
2288 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
2289 LDKChannelKeys* ret = malloc(sizeof(LDKChannelKeys));
2290 *ret = InMemoryChannelKeys_as_ChannelKeys(this_arg_conv);
2294 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1write(JNIEnv * _env, jclass _b, jlong obj) {
2295 LDKInMemoryChannelKeys* obj_conv = (LDKInMemoryChannelKeys*)obj;
2296 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
2297 *ret = InMemoryChannelKeys_write(obj_conv);
2301 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1read(JNIEnv * _env, jclass _b, jlong ser) {
2302 LDKu8slice ser_conv = *(LDKu8slice*)ser;
2304 LDKInMemoryChannelKeys* ret = malloc(sizeof(LDKInMemoryChannelKeys));
2305 *ret = InMemoryChannelKeys_read(ser_conv);
2306 assert(!ret->_underlying_ref);
2307 ret->_underlying_ref = true;
2311 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysManager_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2312 LDKKeysManager this_ptr_conv = *(LDKKeysManager*)this_ptr;
2313 free((void*)this_ptr);
2314 this_ptr_conv._underlying_ref = false;
2315 return KeysManager_free(this_ptr_conv);
2318 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) {
2319 unsigned char seed_arr[32];
2320 (*_env)->GetByteArrayRegion (_env, seed, 0, 32, seed_arr);
2321 unsigned char (*seed_ref)[32] = &seed_arr;
2322 LDKNetwork network_conv = *(LDKNetwork*)network;
2323 free((void*)network);
2324 LDKKeysManager* ret = malloc(sizeof(LDKKeysManager));
2325 *ret = KeysManager_new(seed_ref, network_conv, starting_time_secs, starting_time_nanos);
2326 assert(!ret->_underlying_ref);
2327 ret->_underlying_ref = true;
2331 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) {
2332 LDKKeysManager* this_arg_conv = (LDKKeysManager*)this_arg;
2333 LDKInMemoryChannelKeys* ret = malloc(sizeof(LDKInMemoryChannelKeys));
2334 *ret = KeysManager_derive_channel_keys(this_arg_conv, channel_value_satoshis, params_1, params_2);
2335 assert(!ret->_underlying_ref);
2336 ret->_underlying_ref = true;
2340 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1KeysInterface(JNIEnv * _env, jclass _b, jlong this_arg) {
2341 LDKKeysManager* this_arg_conv = (LDKKeysManager*)this_arg;
2342 LDKKeysInterface* ret = malloc(sizeof(LDKKeysInterface));
2343 *ret = KeysManager_as_KeysInterface(this_arg_conv);
2347 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2348 LDKChannelManager this_ptr_conv = *(LDKChannelManager*)this_ptr;
2349 free((void*)this_ptr);
2350 this_ptr_conv._underlying_ref = false;
2351 return ChannelManager_free(this_ptr_conv);
2354 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2355 LDKChannelDetails this_ptr_conv = *(LDKChannelDetails*)this_ptr;
2356 free((void*)this_ptr);
2357 this_ptr_conv._underlying_ref = false;
2358 return ChannelDetails_free(this_ptr_conv);
2361 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
2362 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2363 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2364 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ChannelDetails_get_channel_id(this_ptr_conv));
2368 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2369 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2370 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
2372 return ChannelDetails_set_channel_id(this_ptr_conv, val_conv);
2375 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1remote_1network_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
2376 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2377 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
2378 *ret = ChannelDetails_get_remote_network_id(this_ptr_conv);
2382 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1remote_1network_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2383 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2384 LDKPublicKey val_conv = *(LDKPublicKey*)val;
2386 return ChannelDetails_set_remote_network_id(this_ptr_conv, val_conv);
2389 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1counterparty_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
2390 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2391 LDKInitFeatures* ret = malloc(sizeof(LDKInitFeatures));
2392 *ret = ChannelDetails_get_counterparty_features(this_ptr_conv);
2393 assert(!ret->_underlying_ref);
2394 ret->_underlying_ref = true;
2398 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1counterparty_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2399 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2400 LDKInitFeatures val_conv = *(LDKInitFeatures*)val;
2402 val_conv._underlying_ref = false;
2403 return ChannelDetails_set_counterparty_features(this_ptr_conv, val_conv);
2406 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1value_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
2407 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2408 return ChannelDetails_get_channel_value_satoshis(this_ptr_conv);
2411 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1value_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2412 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2413 return ChannelDetails_set_channel_value_satoshis(this_ptr_conv, val);
2416 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1user_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
2417 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2418 return ChannelDetails_get_user_id(this_ptr_conv);
2421 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1user_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2422 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2423 return ChannelDetails_set_user_id(this_ptr_conv, val);
2426 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
2427 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2428 return ChannelDetails_get_outbound_capacity_msat(this_ptr_conv);
2431 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1outbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2432 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2433 return ChannelDetails_set_outbound_capacity_msat(this_ptr_conv, val);
2436 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
2437 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2438 return ChannelDetails_get_inbound_capacity_msat(this_ptr_conv);
2441 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2442 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2443 return ChannelDetails_set_inbound_capacity_msat(this_ptr_conv, val);
2446 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1live(JNIEnv * _env, jclass _b, jlong this_ptr) {
2447 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2448 return ChannelDetails_get_is_live(this_ptr_conv);
2451 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1live(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
2452 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2453 return ChannelDetails_set_is_live(this_ptr_conv, val);
2456 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2457 LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)this_ptr;
2458 free((void*)this_ptr);
2459 this_ptr_conv._underlying_ref = false;
2460 return PaymentSendFailure_free(this_ptr_conv);
2463 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) {
2464 LDKNetwork network_conv = *(LDKNetwork*)network;
2465 free((void*)network);
2466 LDKFeeEstimator *fee_est_conv = (LDKFeeEstimator*)fee_est;
2467 LDKFeeEstimator_JCalls_clone(fee_est_conv->this_arg);
2468 LDKManyChannelMonitor *monitor_conv = (LDKManyChannelMonitor*)monitor;
2469 LDKManyChannelMonitor_JCalls_clone(monitor_conv->this_arg);
2470 LDKBroadcasterInterface *tx_broadcaster_conv = (LDKBroadcasterInterface*)tx_broadcaster;
2471 LDKBroadcasterInterface_JCalls_clone(tx_broadcaster_conv->this_arg);
2472 LDKLogger *logger_conv = (LDKLogger*)logger;
2473 LDKLogger_JCalls_clone(logger_conv->this_arg);
2474 LDKKeysInterface *keys_manager_conv = (LDKKeysInterface*)keys_manager;
2475 LDKKeysInterface_JCalls_clone(keys_manager_conv->this_arg);
2476 LDKUserConfig config_conv = *(LDKUserConfig*)config;
2477 free((void*)config);
2478 config_conv._underlying_ref = false;
2479 uintptr_t current_blockchain_height_conv = *(uintptr_t*)current_blockchain_height;
2480 free((void*)current_blockchain_height);
2481 LDKChannelManager* ret = malloc(sizeof(LDKChannelManager));
2482 *ret = ChannelManager_new(network_conv, *fee_est_conv, *monitor_conv, *tx_broadcaster_conv, *logger_conv, *keys_manager_conv, config_conv, current_blockchain_height_conv);
2483 assert(!ret->_underlying_ref);
2484 ret->_underlying_ref = true;
2488 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) {
2489 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2490 LDKPublicKey their_network_key_conv = *(LDKPublicKey*)their_network_key;
2491 free((void*)their_network_key);
2492 LDKUserConfig override_config_conv = *(LDKUserConfig*)override_config;
2493 free((void*)override_config);
2494 override_config_conv._underlying_ref = false;
2495 LDKCResult_NoneAPIErrorZ* ret = malloc(sizeof(LDKCResult_NoneAPIErrorZ));
2496 *ret = ChannelManager_create_channel(this_arg_conv, their_network_key_conv, channel_value_satoshis, push_msat, user_id, override_config_conv);
2500 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
2501 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2502 LDKCVec_ChannelDetailsZ* ret = malloc(sizeof(LDKCVec_ChannelDetailsZ));
2503 *ret = ChannelManager_list_channels(this_arg_conv);
2507 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1usable_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
2508 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2509 LDKCVec_ChannelDetailsZ* ret = malloc(sizeof(LDKCVec_ChannelDetailsZ));
2510 *ret = ChannelManager_list_usable_channels(this_arg_conv);
2514 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray channel_id) {
2515 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2516 unsigned char channel_id_arr[32];
2517 (*_env)->GetByteArrayRegion (_env, channel_id, 0, 32, channel_id_arr);
2518 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
2519 LDKCResult_NoneAPIErrorZ* ret = malloc(sizeof(LDKCResult_NoneAPIErrorZ));
2520 *ret = ChannelManager_close_channel(this_arg_conv, channel_id_ref);
2524 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray channel_id) {
2525 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2526 unsigned char channel_id_arr[32];
2527 (*_env)->GetByteArrayRegion (_env, channel_id, 0, 32, channel_id_arr);
2528 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
2529 return ChannelManager_force_close_channel(this_arg_conv, channel_id_ref);
2532 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1all_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
2533 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2534 return ChannelManager_force_close_all_channels(this_arg_conv);
2537 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) {
2538 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2539 LDKRoute* route_conv = (LDKRoute*)route;
2540 LDKThirtyTwoBytes payment_hash_conv = *(LDKThirtyTwoBytes*)payment_hash;
2541 free((void*)payment_hash);
2542 LDKThirtyTwoBytes payment_secret_conv = *(LDKThirtyTwoBytes*)payment_secret;
2543 free((void*)payment_secret);
2544 LDKCResult_NonePaymentSendFailureZ* ret = malloc(sizeof(LDKCResult_NonePaymentSendFailureZ));
2545 *ret = ChannelManager_send_payment(this_arg_conv, route_conv, payment_hash_conv, payment_secret_conv);
2549 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) {
2550 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2551 unsigned char temporary_channel_id_arr[32];
2552 (*_env)->GetByteArrayRegion (_env, temporary_channel_id, 0, 32, temporary_channel_id_arr);
2553 unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
2554 LDKOutPoint funding_txo_conv = *(LDKOutPoint*)funding_txo;
2555 free((void*)funding_txo);
2556 funding_txo_conv._underlying_ref = false;
2557 return ChannelManager_funding_transaction_generated(this_arg_conv, temporary_channel_id_ref, funding_txo_conv);
2560 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) {
2561 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2562 LDKThreeBytes rgb_conv = *(LDKThreeBytes*)rgb;
2564 LDKThirtyTwoBytes alias_conv = *(LDKThirtyTwoBytes*)alias;
2566 LDKCVec_NetAddressZ addresses_conv = *(LDKCVec_NetAddressZ*)addresses;
2567 free((void*)addresses);
2568 return ChannelManager_broadcast_node_announcement(this_arg_conv, rgb_conv, alias_conv, addresses_conv);
2571 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1process_1pending_1htlc_1forwards(JNIEnv * _env, jclass _b, jlong this_arg) {
2572 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2573 return ChannelManager_process_pending_htlc_forwards(this_arg_conv);
2576 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1timer_1chan_1freshness_1every_1min(JNIEnv * _env, jclass _b, jlong this_arg) {
2577 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2578 return ChannelManager_timer_chan_freshness_every_min(this_arg_conv);
2581 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) {
2582 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2583 unsigned char payment_hash_arr[32];
2584 (*_env)->GetByteArrayRegion (_env, payment_hash, 0, 32, payment_hash_arr);
2585 unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
2586 LDKThirtyTwoBytes payment_secret_conv = *(LDKThirtyTwoBytes*)payment_secret;
2587 free((void*)payment_secret);
2588 return ChannelManager_fail_htlc_backwards(this_arg_conv, payment_hash_ref, payment_secret_conv);
2591 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) {
2592 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2593 LDKThirtyTwoBytes payment_preimage_conv = *(LDKThirtyTwoBytes*)payment_preimage;
2594 free((void*)payment_preimage);
2595 LDKThirtyTwoBytes payment_secret_conv = *(LDKThirtyTwoBytes*)payment_secret;
2596 free((void*)payment_secret);
2597 return ChannelManager_claim_funds(this_arg_conv, payment_preimage_conv, payment_secret_conv, expected_amount);
2600 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1our_1node_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
2601 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2602 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
2603 *ret = ChannelManager_get_our_node_id(this_arg_conv);
2607 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) {
2608 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2609 LDKOutPoint* funding_txo_conv = (LDKOutPoint*)funding_txo;
2610 return ChannelManager_channel_monitor_updated(this_arg_conv, funding_txo_conv, highest_applied_update_id);
2613 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1MessageSendEventsProvider(JNIEnv * _env, jclass _b, jlong this_arg) {
2614 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2615 LDKMessageSendEventsProvider* ret = malloc(sizeof(LDKMessageSendEventsProvider));
2616 *ret = ChannelManager_as_MessageSendEventsProvider(this_arg_conv);
2620 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1EventsProvider(JNIEnv * _env, jclass _b, jlong this_arg) {
2621 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2622 LDKEventsProvider* ret = malloc(sizeof(LDKEventsProvider));
2623 *ret = ChannelManager_as_EventsProvider(this_arg_conv);
2627 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1ChainListener(JNIEnv * _env, jclass _b, jlong this_arg) {
2628 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2629 LDKChainListener* ret = malloc(sizeof(LDKChainListener));
2630 *ret = ChannelManager_as_ChainListener(this_arg_conv);
2634 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1ChannelMessageHandler(JNIEnv * _env, jclass _b, jlong this_arg) {
2635 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2636 LDKChannelMessageHandler* ret = malloc(sizeof(LDKChannelMessageHandler));
2637 *ret = ChannelManager_as_ChannelMessageHandler(this_arg_conv);
2641 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2642 LDKChannelManagerReadArgs this_ptr_conv = *(LDKChannelManagerReadArgs*)this_ptr;
2643 free((void*)this_ptr);
2644 this_ptr_conv._underlying_ref = false;
2645 return ChannelManagerReadArgs_free(this_ptr_conv);
2648 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1keys_1manager(JNIEnv * _env, jclass _b, jlong this_ptr) {
2649 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2650 long ret = (long)ChannelManagerReadArgs_get_keys_manager(this_ptr_conv);
2654 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1keys_1manager(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2655 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2656 LDKKeysInterface *val_conv = (LDKKeysInterface*)val;
2657 LDKKeysInterface_JCalls_clone(val_conv->this_arg);
2658 return ChannelManagerReadArgs_set_keys_manager(this_ptr_conv, *val_conv);
2661 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1fee_1estimator(JNIEnv * _env, jclass _b, jlong this_ptr) {
2662 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2663 long ret = (long)ChannelManagerReadArgs_get_fee_estimator(this_ptr_conv);
2667 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1fee_1estimator(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2668 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2669 LDKFeeEstimator *val_conv = (LDKFeeEstimator*)val;
2670 LDKFeeEstimator_JCalls_clone(val_conv->this_arg);
2671 return ChannelManagerReadArgs_set_fee_estimator(this_ptr_conv, *val_conv);
2674 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1monitor(JNIEnv * _env, jclass _b, jlong this_ptr) {
2675 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2676 long ret = (long)ChannelManagerReadArgs_get_monitor(this_ptr_conv);
2680 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1monitor(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2681 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2682 LDKManyChannelMonitor *val_conv = (LDKManyChannelMonitor*)val;
2683 LDKManyChannelMonitor_JCalls_clone(val_conv->this_arg);
2684 return ChannelManagerReadArgs_set_monitor(this_ptr_conv, *val_conv);
2687 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1tx_1broadcaster(JNIEnv * _env, jclass _b, jlong this_ptr) {
2688 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2689 long ret = (long)ChannelManagerReadArgs_get_tx_broadcaster(this_ptr_conv);
2693 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1tx_1broadcaster(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2694 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2695 LDKBroadcasterInterface *val_conv = (LDKBroadcasterInterface*)val;
2696 LDKBroadcasterInterface_JCalls_clone(val_conv->this_arg);
2697 return ChannelManagerReadArgs_set_tx_broadcaster(this_ptr_conv, *val_conv);
2700 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1logger(JNIEnv * _env, jclass _b, jlong this_ptr) {
2701 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2702 long ret = (long)ChannelManagerReadArgs_get_logger(this_ptr_conv);
2706 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1logger(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2707 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2708 LDKLogger *val_conv = (LDKLogger*)val;
2709 LDKLogger_JCalls_clone(val_conv->this_arg);
2710 return ChannelManagerReadArgs_set_logger(this_ptr_conv, *val_conv);
2713 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1default_1config(JNIEnv * _env, jclass _b, jlong this_ptr) {
2714 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2715 LDKUserConfig* ret = malloc(sizeof(LDKUserConfig));
2716 *ret = ChannelManagerReadArgs_get_default_config(this_ptr_conv);
2717 assert(!ret->_underlying_ref);
2718 ret->_underlying_ref = true;
2722 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1default_1config(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2723 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
2724 LDKUserConfig val_conv = *(LDKUserConfig*)val;
2726 val_conv._underlying_ref = false;
2727 return ChannelManagerReadArgs_set_default_config(this_ptr_conv, val_conv);
2730 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) {
2731 LDKKeysInterface *keys_manager_conv = (LDKKeysInterface*)keys_manager;
2732 LDKKeysInterface_JCalls_clone(keys_manager_conv->this_arg);
2733 LDKFeeEstimator *fee_estimator_conv = (LDKFeeEstimator*)fee_estimator;
2734 LDKFeeEstimator_JCalls_clone(fee_estimator_conv->this_arg);
2735 LDKManyChannelMonitor *monitor_conv = (LDKManyChannelMonitor*)monitor;
2736 LDKManyChannelMonitor_JCalls_clone(monitor_conv->this_arg);
2737 LDKBroadcasterInterface *tx_broadcaster_conv = (LDKBroadcasterInterface*)tx_broadcaster;
2738 LDKBroadcasterInterface_JCalls_clone(tx_broadcaster_conv->this_arg);
2739 LDKLogger *logger_conv = (LDKLogger*)logger;
2740 LDKLogger_JCalls_clone(logger_conv->this_arg);
2741 LDKUserConfig default_config_conv = *(LDKUserConfig*)default_config;
2742 free((void*)default_config);
2743 default_config_conv._underlying_ref = false;
2744 LDKCVec_ChannelMonitorZ channel_monitors_conv = *(LDKCVec_ChannelMonitorZ*)channel_monitors;
2745 free((void*)channel_monitors);
2746 LDKChannelManagerReadArgs* ret = malloc(sizeof(LDKChannelManagerReadArgs));
2747 *ret = ChannelManagerReadArgs_new(*keys_manager_conv, *fee_estimator_conv, *monitor_conv, *tx_broadcaster_conv, *logger_conv, default_config_conv, channel_monitors_conv);
2748 assert(!ret->_underlying_ref);
2749 ret->_underlying_ref = true;
2753 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2754 LDKChannelMonitorUpdate this_ptr_conv = *(LDKChannelMonitorUpdate*)this_ptr;
2755 free((void*)this_ptr);
2756 this_ptr_conv._underlying_ref = false;
2757 return ChannelMonitorUpdate_free(this_ptr_conv);
2760 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1get_1update_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
2761 LDKChannelMonitorUpdate* this_ptr_conv = (LDKChannelMonitorUpdate*)this_ptr;
2762 return ChannelMonitorUpdate_get_update_id(this_ptr_conv);
2765 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1set_1update_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2766 LDKChannelMonitorUpdate* this_ptr_conv = (LDKChannelMonitorUpdate*)this_ptr;
2767 return ChannelMonitorUpdate_set_update_id(this_ptr_conv, val);
2770 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
2771 LDKChannelMonitorUpdate* obj_conv = (LDKChannelMonitorUpdate*)obj;
2772 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
2773 *ret = ChannelMonitorUpdate_write(obj_conv);
2777 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
2778 LDKu8slice ser_conv = *(LDKu8slice*)ser;
2780 LDKChannelMonitorUpdate* ret = malloc(sizeof(LDKChannelMonitorUpdate));
2781 *ret = ChannelMonitorUpdate_read(ser_conv);
2782 assert(!ret->_underlying_ref);
2783 ret->_underlying_ref = true;
2787 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2788 LDKMonitorUpdateError this_ptr_conv = *(LDKMonitorUpdateError*)this_ptr;
2789 free((void*)this_ptr);
2790 this_ptr_conv._underlying_ref = false;
2791 return MonitorUpdateError_free(this_ptr_conv);
2794 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2795 LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)this_ptr;
2796 free((void*)this_ptr);
2797 this_ptr_conv._underlying_ref = false;
2798 return MonitorEvent_free(this_ptr_conv);
2801 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2802 LDKHTLCUpdate this_ptr_conv = *(LDKHTLCUpdate*)this_ptr;
2803 free((void*)this_ptr);
2804 this_ptr_conv._underlying_ref = false;
2805 return HTLCUpdate_free(this_ptr_conv);
2808 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
2809 LDKHTLCUpdate* obj_conv = (LDKHTLCUpdate*)obj;
2810 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
2811 *ret = HTLCUpdate_write(obj_conv);
2815 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
2816 LDKu8slice ser_conv = *(LDKu8slice*)ser;
2818 LDKHTLCUpdate* ret = malloc(sizeof(LDKHTLCUpdate));
2819 *ret = HTLCUpdate_read(ser_conv);
2820 assert(!ret->_underlying_ref);
2821 ret->_underlying_ref = true;
2825 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2826 LDKChannelMonitor this_ptr_conv = *(LDKChannelMonitor*)this_ptr;
2827 free((void*)this_ptr);
2828 this_ptr_conv._underlying_ref = false;
2829 return ChannelMonitor_free(this_ptr_conv);
2832 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ManyChannelMonitor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2833 LDKManyChannelMonitor *this_ptr_conv = (LDKManyChannelMonitor*)this_ptr;
2834 return ManyChannelMonitor_free(*this_ptr_conv);
2837 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1update_1monitor(JNIEnv * _env, jclass _b, jlong this_arg, jlong updates, jlong broadcaster, jlong logger) {
2838 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2839 LDKChannelMonitorUpdate updates_conv = *(LDKChannelMonitorUpdate*)updates;
2840 free((void*)updates);
2841 updates_conv._underlying_ref = false;
2842 LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster;
2843 LDKLogger* logger_conv = (LDKLogger*)logger;
2844 LDKCResult_NoneMonitorUpdateErrorZ* ret = malloc(sizeof(LDKCResult_NoneMonitorUpdateErrorZ));
2845 *ret = ChannelMonitor_update_monitor(this_arg_conv, updates_conv, broadcaster_conv, logger_conv);
2849 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1update_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
2850 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2851 return ChannelMonitor_get_latest_update_id(this_arg_conv);
2854 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1funding_1txo(JNIEnv * _env, jclass _b, jlong this_arg) {
2855 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2856 LDKC2Tuple_OutPointScriptZ* ret = malloc(sizeof(LDKC2Tuple_OutPointScriptZ));
2857 *ret = ChannelMonitor_get_funding_txo(this_arg_conv);
2861 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1monitor_1events(JNIEnv * _env, jclass _b, jlong this_arg) {
2862 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2863 LDKCVec_MonitorEventZ* ret = malloc(sizeof(LDKCVec_MonitorEventZ));
2864 *ret = ChannelMonitor_get_and_clear_pending_monitor_events(this_arg_conv);
2868 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1events(JNIEnv * _env, jclass _b, jlong this_arg) {
2869 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2870 LDKCVec_EventZ* ret = malloc(sizeof(LDKCVec_EventZ));
2871 *ret = ChannelMonitor_get_and_clear_pending_events(this_arg_conv);
2875 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1local_1commitment_1txn(JNIEnv * _env, jclass _b, jlong this_arg, jlong logger) {
2876 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2877 LDKLogger* logger_conv = (LDKLogger*)logger;
2878 LDKCVec_TransactionZ* ret = malloc(sizeof(LDKCVec_TransactionZ));
2879 *ret = ChannelMonitor_get_latest_local_commitment_txn(this_arg_conv, logger_conv);
2883 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DecodeError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2884 LDKDecodeError this_ptr_conv = *(LDKDecodeError*)this_ptr;
2885 free((void*)this_ptr);
2886 this_ptr_conv._underlying_ref = false;
2887 return DecodeError_free(this_ptr_conv);
2890 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2891 LDKInit this_ptr_conv = *(LDKInit*)this_ptr;
2892 free((void*)this_ptr);
2893 this_ptr_conv._underlying_ref = false;
2894 return Init_free(this_ptr_conv);
2897 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2898 LDKErrorMessage this_ptr_conv = *(LDKErrorMessage*)this_ptr;
2899 free((void*)this_ptr);
2900 this_ptr_conv._underlying_ref = false;
2901 return ErrorMessage_free(this_ptr_conv);
2904 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
2905 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
2906 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2907 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ErrorMessage_get_channel_id(this_ptr_conv));
2911 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2912 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
2913 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
2915 return ErrorMessage_set_channel_id(this_ptr_conv, val_conv);
2918 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1data(JNIEnv * _env, jclass _b, jlong this_ptr) {
2919 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
2920 LDKStr* ret = malloc(sizeof(LDKStr));
2921 *ret = ErrorMessage_get_data(this_ptr_conv);
2925 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1data(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2926 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
2927 LDKCVec_u8Z val_conv = *(LDKCVec_u8Z*)val;
2929 return ErrorMessage_set_data(this_ptr_conv, val_conv);
2932 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong data_arg) {
2933 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
2934 free((void*)channel_id_arg);
2935 LDKCVec_u8Z data_arg_conv = *(LDKCVec_u8Z*)data_arg;
2936 free((void*)data_arg);
2937 LDKErrorMessage* ret = malloc(sizeof(LDKErrorMessage));
2938 *ret = ErrorMessage_new(channel_id_arg_conv, data_arg_conv);
2939 assert(!ret->_underlying_ref);
2940 ret->_underlying_ref = true;
2944 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2945 LDKPing this_ptr_conv = *(LDKPing*)this_ptr;
2946 free((void*)this_ptr);
2947 this_ptr_conv._underlying_ref = false;
2948 return Ping_free(this_ptr_conv);
2951 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Ping_1get_1ponglen(JNIEnv * _env, jclass _b, jlong this_ptr) {
2952 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
2953 return Ping_get_ponglen(this_ptr_conv);
2956 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1ponglen(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
2957 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
2958 return Ping_set_ponglen(this_ptr_conv, val);
2961 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Ping_1get_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr) {
2962 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
2963 return Ping_get_byteslen(this_ptr_conv);
2966 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
2967 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
2968 return Ping_set_byteslen(this_ptr_conv, val);
2971 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1new(JNIEnv * _env, jclass _b, jshort ponglen_arg, jshort byteslen_arg) {
2972 LDKPing* ret = malloc(sizeof(LDKPing));
2973 *ret = Ping_new(ponglen_arg, byteslen_arg);
2974 assert(!ret->_underlying_ref);
2975 ret->_underlying_ref = true;
2979 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2980 LDKPong this_ptr_conv = *(LDKPong*)this_ptr;
2981 free((void*)this_ptr);
2982 this_ptr_conv._underlying_ref = false;
2983 return Pong_free(this_ptr_conv);
2986 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Pong_1get_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr) {
2987 LDKPong* this_ptr_conv = (LDKPong*)this_ptr;
2988 return Pong_get_byteslen(this_ptr_conv);
2991 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1set_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
2992 LDKPong* this_ptr_conv = (LDKPong*)this_ptr;
2993 return Pong_set_byteslen(this_ptr_conv, val);
2996 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1new(JNIEnv * _env, jclass _b, jshort byteslen_arg) {
2997 LDKPong* ret = malloc(sizeof(LDKPong));
2998 *ret = Pong_new(byteslen_arg);
2999 assert(!ret->_underlying_ref);
3000 ret->_underlying_ref = true;
3004 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3005 LDKOpenChannel this_ptr_conv = *(LDKOpenChannel*)this_ptr;
3006 free((void*)this_ptr);
3007 this_ptr_conv._underlying_ref = false;
3008 return OpenChannel_free(this_ptr_conv);
3011 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
3012 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3013 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3014 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OpenChannel_get_chain_hash(this_ptr_conv));
3018 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3019 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3020 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3022 return OpenChannel_set_chain_hash(this_ptr_conv, val_conv);
3025 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3026 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3027 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3028 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OpenChannel_get_temporary_channel_id(this_ptr_conv));
3032 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3033 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3034 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3036 return OpenChannel_set_temporary_channel_id(this_ptr_conv, val_conv);
3039 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3040 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3041 return OpenChannel_get_funding_satoshis(this_ptr_conv);
3044 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3045 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3046 return OpenChannel_set_funding_satoshis(this_ptr_conv, val);
3049 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1push_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3050 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3051 return OpenChannel_get_push_msat(this_ptr_conv);
3054 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1push_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3055 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3056 return OpenChannel_set_push_msat(this_ptr_conv, val);
3059 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3060 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3061 return OpenChannel_get_dust_limit_satoshis(this_ptr_conv);
3064 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3065 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3066 return OpenChannel_set_dust_limit_satoshis(this_ptr_conv, val);
3069 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3070 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3071 return OpenChannel_get_max_htlc_value_in_flight_msat(this_ptr_conv);
3074 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) {
3075 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3076 return OpenChannel_set_max_htlc_value_in_flight_msat(this_ptr_conv, val);
3079 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3080 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3081 return OpenChannel_get_channel_reserve_satoshis(this_ptr_conv);
3084 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3085 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3086 return OpenChannel_set_channel_reserve_satoshis(this_ptr_conv, val);
3089 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3090 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3091 return OpenChannel_get_htlc_minimum_msat(this_ptr_conv);
3094 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3095 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3096 return OpenChannel_set_htlc_minimum_msat(this_ptr_conv, val);
3099 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr) {
3100 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3101 return OpenChannel_get_feerate_per_kw(this_ptr_conv);
3104 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
3105 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3106 return OpenChannel_set_feerate_per_kw(this_ptr_conv, val);
3109 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
3110 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3111 return OpenChannel_get_to_self_delay(this_ptr_conv);
3114 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3115 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3116 return OpenChannel_set_to_self_delay(this_ptr_conv, val);
3119 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr) {
3120 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3121 return OpenChannel_get_max_accepted_htlcs(this_ptr_conv);
3124 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3125 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3126 return OpenChannel_set_max_accepted_htlcs(this_ptr_conv, val);
3129 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
3130 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3131 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
3132 *ret = OpenChannel_get_funding_pubkey(this_ptr_conv);
3136 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3137 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3138 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3140 return OpenChannel_set_funding_pubkey(this_ptr_conv, val_conv);
3143 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
3144 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3145 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
3146 *ret = OpenChannel_get_revocation_basepoint(this_ptr_conv);
3150 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3151 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3152 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3154 return OpenChannel_set_revocation_basepoint(this_ptr_conv, val_conv);
3157 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
3158 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3159 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
3160 *ret = OpenChannel_get_payment_point(this_ptr_conv);
3164 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3165 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3166 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3168 return OpenChannel_set_payment_point(this_ptr_conv, val_conv);
3171 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
3172 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3173 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
3174 *ret = OpenChannel_get_delayed_payment_basepoint(this_ptr_conv);
3178 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3179 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3180 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3182 return OpenChannel_set_delayed_payment_basepoint(this_ptr_conv, val_conv);
3185 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
3186 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3187 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
3188 *ret = OpenChannel_get_htlc_basepoint(this_ptr_conv);
3192 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3193 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3194 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3196 return OpenChannel_set_htlc_basepoint(this_ptr_conv, val_conv);
3199 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
3200 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3201 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
3202 *ret = OpenChannel_get_first_per_commitment_point(this_ptr_conv);
3206 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3207 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3208 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3210 return OpenChannel_set_first_per_commitment_point(this_ptr_conv, val_conv);
3213 JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1flags(JNIEnv * _env, jclass _b, jlong this_ptr) {
3214 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3215 return OpenChannel_get_channel_flags(this_ptr_conv);
3218 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1flags(JNIEnv * _env, jclass _b, jlong this_ptr, jbyte val) {
3219 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3220 return OpenChannel_set_channel_flags(this_ptr_conv, val);
3223 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3224 LDKAcceptChannel this_ptr_conv = *(LDKAcceptChannel*)this_ptr;
3225 free((void*)this_ptr);
3226 this_ptr_conv._underlying_ref = false;
3227 return AcceptChannel_free(this_ptr_conv);
3230 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3231 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3232 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3233 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *AcceptChannel_get_temporary_channel_id(this_ptr_conv));
3237 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3238 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3239 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3241 return AcceptChannel_set_temporary_channel_id(this_ptr_conv, val_conv);
3244 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3245 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3246 return AcceptChannel_get_dust_limit_satoshis(this_ptr_conv);
3249 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3250 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3251 return AcceptChannel_set_dust_limit_satoshis(this_ptr_conv, val);
3254 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3255 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3256 return AcceptChannel_get_max_htlc_value_in_flight_msat(this_ptr_conv);
3259 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) {
3260 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3261 return AcceptChannel_set_max_htlc_value_in_flight_msat(this_ptr_conv, val);
3264 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3265 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3266 return AcceptChannel_get_channel_reserve_satoshis(this_ptr_conv);
3269 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3270 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3271 return AcceptChannel_set_channel_reserve_satoshis(this_ptr_conv, val);
3274 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3275 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3276 return AcceptChannel_get_htlc_minimum_msat(this_ptr_conv);
3279 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3280 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3281 return AcceptChannel_set_htlc_minimum_msat(this_ptr_conv, val);
3284 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr) {
3285 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3286 return AcceptChannel_get_minimum_depth(this_ptr_conv);
3289 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
3290 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3291 return AcceptChannel_set_minimum_depth(this_ptr_conv, val);
3294 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
3295 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3296 return AcceptChannel_get_to_self_delay(this_ptr_conv);
3299 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3300 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3301 return AcceptChannel_set_to_self_delay(this_ptr_conv, val);
3304 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr) {
3305 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3306 return AcceptChannel_get_max_accepted_htlcs(this_ptr_conv);
3309 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3310 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3311 return AcceptChannel_set_max_accepted_htlcs(this_ptr_conv, val);
3314 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
3315 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3316 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
3317 *ret = AcceptChannel_get_funding_pubkey(this_ptr_conv);
3321 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3322 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3323 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3325 return AcceptChannel_set_funding_pubkey(this_ptr_conv, val_conv);
3328 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
3329 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3330 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
3331 *ret = AcceptChannel_get_revocation_basepoint(this_ptr_conv);
3335 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3336 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3337 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3339 return AcceptChannel_set_revocation_basepoint(this_ptr_conv, val_conv);
3342 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
3343 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3344 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
3345 *ret = AcceptChannel_get_payment_point(this_ptr_conv);
3349 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3350 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3351 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3353 return AcceptChannel_set_payment_point(this_ptr_conv, val_conv);
3356 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
3357 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3358 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
3359 *ret = AcceptChannel_get_delayed_payment_basepoint(this_ptr_conv);
3363 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3364 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3365 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3367 return AcceptChannel_set_delayed_payment_basepoint(this_ptr_conv, val_conv);
3370 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
3371 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3372 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
3373 *ret = AcceptChannel_get_htlc_basepoint(this_ptr_conv);
3377 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3378 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3379 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3381 return AcceptChannel_set_htlc_basepoint(this_ptr_conv, val_conv);
3384 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
3385 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3386 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
3387 *ret = AcceptChannel_get_first_per_commitment_point(this_ptr_conv);
3391 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3392 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3393 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3395 return AcceptChannel_set_first_per_commitment_point(this_ptr_conv, val_conv);
3398 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3399 LDKFundingCreated this_ptr_conv = *(LDKFundingCreated*)this_ptr;
3400 free((void*)this_ptr);
3401 this_ptr_conv._underlying_ref = false;
3402 return FundingCreated_free(this_ptr_conv);
3405 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3406 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3407 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3408 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingCreated_get_temporary_channel_id(this_ptr_conv));
3412 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3413 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3414 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3416 return FundingCreated_set_temporary_channel_id(this_ptr_conv, val_conv);
3419 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1txid(JNIEnv * _env, jclass _b, jlong this_ptr) {
3420 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3421 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3422 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingCreated_get_funding_txid(this_ptr_conv));
3426 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1txid(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3427 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3428 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3430 return FundingCreated_set_funding_txid(this_ptr_conv, val_conv);
3433 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1output_1index(JNIEnv * _env, jclass _b, jlong this_ptr) {
3434 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3435 return FundingCreated_get_funding_output_index(this_ptr_conv);
3438 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1output_1index(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3439 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3440 return FundingCreated_set_funding_output_index(this_ptr_conv, val);
3443 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
3444 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3445 LDKSignature* ret = malloc(sizeof(LDKSignature));
3446 *ret = FundingCreated_get_signature(this_ptr_conv);
3450 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3451 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3452 LDKSignature val_conv = *(LDKSignature*)val;
3454 return FundingCreated_set_signature(this_ptr_conv, val_conv);
3457 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) {
3458 LDKThirtyTwoBytes temporary_channel_id_arg_conv = *(LDKThirtyTwoBytes*)temporary_channel_id_arg;
3459 free((void*)temporary_channel_id_arg);
3460 LDKThirtyTwoBytes funding_txid_arg_conv = *(LDKThirtyTwoBytes*)funding_txid_arg;
3461 free((void*)funding_txid_arg);
3462 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
3463 free((void*)signature_arg);
3464 LDKFundingCreated* ret = malloc(sizeof(LDKFundingCreated));
3465 *ret = FundingCreated_new(temporary_channel_id_arg_conv, funding_txid_arg_conv, funding_output_index_arg, signature_arg_conv);
3466 assert(!ret->_underlying_ref);
3467 ret->_underlying_ref = true;
3471 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3472 LDKFundingSigned this_ptr_conv = *(LDKFundingSigned*)this_ptr;
3473 free((void*)this_ptr);
3474 this_ptr_conv._underlying_ref = false;
3475 return FundingSigned_free(this_ptr_conv);
3478 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3479 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
3480 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3481 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingSigned_get_channel_id(this_ptr_conv));
3485 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3486 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
3487 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3489 return FundingSigned_set_channel_id(this_ptr_conv, val_conv);
3492 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
3493 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
3494 LDKSignature* ret = malloc(sizeof(LDKSignature));
3495 *ret = FundingSigned_get_signature(this_ptr_conv);
3499 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3500 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
3501 LDKSignature val_conv = *(LDKSignature*)val;
3503 return FundingSigned_set_signature(this_ptr_conv, val_conv);
3506 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong signature_arg) {
3507 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
3508 free((void*)channel_id_arg);
3509 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
3510 free((void*)signature_arg);
3511 LDKFundingSigned* ret = malloc(sizeof(LDKFundingSigned));
3512 *ret = FundingSigned_new(channel_id_arg_conv, signature_arg_conv);
3513 assert(!ret->_underlying_ref);
3514 ret->_underlying_ref = true;
3518 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3519 LDKFundingLocked this_ptr_conv = *(LDKFundingLocked*)this_ptr;
3520 free((void*)this_ptr);
3521 this_ptr_conv._underlying_ref = false;
3522 return FundingLocked_free(this_ptr_conv);
3525 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3526 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
3527 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3528 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingLocked_get_channel_id(this_ptr_conv));
3532 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3533 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
3534 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3536 return FundingLocked_set_channel_id(this_ptr_conv, val_conv);
3539 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
3540 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
3541 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
3542 *ret = FundingLocked_get_next_per_commitment_point(this_ptr_conv);
3546 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3547 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
3548 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3550 return FundingLocked_set_next_per_commitment_point(this_ptr_conv, val_conv);
3553 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong next_per_commitment_point_arg) {
3554 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
3555 free((void*)channel_id_arg);
3556 LDKPublicKey next_per_commitment_point_arg_conv = *(LDKPublicKey*)next_per_commitment_point_arg;
3557 free((void*)next_per_commitment_point_arg);
3558 LDKFundingLocked* ret = malloc(sizeof(LDKFundingLocked));
3559 *ret = FundingLocked_new(channel_id_arg_conv, next_per_commitment_point_arg_conv);
3560 assert(!ret->_underlying_ref);
3561 ret->_underlying_ref = true;
3565 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3566 LDKShutdown this_ptr_conv = *(LDKShutdown*)this_ptr;
3567 free((void*)this_ptr);
3568 this_ptr_conv._underlying_ref = false;
3569 return Shutdown_free(this_ptr_conv);
3572 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3573 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
3574 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3575 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *Shutdown_get_channel_id(this_ptr_conv));
3579 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3580 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
3581 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3583 return Shutdown_set_channel_id(this_ptr_conv, val_conv);
3586 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1scriptpubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
3587 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
3588 LDKu8slice* ret = malloc(sizeof(LDKu8slice));
3589 *ret = Shutdown_get_scriptpubkey(this_ptr_conv);
3593 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1scriptpubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3594 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
3595 LDKCVec_u8Z val_conv = *(LDKCVec_u8Z*)val;
3597 return Shutdown_set_scriptpubkey(this_ptr_conv, val_conv);
3600 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong scriptpubkey_arg) {
3601 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
3602 free((void*)channel_id_arg);
3603 LDKCVec_u8Z scriptpubkey_arg_conv = *(LDKCVec_u8Z*)scriptpubkey_arg;
3604 free((void*)scriptpubkey_arg);
3605 LDKShutdown* ret = malloc(sizeof(LDKShutdown));
3606 *ret = Shutdown_new(channel_id_arg_conv, scriptpubkey_arg_conv);
3607 assert(!ret->_underlying_ref);
3608 ret->_underlying_ref = true;
3612 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3613 LDKClosingSigned this_ptr_conv = *(LDKClosingSigned*)this_ptr;
3614 free((void*)this_ptr);
3615 this_ptr_conv._underlying_ref = false;
3616 return ClosingSigned_free(this_ptr_conv);
3619 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3620 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
3621 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3622 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ClosingSigned_get_channel_id(this_ptr_conv));
3626 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3627 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
3628 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3630 return ClosingSigned_set_channel_id(this_ptr_conv, val_conv);
3633 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3634 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
3635 return ClosingSigned_get_fee_satoshis(this_ptr_conv);
3638 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3639 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
3640 return ClosingSigned_set_fee_satoshis(this_ptr_conv, val);
3643 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
3644 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
3645 LDKSignature* ret = malloc(sizeof(LDKSignature));
3646 *ret = ClosingSigned_get_signature(this_ptr_conv);
3650 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3651 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
3652 LDKSignature val_conv = *(LDKSignature*)val;
3654 return ClosingSigned_set_signature(this_ptr_conv, val_conv);
3657 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) {
3658 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
3659 free((void*)channel_id_arg);
3660 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
3661 free((void*)signature_arg);
3662 LDKClosingSigned* ret = malloc(sizeof(LDKClosingSigned));
3663 *ret = ClosingSigned_new(channel_id_arg_conv, fee_satoshis_arg, signature_arg_conv);
3664 assert(!ret->_underlying_ref);
3665 ret->_underlying_ref = true;
3669 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3670 LDKUpdateAddHTLC this_ptr_conv = *(LDKUpdateAddHTLC*)this_ptr;
3671 free((void*)this_ptr);
3672 this_ptr_conv._underlying_ref = false;
3673 return UpdateAddHTLC_free(this_ptr_conv);
3676 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3677 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
3678 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3679 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateAddHTLC_get_channel_id(this_ptr_conv));
3683 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3684 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
3685 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3687 return UpdateAddHTLC_set_channel_id(this_ptr_conv, val_conv);
3690 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3691 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
3692 return UpdateAddHTLC_get_htlc_id(this_ptr_conv);
3695 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3696 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
3697 return UpdateAddHTLC_set_htlc_id(this_ptr_conv, val);
3700 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3701 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
3702 return UpdateAddHTLC_get_amount_msat(this_ptr_conv);
3705 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3706 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
3707 return UpdateAddHTLC_set_amount_msat(this_ptr_conv, val);
3710 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
3711 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
3712 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3713 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateAddHTLC_get_payment_hash(this_ptr_conv));
3717 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3718 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
3719 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3721 return UpdateAddHTLC_set_payment_hash(this_ptr_conv, val_conv);
3724 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr) {
3725 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
3726 return UpdateAddHTLC_get_cltv_expiry(this_ptr_conv);
3729 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
3730 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
3731 return UpdateAddHTLC_set_cltv_expiry(this_ptr_conv, val);
3734 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3735 LDKUpdateFulfillHTLC this_ptr_conv = *(LDKUpdateFulfillHTLC*)this_ptr;
3736 free((void*)this_ptr);
3737 this_ptr_conv._underlying_ref = false;
3738 return UpdateFulfillHTLC_free(this_ptr_conv);
3741 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3742 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
3743 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3744 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_channel_id(this_ptr_conv));
3748 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3749 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
3750 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3752 return UpdateFulfillHTLC_set_channel_id(this_ptr_conv, val_conv);
3755 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3756 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
3757 return UpdateFulfillHTLC_get_htlc_id(this_ptr_conv);
3760 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3761 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
3762 return UpdateFulfillHTLC_set_htlc_id(this_ptr_conv, val);
3765 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1payment_1preimage(JNIEnv * _env, jclass _b, jlong this_ptr) {
3766 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
3767 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3768 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_payment_preimage(this_ptr_conv));
3772 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1payment_1preimage(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3773 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
3774 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3776 return UpdateFulfillHTLC_set_payment_preimage(this_ptr_conv, val_conv);
3779 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) {
3780 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
3781 free((void*)channel_id_arg);
3782 LDKThirtyTwoBytes payment_preimage_arg_conv = *(LDKThirtyTwoBytes*)payment_preimage_arg;
3783 free((void*)payment_preimage_arg);
3784 LDKUpdateFulfillHTLC* ret = malloc(sizeof(LDKUpdateFulfillHTLC));
3785 *ret = UpdateFulfillHTLC_new(channel_id_arg_conv, htlc_id_arg, payment_preimage_arg_conv);
3786 assert(!ret->_underlying_ref);
3787 ret->_underlying_ref = true;
3791 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3792 LDKUpdateFailHTLC this_ptr_conv = *(LDKUpdateFailHTLC*)this_ptr;
3793 free((void*)this_ptr);
3794 this_ptr_conv._underlying_ref = false;
3795 return UpdateFailHTLC_free(this_ptr_conv);
3798 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3799 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
3800 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3801 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFailHTLC_get_channel_id(this_ptr_conv));
3805 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3806 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
3807 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3809 return UpdateFailHTLC_set_channel_id(this_ptr_conv, val_conv);
3812 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3813 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
3814 return UpdateFailHTLC_get_htlc_id(this_ptr_conv);
3817 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3818 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
3819 return UpdateFailHTLC_set_htlc_id(this_ptr_conv, val);
3822 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3823 LDKUpdateFailMalformedHTLC this_ptr_conv = *(LDKUpdateFailMalformedHTLC*)this_ptr;
3824 free((void*)this_ptr);
3825 this_ptr_conv._underlying_ref = false;
3826 return UpdateFailMalformedHTLC_free(this_ptr_conv);
3829 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3830 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
3831 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3832 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFailMalformedHTLC_get_channel_id(this_ptr_conv));
3836 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3837 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
3838 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3840 return UpdateFailMalformedHTLC_set_channel_id(this_ptr_conv, val_conv);
3843 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3844 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
3845 return UpdateFailMalformedHTLC_get_htlc_id(this_ptr_conv);
3848 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3849 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
3850 return UpdateFailMalformedHTLC_set_htlc_id(this_ptr_conv, val);
3853 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1failure_1code(JNIEnv * _env, jclass _b, jlong this_ptr) {
3854 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
3855 return UpdateFailMalformedHTLC_get_failure_code(this_ptr_conv);
3858 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1failure_1code(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3859 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
3860 return UpdateFailMalformedHTLC_set_failure_code(this_ptr_conv, val);
3863 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3864 LDKCommitmentSigned this_ptr_conv = *(LDKCommitmentSigned*)this_ptr;
3865 free((void*)this_ptr);
3866 this_ptr_conv._underlying_ref = false;
3867 return CommitmentSigned_free(this_ptr_conv);
3870 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3871 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
3872 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3873 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *CommitmentSigned_get_channel_id(this_ptr_conv));
3877 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3878 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
3879 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3881 return CommitmentSigned_set_channel_id(this_ptr_conv, val_conv);
3884 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
3885 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
3886 LDKSignature* ret = malloc(sizeof(LDKSignature));
3887 *ret = CommitmentSigned_get_signature(this_ptr_conv);
3891 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3892 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
3893 LDKSignature val_conv = *(LDKSignature*)val;
3895 return CommitmentSigned_set_signature(this_ptr_conv, val_conv);
3898 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1htlc_1signatures(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3899 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
3900 LDKCVec_SignatureZ val_conv = *(LDKCVec_SignatureZ*)val;
3902 return CommitmentSigned_set_htlc_signatures(this_ptr_conv, val_conv);
3905 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) {
3906 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
3907 free((void*)channel_id_arg);
3908 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
3909 free((void*)signature_arg);
3910 LDKCVec_SignatureZ htlc_signatures_arg_conv = *(LDKCVec_SignatureZ*)htlc_signatures_arg;
3911 free((void*)htlc_signatures_arg);
3912 LDKCommitmentSigned* ret = malloc(sizeof(LDKCommitmentSigned));
3913 *ret = CommitmentSigned_new(channel_id_arg_conv, signature_arg_conv, htlc_signatures_arg_conv);
3914 assert(!ret->_underlying_ref);
3915 ret->_underlying_ref = true;
3919 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3920 LDKRevokeAndACK this_ptr_conv = *(LDKRevokeAndACK*)this_ptr;
3921 free((void*)this_ptr);
3922 this_ptr_conv._underlying_ref = false;
3923 return RevokeAndACK_free(this_ptr_conv);
3926 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3927 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
3928 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3929 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *RevokeAndACK_get_channel_id(this_ptr_conv));
3933 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3934 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
3935 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3937 return RevokeAndACK_set_channel_id(this_ptr_conv, val_conv);
3940 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr) {
3941 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
3942 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3943 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *RevokeAndACK_get_per_commitment_secret(this_ptr_conv));
3947 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3948 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
3949 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3951 return RevokeAndACK_set_per_commitment_secret(this_ptr_conv, val_conv);
3954 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
3955 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
3956 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
3957 *ret = RevokeAndACK_get_next_per_commitment_point(this_ptr_conv);
3961 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3962 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
3963 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3965 return RevokeAndACK_set_next_per_commitment_point(this_ptr_conv, val_conv);
3968 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) {
3969 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
3970 free((void*)channel_id_arg);
3971 LDKThirtyTwoBytes per_commitment_secret_arg_conv = *(LDKThirtyTwoBytes*)per_commitment_secret_arg;
3972 free((void*)per_commitment_secret_arg);
3973 LDKPublicKey next_per_commitment_point_arg_conv = *(LDKPublicKey*)next_per_commitment_point_arg;
3974 free((void*)next_per_commitment_point_arg);
3975 LDKRevokeAndACK* ret = malloc(sizeof(LDKRevokeAndACK));
3976 *ret = RevokeAndACK_new(channel_id_arg_conv, per_commitment_secret_arg_conv, next_per_commitment_point_arg_conv);
3977 assert(!ret->_underlying_ref);
3978 ret->_underlying_ref = true;
3982 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3983 LDKUpdateFee this_ptr_conv = *(LDKUpdateFee*)this_ptr;
3984 free((void*)this_ptr);
3985 this_ptr_conv._underlying_ref = false;
3986 return UpdateFee_free(this_ptr_conv);
3989 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3990 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
3991 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3992 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFee_get_channel_id(this_ptr_conv));
3996 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3997 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
3998 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4000 return UpdateFee_set_channel_id(this_ptr_conv, val_conv);
4003 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr) {
4004 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
4005 return UpdateFee_get_feerate_per_kw(this_ptr_conv);
4008 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
4009 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
4010 return UpdateFee_set_feerate_per_kw(this_ptr_conv, val);
4013 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jint feerate_per_kw_arg) {
4014 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4015 free((void*)channel_id_arg);
4016 LDKUpdateFee* ret = malloc(sizeof(LDKUpdateFee));
4017 *ret = UpdateFee_new(channel_id_arg_conv, feerate_per_kw_arg);
4018 assert(!ret->_underlying_ref);
4019 ret->_underlying_ref = true;
4023 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4024 LDKDataLossProtect this_ptr_conv = *(LDKDataLossProtect*)this_ptr;
4025 free((void*)this_ptr);
4026 this_ptr_conv._underlying_ref = false;
4027 return DataLossProtect_free(this_ptr_conv);
4030 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1your_1last_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr) {
4031 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
4032 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4033 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *DataLossProtect_get_your_last_per_commitment_secret(this_ptr_conv));
4037 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1your_1last_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4038 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
4039 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4041 return DataLossProtect_set_your_last_per_commitment_secret(this_ptr_conv, val_conv);
4044 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1my_1current_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
4045 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
4046 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
4047 *ret = DataLossProtect_get_my_current_per_commitment_point(this_ptr_conv);
4051 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1my_1current_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4052 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
4053 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4055 return DataLossProtect_set_my_current_per_commitment_point(this_ptr_conv, val_conv);
4058 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) {
4059 LDKThirtyTwoBytes your_last_per_commitment_secret_arg_conv = *(LDKThirtyTwoBytes*)your_last_per_commitment_secret_arg;
4060 free((void*)your_last_per_commitment_secret_arg);
4061 LDKPublicKey my_current_per_commitment_point_arg_conv = *(LDKPublicKey*)my_current_per_commitment_point_arg;
4062 free((void*)my_current_per_commitment_point_arg);
4063 LDKDataLossProtect* ret = malloc(sizeof(LDKDataLossProtect));
4064 *ret = DataLossProtect_new(your_last_per_commitment_secret_arg_conv, my_current_per_commitment_point_arg_conv);
4065 assert(!ret->_underlying_ref);
4066 ret->_underlying_ref = true;
4070 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4071 LDKChannelReestablish this_ptr_conv = *(LDKChannelReestablish*)this_ptr;
4072 free((void*)this_ptr);
4073 this_ptr_conv._underlying_ref = false;
4074 return ChannelReestablish_free(this_ptr_conv);
4077 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4078 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
4079 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4080 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ChannelReestablish_get_channel_id(this_ptr_conv));
4084 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4085 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
4086 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4088 return ChannelReestablish_set_channel_id(this_ptr_conv, val_conv);
4091 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1local_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr) {
4092 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
4093 return ChannelReestablish_get_next_local_commitment_number(this_ptr_conv);
4096 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1local_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4097 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
4098 return ChannelReestablish_set_next_local_commitment_number(this_ptr_conv, val);
4101 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1remote_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr) {
4102 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
4103 return ChannelReestablish_get_next_remote_commitment_number(this_ptr_conv);
4106 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1remote_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4107 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
4108 return ChannelReestablish_set_next_remote_commitment_number(this_ptr_conv, val);
4111 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4112 LDKAnnouncementSignatures this_ptr_conv = *(LDKAnnouncementSignatures*)this_ptr;
4113 free((void*)this_ptr);
4114 this_ptr_conv._underlying_ref = false;
4115 return AnnouncementSignatures_free(this_ptr_conv);
4118 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4119 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4120 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4121 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *AnnouncementSignatures_get_channel_id(this_ptr_conv));
4125 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4126 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4127 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4129 return AnnouncementSignatures_set_channel_id(this_ptr_conv, val_conv);
4132 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4133 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4134 return AnnouncementSignatures_get_short_channel_id(this_ptr_conv);
4137 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4138 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4139 return AnnouncementSignatures_set_short_channel_id(this_ptr_conv, val);
4142 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1node_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
4143 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4144 LDKSignature* ret = malloc(sizeof(LDKSignature));
4145 *ret = AnnouncementSignatures_get_node_signature(this_ptr_conv);
4149 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1node_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4150 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4151 LDKSignature val_conv = *(LDKSignature*)val;
4153 return AnnouncementSignatures_set_node_signature(this_ptr_conv, val_conv);
4156 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1bitcoin_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
4157 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4158 LDKSignature* ret = malloc(sizeof(LDKSignature));
4159 *ret = AnnouncementSignatures_get_bitcoin_signature(this_ptr_conv);
4163 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1bitcoin_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4164 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4165 LDKSignature val_conv = *(LDKSignature*)val;
4167 return AnnouncementSignatures_set_bitcoin_signature(this_ptr_conv, val_conv);
4170 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) {
4171 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4172 free((void*)channel_id_arg);
4173 LDKSignature node_signature_arg_conv = *(LDKSignature*)node_signature_arg;
4174 free((void*)node_signature_arg);
4175 LDKSignature bitcoin_signature_arg_conv = *(LDKSignature*)bitcoin_signature_arg;
4176 free((void*)bitcoin_signature_arg);
4177 LDKAnnouncementSignatures* ret = malloc(sizeof(LDKAnnouncementSignatures));
4178 *ret = AnnouncementSignatures_new(channel_id_arg_conv, short_channel_id_arg, node_signature_arg_conv, bitcoin_signature_arg_conv);
4179 assert(!ret->_underlying_ref);
4180 ret->_underlying_ref = true;
4184 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetAddress_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4185 LDKNetAddress this_ptr_conv = *(LDKNetAddress*)this_ptr;
4186 free((void*)this_ptr);
4187 return NetAddress_free(this_ptr_conv);
4190 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4191 LDKUnsignedNodeAnnouncement this_ptr_conv = *(LDKUnsignedNodeAnnouncement*)this_ptr;
4192 free((void*)this_ptr);
4193 this_ptr_conv._underlying_ref = false;
4194 return UnsignedNodeAnnouncement_free(this_ptr_conv);
4197 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr) {
4198 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4199 return UnsignedNodeAnnouncement_get_timestamp(this_ptr_conv);
4202 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
4203 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4204 return UnsignedNodeAnnouncement_set_timestamp(this_ptr_conv, val);
4207 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4208 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4209 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
4210 *ret = UnsignedNodeAnnouncement_get_node_id(this_ptr_conv);
4214 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4215 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4216 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4218 return UnsignedNodeAnnouncement_set_node_id(this_ptr_conv, val_conv);
4221 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr) {
4222 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4223 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 3);
4224 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 3, *UnsignedNodeAnnouncement_get_rgb(this_ptr_conv));
4228 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4229 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4230 LDKThreeBytes val_conv = *(LDKThreeBytes*)val;
4232 return UnsignedNodeAnnouncement_set_rgb(this_ptr_conv, val_conv);
4235 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1alias(JNIEnv * _env, jclass _b, jlong this_ptr) {
4236 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4237 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4238 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedNodeAnnouncement_get_alias(this_ptr_conv));
4242 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1alias(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4243 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4244 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4246 return UnsignedNodeAnnouncement_set_alias(this_ptr_conv, val_conv);
4249 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1addresses(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4250 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4251 LDKCVec_NetAddressZ val_conv = *(LDKCVec_NetAddressZ*)val;
4253 return UnsignedNodeAnnouncement_set_addresses(this_ptr_conv, val_conv);
4256 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4257 LDKNodeAnnouncement this_ptr_conv = *(LDKNodeAnnouncement*)this_ptr;
4258 free((void*)this_ptr);
4259 this_ptr_conv._underlying_ref = false;
4260 return NodeAnnouncement_free(this_ptr_conv);
4263 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
4264 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
4265 LDKSignature* ret = malloc(sizeof(LDKSignature));
4266 *ret = NodeAnnouncement_get_signature(this_ptr_conv);
4270 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4271 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
4272 LDKSignature val_conv = *(LDKSignature*)val;
4274 return NodeAnnouncement_set_signature(this_ptr_conv, val_conv);
4277 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1contents(JNIEnv * _env, jclass _b, jlong this_ptr) {
4278 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
4279 LDKUnsignedNodeAnnouncement* ret = malloc(sizeof(LDKUnsignedNodeAnnouncement));
4280 *ret = NodeAnnouncement_get_contents(this_ptr_conv);
4281 assert(!ret->_underlying_ref);
4282 ret->_underlying_ref = true;
4286 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1contents(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4287 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
4288 LDKUnsignedNodeAnnouncement val_conv = *(LDKUnsignedNodeAnnouncement*)val;
4290 val_conv._underlying_ref = false;
4291 return NodeAnnouncement_set_contents(this_ptr_conv, val_conv);
4294 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1new(JNIEnv * _env, jclass _b, jlong signature_arg, jlong contents_arg) {
4295 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
4296 free((void*)signature_arg);
4297 LDKUnsignedNodeAnnouncement contents_arg_conv = *(LDKUnsignedNodeAnnouncement*)contents_arg;
4298 free((void*)contents_arg);
4299 contents_arg_conv._underlying_ref = false;
4300 LDKNodeAnnouncement* ret = malloc(sizeof(LDKNodeAnnouncement));
4301 *ret = NodeAnnouncement_new(signature_arg_conv, contents_arg_conv);
4302 assert(!ret->_underlying_ref);
4303 ret->_underlying_ref = true;
4307 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4308 LDKUnsignedChannelAnnouncement this_ptr_conv = *(LDKUnsignedChannelAnnouncement*)this_ptr;
4309 free((void*)this_ptr);
4310 this_ptr_conv._underlying_ref = false;
4311 return UnsignedChannelAnnouncement_free(this_ptr_conv);
4314 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
4315 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4316 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4317 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedChannelAnnouncement_get_chain_hash(this_ptr_conv));
4321 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4322 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4323 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4325 return UnsignedChannelAnnouncement_set_chain_hash(this_ptr_conv, val_conv);
4328 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4329 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4330 return UnsignedChannelAnnouncement_get_short_channel_id(this_ptr_conv);
4333 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4334 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4335 return UnsignedChannelAnnouncement_set_short_channel_id(this_ptr_conv, val);
4338 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
4339 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4340 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
4341 *ret = UnsignedChannelAnnouncement_get_node_id_1(this_ptr_conv);
4345 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4346 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4347 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4349 return UnsignedChannelAnnouncement_set_node_id_1(this_ptr_conv, val_conv);
4352 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
4353 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4354 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
4355 *ret = UnsignedChannelAnnouncement_get_node_id_2(this_ptr_conv);
4359 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4360 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4361 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4363 return UnsignedChannelAnnouncement_set_node_id_2(this_ptr_conv, val_conv);
4366 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
4367 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4368 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
4369 *ret = UnsignedChannelAnnouncement_get_bitcoin_key_1(this_ptr_conv);
4373 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4374 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4375 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4377 return UnsignedChannelAnnouncement_set_bitcoin_key_1(this_ptr_conv, val_conv);
4380 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
4381 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4382 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
4383 *ret = UnsignedChannelAnnouncement_get_bitcoin_key_2(this_ptr_conv);
4387 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4388 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4389 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4391 return UnsignedChannelAnnouncement_set_bitcoin_key_2(this_ptr_conv, val_conv);
4394 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4395 LDKChannelAnnouncement this_ptr_conv = *(LDKChannelAnnouncement*)this_ptr;
4396 free((void*)this_ptr);
4397 this_ptr_conv._underlying_ref = false;
4398 return ChannelAnnouncement_free(this_ptr_conv);
4401 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
4402 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4403 LDKSignature* ret = malloc(sizeof(LDKSignature));
4404 *ret = ChannelAnnouncement_get_node_signature_1(this_ptr_conv);
4408 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4409 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4410 LDKSignature val_conv = *(LDKSignature*)val;
4412 return ChannelAnnouncement_set_node_signature_1(this_ptr_conv, val_conv);
4415 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
4416 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4417 LDKSignature* ret = malloc(sizeof(LDKSignature));
4418 *ret = ChannelAnnouncement_get_node_signature_2(this_ptr_conv);
4422 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4423 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4424 LDKSignature val_conv = *(LDKSignature*)val;
4426 return ChannelAnnouncement_set_node_signature_2(this_ptr_conv, val_conv);
4429 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
4430 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4431 LDKSignature* ret = malloc(sizeof(LDKSignature));
4432 *ret = ChannelAnnouncement_get_bitcoin_signature_1(this_ptr_conv);
4436 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4437 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4438 LDKSignature val_conv = *(LDKSignature*)val;
4440 return ChannelAnnouncement_set_bitcoin_signature_1(this_ptr_conv, val_conv);
4443 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
4444 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4445 LDKSignature* ret = malloc(sizeof(LDKSignature));
4446 *ret = ChannelAnnouncement_get_bitcoin_signature_2(this_ptr_conv);
4450 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4451 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4452 LDKSignature val_conv = *(LDKSignature*)val;
4454 return ChannelAnnouncement_set_bitcoin_signature_2(this_ptr_conv, val_conv);
4457 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1contents(JNIEnv * _env, jclass _b, jlong this_ptr) {
4458 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4459 LDKUnsignedChannelAnnouncement* ret = malloc(sizeof(LDKUnsignedChannelAnnouncement));
4460 *ret = ChannelAnnouncement_get_contents(this_ptr_conv);
4461 assert(!ret->_underlying_ref);
4462 ret->_underlying_ref = true;
4466 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1contents(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4467 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4468 LDKUnsignedChannelAnnouncement val_conv = *(LDKUnsignedChannelAnnouncement*)val;
4470 val_conv._underlying_ref = false;
4471 return ChannelAnnouncement_set_contents(this_ptr_conv, val_conv);
4474 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) {
4475 LDKSignature node_signature_1_arg_conv = *(LDKSignature*)node_signature_1_arg;
4476 free((void*)node_signature_1_arg);
4477 LDKSignature node_signature_2_arg_conv = *(LDKSignature*)node_signature_2_arg;
4478 free((void*)node_signature_2_arg);
4479 LDKSignature bitcoin_signature_1_arg_conv = *(LDKSignature*)bitcoin_signature_1_arg;
4480 free((void*)bitcoin_signature_1_arg);
4481 LDKSignature bitcoin_signature_2_arg_conv = *(LDKSignature*)bitcoin_signature_2_arg;
4482 free((void*)bitcoin_signature_2_arg);
4483 LDKUnsignedChannelAnnouncement contents_arg_conv = *(LDKUnsignedChannelAnnouncement*)contents_arg;
4484 free((void*)contents_arg);
4485 contents_arg_conv._underlying_ref = false;
4486 LDKChannelAnnouncement* ret = malloc(sizeof(LDKChannelAnnouncement));
4487 *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);
4488 assert(!ret->_underlying_ref);
4489 ret->_underlying_ref = true;
4493 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4494 LDKUnsignedChannelUpdate this_ptr_conv = *(LDKUnsignedChannelUpdate*)this_ptr;
4495 free((void*)this_ptr);
4496 this_ptr_conv._underlying_ref = false;
4497 return UnsignedChannelUpdate_free(this_ptr_conv);
4500 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
4501 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4502 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4503 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedChannelUpdate_get_chain_hash(this_ptr_conv));
4507 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4508 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4509 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4511 return UnsignedChannelUpdate_set_chain_hash(this_ptr_conv, val_conv);
4514 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4515 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4516 return UnsignedChannelUpdate_get_short_channel_id(this_ptr_conv);
4519 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4520 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4521 return UnsignedChannelUpdate_set_short_channel_id(this_ptr_conv, val);
4524 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr) {
4525 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4526 return UnsignedChannelUpdate_get_timestamp(this_ptr_conv);
4529 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
4530 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4531 return UnsignedChannelUpdate_set_timestamp(this_ptr_conv, val);
4534 JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1flags(JNIEnv * _env, jclass _b, jlong this_ptr) {
4535 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4536 return UnsignedChannelUpdate_get_flags(this_ptr_conv);
4539 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1flags(JNIEnv * _env, jclass _b, jlong this_ptr, jbyte val) {
4540 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4541 return UnsignedChannelUpdate_set_flags(this_ptr_conv, val);
4544 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
4545 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4546 return UnsignedChannelUpdate_get_cltv_expiry_delta(this_ptr_conv);
4549 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
4550 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4551 return UnsignedChannelUpdate_set_cltv_expiry_delta(this_ptr_conv, val);
4554 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
4555 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4556 return UnsignedChannelUpdate_get_htlc_minimum_msat(this_ptr_conv);
4559 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4560 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4561 return UnsignedChannelUpdate_set_htlc_minimum_msat(this_ptr_conv, val);
4564 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
4565 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4566 return UnsignedChannelUpdate_get_fee_base_msat(this_ptr_conv);
4569 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
4570 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4571 return UnsignedChannelUpdate_set_fee_base_msat(this_ptr_conv, val);
4574 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr) {
4575 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4576 return UnsignedChannelUpdate_get_fee_proportional_millionths(this_ptr_conv);
4579 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
4580 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4581 return UnsignedChannelUpdate_set_fee_proportional_millionths(this_ptr_conv, val);
4584 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4585 LDKChannelUpdate this_ptr_conv = *(LDKChannelUpdate*)this_ptr;
4586 free((void*)this_ptr);
4587 this_ptr_conv._underlying_ref = false;
4588 return ChannelUpdate_free(this_ptr_conv);
4591 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
4592 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
4593 LDKSignature* ret = malloc(sizeof(LDKSignature));
4594 *ret = ChannelUpdate_get_signature(this_ptr_conv);
4598 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4599 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
4600 LDKSignature val_conv = *(LDKSignature*)val;
4602 return ChannelUpdate_set_signature(this_ptr_conv, val_conv);
4605 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1contents(JNIEnv * _env, jclass _b, jlong this_ptr) {
4606 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
4607 LDKUnsignedChannelUpdate* ret = malloc(sizeof(LDKUnsignedChannelUpdate));
4608 *ret = ChannelUpdate_get_contents(this_ptr_conv);
4609 assert(!ret->_underlying_ref);
4610 ret->_underlying_ref = true;
4614 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1contents(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4615 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
4616 LDKUnsignedChannelUpdate val_conv = *(LDKUnsignedChannelUpdate*)val;
4618 val_conv._underlying_ref = false;
4619 return ChannelUpdate_set_contents(this_ptr_conv, val_conv);
4622 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1new(JNIEnv * _env, jclass _b, jlong signature_arg, jlong contents_arg) {
4623 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
4624 free((void*)signature_arg);
4625 LDKUnsignedChannelUpdate contents_arg_conv = *(LDKUnsignedChannelUpdate*)contents_arg;
4626 free((void*)contents_arg);
4627 contents_arg_conv._underlying_ref = false;
4628 LDKChannelUpdate* ret = malloc(sizeof(LDKChannelUpdate));
4629 *ret = ChannelUpdate_new(signature_arg_conv, contents_arg_conv);
4630 assert(!ret->_underlying_ref);
4631 ret->_underlying_ref = true;
4635 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorAction_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4636 LDKErrorAction this_ptr_conv = *(LDKErrorAction*)this_ptr;
4637 free((void*)this_ptr);
4638 return ErrorAction_free(this_ptr_conv);
4641 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4642 LDKLightningError this_ptr_conv = *(LDKLightningError*)this_ptr;
4643 free((void*)this_ptr);
4644 this_ptr_conv._underlying_ref = false;
4645 return LightningError_free(this_ptr_conv);
4648 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1err(JNIEnv * _env, jclass _b, jlong this_ptr) {
4649 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
4650 LDKStr* ret = malloc(sizeof(LDKStr));
4651 *ret = LightningError_get_err(this_ptr_conv);
4655 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1err(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4656 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
4657 LDKCVec_u8Z val_conv = *(LDKCVec_u8Z*)val;
4659 return LightningError_set_err(this_ptr_conv, val_conv);
4662 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1action(JNIEnv * _env, jclass _b, jlong this_ptr) {
4663 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
4664 LDKErrorAction* ret = malloc(sizeof(LDKErrorAction));
4665 *ret = LightningError_get_action(this_ptr_conv);
4669 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1action(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4670 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
4671 LDKErrorAction val_conv = *(LDKErrorAction*)val;
4673 return LightningError_set_action(this_ptr_conv, val_conv);
4676 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1new(JNIEnv * _env, jclass _b, jlong err_arg, jlong action_arg) {
4677 LDKCVec_u8Z err_arg_conv = *(LDKCVec_u8Z*)err_arg;
4678 free((void*)err_arg);
4679 LDKErrorAction action_arg_conv = *(LDKErrorAction*)action_arg;
4680 free((void*)action_arg);
4681 LDKLightningError* ret = malloc(sizeof(LDKLightningError));
4682 *ret = LightningError_new(err_arg_conv, action_arg_conv);
4683 assert(!ret->_underlying_ref);
4684 ret->_underlying_ref = true;
4688 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4689 LDKCommitmentUpdate this_ptr_conv = *(LDKCommitmentUpdate*)this_ptr;
4690 free((void*)this_ptr);
4691 this_ptr_conv._underlying_ref = false;
4692 return CommitmentUpdate_free(this_ptr_conv);
4695 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1add_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4696 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
4697 LDKCVec_UpdateAddHTLCZ val_conv = *(LDKCVec_UpdateAddHTLCZ*)val;
4699 return CommitmentUpdate_set_update_add_htlcs(this_ptr_conv, val_conv);
4702 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fulfill_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4703 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
4704 LDKCVec_UpdateFulfillHTLCZ val_conv = *(LDKCVec_UpdateFulfillHTLCZ*)val;
4706 return CommitmentUpdate_set_update_fulfill_htlcs(this_ptr_conv, val_conv);
4709 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4710 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
4711 LDKCVec_UpdateFailHTLCZ val_conv = *(LDKCVec_UpdateFailHTLCZ*)val;
4713 return CommitmentUpdate_set_update_fail_htlcs(this_ptr_conv, val_conv);
4716 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1malformed_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4717 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
4718 LDKCVec_UpdateFailMalformedHTLCZ val_conv = *(LDKCVec_UpdateFailMalformedHTLCZ*)val;
4720 return CommitmentUpdate_set_update_fail_malformed_htlcs(this_ptr_conv, val_conv);
4723 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fee(JNIEnv * _env, jclass _b, jlong this_ptr) {
4724 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
4725 LDKUpdateFee* ret = malloc(sizeof(LDKUpdateFee));
4726 *ret = CommitmentUpdate_get_update_fee(this_ptr_conv);
4727 assert(!ret->_underlying_ref);
4728 ret->_underlying_ref = true;
4732 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fee(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4733 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
4734 LDKUpdateFee val_conv = *(LDKUpdateFee*)val;
4736 val_conv._underlying_ref = false;
4737 return CommitmentUpdate_set_update_fee(this_ptr_conv, val_conv);
4740 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1commitment_1signed(JNIEnv * _env, jclass _b, jlong this_ptr) {
4741 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
4742 LDKCommitmentSigned* ret = malloc(sizeof(LDKCommitmentSigned));
4743 *ret = CommitmentUpdate_get_commitment_signed(this_ptr_conv);
4744 assert(!ret->_underlying_ref);
4745 ret->_underlying_ref = true;
4749 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1commitment_1signed(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4750 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
4751 LDKCommitmentSigned val_conv = *(LDKCommitmentSigned*)val;
4753 val_conv._underlying_ref = false;
4754 return CommitmentUpdate_set_commitment_signed(this_ptr_conv, val_conv);
4757 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) {
4758 LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg_conv = *(LDKCVec_UpdateAddHTLCZ*)update_add_htlcs_arg;
4759 free((void*)update_add_htlcs_arg);
4760 LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg_conv = *(LDKCVec_UpdateFulfillHTLCZ*)update_fulfill_htlcs_arg;
4761 free((void*)update_fulfill_htlcs_arg);
4762 LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg_conv = *(LDKCVec_UpdateFailHTLCZ*)update_fail_htlcs_arg;
4763 free((void*)update_fail_htlcs_arg);
4764 LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg_conv = *(LDKCVec_UpdateFailMalformedHTLCZ*)update_fail_malformed_htlcs_arg;
4765 free((void*)update_fail_malformed_htlcs_arg);
4766 LDKUpdateFee update_fee_arg_conv = *(LDKUpdateFee*)update_fee_arg;
4767 free((void*)update_fee_arg);
4768 update_fee_arg_conv._underlying_ref = false;
4769 LDKCommitmentSigned commitment_signed_arg_conv = *(LDKCommitmentSigned*)commitment_signed_arg;
4770 free((void*)commitment_signed_arg);
4771 commitment_signed_arg_conv._underlying_ref = false;
4772 LDKCommitmentUpdate* ret = malloc(sizeof(LDKCommitmentUpdate));
4773 *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);
4774 assert(!ret->_underlying_ref);
4775 ret->_underlying_ref = true;
4779 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCFailChannelUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4780 LDKHTLCFailChannelUpdate this_ptr_conv = *(LDKHTLCFailChannelUpdate*)this_ptr;
4781 free((void*)this_ptr);
4782 return HTLCFailChannelUpdate_free(this_ptr_conv);
4785 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4786 LDKChannelMessageHandler *this_ptr_conv = (LDKChannelMessageHandler*)this_ptr;
4787 return ChannelMessageHandler_free(*this_ptr_conv);
4790 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4791 LDKRoutingMessageHandler *this_ptr_conv = (LDKRoutingMessageHandler*)this_ptr;
4792 return RoutingMessageHandler_free(*this_ptr_conv);
4795 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1write(JNIEnv * _env, jclass _b, jlong obj) {
4796 LDKAcceptChannel* obj_conv = (LDKAcceptChannel*)obj;
4797 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
4798 *ret = AcceptChannel_write(obj_conv);
4802 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1read(JNIEnv * _env, jclass _b, jlong ser) {
4803 LDKu8slice ser_conv = *(LDKu8slice*)ser;
4805 LDKAcceptChannel* ret = malloc(sizeof(LDKAcceptChannel));
4806 *ret = AcceptChannel_read(ser_conv);
4807 assert(!ret->_underlying_ref);
4808 ret->_underlying_ref = true;
4812 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1write(JNIEnv * _env, jclass _b, jlong obj) {
4813 LDKAnnouncementSignatures* obj_conv = (LDKAnnouncementSignatures*)obj;
4814 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
4815 *ret = AnnouncementSignatures_write(obj_conv);
4819 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1read(JNIEnv * _env, jclass _b, jlong ser) {
4820 LDKu8slice ser_conv = *(LDKu8slice*)ser;
4822 LDKAnnouncementSignatures* ret = malloc(sizeof(LDKAnnouncementSignatures));
4823 *ret = AnnouncementSignatures_read(ser_conv);
4824 assert(!ret->_underlying_ref);
4825 ret->_underlying_ref = true;
4829 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1write(JNIEnv * _env, jclass _b, jlong obj) {
4830 LDKChannelReestablish* obj_conv = (LDKChannelReestablish*)obj;
4831 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
4832 *ret = ChannelReestablish_write(obj_conv);
4836 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1read(JNIEnv * _env, jclass _b, jlong ser) {
4837 LDKu8slice ser_conv = *(LDKu8slice*)ser;
4839 LDKChannelReestablish* ret = malloc(sizeof(LDKChannelReestablish));
4840 *ret = ChannelReestablish_read(ser_conv);
4841 assert(!ret->_underlying_ref);
4842 ret->_underlying_ref = true;
4846 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
4847 LDKClosingSigned* obj_conv = (LDKClosingSigned*)obj;
4848 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
4849 *ret = ClosingSigned_write(obj_conv);
4853 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1read(JNIEnv * _env, jclass _b, jlong ser) {
4854 LDKu8slice ser_conv = *(LDKu8slice*)ser;
4856 LDKClosingSigned* ret = malloc(sizeof(LDKClosingSigned));
4857 *ret = ClosingSigned_read(ser_conv);
4858 assert(!ret->_underlying_ref);
4859 ret->_underlying_ref = true;
4863 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
4864 LDKCommitmentSigned* obj_conv = (LDKCommitmentSigned*)obj;
4865 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
4866 *ret = CommitmentSigned_write(obj_conv);
4870 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1read(JNIEnv * _env, jclass _b, jlong ser) {
4871 LDKu8slice ser_conv = *(LDKu8slice*)ser;
4873 LDKCommitmentSigned* ret = malloc(sizeof(LDKCommitmentSigned));
4874 *ret = CommitmentSigned_read(ser_conv);
4875 assert(!ret->_underlying_ref);
4876 ret->_underlying_ref = true;
4880 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1write(JNIEnv * _env, jclass _b, jlong obj) {
4881 LDKFundingCreated* obj_conv = (LDKFundingCreated*)obj;
4882 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
4883 *ret = FundingCreated_write(obj_conv);
4887 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1read(JNIEnv * _env, jclass _b, jlong ser) {
4888 LDKu8slice ser_conv = *(LDKu8slice*)ser;
4890 LDKFundingCreated* ret = malloc(sizeof(LDKFundingCreated));
4891 *ret = FundingCreated_read(ser_conv);
4892 assert(!ret->_underlying_ref);
4893 ret->_underlying_ref = true;
4897 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
4898 LDKFundingSigned* obj_conv = (LDKFundingSigned*)obj;
4899 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
4900 *ret = FundingSigned_write(obj_conv);
4904 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1read(JNIEnv * _env, jclass _b, jlong ser) {
4905 LDKu8slice ser_conv = *(LDKu8slice*)ser;
4907 LDKFundingSigned* ret = malloc(sizeof(LDKFundingSigned));
4908 *ret = FundingSigned_read(ser_conv);
4909 assert(!ret->_underlying_ref);
4910 ret->_underlying_ref = true;
4914 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1write(JNIEnv * _env, jclass _b, jlong obj) {
4915 LDKFundingLocked* obj_conv = (LDKFundingLocked*)obj;
4916 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
4917 *ret = FundingLocked_write(obj_conv);
4921 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1read(JNIEnv * _env, jclass _b, jlong ser) {
4922 LDKu8slice ser_conv = *(LDKu8slice*)ser;
4924 LDKFundingLocked* ret = malloc(sizeof(LDKFundingLocked));
4925 *ret = FundingLocked_read(ser_conv);
4926 assert(!ret->_underlying_ref);
4927 ret->_underlying_ref = true;
4931 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1write(JNIEnv * _env, jclass _b, jlong obj) {
4932 LDKInit* obj_conv = (LDKInit*)obj;
4933 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
4934 *ret = Init_write(obj_conv);
4938 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1read(JNIEnv * _env, jclass _b, jlong ser) {
4939 LDKu8slice ser_conv = *(LDKu8slice*)ser;
4941 LDKInit* ret = malloc(sizeof(LDKInit));
4942 *ret = Init_read(ser_conv);
4943 assert(!ret->_underlying_ref);
4944 ret->_underlying_ref = true;
4948 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1write(JNIEnv * _env, jclass _b, jlong obj) {
4949 LDKOpenChannel* obj_conv = (LDKOpenChannel*)obj;
4950 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
4951 *ret = OpenChannel_write(obj_conv);
4955 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1read(JNIEnv * _env, jclass _b, jlong ser) {
4956 LDKu8slice ser_conv = *(LDKu8slice*)ser;
4958 LDKOpenChannel* ret = malloc(sizeof(LDKOpenChannel));
4959 *ret = OpenChannel_read(ser_conv);
4960 assert(!ret->_underlying_ref);
4961 ret->_underlying_ref = true;
4965 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1write(JNIEnv * _env, jclass _b, jlong obj) {
4966 LDKRevokeAndACK* obj_conv = (LDKRevokeAndACK*)obj;
4967 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
4968 *ret = RevokeAndACK_write(obj_conv);
4972 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1read(JNIEnv * _env, jclass _b, jlong ser) {
4973 LDKu8slice ser_conv = *(LDKu8slice*)ser;
4975 LDKRevokeAndACK* ret = malloc(sizeof(LDKRevokeAndACK));
4976 *ret = RevokeAndACK_read(ser_conv);
4977 assert(!ret->_underlying_ref);
4978 ret->_underlying_ref = true;
4982 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1write(JNIEnv * _env, jclass _b, jlong obj) {
4983 LDKShutdown* obj_conv = (LDKShutdown*)obj;
4984 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
4985 *ret = Shutdown_write(obj_conv);
4989 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1read(JNIEnv * _env, jclass _b, jlong ser) {
4990 LDKu8slice ser_conv = *(LDKu8slice*)ser;
4992 LDKShutdown* ret = malloc(sizeof(LDKShutdown));
4993 *ret = Shutdown_read(ser_conv);
4994 assert(!ret->_underlying_ref);
4995 ret->_underlying_ref = true;
4999 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
5000 LDKUpdateFailHTLC* obj_conv = (LDKUpdateFailHTLC*)obj;
5001 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5002 *ret = UpdateFailHTLC_write(obj_conv);
5006 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
5007 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5009 LDKUpdateFailHTLC* ret = malloc(sizeof(LDKUpdateFailHTLC));
5010 *ret = UpdateFailHTLC_read(ser_conv);
5011 assert(!ret->_underlying_ref);
5012 ret->_underlying_ref = true;
5016 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
5017 LDKUpdateFailMalformedHTLC* obj_conv = (LDKUpdateFailMalformedHTLC*)obj;
5018 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5019 *ret = UpdateFailMalformedHTLC_write(obj_conv);
5023 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
5024 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5026 LDKUpdateFailMalformedHTLC* ret = malloc(sizeof(LDKUpdateFailMalformedHTLC));
5027 *ret = UpdateFailMalformedHTLC_read(ser_conv);
5028 assert(!ret->_underlying_ref);
5029 ret->_underlying_ref = true;
5033 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1write(JNIEnv * _env, jclass _b, jlong obj) {
5034 LDKUpdateFee* obj_conv = (LDKUpdateFee*)obj;
5035 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5036 *ret = UpdateFee_write(obj_conv);
5040 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1read(JNIEnv * _env, jclass _b, jlong ser) {
5041 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5043 LDKUpdateFee* ret = malloc(sizeof(LDKUpdateFee));
5044 *ret = UpdateFee_read(ser_conv);
5045 assert(!ret->_underlying_ref);
5046 ret->_underlying_ref = true;
5050 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
5051 LDKUpdateFulfillHTLC* obj_conv = (LDKUpdateFulfillHTLC*)obj;
5052 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5053 *ret = UpdateFulfillHTLC_write(obj_conv);
5057 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
5058 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5060 LDKUpdateFulfillHTLC* ret = malloc(sizeof(LDKUpdateFulfillHTLC));
5061 *ret = UpdateFulfillHTLC_read(ser_conv);
5062 assert(!ret->_underlying_ref);
5063 ret->_underlying_ref = true;
5067 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
5068 LDKUpdateAddHTLC* obj_conv = (LDKUpdateAddHTLC*)obj;
5069 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5070 *ret = UpdateAddHTLC_write(obj_conv);
5074 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
5075 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5077 LDKUpdateAddHTLC* ret = malloc(sizeof(LDKUpdateAddHTLC));
5078 *ret = UpdateAddHTLC_read(ser_conv);
5079 assert(!ret->_underlying_ref);
5080 ret->_underlying_ref = true;
5084 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1write(JNIEnv * _env, jclass _b, jlong obj) {
5085 LDKPing* obj_conv = (LDKPing*)obj;
5086 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5087 *ret = Ping_write(obj_conv);
5091 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1read(JNIEnv * _env, jclass _b, jlong ser) {
5092 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5094 LDKPing* ret = malloc(sizeof(LDKPing));
5095 *ret = Ping_read(ser_conv);
5096 assert(!ret->_underlying_ref);
5097 ret->_underlying_ref = true;
5101 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1write(JNIEnv * _env, jclass _b, jlong obj) {
5102 LDKPong* obj_conv = (LDKPong*)obj;
5103 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5104 *ret = Pong_write(obj_conv);
5108 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1read(JNIEnv * _env, jclass _b, jlong ser) {
5109 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5111 LDKPong* ret = malloc(sizeof(LDKPong));
5112 *ret = Pong_read(ser_conv);
5113 assert(!ret->_underlying_ref);
5114 ret->_underlying_ref = true;
5118 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
5119 LDKUnsignedChannelAnnouncement* obj_conv = (LDKUnsignedChannelAnnouncement*)obj;
5120 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5121 *ret = UnsignedChannelAnnouncement_write(obj_conv);
5125 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
5126 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5128 LDKUnsignedChannelAnnouncement* ret = malloc(sizeof(LDKUnsignedChannelAnnouncement));
5129 *ret = UnsignedChannelAnnouncement_read(ser_conv);
5130 assert(!ret->_underlying_ref);
5131 ret->_underlying_ref = true;
5135 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
5136 LDKChannelAnnouncement* obj_conv = (LDKChannelAnnouncement*)obj;
5137 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5138 *ret = ChannelAnnouncement_write(obj_conv);
5142 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
5143 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5145 LDKChannelAnnouncement* ret = malloc(sizeof(LDKChannelAnnouncement));
5146 *ret = ChannelAnnouncement_read(ser_conv);
5147 assert(!ret->_underlying_ref);
5148 ret->_underlying_ref = true;
5152 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
5153 LDKUnsignedChannelUpdate* obj_conv = (LDKUnsignedChannelUpdate*)obj;
5154 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5155 *ret = UnsignedChannelUpdate_write(obj_conv);
5159 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
5160 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5162 LDKUnsignedChannelUpdate* ret = malloc(sizeof(LDKUnsignedChannelUpdate));
5163 *ret = UnsignedChannelUpdate_read(ser_conv);
5164 assert(!ret->_underlying_ref);
5165 ret->_underlying_ref = true;
5169 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
5170 LDKChannelUpdate* obj_conv = (LDKChannelUpdate*)obj;
5171 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5172 *ret = ChannelUpdate_write(obj_conv);
5176 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
5177 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5179 LDKChannelUpdate* ret = malloc(sizeof(LDKChannelUpdate));
5180 *ret = ChannelUpdate_read(ser_conv);
5181 assert(!ret->_underlying_ref);
5182 ret->_underlying_ref = true;
5186 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1write(JNIEnv * _env, jclass _b, jlong obj) {
5187 LDKErrorMessage* obj_conv = (LDKErrorMessage*)obj;
5188 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5189 *ret = ErrorMessage_write(obj_conv);
5193 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1read(JNIEnv * _env, jclass _b, jlong ser) {
5194 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5196 LDKErrorMessage* ret = malloc(sizeof(LDKErrorMessage));
5197 *ret = ErrorMessage_read(ser_conv);
5198 assert(!ret->_underlying_ref);
5199 ret->_underlying_ref = true;
5203 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
5204 LDKUnsignedNodeAnnouncement* obj_conv = (LDKUnsignedNodeAnnouncement*)obj;
5205 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5206 *ret = UnsignedNodeAnnouncement_write(obj_conv);
5210 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
5211 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5213 LDKUnsignedNodeAnnouncement* ret = malloc(sizeof(LDKUnsignedNodeAnnouncement));
5214 *ret = UnsignedNodeAnnouncement_read(ser_conv);
5215 assert(!ret->_underlying_ref);
5216 ret->_underlying_ref = true;
5220 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
5221 LDKNodeAnnouncement* obj_conv = (LDKNodeAnnouncement*)obj;
5222 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5223 *ret = NodeAnnouncement_write(obj_conv);
5227 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
5228 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5230 LDKNodeAnnouncement* ret = malloc(sizeof(LDKNodeAnnouncement));
5231 *ret = NodeAnnouncement_read(ser_conv);
5232 assert(!ret->_underlying_ref);
5233 ret->_underlying_ref = true;
5237 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5238 LDKMessageHandler this_ptr_conv = *(LDKMessageHandler*)this_ptr;
5239 free((void*)this_ptr);
5240 this_ptr_conv._underlying_ref = false;
5241 return MessageHandler_free(this_ptr_conv);
5244 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1chan_1handler(JNIEnv * _env, jclass _b, jlong this_ptr) {
5245 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
5246 long ret = (long)MessageHandler_get_chan_handler(this_ptr_conv);
5250 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1chan_1handler(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5251 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
5252 LDKChannelMessageHandler *val_conv = (LDKChannelMessageHandler*)val;
5253 LDKChannelMessageHandler_JCalls_clone(val_conv->this_arg);
5254 return MessageHandler_set_chan_handler(this_ptr_conv, *val_conv);
5257 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1route_1handler(JNIEnv * _env, jclass _b, jlong this_ptr) {
5258 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
5259 long ret = (long)MessageHandler_get_route_handler(this_ptr_conv);
5263 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1route_1handler(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5264 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
5265 LDKRoutingMessageHandler *val_conv = (LDKRoutingMessageHandler*)val;
5266 LDKRoutingMessageHandler_JCalls_clone(val_conv->this_arg);
5267 return MessageHandler_set_route_handler(this_ptr_conv, *val_conv);
5270 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new(JNIEnv * _env, jclass _b, jlong chan_handler_arg, jlong route_handler_arg) {
5271 LDKChannelMessageHandler *chan_handler_arg_conv = (LDKChannelMessageHandler*)chan_handler_arg;
5272 LDKChannelMessageHandler_JCalls_clone(chan_handler_arg_conv->this_arg);
5273 LDKRoutingMessageHandler *route_handler_arg_conv = (LDKRoutingMessageHandler*)route_handler_arg;
5274 LDKRoutingMessageHandler_JCalls_clone(route_handler_arg_conv->this_arg);
5275 LDKMessageHandler* ret = malloc(sizeof(LDKMessageHandler));
5276 *ret = MessageHandler_new(*chan_handler_arg_conv, *route_handler_arg_conv);
5277 assert(!ret->_underlying_ref);
5278 ret->_underlying_ref = true;
5282 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5283 LDKSocketDescriptor *this_ptr_conv = (LDKSocketDescriptor*)this_ptr;
5284 return SocketDescriptor_free(*this_ptr_conv);
5287 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5288 LDKPeerHandleError this_ptr_conv = *(LDKPeerHandleError*)this_ptr;
5289 free((void*)this_ptr);
5290 this_ptr_conv._underlying_ref = false;
5291 return PeerHandleError_free(this_ptr_conv);
5294 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1get_1no_1connection_1possible(JNIEnv * _env, jclass _b, jlong this_ptr) {
5295 LDKPeerHandleError* this_ptr_conv = (LDKPeerHandleError*)this_ptr;
5296 return PeerHandleError_get_no_connection_possible(this_ptr_conv);
5299 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1set_1no_1connection_1possible(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
5300 LDKPeerHandleError* this_ptr_conv = (LDKPeerHandleError*)this_ptr;
5301 return PeerHandleError_set_no_connection_possible(this_ptr_conv, val);
5304 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new(JNIEnv * _env, jclass _b, jboolean no_connection_possible_arg) {
5305 LDKPeerHandleError* ret = malloc(sizeof(LDKPeerHandleError));
5306 *ret = PeerHandleError_new(no_connection_possible_arg);
5307 assert(!ret->_underlying_ref);
5308 ret->_underlying_ref = true;
5312 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5313 LDKPeerManager this_ptr_conv = *(LDKPeerManager*)this_ptr;
5314 free((void*)this_ptr);
5315 this_ptr_conv._underlying_ref = false;
5316 return PeerManager_free(this_ptr_conv);
5319 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) {
5320 LDKMessageHandler message_handler_conv = *(LDKMessageHandler*)message_handler;
5321 free((void*)message_handler);
5322 message_handler_conv._underlying_ref = false;
5323 LDKSecretKey our_node_secret_conv = *(LDKSecretKey*)our_node_secret;
5324 free((void*)our_node_secret);
5325 unsigned char ephemeral_random_data_arr[32];
5326 (*_env)->GetByteArrayRegion (_env, ephemeral_random_data, 0, 32, ephemeral_random_data_arr);
5327 unsigned char (*ephemeral_random_data_ref)[32] = &ephemeral_random_data_arr;
5328 LDKLogger *logger_conv = (LDKLogger*)logger;
5329 LDKLogger_JCalls_clone(logger_conv->this_arg);
5330 LDKPeerManager* ret = malloc(sizeof(LDKPeerManager));
5331 *ret = PeerManager_new(message_handler_conv, our_node_secret_conv, ephemeral_random_data_ref, *logger_conv);
5332 assert(!ret->_underlying_ref);
5333 ret->_underlying_ref = true;
5337 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1get_1peer_1node_1ids(JNIEnv * _env, jclass _b, jlong this_arg) {
5338 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
5339 LDKCVec_PublicKeyZ* ret = malloc(sizeof(LDKCVec_PublicKeyZ));
5340 *ret = PeerManager_get_peer_node_ids(this_arg_conv);
5344 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) {
5345 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
5346 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
5347 free((void*)their_node_id);
5348 LDKSocketDescriptor *descriptor_conv = (LDKSocketDescriptor*)descriptor;
5349 LDKSocketDescriptor_JCalls_clone(descriptor_conv->this_arg);
5350 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret = malloc(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ));
5351 *ret = PeerManager_new_outbound_connection(this_arg_conv, their_node_id_conv, *descriptor_conv);
5355 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1inbound_1connection(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) {
5356 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
5357 LDKSocketDescriptor *descriptor_conv = (LDKSocketDescriptor*)descriptor;
5358 LDKSocketDescriptor_JCalls_clone(descriptor_conv->this_arg);
5359 LDKCResult_NonePeerHandleErrorZ* ret = malloc(sizeof(LDKCResult_NonePeerHandleErrorZ));
5360 *ret = PeerManager_new_inbound_connection(this_arg_conv, *descriptor_conv);
5364 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1write_1buffer_1space_1avail(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) {
5365 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
5366 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor;
5367 LDKCResult_NonePeerHandleErrorZ* ret = malloc(sizeof(LDKCResult_NonePeerHandleErrorZ));
5368 *ret = PeerManager_write_buffer_space_avail(this_arg_conv, descriptor_conv);
5372 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1read_1event(JNIEnv * _env, jclass _b, jlong this_arg, jlong peer_descriptor, jlong data) {
5373 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
5374 LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor;
5375 LDKu8slice data_conv = *(LDKu8slice*)data;
5377 LDKCResult_boolPeerHandleErrorZ* ret = malloc(sizeof(LDKCResult_boolPeerHandleErrorZ));
5378 *ret = PeerManager_read_event(this_arg_conv, peer_descriptor_conv, data_conv);
5382 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1process_1events(JNIEnv * _env, jclass _b, jlong this_arg) {
5383 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
5384 return PeerManager_process_events(this_arg_conv);
5387 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1socket_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) {
5388 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
5389 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor;
5390 return PeerManager_socket_disconnected(this_arg_conv, descriptor_conv);
5393 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1timer_1tick_1occured(JNIEnv * _env, jclass _b, jlong this_arg) {
5394 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
5395 return PeerManager_timer_tick_occured(this_arg_conv);
5398 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_build_1commitment_1secret(JNIEnv * _env, jclass _b, jbyteArray commitment_seed, jlong idx) {
5399 unsigned char commitment_seed_arr[32];
5400 (*_env)->GetByteArrayRegion (_env, commitment_seed, 0, 32, commitment_seed_arr);
5401 unsigned char (*commitment_seed_ref)[32] = &commitment_seed_arr;
5402 LDKThirtyTwoBytes* ret = malloc(sizeof(LDKThirtyTwoBytes));
5403 *ret = build_commitment_secret(commitment_seed_ref, idx);
5407 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5408 LDKTxCreationKeys this_ptr_conv = *(LDKTxCreationKeys*)this_ptr;
5409 free((void*)this_ptr);
5410 this_ptr_conv._underlying_ref = false;
5411 return TxCreationKeys_free(this_ptr_conv);
5414 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
5415 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
5416 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
5417 *ret = TxCreationKeys_get_per_commitment_point(this_ptr_conv);
5421 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5422 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
5423 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5425 return TxCreationKeys_set_per_commitment_point(this_ptr_conv, val_conv);
5428 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1revocation_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
5429 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
5430 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
5431 *ret = TxCreationKeys_get_revocation_key(this_ptr_conv);
5435 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1revocation_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5436 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
5437 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5439 return TxCreationKeys_set_revocation_key(this_ptr_conv, val_conv);
5442 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1a_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
5443 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
5444 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
5445 *ret = TxCreationKeys_get_a_htlc_key(this_ptr_conv);
5449 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1a_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5450 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
5451 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5453 return TxCreationKeys_set_a_htlc_key(this_ptr_conv, val_conv);
5456 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1b_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
5457 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
5458 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
5459 *ret = TxCreationKeys_get_b_htlc_key(this_ptr_conv);
5463 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1b_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5464 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
5465 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5467 return TxCreationKeys_set_b_htlc_key(this_ptr_conv, val_conv);
5470 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1a_1delayed_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
5471 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
5472 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
5473 *ret = TxCreationKeys_get_a_delayed_payment_key(this_ptr_conv);
5477 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1a_1delayed_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5478 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
5479 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5481 return TxCreationKeys_set_a_delayed_payment_key(this_ptr_conv, val_conv);
5484 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) {
5485 LDKPublicKey per_commitment_point_arg_conv = *(LDKPublicKey*)per_commitment_point_arg;
5486 free((void*)per_commitment_point_arg);
5487 LDKPublicKey revocation_key_arg_conv = *(LDKPublicKey*)revocation_key_arg;
5488 free((void*)revocation_key_arg);
5489 LDKPublicKey a_htlc_key_arg_conv = *(LDKPublicKey*)a_htlc_key_arg;
5490 free((void*)a_htlc_key_arg);
5491 LDKPublicKey b_htlc_key_arg_conv = *(LDKPublicKey*)b_htlc_key_arg;
5492 free((void*)b_htlc_key_arg);
5493 LDKPublicKey a_delayed_payment_key_arg_conv = *(LDKPublicKey*)a_delayed_payment_key_arg;
5494 free((void*)a_delayed_payment_key_arg);
5495 LDKTxCreationKeys* ret = malloc(sizeof(LDKTxCreationKeys));
5496 *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);
5497 assert(!ret->_underlying_ref);
5498 ret->_underlying_ref = true;
5502 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1write(JNIEnv * _env, jclass _b, jlong obj) {
5503 LDKTxCreationKeys* obj_conv = (LDKTxCreationKeys*)obj;
5504 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5505 *ret = TxCreationKeys_write(obj_conv);
5509 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1read(JNIEnv * _env, jclass _b, jlong ser) {
5510 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5512 LDKTxCreationKeys* ret = malloc(sizeof(LDKTxCreationKeys));
5513 *ret = TxCreationKeys_read(ser_conv);
5514 assert(!ret->_underlying_ref);
5515 ret->_underlying_ref = true;
5519 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5520 LDKPreCalculatedTxCreationKeys this_ptr_conv = *(LDKPreCalculatedTxCreationKeys*)this_ptr;
5521 free((void*)this_ptr);
5522 this_ptr_conv._underlying_ref = false;
5523 return PreCalculatedTxCreationKeys_free(this_ptr_conv);
5526 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1new(JNIEnv * _env, jclass _b, jlong keys) {
5527 LDKTxCreationKeys keys_conv = *(LDKTxCreationKeys*)keys;
5529 keys_conv._underlying_ref = false;
5530 LDKPreCalculatedTxCreationKeys* ret = malloc(sizeof(LDKPreCalculatedTxCreationKeys));
5531 *ret = PreCalculatedTxCreationKeys_new(keys_conv);
5532 assert(!ret->_underlying_ref);
5533 ret->_underlying_ref = true;
5537 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1trust_1key_1derivation(JNIEnv * _env, jclass _b, jlong this_arg) {
5538 LDKPreCalculatedTxCreationKeys* this_arg_conv = (LDKPreCalculatedTxCreationKeys*)this_arg;
5539 LDKTxCreationKeys* ret = malloc(sizeof(LDKTxCreationKeys));
5540 *ret = PreCalculatedTxCreationKeys_trust_key_derivation(this_arg_conv);
5541 assert(!ret->_underlying_ref);
5542 ret->_underlying_ref = true;
5546 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_arg) {
5547 LDKPreCalculatedTxCreationKeys* this_arg_conv = (LDKPreCalculatedTxCreationKeys*)this_arg;
5548 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
5549 *ret = PreCalculatedTxCreationKeys_per_commitment_point(this_arg_conv);
5553 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5554 LDKChannelPublicKeys this_ptr_conv = *(LDKChannelPublicKeys*)this_ptr;
5555 free((void*)this_ptr);
5556 this_ptr_conv._underlying_ref = false;
5557 return ChannelPublicKeys_free(this_ptr_conv);
5560 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
5561 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
5562 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
5563 *ret = ChannelPublicKeys_get_funding_pubkey(this_ptr_conv);
5567 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5568 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
5569 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5571 return ChannelPublicKeys_set_funding_pubkey(this_ptr_conv, val_conv);
5574 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
5575 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
5576 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
5577 *ret = ChannelPublicKeys_get_revocation_basepoint(this_ptr_conv);
5581 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5582 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
5583 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5585 return ChannelPublicKeys_set_revocation_basepoint(this_ptr_conv, val_conv);
5588 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
5589 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
5590 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
5591 *ret = ChannelPublicKeys_get_payment_point(this_ptr_conv);
5595 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5596 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
5597 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5599 return ChannelPublicKeys_set_payment_point(this_ptr_conv, val_conv);
5602 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
5603 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
5604 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
5605 *ret = ChannelPublicKeys_get_delayed_payment_basepoint(this_ptr_conv);
5609 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5610 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
5611 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5613 return ChannelPublicKeys_set_delayed_payment_basepoint(this_ptr_conv, val_conv);
5616 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
5617 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
5618 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
5619 *ret = ChannelPublicKeys_get_htlc_basepoint(this_ptr_conv);
5623 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5624 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
5625 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5627 return ChannelPublicKeys_set_htlc_basepoint(this_ptr_conv, val_conv);
5630 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) {
5631 LDKPublicKey funding_pubkey_arg_conv = *(LDKPublicKey*)funding_pubkey_arg;
5632 free((void*)funding_pubkey_arg);
5633 LDKPublicKey revocation_basepoint_arg_conv = *(LDKPublicKey*)revocation_basepoint_arg;
5634 free((void*)revocation_basepoint_arg);
5635 LDKPublicKey payment_point_arg_conv = *(LDKPublicKey*)payment_point_arg;
5636 free((void*)payment_point_arg);
5637 LDKPublicKey delayed_payment_basepoint_arg_conv = *(LDKPublicKey*)delayed_payment_basepoint_arg;
5638 free((void*)delayed_payment_basepoint_arg);
5639 LDKPublicKey htlc_basepoint_arg_conv = *(LDKPublicKey*)htlc_basepoint_arg;
5640 free((void*)htlc_basepoint_arg);
5641 LDKChannelPublicKeys* ret = malloc(sizeof(LDKChannelPublicKeys));
5642 *ret = ChannelPublicKeys_new(funding_pubkey_arg_conv, revocation_basepoint_arg_conv, payment_point_arg_conv, delayed_payment_basepoint_arg_conv, htlc_basepoint_arg_conv);
5643 assert(!ret->_underlying_ref);
5644 ret->_underlying_ref = true;
5648 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1write(JNIEnv * _env, jclass _b, jlong obj) {
5649 LDKChannelPublicKeys* obj_conv = (LDKChannelPublicKeys*)obj;
5650 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5651 *ret = ChannelPublicKeys_write(obj_conv);
5655 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1read(JNIEnv * _env, jclass _b, jlong ser) {
5656 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5658 LDKChannelPublicKeys* ret = malloc(sizeof(LDKChannelPublicKeys));
5659 *ret = ChannelPublicKeys_read(ser_conv);
5660 assert(!ret->_underlying_ref);
5661 ret->_underlying_ref = true;
5665 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) {
5666 LDKPublicKey per_commitment_point_conv = *(LDKPublicKey*)per_commitment_point;
5667 free((void*)per_commitment_point);
5668 LDKPublicKey a_delayed_payment_base_conv = *(LDKPublicKey*)a_delayed_payment_base;
5669 free((void*)a_delayed_payment_base);
5670 LDKPublicKey a_htlc_base_conv = *(LDKPublicKey*)a_htlc_base;
5671 free((void*)a_htlc_base);
5672 LDKPublicKey b_revocation_base_conv = *(LDKPublicKey*)b_revocation_base;
5673 free((void*)b_revocation_base);
5674 LDKPublicKey b_htlc_base_conv = *(LDKPublicKey*)b_htlc_base;
5675 free((void*)b_htlc_base);
5676 LDKCResult_TxCreationKeysSecpErrorZ* ret = malloc(sizeof(LDKCResult_TxCreationKeysSecpErrorZ));
5677 *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);
5681 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) {
5682 LDKPublicKey revocation_key_conv = *(LDKPublicKey*)revocation_key;
5683 free((void*)revocation_key);
5684 LDKPublicKey delayed_payment_key_conv = *(LDKPublicKey*)delayed_payment_key;
5685 free((void*)delayed_payment_key);
5686 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5687 *ret = get_revokeable_redeemscript(revocation_key_conv, to_self_delay, delayed_payment_key_conv);
5691 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5692 LDKHTLCOutputInCommitment this_ptr_conv = *(LDKHTLCOutputInCommitment*)this_ptr;
5693 free((void*)this_ptr);
5694 this_ptr_conv._underlying_ref = false;
5695 return HTLCOutputInCommitment_free(this_ptr_conv);
5698 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1offered(JNIEnv * _env, jclass _b, jlong this_ptr) {
5699 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
5700 return HTLCOutputInCommitment_get_offered(this_ptr_conv);
5703 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1offered(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
5704 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
5705 return HTLCOutputInCommitment_set_offered(this_ptr_conv, val);
5708 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
5709 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
5710 return HTLCOutputInCommitment_get_amount_msat(this_ptr_conv);
5713 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5714 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
5715 return HTLCOutputInCommitment_set_amount_msat(this_ptr_conv, val);
5718 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr) {
5719 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
5720 return HTLCOutputInCommitment_get_cltv_expiry(this_ptr_conv);
5723 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5724 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
5725 return HTLCOutputInCommitment_set_cltv_expiry(this_ptr_conv, val);
5728 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
5729 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
5730 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5731 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *HTLCOutputInCommitment_get_payment_hash(this_ptr_conv));
5735 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5736 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
5737 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5739 return HTLCOutputInCommitment_set_payment_hash(this_ptr_conv, val_conv);
5742 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1write(JNIEnv * _env, jclass _b, jlong obj) {
5743 LDKHTLCOutputInCommitment* obj_conv = (LDKHTLCOutputInCommitment*)obj;
5744 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5745 *ret = HTLCOutputInCommitment_write(obj_conv);
5749 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1read(JNIEnv * _env, jclass _b, jlong ser) {
5750 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5752 LDKHTLCOutputInCommitment* ret = malloc(sizeof(LDKHTLCOutputInCommitment));
5753 *ret = HTLCOutputInCommitment_read(ser_conv);
5754 assert(!ret->_underlying_ref);
5755 ret->_underlying_ref = true;
5759 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_get_1htlc_1redeemscript(JNIEnv * _env, jclass _b, jlong htlc, jlong keys) {
5760 LDKHTLCOutputInCommitment* htlc_conv = (LDKHTLCOutputInCommitment*)htlc;
5761 LDKTxCreationKeys* keys_conv = (LDKTxCreationKeys*)keys;
5762 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5763 *ret = get_htlc_redeemscript(htlc_conv, keys_conv);
5767 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_make_1funding_1redeemscript(JNIEnv * _env, jclass _b, jlong a, jlong b) {
5768 LDKPublicKey a_conv = *(LDKPublicKey*)a;
5770 LDKPublicKey b_conv = *(LDKPublicKey*)b;
5772 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5773 *ret = make_funding_redeemscript(a_conv, b_conv);
5777 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) {
5778 unsigned char prev_hash_arr[32];
5779 (*_env)->GetByteArrayRegion (_env, prev_hash, 0, 32, prev_hash_arr);
5780 unsigned char (*prev_hash_ref)[32] = &prev_hash_arr;
5781 LDKHTLCOutputInCommitment* htlc_conv = (LDKHTLCOutputInCommitment*)htlc;
5782 LDKPublicKey a_delayed_payment_key_conv = *(LDKPublicKey*)a_delayed_payment_key;
5783 free((void*)a_delayed_payment_key);
5784 LDKPublicKey revocation_key_conv = *(LDKPublicKey*)revocation_key;
5785 free((void*)revocation_key);
5786 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5787 *ret = build_htlc_transaction(prev_hash_ref, feerate_per_kw, to_self_delay, htlc_conv, a_delayed_payment_key_conv, revocation_key_conv);
5791 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5792 LDKLocalCommitmentTransaction this_ptr_conv = *(LDKLocalCommitmentTransaction*)this_ptr;
5793 free((void*)this_ptr);
5794 this_ptr_conv._underlying_ref = false;
5795 return LocalCommitmentTransaction_free(this_ptr_conv);
5798 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1get_1unsigned_1tx(JNIEnv * _env, jclass _b, jlong this_ptr) {
5799 LDKLocalCommitmentTransaction* this_ptr_conv = (LDKLocalCommitmentTransaction*)this_ptr;
5800 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5801 *ret = LocalCommitmentTransaction_get_unsigned_tx(this_ptr_conv);
5805 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1set_1unsigned_1tx(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5806 LDKLocalCommitmentTransaction* this_ptr_conv = (LDKLocalCommitmentTransaction*)this_ptr;
5807 LDKCVec_u8Z val_conv = *(LDKCVec_u8Z*)val;
5809 return LocalCommitmentTransaction_set_unsigned_tx(this_ptr_conv, val_conv);
5812 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1get_1their_1sig(JNIEnv * _env, jclass _b, jlong this_ptr) {
5813 LDKLocalCommitmentTransaction* this_ptr_conv = (LDKLocalCommitmentTransaction*)this_ptr;
5814 LDKSignature* ret = malloc(sizeof(LDKSignature));
5815 *ret = LocalCommitmentTransaction_get_their_sig(this_ptr_conv);
5819 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1set_1their_1sig(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5820 LDKLocalCommitmentTransaction* this_ptr_conv = (LDKLocalCommitmentTransaction*)this_ptr;
5821 LDKSignature val_conv = *(LDKSignature*)val;
5823 return LocalCommitmentTransaction_set_their_sig(this_ptr_conv, val_conv);
5826 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1get_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr) {
5827 LDKLocalCommitmentTransaction* this_ptr_conv = (LDKLocalCommitmentTransaction*)this_ptr;
5828 return LocalCommitmentTransaction_get_feerate_per_kw(this_ptr_conv);
5831 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1set_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5832 LDKLocalCommitmentTransaction* this_ptr_conv = (LDKLocalCommitmentTransaction*)this_ptr;
5833 return LocalCommitmentTransaction_set_feerate_per_kw(this_ptr_conv, val);
5836 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1set_1per_1htlc(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5837 LDKLocalCommitmentTransaction* this_ptr_conv = (LDKLocalCommitmentTransaction*)this_ptr;
5838 LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ val_conv = *(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ*)val;
5840 return LocalCommitmentTransaction_set_per_htlc(this_ptr_conv, val_conv);
5843 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) {
5844 LDKCVec_u8Z unsigned_tx_conv = *(LDKCVec_u8Z*)unsigned_tx;
5845 free((void*)unsigned_tx);
5846 LDKSignature their_sig_conv = *(LDKSignature*)their_sig;
5847 free((void*)their_sig);
5848 LDKPublicKey our_funding_key_conv = *(LDKPublicKey*)our_funding_key;
5849 free((void*)our_funding_key);
5850 LDKPublicKey their_funding_key_conv = *(LDKPublicKey*)their_funding_key;
5851 free((void*)their_funding_key);
5852 LDKTxCreationKeys local_keys_conv = *(LDKTxCreationKeys*)local_keys;
5853 free((void*)local_keys);
5854 local_keys_conv._underlying_ref = false;
5855 LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ htlc_data_conv = *(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ*)htlc_data;
5856 free((void*)htlc_data);
5857 LDKLocalCommitmentTransaction* ret = malloc(sizeof(LDKLocalCommitmentTransaction));
5858 *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);
5859 assert(!ret->_underlying_ref);
5860 ret->_underlying_ref = true;
5864 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1trust_1key_1derivation(JNIEnv * _env, jclass _b, jlong this_arg) {
5865 LDKLocalCommitmentTransaction* this_arg_conv = (LDKLocalCommitmentTransaction*)this_arg;
5866 LDKTxCreationKeys* ret = malloc(sizeof(LDKTxCreationKeys));
5867 *ret = LocalCommitmentTransaction_trust_key_derivation(this_arg_conv);
5868 assert(!ret->_underlying_ref);
5869 ret->_underlying_ref = true;
5873 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1txid(JNIEnv * _env, jclass _b, jlong this_arg) {
5874 LDKLocalCommitmentTransaction* this_arg_conv = (LDKLocalCommitmentTransaction*)this_arg;
5875 LDKThirtyTwoBytes* ret = malloc(sizeof(LDKThirtyTwoBytes));
5876 *ret = LocalCommitmentTransaction_txid(this_arg_conv);
5880 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) {
5881 LDKLocalCommitmentTransaction* this_arg_conv = (LDKLocalCommitmentTransaction*)this_arg;
5882 unsigned char funding_key_arr[32];
5883 (*_env)->GetByteArrayRegion (_env, funding_key, 0, 32, funding_key_arr);
5884 unsigned char (*funding_key_ref)[32] = &funding_key_arr;
5885 LDKu8slice funding_redeemscript_conv = *(LDKu8slice*)funding_redeemscript;
5886 free((void*)funding_redeemscript);
5887 LDKSignature* ret = malloc(sizeof(LDKSignature));
5888 *ret = LocalCommitmentTransaction_get_local_sig(this_arg_conv, funding_key_ref, funding_redeemscript_conv, channel_value_satoshis);
5892 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) {
5893 LDKLocalCommitmentTransaction* this_arg_conv = (LDKLocalCommitmentTransaction*)this_arg;
5894 unsigned char htlc_base_key_arr[32];
5895 (*_env)->GetByteArrayRegion (_env, htlc_base_key, 0, 32, htlc_base_key_arr);
5896 unsigned char (*htlc_base_key_ref)[32] = &htlc_base_key_arr;
5897 LDKCResult_CVec_SignatureZNoneZ* ret = malloc(sizeof(LDKCResult_CVec_SignatureZNoneZ));
5898 *ret = LocalCommitmentTransaction_get_htlc_sigs(this_arg_conv, htlc_base_key_ref, local_csv);
5902 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1write(JNIEnv * _env, jclass _b, jlong obj) {
5903 LDKLocalCommitmentTransaction* obj_conv = (LDKLocalCommitmentTransaction*)obj;
5904 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
5905 *ret = LocalCommitmentTransaction_write(obj_conv);
5909 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LocalCommitmentTransaction_1read(JNIEnv * _env, jclass _b, jlong ser) {
5910 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5912 LDKLocalCommitmentTransaction* ret = malloc(sizeof(LDKLocalCommitmentTransaction));
5913 *ret = LocalCommitmentTransaction_read(ser_conv);
5914 assert(!ret->_underlying_ref);
5915 ret->_underlying_ref = true;
5919 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5920 LDKInitFeatures this_ptr_conv = *(LDKInitFeatures*)this_ptr;
5921 free((void*)this_ptr);
5922 this_ptr_conv._underlying_ref = false;
5923 return InitFeatures_free(this_ptr_conv);
5926 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5927 LDKNodeFeatures this_ptr_conv = *(LDKNodeFeatures*)this_ptr;
5928 free((void*)this_ptr);
5929 this_ptr_conv._underlying_ref = false;
5930 return NodeFeatures_free(this_ptr_conv);
5933 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5934 LDKChannelFeatures this_ptr_conv = *(LDKChannelFeatures*)this_ptr;
5935 free((void*)this_ptr);
5936 this_ptr_conv._underlying_ref = false;
5937 return ChannelFeatures_free(this_ptr_conv);
5940 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5941 LDKRouteHop this_ptr_conv = *(LDKRouteHop*)this_ptr;
5942 free((void*)this_ptr);
5943 this_ptr_conv._underlying_ref = false;
5944 return RouteHop_free(this_ptr_conv);
5947 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
5948 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
5949 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
5950 *ret = RouteHop_get_pubkey(this_ptr_conv);
5954 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5955 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
5956 LDKPublicKey val_conv = *(LDKPublicKey*)val;
5958 return RouteHop_set_pubkey(this_ptr_conv, val_conv);
5961 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5962 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
5963 return RouteHop_get_short_channel_id(this_ptr_conv);
5966 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5967 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
5968 return RouteHop_set_short_channel_id(this_ptr_conv, val);
5971 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1fee_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
5972 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
5973 return RouteHop_get_fee_msat(this_ptr_conv);
5976 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1fee_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5977 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
5978 return RouteHop_set_fee_msat(this_ptr_conv, val);
5981 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
5982 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
5983 return RouteHop_get_cltv_expiry_delta(this_ptr_conv);
5986 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5987 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
5988 return RouteHop_set_cltv_expiry_delta(this_ptr_conv, val);
5991 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5992 LDKRoute this_ptr_conv = *(LDKRoute*)this_ptr;
5993 free((void*)this_ptr);
5994 this_ptr_conv._underlying_ref = false;
5995 return Route_free(this_ptr_conv);
5998 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1paths(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5999 LDKRoute* this_ptr_conv = (LDKRoute*)this_ptr;
6000 LDKCVec_CVec_RouteHopZZ val_conv = *(LDKCVec_CVec_RouteHopZZ*)val;
6002 return Route_set_paths(this_ptr_conv, val_conv);
6005 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv * _env, jclass _b, jlong paths_arg) {
6006 LDKCVec_CVec_RouteHopZZ paths_arg_conv = *(LDKCVec_CVec_RouteHopZZ*)paths_arg;
6007 free((void*)paths_arg);
6008 LDKRoute* ret = malloc(sizeof(LDKRoute));
6009 *ret = Route_new(paths_arg_conv);
6010 assert(!ret->_underlying_ref);
6011 ret->_underlying_ref = true;
6015 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1write(JNIEnv * _env, jclass _b, jlong obj) {
6016 LDKRoute* obj_conv = (LDKRoute*)obj;
6017 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
6018 *ret = Route_write(obj_conv);
6022 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1read(JNIEnv * _env, jclass _b, jlong ser) {
6023 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6025 LDKRoute* ret = malloc(sizeof(LDKRoute));
6026 *ret = Route_read(ser_conv);
6027 assert(!ret->_underlying_ref);
6028 ret->_underlying_ref = true;
6032 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6033 LDKRouteHint this_ptr_conv = *(LDKRouteHint*)this_ptr;
6034 free((void*)this_ptr);
6035 this_ptr_conv._underlying_ref = false;
6036 return RouteHint_free(this_ptr_conv);
6039 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1src_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6040 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6041 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
6042 *ret = RouteHint_get_src_node_id(this_ptr_conv);
6046 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1src_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6047 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6048 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6050 return RouteHint_set_src_node_id(this_ptr_conv, val_conv);
6053 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6054 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6055 return RouteHint_get_short_channel_id(this_ptr_conv);
6058 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6059 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6060 return RouteHint_set_short_channel_id(this_ptr_conv, val);
6063 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1fees(JNIEnv * _env, jclass _b, jlong this_ptr) {
6064 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6065 LDKRoutingFees* ret = malloc(sizeof(LDKRoutingFees));
6066 *ret = RouteHint_get_fees(this_ptr_conv);
6067 assert(!ret->_underlying_ref);
6068 ret->_underlying_ref = true;
6072 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1fees(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6073 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6074 LDKRoutingFees val_conv = *(LDKRoutingFees*)val;
6076 val_conv._underlying_ref = false;
6077 return RouteHint_set_fees(this_ptr_conv, val_conv);
6080 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
6081 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6082 return RouteHint_get_cltv_expiry_delta(this_ptr_conv);
6085 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
6086 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6087 return RouteHint_set_cltv_expiry_delta(this_ptr_conv, val);
6090 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
6091 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6092 return RouteHint_get_htlc_minimum_msat(this_ptr_conv);
6095 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6096 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6097 return RouteHint_set_htlc_minimum_msat(this_ptr_conv, val);
6100 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) {
6101 LDKPublicKey src_node_id_arg_conv = *(LDKPublicKey*)src_node_id_arg;
6102 free((void*)src_node_id_arg);
6103 LDKRoutingFees fees_arg_conv = *(LDKRoutingFees*)fees_arg;
6104 free((void*)fees_arg);
6105 fees_arg_conv._underlying_ref = false;
6106 LDKRouteHint* ret = malloc(sizeof(LDKRouteHint));
6107 *ret = RouteHint_new(src_node_id_arg_conv, short_channel_id_arg, fees_arg_conv, cltv_expiry_delta_arg, htlc_minimum_msat_arg);
6108 assert(!ret->_underlying_ref);
6109 ret->_underlying_ref = true;
6113 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) {
6114 LDKPublicKey our_node_id_conv = *(LDKPublicKey*)our_node_id;
6115 free((void*)our_node_id);
6116 LDKNetworkGraph* network_conv = (LDKNetworkGraph*)network;
6117 LDKPublicKey target_conv = *(LDKPublicKey*)target;
6118 free((void*)target);
6119 LDKCVec_ChannelDetailsZ* first_hops_conv = (LDKCVec_ChannelDetailsZ*)first_hops;
6120 LDKCVec_RouteHintZ last_hops_conv = *(LDKCVec_RouteHintZ*)last_hops;
6121 free((void*)last_hops);
6122 LDKLogger *logger_conv = (LDKLogger*)logger;
6123 LDKLogger_JCalls_clone(logger_conv->this_arg);
6124 LDKCResult_RouteLightningErrorZ* ret = malloc(sizeof(LDKCResult_RouteLightningErrorZ));
6125 *ret = get_route(our_node_id_conv, network_conv, target_conv, first_hops_conv, last_hops_conv, final_value_msat, final_cltv, *logger_conv);
6129 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6130 LDKNetworkGraph this_ptr_conv = *(LDKNetworkGraph*)this_ptr;
6131 free((void*)this_ptr);
6132 this_ptr_conv._underlying_ref = false;
6133 return NetworkGraph_free(this_ptr_conv);
6136 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockedNetworkGraph_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6137 LDKLockedNetworkGraph this_ptr_conv = *(LDKLockedNetworkGraph*)this_ptr;
6138 free((void*)this_ptr);
6139 this_ptr_conv._underlying_ref = false;
6140 return LockedNetworkGraph_free(this_ptr_conv);
6143 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6144 LDKNetGraphMsgHandler this_ptr_conv = *(LDKNetGraphMsgHandler*)this_ptr;
6145 free((void*)this_ptr);
6146 this_ptr_conv._underlying_ref = false;
6147 return NetGraphMsgHandler_free(this_ptr_conv);
6150 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new(JNIEnv * _env, jclass _b, jlong chain_monitor, jlong logger) {
6151 LDKChainWatchInterface *chain_monitor_conv = (LDKChainWatchInterface*)chain_monitor;
6152 LDKChainWatchInterface_JCalls_clone(chain_monitor_conv->this_arg);
6153 LDKLogger *logger_conv = (LDKLogger*)logger;
6154 LDKLogger_JCalls_clone(logger_conv->this_arg);
6155 LDKNetGraphMsgHandler* ret = malloc(sizeof(LDKNetGraphMsgHandler));
6156 *ret = NetGraphMsgHandler_new(*chain_monitor_conv, *logger_conv);
6157 assert(!ret->_underlying_ref);
6158 ret->_underlying_ref = true;
6162 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1from_1net_1graph(JNIEnv * _env, jclass _b, jlong chain_monitor, jlong logger, jlong network_graph) {
6163 LDKChainWatchInterface *chain_monitor_conv = (LDKChainWatchInterface*)chain_monitor;
6164 LDKChainWatchInterface_JCalls_clone(chain_monitor_conv->this_arg);
6165 LDKLogger *logger_conv = (LDKLogger*)logger;
6166 LDKLogger_JCalls_clone(logger_conv->this_arg);
6167 LDKNetworkGraph network_graph_conv = *(LDKNetworkGraph*)network_graph;
6168 free((void*)network_graph);
6169 network_graph_conv._underlying_ref = false;
6170 LDKNetGraphMsgHandler* ret = malloc(sizeof(LDKNetGraphMsgHandler));
6171 *ret = NetGraphMsgHandler_from_net_graph(*chain_monitor_conv, *logger_conv, network_graph_conv);
6172 assert(!ret->_underlying_ref);
6173 ret->_underlying_ref = true;
6177 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1read_1locked_1graph(JNIEnv * _env, jclass _b, jlong this_arg) {
6178 LDKNetGraphMsgHandler* this_arg_conv = (LDKNetGraphMsgHandler*)this_arg;
6179 LDKLockedNetworkGraph* ret = malloc(sizeof(LDKLockedNetworkGraph));
6180 *ret = NetGraphMsgHandler_read_locked_graph(this_arg_conv);
6181 assert(!ret->_underlying_ref);
6182 ret->_underlying_ref = true;
6186 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LockedNetworkGraph_1graph(JNIEnv * _env, jclass _b, jlong this_arg) {
6187 LDKLockedNetworkGraph* this_arg_conv = (LDKLockedNetworkGraph*)this_arg;
6188 LDKNetworkGraph* ret = malloc(sizeof(LDKNetworkGraph));
6189 *ret = LockedNetworkGraph_graph(this_arg_conv);
6190 assert(!ret->_underlying_ref);
6191 ret->_underlying_ref = true;
6195 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1RoutingMessageHandler(JNIEnv * _env, jclass _b, jlong this_arg) {
6196 LDKNetGraphMsgHandler* this_arg_conv = (LDKNetGraphMsgHandler*)this_arg;
6197 LDKRoutingMessageHandler* ret = malloc(sizeof(LDKRoutingMessageHandler));
6198 *ret = NetGraphMsgHandler_as_RoutingMessageHandler(this_arg_conv);
6202 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6203 LDKDirectionalChannelInfo this_ptr_conv = *(LDKDirectionalChannelInfo*)this_ptr;
6204 free((void*)this_ptr);
6205 this_ptr_conv._underlying_ref = false;
6206 return DirectionalChannelInfo_free(this_ptr_conv);
6209 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr) {
6210 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
6211 return DirectionalChannelInfo_get_last_update(this_ptr_conv);
6214 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6215 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
6216 return DirectionalChannelInfo_set_last_update(this_ptr_conv, val);
6219 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1enabled(JNIEnv * _env, jclass _b, jlong this_ptr) {
6220 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
6221 return DirectionalChannelInfo_get_enabled(this_ptr_conv);
6224 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1enabled(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
6225 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
6226 return DirectionalChannelInfo_set_enabled(this_ptr_conv, val);
6229 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
6230 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
6231 return DirectionalChannelInfo_get_cltv_expiry_delta(this_ptr_conv);
6234 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
6235 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
6236 return DirectionalChannelInfo_set_cltv_expiry_delta(this_ptr_conv, val);
6239 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
6240 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
6241 return DirectionalChannelInfo_get_htlc_minimum_msat(this_ptr_conv);
6244 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6245 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
6246 return DirectionalChannelInfo_set_htlc_minimum_msat(this_ptr_conv, val);
6249 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
6250 LDKDirectionalChannelInfo* obj_conv = (LDKDirectionalChannelInfo*)obj;
6251 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
6252 *ret = DirectionalChannelInfo_write(obj_conv);
6256 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
6257 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6259 LDKDirectionalChannelInfo* ret = malloc(sizeof(LDKDirectionalChannelInfo));
6260 *ret = DirectionalChannelInfo_read(ser_conv);
6261 assert(!ret->_underlying_ref);
6262 ret->_underlying_ref = true;
6266 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6267 LDKChannelInfo this_ptr_conv = *(LDKChannelInfo*)this_ptr;
6268 free((void*)this_ptr);
6269 this_ptr_conv._underlying_ref = false;
6270 return ChannelInfo_free(this_ptr_conv);
6273 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1one(JNIEnv * _env, jclass _b, jlong this_ptr) {
6274 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
6275 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
6276 *ret = ChannelInfo_get_node_one(this_ptr_conv);
6280 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1one(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6281 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
6282 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6284 return ChannelInfo_set_node_one(this_ptr_conv, val_conv);
6287 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1one_1to_1two(JNIEnv * _env, jclass _b, jlong this_ptr) {
6288 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
6289 LDKDirectionalChannelInfo* ret = malloc(sizeof(LDKDirectionalChannelInfo));
6290 *ret = ChannelInfo_get_one_to_two(this_ptr_conv);
6291 assert(!ret->_underlying_ref);
6292 ret->_underlying_ref = true;
6296 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1one_1to_1two(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6297 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
6298 LDKDirectionalChannelInfo val_conv = *(LDKDirectionalChannelInfo*)val;
6300 val_conv._underlying_ref = false;
6301 return ChannelInfo_set_one_to_two(this_ptr_conv, val_conv);
6304 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1two(JNIEnv * _env, jclass _b, jlong this_ptr) {
6305 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
6306 LDKPublicKey* ret = malloc(sizeof(LDKPublicKey));
6307 *ret = ChannelInfo_get_node_two(this_ptr_conv);
6311 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1two(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6312 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
6313 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6315 return ChannelInfo_set_node_two(this_ptr_conv, val_conv);
6318 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1two_1to_1one(JNIEnv * _env, jclass _b, jlong this_ptr) {
6319 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
6320 LDKDirectionalChannelInfo* ret = malloc(sizeof(LDKDirectionalChannelInfo));
6321 *ret = ChannelInfo_get_two_to_one(this_ptr_conv);
6322 assert(!ret->_underlying_ref);
6323 ret->_underlying_ref = true;
6327 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1two_1to_1one(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6328 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
6329 LDKDirectionalChannelInfo val_conv = *(LDKDirectionalChannelInfo*)val;
6331 val_conv._underlying_ref = false;
6332 return ChannelInfo_set_two_to_one(this_ptr_conv, val_conv);
6335 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
6336 LDKChannelInfo* obj_conv = (LDKChannelInfo*)obj;
6337 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
6338 *ret = ChannelInfo_write(obj_conv);
6342 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
6343 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6345 LDKChannelInfo* ret = malloc(sizeof(LDKChannelInfo));
6346 *ret = ChannelInfo_read(ser_conv);
6347 assert(!ret->_underlying_ref);
6348 ret->_underlying_ref = true;
6352 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6353 LDKRoutingFees this_ptr_conv = *(LDKRoutingFees*)this_ptr;
6354 free((void*)this_ptr);
6355 this_ptr_conv._underlying_ref = false;
6356 return RoutingFees_free(this_ptr_conv);
6359 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
6360 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
6361 return RoutingFees_get_base_msat(this_ptr_conv);
6364 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6365 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
6366 return RoutingFees_set_base_msat(this_ptr_conv, val);
6369 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr) {
6370 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
6371 return RoutingFees_get_proportional_millionths(this_ptr_conv);
6374 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6375 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
6376 return RoutingFees_set_proportional_millionths(this_ptr_conv, val);
6379 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1new(JNIEnv * _env, jclass _b, jint base_msat_arg, jint proportional_millionths_arg) {
6380 LDKRoutingFees* ret = malloc(sizeof(LDKRoutingFees));
6381 *ret = RoutingFees_new(base_msat_arg, proportional_millionths_arg);
6382 assert(!ret->_underlying_ref);
6383 ret->_underlying_ref = true;
6387 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1read(JNIEnv * _env, jclass _b, jlong ser) {
6388 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6390 LDKRoutingFees* ret = malloc(sizeof(LDKRoutingFees));
6391 *ret = RoutingFees_read(ser_conv);
6392 assert(!ret->_underlying_ref);
6393 ret->_underlying_ref = true;
6397 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1write(JNIEnv * _env, jclass _b, jlong obj) {
6398 LDKRoutingFees* obj_conv = (LDKRoutingFees*)obj;
6399 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
6400 *ret = RoutingFees_write(obj_conv);
6404 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6405 LDKNodeAnnouncementInfo this_ptr_conv = *(LDKNodeAnnouncementInfo*)this_ptr;
6406 free((void*)this_ptr);
6407 this_ptr_conv._underlying_ref = false;
6408 return NodeAnnouncementInfo_free(this_ptr_conv);
6411 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr) {
6412 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
6413 return NodeAnnouncementInfo_get_last_update(this_ptr_conv);
6416 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6417 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
6418 return NodeAnnouncementInfo_set_last_update(this_ptr_conv, val);
6421 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr) {
6422 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
6423 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 3);
6424 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 3, *NodeAnnouncementInfo_get_rgb(this_ptr_conv));
6428 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6429 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
6430 LDKThreeBytes val_conv = *(LDKThreeBytes*)val;
6432 return NodeAnnouncementInfo_set_rgb(this_ptr_conv, val_conv);
6435 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1alias(JNIEnv * _env, jclass _b, jlong this_ptr) {
6436 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
6437 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6438 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *NodeAnnouncementInfo_get_alias(this_ptr_conv));
6442 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1alias(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6443 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
6444 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
6446 return NodeAnnouncementInfo_set_alias(this_ptr_conv, val_conv);
6449 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1addresses(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6450 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
6451 LDKCVec_NetAddressZ val_conv = *(LDKCVec_NetAddressZ*)val;
6453 return NodeAnnouncementInfo_set_addresses(this_ptr_conv, val_conv);
6456 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
6457 LDKNodeAnnouncementInfo* obj_conv = (LDKNodeAnnouncementInfo*)obj;
6458 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
6459 *ret = NodeAnnouncementInfo_write(obj_conv);
6463 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
6464 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6466 LDKNodeAnnouncementInfo* ret = malloc(sizeof(LDKNodeAnnouncementInfo));
6467 *ret = NodeAnnouncementInfo_read(ser_conv);
6468 assert(!ret->_underlying_ref);
6469 ret->_underlying_ref = true;
6473 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6474 LDKNodeInfo this_ptr_conv = *(LDKNodeInfo*)this_ptr;
6475 free((void*)this_ptr);
6476 this_ptr_conv._underlying_ref = false;
6477 return NodeInfo_free(this_ptr_conv);
6480 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1channels(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6481 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
6482 LDKCVec_u64Z val_conv = *(LDKCVec_u64Z*)val;
6484 return NodeInfo_set_channels(this_ptr_conv, val_conv);
6487 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1lowest_1inbound_1channel_1fees(JNIEnv * _env, jclass _b, jlong this_ptr) {
6488 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
6489 LDKRoutingFees* ret = malloc(sizeof(LDKRoutingFees));
6490 *ret = NodeInfo_get_lowest_inbound_channel_fees(this_ptr_conv);
6491 assert(!ret->_underlying_ref);
6492 ret->_underlying_ref = true;
6496 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1lowest_1inbound_1channel_1fees(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6497 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
6498 LDKRoutingFees val_conv = *(LDKRoutingFees*)val;
6500 val_conv._underlying_ref = false;
6501 return NodeInfo_set_lowest_inbound_channel_fees(this_ptr_conv, val_conv);
6504 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1announcement_1info(JNIEnv * _env, jclass _b, jlong this_ptr) {
6505 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
6506 LDKNodeAnnouncementInfo* ret = malloc(sizeof(LDKNodeAnnouncementInfo));
6507 *ret = NodeInfo_get_announcement_info(this_ptr_conv);
6508 assert(!ret->_underlying_ref);
6509 ret->_underlying_ref = true;
6513 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1announcement_1info(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6514 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
6515 LDKNodeAnnouncementInfo val_conv = *(LDKNodeAnnouncementInfo*)val;
6517 val_conv._underlying_ref = false;
6518 return NodeInfo_set_announcement_info(this_ptr_conv, val_conv);
6521 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) {
6522 LDKCVec_u64Z channels_arg_conv = *(LDKCVec_u64Z*)channels_arg;
6523 free((void*)channels_arg);
6524 LDKRoutingFees lowest_inbound_channel_fees_arg_conv = *(LDKRoutingFees*)lowest_inbound_channel_fees_arg;
6525 free((void*)lowest_inbound_channel_fees_arg);
6526 lowest_inbound_channel_fees_arg_conv._underlying_ref = false;
6527 LDKNodeAnnouncementInfo announcement_info_arg_conv = *(LDKNodeAnnouncementInfo*)announcement_info_arg;
6528 free((void*)announcement_info_arg);
6529 announcement_info_arg_conv._underlying_ref = false;
6530 LDKNodeInfo* ret = malloc(sizeof(LDKNodeInfo));
6531 *ret = NodeInfo_new(channels_arg_conv, lowest_inbound_channel_fees_arg_conv, announcement_info_arg_conv);
6532 assert(!ret->_underlying_ref);
6533 ret->_underlying_ref = true;
6537 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
6538 LDKNodeInfo* obj_conv = (LDKNodeInfo*)obj;
6539 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
6540 *ret = NodeInfo_write(obj_conv);
6544 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
6545 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6547 LDKNodeInfo* ret = malloc(sizeof(LDKNodeInfo));
6548 *ret = NodeInfo_read(ser_conv);
6549 assert(!ret->_underlying_ref);
6550 ret->_underlying_ref = true;
6554 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1write(JNIEnv * _env, jclass _b, jlong obj) {
6555 LDKNetworkGraph* obj_conv = (LDKNetworkGraph*)obj;
6556 LDKCVec_u8Z* ret = malloc(sizeof(LDKCVec_u8Z));
6557 *ret = NetworkGraph_write(obj_conv);
6561 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read(JNIEnv * _env, jclass _b, jlong ser) {
6562 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6564 LDKNetworkGraph* ret = malloc(sizeof(LDKNetworkGraph));
6565 *ret = NetworkGraph_read(ser_conv);
6566 assert(!ret->_underlying_ref);
6567 ret->_underlying_ref = true;
6571 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new(JNIEnv * _env, jclass _b) {
6572 LDKNetworkGraph* ret = malloc(sizeof(LDKNetworkGraph));
6573 *ret = NetworkGraph_new();
6574 assert(!ret->_underlying_ref);
6575 ret->_underlying_ref = true;
6579 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) {
6580 LDKNetworkGraph* this_arg_conv = (LDKNetworkGraph*)this_arg;
6581 return NetworkGraph_close_channel_from_update(this_arg_conv, short_channel_id, is_permanent);