1 #include "org_ldk_impl_bindings.h"
2 #include <rust_types.h>
8 jmethodID ordinal_meth = NULL;
9 JNIEXPORT void Java_org_ldk_impl_bindings_init(JNIEnv * env, jclass _b, jclass enum_class) {
10 ordinal_meth = (*env)->GetMethodID(env, enum_class, "ordinal", "()I");
11 assert(ordinal_meth != NULL);
14 #define MALLOC(a, _) malloc(a)
17 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKSecretKey_1new(JNIEnv * _env, jclass _b) {
18 LDKSecretKey* key = (LDKSecretKey*)MALLOC(sizeof(LDKSecretKey), "LDKSecretKey");
21 static inline LDKAccessError LDKAccessError_from_java(JNIEnv *env, jclass val) {
22 switch ((*env)->CallIntMethod(env, val, ordinal_meth)) {
23 case 0: return LDKAccessError_UnknownChain;
24 case 1: return LDKAccessError_UnknownTx;
28 static inline jclass LDKAccessError_to_java(JNIEnv *env, LDKAccessError val) {
29 // TODO: This is pretty inefficient, we really need to cache the field IDs and class
30 jclass enum_class = (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKAccessError;");
31 assert(enum_class != NULL);
33 case LDKAccessError_UnknownChain: {
34 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKAccessError_UnknownChain", "Lorg/ldk/impl/bindings$LDKAccessError;");
35 assert(field != NULL);
36 return (*env)->GetStaticObjectField(env, enum_class, field);
38 case LDKAccessError_UnknownTx: {
39 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKAccessError_UnknownTx", "Lorg/ldk/impl/bindings$LDKAccessError;");
40 assert(field != NULL);
41 return (*env)->GetStaticObjectField(env, enum_class, field);
43 default: assert(false);
47 static inline LDKChannelMonitorUpdateErr LDKChannelMonitorUpdateErr_from_java(JNIEnv *env, jclass val) {
48 switch ((*env)->CallIntMethod(env, val, ordinal_meth)) {
49 case 0: return LDKChannelMonitorUpdateErr_TemporaryFailure;
50 case 1: return LDKChannelMonitorUpdateErr_PermanentFailure;
54 static inline jclass LDKChannelMonitorUpdateErr_to_java(JNIEnv *env, LDKChannelMonitorUpdateErr val) {
55 // TODO: This is pretty inefficient, we really need to cache the field IDs and class
56 jclass enum_class = (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKChannelMonitorUpdateErr;");
57 assert(enum_class != NULL);
59 case LDKChannelMonitorUpdateErr_TemporaryFailure: {
60 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKChannelMonitorUpdateErr_TemporaryFailure", "Lorg/ldk/impl/bindings$LDKChannelMonitorUpdateErr;");
61 assert(field != NULL);
62 return (*env)->GetStaticObjectField(env, enum_class, field);
64 case LDKChannelMonitorUpdateErr_PermanentFailure: {
65 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKChannelMonitorUpdateErr_PermanentFailure", "Lorg/ldk/impl/bindings$LDKChannelMonitorUpdateErr;");
66 assert(field != NULL);
67 return (*env)->GetStaticObjectField(env, enum_class, field);
69 default: assert(false);
73 static inline LDKConfirmationTarget LDKConfirmationTarget_from_java(JNIEnv *env, jclass val) {
74 switch ((*env)->CallIntMethod(env, val, ordinal_meth)) {
75 case 0: return LDKConfirmationTarget_Background;
76 case 1: return LDKConfirmationTarget_Normal;
77 case 2: return LDKConfirmationTarget_HighPriority;
81 static inline jclass LDKConfirmationTarget_to_java(JNIEnv *env, LDKConfirmationTarget val) {
82 // TODO: This is pretty inefficient, we really need to cache the field IDs and class
83 jclass enum_class = (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKConfirmationTarget;");
84 assert(enum_class != NULL);
86 case LDKConfirmationTarget_Background: {
87 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKConfirmationTarget_Background", "Lorg/ldk/impl/bindings$LDKConfirmationTarget;");
88 assert(field != NULL);
89 return (*env)->GetStaticObjectField(env, enum_class, field);
91 case LDKConfirmationTarget_Normal: {
92 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKConfirmationTarget_Normal", "Lorg/ldk/impl/bindings$LDKConfirmationTarget;");
93 assert(field != NULL);
94 return (*env)->GetStaticObjectField(env, enum_class, field);
96 case LDKConfirmationTarget_HighPriority: {
97 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKConfirmationTarget_HighPriority", "Lorg/ldk/impl/bindings$LDKConfirmationTarget;");
98 assert(field != NULL);
99 return (*env)->GetStaticObjectField(env, enum_class, field);
101 default: assert(false);
105 static inline LDKLevel LDKLevel_from_java(JNIEnv *env, jclass val) {
106 switch ((*env)->CallIntMethod(env, val, ordinal_meth)) {
107 case 0: return LDKLevel_Off;
108 case 1: return LDKLevel_Error;
109 case 2: return LDKLevel_Warn;
110 case 3: return LDKLevel_Info;
111 case 4: return LDKLevel_Debug;
112 case 5: return LDKLevel_Trace;
116 static inline jclass LDKLevel_to_java(JNIEnv *env, LDKLevel val) {
117 // TODO: This is pretty inefficient, we really need to cache the field IDs and class
118 jclass enum_class = (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKLevel;");
119 assert(enum_class != NULL);
122 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKLevel_Off", "Lorg/ldk/impl/bindings$LDKLevel;");
123 assert(field != NULL);
124 return (*env)->GetStaticObjectField(env, enum_class, field);
126 case LDKLevel_Error: {
127 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKLevel_Error", "Lorg/ldk/impl/bindings$LDKLevel;");
128 assert(field != NULL);
129 return (*env)->GetStaticObjectField(env, enum_class, field);
131 case LDKLevel_Warn: {
132 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKLevel_Warn", "Lorg/ldk/impl/bindings$LDKLevel;");
133 assert(field != NULL);
134 return (*env)->GetStaticObjectField(env, enum_class, field);
136 case LDKLevel_Info: {
137 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKLevel_Info", "Lorg/ldk/impl/bindings$LDKLevel;");
138 assert(field != NULL);
139 return (*env)->GetStaticObjectField(env, enum_class, field);
141 case LDKLevel_Debug: {
142 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKLevel_Debug", "Lorg/ldk/impl/bindings$LDKLevel;");
143 assert(field != NULL);
144 return (*env)->GetStaticObjectField(env, enum_class, field);
146 case LDKLevel_Trace: {
147 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKLevel_Trace", "Lorg/ldk/impl/bindings$LDKLevel;");
148 assert(field != NULL);
149 return (*env)->GetStaticObjectField(env, enum_class, field);
151 default: assert(false);
155 static inline LDKNetwork LDKNetwork_from_java(JNIEnv *env, jclass val) {
156 switch ((*env)->CallIntMethod(env, val, ordinal_meth)) {
157 case 0: return LDKNetwork_Bitcoin;
158 case 1: return LDKNetwork_Testnet;
159 case 2: return LDKNetwork_Regtest;
163 static inline jclass LDKNetwork_to_java(JNIEnv *env, LDKNetwork val) {
164 // TODO: This is pretty inefficient, we really need to cache the field IDs and class
165 jclass enum_class = (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKNetwork;");
166 assert(enum_class != NULL);
168 case LDKNetwork_Bitcoin: {
169 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKNetwork_Bitcoin", "Lorg/ldk/impl/bindings$LDKNetwork;");
170 assert(field != NULL);
171 return (*env)->GetStaticObjectField(env, enum_class, field);
173 case LDKNetwork_Testnet: {
174 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKNetwork_Testnet", "Lorg/ldk/impl/bindings$LDKNetwork;");
175 assert(field != NULL);
176 return (*env)->GetStaticObjectField(env, enum_class, field);
178 case LDKNetwork_Regtest: {
179 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKNetwork_Regtest", "Lorg/ldk/impl/bindings$LDKNetwork;");
180 assert(field != NULL);
181 return (*env)->GetStaticObjectField(env, enum_class, field);
183 default: assert(false);
187 static inline LDKSecp256k1Error LDKSecp256k1Error_from_java(JNIEnv *env, jclass val) {
188 switch ((*env)->CallIntMethod(env, val, ordinal_meth)) {
189 case 0: return LDKSecp256k1Error_IncorrectSignature;
190 case 1: return LDKSecp256k1Error_InvalidMessage;
191 case 2: return LDKSecp256k1Error_InvalidPublicKey;
192 case 3: return LDKSecp256k1Error_InvalidSignature;
193 case 4: return LDKSecp256k1Error_InvalidSecretKey;
194 case 5: return LDKSecp256k1Error_InvalidRecoveryId;
195 case 6: return LDKSecp256k1Error_InvalidTweak;
196 case 7: return LDKSecp256k1Error_NotEnoughMemory;
197 case 8: return LDKSecp256k1Error_CallbackPanicked;
201 static inline jclass LDKSecp256k1Error_to_java(JNIEnv *env, LDKSecp256k1Error val) {
202 // TODO: This is pretty inefficient, we really need to cache the field IDs and class
203 jclass enum_class = (*env)->FindClass(env, "Lorg/ldk/impl/bindings$LDKSecp256k1Error;");
204 assert(enum_class != NULL);
206 case LDKSecp256k1Error_IncorrectSignature: {
207 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKSecp256k1Error_IncorrectSignature", "Lorg/ldk/impl/bindings$LDKSecp256k1Error;");
208 assert(field != NULL);
209 return (*env)->GetStaticObjectField(env, enum_class, field);
211 case LDKSecp256k1Error_InvalidMessage: {
212 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKSecp256k1Error_InvalidMessage", "Lorg/ldk/impl/bindings$LDKSecp256k1Error;");
213 assert(field != NULL);
214 return (*env)->GetStaticObjectField(env, enum_class, field);
216 case LDKSecp256k1Error_InvalidPublicKey: {
217 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKSecp256k1Error_InvalidPublicKey", "Lorg/ldk/impl/bindings$LDKSecp256k1Error;");
218 assert(field != NULL);
219 return (*env)->GetStaticObjectField(env, enum_class, field);
221 case LDKSecp256k1Error_InvalidSignature: {
222 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKSecp256k1Error_InvalidSignature", "Lorg/ldk/impl/bindings$LDKSecp256k1Error;");
223 assert(field != NULL);
224 return (*env)->GetStaticObjectField(env, enum_class, field);
226 case LDKSecp256k1Error_InvalidSecretKey: {
227 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKSecp256k1Error_InvalidSecretKey", "Lorg/ldk/impl/bindings$LDKSecp256k1Error;");
228 assert(field != NULL);
229 return (*env)->GetStaticObjectField(env, enum_class, field);
231 case LDKSecp256k1Error_InvalidRecoveryId: {
232 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKSecp256k1Error_InvalidRecoveryId", "Lorg/ldk/impl/bindings$LDKSecp256k1Error;");
233 assert(field != NULL);
234 return (*env)->GetStaticObjectField(env, enum_class, field);
236 case LDKSecp256k1Error_InvalidTweak: {
237 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKSecp256k1Error_InvalidTweak", "Lorg/ldk/impl/bindings$LDKSecp256k1Error;");
238 assert(field != NULL);
239 return (*env)->GetStaticObjectField(env, enum_class, field);
241 case LDKSecp256k1Error_NotEnoughMemory: {
242 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKSecp256k1Error_NotEnoughMemory", "Lorg/ldk/impl/bindings$LDKSecp256k1Error;");
243 assert(field != NULL);
244 return (*env)->GetStaticObjectField(env, enum_class, field);
246 case LDKSecp256k1Error_CallbackPanicked: {
247 jfieldID field = (*env)->GetStaticFieldID(env, enum_class, "LDKSecp256k1Error_CallbackPanicked", "Lorg/ldk/impl/bindings$LDKSecp256k1Error;");
248 assert(field != NULL);
249 return (*env)->GetStaticObjectField(env, enum_class, field);
251 default: assert(false);
255 typedef struct LDKMessageSendEventsProvider_JCalls {
256 atomic_size_t refcnt;
259 jmethodID get_and_clear_pending_msg_events_meth;
260 } LDKMessageSendEventsProvider_JCalls;
261 LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_jcall(const void* this_arg) {
262 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
263 LDKCVec_MessageSendEventZ* ret = (LDKCVec_MessageSendEventZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_and_clear_pending_msg_events_meth);
264 LDKCVec_MessageSendEventZ res = *ret;
268 static void LDKMessageSendEventsProvider_JCalls_free(void* this_arg) {
269 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
270 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
271 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
275 static void* LDKMessageSendEventsProvider_JCalls_clone(const void* this_arg) {
276 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
277 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
278 return (void*) this_arg;
280 static inline LDKMessageSendEventsProvider LDKMessageSendEventsProvider_init (JNIEnv * env, jclass _a, jobject o) {
281 jclass c = (*env)->GetObjectClass(env, o);
283 LDKMessageSendEventsProvider_JCalls *calls = MALLOC(sizeof(LDKMessageSendEventsProvider_JCalls), "LDKMessageSendEventsProvider_JCalls");
284 atomic_init(&calls->refcnt, 1);
286 calls->o = (*env)->NewGlobalRef(env, o);
287 calls->get_and_clear_pending_msg_events_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_msg_events", "()J");
288 assert(calls->get_and_clear_pending_msg_events_meth != NULL);
290 LDKMessageSendEventsProvider ret = {
291 .this_arg = (void*) calls,
292 .get_and_clear_pending_msg_events = get_and_clear_pending_msg_events_jcall,
293 .free = LDKMessageSendEventsProvider_JCalls_free,
297 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1new (JNIEnv * env, jclass _a, jobject o) {
298 LDKMessageSendEventsProvider *res_ptr = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
299 *res_ptr = LDKMessageSendEventsProvider_init(env, _a, o);
300 return (long)res_ptr;
302 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
303 return ((LDKMessageSendEventsProvider_JCalls*)val)->o;
305 typedef struct LDKEventsProvider_JCalls {
306 atomic_size_t refcnt;
309 jmethodID get_and_clear_pending_events_meth;
310 } LDKEventsProvider_JCalls;
311 LDKCVec_EventZ get_and_clear_pending_events_jcall(const void* this_arg) {
312 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
313 LDKCVec_EventZ* ret = (LDKCVec_EventZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_and_clear_pending_events_meth);
314 LDKCVec_EventZ res = *ret;
318 static void LDKEventsProvider_JCalls_free(void* this_arg) {
319 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
320 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
321 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
325 static void* LDKEventsProvider_JCalls_clone(const void* this_arg) {
326 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
327 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
328 return (void*) this_arg;
330 static inline LDKEventsProvider LDKEventsProvider_init (JNIEnv * env, jclass _a, jobject o) {
331 jclass c = (*env)->GetObjectClass(env, o);
333 LDKEventsProvider_JCalls *calls = MALLOC(sizeof(LDKEventsProvider_JCalls), "LDKEventsProvider_JCalls");
334 atomic_init(&calls->refcnt, 1);
336 calls->o = (*env)->NewGlobalRef(env, o);
337 calls->get_and_clear_pending_events_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_events", "()J");
338 assert(calls->get_and_clear_pending_events_meth != NULL);
340 LDKEventsProvider ret = {
341 .this_arg = (void*) calls,
342 .get_and_clear_pending_events = get_and_clear_pending_events_jcall,
343 .free = LDKEventsProvider_JCalls_free,
347 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1new (JNIEnv * env, jclass _a, jobject o) {
348 LDKEventsProvider *res_ptr = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
349 *res_ptr = LDKEventsProvider_init(env, _a, o);
350 return (long)res_ptr;
352 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
353 return ((LDKEventsProvider_JCalls*)val)->o;
355 typedef struct LDKLogger_JCalls {
356 atomic_size_t refcnt;
361 void log_jcall(const void* this_arg, const char *record) {
362 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
363 jstring record_conv = (*j_calls->env)->NewStringUTF(j_calls->env, record);
364 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->log_meth, record_conv);
366 static void LDKLogger_JCalls_free(void* this_arg) {
367 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
368 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
369 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
373 static void* LDKLogger_JCalls_clone(const void* this_arg) {
374 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
375 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
376 return (void*) this_arg;
378 static inline LDKLogger LDKLogger_init (JNIEnv * env, jclass _a, jobject o) {
379 jclass c = (*env)->GetObjectClass(env, o);
381 LDKLogger_JCalls *calls = MALLOC(sizeof(LDKLogger_JCalls), "LDKLogger_JCalls");
382 atomic_init(&calls->refcnt, 1);
384 calls->o = (*env)->NewGlobalRef(env, o);
385 calls->log_meth = (*env)->GetMethodID(env, c, "log", "(Ljava/lang/String;)V");
386 assert(calls->log_meth != NULL);
389 .this_arg = (void*) calls,
391 .free = LDKLogger_JCalls_free,
395 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKLogger_1new (JNIEnv * env, jclass _a, jobject o) {
396 LDKLogger *res_ptr = MALLOC(sizeof(LDKLogger), "LDKLogger");
397 *res_ptr = LDKLogger_init(env, _a, o);
398 return (long)res_ptr;
400 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKLogger_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
401 return ((LDKLogger_JCalls*)val)->o;
403 typedef struct LDKAccess_JCalls {
404 atomic_size_t refcnt;
407 jmethodID get_utxo_meth;
409 LDKCResult_TxOutAccessErrorZ get_utxo_jcall(const void* this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id) {
410 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
411 jbyteArray genesis_hash_arr = (*j_calls->env)->NewByteArray(j_calls->env, 32);
412 (*j_calls->env)->SetByteArrayRegion(j_calls->env, genesis_hash_arr, 0, 32, *genesis_hash);
413 LDKCResult_TxOutAccessErrorZ* ret = (LDKCResult_TxOutAccessErrorZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_utxo_meth, genesis_hash_arr, short_channel_id);
414 LDKCResult_TxOutAccessErrorZ res = *ret;
418 static void LDKAccess_JCalls_free(void* this_arg) {
419 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
420 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
421 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
425 static void* LDKAccess_JCalls_clone(const void* this_arg) {
426 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
427 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
428 return (void*) this_arg;
430 static inline LDKAccess LDKAccess_init (JNIEnv * env, jclass _a, jobject o) {
431 jclass c = (*env)->GetObjectClass(env, o);
433 LDKAccess_JCalls *calls = MALLOC(sizeof(LDKAccess_JCalls), "LDKAccess_JCalls");
434 atomic_init(&calls->refcnt, 1);
436 calls->o = (*env)->NewGlobalRef(env, o);
437 calls->get_utxo_meth = (*env)->GetMethodID(env, c, "get_utxo", "([BJ)J");
438 assert(calls->get_utxo_meth != NULL);
441 .this_arg = (void*) calls,
442 .get_utxo = get_utxo_jcall,
443 .free = LDKAccess_JCalls_free,
447 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKAccess_1new (JNIEnv * env, jclass _a, jobject o) {
448 LDKAccess *res_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess");
449 *res_ptr = LDKAccess_init(env, _a, o);
450 return (long)res_ptr;
452 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAccess_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
453 return ((LDKAccess_JCalls*)val)->o;
455 typedef struct LDKChannelKeys_JCalls {
456 atomic_size_t refcnt;
459 jmethodID get_per_commitment_point_meth;
460 jmethodID release_commitment_secret_meth;
461 jmethodID key_derivation_params_meth;
462 jmethodID sign_counterparty_commitment_meth;
463 jmethodID sign_holder_commitment_meth;
464 jmethodID sign_holder_commitment_htlc_transactions_meth;
465 jmethodID sign_justice_transaction_meth;
466 jmethodID sign_counterparty_htlc_transaction_meth;
467 jmethodID sign_closing_transaction_meth;
468 jmethodID sign_channel_announcement_meth;
469 jmethodID on_accept_meth;
470 } LDKChannelKeys_JCalls;
471 LDKPublicKey get_per_commitment_point_jcall(const void* this_arg, uint64_t idx) {
472 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
473 LDKPublicKey* ret = (LDKPublicKey*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_per_commitment_point_meth, idx);
474 LDKPublicKey res = *ret;
478 LDKThirtyTwoBytes release_commitment_secret_jcall(const void* this_arg, uint64_t idx) {
479 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
480 LDKThirtyTwoBytes* ret = (LDKThirtyTwoBytes*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->release_commitment_secret_meth, idx);
481 LDKThirtyTwoBytes res = *ret;
485 LDKC2Tuple_u64u64Z key_derivation_params_jcall(const void* this_arg) {
486 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
487 LDKC2Tuple_u64u64Z* ret = (LDKC2Tuple_u64u64Z*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->key_derivation_params_meth);
488 LDKC2Tuple_u64u64Z res = *ret;
492 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_jcall(const void* this_arg, uint32_t feerate_per_kw, LDKTransaction commitment_tx, const LDKPreCalculatedTxCreationKeys *keys, LDKCVec_HTLCOutputInCommitmentZ htlcs) {
493 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
494 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->sign_counterparty_commitment_meth, feerate_per_kw, commitment_tx, keys, htlcs);
495 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ res = *ret;
499 LDKCResult_SignatureNoneZ sign_holder_commitment_jcall(const void* this_arg, const LDKHolderCommitmentTransaction *holder_commitment_tx) {
500 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
501 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->sign_holder_commitment_meth, holder_commitment_tx);
502 LDKCResult_SignatureNoneZ res = *ret;
506 LDKCResult_CVec_SignatureZNoneZ sign_holder_commitment_htlc_transactions_jcall(const void* this_arg, const LDKHolderCommitmentTransaction *holder_commitment_tx) {
507 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
508 LDKCResult_CVec_SignatureZNoneZ* ret = (LDKCResult_CVec_SignatureZNoneZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->sign_holder_commitment_htlc_transactions_meth, holder_commitment_tx);
509 LDKCResult_CVec_SignatureZNoneZ res = *ret;
513 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) {
514 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
515 jbyteArray per_commitment_key_arr = (*j_calls->env)->NewByteArray(j_calls->env, 32);
516 (*j_calls->env)->SetByteArrayRegion(j_calls->env, per_commitment_key_arr, 0, 32, *per_commitment_key);
517 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);
518 LDKCResult_SignatureNoneZ res = *ret;
522 LDKCResult_SignatureNoneZ sign_counterparty_htlc_transaction_jcall(const void* this_arg, LDKTransaction htlc_tx, uintptr_t input, uint64_t amount, LDKPublicKey per_commitment_point, const LDKHTLCOutputInCommitment *htlc) {
523 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
524 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->sign_counterparty_htlc_transaction_meth, htlc_tx, input, amount, per_commitment_point, htlc);
525 LDKCResult_SignatureNoneZ res = *ret;
529 LDKCResult_SignatureNoneZ sign_closing_transaction_jcall(const void* this_arg, LDKTransaction closing_tx) {
530 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
531 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->sign_closing_transaction_meth, closing_tx);
532 LDKCResult_SignatureNoneZ res = *ret;
536 LDKCResult_SignatureNoneZ sign_channel_announcement_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement *msg) {
537 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
538 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->sign_channel_announcement_meth, msg);
539 LDKCResult_SignatureNoneZ res = *ret;
543 void on_accept_jcall(void* this_arg, const LDKChannelPublicKeys *channel_points, uint16_t counterparty_selected_contest_delay, uint16_t holder_selected_contest_delay) {
544 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
545 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->on_accept_meth, channel_points, counterparty_selected_contest_delay, holder_selected_contest_delay);
547 static void LDKChannelKeys_JCalls_free(void* this_arg) {
548 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
549 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
550 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
554 static void* LDKChannelKeys_JCalls_clone(const void* this_arg) {
555 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
556 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
557 return (void*) this_arg;
559 static inline LDKChannelKeys LDKChannelKeys_init (JNIEnv * env, jclass _a, jobject o) {
560 jclass c = (*env)->GetObjectClass(env, o);
562 LDKChannelKeys_JCalls *calls = MALLOC(sizeof(LDKChannelKeys_JCalls), "LDKChannelKeys_JCalls");
563 atomic_init(&calls->refcnt, 1);
565 calls->o = (*env)->NewGlobalRef(env, o);
566 calls->get_per_commitment_point_meth = (*env)->GetMethodID(env, c, "get_per_commitment_point", "(J)J");
567 assert(calls->get_per_commitment_point_meth != NULL);
568 calls->release_commitment_secret_meth = (*env)->GetMethodID(env, c, "release_commitment_secret", "(J)J");
569 assert(calls->release_commitment_secret_meth != NULL);
570 calls->key_derivation_params_meth = (*env)->GetMethodID(env, c, "key_derivation_params", "()J");
571 assert(calls->key_derivation_params_meth != NULL);
572 calls->sign_counterparty_commitment_meth = (*env)->GetMethodID(env, c, "sign_counterparty_commitment", "(IJJJ)J");
573 assert(calls->sign_counterparty_commitment_meth != NULL);
574 calls->sign_holder_commitment_meth = (*env)->GetMethodID(env, c, "sign_holder_commitment", "(J)J");
575 assert(calls->sign_holder_commitment_meth != NULL);
576 calls->sign_holder_commitment_htlc_transactions_meth = (*env)->GetMethodID(env, c, "sign_holder_commitment_htlc_transactions", "(J)J");
577 assert(calls->sign_holder_commitment_htlc_transactions_meth != NULL);
578 calls->sign_justice_transaction_meth = (*env)->GetMethodID(env, c, "sign_justice_transaction", "(JJJ[BJ)J");
579 assert(calls->sign_justice_transaction_meth != NULL);
580 calls->sign_counterparty_htlc_transaction_meth = (*env)->GetMethodID(env, c, "sign_counterparty_htlc_transaction", "(JJJJJ)J");
581 assert(calls->sign_counterparty_htlc_transaction_meth != NULL);
582 calls->sign_closing_transaction_meth = (*env)->GetMethodID(env, c, "sign_closing_transaction", "(J)J");
583 assert(calls->sign_closing_transaction_meth != NULL);
584 calls->sign_channel_announcement_meth = (*env)->GetMethodID(env, c, "sign_channel_announcement", "(J)J");
585 assert(calls->sign_channel_announcement_meth != NULL);
586 calls->on_accept_meth = (*env)->GetMethodID(env, c, "on_accept", "(JSS)V");
587 assert(calls->on_accept_meth != NULL);
589 LDKChannelKeys ret = {
590 .this_arg = (void*) calls,
591 .get_per_commitment_point = get_per_commitment_point_jcall,
592 .release_commitment_secret = release_commitment_secret_jcall,
593 .key_derivation_params = key_derivation_params_jcall,
594 .sign_counterparty_commitment = sign_counterparty_commitment_jcall,
595 .sign_holder_commitment = sign_holder_commitment_jcall,
596 .sign_holder_commitment_htlc_transactions = sign_holder_commitment_htlc_transactions_jcall,
597 .sign_justice_transaction = sign_justice_transaction_jcall,
598 .sign_counterparty_htlc_transaction = sign_counterparty_htlc_transaction_jcall,
599 .sign_closing_transaction = sign_closing_transaction_jcall,
600 .sign_channel_announcement = sign_channel_announcement_jcall,
601 .on_accept = on_accept_jcall,
602 .clone = LDKChannelKeys_JCalls_clone,
603 .free = LDKChannelKeys_JCalls_free,
607 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1new (JNIEnv * env, jclass _a, jobject o) {
608 LDKChannelKeys *res_ptr = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys");
609 *res_ptr = LDKChannelKeys_init(env, _a, o);
610 return (long)res_ptr;
612 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
613 return ((LDKChannelKeys_JCalls*)val)->o;
615 typedef struct LDKWatch_JCalls {
616 atomic_size_t refcnt;
619 jmethodID watch_channel_meth;
620 jmethodID update_channel_meth;
621 jmethodID release_pending_monitor_events_meth;
623 LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) {
624 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
625 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->watch_channel_meth, funding_txo, monitor);
626 LDKCResult_NoneChannelMonitorUpdateErrZ res = *ret;
630 LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate update) {
631 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
632 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->update_channel_meth, funding_txo, update);
633 LDKCResult_NoneChannelMonitorUpdateErrZ res = *ret;
637 LDKCVec_MonitorEventZ release_pending_monitor_events_jcall(const void* this_arg) {
638 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
639 LDKCVec_MonitorEventZ* ret = (LDKCVec_MonitorEventZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->release_pending_monitor_events_meth);
640 LDKCVec_MonitorEventZ res = *ret;
644 static void LDKWatch_JCalls_free(void* this_arg) {
645 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
646 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
647 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
651 static void* LDKWatch_JCalls_clone(const void* this_arg) {
652 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
653 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
654 return (void*) this_arg;
656 static inline LDKWatch LDKWatch_init (JNIEnv * env, jclass _a, jobject o) {
657 jclass c = (*env)->GetObjectClass(env, o);
659 LDKWatch_JCalls *calls = MALLOC(sizeof(LDKWatch_JCalls), "LDKWatch_JCalls");
660 atomic_init(&calls->refcnt, 1);
662 calls->o = (*env)->NewGlobalRef(env, o);
663 calls->watch_channel_meth = (*env)->GetMethodID(env, c, "watch_channel", "(JJ)J");
664 assert(calls->watch_channel_meth != NULL);
665 calls->update_channel_meth = (*env)->GetMethodID(env, c, "update_channel", "(JJ)J");
666 assert(calls->update_channel_meth != NULL);
667 calls->release_pending_monitor_events_meth = (*env)->GetMethodID(env, c, "release_pending_monitor_events", "()J");
668 assert(calls->release_pending_monitor_events_meth != NULL);
671 .this_arg = (void*) calls,
672 .watch_channel = watch_channel_jcall,
673 .update_channel = update_channel_jcall,
674 .release_pending_monitor_events = release_pending_monitor_events_jcall,
675 .free = LDKWatch_JCalls_free,
679 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKWatch_1new (JNIEnv * env, jclass _a, jobject o) {
680 LDKWatch *res_ptr = MALLOC(sizeof(LDKWatch), "LDKWatch");
681 *res_ptr = LDKWatch_init(env, _a, o);
682 return (long)res_ptr;
684 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKWatch_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
685 return ((LDKWatch_JCalls*)val)->o;
687 typedef struct LDKFilter_JCalls {
688 atomic_size_t refcnt;
691 jmethodID register_tx_meth;
692 jmethodID register_output_meth;
694 void register_tx_jcall(const void* this_arg, const uint8_t (*txid)[32], LDKu8slice script_pubkey) {
695 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
696 jbyteArray txid_arr = (*j_calls->env)->NewByteArray(j_calls->env, 32);
697 (*j_calls->env)->SetByteArrayRegion(j_calls->env, txid_arr, 0, 32, *txid);
698 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->register_tx_meth, txid_arr, script_pubkey);
700 void register_output_jcall(const void* this_arg, const LDKOutPoint *outpoint, LDKu8slice script_pubkey) {
701 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
702 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->register_output_meth, outpoint, script_pubkey);
704 static void LDKFilter_JCalls_free(void* this_arg) {
705 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
706 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
707 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
711 static void* LDKFilter_JCalls_clone(const void* this_arg) {
712 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
713 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
714 return (void*) this_arg;
716 static inline LDKFilter LDKFilter_init (JNIEnv * env, jclass _a, jobject o) {
717 jclass c = (*env)->GetObjectClass(env, o);
719 LDKFilter_JCalls *calls = MALLOC(sizeof(LDKFilter_JCalls), "LDKFilter_JCalls");
720 atomic_init(&calls->refcnt, 1);
722 calls->o = (*env)->NewGlobalRef(env, o);
723 calls->register_tx_meth = (*env)->GetMethodID(env, c, "register_tx", "([BJ)V");
724 assert(calls->register_tx_meth != NULL);
725 calls->register_output_meth = (*env)->GetMethodID(env, c, "register_output", "(JJ)V");
726 assert(calls->register_output_meth != NULL);
729 .this_arg = (void*) calls,
730 .register_tx = register_tx_jcall,
731 .register_output = register_output_jcall,
732 .free = LDKFilter_JCalls_free,
736 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKFilter_1new (JNIEnv * env, jclass _a, jobject o) {
737 LDKFilter *res_ptr = MALLOC(sizeof(LDKFilter), "LDKFilter");
738 *res_ptr = LDKFilter_init(env, _a, o);
739 return (long)res_ptr;
741 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFilter_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
742 return ((LDKFilter_JCalls*)val)->o;
744 typedef struct LDKBroadcasterInterface_JCalls {
745 atomic_size_t refcnt;
748 jmethodID broadcast_transaction_meth;
749 } LDKBroadcasterInterface_JCalls;
750 void broadcast_transaction_jcall(const void* this_arg, LDKTransaction tx) {
751 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
752 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->broadcast_transaction_meth, tx);
754 static void LDKBroadcasterInterface_JCalls_free(void* this_arg) {
755 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_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 static void* LDKBroadcasterInterface_JCalls_clone(const void* this_arg) {
762 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
763 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
764 return (void*) this_arg;
766 static inline LDKBroadcasterInterface LDKBroadcasterInterface_init (JNIEnv * env, jclass _a, jobject o) {
767 jclass c = (*env)->GetObjectClass(env, o);
769 LDKBroadcasterInterface_JCalls *calls = MALLOC(sizeof(LDKBroadcasterInterface_JCalls), "LDKBroadcasterInterface_JCalls");
770 atomic_init(&calls->refcnt, 1);
772 calls->o = (*env)->NewGlobalRef(env, o);
773 calls->broadcast_transaction_meth = (*env)->GetMethodID(env, c, "broadcast_transaction", "(J)V");
774 assert(calls->broadcast_transaction_meth != NULL);
776 LDKBroadcasterInterface ret = {
777 .this_arg = (void*) calls,
778 .broadcast_transaction = broadcast_transaction_jcall,
779 .free = LDKBroadcasterInterface_JCalls_free,
783 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1new (JNIEnv * env, jclass _a, jobject o) {
784 LDKBroadcasterInterface *res_ptr = MALLOC(sizeof(LDKBroadcasterInterface), "LDKBroadcasterInterface");
785 *res_ptr = LDKBroadcasterInterface_init(env, _a, o);
786 return (long)res_ptr;
788 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
789 return ((LDKBroadcasterInterface_JCalls*)val)->o;
791 typedef struct LDKFeeEstimator_JCalls {
792 atomic_size_t refcnt;
795 jmethodID get_est_sat_per_1000_weight_meth;
796 } LDKFeeEstimator_JCalls;
797 uint32_t get_est_sat_per_1000_weight_jcall(const void* this_arg, LDKConfirmationTarget confirmation_target) {
798 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
799 jclass confirmation_target_conv = LDKConfirmationTarget_to_java(j_calls->env, confirmation_target);
800 return (*j_calls->env)->CallIntMethod(j_calls->env, j_calls->o, j_calls->get_est_sat_per_1000_weight_meth, confirmation_target_conv);
802 static void LDKFeeEstimator_JCalls_free(void* this_arg) {
803 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
804 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
805 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
809 static void* LDKFeeEstimator_JCalls_clone(const void* this_arg) {
810 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
811 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
812 return (void*) this_arg;
814 static inline LDKFeeEstimator LDKFeeEstimator_init (JNIEnv * env, jclass _a, jobject o) {
815 jclass c = (*env)->GetObjectClass(env, o);
817 LDKFeeEstimator_JCalls *calls = MALLOC(sizeof(LDKFeeEstimator_JCalls), "LDKFeeEstimator_JCalls");
818 atomic_init(&calls->refcnt, 1);
820 calls->o = (*env)->NewGlobalRef(env, o);
821 calls->get_est_sat_per_1000_weight_meth = (*env)->GetMethodID(env, c, "get_est_sat_per_1000_weight", "(Lorg/ldk/impl/bindings$LDKConfirmationTarget;)I");
822 assert(calls->get_est_sat_per_1000_weight_meth != NULL);
824 LDKFeeEstimator ret = {
825 .this_arg = (void*) calls,
826 .get_est_sat_per_1000_weight = get_est_sat_per_1000_weight_jcall,
827 .free = LDKFeeEstimator_JCalls_free,
831 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1new (JNIEnv * env, jclass _a, jobject o) {
832 LDKFeeEstimator *res_ptr = MALLOC(sizeof(LDKFeeEstimator), "LDKFeeEstimator");
833 *res_ptr = LDKFeeEstimator_init(env, _a, o);
834 return (long)res_ptr;
836 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
837 return ((LDKFeeEstimator_JCalls*)val)->o;
839 typedef struct LDKKeysInterface_JCalls {
840 atomic_size_t refcnt;
843 jmethodID get_node_secret_meth;
844 jmethodID get_destination_script_meth;
845 jmethodID get_shutdown_pubkey_meth;
846 jmethodID get_channel_keys_meth;
847 jmethodID get_secure_random_bytes_meth;
848 } LDKKeysInterface_JCalls;
849 LDKSecretKey get_node_secret_jcall(const void* this_arg) {
850 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
851 LDKSecretKey* ret = (LDKSecretKey*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_node_secret_meth);
852 LDKSecretKey res = *ret;
856 LDKCVec_u8Z get_destination_script_jcall(const void* this_arg) {
857 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
858 LDKCVec_u8Z* ret = (LDKCVec_u8Z*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_destination_script_meth);
859 LDKCVec_u8Z res = *ret;
863 LDKPublicKey get_shutdown_pubkey_jcall(const void* this_arg) {
864 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
865 LDKPublicKey* ret = (LDKPublicKey*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_shutdown_pubkey_meth);
866 LDKPublicKey res = *ret;
870 LDKChannelKeys get_channel_keys_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) {
871 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
872 LDKChannelKeys* ret = (LDKChannelKeys*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_channel_keys_meth, inbound, channel_value_satoshis);
873 LDKChannelKeys res = *ret;
877 LDKThirtyTwoBytes get_secure_random_bytes_jcall(const void* this_arg) {
878 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
879 LDKThirtyTwoBytes* ret = (LDKThirtyTwoBytes*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_secure_random_bytes_meth);
880 LDKThirtyTwoBytes res = *ret;
884 static void LDKKeysInterface_JCalls_free(void* this_arg) {
885 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
886 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
887 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
891 static void* LDKKeysInterface_JCalls_clone(const void* this_arg) {
892 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
893 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
894 return (void*) this_arg;
896 static inline LDKKeysInterface LDKKeysInterface_init (JNIEnv * env, jclass _a, jobject o) {
897 jclass c = (*env)->GetObjectClass(env, o);
899 LDKKeysInterface_JCalls *calls = MALLOC(sizeof(LDKKeysInterface_JCalls), "LDKKeysInterface_JCalls");
900 atomic_init(&calls->refcnt, 1);
902 calls->o = (*env)->NewGlobalRef(env, o);
903 calls->get_node_secret_meth = (*env)->GetMethodID(env, c, "get_node_secret", "()J");
904 assert(calls->get_node_secret_meth != NULL);
905 calls->get_destination_script_meth = (*env)->GetMethodID(env, c, "get_destination_script", "()J");
906 assert(calls->get_destination_script_meth != NULL);
907 calls->get_shutdown_pubkey_meth = (*env)->GetMethodID(env, c, "get_shutdown_pubkey", "()J");
908 assert(calls->get_shutdown_pubkey_meth != NULL);
909 calls->get_channel_keys_meth = (*env)->GetMethodID(env, c, "get_channel_keys", "(ZJ)J");
910 assert(calls->get_channel_keys_meth != NULL);
911 calls->get_secure_random_bytes_meth = (*env)->GetMethodID(env, c, "get_secure_random_bytes", "()J");
912 assert(calls->get_secure_random_bytes_meth != NULL);
914 LDKKeysInterface ret = {
915 .this_arg = (void*) calls,
916 .get_node_secret = get_node_secret_jcall,
917 .get_destination_script = get_destination_script_jcall,
918 .get_shutdown_pubkey = get_shutdown_pubkey_jcall,
919 .get_channel_keys = get_channel_keys_jcall,
920 .get_secure_random_bytes = get_secure_random_bytes_jcall,
921 .free = LDKKeysInterface_JCalls_free,
925 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1new (JNIEnv * env, jclass _a, jobject o) {
926 LDKKeysInterface *res_ptr = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
927 *res_ptr = LDKKeysInterface_init(env, _a, o);
928 return (long)res_ptr;
930 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
931 return ((LDKKeysInterface_JCalls*)val)->o;
933 typedef struct LDKChannelMessageHandler_JCalls {
934 atomic_size_t refcnt;
937 LDKMessageSendEventsProvider_JCalls* MessageSendEventsProvider;
938 jmethodID handle_open_channel_meth;
939 jmethodID handle_accept_channel_meth;
940 jmethodID handle_funding_created_meth;
941 jmethodID handle_funding_signed_meth;
942 jmethodID handle_funding_locked_meth;
943 jmethodID handle_shutdown_meth;
944 jmethodID handle_closing_signed_meth;
945 jmethodID handle_update_add_htlc_meth;
946 jmethodID handle_update_fulfill_htlc_meth;
947 jmethodID handle_update_fail_htlc_meth;
948 jmethodID handle_update_fail_malformed_htlc_meth;
949 jmethodID handle_commitment_signed_meth;
950 jmethodID handle_revoke_and_ack_meth;
951 jmethodID handle_update_fee_meth;
952 jmethodID handle_announcement_signatures_meth;
953 jmethodID peer_disconnected_meth;
954 jmethodID peer_connected_meth;
955 jmethodID handle_channel_reestablish_meth;
956 jmethodID handle_error_meth;
957 } LDKChannelMessageHandler_JCalls;
958 void handle_open_channel_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKOpenChannel *msg) {
959 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
960 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_open_channel_meth, their_node_id, their_features, msg);
962 void handle_accept_channel_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKAcceptChannel *msg) {
963 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
964 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_accept_channel_meth, their_node_id, their_features, msg);
966 void handle_funding_created_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated *msg) {
967 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
968 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_funding_created_meth, their_node_id, msg);
970 void handle_funding_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned *msg) {
971 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
972 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_funding_signed_meth, their_node_id, msg);
974 void handle_funding_locked_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingLocked *msg) {
975 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
976 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_funding_locked_meth, their_node_id, msg);
978 void handle_shutdown_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKShutdown *msg) {
979 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
980 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_shutdown_meth, their_node_id, msg);
982 void handle_closing_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned *msg) {
983 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
984 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_closing_signed_meth, their_node_id, msg);
986 void handle_update_add_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC *msg) {
987 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
988 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_update_add_htlc_meth, their_node_id, msg);
990 void handle_update_fulfill_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC *msg) {
991 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
992 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_update_fulfill_htlc_meth, their_node_id, msg);
994 void handle_update_fail_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC *msg) {
995 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
996 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_update_fail_htlc_meth, their_node_id, msg);
998 void handle_update_fail_malformed_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC *msg) {
999 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1000 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_update_fail_malformed_htlc_meth, their_node_id, msg);
1002 void handle_commitment_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned *msg) {
1003 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1004 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_commitment_signed_meth, their_node_id, msg);
1006 void handle_revoke_and_ack_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK *msg) {
1007 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1008 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_revoke_and_ack_meth, their_node_id, msg);
1010 void handle_update_fee_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee *msg) {
1011 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1012 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_update_fee_meth, their_node_id, msg);
1014 void handle_announcement_signatures_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures *msg) {
1015 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1016 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_announcement_signatures_meth, their_node_id, msg);
1018 void peer_disconnected_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) {
1019 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1020 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->peer_disconnected_meth, their_node_id, no_connection_possible);
1022 void peer_connected_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit *msg) {
1023 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1024 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->peer_connected_meth, their_node_id, msg);
1026 void handle_channel_reestablish_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReestablish *msg) {
1027 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1028 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_channel_reestablish_meth, their_node_id, msg);
1030 void handle_error_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage *msg) {
1031 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1032 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_error_meth, their_node_id, msg);
1034 static void LDKChannelMessageHandler_JCalls_free(void* this_arg) {
1035 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1036 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1037 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
1041 static void* LDKChannelMessageHandler_JCalls_clone(const void* this_arg) {
1042 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1043 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1044 atomic_fetch_add_explicit(&j_calls->MessageSendEventsProvider->refcnt, 1, memory_order_release);
1045 return (void*) this_arg;
1047 static inline LDKChannelMessageHandler LDKChannelMessageHandler_init (JNIEnv * env, jclass _a, jobject o, jobject MessageSendEventsProvider) {
1048 jclass c = (*env)->GetObjectClass(env, o);
1050 LDKChannelMessageHandler_JCalls *calls = MALLOC(sizeof(LDKChannelMessageHandler_JCalls), "LDKChannelMessageHandler_JCalls");
1051 atomic_init(&calls->refcnt, 1);
1053 calls->o = (*env)->NewGlobalRef(env, o);
1054 calls->handle_open_channel_meth = (*env)->GetMethodID(env, c, "handle_open_channel", "(JJJ)V");
1055 assert(calls->handle_open_channel_meth != NULL);
1056 calls->handle_accept_channel_meth = (*env)->GetMethodID(env, c, "handle_accept_channel", "(JJJ)V");
1057 assert(calls->handle_accept_channel_meth != NULL);
1058 calls->handle_funding_created_meth = (*env)->GetMethodID(env, c, "handle_funding_created", "(JJ)V");
1059 assert(calls->handle_funding_created_meth != NULL);
1060 calls->handle_funding_signed_meth = (*env)->GetMethodID(env, c, "handle_funding_signed", "(JJ)V");
1061 assert(calls->handle_funding_signed_meth != NULL);
1062 calls->handle_funding_locked_meth = (*env)->GetMethodID(env, c, "handle_funding_locked", "(JJ)V");
1063 assert(calls->handle_funding_locked_meth != NULL);
1064 calls->handle_shutdown_meth = (*env)->GetMethodID(env, c, "handle_shutdown", "(JJ)V");
1065 assert(calls->handle_shutdown_meth != NULL);
1066 calls->handle_closing_signed_meth = (*env)->GetMethodID(env, c, "handle_closing_signed", "(JJ)V");
1067 assert(calls->handle_closing_signed_meth != NULL);
1068 calls->handle_update_add_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_add_htlc", "(JJ)V");
1069 assert(calls->handle_update_add_htlc_meth != NULL);
1070 calls->handle_update_fulfill_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fulfill_htlc", "(JJ)V");
1071 assert(calls->handle_update_fulfill_htlc_meth != NULL);
1072 calls->handle_update_fail_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fail_htlc", "(JJ)V");
1073 assert(calls->handle_update_fail_htlc_meth != NULL);
1074 calls->handle_update_fail_malformed_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fail_malformed_htlc", "(JJ)V");
1075 assert(calls->handle_update_fail_malformed_htlc_meth != NULL);
1076 calls->handle_commitment_signed_meth = (*env)->GetMethodID(env, c, "handle_commitment_signed", "(JJ)V");
1077 assert(calls->handle_commitment_signed_meth != NULL);
1078 calls->handle_revoke_and_ack_meth = (*env)->GetMethodID(env, c, "handle_revoke_and_ack", "(JJ)V");
1079 assert(calls->handle_revoke_and_ack_meth != NULL);
1080 calls->handle_update_fee_meth = (*env)->GetMethodID(env, c, "handle_update_fee", "(JJ)V");
1081 assert(calls->handle_update_fee_meth != NULL);
1082 calls->handle_announcement_signatures_meth = (*env)->GetMethodID(env, c, "handle_announcement_signatures", "(JJ)V");
1083 assert(calls->handle_announcement_signatures_meth != NULL);
1084 calls->peer_disconnected_meth = (*env)->GetMethodID(env, c, "peer_disconnected", "(JZ)V");
1085 assert(calls->peer_disconnected_meth != NULL);
1086 calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "(JJ)V");
1087 assert(calls->peer_connected_meth != NULL);
1088 calls->handle_channel_reestablish_meth = (*env)->GetMethodID(env, c, "handle_channel_reestablish", "(JJ)V");
1089 assert(calls->handle_channel_reestablish_meth != NULL);
1090 calls->handle_error_meth = (*env)->GetMethodID(env, c, "handle_error", "(JJ)V");
1091 assert(calls->handle_error_meth != NULL);
1093 LDKChannelMessageHandler ret = {
1094 .this_arg = (void*) calls,
1095 .handle_open_channel = handle_open_channel_jcall,
1096 .handle_accept_channel = handle_accept_channel_jcall,
1097 .handle_funding_created = handle_funding_created_jcall,
1098 .handle_funding_signed = handle_funding_signed_jcall,
1099 .handle_funding_locked = handle_funding_locked_jcall,
1100 .handle_shutdown = handle_shutdown_jcall,
1101 .handle_closing_signed = handle_closing_signed_jcall,
1102 .handle_update_add_htlc = handle_update_add_htlc_jcall,
1103 .handle_update_fulfill_htlc = handle_update_fulfill_htlc_jcall,
1104 .handle_update_fail_htlc = handle_update_fail_htlc_jcall,
1105 .handle_update_fail_malformed_htlc = handle_update_fail_malformed_htlc_jcall,
1106 .handle_commitment_signed = handle_commitment_signed_jcall,
1107 .handle_revoke_and_ack = handle_revoke_and_ack_jcall,
1108 .handle_update_fee = handle_update_fee_jcall,
1109 .handle_announcement_signatures = handle_announcement_signatures_jcall,
1110 .peer_disconnected = peer_disconnected_jcall,
1111 .peer_connected = peer_connected_jcall,
1112 .handle_channel_reestablish = handle_channel_reestablish_jcall,
1113 .handle_error = handle_error_jcall,
1114 .free = LDKChannelMessageHandler_JCalls_free,
1115 .MessageSendEventsProvider = LDKMessageSendEventsProvider_init(env, _a, MessageSendEventsProvider),
1117 calls->MessageSendEventsProvider = ret.MessageSendEventsProvider.this_arg;
1120 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1new (JNIEnv * env, jclass _a, jobject o, jobject MessageSendEventsProvider) {
1121 LDKChannelMessageHandler *res_ptr = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
1122 *res_ptr = LDKChannelMessageHandler_init(env, _a, o, MessageSendEventsProvider);
1123 return (long)res_ptr;
1125 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
1126 return ((LDKChannelMessageHandler_JCalls*)val)->o;
1128 typedef struct LDKRoutingMessageHandler_JCalls {
1129 atomic_size_t refcnt;
1132 jmethodID handle_node_announcement_meth;
1133 jmethodID handle_channel_announcement_meth;
1134 jmethodID handle_channel_update_meth;
1135 jmethodID handle_htlc_fail_channel_update_meth;
1136 jmethodID get_next_channel_announcements_meth;
1137 jmethodID get_next_node_announcements_meth;
1138 jmethodID should_request_full_sync_meth;
1139 } LDKRoutingMessageHandler_JCalls;
1140 LDKCResult_boolLightningErrorZ handle_node_announcement_jcall(const void* this_arg, const LDKNodeAnnouncement *msg) {
1141 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1142 LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->handle_node_announcement_meth, msg);
1143 LDKCResult_boolLightningErrorZ res = *ret;
1147 LDKCResult_boolLightningErrorZ handle_channel_announcement_jcall(const void* this_arg, const LDKChannelAnnouncement *msg) {
1148 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1149 LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->handle_channel_announcement_meth, msg);
1150 LDKCResult_boolLightningErrorZ res = *ret;
1154 LDKCResult_boolLightningErrorZ handle_channel_update_jcall(const void* this_arg, const LDKChannelUpdate *msg) {
1155 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1156 LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->handle_channel_update_meth, msg);
1157 LDKCResult_boolLightningErrorZ res = *ret;
1161 void handle_htlc_fail_channel_update_jcall(const void* this_arg, const LDKHTLCFailChannelUpdate *update) {
1162 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1163 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_htlc_fail_channel_update_meth, update);
1165 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcements_jcall(const void* this_arg, uint64_t starting_point, uint8_t batch_amount) {
1166 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1167 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);
1168 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ res = *ret;
1172 LDKCVec_NodeAnnouncementZ get_next_node_announcements_jcall(const void* this_arg, LDKPublicKey starting_point, uint8_t batch_amount) {
1173 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1174 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);
1175 LDKCVec_NodeAnnouncementZ res = *ret;
1179 bool should_request_full_sync_jcall(const void* this_arg, LDKPublicKey node_id) {
1180 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1181 return (*j_calls->env)->CallBooleanMethod(j_calls->env, j_calls->o, j_calls->should_request_full_sync_meth, node_id);
1183 static void LDKRoutingMessageHandler_JCalls_free(void* this_arg) {
1184 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1185 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1186 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
1190 static void* LDKRoutingMessageHandler_JCalls_clone(const void* this_arg) {
1191 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1192 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1193 return (void*) this_arg;
1195 static inline LDKRoutingMessageHandler LDKRoutingMessageHandler_init (JNIEnv * env, jclass _a, jobject o) {
1196 jclass c = (*env)->GetObjectClass(env, o);
1198 LDKRoutingMessageHandler_JCalls *calls = MALLOC(sizeof(LDKRoutingMessageHandler_JCalls), "LDKRoutingMessageHandler_JCalls");
1199 atomic_init(&calls->refcnt, 1);
1201 calls->o = (*env)->NewGlobalRef(env, o);
1202 calls->handle_node_announcement_meth = (*env)->GetMethodID(env, c, "handle_node_announcement", "(J)J");
1203 assert(calls->handle_node_announcement_meth != NULL);
1204 calls->handle_channel_announcement_meth = (*env)->GetMethodID(env, c, "handle_channel_announcement", "(J)J");
1205 assert(calls->handle_channel_announcement_meth != NULL);
1206 calls->handle_channel_update_meth = (*env)->GetMethodID(env, c, "handle_channel_update", "(J)J");
1207 assert(calls->handle_channel_update_meth != NULL);
1208 calls->handle_htlc_fail_channel_update_meth = (*env)->GetMethodID(env, c, "handle_htlc_fail_channel_update", "(J)V");
1209 assert(calls->handle_htlc_fail_channel_update_meth != NULL);
1210 calls->get_next_channel_announcements_meth = (*env)->GetMethodID(env, c, "get_next_channel_announcements", "(JB)J");
1211 assert(calls->get_next_channel_announcements_meth != NULL);
1212 calls->get_next_node_announcements_meth = (*env)->GetMethodID(env, c, "get_next_node_announcements", "(JB)J");
1213 assert(calls->get_next_node_announcements_meth != NULL);
1214 calls->should_request_full_sync_meth = (*env)->GetMethodID(env, c, "should_request_full_sync", "(J)Z");
1215 assert(calls->should_request_full_sync_meth != NULL);
1217 LDKRoutingMessageHandler ret = {
1218 .this_arg = (void*) calls,
1219 .handle_node_announcement = handle_node_announcement_jcall,
1220 .handle_channel_announcement = handle_channel_announcement_jcall,
1221 .handle_channel_update = handle_channel_update_jcall,
1222 .handle_htlc_fail_channel_update = handle_htlc_fail_channel_update_jcall,
1223 .get_next_channel_announcements = get_next_channel_announcements_jcall,
1224 .get_next_node_announcements = get_next_node_announcements_jcall,
1225 .should_request_full_sync = should_request_full_sync_jcall,
1226 .free = LDKRoutingMessageHandler_JCalls_free,
1230 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1new (JNIEnv * env, jclass _a, jobject o) {
1231 LDKRoutingMessageHandler *res_ptr = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
1232 *res_ptr = LDKRoutingMessageHandler_init(env, _a, o);
1233 return (long)res_ptr;
1235 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
1236 return ((LDKRoutingMessageHandler_JCalls*)val)->o;
1238 typedef struct LDKSocketDescriptor_JCalls {
1239 atomic_size_t refcnt;
1242 jmethodID send_data_meth;
1243 jmethodID disconnect_socket_meth;
1245 jmethodID hash_meth;
1246 } LDKSocketDescriptor_JCalls;
1247 uintptr_t send_data_jcall(void* this_arg, LDKu8slice data, bool resume_read) {
1248 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
1249 return (*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->send_data_meth, data, resume_read);
1251 void disconnect_socket_jcall(void* this_arg) {
1252 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
1253 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->disconnect_socket_meth);
1255 bool eq_jcall(const void* this_arg, const void *other_arg) {
1256 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
1257 return (*j_calls->env)->CallBooleanMethod(j_calls->env, j_calls->o, j_calls->eq_meth, other_arg);
1259 uint64_t hash_jcall(const void* this_arg) {
1260 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
1261 return (*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->hash_meth);
1263 static void LDKSocketDescriptor_JCalls_free(void* this_arg) {
1264 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
1265 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1266 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
1270 static void* LDKSocketDescriptor_JCalls_clone(const void* this_arg) {
1271 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
1272 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1273 return (void*) this_arg;
1275 static inline LDKSocketDescriptor LDKSocketDescriptor_init (JNIEnv * env, jclass _a, jobject o) {
1276 jclass c = (*env)->GetObjectClass(env, o);
1278 LDKSocketDescriptor_JCalls *calls = MALLOC(sizeof(LDKSocketDescriptor_JCalls), "LDKSocketDescriptor_JCalls");
1279 atomic_init(&calls->refcnt, 1);
1281 calls->o = (*env)->NewGlobalRef(env, o);
1282 calls->send_data_meth = (*env)->GetMethodID(env, c, "send_data", "(JZ)J");
1283 assert(calls->send_data_meth != NULL);
1284 calls->disconnect_socket_meth = (*env)->GetMethodID(env, c, "disconnect_socket", "()V");
1285 assert(calls->disconnect_socket_meth != NULL);
1286 calls->eq_meth = (*env)->GetMethodID(env, c, "eq", "(J)Z");
1287 assert(calls->eq_meth != NULL);
1288 calls->hash_meth = (*env)->GetMethodID(env, c, "hash", "()J");
1289 assert(calls->hash_meth != NULL);
1291 LDKSocketDescriptor ret = {
1292 .this_arg = (void*) calls,
1293 .send_data = send_data_jcall,
1294 .disconnect_socket = disconnect_socket_jcall,
1297 .clone = LDKSocketDescriptor_JCalls_clone,
1298 .free = LDKSocketDescriptor_JCalls_free,
1302 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1new (JNIEnv * env, jclass _a, jobject o) {
1303 LDKSocketDescriptor *res_ptr = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
1304 *res_ptr = LDKSocketDescriptor_init(env, _a, o);
1305 return (long)res_ptr;
1307 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
1308 return ((LDKSocketDescriptor_JCalls*)val)->o;
1310 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HTLCOutputInCommitmentSignatureZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1311 LDKC2Tuple_HTLCOutputInCommitmentSignatureZ arg_conv = *(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ*)arg;
1313 return C2Tuple_HTLCOutputInCommitmentSignatureZ_free(arg_conv);
1316 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1317 LDKC2Tuple_OutPointScriptZ arg_conv = *(LDKC2Tuple_OutPointScriptZ*)arg;
1319 return C2Tuple_OutPointScriptZ_free(arg_conv);
1322 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1323 LDKC2Tuple_SignatureCVec_SignatureZZ arg_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)arg;
1325 return C2Tuple_SignatureCVec_SignatureZZ_free(arg_conv);
1328 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1TxOutZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1329 LDKC2Tuple_TxidCVec_TxOutZZ arg_conv = *(LDKC2Tuple_TxidCVec_TxOutZZ*)arg;
1331 return C2Tuple_TxidCVec_TxOutZZ_free(arg_conv);
1334 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
1335 LDKC2Tuple_u64u64Z arg_conv = *(LDKC2Tuple_u64u64Z*)arg;
1337 return C2Tuple_u64u64Z_free(arg_conv);
1340 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1341 LDKC2Tuple_usizeTransactionZ arg_conv = *(LDKC2Tuple_usizeTransactionZ*)arg;
1343 return C2Tuple_usizeTransactionZ_free(arg_conv);
1346 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1347 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arg_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)arg;
1349 return C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(arg_conv);
1352 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1353 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ arg_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg;
1355 return CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(arg_conv);
1358 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1359 LDKC2Tuple_SignatureCVec_SignatureZZ arg_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)arg;
1361 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
1362 *ret = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(arg_conv);
1366 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1367 LDKCResult_CVec_SignatureZNoneZ arg_conv = *(LDKCResult_CVec_SignatureZNoneZ*)arg;
1369 return CResult_CVec_SignatureZNoneZ_free(arg_conv);
1372 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1373 LDKCVec_SignatureZ arg_conv = *(LDKCVec_SignatureZ*)arg;
1375 LDKCResult_CVec_SignatureZNoneZ* ret = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
1376 *ret = CResult_CVec_SignatureZNoneZ_ok(arg_conv);
1380 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1381 LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg;
1383 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
1384 *ret = CResult_CVec_u8ZPeerHandleErrorZ_err(arg_conv);
1388 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1389 LDKCResult_CVec_u8ZPeerHandleErrorZ arg_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg;
1391 return CResult_CVec_u8ZPeerHandleErrorZ_free(arg_conv);
1394 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1395 LDKCVec_u8Z arg_conv = *(LDKCVec_u8Z*)arg;
1397 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
1398 *ret = CResult_CVec_u8ZPeerHandleErrorZ_ok(arg_conv);
1402 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1403 LDKAPIError arg_conv = *(LDKAPIError*)arg;
1405 LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
1406 *ret = CResult_NoneAPIErrorZ_err(arg_conv);
1410 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1411 LDKCResult_NoneAPIErrorZ arg_conv = *(LDKCResult_NoneAPIErrorZ*)arg;
1413 return CResult_NoneAPIErrorZ_free(arg_conv);
1416 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
1417 LDKChannelMonitorUpdateErr arg_conv = *(LDKChannelMonitorUpdateErr*)arg;
1419 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
1420 *ret = CResult_NoneChannelMonitorUpdateErrZ_err(arg_conv);
1424 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1425 LDKCResult_NoneChannelMonitorUpdateErrZ arg_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)arg;
1427 return CResult_NoneChannelMonitorUpdateErrZ_free(arg_conv);
1430 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1431 LDKMonitorUpdateError arg_conv = *(LDKMonitorUpdateError*)arg;
1433 LDKCResult_NoneMonitorUpdateErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
1434 *ret = CResult_NoneMonitorUpdateErrorZ_err(arg_conv);
1438 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1439 LDKCResult_NoneMonitorUpdateErrorZ arg_conv = *(LDKCResult_NoneMonitorUpdateErrorZ*)arg;
1441 return CResult_NoneMonitorUpdateErrorZ_free(arg_conv);
1444 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1445 LDKPaymentSendFailure arg_conv = *(LDKPaymentSendFailure*)arg;
1447 LDKCResult_NonePaymentSendFailureZ* ret = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
1448 *ret = CResult_NonePaymentSendFailureZ_err(arg_conv);
1452 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1453 LDKCResult_NonePaymentSendFailureZ arg_conv = *(LDKCResult_NonePaymentSendFailureZ*)arg;
1455 return CResult_NonePaymentSendFailureZ_free(arg_conv);
1458 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1459 LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg;
1461 LDKCResult_NonePeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
1462 *ret = CResult_NonePeerHandleErrorZ_err(arg_conv);
1466 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1467 LDKCResult_NonePeerHandleErrorZ arg_conv = *(LDKCResult_NonePeerHandleErrorZ*)arg;
1469 return CResult_NonePeerHandleErrorZ_free(arg_conv);
1472 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
1473 LDKSecp256k1Error arg_conv = *(LDKSecp256k1Error*)arg;
1475 LDKCResult_PublicKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ");
1476 *ret = CResult_PublicKeySecpErrorZ_err(arg_conv);
1480 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1481 LDKCResult_PublicKeySecpErrorZ arg_conv = *(LDKCResult_PublicKeySecpErrorZ*)arg;
1483 return CResult_PublicKeySecpErrorZ_free(arg_conv);
1486 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1487 LDKPublicKey arg_conv = *(LDKPublicKey*)arg;
1489 LDKCResult_PublicKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ");
1490 *ret = CResult_PublicKeySecpErrorZ_ok(arg_conv);
1494 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1495 LDKLightningError arg_conv = *(LDKLightningError*)arg;
1497 LDKCResult_RouteLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
1498 *ret = CResult_RouteLightningErrorZ_err(arg_conv);
1502 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1503 LDKCResult_RouteLightningErrorZ arg_conv = *(LDKCResult_RouteLightningErrorZ*)arg;
1505 return CResult_RouteLightningErrorZ_free(arg_conv);
1508 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1509 LDKRoute arg_conv = *(LDKRoute*)arg;
1511 LDKCResult_RouteLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
1512 *ret = CResult_RouteLightningErrorZ_ok(arg_conv);
1516 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
1517 LDKSecp256k1Error arg_conv = *(LDKSecp256k1Error*)arg;
1519 LDKCResult_SecretKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ");
1520 *ret = CResult_SecretKeySecpErrorZ_err(arg_conv);
1524 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1525 LDKCResult_SecretKeySecpErrorZ arg_conv = *(LDKCResult_SecretKeySecpErrorZ*)arg;
1527 return CResult_SecretKeySecpErrorZ_free(arg_conv);
1530 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1531 LDKSecretKey arg_conv = *(LDKSecretKey*)arg;
1533 LDKCResult_SecretKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ");
1534 *ret = CResult_SecretKeySecpErrorZ_ok(arg_conv);
1538 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1539 LDKCResult_SignatureNoneZ arg_conv = *(LDKCResult_SignatureNoneZ*)arg;
1541 return CResult_SignatureNoneZ_free(arg_conv);
1544 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1545 LDKSignature arg_conv = *(LDKSignature*)arg;
1547 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
1548 *ret = CResult_SignatureNoneZ_ok(arg_conv);
1552 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
1553 LDKSecp256k1Error arg_conv = *(LDKSecp256k1Error*)arg;
1555 LDKCResult_TxCreationKeysSecpErrorZ* ret = MALLOC(sizeof(LDKCResult_TxCreationKeysSecpErrorZ), "LDKCResult_TxCreationKeysSecpErrorZ");
1556 *ret = CResult_TxCreationKeysSecpErrorZ_err(arg_conv);
1560 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1561 LDKCResult_TxCreationKeysSecpErrorZ arg_conv = *(LDKCResult_TxCreationKeysSecpErrorZ*)arg;
1563 return CResult_TxCreationKeysSecpErrorZ_free(arg_conv);
1566 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1567 LDKTxCreationKeys arg_conv = *(LDKTxCreationKeys*)arg;
1569 LDKCResult_TxCreationKeysSecpErrorZ* ret = MALLOC(sizeof(LDKCResult_TxCreationKeysSecpErrorZ), "LDKCResult_TxCreationKeysSecpErrorZ");
1570 *ret = CResult_TxCreationKeysSecpErrorZ_ok(arg_conv);
1574 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
1575 LDKAccessError arg_conv = *(LDKAccessError*)arg;
1577 LDKCResult_TxOutAccessErrorZ* ret = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
1578 *ret = CResult_TxOutAccessErrorZ_err(arg_conv);
1582 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1583 LDKCResult_TxOutAccessErrorZ arg_conv = *(LDKCResult_TxOutAccessErrorZ*)arg;
1585 return CResult_TxOutAccessErrorZ_free(arg_conv);
1588 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1589 LDKTxOut arg_conv = *(LDKTxOut*)arg;
1591 LDKCResult_TxOutAccessErrorZ* ret = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
1592 *ret = CResult_TxOutAccessErrorZ_ok(arg_conv);
1596 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1597 LDKLightningError arg_conv = *(LDKLightningError*)arg;
1599 LDKCResult_boolLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
1600 *ret = CResult_boolLightningErrorZ_err(arg_conv);
1604 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1605 LDKCResult_boolLightningErrorZ arg_conv = *(LDKCResult_boolLightningErrorZ*)arg;
1607 return CResult_boolLightningErrorZ_free(arg_conv);
1610 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1ok(JNIEnv * _env, jclass _b, jboolean arg) {
1611 LDKCResult_boolLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
1612 *ret = CResult_boolLightningErrorZ_ok(arg);
1616 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1617 LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg;
1619 LDKCResult_boolPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
1620 *ret = CResult_boolPeerHandleErrorZ_err(arg_conv);
1624 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1625 LDKCResult_boolPeerHandleErrorZ arg_conv = *(LDKCResult_boolPeerHandleErrorZ*)arg;
1627 return CResult_boolPeerHandleErrorZ_free(arg_conv);
1630 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b, jboolean arg) {
1631 LDKCResult_boolPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
1632 *ret = CResult_boolPeerHandleErrorZ_ok(arg);
1636 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1HTLCOutputInCommitmentSignatureZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1637 LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ arg_conv = *(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ*)arg;
1639 return CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ_free(arg_conv);
1642 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1TxOutZZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1643 LDKCVec_C2Tuple_TxidCVec_TxOutZZZ arg_conv = *(LDKCVec_C2Tuple_TxidCVec_TxOutZZZ*)arg;
1645 return CVec_C2Tuple_TxidCVec_TxOutZZZ_free(arg_conv);
1648 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1usizeTransactionZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1649 LDKCVec_C2Tuple_usizeTransactionZZ arg_conv = *(LDKCVec_C2Tuple_usizeTransactionZZ*)arg;
1651 return CVec_C2Tuple_usizeTransactionZZ_free(arg_conv);
1654 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1655 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ arg_conv = *(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)arg;
1657 return CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(arg_conv);
1660 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1RouteHopZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1661 LDKCVec_CVec_RouteHopZZ arg_conv = *(LDKCVec_CVec_RouteHopZZ*)arg;
1663 return CVec_CVec_RouteHopZZ_free(arg_conv);
1666 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1667 LDKCVec_ChannelDetailsZ arg_conv = *(LDKCVec_ChannelDetailsZ*)arg;
1669 return CVec_ChannelDetailsZ_free(arg_conv);
1672 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelMonitorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1673 LDKCVec_ChannelMonitorZ arg_conv = *(LDKCVec_ChannelMonitorZ*)arg;
1675 return CVec_ChannelMonitorZ_free(arg_conv);
1678 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1EventZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1679 LDKCVec_EventZ arg_conv = *(LDKCVec_EventZ*)arg;
1681 return CVec_EventZ_free(arg_conv);
1684 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1HTLCOutputInCommitmentZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1685 LDKCVec_HTLCOutputInCommitmentZ arg_conv = *(LDKCVec_HTLCOutputInCommitmentZ*)arg;
1687 return CVec_HTLCOutputInCommitmentZ_free(arg_conv);
1690 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MessageSendEventZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1691 LDKCVec_MessageSendEventZ arg_conv = *(LDKCVec_MessageSendEventZ*)arg;
1693 return CVec_MessageSendEventZ_free(arg_conv);
1696 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorEventZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1697 LDKCVec_MonitorEventZ arg_conv = *(LDKCVec_MonitorEventZ*)arg;
1699 return CVec_MonitorEventZ_free(arg_conv);
1702 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NetAddressZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1703 LDKCVec_NetAddressZ arg_conv = *(LDKCVec_NetAddressZ*)arg;
1705 return CVec_NetAddressZ_free(arg_conv);
1708 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NodeAnnouncementZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1709 LDKCVec_NodeAnnouncementZ arg_conv = *(LDKCVec_NodeAnnouncementZ*)arg;
1711 return CVec_NodeAnnouncementZ_free(arg_conv);
1714 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PublicKeyZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1715 LDKCVec_PublicKeyZ arg_conv = *(LDKCVec_PublicKeyZ*)arg;
1717 return CVec_PublicKeyZ_free(arg_conv);
1720 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1721 LDKCVec_RouteHintZ arg_conv = *(LDKCVec_RouteHintZ*)arg;
1723 return CVec_RouteHintZ_free(arg_conv);
1726 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHopZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1727 LDKCVec_RouteHopZ arg_conv = *(LDKCVec_RouteHopZ*)arg;
1729 return CVec_RouteHopZ_free(arg_conv);
1732 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SignatureZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1733 LDKCVec_SignatureZ arg_conv = *(LDKCVec_SignatureZ*)arg;
1735 return CVec_SignatureZ_free(arg_conv);
1738 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SpendableOutputDescriptorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1739 LDKCVec_SpendableOutputDescriptorZ arg_conv = *(LDKCVec_SpendableOutputDescriptorZ*)arg;
1741 return CVec_SpendableOutputDescriptorZ_free(arg_conv);
1744 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1745 LDKCVec_TransactionZ arg_conv = *(LDKCVec_TransactionZ*)arg;
1747 return CVec_TransactionZ_free(arg_conv);
1750 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TxOutZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1751 LDKCVec_TxOutZ arg_conv = *(LDKCVec_TxOutZ*)arg;
1753 return CVec_TxOutZ_free(arg_conv);
1756 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateAddHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1757 LDKCVec_UpdateAddHTLCZ arg_conv = *(LDKCVec_UpdateAddHTLCZ*)arg;
1759 return CVec_UpdateAddHTLCZ_free(arg_conv);
1762 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1763 LDKCVec_UpdateFailHTLCZ arg_conv = *(LDKCVec_UpdateFailHTLCZ*)arg;
1765 return CVec_UpdateFailHTLCZ_free(arg_conv);
1768 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailMalformedHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1769 LDKCVec_UpdateFailMalformedHTLCZ arg_conv = *(LDKCVec_UpdateFailMalformedHTLCZ*)arg;
1771 return CVec_UpdateFailMalformedHTLCZ_free(arg_conv);
1774 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFulfillHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1775 LDKCVec_UpdateFulfillHTLCZ arg_conv = *(LDKCVec_UpdateFulfillHTLCZ*)arg;
1777 return CVec_UpdateFulfillHTLCZ_free(arg_conv);
1780 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u64Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
1781 LDKCVec_u64Z arg_conv = *(LDKCVec_u64Z*)arg;
1783 return CVec_u64Z_free(arg_conv);
1786 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u8Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
1787 LDKCVec_u8Z arg_conv = *(LDKCVec_u8Z*)arg;
1789 return CVec_u8Z_free(arg_conv);
1792 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Transaction_1free(JNIEnv * _env, jclass _b, jlong _res) {
1793 LDKTransaction _res_conv = *(LDKTransaction*)_res;
1795 return Transaction_free(_res_conv);
1798 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_1free(JNIEnv * _env, jclass _b, jlong _res) {
1799 LDKTxOut _res_conv = *(LDKTxOut*)_res;
1801 return TxOut_free(_res_conv);
1804 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
1805 LDKTransaction b_conv = *(LDKTransaction*)b;
1807 LDKC2Tuple_usizeTransactionZ* ret = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
1808 *ret = C2Tuple_usizeTransactionZ_new(a, b_conv);
1812 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1ok(JNIEnv * _env, jclass _b) {
1813 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
1814 *ret = CResult_NoneChannelMonitorUpdateErrZ_ok();
1818 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1ok(JNIEnv * _env, jclass _b) {
1819 LDKCResult_NoneMonitorUpdateErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
1820 *ret = CResult_NoneMonitorUpdateErrorZ_ok();
1824 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
1825 LDKOutPoint a_conv = *(LDKOutPoint*)a;
1827 a_conv.is_owned = true;
1828 LDKCVec_u8Z b_conv = *(LDKCVec_u8Z*)b;
1830 LDKC2Tuple_OutPointScriptZ* ret = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
1831 *ret = C2Tuple_OutPointScriptZ_new(a_conv, b_conv);
1835 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1TxOutZZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
1836 LDKThirtyTwoBytes a_conv = *(LDKThirtyTwoBytes*)a;
1838 LDKCVec_TxOutZ b_conv = *(LDKCVec_TxOutZ*)b;
1840 LDKC2Tuple_TxidCVec_TxOutZZ* ret = MALLOC(sizeof(LDKC2Tuple_TxidCVec_TxOutZZ), "LDKC2Tuple_TxidCVec_TxOutZZ");
1841 *ret = C2Tuple_TxidCVec_TxOutZZ_new(a_conv, b_conv);
1845 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
1846 LDKC2Tuple_u64u64Z* ret = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
1847 *ret = C2Tuple_u64u64Z_new(a, b);
1851 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
1852 LDKSignature a_conv = *(LDKSignature*)a;
1854 LDKCVec_SignatureZ b_conv = *(LDKCVec_SignatureZ*)b;
1856 LDKC2Tuple_SignatureCVec_SignatureZZ* ret = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
1857 *ret = C2Tuple_SignatureCVec_SignatureZZ_new(a_conv, b_conv);
1861 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1err(JNIEnv * _env, jclass _b) {
1862 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
1863 *ret = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err();
1867 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1err(JNIEnv * _env, jclass _b) {
1868 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
1869 *ret = CResult_SignatureNoneZ_err();
1873 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1err(JNIEnv * _env, jclass _b) {
1874 LDKCResult_CVec_SignatureZNoneZ* ret = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
1875 *ret = CResult_CVec_SignatureZNoneZ_err();
1879 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1ok(JNIEnv * _env, jclass _b) {
1880 LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
1881 *ret = CResult_NoneAPIErrorZ_ok();
1885 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1ok(JNIEnv * _env, jclass _b) {
1886 LDKCResult_NonePaymentSendFailureZ* ret = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
1887 *ret = CResult_NonePaymentSendFailureZ_ok();
1891 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b, jlong c) {
1892 LDKChannelAnnouncement a_conv = *(LDKChannelAnnouncement*)a;
1894 a_conv.is_owned = true;
1895 LDKChannelUpdate b_conv = *(LDKChannelUpdate*)b;
1897 b_conv.is_owned = true;
1898 LDKChannelUpdate c_conv = *(LDKChannelUpdate*)c;
1900 c_conv.is_owned = true;
1901 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
1902 *ret = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a_conv, b_conv, c_conv);
1906 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b) {
1907 LDKCResult_NonePeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
1908 *ret = CResult_NonePeerHandleErrorZ_ok();
1912 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HTLCOutputInCommitmentSignatureZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
1913 LDKHTLCOutputInCommitment a_conv = *(LDKHTLCOutputInCommitment*)a;
1915 a_conv.is_owned = true;
1916 LDKSignature b_conv = *(LDKSignature*)b;
1918 LDKC2Tuple_HTLCOutputInCommitmentSignatureZ* ret = MALLOC(sizeof(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ), "LDKC2Tuple_HTLCOutputInCommitmentSignatureZ");
1919 *ret = C2Tuple_HTLCOutputInCommitmentSignatureZ_new(a_conv, b_conv);
1923 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1924 LDKEvent this_ptr_conv = *(LDKEvent*)this_ptr;
1925 FREE((void*)this_ptr);
1926 return Event_free(this_ptr_conv);
1929 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1930 LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)this_ptr;
1931 FREE((void*)this_ptr);
1932 return MessageSendEvent_free(this_ptr_conv);
1935 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1936 LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)this_ptr;
1937 FREE((void*)this_ptr);
1938 return MessageSendEventsProvider_free(this_ptr_conv);
1941 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1942 LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)this_ptr;
1943 FREE((void*)this_ptr);
1944 return EventsProvider_free(this_ptr_conv);
1947 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_APIError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1948 LDKAPIError this_ptr_conv = *(LDKAPIError*)this_ptr;
1949 FREE((void*)this_ptr);
1950 return APIError_free(this_ptr_conv);
1953 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1max(JNIEnv * _env, jclass _b) {
1954 jclass ret = LDKLevel_to_java(_env, Level_max());
1958 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Logger_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1959 LDKLogger this_ptr_conv = *(LDKLogger*)this_ptr;
1960 FREE((void*)this_ptr);
1961 return Logger_free(this_ptr_conv);
1964 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1965 LDKChannelHandshakeConfig this_ptr_conv = *(LDKChannelHandshakeConfig*)this_ptr;
1966 FREE((void*)this_ptr);
1967 this_ptr_conv.is_owned = true;
1968 return ChannelHandshakeConfig_free(this_ptr_conv);
1971 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr) {
1972 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
1973 return ChannelHandshakeConfig_get_minimum_depth(this_ptr_conv);
1976 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
1977 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
1978 return ChannelHandshakeConfig_set_minimum_depth(this_ptr_conv, val);
1981 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
1982 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
1983 return ChannelHandshakeConfig_get_our_to_self_delay(this_ptr_conv);
1986 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
1987 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
1988 return ChannelHandshakeConfig_set_our_to_self_delay(this_ptr_conv, val);
1991 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
1992 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
1993 return ChannelHandshakeConfig_get_our_htlc_minimum_msat(this_ptr_conv);
1996 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1997 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
1998 return ChannelHandshakeConfig_set_our_htlc_minimum_msat(this_ptr_conv, val);
2001 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) {
2002 LDKChannelHandshakeConfig* ret = MALLOC(sizeof(LDKChannelHandshakeConfig), "LDKChannelHandshakeConfig");
2003 *ret = ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg);
2004 assert(ret->is_owned);
2005 ret->is_owned = false;
2009 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1default(JNIEnv * _env, jclass _b) {
2010 LDKChannelHandshakeConfig* ret = MALLOC(sizeof(LDKChannelHandshakeConfig), "LDKChannelHandshakeConfig");
2011 *ret = ChannelHandshakeConfig_default();
2012 assert(ret->is_owned);
2013 ret->is_owned = false;
2017 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2018 LDKChannelHandshakeLimits this_ptr_conv = *(LDKChannelHandshakeLimits*)this_ptr;
2019 FREE((void*)this_ptr);
2020 this_ptr_conv.is_owned = true;
2021 return ChannelHandshakeLimits_free(this_ptr_conv);
2024 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
2025 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2026 return ChannelHandshakeLimits_get_min_funding_satoshis(this_ptr_conv);
2029 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2030 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2031 return ChannelHandshakeLimits_set_min_funding_satoshis(this_ptr_conv, val);
2034 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
2035 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2036 return ChannelHandshakeLimits_get_max_htlc_minimum_msat(this_ptr_conv);
2039 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2040 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2041 return ChannelHandshakeLimits_set_max_htlc_minimum_msat(this_ptr_conv, val);
2044 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
2045 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2046 return ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(this_ptr_conv);
2049 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) {
2050 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2051 return ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(this_ptr_conv, val);
2054 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
2055 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2056 return ChannelHandshakeLimits_get_max_channel_reserve_satoshis(this_ptr_conv);
2059 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2060 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2061 return ChannelHandshakeLimits_set_max_channel_reserve_satoshis(this_ptr_conv, val);
2064 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr) {
2065 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2066 return ChannelHandshakeLimits_get_min_max_accepted_htlcs(this_ptr_conv);
2069 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
2070 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2071 return ChannelHandshakeLimits_set_min_max_accepted_htlcs(this_ptr_conv, val);
2074 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
2075 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2076 return ChannelHandshakeLimits_get_min_dust_limit_satoshis(this_ptr_conv);
2079 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2080 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2081 return ChannelHandshakeLimits_set_min_dust_limit_satoshis(this_ptr_conv, val);
2084 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
2085 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2086 return ChannelHandshakeLimits_get_max_dust_limit_satoshis(this_ptr_conv);
2089 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2090 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2091 return ChannelHandshakeLimits_set_max_dust_limit_satoshis(this_ptr_conv, val);
2094 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr) {
2095 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2096 return ChannelHandshakeLimits_get_max_minimum_depth(this_ptr_conv);
2099 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
2100 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2101 return ChannelHandshakeLimits_set_max_minimum_depth(this_ptr_conv, val);
2104 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1force_1announced_1channel_1preference(JNIEnv * _env, jclass _b, jlong this_ptr) {
2105 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2106 return ChannelHandshakeLimits_get_force_announced_channel_preference(this_ptr_conv);
2109 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1force_1announced_1channel_1preference(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
2110 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2111 return ChannelHandshakeLimits_set_force_announced_channel_preference(this_ptr_conv, val);
2114 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1their_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
2115 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2116 return ChannelHandshakeLimits_get_their_to_self_delay(this_ptr_conv);
2119 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1their_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
2120 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2121 return ChannelHandshakeLimits_set_their_to_self_delay(this_ptr_conv, val);
2124 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) {
2125 LDKChannelHandshakeLimits* ret = MALLOC(sizeof(LDKChannelHandshakeLimits), "LDKChannelHandshakeLimits");
2126 *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);
2127 assert(ret->is_owned);
2128 ret->is_owned = false;
2132 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1default(JNIEnv * _env, jclass _b) {
2133 LDKChannelHandshakeLimits* ret = MALLOC(sizeof(LDKChannelHandshakeLimits), "LDKChannelHandshakeLimits");
2134 *ret = ChannelHandshakeLimits_default();
2135 assert(ret->is_owned);
2136 ret->is_owned = false;
2140 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2141 LDKChannelConfig this_ptr_conv = *(LDKChannelConfig*)this_ptr;
2142 FREE((void*)this_ptr);
2143 this_ptr_conv.is_owned = true;
2144 return ChannelConfig_free(this_ptr_conv);
2147 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr) {
2148 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
2149 return ChannelConfig_get_fee_proportional_millionths(this_ptr_conv);
2152 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
2153 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
2154 return ChannelConfig_set_fee_proportional_millionths(this_ptr_conv, val);
2157 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1announced_1channel(JNIEnv * _env, jclass _b, jlong this_ptr) {
2158 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
2159 return ChannelConfig_get_announced_channel(this_ptr_conv);
2162 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1announced_1channel(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
2163 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
2164 return ChannelConfig_set_announced_channel(this_ptr_conv, val);
2167 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1commit_1upfront_1shutdown_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
2168 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
2169 return ChannelConfig_get_commit_upfront_shutdown_pubkey(this_ptr_conv);
2172 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1commit_1upfront_1shutdown_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
2173 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
2174 return ChannelConfig_set_commit_upfront_shutdown_pubkey(this_ptr_conv, val);
2177 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) {
2178 LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
2179 *ret = ChannelConfig_new(fee_proportional_millionths_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg);
2180 assert(ret->is_owned);
2181 ret->is_owned = false;
2185 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1default(JNIEnv * _env, jclass _b) {
2186 LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
2187 *ret = ChannelConfig_default();
2188 assert(ret->is_owned);
2189 ret->is_owned = false;
2193 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1write(JNIEnv * _env, jclass _b, jlong obj) {
2194 LDKChannelConfig* obj_conv = (LDKChannelConfig*)obj;
2195 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
2196 *ret = ChannelConfig_write(obj_conv);
2200 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1read(JNIEnv * _env, jclass _b, jlong ser) {
2201 LDKu8slice ser_conv = *(LDKu8slice*)ser;
2203 LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
2204 *ret = ChannelConfig_read(ser_conv);
2205 assert(ret->is_owned);
2206 ret->is_owned = false;
2210 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2211 LDKUserConfig this_ptr_conv = *(LDKUserConfig*)this_ptr;
2212 FREE((void*)this_ptr);
2213 this_ptr_conv.is_owned = true;
2214 return UserConfig_free(this_ptr_conv);
2217 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1own_1channel_1config(JNIEnv * _env, jclass _b, jlong this_ptr) {
2218 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
2219 LDKChannelHandshakeConfig* ret = MALLOC(sizeof(LDKChannelHandshakeConfig), "LDKChannelHandshakeConfig");
2220 *ret = UserConfig_get_own_channel_config(this_ptr_conv);
2221 assert(ret->is_owned);
2222 ret->is_owned = false;
2226 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1own_1channel_1config(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2227 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
2228 LDKChannelHandshakeConfig val_conv = *(LDKChannelHandshakeConfig*)val;
2230 val_conv.is_owned = true;
2231 return UserConfig_set_own_channel_config(this_ptr_conv, val_conv);
2234 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1peer_1channel_1config_1limits(JNIEnv * _env, jclass _b, jlong this_ptr) {
2235 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
2236 LDKChannelHandshakeLimits* ret = MALLOC(sizeof(LDKChannelHandshakeLimits), "LDKChannelHandshakeLimits");
2237 *ret = UserConfig_get_peer_channel_config_limits(this_ptr_conv);
2238 assert(ret->is_owned);
2239 ret->is_owned = false;
2243 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1peer_1channel_1config_1limits(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2244 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
2245 LDKChannelHandshakeLimits val_conv = *(LDKChannelHandshakeLimits*)val;
2247 val_conv.is_owned = true;
2248 return UserConfig_set_peer_channel_config_limits(this_ptr_conv, val_conv);
2251 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1channel_1options(JNIEnv * _env, jclass _b, jlong this_ptr) {
2252 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
2253 LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
2254 *ret = UserConfig_get_channel_options(this_ptr_conv);
2255 assert(ret->is_owned);
2256 ret->is_owned = false;
2260 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1channel_1options(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2261 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
2262 LDKChannelConfig val_conv = *(LDKChannelConfig*)val;
2264 val_conv.is_owned = true;
2265 return UserConfig_set_channel_options(this_ptr_conv, val_conv);
2268 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) {
2269 LDKChannelHandshakeConfig own_channel_config_arg_conv = *(LDKChannelHandshakeConfig*)own_channel_config_arg;
2270 FREE((void*)own_channel_config_arg);
2271 own_channel_config_arg_conv.is_owned = true;
2272 LDKChannelHandshakeLimits peer_channel_config_limits_arg_conv = *(LDKChannelHandshakeLimits*)peer_channel_config_limits_arg;
2273 FREE((void*)peer_channel_config_limits_arg);
2274 peer_channel_config_limits_arg_conv.is_owned = true;
2275 LDKChannelConfig channel_options_arg_conv = *(LDKChannelConfig*)channel_options_arg;
2276 FREE((void*)channel_options_arg);
2277 channel_options_arg_conv.is_owned = true;
2278 LDKUserConfig* ret = MALLOC(sizeof(LDKUserConfig), "LDKUserConfig");
2279 *ret = UserConfig_new(own_channel_config_arg_conv, peer_channel_config_limits_arg_conv, channel_options_arg_conv);
2280 assert(ret->is_owned);
2281 ret->is_owned = false;
2285 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1default(JNIEnv * _env, jclass _b) {
2286 LDKUserConfig* ret = MALLOC(sizeof(LDKUserConfig), "LDKUserConfig");
2287 *ret = UserConfig_default();
2288 assert(ret->is_owned);
2289 ret->is_owned = false;
2293 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Access_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2294 LDKAccess this_ptr_conv = *(LDKAccess*)this_ptr;
2295 FREE((void*)this_ptr);
2296 return Access_free(this_ptr_conv);
2299 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Watch_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2300 LDKWatch this_ptr_conv = *(LDKWatch*)this_ptr;
2301 FREE((void*)this_ptr);
2302 return Watch_free(this_ptr_conv);
2305 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2306 LDKFilter this_ptr_conv = *(LDKFilter*)this_ptr;
2307 FREE((void*)this_ptr);
2308 return Filter_free(this_ptr_conv);
2311 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2312 LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)this_ptr;
2313 FREE((void*)this_ptr);
2314 return BroadcasterInterface_free(this_ptr_conv);
2317 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2318 LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)this_ptr;
2319 FREE((void*)this_ptr);
2320 return FeeEstimator_free(this_ptr_conv);
2323 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2324 LDKChainMonitor this_ptr_conv = *(LDKChainMonitor*)this_ptr;
2325 FREE((void*)this_ptr);
2326 this_ptr_conv.is_owned = true;
2327 return ChainMonitor_free(this_ptr_conv);
2330 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1block_1connected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jlong txdata, jint height) {
2331 LDKChainMonitor* this_arg_conv = (LDKChainMonitor*)this_arg;
2332 unsigned char header_arr[80];
2333 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
2334 unsigned char (*header_ref)[80] = &header_arr;
2335 LDKCVec_C2Tuple_usizeTransactionZZ txdata_conv = *(LDKCVec_C2Tuple_usizeTransactionZZ*)txdata;
2336 FREE((void*)txdata);
2337 return ChainMonitor_block_connected(this_arg_conv, header_ref, txdata_conv, height);
2340 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1block_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jint disconnected_height) {
2341 LDKChainMonitor* this_arg_conv = (LDKChainMonitor*)this_arg;
2342 unsigned char header_arr[80];
2343 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
2344 unsigned char (*header_ref)[80] = &header_arr;
2345 return ChainMonitor_block_disconnected(this_arg_conv, header_ref, disconnected_height);
2348 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1new(JNIEnv * _env, jclass _b, jlong chain_source, jlong broadcaster, jlong logger, jlong feeest) {
2349 LDKFilter* chain_source_conv = (LDKFilter*)chain_source;
2350 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)broadcaster;
2351 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
2352 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2353 LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
2355 LDKLogger logger_conv = *(LDKLogger*)logger;
2356 if (logger_conv.free == LDKLogger_JCalls_free) {
2357 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2358 LDKLogger_JCalls_clone(logger_conv.this_arg);
2360 LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)feeest;
2361 if (feeest_conv.free == LDKFeeEstimator_JCalls_free) {
2362 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2363 LDKFeeEstimator_JCalls_clone(feeest_conv.this_arg);
2365 LDKChainMonitor* ret = MALLOC(sizeof(LDKChainMonitor), "LDKChainMonitor");
2366 *ret = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv);
2367 assert(ret->is_owned);
2368 ret->is_owned = false;
2372 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Watch(JNIEnv * _env, jclass _b, jlong this_arg) {
2373 LDKChainMonitor* this_arg_conv = (LDKChainMonitor*)this_arg;
2374 LDKWatch* ret = MALLOC(sizeof(LDKWatch), "LDKWatch");
2375 *ret = ChainMonitor_as_Watch(this_arg_conv);
2379 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1EventsProvider(JNIEnv * _env, jclass _b, jlong this_arg) {
2380 LDKChainMonitor* this_arg_conv = (LDKChainMonitor*)this_arg;
2381 LDKEventsProvider* ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
2382 *ret = ChainMonitor_as_EventsProvider(this_arg_conv);
2386 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2387 LDKChannelMonitorUpdate this_ptr_conv = *(LDKChannelMonitorUpdate*)this_ptr;
2388 FREE((void*)this_ptr);
2389 this_ptr_conv.is_owned = true;
2390 return ChannelMonitorUpdate_free(this_ptr_conv);
2393 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1get_1update_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
2394 LDKChannelMonitorUpdate* this_ptr_conv = (LDKChannelMonitorUpdate*)this_ptr;
2395 return ChannelMonitorUpdate_get_update_id(this_ptr_conv);
2398 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1set_1update_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2399 LDKChannelMonitorUpdate* this_ptr_conv = (LDKChannelMonitorUpdate*)this_ptr;
2400 return ChannelMonitorUpdate_set_update_id(this_ptr_conv, val);
2403 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
2404 LDKChannelMonitorUpdate* obj_conv = (LDKChannelMonitorUpdate*)obj;
2405 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
2406 *ret = ChannelMonitorUpdate_write(obj_conv);
2410 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
2411 LDKu8slice ser_conv = *(LDKu8slice*)ser;
2413 LDKChannelMonitorUpdate* ret = MALLOC(sizeof(LDKChannelMonitorUpdate), "LDKChannelMonitorUpdate");
2414 *ret = ChannelMonitorUpdate_read(ser_conv);
2415 assert(ret->is_owned);
2416 ret->is_owned = false;
2420 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2421 LDKMonitorUpdateError this_ptr_conv = *(LDKMonitorUpdateError*)this_ptr;
2422 FREE((void*)this_ptr);
2423 this_ptr_conv.is_owned = true;
2424 return MonitorUpdateError_free(this_ptr_conv);
2427 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2428 LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)this_ptr;
2429 FREE((void*)this_ptr);
2430 this_ptr_conv.is_owned = true;
2431 return MonitorEvent_free(this_ptr_conv);
2434 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2435 LDKHTLCUpdate this_ptr_conv = *(LDKHTLCUpdate*)this_ptr;
2436 FREE((void*)this_ptr);
2437 this_ptr_conv.is_owned = true;
2438 return HTLCUpdate_free(this_ptr_conv);
2441 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
2442 LDKHTLCUpdate* obj_conv = (LDKHTLCUpdate*)obj;
2443 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
2444 *ret = HTLCUpdate_write(obj_conv);
2448 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
2449 LDKu8slice ser_conv = *(LDKu8slice*)ser;
2451 LDKHTLCUpdate* ret = MALLOC(sizeof(LDKHTLCUpdate), "LDKHTLCUpdate");
2452 *ret = HTLCUpdate_read(ser_conv);
2453 assert(ret->is_owned);
2454 ret->is_owned = false;
2458 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2459 LDKChannelMonitor this_ptr_conv = *(LDKChannelMonitor*)this_ptr;
2460 FREE((void*)this_ptr);
2461 this_ptr_conv.is_owned = true;
2462 return ChannelMonitor_free(this_ptr_conv);
2465 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1update_1monitor(JNIEnv * _env, jclass _b, jlong this_arg, jlong updates, jlong broadcaster, jlong logger) {
2466 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2467 LDKChannelMonitorUpdate updates_conv = *(LDKChannelMonitorUpdate*)updates;
2468 FREE((void*)updates);
2469 updates_conv.is_owned = true;
2470 LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster;
2471 LDKLogger* logger_conv = (LDKLogger*)logger;
2472 LDKCResult_NoneMonitorUpdateErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
2473 *ret = ChannelMonitor_update_monitor(this_arg_conv, updates_conv, broadcaster_conv, logger_conv);
2477 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1update_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
2478 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2479 return ChannelMonitor_get_latest_update_id(this_arg_conv);
2482 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1funding_1txo(JNIEnv * _env, jclass _b, jlong this_arg) {
2483 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2484 LDKC2Tuple_OutPointScriptZ* ret = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
2485 *ret = ChannelMonitor_get_funding_txo(this_arg_conv);
2489 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1monitor_1events(JNIEnv * _env, jclass _b, jlong this_arg) {
2490 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2491 LDKCVec_MonitorEventZ* ret = MALLOC(sizeof(LDKCVec_MonitorEventZ), "LDKCVec_MonitorEventZ");
2492 *ret = ChannelMonitor_get_and_clear_pending_monitor_events(this_arg_conv);
2496 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1events(JNIEnv * _env, jclass _b, jlong this_arg) {
2497 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2498 LDKCVec_EventZ* ret = MALLOC(sizeof(LDKCVec_EventZ), "LDKCVec_EventZ");
2499 *ret = ChannelMonitor_get_and_clear_pending_events(this_arg_conv);
2503 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1holder_1commitment_1txn(JNIEnv * _env, jclass _b, jlong this_arg, jlong logger) {
2504 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2505 LDKLogger* logger_conv = (LDKLogger*)logger;
2506 LDKCVec_TransactionZ* ret = MALLOC(sizeof(LDKCVec_TransactionZ), "LDKCVec_TransactionZ");
2507 *ret = ChannelMonitor_get_latest_holder_commitment_txn(this_arg_conv, logger_conv);
2511 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_1connected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jlong txdata, jint height, jlong broadcaster, jlong fee_estimator, jlong logger) {
2512 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2513 unsigned char header_arr[80];
2514 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
2515 unsigned char (*header_ref)[80] = &header_arr;
2516 LDKCVec_C2Tuple_usizeTransactionZZ txdata_conv = *(LDKCVec_C2Tuple_usizeTransactionZZ*)txdata;
2517 FREE((void*)txdata);
2518 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)broadcaster;
2519 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
2520 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2521 LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
2523 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)fee_estimator;
2524 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
2525 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2526 LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
2528 LDKLogger logger_conv = *(LDKLogger*)logger;
2529 if (logger_conv.free == LDKLogger_JCalls_free) {
2530 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2531 LDKLogger_JCalls_clone(logger_conv.this_arg);
2533 LDKCVec_C2Tuple_TxidCVec_TxOutZZZ* ret = MALLOC(sizeof(LDKCVec_C2Tuple_TxidCVec_TxOutZZZ), "LDKCVec_C2Tuple_TxidCVec_TxOutZZZ");
2534 *ret = ChannelMonitor_block_connected(this_arg_conv, header_ref, txdata_conv, height, broadcaster_conv, fee_estimator_conv, logger_conv);
2538 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1block_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jint height, jlong broadcaster, jlong fee_estimator, jlong logger) {
2539 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2540 unsigned char header_arr[80];
2541 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
2542 unsigned char (*header_ref)[80] = &header_arr;
2543 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)broadcaster;
2544 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
2545 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2546 LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
2548 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)fee_estimator;
2549 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
2550 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2551 LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
2553 LDKLogger logger_conv = *(LDKLogger*)logger;
2554 if (logger_conv.free == LDKLogger_JCalls_free) {
2555 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2556 LDKLogger_JCalls_clone(logger_conv.this_arg);
2558 return ChannelMonitor_block_disconnected(this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
2561 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2562 LDKOutPoint this_ptr_conv = *(LDKOutPoint*)this_ptr;
2563 FREE((void*)this_ptr);
2564 this_ptr_conv.is_owned = true;
2565 return OutPoint_free(this_ptr_conv);
2568 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1txid(JNIEnv * _env, jclass _b, jlong this_ptr) {
2569 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
2570 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2571 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OutPoint_get_txid(this_ptr_conv));
2575 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1txid(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2576 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
2577 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
2579 return OutPoint_set_txid(this_ptr_conv, val_conv);
2582 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1index(JNIEnv * _env, jclass _b, jlong this_ptr) {
2583 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
2584 return OutPoint_get_index(this_ptr_conv);
2587 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1index(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
2588 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
2589 return OutPoint_set_index(this_ptr_conv, val);
2592 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1new(JNIEnv * _env, jclass _b, jlong txid_arg, jshort index_arg) {
2593 LDKThirtyTwoBytes txid_arg_conv = *(LDKThirtyTwoBytes*)txid_arg;
2594 FREE((void*)txid_arg);
2595 LDKOutPoint* ret = MALLOC(sizeof(LDKOutPoint), "LDKOutPoint");
2596 *ret = OutPoint_new(txid_arg_conv, index_arg);
2597 assert(ret->is_owned);
2598 ret->is_owned = false;
2602 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1to_1channel_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
2603 LDKOutPoint* this_arg_conv = (LDKOutPoint*)this_arg;
2604 LDKThirtyTwoBytes* ret = MALLOC(sizeof(LDKThirtyTwoBytes), "LDKThirtyTwoBytes");
2605 *ret = OutPoint_to_channel_id(this_arg_conv);
2609 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1write(JNIEnv * _env, jclass _b, jlong obj) {
2610 LDKOutPoint* obj_conv = (LDKOutPoint*)obj;
2611 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
2612 *ret = OutPoint_write(obj_conv);
2616 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1read(JNIEnv * _env, jclass _b, jlong ser) {
2617 LDKu8slice ser_conv = *(LDKu8slice*)ser;
2619 LDKOutPoint* ret = MALLOC(sizeof(LDKOutPoint), "LDKOutPoint");
2620 *ret = OutPoint_read(ser_conv);
2621 assert(ret->is_owned);
2622 ret->is_owned = false;
2626 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2627 LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)this_ptr;
2628 FREE((void*)this_ptr);
2629 return SpendableOutputDescriptor_free(this_ptr_conv);
2632 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2633 LDKChannelKeys this_ptr_conv = *(LDKChannelKeys*)this_ptr;
2634 FREE((void*)this_ptr);
2635 return ChannelKeys_free(this_ptr_conv);
2638 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysInterface_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2639 LDKKeysInterface this_ptr_conv = *(LDKKeysInterface*)this_ptr;
2640 FREE((void*)this_ptr);
2641 return KeysInterface_free(this_ptr_conv);
2644 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2645 LDKInMemoryChannelKeys this_ptr_conv = *(LDKInMemoryChannelKeys*)this_ptr;
2646 FREE((void*)this_ptr);
2647 this_ptr_conv.is_owned = true;
2648 return InMemoryChannelKeys_free(this_ptr_conv);
2651 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1funding_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
2652 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2653 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2654 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_funding_key(this_ptr_conv));
2658 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1funding_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2659 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2660 LDKSecretKey val_conv = *(LDKSecretKey*)val;
2662 return InMemoryChannelKeys_set_funding_key(this_ptr_conv, val_conv);
2665 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1revocation_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
2666 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2667 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2668 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_revocation_base_key(this_ptr_conv));
2672 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1revocation_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2673 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2674 LDKSecretKey val_conv = *(LDKSecretKey*)val;
2676 return InMemoryChannelKeys_set_revocation_base_key(this_ptr_conv, val_conv);
2679 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
2680 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2681 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2682 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_payment_key(this_ptr_conv));
2686 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2687 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2688 LDKSecretKey val_conv = *(LDKSecretKey*)val;
2690 return InMemoryChannelKeys_set_payment_key(this_ptr_conv, val_conv);
2693 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1delayed_1payment_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
2694 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2695 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2696 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_delayed_payment_base_key(this_ptr_conv));
2700 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1delayed_1payment_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2701 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2702 LDKSecretKey val_conv = *(LDKSecretKey*)val;
2704 return InMemoryChannelKeys_set_delayed_payment_base_key(this_ptr_conv, val_conv);
2707 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1htlc_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
2708 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2709 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2710 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_htlc_base_key(this_ptr_conv));
2714 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1htlc_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2715 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2716 LDKSecretKey val_conv = *(LDKSecretKey*)val;
2718 return InMemoryChannelKeys_set_htlc_base_key(this_ptr_conv, val_conv);
2721 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1commitment_1seed(JNIEnv * _env, jclass _b, jlong this_ptr) {
2722 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2723 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2724 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_commitment_seed(this_ptr_conv));
2728 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1commitment_1seed(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2729 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2730 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
2732 return InMemoryChannelKeys_set_commitment_seed(this_ptr_conv, val_conv);
2735 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) {
2736 LDKSecretKey funding_key_conv = *(LDKSecretKey*)funding_key;
2737 FREE((void*)funding_key);
2738 LDKSecretKey revocation_base_key_conv = *(LDKSecretKey*)revocation_base_key;
2739 FREE((void*)revocation_base_key);
2740 LDKSecretKey payment_key_conv = *(LDKSecretKey*)payment_key;
2741 FREE((void*)payment_key);
2742 LDKSecretKey delayed_payment_base_key_conv = *(LDKSecretKey*)delayed_payment_base_key;
2743 FREE((void*)delayed_payment_base_key);
2744 LDKSecretKey htlc_base_key_conv = *(LDKSecretKey*)htlc_base_key;
2745 FREE((void*)htlc_base_key);
2746 LDKThirtyTwoBytes commitment_seed_conv = *(LDKThirtyTwoBytes*)commitment_seed;
2747 FREE((void*)commitment_seed);
2748 LDKC2Tuple_u64u64Z key_derivation_params_conv = *(LDKC2Tuple_u64u64Z*)key_derivation_params;
2749 FREE((void*)key_derivation_params);
2750 LDKInMemoryChannelKeys* ret = MALLOC(sizeof(LDKInMemoryChannelKeys), "LDKInMemoryChannelKeys");
2751 *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);
2752 assert(ret->is_owned);
2753 ret->is_owned = false;
2757 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1counterparty_1pubkeys(JNIEnv * _env, jclass _b, jlong this_arg) {
2758 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
2759 LDKChannelPublicKeys* ret = MALLOC(sizeof(LDKChannelPublicKeys), "LDKChannelPublicKeys");
2760 *ret = InMemoryChannelKeys_counterparty_pubkeys(this_arg_conv);
2761 assert(ret->is_owned);
2762 ret->is_owned = false;
2766 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1counterparty_1selected_1contest_1delay(JNIEnv * _env, jclass _b, jlong this_arg) {
2767 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
2768 return InMemoryChannelKeys_counterparty_selected_contest_delay(this_arg_conv);
2771 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1holder_1selected_1contest_1delay(JNIEnv * _env, jclass _b, jlong this_arg) {
2772 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
2773 return InMemoryChannelKeys_holder_selected_contest_delay(this_arg_conv);
2776 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1as_1ChannelKeys(JNIEnv * _env, jclass _b, jlong this_arg) {
2777 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
2778 LDKChannelKeys* ret = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys");
2779 *ret = InMemoryChannelKeys_as_ChannelKeys(this_arg_conv);
2783 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1write(JNIEnv * _env, jclass _b, jlong obj) {
2784 LDKInMemoryChannelKeys* obj_conv = (LDKInMemoryChannelKeys*)obj;
2785 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
2786 *ret = InMemoryChannelKeys_write(obj_conv);
2790 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1read(JNIEnv * _env, jclass _b, jlong ser) {
2791 LDKu8slice ser_conv = *(LDKu8slice*)ser;
2793 LDKInMemoryChannelKeys* ret = MALLOC(sizeof(LDKInMemoryChannelKeys), "LDKInMemoryChannelKeys");
2794 *ret = InMemoryChannelKeys_read(ser_conv);
2795 assert(ret->is_owned);
2796 ret->is_owned = false;
2800 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysManager_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2801 LDKKeysManager this_ptr_conv = *(LDKKeysManager*)this_ptr;
2802 FREE((void*)this_ptr);
2803 this_ptr_conv.is_owned = true;
2804 return KeysManager_free(this_ptr_conv);
2807 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1new(JNIEnv * _env, jclass _b, jbyteArray seed, jclass network, jlong starting_time_secs, jint starting_time_nanos) {
2808 unsigned char seed_arr[32];
2809 (*_env)->GetByteArrayRegion (_env, seed, 0, 32, seed_arr);
2810 unsigned char (*seed_ref)[32] = &seed_arr;
2811 LDKNetwork network_conv = LDKNetwork_from_java(_env, network);
2812 LDKKeysManager* ret = MALLOC(sizeof(LDKKeysManager), "LDKKeysManager");
2813 *ret = KeysManager_new(seed_ref, network_conv, starting_time_secs, starting_time_nanos);
2814 assert(ret->is_owned);
2815 ret->is_owned = false;
2819 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) {
2820 LDKKeysManager* this_arg_conv = (LDKKeysManager*)this_arg;
2821 LDKInMemoryChannelKeys* ret = MALLOC(sizeof(LDKInMemoryChannelKeys), "LDKInMemoryChannelKeys");
2822 *ret = KeysManager_derive_channel_keys(this_arg_conv, channel_value_satoshis, params_1, params_2);
2823 assert(ret->is_owned);
2824 ret->is_owned = false;
2828 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1KeysInterface(JNIEnv * _env, jclass _b, jlong this_arg) {
2829 LDKKeysManager* this_arg_conv = (LDKKeysManager*)this_arg;
2830 LDKKeysInterface* ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
2831 *ret = KeysManager_as_KeysInterface(this_arg_conv);
2835 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2836 LDKChannelManager this_ptr_conv = *(LDKChannelManager*)this_ptr;
2837 FREE((void*)this_ptr);
2838 this_ptr_conv.is_owned = true;
2839 return ChannelManager_free(this_ptr_conv);
2842 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2843 LDKChannelDetails this_ptr_conv = *(LDKChannelDetails*)this_ptr;
2844 FREE((void*)this_ptr);
2845 this_ptr_conv.is_owned = true;
2846 return ChannelDetails_free(this_ptr_conv);
2849 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
2850 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2851 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2852 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ChannelDetails_get_channel_id(this_ptr_conv));
2856 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2857 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2858 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
2860 return ChannelDetails_set_channel_id(this_ptr_conv, val_conv);
2863 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1remote_1network_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
2864 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2865 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
2866 *ret = ChannelDetails_get_remote_network_id(this_ptr_conv);
2870 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1remote_1network_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2871 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2872 LDKPublicKey val_conv = *(LDKPublicKey*)val;
2874 return ChannelDetails_set_remote_network_id(this_ptr_conv, val_conv);
2877 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1counterparty_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
2878 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2879 LDKInitFeatures* ret = MALLOC(sizeof(LDKInitFeatures), "LDKInitFeatures");
2880 *ret = ChannelDetails_get_counterparty_features(this_ptr_conv);
2881 assert(ret->is_owned);
2882 ret->is_owned = false;
2886 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1counterparty_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2887 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2888 LDKInitFeatures val_conv = *(LDKInitFeatures*)val;
2890 val_conv.is_owned = true;
2891 return ChannelDetails_set_counterparty_features(this_ptr_conv, val_conv);
2894 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1value_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
2895 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2896 return ChannelDetails_get_channel_value_satoshis(this_ptr_conv);
2899 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1value_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2900 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2901 return ChannelDetails_set_channel_value_satoshis(this_ptr_conv, val);
2904 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1user_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
2905 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2906 return ChannelDetails_get_user_id(this_ptr_conv);
2909 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1user_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2910 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2911 return ChannelDetails_set_user_id(this_ptr_conv, val);
2914 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
2915 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2916 return ChannelDetails_get_outbound_capacity_msat(this_ptr_conv);
2919 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1outbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2920 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2921 return ChannelDetails_set_outbound_capacity_msat(this_ptr_conv, val);
2924 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
2925 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2926 return ChannelDetails_get_inbound_capacity_msat(this_ptr_conv);
2929 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2930 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2931 return ChannelDetails_set_inbound_capacity_msat(this_ptr_conv, val);
2934 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1live(JNIEnv * _env, jclass _b, jlong this_ptr) {
2935 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2936 return ChannelDetails_get_is_live(this_ptr_conv);
2939 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1live(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
2940 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2941 return ChannelDetails_set_is_live(this_ptr_conv, val);
2944 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2945 LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)this_ptr;
2946 FREE((void*)this_ptr);
2947 this_ptr_conv.is_owned = true;
2948 return PaymentSendFailure_free(this_ptr_conv);
2951 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1new(JNIEnv * _env, jclass _b, jclass network, jlong fee_est, jlong chain_monitor, jlong tx_broadcaster, jlong logger, jlong keys_manager, jlong config, jlong current_blockchain_height) {
2952 LDKNetwork network_conv = LDKNetwork_from_java(_env, network);
2953 LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)fee_est;
2954 if (fee_est_conv.free == LDKFeeEstimator_JCalls_free) {
2955 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2956 LDKFeeEstimator_JCalls_clone(fee_est_conv.this_arg);
2958 LDKWatch chain_monitor_conv = *(LDKWatch*)chain_monitor;
2959 if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
2960 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2961 LDKWatch_JCalls_clone(chain_monitor_conv.this_arg);
2963 LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)tx_broadcaster;
2964 if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
2965 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2966 LDKBroadcasterInterface_JCalls_clone(tx_broadcaster_conv.this_arg);
2968 LDKLogger logger_conv = *(LDKLogger*)logger;
2969 if (logger_conv.free == LDKLogger_JCalls_free) {
2970 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2971 LDKLogger_JCalls_clone(logger_conv.this_arg);
2973 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)keys_manager;
2974 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
2975 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2976 LDKKeysInterface_JCalls_clone(keys_manager_conv.this_arg);
2978 LDKUserConfig config_conv = *(LDKUserConfig*)config;
2979 FREE((void*)config);
2980 config_conv.is_owned = true;
2981 LDKChannelManager* ret = MALLOC(sizeof(LDKChannelManager), "LDKChannelManager");
2982 *ret = ChannelManager_new(network_conv, fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, keys_manager_conv, config_conv, current_blockchain_height);
2983 assert(ret->is_owned);
2984 ret->is_owned = false;
2988 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) {
2989 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2990 LDKPublicKey their_network_key_conv = *(LDKPublicKey*)their_network_key;
2991 FREE((void*)their_network_key);
2992 LDKUserConfig override_config_conv = *(LDKUserConfig*)override_config;
2993 FREE((void*)override_config);
2994 override_config_conv.is_owned = true;
2995 LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
2996 *ret = ChannelManager_create_channel(this_arg_conv, their_network_key_conv, channel_value_satoshis, push_msat, user_id, override_config_conv);
3000 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
3001 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3002 LDKCVec_ChannelDetailsZ* ret = MALLOC(sizeof(LDKCVec_ChannelDetailsZ), "LDKCVec_ChannelDetailsZ");
3003 *ret = ChannelManager_list_channels(this_arg_conv);
3007 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1usable_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
3008 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3009 LDKCVec_ChannelDetailsZ* ret = MALLOC(sizeof(LDKCVec_ChannelDetailsZ), "LDKCVec_ChannelDetailsZ");
3010 *ret = ChannelManager_list_usable_channels(this_arg_conv);
3014 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray channel_id) {
3015 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3016 unsigned char channel_id_arr[32];
3017 (*_env)->GetByteArrayRegion (_env, channel_id, 0, 32, channel_id_arr);
3018 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
3019 LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
3020 *ret = ChannelManager_close_channel(this_arg_conv, channel_id_ref);
3024 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray channel_id) {
3025 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3026 unsigned char channel_id_arr[32];
3027 (*_env)->GetByteArrayRegion (_env, channel_id, 0, 32, channel_id_arr);
3028 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
3029 return ChannelManager_force_close_channel(this_arg_conv, channel_id_ref);
3032 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1all_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
3033 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3034 return ChannelManager_force_close_all_channels(this_arg_conv);
3037 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) {
3038 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3039 LDKRoute* route_conv = (LDKRoute*)route;
3040 LDKThirtyTwoBytes payment_hash_conv = *(LDKThirtyTwoBytes*)payment_hash;
3041 FREE((void*)payment_hash);
3042 LDKThirtyTwoBytes payment_secret_conv = *(LDKThirtyTwoBytes*)payment_secret;
3043 FREE((void*)payment_secret);
3044 LDKCResult_NonePaymentSendFailureZ* ret = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
3045 *ret = ChannelManager_send_payment(this_arg_conv, route_conv, payment_hash_conv, payment_secret_conv);
3049 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) {
3050 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3051 unsigned char temporary_channel_id_arr[32];
3052 (*_env)->GetByteArrayRegion (_env, temporary_channel_id, 0, 32, temporary_channel_id_arr);
3053 unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
3054 LDKOutPoint funding_txo_conv = *(LDKOutPoint*)funding_txo;
3055 FREE((void*)funding_txo);
3056 funding_txo_conv.is_owned = true;
3057 return ChannelManager_funding_transaction_generated(this_arg_conv, temporary_channel_id_ref, funding_txo_conv);
3060 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) {
3061 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3062 LDKThreeBytes rgb_conv = *(LDKThreeBytes*)rgb;
3064 LDKThirtyTwoBytes alias_conv = *(LDKThirtyTwoBytes*)alias;
3066 LDKCVec_NetAddressZ addresses_conv = *(LDKCVec_NetAddressZ*)addresses;
3067 FREE((void*)addresses);
3068 return ChannelManager_broadcast_node_announcement(this_arg_conv, rgb_conv, alias_conv, addresses_conv);
3071 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1process_1pending_1htlc_1forwards(JNIEnv * _env, jclass _b, jlong this_arg) {
3072 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3073 return ChannelManager_process_pending_htlc_forwards(this_arg_conv);
3076 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1timer_1chan_1freshness_1every_1min(JNIEnv * _env, jclass _b, jlong this_arg) {
3077 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3078 return ChannelManager_timer_chan_freshness_every_min(this_arg_conv);
3081 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) {
3082 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3083 unsigned char payment_hash_arr[32];
3084 (*_env)->GetByteArrayRegion (_env, payment_hash, 0, 32, payment_hash_arr);
3085 unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
3086 LDKThirtyTwoBytes payment_secret_conv = *(LDKThirtyTwoBytes*)payment_secret;
3087 FREE((void*)payment_secret);
3088 return ChannelManager_fail_htlc_backwards(this_arg_conv, payment_hash_ref, payment_secret_conv);
3091 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) {
3092 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3093 LDKThirtyTwoBytes payment_preimage_conv = *(LDKThirtyTwoBytes*)payment_preimage;
3094 FREE((void*)payment_preimage);
3095 LDKThirtyTwoBytes payment_secret_conv = *(LDKThirtyTwoBytes*)payment_secret;
3096 FREE((void*)payment_secret);
3097 return ChannelManager_claim_funds(this_arg_conv, payment_preimage_conv, payment_secret_conv, expected_amount);
3100 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1our_1node_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
3101 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3102 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3103 *ret = ChannelManager_get_our_node_id(this_arg_conv);
3107 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) {
3108 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3109 LDKOutPoint* funding_txo_conv = (LDKOutPoint*)funding_txo;
3110 return ChannelManager_channel_monitor_updated(this_arg_conv, funding_txo_conv, highest_applied_update_id);
3113 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1MessageSendEventsProvider(JNIEnv * _env, jclass _b, jlong this_arg) {
3114 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3115 LDKMessageSendEventsProvider* ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
3116 *ret = ChannelManager_as_MessageSendEventsProvider(this_arg_conv);
3120 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1EventsProvider(JNIEnv * _env, jclass _b, jlong this_arg) {
3121 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3122 LDKEventsProvider* ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
3123 *ret = ChannelManager_as_EventsProvider(this_arg_conv);
3127 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1block_1connected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jlong txdata, jint height) {
3128 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3129 unsigned char header_arr[80];
3130 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
3131 unsigned char (*header_ref)[80] = &header_arr;
3132 LDKCVec_C2Tuple_usizeTransactionZZ txdata_conv = *(LDKCVec_C2Tuple_usizeTransactionZZ*)txdata;
3133 FREE((void*)txdata);
3134 return ChannelManager_block_connected(this_arg_conv, header_ref, txdata_conv, height);
3137 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1block_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header) {
3138 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3139 unsigned char header_arr[80];
3140 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
3141 unsigned char (*header_ref)[80] = &header_arr;
3142 return ChannelManager_block_disconnected(this_arg_conv, header_ref);
3145 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1ChannelMessageHandler(JNIEnv * _env, jclass _b, jlong this_arg) {
3146 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3147 LDKChannelMessageHandler* ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
3148 *ret = ChannelManager_as_ChannelMessageHandler(this_arg_conv);
3152 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3153 LDKChannelManagerReadArgs this_ptr_conv = *(LDKChannelManagerReadArgs*)this_ptr;
3154 FREE((void*)this_ptr);
3155 this_ptr_conv.is_owned = true;
3156 return ChannelManagerReadArgs_free(this_ptr_conv);
3159 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1keys_1manager(JNIEnv * _env, jclass _b, jlong this_ptr) {
3160 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3161 long ret = (long)ChannelManagerReadArgs_get_keys_manager(this_ptr_conv);
3165 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1keys_1manager(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3166 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3167 LDKKeysInterface val_conv = *(LDKKeysInterface*)val;
3168 if (val_conv.free == LDKKeysInterface_JCalls_free) {
3169 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3170 LDKKeysInterface_JCalls_clone(val_conv.this_arg);
3172 return ChannelManagerReadArgs_set_keys_manager(this_ptr_conv, val_conv);
3175 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1fee_1estimator(JNIEnv * _env, jclass _b, jlong this_ptr) {
3176 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3177 long ret = (long)ChannelManagerReadArgs_get_fee_estimator(this_ptr_conv);
3181 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1fee_1estimator(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3182 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3183 LDKFeeEstimator val_conv = *(LDKFeeEstimator*)val;
3184 if (val_conv.free == LDKFeeEstimator_JCalls_free) {
3185 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3186 LDKFeeEstimator_JCalls_clone(val_conv.this_arg);
3188 return ChannelManagerReadArgs_set_fee_estimator(this_ptr_conv, val_conv);
3191 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1chain_1monitor(JNIEnv * _env, jclass _b, jlong this_ptr) {
3192 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3193 long ret = (long)ChannelManagerReadArgs_get_chain_monitor(this_ptr_conv);
3197 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1chain_1monitor(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3198 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3199 LDKWatch val_conv = *(LDKWatch*)val;
3200 if (val_conv.free == LDKWatch_JCalls_free) {
3201 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3202 LDKWatch_JCalls_clone(val_conv.this_arg);
3204 return ChannelManagerReadArgs_set_chain_monitor(this_ptr_conv, val_conv);
3207 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1tx_1broadcaster(JNIEnv * _env, jclass _b, jlong this_ptr) {
3208 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3209 long ret = (long)ChannelManagerReadArgs_get_tx_broadcaster(this_ptr_conv);
3213 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1tx_1broadcaster(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3214 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3215 LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)val;
3216 if (val_conv.free == LDKBroadcasterInterface_JCalls_free) {
3217 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3218 LDKBroadcasterInterface_JCalls_clone(val_conv.this_arg);
3220 return ChannelManagerReadArgs_set_tx_broadcaster(this_ptr_conv, val_conv);
3223 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1logger(JNIEnv * _env, jclass _b, jlong this_ptr) {
3224 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3225 long ret = (long)ChannelManagerReadArgs_get_logger(this_ptr_conv);
3229 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1logger(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3230 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3231 LDKLogger val_conv = *(LDKLogger*)val;
3232 if (val_conv.free == LDKLogger_JCalls_free) {
3233 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3234 LDKLogger_JCalls_clone(val_conv.this_arg);
3236 return ChannelManagerReadArgs_set_logger(this_ptr_conv, val_conv);
3239 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1default_1config(JNIEnv * _env, jclass _b, jlong this_ptr) {
3240 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3241 LDKUserConfig* ret = MALLOC(sizeof(LDKUserConfig), "LDKUserConfig");
3242 *ret = ChannelManagerReadArgs_get_default_config(this_ptr_conv);
3243 assert(ret->is_owned);
3244 ret->is_owned = false;
3248 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1default_1config(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3249 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3250 LDKUserConfig val_conv = *(LDKUserConfig*)val;
3252 val_conv.is_owned = true;
3253 return ChannelManagerReadArgs_set_default_config(this_ptr_conv, val_conv);
3256 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1new(JNIEnv * _env, jclass _b, jlong keys_manager, jlong fee_estimator, jlong chain_monitor, jlong tx_broadcaster, jlong logger, jlong default_config, jlong channel_monitors) {
3257 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)keys_manager;
3258 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
3259 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3260 LDKKeysInterface_JCalls_clone(keys_manager_conv.this_arg);
3262 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)fee_estimator;
3263 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
3264 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3265 LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
3267 LDKWatch chain_monitor_conv = *(LDKWatch*)chain_monitor;
3268 if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
3269 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3270 LDKWatch_JCalls_clone(chain_monitor_conv.this_arg);
3272 LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)tx_broadcaster;
3273 if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
3274 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3275 LDKBroadcasterInterface_JCalls_clone(tx_broadcaster_conv.this_arg);
3277 LDKLogger logger_conv = *(LDKLogger*)logger;
3278 if (logger_conv.free == LDKLogger_JCalls_free) {
3279 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3280 LDKLogger_JCalls_clone(logger_conv.this_arg);
3282 LDKUserConfig default_config_conv = *(LDKUserConfig*)default_config;
3283 FREE((void*)default_config);
3284 default_config_conv.is_owned = true;
3285 LDKCVec_ChannelMonitorZ channel_monitors_conv = *(LDKCVec_ChannelMonitorZ*)channel_monitors;
3286 FREE((void*)channel_monitors);
3287 LDKChannelManagerReadArgs* ret = MALLOC(sizeof(LDKChannelManagerReadArgs), "LDKChannelManagerReadArgs");
3288 *ret = ChannelManagerReadArgs_new(keys_manager_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, default_config_conv, channel_monitors_conv);
3289 assert(ret->is_owned);
3290 ret->is_owned = false;
3294 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DecodeError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3295 LDKDecodeError this_ptr_conv = *(LDKDecodeError*)this_ptr;
3296 FREE((void*)this_ptr);
3297 this_ptr_conv.is_owned = true;
3298 return DecodeError_free(this_ptr_conv);
3301 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3302 LDKInit this_ptr_conv = *(LDKInit*)this_ptr;
3303 FREE((void*)this_ptr);
3304 this_ptr_conv.is_owned = true;
3305 return Init_free(this_ptr_conv);
3308 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3309 LDKErrorMessage this_ptr_conv = *(LDKErrorMessage*)this_ptr;
3310 FREE((void*)this_ptr);
3311 this_ptr_conv.is_owned = true;
3312 return ErrorMessage_free(this_ptr_conv);
3315 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3316 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
3317 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3318 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ErrorMessage_get_channel_id(this_ptr_conv));
3322 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3323 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
3324 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3326 return ErrorMessage_set_channel_id(this_ptr_conv, val_conv);
3329 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1data(JNIEnv * _env, jclass _b, jlong this_ptr) {
3330 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
3331 LDKStr* ret = MALLOC(sizeof(LDKStr), "LDKStr");
3332 *ret = ErrorMessage_get_data(this_ptr_conv);
3336 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1data(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3337 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
3338 LDKCVec_u8Z val_conv = *(LDKCVec_u8Z*)val;
3340 return ErrorMessage_set_data(this_ptr_conv, val_conv);
3343 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong data_arg) {
3344 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
3345 FREE((void*)channel_id_arg);
3346 LDKCVec_u8Z data_arg_conv = *(LDKCVec_u8Z*)data_arg;
3347 FREE((void*)data_arg);
3348 LDKErrorMessage* ret = MALLOC(sizeof(LDKErrorMessage), "LDKErrorMessage");
3349 *ret = ErrorMessage_new(channel_id_arg_conv, data_arg_conv);
3350 assert(ret->is_owned);
3351 ret->is_owned = false;
3355 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3356 LDKPing this_ptr_conv = *(LDKPing*)this_ptr;
3357 FREE((void*)this_ptr);
3358 this_ptr_conv.is_owned = true;
3359 return Ping_free(this_ptr_conv);
3362 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Ping_1get_1ponglen(JNIEnv * _env, jclass _b, jlong this_ptr) {
3363 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
3364 return Ping_get_ponglen(this_ptr_conv);
3367 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1ponglen(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3368 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
3369 return Ping_set_ponglen(this_ptr_conv, val);
3372 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Ping_1get_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr) {
3373 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
3374 return Ping_get_byteslen(this_ptr_conv);
3377 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3378 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
3379 return Ping_set_byteslen(this_ptr_conv, val);
3382 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1new(JNIEnv * _env, jclass _b, jshort ponglen_arg, jshort byteslen_arg) {
3383 LDKPing* ret = MALLOC(sizeof(LDKPing), "LDKPing");
3384 *ret = Ping_new(ponglen_arg, byteslen_arg);
3385 assert(ret->is_owned);
3386 ret->is_owned = false;
3390 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3391 LDKPong this_ptr_conv = *(LDKPong*)this_ptr;
3392 FREE((void*)this_ptr);
3393 this_ptr_conv.is_owned = true;
3394 return Pong_free(this_ptr_conv);
3397 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Pong_1get_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr) {
3398 LDKPong* this_ptr_conv = (LDKPong*)this_ptr;
3399 return Pong_get_byteslen(this_ptr_conv);
3402 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1set_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3403 LDKPong* this_ptr_conv = (LDKPong*)this_ptr;
3404 return Pong_set_byteslen(this_ptr_conv, val);
3407 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1new(JNIEnv * _env, jclass _b, jshort byteslen_arg) {
3408 LDKPong* ret = MALLOC(sizeof(LDKPong), "LDKPong");
3409 *ret = Pong_new(byteslen_arg);
3410 assert(ret->is_owned);
3411 ret->is_owned = false;
3415 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3416 LDKOpenChannel this_ptr_conv = *(LDKOpenChannel*)this_ptr;
3417 FREE((void*)this_ptr);
3418 this_ptr_conv.is_owned = true;
3419 return OpenChannel_free(this_ptr_conv);
3422 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
3423 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3424 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3425 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OpenChannel_get_chain_hash(this_ptr_conv));
3429 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3430 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3431 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3433 return OpenChannel_set_chain_hash(this_ptr_conv, val_conv);
3436 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3437 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3438 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3439 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OpenChannel_get_temporary_channel_id(this_ptr_conv));
3443 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3444 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3445 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3447 return OpenChannel_set_temporary_channel_id(this_ptr_conv, val_conv);
3450 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3451 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3452 return OpenChannel_get_funding_satoshis(this_ptr_conv);
3455 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3456 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3457 return OpenChannel_set_funding_satoshis(this_ptr_conv, val);
3460 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1push_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3461 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3462 return OpenChannel_get_push_msat(this_ptr_conv);
3465 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1push_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3466 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3467 return OpenChannel_set_push_msat(this_ptr_conv, val);
3470 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3471 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3472 return OpenChannel_get_dust_limit_satoshis(this_ptr_conv);
3475 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3476 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3477 return OpenChannel_set_dust_limit_satoshis(this_ptr_conv, val);
3480 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3481 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3482 return OpenChannel_get_max_htlc_value_in_flight_msat(this_ptr_conv);
3485 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) {
3486 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3487 return OpenChannel_set_max_htlc_value_in_flight_msat(this_ptr_conv, val);
3490 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3491 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3492 return OpenChannel_get_channel_reserve_satoshis(this_ptr_conv);
3495 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3496 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3497 return OpenChannel_set_channel_reserve_satoshis(this_ptr_conv, val);
3500 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3501 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3502 return OpenChannel_get_htlc_minimum_msat(this_ptr_conv);
3505 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3506 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3507 return OpenChannel_set_htlc_minimum_msat(this_ptr_conv, val);
3510 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr) {
3511 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3512 return OpenChannel_get_feerate_per_kw(this_ptr_conv);
3515 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
3516 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3517 return OpenChannel_set_feerate_per_kw(this_ptr_conv, val);
3520 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
3521 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3522 return OpenChannel_get_to_self_delay(this_ptr_conv);
3525 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3526 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3527 return OpenChannel_set_to_self_delay(this_ptr_conv, val);
3530 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr) {
3531 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3532 return OpenChannel_get_max_accepted_htlcs(this_ptr_conv);
3535 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3536 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3537 return OpenChannel_set_max_accepted_htlcs(this_ptr_conv, val);
3540 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
3541 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3542 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3543 *ret = OpenChannel_get_funding_pubkey(this_ptr_conv);
3547 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3548 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3549 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3551 return OpenChannel_set_funding_pubkey(this_ptr_conv, val_conv);
3554 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
3555 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3556 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3557 *ret = OpenChannel_get_revocation_basepoint(this_ptr_conv);
3561 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3562 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3563 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3565 return OpenChannel_set_revocation_basepoint(this_ptr_conv, val_conv);
3568 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
3569 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3570 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3571 *ret = OpenChannel_get_payment_point(this_ptr_conv);
3575 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3576 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3577 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3579 return OpenChannel_set_payment_point(this_ptr_conv, val_conv);
3582 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
3583 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3584 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3585 *ret = OpenChannel_get_delayed_payment_basepoint(this_ptr_conv);
3589 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3590 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3591 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3593 return OpenChannel_set_delayed_payment_basepoint(this_ptr_conv, val_conv);
3596 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
3597 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3598 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3599 *ret = OpenChannel_get_htlc_basepoint(this_ptr_conv);
3603 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3604 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3605 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3607 return OpenChannel_set_htlc_basepoint(this_ptr_conv, val_conv);
3610 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
3611 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3612 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3613 *ret = OpenChannel_get_first_per_commitment_point(this_ptr_conv);
3617 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3618 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3619 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3621 return OpenChannel_set_first_per_commitment_point(this_ptr_conv, val_conv);
3624 JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1flags(JNIEnv * _env, jclass _b, jlong this_ptr) {
3625 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3626 return OpenChannel_get_channel_flags(this_ptr_conv);
3629 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1flags(JNIEnv * _env, jclass _b, jlong this_ptr, jbyte val) {
3630 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3631 return OpenChannel_set_channel_flags(this_ptr_conv, val);
3634 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3635 LDKAcceptChannel this_ptr_conv = *(LDKAcceptChannel*)this_ptr;
3636 FREE((void*)this_ptr);
3637 this_ptr_conv.is_owned = true;
3638 return AcceptChannel_free(this_ptr_conv);
3641 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3642 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3643 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3644 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *AcceptChannel_get_temporary_channel_id(this_ptr_conv));
3648 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3649 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3650 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3652 return AcceptChannel_set_temporary_channel_id(this_ptr_conv, val_conv);
3655 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3656 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3657 return AcceptChannel_get_dust_limit_satoshis(this_ptr_conv);
3660 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3661 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3662 return AcceptChannel_set_dust_limit_satoshis(this_ptr_conv, val);
3665 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3666 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3667 return AcceptChannel_get_max_htlc_value_in_flight_msat(this_ptr_conv);
3670 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) {
3671 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3672 return AcceptChannel_set_max_htlc_value_in_flight_msat(this_ptr_conv, val);
3675 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3676 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3677 return AcceptChannel_get_channel_reserve_satoshis(this_ptr_conv);
3680 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3681 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3682 return AcceptChannel_set_channel_reserve_satoshis(this_ptr_conv, val);
3685 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3686 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3687 return AcceptChannel_get_htlc_minimum_msat(this_ptr_conv);
3690 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3691 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3692 return AcceptChannel_set_htlc_minimum_msat(this_ptr_conv, val);
3695 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr) {
3696 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3697 return AcceptChannel_get_minimum_depth(this_ptr_conv);
3700 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
3701 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3702 return AcceptChannel_set_minimum_depth(this_ptr_conv, val);
3705 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
3706 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3707 return AcceptChannel_get_to_self_delay(this_ptr_conv);
3710 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3711 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3712 return AcceptChannel_set_to_self_delay(this_ptr_conv, val);
3715 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr) {
3716 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3717 return AcceptChannel_get_max_accepted_htlcs(this_ptr_conv);
3720 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3721 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3722 return AcceptChannel_set_max_accepted_htlcs(this_ptr_conv, val);
3725 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
3726 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3727 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3728 *ret = AcceptChannel_get_funding_pubkey(this_ptr_conv);
3732 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3733 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3734 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3736 return AcceptChannel_set_funding_pubkey(this_ptr_conv, val_conv);
3739 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
3740 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3741 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3742 *ret = AcceptChannel_get_revocation_basepoint(this_ptr_conv);
3746 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3747 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3748 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3750 return AcceptChannel_set_revocation_basepoint(this_ptr_conv, val_conv);
3753 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
3754 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3755 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3756 *ret = AcceptChannel_get_payment_point(this_ptr_conv);
3760 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3761 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3762 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3764 return AcceptChannel_set_payment_point(this_ptr_conv, val_conv);
3767 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
3768 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3769 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3770 *ret = AcceptChannel_get_delayed_payment_basepoint(this_ptr_conv);
3774 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3775 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3776 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3778 return AcceptChannel_set_delayed_payment_basepoint(this_ptr_conv, val_conv);
3781 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
3782 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3783 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3784 *ret = AcceptChannel_get_htlc_basepoint(this_ptr_conv);
3788 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3789 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3790 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3792 return AcceptChannel_set_htlc_basepoint(this_ptr_conv, val_conv);
3795 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
3796 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3797 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3798 *ret = AcceptChannel_get_first_per_commitment_point(this_ptr_conv);
3802 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3803 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3804 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3806 return AcceptChannel_set_first_per_commitment_point(this_ptr_conv, val_conv);
3809 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3810 LDKFundingCreated this_ptr_conv = *(LDKFundingCreated*)this_ptr;
3811 FREE((void*)this_ptr);
3812 this_ptr_conv.is_owned = true;
3813 return FundingCreated_free(this_ptr_conv);
3816 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3817 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3818 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3819 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingCreated_get_temporary_channel_id(this_ptr_conv));
3823 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3824 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3825 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3827 return FundingCreated_set_temporary_channel_id(this_ptr_conv, val_conv);
3830 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1txid(JNIEnv * _env, jclass _b, jlong this_ptr) {
3831 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3832 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3833 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingCreated_get_funding_txid(this_ptr_conv));
3837 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1txid(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3838 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3839 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3841 return FundingCreated_set_funding_txid(this_ptr_conv, val_conv);
3844 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1output_1index(JNIEnv * _env, jclass _b, jlong this_ptr) {
3845 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3846 return FundingCreated_get_funding_output_index(this_ptr_conv);
3849 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1output_1index(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3850 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3851 return FundingCreated_set_funding_output_index(this_ptr_conv, val);
3854 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
3855 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3856 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
3857 *ret = FundingCreated_get_signature(this_ptr_conv);
3861 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3862 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3863 LDKSignature val_conv = *(LDKSignature*)val;
3865 return FundingCreated_set_signature(this_ptr_conv, val_conv);
3868 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) {
3869 LDKThirtyTwoBytes temporary_channel_id_arg_conv = *(LDKThirtyTwoBytes*)temporary_channel_id_arg;
3870 FREE((void*)temporary_channel_id_arg);
3871 LDKThirtyTwoBytes funding_txid_arg_conv = *(LDKThirtyTwoBytes*)funding_txid_arg;
3872 FREE((void*)funding_txid_arg);
3873 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
3874 FREE((void*)signature_arg);
3875 LDKFundingCreated* ret = MALLOC(sizeof(LDKFundingCreated), "LDKFundingCreated");
3876 *ret = FundingCreated_new(temporary_channel_id_arg_conv, funding_txid_arg_conv, funding_output_index_arg, signature_arg_conv);
3877 assert(ret->is_owned);
3878 ret->is_owned = false;
3882 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3883 LDKFundingSigned this_ptr_conv = *(LDKFundingSigned*)this_ptr;
3884 FREE((void*)this_ptr);
3885 this_ptr_conv.is_owned = true;
3886 return FundingSigned_free(this_ptr_conv);
3889 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3890 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
3891 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3892 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingSigned_get_channel_id(this_ptr_conv));
3896 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3897 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
3898 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3900 return FundingSigned_set_channel_id(this_ptr_conv, val_conv);
3903 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
3904 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
3905 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
3906 *ret = FundingSigned_get_signature(this_ptr_conv);
3910 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3911 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
3912 LDKSignature val_conv = *(LDKSignature*)val;
3914 return FundingSigned_set_signature(this_ptr_conv, val_conv);
3917 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong signature_arg) {
3918 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
3919 FREE((void*)channel_id_arg);
3920 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
3921 FREE((void*)signature_arg);
3922 LDKFundingSigned* ret = MALLOC(sizeof(LDKFundingSigned), "LDKFundingSigned");
3923 *ret = FundingSigned_new(channel_id_arg_conv, signature_arg_conv);
3924 assert(ret->is_owned);
3925 ret->is_owned = false;
3929 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3930 LDKFundingLocked this_ptr_conv = *(LDKFundingLocked*)this_ptr;
3931 FREE((void*)this_ptr);
3932 this_ptr_conv.is_owned = true;
3933 return FundingLocked_free(this_ptr_conv);
3936 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3937 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
3938 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3939 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingLocked_get_channel_id(this_ptr_conv));
3943 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3944 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
3945 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3947 return FundingLocked_set_channel_id(this_ptr_conv, val_conv);
3950 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
3951 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
3952 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3953 *ret = FundingLocked_get_next_per_commitment_point(this_ptr_conv);
3957 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3958 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
3959 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3961 return FundingLocked_set_next_per_commitment_point(this_ptr_conv, val_conv);
3964 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong next_per_commitment_point_arg) {
3965 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
3966 FREE((void*)channel_id_arg);
3967 LDKPublicKey next_per_commitment_point_arg_conv = *(LDKPublicKey*)next_per_commitment_point_arg;
3968 FREE((void*)next_per_commitment_point_arg);
3969 LDKFundingLocked* ret = MALLOC(sizeof(LDKFundingLocked), "LDKFundingLocked");
3970 *ret = FundingLocked_new(channel_id_arg_conv, next_per_commitment_point_arg_conv);
3971 assert(ret->is_owned);
3972 ret->is_owned = false;
3976 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3977 LDKShutdown this_ptr_conv = *(LDKShutdown*)this_ptr;
3978 FREE((void*)this_ptr);
3979 this_ptr_conv.is_owned = true;
3980 return Shutdown_free(this_ptr_conv);
3983 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3984 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
3985 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3986 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *Shutdown_get_channel_id(this_ptr_conv));
3990 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3991 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
3992 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3994 return Shutdown_set_channel_id(this_ptr_conv, val_conv);
3997 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1scriptpubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
3998 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
3999 LDKu8slice* ret = MALLOC(sizeof(LDKu8slice), "LDKu8slice");
4000 *ret = Shutdown_get_scriptpubkey(this_ptr_conv);
4004 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1scriptpubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4005 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
4006 LDKCVec_u8Z val_conv = *(LDKCVec_u8Z*)val;
4008 return Shutdown_set_scriptpubkey(this_ptr_conv, val_conv);
4011 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong scriptpubkey_arg) {
4012 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4013 FREE((void*)channel_id_arg);
4014 LDKCVec_u8Z scriptpubkey_arg_conv = *(LDKCVec_u8Z*)scriptpubkey_arg;
4015 FREE((void*)scriptpubkey_arg);
4016 LDKShutdown* ret = MALLOC(sizeof(LDKShutdown), "LDKShutdown");
4017 *ret = Shutdown_new(channel_id_arg_conv, scriptpubkey_arg_conv);
4018 assert(ret->is_owned);
4019 ret->is_owned = false;
4023 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4024 LDKClosingSigned this_ptr_conv = *(LDKClosingSigned*)this_ptr;
4025 FREE((void*)this_ptr);
4026 this_ptr_conv.is_owned = true;
4027 return ClosingSigned_free(this_ptr_conv);
4030 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4031 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
4032 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4033 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ClosingSigned_get_channel_id(this_ptr_conv));
4037 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4038 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
4039 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4041 return ClosingSigned_set_channel_id(this_ptr_conv, val_conv);
4044 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
4045 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
4046 return ClosingSigned_get_fee_satoshis(this_ptr_conv);
4049 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4050 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
4051 return ClosingSigned_set_fee_satoshis(this_ptr_conv, val);
4054 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
4055 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
4056 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4057 *ret = ClosingSigned_get_signature(this_ptr_conv);
4061 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4062 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
4063 LDKSignature val_conv = *(LDKSignature*)val;
4065 return ClosingSigned_set_signature(this_ptr_conv, val_conv);
4068 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) {
4069 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4070 FREE((void*)channel_id_arg);
4071 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
4072 FREE((void*)signature_arg);
4073 LDKClosingSigned* ret = MALLOC(sizeof(LDKClosingSigned), "LDKClosingSigned");
4074 *ret = ClosingSigned_new(channel_id_arg_conv, fee_satoshis_arg, signature_arg_conv);
4075 assert(ret->is_owned);
4076 ret->is_owned = false;
4080 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4081 LDKUpdateAddHTLC this_ptr_conv = *(LDKUpdateAddHTLC*)this_ptr;
4082 FREE((void*)this_ptr);
4083 this_ptr_conv.is_owned = true;
4084 return UpdateAddHTLC_free(this_ptr_conv);
4087 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4088 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4089 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4090 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateAddHTLC_get_channel_id(this_ptr_conv));
4094 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4095 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4096 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4098 return UpdateAddHTLC_set_channel_id(this_ptr_conv, val_conv);
4101 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4102 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4103 return UpdateAddHTLC_get_htlc_id(this_ptr_conv);
4106 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4107 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4108 return UpdateAddHTLC_set_htlc_id(this_ptr_conv, val);
4111 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
4112 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4113 return UpdateAddHTLC_get_amount_msat(this_ptr_conv);
4116 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4117 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4118 return UpdateAddHTLC_set_amount_msat(this_ptr_conv, val);
4121 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
4122 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4123 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4124 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateAddHTLC_get_payment_hash(this_ptr_conv));
4128 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4129 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4130 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4132 return UpdateAddHTLC_set_payment_hash(this_ptr_conv, val_conv);
4135 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr) {
4136 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4137 return UpdateAddHTLC_get_cltv_expiry(this_ptr_conv);
4140 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
4141 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4142 return UpdateAddHTLC_set_cltv_expiry(this_ptr_conv, val);
4145 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4146 LDKUpdateFulfillHTLC this_ptr_conv = *(LDKUpdateFulfillHTLC*)this_ptr;
4147 FREE((void*)this_ptr);
4148 this_ptr_conv.is_owned = true;
4149 return UpdateFulfillHTLC_free(this_ptr_conv);
4152 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4153 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
4154 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4155 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_channel_id(this_ptr_conv));
4159 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4160 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
4161 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4163 return UpdateFulfillHTLC_set_channel_id(this_ptr_conv, val_conv);
4166 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4167 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
4168 return UpdateFulfillHTLC_get_htlc_id(this_ptr_conv);
4171 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4172 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
4173 return UpdateFulfillHTLC_set_htlc_id(this_ptr_conv, val);
4176 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1payment_1preimage(JNIEnv * _env, jclass _b, jlong this_ptr) {
4177 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
4178 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4179 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_payment_preimage(this_ptr_conv));
4183 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1payment_1preimage(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4184 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
4185 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4187 return UpdateFulfillHTLC_set_payment_preimage(this_ptr_conv, val_conv);
4190 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) {
4191 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4192 FREE((void*)channel_id_arg);
4193 LDKThirtyTwoBytes payment_preimage_arg_conv = *(LDKThirtyTwoBytes*)payment_preimage_arg;
4194 FREE((void*)payment_preimage_arg);
4195 LDKUpdateFulfillHTLC* ret = MALLOC(sizeof(LDKUpdateFulfillHTLC), "LDKUpdateFulfillHTLC");
4196 *ret = UpdateFulfillHTLC_new(channel_id_arg_conv, htlc_id_arg, payment_preimage_arg_conv);
4197 assert(ret->is_owned);
4198 ret->is_owned = false;
4202 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4203 LDKUpdateFailHTLC this_ptr_conv = *(LDKUpdateFailHTLC*)this_ptr;
4204 FREE((void*)this_ptr);
4205 this_ptr_conv.is_owned = true;
4206 return UpdateFailHTLC_free(this_ptr_conv);
4209 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4210 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
4211 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4212 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFailHTLC_get_channel_id(this_ptr_conv));
4216 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4217 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
4218 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4220 return UpdateFailHTLC_set_channel_id(this_ptr_conv, val_conv);
4223 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4224 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
4225 return UpdateFailHTLC_get_htlc_id(this_ptr_conv);
4228 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4229 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
4230 return UpdateFailHTLC_set_htlc_id(this_ptr_conv, val);
4233 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4234 LDKUpdateFailMalformedHTLC this_ptr_conv = *(LDKUpdateFailMalformedHTLC*)this_ptr;
4235 FREE((void*)this_ptr);
4236 this_ptr_conv.is_owned = true;
4237 return UpdateFailMalformedHTLC_free(this_ptr_conv);
4240 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4241 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
4242 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4243 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFailMalformedHTLC_get_channel_id(this_ptr_conv));
4247 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4248 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
4249 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4251 return UpdateFailMalformedHTLC_set_channel_id(this_ptr_conv, val_conv);
4254 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4255 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
4256 return UpdateFailMalformedHTLC_get_htlc_id(this_ptr_conv);
4259 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4260 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
4261 return UpdateFailMalformedHTLC_set_htlc_id(this_ptr_conv, val);
4264 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1failure_1code(JNIEnv * _env, jclass _b, jlong this_ptr) {
4265 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
4266 return UpdateFailMalformedHTLC_get_failure_code(this_ptr_conv);
4269 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1failure_1code(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
4270 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
4271 return UpdateFailMalformedHTLC_set_failure_code(this_ptr_conv, val);
4274 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4275 LDKCommitmentSigned this_ptr_conv = *(LDKCommitmentSigned*)this_ptr;
4276 FREE((void*)this_ptr);
4277 this_ptr_conv.is_owned = true;
4278 return CommitmentSigned_free(this_ptr_conv);
4281 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4282 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
4283 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4284 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *CommitmentSigned_get_channel_id(this_ptr_conv));
4288 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4289 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
4290 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4292 return CommitmentSigned_set_channel_id(this_ptr_conv, val_conv);
4295 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
4296 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
4297 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4298 *ret = CommitmentSigned_get_signature(this_ptr_conv);
4302 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4303 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
4304 LDKSignature val_conv = *(LDKSignature*)val;
4306 return CommitmentSigned_set_signature(this_ptr_conv, val_conv);
4309 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1htlc_1signatures(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4310 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
4311 LDKCVec_SignatureZ val_conv = *(LDKCVec_SignatureZ*)val;
4313 return CommitmentSigned_set_htlc_signatures(this_ptr_conv, val_conv);
4316 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) {
4317 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4318 FREE((void*)channel_id_arg);
4319 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
4320 FREE((void*)signature_arg);
4321 LDKCVec_SignatureZ htlc_signatures_arg_conv = *(LDKCVec_SignatureZ*)htlc_signatures_arg;
4322 FREE((void*)htlc_signatures_arg);
4323 LDKCommitmentSigned* ret = MALLOC(sizeof(LDKCommitmentSigned), "LDKCommitmentSigned");
4324 *ret = CommitmentSigned_new(channel_id_arg_conv, signature_arg_conv, htlc_signatures_arg_conv);
4325 assert(ret->is_owned);
4326 ret->is_owned = false;
4330 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4331 LDKRevokeAndACK this_ptr_conv = *(LDKRevokeAndACK*)this_ptr;
4332 FREE((void*)this_ptr);
4333 this_ptr_conv.is_owned = true;
4334 return RevokeAndACK_free(this_ptr_conv);
4337 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4338 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
4339 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4340 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *RevokeAndACK_get_channel_id(this_ptr_conv));
4344 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4345 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
4346 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4348 return RevokeAndACK_set_channel_id(this_ptr_conv, val_conv);
4351 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr) {
4352 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
4353 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4354 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *RevokeAndACK_get_per_commitment_secret(this_ptr_conv));
4358 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4359 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
4360 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4362 return RevokeAndACK_set_per_commitment_secret(this_ptr_conv, val_conv);
4365 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
4366 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
4367 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4368 *ret = RevokeAndACK_get_next_per_commitment_point(this_ptr_conv);
4372 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4373 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
4374 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4376 return RevokeAndACK_set_next_per_commitment_point(this_ptr_conv, val_conv);
4379 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) {
4380 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4381 FREE((void*)channel_id_arg);
4382 LDKThirtyTwoBytes per_commitment_secret_arg_conv = *(LDKThirtyTwoBytes*)per_commitment_secret_arg;
4383 FREE((void*)per_commitment_secret_arg);
4384 LDKPublicKey next_per_commitment_point_arg_conv = *(LDKPublicKey*)next_per_commitment_point_arg;
4385 FREE((void*)next_per_commitment_point_arg);
4386 LDKRevokeAndACK* ret = MALLOC(sizeof(LDKRevokeAndACK), "LDKRevokeAndACK");
4387 *ret = RevokeAndACK_new(channel_id_arg_conv, per_commitment_secret_arg_conv, next_per_commitment_point_arg_conv);
4388 assert(ret->is_owned);
4389 ret->is_owned = false;
4393 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4394 LDKUpdateFee this_ptr_conv = *(LDKUpdateFee*)this_ptr;
4395 FREE((void*)this_ptr);
4396 this_ptr_conv.is_owned = true;
4397 return UpdateFee_free(this_ptr_conv);
4400 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4401 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
4402 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4403 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFee_get_channel_id(this_ptr_conv));
4407 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4408 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
4409 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4411 return UpdateFee_set_channel_id(this_ptr_conv, val_conv);
4414 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr) {
4415 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
4416 return UpdateFee_get_feerate_per_kw(this_ptr_conv);
4419 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
4420 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
4421 return UpdateFee_set_feerate_per_kw(this_ptr_conv, val);
4424 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jint feerate_per_kw_arg) {
4425 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4426 FREE((void*)channel_id_arg);
4427 LDKUpdateFee* ret = MALLOC(sizeof(LDKUpdateFee), "LDKUpdateFee");
4428 *ret = UpdateFee_new(channel_id_arg_conv, feerate_per_kw_arg);
4429 assert(ret->is_owned);
4430 ret->is_owned = false;
4434 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4435 LDKDataLossProtect this_ptr_conv = *(LDKDataLossProtect*)this_ptr;
4436 FREE((void*)this_ptr);
4437 this_ptr_conv.is_owned = true;
4438 return DataLossProtect_free(this_ptr_conv);
4441 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1your_1last_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr) {
4442 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
4443 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4444 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *DataLossProtect_get_your_last_per_commitment_secret(this_ptr_conv));
4448 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1your_1last_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4449 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
4450 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4452 return DataLossProtect_set_your_last_per_commitment_secret(this_ptr_conv, val_conv);
4455 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1my_1current_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
4456 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
4457 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4458 *ret = DataLossProtect_get_my_current_per_commitment_point(this_ptr_conv);
4462 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1my_1current_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4463 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
4464 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4466 return DataLossProtect_set_my_current_per_commitment_point(this_ptr_conv, val_conv);
4469 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) {
4470 LDKThirtyTwoBytes your_last_per_commitment_secret_arg_conv = *(LDKThirtyTwoBytes*)your_last_per_commitment_secret_arg;
4471 FREE((void*)your_last_per_commitment_secret_arg);
4472 LDKPublicKey my_current_per_commitment_point_arg_conv = *(LDKPublicKey*)my_current_per_commitment_point_arg;
4473 FREE((void*)my_current_per_commitment_point_arg);
4474 LDKDataLossProtect* ret = MALLOC(sizeof(LDKDataLossProtect), "LDKDataLossProtect");
4475 *ret = DataLossProtect_new(your_last_per_commitment_secret_arg_conv, my_current_per_commitment_point_arg_conv);
4476 assert(ret->is_owned);
4477 ret->is_owned = false;
4481 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4482 LDKChannelReestablish this_ptr_conv = *(LDKChannelReestablish*)this_ptr;
4483 FREE((void*)this_ptr);
4484 this_ptr_conv.is_owned = true;
4485 return ChannelReestablish_free(this_ptr_conv);
4488 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4489 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
4490 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4491 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ChannelReestablish_get_channel_id(this_ptr_conv));
4495 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4496 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
4497 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4499 return ChannelReestablish_set_channel_id(this_ptr_conv, val_conv);
4502 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1local_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr) {
4503 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
4504 return ChannelReestablish_get_next_local_commitment_number(this_ptr_conv);
4507 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1local_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4508 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
4509 return ChannelReestablish_set_next_local_commitment_number(this_ptr_conv, val);
4512 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1remote_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr) {
4513 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
4514 return ChannelReestablish_get_next_remote_commitment_number(this_ptr_conv);
4517 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1remote_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4518 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
4519 return ChannelReestablish_set_next_remote_commitment_number(this_ptr_conv, val);
4522 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4523 LDKAnnouncementSignatures this_ptr_conv = *(LDKAnnouncementSignatures*)this_ptr;
4524 FREE((void*)this_ptr);
4525 this_ptr_conv.is_owned = true;
4526 return AnnouncementSignatures_free(this_ptr_conv);
4529 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4530 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4531 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4532 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *AnnouncementSignatures_get_channel_id(this_ptr_conv));
4536 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4537 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4538 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4540 return AnnouncementSignatures_set_channel_id(this_ptr_conv, val_conv);
4543 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4544 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4545 return AnnouncementSignatures_get_short_channel_id(this_ptr_conv);
4548 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4549 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4550 return AnnouncementSignatures_set_short_channel_id(this_ptr_conv, val);
4553 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1node_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
4554 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4555 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4556 *ret = AnnouncementSignatures_get_node_signature(this_ptr_conv);
4560 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1node_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4561 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4562 LDKSignature val_conv = *(LDKSignature*)val;
4564 return AnnouncementSignatures_set_node_signature(this_ptr_conv, val_conv);
4567 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1bitcoin_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
4568 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4569 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4570 *ret = AnnouncementSignatures_get_bitcoin_signature(this_ptr_conv);
4574 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1bitcoin_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4575 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4576 LDKSignature val_conv = *(LDKSignature*)val;
4578 return AnnouncementSignatures_set_bitcoin_signature(this_ptr_conv, val_conv);
4581 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) {
4582 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4583 FREE((void*)channel_id_arg);
4584 LDKSignature node_signature_arg_conv = *(LDKSignature*)node_signature_arg;
4585 FREE((void*)node_signature_arg);
4586 LDKSignature bitcoin_signature_arg_conv = *(LDKSignature*)bitcoin_signature_arg;
4587 FREE((void*)bitcoin_signature_arg);
4588 LDKAnnouncementSignatures* ret = MALLOC(sizeof(LDKAnnouncementSignatures), "LDKAnnouncementSignatures");
4589 *ret = AnnouncementSignatures_new(channel_id_arg_conv, short_channel_id_arg, node_signature_arg_conv, bitcoin_signature_arg_conv);
4590 assert(ret->is_owned);
4591 ret->is_owned = false;
4595 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetAddress_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4596 LDKNetAddress this_ptr_conv = *(LDKNetAddress*)this_ptr;
4597 FREE((void*)this_ptr);
4598 return NetAddress_free(this_ptr_conv);
4601 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4602 LDKUnsignedNodeAnnouncement this_ptr_conv = *(LDKUnsignedNodeAnnouncement*)this_ptr;
4603 FREE((void*)this_ptr);
4604 this_ptr_conv.is_owned = true;
4605 return UnsignedNodeAnnouncement_free(this_ptr_conv);
4608 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
4609 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4610 LDKNodeFeatures* ret = MALLOC(sizeof(LDKNodeFeatures), "LDKNodeFeatures");
4611 *ret = UnsignedNodeAnnouncement_get_features(this_ptr_conv);
4612 assert(ret->is_owned);
4613 ret->is_owned = false;
4617 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4618 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4619 LDKNodeFeatures val_conv = *(LDKNodeFeatures*)val;
4621 val_conv.is_owned = true;
4622 return UnsignedNodeAnnouncement_set_features(this_ptr_conv, val_conv);
4625 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr) {
4626 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4627 return UnsignedNodeAnnouncement_get_timestamp(this_ptr_conv);
4630 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
4631 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4632 return UnsignedNodeAnnouncement_set_timestamp(this_ptr_conv, val);
4635 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4636 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4637 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4638 *ret = UnsignedNodeAnnouncement_get_node_id(this_ptr_conv);
4642 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4643 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4644 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4646 return UnsignedNodeAnnouncement_set_node_id(this_ptr_conv, val_conv);
4649 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr) {
4650 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4651 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 3);
4652 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 3, *UnsignedNodeAnnouncement_get_rgb(this_ptr_conv));
4656 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4657 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4658 LDKThreeBytes val_conv = *(LDKThreeBytes*)val;
4660 return UnsignedNodeAnnouncement_set_rgb(this_ptr_conv, val_conv);
4663 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1alias(JNIEnv * _env, jclass _b, jlong this_ptr) {
4664 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4665 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4666 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedNodeAnnouncement_get_alias(this_ptr_conv));
4670 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1alias(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4671 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4672 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4674 return UnsignedNodeAnnouncement_set_alias(this_ptr_conv, val_conv);
4677 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1addresses(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4678 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4679 LDKCVec_NetAddressZ val_conv = *(LDKCVec_NetAddressZ*)val;
4681 return UnsignedNodeAnnouncement_set_addresses(this_ptr_conv, val_conv);
4684 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4685 LDKNodeAnnouncement this_ptr_conv = *(LDKNodeAnnouncement*)this_ptr;
4686 FREE((void*)this_ptr);
4687 this_ptr_conv.is_owned = true;
4688 return NodeAnnouncement_free(this_ptr_conv);
4691 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
4692 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
4693 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4694 *ret = NodeAnnouncement_get_signature(this_ptr_conv);
4698 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4699 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
4700 LDKSignature val_conv = *(LDKSignature*)val;
4702 return NodeAnnouncement_set_signature(this_ptr_conv, val_conv);
4705 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1contents(JNIEnv * _env, jclass _b, jlong this_ptr) {
4706 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
4707 LDKUnsignedNodeAnnouncement* ret = MALLOC(sizeof(LDKUnsignedNodeAnnouncement), "LDKUnsignedNodeAnnouncement");
4708 *ret = NodeAnnouncement_get_contents(this_ptr_conv);
4709 assert(ret->is_owned);
4710 ret->is_owned = false;
4714 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1contents(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4715 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
4716 LDKUnsignedNodeAnnouncement val_conv = *(LDKUnsignedNodeAnnouncement*)val;
4718 val_conv.is_owned = true;
4719 return NodeAnnouncement_set_contents(this_ptr_conv, val_conv);
4722 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1new(JNIEnv * _env, jclass _b, jlong signature_arg, jlong contents_arg) {
4723 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
4724 FREE((void*)signature_arg);
4725 LDKUnsignedNodeAnnouncement contents_arg_conv = *(LDKUnsignedNodeAnnouncement*)contents_arg;
4726 FREE((void*)contents_arg);
4727 contents_arg_conv.is_owned = true;
4728 LDKNodeAnnouncement* ret = MALLOC(sizeof(LDKNodeAnnouncement), "LDKNodeAnnouncement");
4729 *ret = NodeAnnouncement_new(signature_arg_conv, contents_arg_conv);
4730 assert(ret->is_owned);
4731 ret->is_owned = false;
4735 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4736 LDKUnsignedChannelAnnouncement this_ptr_conv = *(LDKUnsignedChannelAnnouncement*)this_ptr;
4737 FREE((void*)this_ptr);
4738 this_ptr_conv.is_owned = true;
4739 return UnsignedChannelAnnouncement_free(this_ptr_conv);
4742 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
4743 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4744 LDKChannelFeatures* ret = MALLOC(sizeof(LDKChannelFeatures), "LDKChannelFeatures");
4745 *ret = UnsignedChannelAnnouncement_get_features(this_ptr_conv);
4746 assert(ret->is_owned);
4747 ret->is_owned = false;
4751 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4752 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4753 LDKChannelFeatures val_conv = *(LDKChannelFeatures*)val;
4755 val_conv.is_owned = true;
4756 return UnsignedChannelAnnouncement_set_features(this_ptr_conv, val_conv);
4759 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
4760 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4761 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4762 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedChannelAnnouncement_get_chain_hash(this_ptr_conv));
4766 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4767 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4768 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4770 return UnsignedChannelAnnouncement_set_chain_hash(this_ptr_conv, val_conv);
4773 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4774 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4775 return UnsignedChannelAnnouncement_get_short_channel_id(this_ptr_conv);
4778 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4779 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4780 return UnsignedChannelAnnouncement_set_short_channel_id(this_ptr_conv, val);
4783 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
4784 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4785 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4786 *ret = UnsignedChannelAnnouncement_get_node_id_1(this_ptr_conv);
4790 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4791 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4792 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4794 return UnsignedChannelAnnouncement_set_node_id_1(this_ptr_conv, val_conv);
4797 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
4798 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4799 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4800 *ret = UnsignedChannelAnnouncement_get_node_id_2(this_ptr_conv);
4804 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4805 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4806 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4808 return UnsignedChannelAnnouncement_set_node_id_2(this_ptr_conv, val_conv);
4811 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
4812 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4813 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4814 *ret = UnsignedChannelAnnouncement_get_bitcoin_key_1(this_ptr_conv);
4818 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4819 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4820 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4822 return UnsignedChannelAnnouncement_set_bitcoin_key_1(this_ptr_conv, val_conv);
4825 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
4826 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4827 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4828 *ret = UnsignedChannelAnnouncement_get_bitcoin_key_2(this_ptr_conv);
4832 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4833 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4834 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4836 return UnsignedChannelAnnouncement_set_bitcoin_key_2(this_ptr_conv, val_conv);
4839 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4840 LDKChannelAnnouncement this_ptr_conv = *(LDKChannelAnnouncement*)this_ptr;
4841 FREE((void*)this_ptr);
4842 this_ptr_conv.is_owned = true;
4843 return ChannelAnnouncement_free(this_ptr_conv);
4846 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
4847 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4848 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4849 *ret = ChannelAnnouncement_get_node_signature_1(this_ptr_conv);
4853 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4854 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4855 LDKSignature val_conv = *(LDKSignature*)val;
4857 return ChannelAnnouncement_set_node_signature_1(this_ptr_conv, val_conv);
4860 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
4861 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4862 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4863 *ret = ChannelAnnouncement_get_node_signature_2(this_ptr_conv);
4867 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4868 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4869 LDKSignature val_conv = *(LDKSignature*)val;
4871 return ChannelAnnouncement_set_node_signature_2(this_ptr_conv, val_conv);
4874 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
4875 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4876 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4877 *ret = ChannelAnnouncement_get_bitcoin_signature_1(this_ptr_conv);
4881 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4882 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4883 LDKSignature val_conv = *(LDKSignature*)val;
4885 return ChannelAnnouncement_set_bitcoin_signature_1(this_ptr_conv, val_conv);
4888 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
4889 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4890 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4891 *ret = ChannelAnnouncement_get_bitcoin_signature_2(this_ptr_conv);
4895 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4896 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4897 LDKSignature val_conv = *(LDKSignature*)val;
4899 return ChannelAnnouncement_set_bitcoin_signature_2(this_ptr_conv, val_conv);
4902 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1contents(JNIEnv * _env, jclass _b, jlong this_ptr) {
4903 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4904 LDKUnsignedChannelAnnouncement* ret = MALLOC(sizeof(LDKUnsignedChannelAnnouncement), "LDKUnsignedChannelAnnouncement");
4905 *ret = ChannelAnnouncement_get_contents(this_ptr_conv);
4906 assert(ret->is_owned);
4907 ret->is_owned = false;
4911 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1contents(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4912 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4913 LDKUnsignedChannelAnnouncement val_conv = *(LDKUnsignedChannelAnnouncement*)val;
4915 val_conv.is_owned = true;
4916 return ChannelAnnouncement_set_contents(this_ptr_conv, val_conv);
4919 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) {
4920 LDKSignature node_signature_1_arg_conv = *(LDKSignature*)node_signature_1_arg;
4921 FREE((void*)node_signature_1_arg);
4922 LDKSignature node_signature_2_arg_conv = *(LDKSignature*)node_signature_2_arg;
4923 FREE((void*)node_signature_2_arg);
4924 LDKSignature bitcoin_signature_1_arg_conv = *(LDKSignature*)bitcoin_signature_1_arg;
4925 FREE((void*)bitcoin_signature_1_arg);
4926 LDKSignature bitcoin_signature_2_arg_conv = *(LDKSignature*)bitcoin_signature_2_arg;
4927 FREE((void*)bitcoin_signature_2_arg);
4928 LDKUnsignedChannelAnnouncement contents_arg_conv = *(LDKUnsignedChannelAnnouncement*)contents_arg;
4929 FREE((void*)contents_arg);
4930 contents_arg_conv.is_owned = true;
4931 LDKChannelAnnouncement* ret = MALLOC(sizeof(LDKChannelAnnouncement), "LDKChannelAnnouncement");
4932 *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);
4933 assert(ret->is_owned);
4934 ret->is_owned = false;
4938 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4939 LDKUnsignedChannelUpdate this_ptr_conv = *(LDKUnsignedChannelUpdate*)this_ptr;
4940 FREE((void*)this_ptr);
4941 this_ptr_conv.is_owned = true;
4942 return UnsignedChannelUpdate_free(this_ptr_conv);
4945 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
4946 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4947 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4948 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedChannelUpdate_get_chain_hash(this_ptr_conv));
4952 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4953 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4954 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4956 return UnsignedChannelUpdate_set_chain_hash(this_ptr_conv, val_conv);
4959 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4960 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4961 return UnsignedChannelUpdate_get_short_channel_id(this_ptr_conv);
4964 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4965 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4966 return UnsignedChannelUpdate_set_short_channel_id(this_ptr_conv, val);
4969 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr) {
4970 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4971 return UnsignedChannelUpdate_get_timestamp(this_ptr_conv);
4974 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
4975 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4976 return UnsignedChannelUpdate_set_timestamp(this_ptr_conv, val);
4979 JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1flags(JNIEnv * _env, jclass _b, jlong this_ptr) {
4980 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4981 return UnsignedChannelUpdate_get_flags(this_ptr_conv);
4984 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1flags(JNIEnv * _env, jclass _b, jlong this_ptr, jbyte val) {
4985 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4986 return UnsignedChannelUpdate_set_flags(this_ptr_conv, val);
4989 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
4990 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4991 return UnsignedChannelUpdate_get_cltv_expiry_delta(this_ptr_conv);
4994 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
4995 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4996 return UnsignedChannelUpdate_set_cltv_expiry_delta(this_ptr_conv, val);
4999 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
5000 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5001 return UnsignedChannelUpdate_get_htlc_minimum_msat(this_ptr_conv);
5004 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5005 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5006 return UnsignedChannelUpdate_set_htlc_minimum_msat(this_ptr_conv, val);
5009 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
5010 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5011 return UnsignedChannelUpdate_get_fee_base_msat(this_ptr_conv);
5014 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5015 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5016 return UnsignedChannelUpdate_set_fee_base_msat(this_ptr_conv, val);
5019 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr) {
5020 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5021 return UnsignedChannelUpdate_get_fee_proportional_millionths(this_ptr_conv);
5024 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5025 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5026 return UnsignedChannelUpdate_set_fee_proportional_millionths(this_ptr_conv, val);
5029 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5030 LDKChannelUpdate this_ptr_conv = *(LDKChannelUpdate*)this_ptr;
5031 FREE((void*)this_ptr);
5032 this_ptr_conv.is_owned = true;
5033 return ChannelUpdate_free(this_ptr_conv);
5036 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
5037 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
5038 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
5039 *ret = ChannelUpdate_get_signature(this_ptr_conv);
5043 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5044 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
5045 LDKSignature val_conv = *(LDKSignature*)val;
5047 return ChannelUpdate_set_signature(this_ptr_conv, val_conv);
5050 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1contents(JNIEnv * _env, jclass _b, jlong this_ptr) {
5051 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
5052 LDKUnsignedChannelUpdate* ret = MALLOC(sizeof(LDKUnsignedChannelUpdate), "LDKUnsignedChannelUpdate");
5053 *ret = ChannelUpdate_get_contents(this_ptr_conv);
5054 assert(ret->is_owned);
5055 ret->is_owned = false;
5059 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1contents(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5060 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
5061 LDKUnsignedChannelUpdate val_conv = *(LDKUnsignedChannelUpdate*)val;
5063 val_conv.is_owned = true;
5064 return ChannelUpdate_set_contents(this_ptr_conv, val_conv);
5067 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1new(JNIEnv * _env, jclass _b, jlong signature_arg, jlong contents_arg) {
5068 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
5069 FREE((void*)signature_arg);
5070 LDKUnsignedChannelUpdate contents_arg_conv = *(LDKUnsignedChannelUpdate*)contents_arg;
5071 FREE((void*)contents_arg);
5072 contents_arg_conv.is_owned = true;
5073 LDKChannelUpdate* ret = MALLOC(sizeof(LDKChannelUpdate), "LDKChannelUpdate");
5074 *ret = ChannelUpdate_new(signature_arg_conv, contents_arg_conv);
5075 assert(ret->is_owned);
5076 ret->is_owned = false;
5080 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5081 LDKQueryChannelRange this_ptr_conv = *(LDKQueryChannelRange*)this_ptr;
5082 FREE((void*)this_ptr);
5083 this_ptr_conv.is_owned = true;
5084 return QueryChannelRange_free(this_ptr_conv);
5087 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
5088 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
5089 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5090 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *QueryChannelRange_get_chain_hash(this_ptr_conv));
5094 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5095 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
5096 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5098 return QueryChannelRange_set_chain_hash(this_ptr_conv, val_conv);
5101 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1first_1blocknum(JNIEnv * _env, jclass _b, jlong this_ptr) {
5102 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
5103 return QueryChannelRange_get_first_blocknum(this_ptr_conv);
5106 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1first_1blocknum(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5107 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
5108 return QueryChannelRange_set_first_blocknum(this_ptr_conv, val);
5111 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1number_1of_1blocks(JNIEnv * _env, jclass _b, jlong this_ptr) {
5112 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
5113 return QueryChannelRange_get_number_of_blocks(this_ptr_conv);
5116 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1number_1of_1blocks(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5117 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
5118 return QueryChannelRange_set_number_of_blocks(this_ptr_conv, val);
5121 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1new(JNIEnv * _env, jclass _b, jlong chain_hash_arg, jint first_blocknum_arg, jint number_of_blocks_arg) {
5122 LDKThirtyTwoBytes chain_hash_arg_conv = *(LDKThirtyTwoBytes*)chain_hash_arg;
5123 FREE((void*)chain_hash_arg);
5124 LDKQueryChannelRange* ret = MALLOC(sizeof(LDKQueryChannelRange), "LDKQueryChannelRange");
5125 *ret = QueryChannelRange_new(chain_hash_arg_conv, first_blocknum_arg, number_of_blocks_arg);
5126 assert(ret->is_owned);
5127 ret->is_owned = false;
5131 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5132 LDKReplyChannelRange this_ptr_conv = *(LDKReplyChannelRange*)this_ptr;
5133 FREE((void*)this_ptr);
5134 this_ptr_conv.is_owned = true;
5135 return ReplyChannelRange_free(this_ptr_conv);
5138 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
5139 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5140 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5141 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ReplyChannelRange_get_chain_hash(this_ptr_conv));
5145 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5146 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5147 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5149 return ReplyChannelRange_set_chain_hash(this_ptr_conv, val_conv);
5152 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1first_1blocknum(JNIEnv * _env, jclass _b, jlong this_ptr) {
5153 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5154 return ReplyChannelRange_get_first_blocknum(this_ptr_conv);
5157 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1first_1blocknum(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5158 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5159 return ReplyChannelRange_set_first_blocknum(this_ptr_conv, val);
5162 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1number_1of_1blocks(JNIEnv * _env, jclass _b, jlong this_ptr) {
5163 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5164 return ReplyChannelRange_get_number_of_blocks(this_ptr_conv);
5167 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1number_1of_1blocks(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5168 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5169 return ReplyChannelRange_set_number_of_blocks(this_ptr_conv, val);
5172 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1full_1information(JNIEnv * _env, jclass _b, jlong this_ptr) {
5173 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5174 return ReplyChannelRange_get_full_information(this_ptr_conv);
5177 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1full_1information(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
5178 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5179 return ReplyChannelRange_set_full_information(this_ptr_conv, val);
5182 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1short_1channel_1ids(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5183 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5184 LDKCVec_u64Z val_conv = *(LDKCVec_u64Z*)val;
5186 return ReplyChannelRange_set_short_channel_ids(this_ptr_conv, val_conv);
5189 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1new(JNIEnv * _env, jclass _b, jlong chain_hash_arg, jint first_blocknum_arg, jint number_of_blocks_arg, jboolean full_information_arg, jlong short_channel_ids_arg) {
5190 LDKThirtyTwoBytes chain_hash_arg_conv = *(LDKThirtyTwoBytes*)chain_hash_arg;
5191 FREE((void*)chain_hash_arg);
5192 LDKCVec_u64Z short_channel_ids_arg_conv = *(LDKCVec_u64Z*)short_channel_ids_arg;
5193 FREE((void*)short_channel_ids_arg);
5194 LDKReplyChannelRange* ret = MALLOC(sizeof(LDKReplyChannelRange), "LDKReplyChannelRange");
5195 *ret = ReplyChannelRange_new(chain_hash_arg_conv, first_blocknum_arg, number_of_blocks_arg, full_information_arg, short_channel_ids_arg_conv);
5196 assert(ret->is_owned);
5197 ret->is_owned = false;
5201 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5202 LDKQueryShortChannelIds this_ptr_conv = *(LDKQueryShortChannelIds*)this_ptr;
5203 FREE((void*)this_ptr);
5204 this_ptr_conv.is_owned = true;
5205 return QueryShortChannelIds_free(this_ptr_conv);
5208 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
5209 LDKQueryShortChannelIds* this_ptr_conv = (LDKQueryShortChannelIds*)this_ptr;
5210 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5211 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *QueryShortChannelIds_get_chain_hash(this_ptr_conv));
5215 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5216 LDKQueryShortChannelIds* this_ptr_conv = (LDKQueryShortChannelIds*)this_ptr;
5217 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5219 return QueryShortChannelIds_set_chain_hash(this_ptr_conv, val_conv);
5222 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1short_1channel_1ids(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5223 LDKQueryShortChannelIds* this_ptr_conv = (LDKQueryShortChannelIds*)this_ptr;
5224 LDKCVec_u64Z val_conv = *(LDKCVec_u64Z*)val;
5226 return QueryShortChannelIds_set_short_channel_ids(this_ptr_conv, val_conv);
5229 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1new(JNIEnv * _env, jclass _b, jlong chain_hash_arg, jlong short_channel_ids_arg) {
5230 LDKThirtyTwoBytes chain_hash_arg_conv = *(LDKThirtyTwoBytes*)chain_hash_arg;
5231 FREE((void*)chain_hash_arg);
5232 LDKCVec_u64Z short_channel_ids_arg_conv = *(LDKCVec_u64Z*)short_channel_ids_arg;
5233 FREE((void*)short_channel_ids_arg);
5234 LDKQueryShortChannelIds* ret = MALLOC(sizeof(LDKQueryShortChannelIds), "LDKQueryShortChannelIds");
5235 *ret = QueryShortChannelIds_new(chain_hash_arg_conv, short_channel_ids_arg_conv);
5236 assert(ret->is_owned);
5237 ret->is_owned = false;
5241 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5242 LDKReplyShortChannelIdsEnd this_ptr_conv = *(LDKReplyShortChannelIdsEnd*)this_ptr;
5243 FREE((void*)this_ptr);
5244 this_ptr_conv.is_owned = true;
5245 return ReplyShortChannelIdsEnd_free(this_ptr_conv);
5248 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
5249 LDKReplyShortChannelIdsEnd* this_ptr_conv = (LDKReplyShortChannelIdsEnd*)this_ptr;
5250 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5251 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ReplyShortChannelIdsEnd_get_chain_hash(this_ptr_conv));
5255 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5256 LDKReplyShortChannelIdsEnd* this_ptr_conv = (LDKReplyShortChannelIdsEnd*)this_ptr;
5257 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5259 return ReplyShortChannelIdsEnd_set_chain_hash(this_ptr_conv, val_conv);
5262 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1full_1information(JNIEnv * _env, jclass _b, jlong this_ptr) {
5263 LDKReplyShortChannelIdsEnd* this_ptr_conv = (LDKReplyShortChannelIdsEnd*)this_ptr;
5264 return ReplyShortChannelIdsEnd_get_full_information(this_ptr_conv);
5267 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1full_1information(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
5268 LDKReplyShortChannelIdsEnd* this_ptr_conv = (LDKReplyShortChannelIdsEnd*)this_ptr;
5269 return ReplyShortChannelIdsEnd_set_full_information(this_ptr_conv, val);
5272 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1new(JNIEnv * _env, jclass _b, jlong chain_hash_arg, jboolean full_information_arg) {
5273 LDKThirtyTwoBytes chain_hash_arg_conv = *(LDKThirtyTwoBytes*)chain_hash_arg;
5274 FREE((void*)chain_hash_arg);
5275 LDKReplyShortChannelIdsEnd* ret = MALLOC(sizeof(LDKReplyShortChannelIdsEnd), "LDKReplyShortChannelIdsEnd");
5276 *ret = ReplyShortChannelIdsEnd_new(chain_hash_arg_conv, full_information_arg);
5277 assert(ret->is_owned);
5278 ret->is_owned = false;
5282 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5283 LDKGossipTimestampFilter this_ptr_conv = *(LDKGossipTimestampFilter*)this_ptr;
5284 FREE((void*)this_ptr);
5285 this_ptr_conv.is_owned = true;
5286 return GossipTimestampFilter_free(this_ptr_conv);
5289 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
5290 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
5291 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5292 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *GossipTimestampFilter_get_chain_hash(this_ptr_conv));
5296 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5297 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
5298 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5300 return GossipTimestampFilter_set_chain_hash(this_ptr_conv, val_conv);
5303 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1first_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr) {
5304 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
5305 return GossipTimestampFilter_get_first_timestamp(this_ptr_conv);
5308 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1first_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5309 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
5310 return GossipTimestampFilter_set_first_timestamp(this_ptr_conv, val);
5313 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1timestamp_1range(JNIEnv * _env, jclass _b, jlong this_ptr) {
5314 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
5315 return GossipTimestampFilter_get_timestamp_range(this_ptr_conv);
5318 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1timestamp_1range(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5319 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
5320 return GossipTimestampFilter_set_timestamp_range(this_ptr_conv, val);
5323 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1new(JNIEnv * _env, jclass _b, jlong chain_hash_arg, jint first_timestamp_arg, jint timestamp_range_arg) {
5324 LDKThirtyTwoBytes chain_hash_arg_conv = *(LDKThirtyTwoBytes*)chain_hash_arg;
5325 FREE((void*)chain_hash_arg);
5326 LDKGossipTimestampFilter* ret = MALLOC(sizeof(LDKGossipTimestampFilter), "LDKGossipTimestampFilter");
5327 *ret = GossipTimestampFilter_new(chain_hash_arg_conv, first_timestamp_arg, timestamp_range_arg);
5328 assert(ret->is_owned);
5329 ret->is_owned = false;
5333 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorAction_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5334 LDKErrorAction this_ptr_conv = *(LDKErrorAction*)this_ptr;
5335 FREE((void*)this_ptr);
5336 return ErrorAction_free(this_ptr_conv);
5339 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5340 LDKLightningError this_ptr_conv = *(LDKLightningError*)this_ptr;
5341 FREE((void*)this_ptr);
5342 this_ptr_conv.is_owned = true;
5343 return LightningError_free(this_ptr_conv);
5346 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1err(JNIEnv * _env, jclass _b, jlong this_ptr) {
5347 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
5348 LDKStr* ret = MALLOC(sizeof(LDKStr), "LDKStr");
5349 *ret = LightningError_get_err(this_ptr_conv);
5353 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1err(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5354 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
5355 LDKCVec_u8Z val_conv = *(LDKCVec_u8Z*)val;
5357 return LightningError_set_err(this_ptr_conv, val_conv);
5360 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1action(JNIEnv * _env, jclass _b, jlong this_ptr) {
5361 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
5362 LDKErrorAction* ret = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
5363 *ret = LightningError_get_action(this_ptr_conv);
5367 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1action(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5368 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
5369 LDKErrorAction val_conv = *(LDKErrorAction*)val;
5371 return LightningError_set_action(this_ptr_conv, val_conv);
5374 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1new(JNIEnv * _env, jclass _b, jlong err_arg, jlong action_arg) {
5375 LDKCVec_u8Z err_arg_conv = *(LDKCVec_u8Z*)err_arg;
5376 FREE((void*)err_arg);
5377 LDKErrorAction action_arg_conv = *(LDKErrorAction*)action_arg;
5378 FREE((void*)action_arg);
5379 LDKLightningError* ret = MALLOC(sizeof(LDKLightningError), "LDKLightningError");
5380 *ret = LightningError_new(err_arg_conv, action_arg_conv);
5381 assert(ret->is_owned);
5382 ret->is_owned = false;
5386 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5387 LDKCommitmentUpdate this_ptr_conv = *(LDKCommitmentUpdate*)this_ptr;
5388 FREE((void*)this_ptr);
5389 this_ptr_conv.is_owned = true;
5390 return CommitmentUpdate_free(this_ptr_conv);
5393 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1add_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5394 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
5395 LDKCVec_UpdateAddHTLCZ val_conv = *(LDKCVec_UpdateAddHTLCZ*)val;
5397 return CommitmentUpdate_set_update_add_htlcs(this_ptr_conv, val_conv);
5400 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fulfill_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5401 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
5402 LDKCVec_UpdateFulfillHTLCZ val_conv = *(LDKCVec_UpdateFulfillHTLCZ*)val;
5404 return CommitmentUpdate_set_update_fulfill_htlcs(this_ptr_conv, val_conv);
5407 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5408 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
5409 LDKCVec_UpdateFailHTLCZ val_conv = *(LDKCVec_UpdateFailHTLCZ*)val;
5411 return CommitmentUpdate_set_update_fail_htlcs(this_ptr_conv, val_conv);
5414 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1malformed_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5415 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
5416 LDKCVec_UpdateFailMalformedHTLCZ val_conv = *(LDKCVec_UpdateFailMalformedHTLCZ*)val;
5418 return CommitmentUpdate_set_update_fail_malformed_htlcs(this_ptr_conv, val_conv);
5421 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fee(JNIEnv * _env, jclass _b, jlong this_ptr) {
5422 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
5423 LDKUpdateFee* ret = MALLOC(sizeof(LDKUpdateFee), "LDKUpdateFee");
5424 *ret = CommitmentUpdate_get_update_fee(this_ptr_conv);
5425 assert(ret->is_owned);
5426 ret->is_owned = false;
5430 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fee(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5431 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
5432 LDKUpdateFee val_conv = *(LDKUpdateFee*)val;
5434 val_conv.is_owned = true;
5435 return CommitmentUpdate_set_update_fee(this_ptr_conv, val_conv);
5438 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1commitment_1signed(JNIEnv * _env, jclass _b, jlong this_ptr) {
5439 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
5440 LDKCommitmentSigned* ret = MALLOC(sizeof(LDKCommitmentSigned), "LDKCommitmentSigned");
5441 *ret = CommitmentUpdate_get_commitment_signed(this_ptr_conv);
5442 assert(ret->is_owned);
5443 ret->is_owned = false;
5447 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1commitment_1signed(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5448 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
5449 LDKCommitmentSigned val_conv = *(LDKCommitmentSigned*)val;
5451 val_conv.is_owned = true;
5452 return CommitmentUpdate_set_commitment_signed(this_ptr_conv, val_conv);
5455 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) {
5456 LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg_conv = *(LDKCVec_UpdateAddHTLCZ*)update_add_htlcs_arg;
5457 FREE((void*)update_add_htlcs_arg);
5458 LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg_conv = *(LDKCVec_UpdateFulfillHTLCZ*)update_fulfill_htlcs_arg;
5459 FREE((void*)update_fulfill_htlcs_arg);
5460 LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg_conv = *(LDKCVec_UpdateFailHTLCZ*)update_fail_htlcs_arg;
5461 FREE((void*)update_fail_htlcs_arg);
5462 LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg_conv = *(LDKCVec_UpdateFailMalformedHTLCZ*)update_fail_malformed_htlcs_arg;
5463 FREE((void*)update_fail_malformed_htlcs_arg);
5464 LDKUpdateFee update_fee_arg_conv = *(LDKUpdateFee*)update_fee_arg;
5465 FREE((void*)update_fee_arg);
5466 update_fee_arg_conv.is_owned = true;
5467 LDKCommitmentSigned commitment_signed_arg_conv = *(LDKCommitmentSigned*)commitment_signed_arg;
5468 FREE((void*)commitment_signed_arg);
5469 commitment_signed_arg_conv.is_owned = true;
5470 LDKCommitmentUpdate* ret = MALLOC(sizeof(LDKCommitmentUpdate), "LDKCommitmentUpdate");
5471 *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);
5472 assert(ret->is_owned);
5473 ret->is_owned = false;
5477 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCFailChannelUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5478 LDKHTLCFailChannelUpdate this_ptr_conv = *(LDKHTLCFailChannelUpdate*)this_ptr;
5479 FREE((void*)this_ptr);
5480 return HTLCFailChannelUpdate_free(this_ptr_conv);
5483 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5484 LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)this_ptr;
5485 FREE((void*)this_ptr);
5486 return ChannelMessageHandler_free(this_ptr_conv);
5489 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5490 LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)this_ptr;
5491 FREE((void*)this_ptr);
5492 return RoutingMessageHandler_free(this_ptr_conv);
5495 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1write(JNIEnv * _env, jclass _b, jlong obj) {
5496 LDKAcceptChannel* obj_conv = (LDKAcceptChannel*)obj;
5497 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5498 *ret = AcceptChannel_write(obj_conv);
5502 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1read(JNIEnv * _env, jclass _b, jlong ser) {
5503 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5505 LDKAcceptChannel* ret = MALLOC(sizeof(LDKAcceptChannel), "LDKAcceptChannel");
5506 *ret = AcceptChannel_read(ser_conv);
5507 assert(ret->is_owned);
5508 ret->is_owned = false;
5512 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1write(JNIEnv * _env, jclass _b, jlong obj) {
5513 LDKAnnouncementSignatures* obj_conv = (LDKAnnouncementSignatures*)obj;
5514 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5515 *ret = AnnouncementSignatures_write(obj_conv);
5519 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1read(JNIEnv * _env, jclass _b, jlong ser) {
5520 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5522 LDKAnnouncementSignatures* ret = MALLOC(sizeof(LDKAnnouncementSignatures), "LDKAnnouncementSignatures");
5523 *ret = AnnouncementSignatures_read(ser_conv);
5524 assert(ret->is_owned);
5525 ret->is_owned = false;
5529 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1write(JNIEnv * _env, jclass _b, jlong obj) {
5530 LDKChannelReestablish* obj_conv = (LDKChannelReestablish*)obj;
5531 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5532 *ret = ChannelReestablish_write(obj_conv);
5536 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1read(JNIEnv * _env, jclass _b, jlong ser) {
5537 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5539 LDKChannelReestablish* ret = MALLOC(sizeof(LDKChannelReestablish), "LDKChannelReestablish");
5540 *ret = ChannelReestablish_read(ser_conv);
5541 assert(ret->is_owned);
5542 ret->is_owned = false;
5546 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
5547 LDKClosingSigned* obj_conv = (LDKClosingSigned*)obj;
5548 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5549 *ret = ClosingSigned_write(obj_conv);
5553 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1read(JNIEnv * _env, jclass _b, jlong ser) {
5554 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5556 LDKClosingSigned* ret = MALLOC(sizeof(LDKClosingSigned), "LDKClosingSigned");
5557 *ret = ClosingSigned_read(ser_conv);
5558 assert(ret->is_owned);
5559 ret->is_owned = false;
5563 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
5564 LDKCommitmentSigned* obj_conv = (LDKCommitmentSigned*)obj;
5565 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5566 *ret = CommitmentSigned_write(obj_conv);
5570 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1read(JNIEnv * _env, jclass _b, jlong ser) {
5571 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5573 LDKCommitmentSigned* ret = MALLOC(sizeof(LDKCommitmentSigned), "LDKCommitmentSigned");
5574 *ret = CommitmentSigned_read(ser_conv);
5575 assert(ret->is_owned);
5576 ret->is_owned = false;
5580 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1write(JNIEnv * _env, jclass _b, jlong obj) {
5581 LDKFundingCreated* obj_conv = (LDKFundingCreated*)obj;
5582 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5583 *ret = FundingCreated_write(obj_conv);
5587 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1read(JNIEnv * _env, jclass _b, jlong ser) {
5588 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5590 LDKFundingCreated* ret = MALLOC(sizeof(LDKFundingCreated), "LDKFundingCreated");
5591 *ret = FundingCreated_read(ser_conv);
5592 assert(ret->is_owned);
5593 ret->is_owned = false;
5597 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
5598 LDKFundingSigned* obj_conv = (LDKFundingSigned*)obj;
5599 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5600 *ret = FundingSigned_write(obj_conv);
5604 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1read(JNIEnv * _env, jclass _b, jlong ser) {
5605 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5607 LDKFundingSigned* ret = MALLOC(sizeof(LDKFundingSigned), "LDKFundingSigned");
5608 *ret = FundingSigned_read(ser_conv);
5609 assert(ret->is_owned);
5610 ret->is_owned = false;
5614 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1write(JNIEnv * _env, jclass _b, jlong obj) {
5615 LDKFundingLocked* obj_conv = (LDKFundingLocked*)obj;
5616 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5617 *ret = FundingLocked_write(obj_conv);
5621 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1read(JNIEnv * _env, jclass _b, jlong ser) {
5622 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5624 LDKFundingLocked* ret = MALLOC(sizeof(LDKFundingLocked), "LDKFundingLocked");
5625 *ret = FundingLocked_read(ser_conv);
5626 assert(ret->is_owned);
5627 ret->is_owned = false;
5631 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1write(JNIEnv * _env, jclass _b, jlong obj) {
5632 LDKInit* obj_conv = (LDKInit*)obj;
5633 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5634 *ret = Init_write(obj_conv);
5638 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1read(JNIEnv * _env, jclass _b, jlong ser) {
5639 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5641 LDKInit* ret = MALLOC(sizeof(LDKInit), "LDKInit");
5642 *ret = Init_read(ser_conv);
5643 assert(ret->is_owned);
5644 ret->is_owned = false;
5648 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1write(JNIEnv * _env, jclass _b, jlong obj) {
5649 LDKOpenChannel* obj_conv = (LDKOpenChannel*)obj;
5650 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5651 *ret = OpenChannel_write(obj_conv);
5655 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1read(JNIEnv * _env, jclass _b, jlong ser) {
5656 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5658 LDKOpenChannel* ret = MALLOC(sizeof(LDKOpenChannel), "LDKOpenChannel");
5659 *ret = OpenChannel_read(ser_conv);
5660 assert(ret->is_owned);
5661 ret->is_owned = false;
5665 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1write(JNIEnv * _env, jclass _b, jlong obj) {
5666 LDKRevokeAndACK* obj_conv = (LDKRevokeAndACK*)obj;
5667 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5668 *ret = RevokeAndACK_write(obj_conv);
5672 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1read(JNIEnv * _env, jclass _b, jlong ser) {
5673 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5675 LDKRevokeAndACK* ret = MALLOC(sizeof(LDKRevokeAndACK), "LDKRevokeAndACK");
5676 *ret = RevokeAndACK_read(ser_conv);
5677 assert(ret->is_owned);
5678 ret->is_owned = false;
5682 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1write(JNIEnv * _env, jclass _b, jlong obj) {
5683 LDKShutdown* obj_conv = (LDKShutdown*)obj;
5684 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5685 *ret = Shutdown_write(obj_conv);
5689 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1read(JNIEnv * _env, jclass _b, jlong ser) {
5690 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5692 LDKShutdown* ret = MALLOC(sizeof(LDKShutdown), "LDKShutdown");
5693 *ret = Shutdown_read(ser_conv);
5694 assert(ret->is_owned);
5695 ret->is_owned = false;
5699 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
5700 LDKUpdateFailHTLC* obj_conv = (LDKUpdateFailHTLC*)obj;
5701 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5702 *ret = UpdateFailHTLC_write(obj_conv);
5706 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
5707 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5709 LDKUpdateFailHTLC* ret = MALLOC(sizeof(LDKUpdateFailHTLC), "LDKUpdateFailHTLC");
5710 *ret = UpdateFailHTLC_read(ser_conv);
5711 assert(ret->is_owned);
5712 ret->is_owned = false;
5716 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
5717 LDKUpdateFailMalformedHTLC* obj_conv = (LDKUpdateFailMalformedHTLC*)obj;
5718 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5719 *ret = UpdateFailMalformedHTLC_write(obj_conv);
5723 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
5724 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5726 LDKUpdateFailMalformedHTLC* ret = MALLOC(sizeof(LDKUpdateFailMalformedHTLC), "LDKUpdateFailMalformedHTLC");
5727 *ret = UpdateFailMalformedHTLC_read(ser_conv);
5728 assert(ret->is_owned);
5729 ret->is_owned = false;
5733 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1write(JNIEnv * _env, jclass _b, jlong obj) {
5734 LDKUpdateFee* obj_conv = (LDKUpdateFee*)obj;
5735 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5736 *ret = UpdateFee_write(obj_conv);
5740 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1read(JNIEnv * _env, jclass _b, jlong ser) {
5741 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5743 LDKUpdateFee* ret = MALLOC(sizeof(LDKUpdateFee), "LDKUpdateFee");
5744 *ret = UpdateFee_read(ser_conv);
5745 assert(ret->is_owned);
5746 ret->is_owned = false;
5750 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
5751 LDKUpdateFulfillHTLC* obj_conv = (LDKUpdateFulfillHTLC*)obj;
5752 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5753 *ret = UpdateFulfillHTLC_write(obj_conv);
5757 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
5758 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5760 LDKUpdateFulfillHTLC* ret = MALLOC(sizeof(LDKUpdateFulfillHTLC), "LDKUpdateFulfillHTLC");
5761 *ret = UpdateFulfillHTLC_read(ser_conv);
5762 assert(ret->is_owned);
5763 ret->is_owned = false;
5767 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
5768 LDKUpdateAddHTLC* obj_conv = (LDKUpdateAddHTLC*)obj;
5769 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5770 *ret = UpdateAddHTLC_write(obj_conv);
5774 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
5775 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5777 LDKUpdateAddHTLC* ret = MALLOC(sizeof(LDKUpdateAddHTLC), "LDKUpdateAddHTLC");
5778 *ret = UpdateAddHTLC_read(ser_conv);
5779 assert(ret->is_owned);
5780 ret->is_owned = false;
5784 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1write(JNIEnv * _env, jclass _b, jlong obj) {
5785 LDKPing* obj_conv = (LDKPing*)obj;
5786 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5787 *ret = Ping_write(obj_conv);
5791 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1read(JNIEnv * _env, jclass _b, jlong ser) {
5792 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5794 LDKPing* ret = MALLOC(sizeof(LDKPing), "LDKPing");
5795 *ret = Ping_read(ser_conv);
5796 assert(ret->is_owned);
5797 ret->is_owned = false;
5801 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1write(JNIEnv * _env, jclass _b, jlong obj) {
5802 LDKPong* obj_conv = (LDKPong*)obj;
5803 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5804 *ret = Pong_write(obj_conv);
5808 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1read(JNIEnv * _env, jclass _b, jlong ser) {
5809 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5811 LDKPong* ret = MALLOC(sizeof(LDKPong), "LDKPong");
5812 *ret = Pong_read(ser_conv);
5813 assert(ret->is_owned);
5814 ret->is_owned = false;
5818 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
5819 LDKUnsignedChannelAnnouncement* obj_conv = (LDKUnsignedChannelAnnouncement*)obj;
5820 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5821 *ret = UnsignedChannelAnnouncement_write(obj_conv);
5825 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
5826 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5828 LDKUnsignedChannelAnnouncement* ret = MALLOC(sizeof(LDKUnsignedChannelAnnouncement), "LDKUnsignedChannelAnnouncement");
5829 *ret = UnsignedChannelAnnouncement_read(ser_conv);
5830 assert(ret->is_owned);
5831 ret->is_owned = false;
5835 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
5836 LDKChannelAnnouncement* obj_conv = (LDKChannelAnnouncement*)obj;
5837 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5838 *ret = ChannelAnnouncement_write(obj_conv);
5842 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
5843 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5845 LDKChannelAnnouncement* ret = MALLOC(sizeof(LDKChannelAnnouncement), "LDKChannelAnnouncement");
5846 *ret = ChannelAnnouncement_read(ser_conv);
5847 assert(ret->is_owned);
5848 ret->is_owned = false;
5852 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
5853 LDKUnsignedChannelUpdate* obj_conv = (LDKUnsignedChannelUpdate*)obj;
5854 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5855 *ret = UnsignedChannelUpdate_write(obj_conv);
5859 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
5860 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5862 LDKUnsignedChannelUpdate* ret = MALLOC(sizeof(LDKUnsignedChannelUpdate), "LDKUnsignedChannelUpdate");
5863 *ret = UnsignedChannelUpdate_read(ser_conv);
5864 assert(ret->is_owned);
5865 ret->is_owned = false;
5869 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
5870 LDKChannelUpdate* obj_conv = (LDKChannelUpdate*)obj;
5871 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5872 *ret = ChannelUpdate_write(obj_conv);
5876 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
5877 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5879 LDKChannelUpdate* ret = MALLOC(sizeof(LDKChannelUpdate), "LDKChannelUpdate");
5880 *ret = ChannelUpdate_read(ser_conv);
5881 assert(ret->is_owned);
5882 ret->is_owned = false;
5886 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1write(JNIEnv * _env, jclass _b, jlong obj) {
5887 LDKErrorMessage* obj_conv = (LDKErrorMessage*)obj;
5888 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5889 *ret = ErrorMessage_write(obj_conv);
5893 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1read(JNIEnv * _env, jclass _b, jlong ser) {
5894 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5896 LDKErrorMessage* ret = MALLOC(sizeof(LDKErrorMessage), "LDKErrorMessage");
5897 *ret = ErrorMessage_read(ser_conv);
5898 assert(ret->is_owned);
5899 ret->is_owned = false;
5903 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
5904 LDKUnsignedNodeAnnouncement* obj_conv = (LDKUnsignedNodeAnnouncement*)obj;
5905 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5906 *ret = UnsignedNodeAnnouncement_write(obj_conv);
5910 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
5911 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5913 LDKUnsignedNodeAnnouncement* ret = MALLOC(sizeof(LDKUnsignedNodeAnnouncement), "LDKUnsignedNodeAnnouncement");
5914 *ret = UnsignedNodeAnnouncement_read(ser_conv);
5915 assert(ret->is_owned);
5916 ret->is_owned = false;
5920 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
5921 LDKNodeAnnouncement* obj_conv = (LDKNodeAnnouncement*)obj;
5922 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5923 *ret = NodeAnnouncement_write(obj_conv);
5927 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
5928 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5930 LDKNodeAnnouncement* ret = MALLOC(sizeof(LDKNodeAnnouncement), "LDKNodeAnnouncement");
5931 *ret = NodeAnnouncement_read(ser_conv);
5932 assert(ret->is_owned);
5933 ret->is_owned = false;
5937 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1read(JNIEnv * _env, jclass _b, jlong ser) {
5938 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5940 LDKQueryShortChannelIds* ret = MALLOC(sizeof(LDKQueryShortChannelIds), "LDKQueryShortChannelIds");
5941 *ret = QueryShortChannelIds_read(ser_conv);
5942 assert(ret->is_owned);
5943 ret->is_owned = false;
5947 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1write(JNIEnv * _env, jclass _b, jlong obj) {
5948 LDKQueryShortChannelIds* obj_conv = (LDKQueryShortChannelIds*)obj;
5949 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5950 *ret = QueryShortChannelIds_write(obj_conv);
5954 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1read(JNIEnv * _env, jclass _b, jlong ser) {
5955 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5957 LDKReplyShortChannelIdsEnd* ret = MALLOC(sizeof(LDKReplyShortChannelIdsEnd), "LDKReplyShortChannelIdsEnd");
5958 *ret = ReplyShortChannelIdsEnd_read(ser_conv);
5959 assert(ret->is_owned);
5960 ret->is_owned = false;
5964 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1write(JNIEnv * _env, jclass _b, jlong obj) {
5965 LDKReplyShortChannelIdsEnd* obj_conv = (LDKReplyShortChannelIdsEnd*)obj;
5966 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5967 *ret = ReplyShortChannelIdsEnd_write(obj_conv);
5971 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1read(JNIEnv * _env, jclass _b, jlong ser) {
5972 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5974 LDKQueryChannelRange* ret = MALLOC(sizeof(LDKQueryChannelRange), "LDKQueryChannelRange");
5975 *ret = QueryChannelRange_read(ser_conv);
5976 assert(ret->is_owned);
5977 ret->is_owned = false;
5981 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1write(JNIEnv * _env, jclass _b, jlong obj) {
5982 LDKQueryChannelRange* obj_conv = (LDKQueryChannelRange*)obj;
5983 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5984 *ret = QueryChannelRange_write(obj_conv);
5988 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1read(JNIEnv * _env, jclass _b, jlong ser) {
5989 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5991 LDKReplyChannelRange* ret = MALLOC(sizeof(LDKReplyChannelRange), "LDKReplyChannelRange");
5992 *ret = ReplyChannelRange_read(ser_conv);
5993 assert(ret->is_owned);
5994 ret->is_owned = false;
5998 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1write(JNIEnv * _env, jclass _b, jlong obj) {
5999 LDKReplyChannelRange* obj_conv = (LDKReplyChannelRange*)obj;
6000 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6001 *ret = ReplyChannelRange_write(obj_conv);
6005 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1read(JNIEnv * _env, jclass _b, jlong ser) {
6006 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6008 LDKGossipTimestampFilter* ret = MALLOC(sizeof(LDKGossipTimestampFilter), "LDKGossipTimestampFilter");
6009 *ret = GossipTimestampFilter_read(ser_conv);
6010 assert(ret->is_owned);
6011 ret->is_owned = false;
6015 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1write(JNIEnv * _env, jclass _b, jlong obj) {
6016 LDKGossipTimestampFilter* obj_conv = (LDKGossipTimestampFilter*)obj;
6017 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6018 *ret = GossipTimestampFilter_write(obj_conv);
6022 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6023 LDKMessageHandler this_ptr_conv = *(LDKMessageHandler*)this_ptr;
6024 FREE((void*)this_ptr);
6025 this_ptr_conv.is_owned = true;
6026 return MessageHandler_free(this_ptr_conv);
6029 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1chan_1handler(JNIEnv * _env, jclass _b, jlong this_ptr) {
6030 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
6031 long ret = (long)MessageHandler_get_chan_handler(this_ptr_conv);
6035 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1chan_1handler(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6036 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
6037 LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)val;
6038 if (val_conv.free == LDKChannelMessageHandler_JCalls_free) {
6039 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
6040 LDKChannelMessageHandler_JCalls_clone(val_conv.this_arg);
6042 return MessageHandler_set_chan_handler(this_ptr_conv, val_conv);
6045 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1route_1handler(JNIEnv * _env, jclass _b, jlong this_ptr) {
6046 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
6047 long ret = (long)MessageHandler_get_route_handler(this_ptr_conv);
6051 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1route_1handler(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6052 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
6053 LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)val;
6054 if (val_conv.free == LDKRoutingMessageHandler_JCalls_free) {
6055 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
6056 LDKRoutingMessageHandler_JCalls_clone(val_conv.this_arg);
6058 return MessageHandler_set_route_handler(this_ptr_conv, val_conv);
6061 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new(JNIEnv * _env, jclass _b, jlong chan_handler_arg, jlong route_handler_arg) {
6062 LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)chan_handler_arg;
6063 if (chan_handler_arg_conv.free == LDKChannelMessageHandler_JCalls_free) {
6064 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
6065 LDKChannelMessageHandler_JCalls_clone(chan_handler_arg_conv.this_arg);
6067 LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)route_handler_arg;
6068 if (route_handler_arg_conv.free == LDKRoutingMessageHandler_JCalls_free) {
6069 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
6070 LDKRoutingMessageHandler_JCalls_clone(route_handler_arg_conv.this_arg);
6072 LDKMessageHandler* ret = MALLOC(sizeof(LDKMessageHandler), "LDKMessageHandler");
6073 *ret = MessageHandler_new(chan_handler_arg_conv, route_handler_arg_conv);
6074 assert(ret->is_owned);
6075 ret->is_owned = false;
6079 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6080 LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)this_ptr;
6081 FREE((void*)this_ptr);
6082 return SocketDescriptor_free(this_ptr_conv);
6085 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6086 LDKPeerHandleError this_ptr_conv = *(LDKPeerHandleError*)this_ptr;
6087 FREE((void*)this_ptr);
6088 this_ptr_conv.is_owned = true;
6089 return PeerHandleError_free(this_ptr_conv);
6092 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1get_1no_1connection_1possible(JNIEnv * _env, jclass _b, jlong this_ptr) {
6093 LDKPeerHandleError* this_ptr_conv = (LDKPeerHandleError*)this_ptr;
6094 return PeerHandleError_get_no_connection_possible(this_ptr_conv);
6097 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1set_1no_1connection_1possible(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
6098 LDKPeerHandleError* this_ptr_conv = (LDKPeerHandleError*)this_ptr;
6099 return PeerHandleError_set_no_connection_possible(this_ptr_conv, val);
6102 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new(JNIEnv * _env, jclass _b, jboolean no_connection_possible_arg) {
6103 LDKPeerHandleError* ret = MALLOC(sizeof(LDKPeerHandleError), "LDKPeerHandleError");
6104 *ret = PeerHandleError_new(no_connection_possible_arg);
6105 assert(ret->is_owned);
6106 ret->is_owned = false;
6110 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6111 LDKPeerManager this_ptr_conv = *(LDKPeerManager*)this_ptr;
6112 FREE((void*)this_ptr);
6113 this_ptr_conv.is_owned = true;
6114 return PeerManager_free(this_ptr_conv);
6117 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) {
6118 LDKMessageHandler message_handler_conv = *(LDKMessageHandler*)message_handler;
6119 FREE((void*)message_handler);
6120 message_handler_conv.is_owned = true;
6121 LDKSecretKey our_node_secret_conv = *(LDKSecretKey*)our_node_secret;
6122 FREE((void*)our_node_secret);
6123 unsigned char ephemeral_random_data_arr[32];
6124 (*_env)->GetByteArrayRegion (_env, ephemeral_random_data, 0, 32, ephemeral_random_data_arr);
6125 unsigned char (*ephemeral_random_data_ref)[32] = &ephemeral_random_data_arr;
6126 LDKLogger logger_conv = *(LDKLogger*)logger;
6127 if (logger_conv.free == LDKLogger_JCalls_free) {
6128 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
6129 LDKLogger_JCalls_clone(logger_conv.this_arg);
6131 LDKPeerManager* ret = MALLOC(sizeof(LDKPeerManager), "LDKPeerManager");
6132 *ret = PeerManager_new(message_handler_conv, our_node_secret_conv, ephemeral_random_data_ref, logger_conv);
6133 assert(ret->is_owned);
6134 ret->is_owned = false;
6138 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1get_1peer_1node_1ids(JNIEnv * _env, jclass _b, jlong this_arg) {
6139 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
6140 LDKCVec_PublicKeyZ* ret = MALLOC(sizeof(LDKCVec_PublicKeyZ), "LDKCVec_PublicKeyZ");
6141 *ret = PeerManager_get_peer_node_ids(this_arg_conv);
6145 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) {
6146 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
6147 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
6148 FREE((void*)their_node_id);
6149 LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)descriptor;
6150 if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
6151 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
6152 LDKSocketDescriptor_JCalls_clone(descriptor_conv.this_arg);
6154 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
6155 *ret = PeerManager_new_outbound_connection(this_arg_conv, their_node_id_conv, descriptor_conv);
6159 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1inbound_1connection(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) {
6160 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
6161 LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)descriptor;
6162 if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
6163 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
6164 LDKSocketDescriptor_JCalls_clone(descriptor_conv.this_arg);
6166 LDKCResult_NonePeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
6167 *ret = PeerManager_new_inbound_connection(this_arg_conv, descriptor_conv);
6171 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1write_1buffer_1space_1avail(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) {
6172 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
6173 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor;
6174 LDKCResult_NonePeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
6175 *ret = PeerManager_write_buffer_space_avail(this_arg_conv, descriptor_conv);
6179 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1read_1event(JNIEnv * _env, jclass _b, jlong this_arg, jlong peer_descriptor, jlong data) {
6180 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
6181 LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor;
6182 LDKu8slice data_conv = *(LDKu8slice*)data;
6184 LDKCResult_boolPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
6185 *ret = PeerManager_read_event(this_arg_conv, peer_descriptor_conv, data_conv);
6189 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1process_1events(JNIEnv * _env, jclass _b, jlong this_arg) {
6190 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
6191 return PeerManager_process_events(this_arg_conv);
6194 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1socket_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) {
6195 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
6196 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor;
6197 return PeerManager_socket_disconnected(this_arg_conv, descriptor_conv);
6200 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1timer_1tick_1occured(JNIEnv * _env, jclass _b, jlong this_arg) {
6201 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
6202 return PeerManager_timer_tick_occured(this_arg_conv);
6205 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_build_1commitment_1secret(JNIEnv * _env, jclass _b, jbyteArray commitment_seed, jlong idx) {
6206 unsigned char commitment_seed_arr[32];
6207 (*_env)->GetByteArrayRegion (_env, commitment_seed, 0, 32, commitment_seed_arr);
6208 unsigned char (*commitment_seed_ref)[32] = &commitment_seed_arr;
6209 LDKThirtyTwoBytes* ret = MALLOC(sizeof(LDKThirtyTwoBytes), "LDKThirtyTwoBytes");
6210 *ret = build_commitment_secret(commitment_seed_ref, idx);
6214 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1private_1key(JNIEnv * _env, jclass _b, jlong per_commitment_point, jbyteArray base_secret) {
6215 LDKPublicKey per_commitment_point_conv = *(LDKPublicKey*)per_commitment_point;
6216 FREE((void*)per_commitment_point);
6217 unsigned char base_secret_arr[32];
6218 (*_env)->GetByteArrayRegion (_env, base_secret, 0, 32, base_secret_arr);
6219 unsigned char (*base_secret_ref)[32] = &base_secret_arr;
6220 LDKCResult_SecretKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ");
6221 *ret = derive_private_key(per_commitment_point_conv, base_secret_ref);
6225 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1public_1key(JNIEnv * _env, jclass _b, jlong per_commitment_point, jlong base_point) {
6226 LDKPublicKey per_commitment_point_conv = *(LDKPublicKey*)per_commitment_point;
6227 FREE((void*)per_commitment_point);
6228 LDKPublicKey base_point_conv = *(LDKPublicKey*)base_point;
6229 FREE((void*)base_point);
6230 LDKCResult_PublicKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ");
6231 *ret = derive_public_key(per_commitment_point_conv, base_point_conv);
6235 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1private_1revocation_1key(JNIEnv * _env, jclass _b, jbyteArray per_commitment_secret, jbyteArray countersignatory_revocation_base_secret) {
6236 unsigned char per_commitment_secret_arr[32];
6237 (*_env)->GetByteArrayRegion (_env, per_commitment_secret, 0, 32, per_commitment_secret_arr);
6238 unsigned char (*per_commitment_secret_ref)[32] = &per_commitment_secret_arr;
6239 unsigned char countersignatory_revocation_base_secret_arr[32];
6240 (*_env)->GetByteArrayRegion (_env, countersignatory_revocation_base_secret, 0, 32, countersignatory_revocation_base_secret_arr);
6241 unsigned char (*countersignatory_revocation_base_secret_ref)[32] = &countersignatory_revocation_base_secret_arr;
6242 LDKCResult_SecretKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ");
6243 *ret = derive_private_revocation_key(per_commitment_secret_ref, countersignatory_revocation_base_secret_ref);
6247 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1public_1revocation_1key(JNIEnv * _env, jclass _b, jlong per_commitment_point, jlong countersignatory_revocation_base_point) {
6248 LDKPublicKey per_commitment_point_conv = *(LDKPublicKey*)per_commitment_point;
6249 FREE((void*)per_commitment_point);
6250 LDKPublicKey countersignatory_revocation_base_point_conv = *(LDKPublicKey*)countersignatory_revocation_base_point;
6251 FREE((void*)countersignatory_revocation_base_point);
6252 LDKCResult_PublicKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ");
6253 *ret = derive_public_revocation_key(per_commitment_point_conv, countersignatory_revocation_base_point_conv);
6257 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6258 LDKTxCreationKeys this_ptr_conv = *(LDKTxCreationKeys*)this_ptr;
6259 FREE((void*)this_ptr);
6260 this_ptr_conv.is_owned = true;
6261 return TxCreationKeys_free(this_ptr_conv);
6264 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
6265 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6266 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6267 *ret = TxCreationKeys_get_per_commitment_point(this_ptr_conv);
6271 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6272 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6273 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6275 return TxCreationKeys_set_per_commitment_point(this_ptr_conv, val_conv);
6278 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1revocation_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
6279 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6280 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6281 *ret = TxCreationKeys_get_revocation_key(this_ptr_conv);
6285 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1revocation_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6286 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6287 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6289 return TxCreationKeys_set_revocation_key(this_ptr_conv, val_conv);
6292 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
6293 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6294 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6295 *ret = TxCreationKeys_get_broadcaster_htlc_key(this_ptr_conv);
6299 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6300 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6301 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6303 return TxCreationKeys_set_broadcaster_htlc_key(this_ptr_conv, val_conv);
6306 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1countersignatory_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
6307 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6308 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6309 *ret = TxCreationKeys_get_countersignatory_htlc_key(this_ptr_conv);
6313 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1countersignatory_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6314 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6315 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6317 return TxCreationKeys_set_countersignatory_htlc_key(this_ptr_conv, val_conv);
6320 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1delayed_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
6321 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6322 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6323 *ret = TxCreationKeys_get_broadcaster_delayed_payment_key(this_ptr_conv);
6327 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1delayed_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6328 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6329 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6331 return TxCreationKeys_set_broadcaster_delayed_payment_key(this_ptr_conv, val_conv);
6334 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1new(JNIEnv * _env, jclass _b, jlong per_commitment_point_arg, jlong revocation_key_arg, jlong broadcaster_htlc_key_arg, jlong countersignatory_htlc_key_arg, jlong broadcaster_delayed_payment_key_arg) {
6335 LDKPublicKey per_commitment_point_arg_conv = *(LDKPublicKey*)per_commitment_point_arg;
6336 FREE((void*)per_commitment_point_arg);
6337 LDKPublicKey revocation_key_arg_conv = *(LDKPublicKey*)revocation_key_arg;
6338 FREE((void*)revocation_key_arg);
6339 LDKPublicKey broadcaster_htlc_key_arg_conv = *(LDKPublicKey*)broadcaster_htlc_key_arg;
6340 FREE((void*)broadcaster_htlc_key_arg);
6341 LDKPublicKey countersignatory_htlc_key_arg_conv = *(LDKPublicKey*)countersignatory_htlc_key_arg;
6342 FREE((void*)countersignatory_htlc_key_arg);
6343 LDKPublicKey broadcaster_delayed_payment_key_arg_conv = *(LDKPublicKey*)broadcaster_delayed_payment_key_arg;
6344 FREE((void*)broadcaster_delayed_payment_key_arg);
6345 LDKTxCreationKeys* ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
6346 *ret = TxCreationKeys_new(per_commitment_point_arg_conv, revocation_key_arg_conv, broadcaster_htlc_key_arg_conv, countersignatory_htlc_key_arg_conv, broadcaster_delayed_payment_key_arg_conv);
6347 assert(ret->is_owned);
6348 ret->is_owned = false;
6352 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1write(JNIEnv * _env, jclass _b, jlong obj) {
6353 LDKTxCreationKeys* obj_conv = (LDKTxCreationKeys*)obj;
6354 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6355 *ret = TxCreationKeys_write(obj_conv);
6359 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1read(JNIEnv * _env, jclass _b, jlong ser) {
6360 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6362 LDKTxCreationKeys* ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
6363 *ret = TxCreationKeys_read(ser_conv);
6364 assert(ret->is_owned);
6365 ret->is_owned = false;
6369 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6370 LDKPreCalculatedTxCreationKeys this_ptr_conv = *(LDKPreCalculatedTxCreationKeys*)this_ptr;
6371 FREE((void*)this_ptr);
6372 this_ptr_conv.is_owned = true;
6373 return PreCalculatedTxCreationKeys_free(this_ptr_conv);
6376 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1new(JNIEnv * _env, jclass _b, jlong keys) {
6377 LDKTxCreationKeys keys_conv = *(LDKTxCreationKeys*)keys;
6379 keys_conv.is_owned = true;
6380 LDKPreCalculatedTxCreationKeys* ret = MALLOC(sizeof(LDKPreCalculatedTxCreationKeys), "LDKPreCalculatedTxCreationKeys");
6381 *ret = PreCalculatedTxCreationKeys_new(keys_conv);
6382 assert(ret->is_owned);
6383 ret->is_owned = false;
6387 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1trust_1key_1derivation(JNIEnv * _env, jclass _b, jlong this_arg) {
6388 LDKPreCalculatedTxCreationKeys* this_arg_conv = (LDKPreCalculatedTxCreationKeys*)this_arg;
6389 LDKTxCreationKeys* ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
6390 *ret = PreCalculatedTxCreationKeys_trust_key_derivation(this_arg_conv);
6391 assert(ret->is_owned);
6392 ret->is_owned = false;
6396 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_arg) {
6397 LDKPreCalculatedTxCreationKeys* this_arg_conv = (LDKPreCalculatedTxCreationKeys*)this_arg;
6398 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6399 *ret = PreCalculatedTxCreationKeys_per_commitment_point(this_arg_conv);
6403 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6404 LDKChannelPublicKeys this_ptr_conv = *(LDKChannelPublicKeys*)this_ptr;
6405 FREE((void*)this_ptr);
6406 this_ptr_conv.is_owned = true;
6407 return ChannelPublicKeys_free(this_ptr_conv);
6410 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
6411 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
6412 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6413 *ret = ChannelPublicKeys_get_funding_pubkey(this_ptr_conv);
6417 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6418 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
6419 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6421 return ChannelPublicKeys_set_funding_pubkey(this_ptr_conv, val_conv);
6424 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
6425 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
6426 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6427 *ret = ChannelPublicKeys_get_revocation_basepoint(this_ptr_conv);
6431 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6432 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
6433 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6435 return ChannelPublicKeys_set_revocation_basepoint(this_ptr_conv, val_conv);
6438 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
6439 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
6440 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6441 *ret = ChannelPublicKeys_get_payment_point(this_ptr_conv);
6445 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6446 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
6447 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6449 return ChannelPublicKeys_set_payment_point(this_ptr_conv, val_conv);
6452 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
6453 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
6454 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6455 *ret = ChannelPublicKeys_get_delayed_payment_basepoint(this_ptr_conv);
6459 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6460 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
6461 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6463 return ChannelPublicKeys_set_delayed_payment_basepoint(this_ptr_conv, val_conv);
6466 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
6467 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
6468 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6469 *ret = ChannelPublicKeys_get_htlc_basepoint(this_ptr_conv);
6473 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6474 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
6475 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6477 return ChannelPublicKeys_set_htlc_basepoint(this_ptr_conv, val_conv);
6480 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) {
6481 LDKPublicKey funding_pubkey_arg_conv = *(LDKPublicKey*)funding_pubkey_arg;
6482 FREE((void*)funding_pubkey_arg);
6483 LDKPublicKey revocation_basepoint_arg_conv = *(LDKPublicKey*)revocation_basepoint_arg;
6484 FREE((void*)revocation_basepoint_arg);
6485 LDKPublicKey payment_point_arg_conv = *(LDKPublicKey*)payment_point_arg;
6486 FREE((void*)payment_point_arg);
6487 LDKPublicKey delayed_payment_basepoint_arg_conv = *(LDKPublicKey*)delayed_payment_basepoint_arg;
6488 FREE((void*)delayed_payment_basepoint_arg);
6489 LDKPublicKey htlc_basepoint_arg_conv = *(LDKPublicKey*)htlc_basepoint_arg;
6490 FREE((void*)htlc_basepoint_arg);
6491 LDKChannelPublicKeys* ret = MALLOC(sizeof(LDKChannelPublicKeys), "LDKChannelPublicKeys");
6492 *ret = ChannelPublicKeys_new(funding_pubkey_arg_conv, revocation_basepoint_arg_conv, payment_point_arg_conv, delayed_payment_basepoint_arg_conv, htlc_basepoint_arg_conv);
6493 assert(ret->is_owned);
6494 ret->is_owned = false;
6498 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1write(JNIEnv * _env, jclass _b, jlong obj) {
6499 LDKChannelPublicKeys* obj_conv = (LDKChannelPublicKeys*)obj;
6500 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6501 *ret = ChannelPublicKeys_write(obj_conv);
6505 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1read(JNIEnv * _env, jclass _b, jlong ser) {
6506 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6508 LDKChannelPublicKeys* ret = MALLOC(sizeof(LDKChannelPublicKeys), "LDKChannelPublicKeys");
6509 *ret = ChannelPublicKeys_read(ser_conv);
6510 assert(ret->is_owned);
6511 ret->is_owned = false;
6515 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1derive_1new(JNIEnv * _env, jclass _b, jlong per_commitment_point, jlong broadcaster_delayed_payment_base, jlong broadcaster_htlc_base, jlong countersignatory_revocation_base, jlong countersignatory_htlc_base) {
6516 LDKPublicKey per_commitment_point_conv = *(LDKPublicKey*)per_commitment_point;
6517 FREE((void*)per_commitment_point);
6518 LDKPublicKey broadcaster_delayed_payment_base_conv = *(LDKPublicKey*)broadcaster_delayed_payment_base;
6519 FREE((void*)broadcaster_delayed_payment_base);
6520 LDKPublicKey broadcaster_htlc_base_conv = *(LDKPublicKey*)broadcaster_htlc_base;
6521 FREE((void*)broadcaster_htlc_base);
6522 LDKPublicKey countersignatory_revocation_base_conv = *(LDKPublicKey*)countersignatory_revocation_base;
6523 FREE((void*)countersignatory_revocation_base);
6524 LDKPublicKey countersignatory_htlc_base_conv = *(LDKPublicKey*)countersignatory_htlc_base;
6525 FREE((void*)countersignatory_htlc_base);
6526 LDKCResult_TxCreationKeysSecpErrorZ* ret = MALLOC(sizeof(LDKCResult_TxCreationKeysSecpErrorZ), "LDKCResult_TxCreationKeysSecpErrorZ");
6527 *ret = TxCreationKeys_derive_new(per_commitment_point_conv, broadcaster_delayed_payment_base_conv, broadcaster_htlc_base_conv, countersignatory_revocation_base_conv, countersignatory_htlc_base_conv);
6531 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_get_1revokeable_1redeemscript(JNIEnv * _env, jclass _b, jlong revocation_key, jshort contest_delay, jlong broadcaster_delayed_payment_key) {
6532 LDKPublicKey revocation_key_conv = *(LDKPublicKey*)revocation_key;
6533 FREE((void*)revocation_key);
6534 LDKPublicKey broadcaster_delayed_payment_key_conv = *(LDKPublicKey*)broadcaster_delayed_payment_key;
6535 FREE((void*)broadcaster_delayed_payment_key);
6536 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6537 *ret = get_revokeable_redeemscript(revocation_key_conv, contest_delay, broadcaster_delayed_payment_key_conv);
6541 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6542 LDKHTLCOutputInCommitment this_ptr_conv = *(LDKHTLCOutputInCommitment*)this_ptr;
6543 FREE((void*)this_ptr);
6544 this_ptr_conv.is_owned = true;
6545 return HTLCOutputInCommitment_free(this_ptr_conv);
6548 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1offered(JNIEnv * _env, jclass _b, jlong this_ptr) {
6549 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
6550 return HTLCOutputInCommitment_get_offered(this_ptr_conv);
6553 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1offered(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
6554 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
6555 return HTLCOutputInCommitment_set_offered(this_ptr_conv, val);
6558 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
6559 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
6560 return HTLCOutputInCommitment_get_amount_msat(this_ptr_conv);
6563 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6564 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
6565 return HTLCOutputInCommitment_set_amount_msat(this_ptr_conv, val);
6568 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr) {
6569 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
6570 return HTLCOutputInCommitment_get_cltv_expiry(this_ptr_conv);
6573 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6574 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
6575 return HTLCOutputInCommitment_set_cltv_expiry(this_ptr_conv, val);
6578 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
6579 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
6580 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6581 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *HTLCOutputInCommitment_get_payment_hash(this_ptr_conv));
6585 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6586 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
6587 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
6589 return HTLCOutputInCommitment_set_payment_hash(this_ptr_conv, val_conv);
6592 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1write(JNIEnv * _env, jclass _b, jlong obj) {
6593 LDKHTLCOutputInCommitment* obj_conv = (LDKHTLCOutputInCommitment*)obj;
6594 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6595 *ret = HTLCOutputInCommitment_write(obj_conv);
6599 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1read(JNIEnv * _env, jclass _b, jlong ser) {
6600 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6602 LDKHTLCOutputInCommitment* ret = MALLOC(sizeof(LDKHTLCOutputInCommitment), "LDKHTLCOutputInCommitment");
6603 *ret = HTLCOutputInCommitment_read(ser_conv);
6604 assert(ret->is_owned);
6605 ret->is_owned = false;
6609 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_get_1htlc_1redeemscript(JNIEnv * _env, jclass _b, jlong htlc, jlong keys) {
6610 LDKHTLCOutputInCommitment* htlc_conv = (LDKHTLCOutputInCommitment*)htlc;
6611 LDKTxCreationKeys* keys_conv = (LDKTxCreationKeys*)keys;
6612 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6613 *ret = get_htlc_redeemscript(htlc_conv, keys_conv);
6617 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_make_1funding_1redeemscript(JNIEnv * _env, jclass _b, jlong broadcaster, jlong countersignatory) {
6618 LDKPublicKey broadcaster_conv = *(LDKPublicKey*)broadcaster;
6619 FREE((void*)broadcaster);
6620 LDKPublicKey countersignatory_conv = *(LDKPublicKey*)countersignatory;
6621 FREE((void*)countersignatory);
6622 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6623 *ret = make_funding_redeemscript(broadcaster_conv, countersignatory_conv);
6627 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_build_1htlc_1transaction(JNIEnv * _env, jclass _b, jbyteArray prev_hash, jint feerate_per_kw, jshort contest_delay, jlong htlc, jlong broadcaster_delayed_payment_key, jlong revocation_key) {
6628 unsigned char prev_hash_arr[32];
6629 (*_env)->GetByteArrayRegion (_env, prev_hash, 0, 32, prev_hash_arr);
6630 unsigned char (*prev_hash_ref)[32] = &prev_hash_arr;
6631 LDKHTLCOutputInCommitment* htlc_conv = (LDKHTLCOutputInCommitment*)htlc;
6632 LDKPublicKey broadcaster_delayed_payment_key_conv = *(LDKPublicKey*)broadcaster_delayed_payment_key;
6633 FREE((void*)broadcaster_delayed_payment_key);
6634 LDKPublicKey revocation_key_conv = *(LDKPublicKey*)revocation_key;
6635 FREE((void*)revocation_key);
6636 LDKTransaction* ret = MALLOC(sizeof(LDKTransaction), "LDKTransaction");
6637 *ret = build_htlc_transaction(prev_hash_ref, feerate_per_kw, contest_delay, htlc_conv, broadcaster_delayed_payment_key_conv, revocation_key_conv);
6641 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6642 LDKHolderCommitmentTransaction this_ptr_conv = *(LDKHolderCommitmentTransaction*)this_ptr;
6643 FREE((void*)this_ptr);
6644 this_ptr_conv.is_owned = true;
6645 return HolderCommitmentTransaction_free(this_ptr_conv);
6648 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1unsigned_1tx(JNIEnv * _env, jclass _b, jlong this_ptr) {
6649 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
6650 LDKTransaction* ret = MALLOC(sizeof(LDKTransaction), "LDKTransaction");
6651 *ret = HolderCommitmentTransaction_get_unsigned_tx(this_ptr_conv);
6655 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1unsigned_1tx(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6656 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
6657 LDKTransaction val_conv = *(LDKTransaction*)val;
6659 return HolderCommitmentTransaction_set_unsigned_tx(this_ptr_conv, val_conv);
6662 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1counterparty_1sig(JNIEnv * _env, jclass _b, jlong this_ptr) {
6663 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
6664 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
6665 *ret = HolderCommitmentTransaction_get_counterparty_sig(this_ptr_conv);
6669 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1sig(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6670 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
6671 LDKSignature val_conv = *(LDKSignature*)val;
6673 return HolderCommitmentTransaction_set_counterparty_sig(this_ptr_conv, val_conv);
6676 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr) {
6677 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
6678 return HolderCommitmentTransaction_get_feerate_per_kw(this_ptr_conv);
6681 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6682 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
6683 return HolderCommitmentTransaction_set_feerate_per_kw(this_ptr_conv, val);
6686 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1per_1htlc(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6687 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
6688 LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ val_conv = *(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ*)val;
6690 return HolderCommitmentTransaction_set_per_htlc(this_ptr_conv, val_conv);
6693 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1new_1missing_1holder_1sig(JNIEnv * _env, jclass _b, jlong unsigned_tx, jlong counterparty_sig, jlong holder_funding_key, jlong counterparty_funding_key, jlong keys, jint feerate_per_kw, jlong htlc_data) {
6694 LDKTransaction unsigned_tx_conv = *(LDKTransaction*)unsigned_tx;
6695 FREE((void*)unsigned_tx);
6696 LDKSignature counterparty_sig_conv = *(LDKSignature*)counterparty_sig;
6697 FREE((void*)counterparty_sig);
6698 LDKPublicKey holder_funding_key_conv = *(LDKPublicKey*)holder_funding_key;
6699 FREE((void*)holder_funding_key);
6700 LDKPublicKey counterparty_funding_key_conv = *(LDKPublicKey*)counterparty_funding_key;
6701 FREE((void*)counterparty_funding_key);
6702 LDKTxCreationKeys keys_conv = *(LDKTxCreationKeys*)keys;
6704 keys_conv.is_owned = true;
6705 LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ htlc_data_conv = *(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ*)htlc_data;
6706 FREE((void*)htlc_data);
6707 LDKHolderCommitmentTransaction* ret = MALLOC(sizeof(LDKHolderCommitmentTransaction), "LDKHolderCommitmentTransaction");
6708 *ret = HolderCommitmentTransaction_new_missing_holder_sig(unsigned_tx_conv, counterparty_sig_conv, holder_funding_key_conv, counterparty_funding_key_conv, keys_conv, feerate_per_kw, htlc_data_conv);
6709 assert(ret->is_owned);
6710 ret->is_owned = false;
6714 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1trust_1key_1derivation(JNIEnv * _env, jclass _b, jlong this_arg) {
6715 LDKHolderCommitmentTransaction* this_arg_conv = (LDKHolderCommitmentTransaction*)this_arg;
6716 LDKTxCreationKeys* ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
6717 *ret = HolderCommitmentTransaction_trust_key_derivation(this_arg_conv);
6718 assert(ret->is_owned);
6719 ret->is_owned = false;
6723 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1txid(JNIEnv * _env, jclass _b, jlong this_arg) {
6724 LDKHolderCommitmentTransaction* this_arg_conv = (LDKHolderCommitmentTransaction*)this_arg;
6725 LDKThirtyTwoBytes* ret = MALLOC(sizeof(LDKThirtyTwoBytes), "LDKThirtyTwoBytes");
6726 *ret = HolderCommitmentTransaction_txid(this_arg_conv);
6730 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1holder_1sig(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray funding_key, jlong funding_redeemscript, jlong channel_value_satoshis) {
6731 LDKHolderCommitmentTransaction* this_arg_conv = (LDKHolderCommitmentTransaction*)this_arg;
6732 unsigned char funding_key_arr[32];
6733 (*_env)->GetByteArrayRegion (_env, funding_key, 0, 32, funding_key_arr);
6734 unsigned char (*funding_key_ref)[32] = &funding_key_arr;
6735 LDKu8slice funding_redeemscript_conv = *(LDKu8slice*)funding_redeemscript;
6736 FREE((void*)funding_redeemscript);
6737 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
6738 *ret = HolderCommitmentTransaction_get_holder_sig(this_arg_conv, funding_key_ref, funding_redeemscript_conv, channel_value_satoshis);
6742 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1htlc_1sigs(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray htlc_base_key, jshort counterparty_selected_contest_delay) {
6743 LDKHolderCommitmentTransaction* this_arg_conv = (LDKHolderCommitmentTransaction*)this_arg;
6744 unsigned char htlc_base_key_arr[32];
6745 (*_env)->GetByteArrayRegion (_env, htlc_base_key, 0, 32, htlc_base_key_arr);
6746 unsigned char (*htlc_base_key_ref)[32] = &htlc_base_key_arr;
6747 LDKCResult_CVec_SignatureZNoneZ* ret = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
6748 *ret = HolderCommitmentTransaction_get_htlc_sigs(this_arg_conv, htlc_base_key_ref, counterparty_selected_contest_delay);
6752 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1write(JNIEnv * _env, jclass _b, jlong obj) {
6753 LDKHolderCommitmentTransaction* obj_conv = (LDKHolderCommitmentTransaction*)obj;
6754 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6755 *ret = HolderCommitmentTransaction_write(obj_conv);
6759 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1read(JNIEnv * _env, jclass _b, jlong ser) {
6760 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6762 LDKHolderCommitmentTransaction* ret = MALLOC(sizeof(LDKHolderCommitmentTransaction), "LDKHolderCommitmentTransaction");
6763 *ret = HolderCommitmentTransaction_read(ser_conv);
6764 assert(ret->is_owned);
6765 ret->is_owned = false;
6769 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6770 LDKInitFeatures this_ptr_conv = *(LDKInitFeatures*)this_ptr;
6771 FREE((void*)this_ptr);
6772 this_ptr_conv.is_owned = true;
6773 return InitFeatures_free(this_ptr_conv);
6776 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6777 LDKNodeFeatures this_ptr_conv = *(LDKNodeFeatures*)this_ptr;
6778 FREE((void*)this_ptr);
6779 this_ptr_conv.is_owned = true;
6780 return NodeFeatures_free(this_ptr_conv);
6783 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6784 LDKChannelFeatures this_ptr_conv = *(LDKChannelFeatures*)this_ptr;
6785 FREE((void*)this_ptr);
6786 this_ptr_conv.is_owned = true;
6787 return ChannelFeatures_free(this_ptr_conv);
6790 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6791 LDKRouteHop this_ptr_conv = *(LDKRouteHop*)this_ptr;
6792 FREE((void*)this_ptr);
6793 this_ptr_conv.is_owned = true;
6794 return RouteHop_free(this_ptr_conv);
6797 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
6798 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6799 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6800 *ret = RouteHop_get_pubkey(this_ptr_conv);
6804 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6805 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6806 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6808 return RouteHop_set_pubkey(this_ptr_conv, val_conv);
6811 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1node_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
6812 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6813 LDKNodeFeatures* ret = MALLOC(sizeof(LDKNodeFeatures), "LDKNodeFeatures");
6814 *ret = RouteHop_get_node_features(this_ptr_conv);
6815 assert(ret->is_owned);
6816 ret->is_owned = false;
6820 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1node_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6821 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6822 LDKNodeFeatures val_conv = *(LDKNodeFeatures*)val;
6824 val_conv.is_owned = true;
6825 return RouteHop_set_node_features(this_ptr_conv, val_conv);
6828 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6829 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6830 return RouteHop_get_short_channel_id(this_ptr_conv);
6833 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6834 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6835 return RouteHop_set_short_channel_id(this_ptr_conv, val);
6838 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1channel_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
6839 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6840 LDKChannelFeatures* ret = MALLOC(sizeof(LDKChannelFeatures), "LDKChannelFeatures");
6841 *ret = RouteHop_get_channel_features(this_ptr_conv);
6842 assert(ret->is_owned);
6843 ret->is_owned = false;
6847 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1channel_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6848 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6849 LDKChannelFeatures val_conv = *(LDKChannelFeatures*)val;
6851 val_conv.is_owned = true;
6852 return RouteHop_set_channel_features(this_ptr_conv, val_conv);
6855 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1fee_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
6856 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6857 return RouteHop_get_fee_msat(this_ptr_conv);
6860 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1fee_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6861 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6862 return RouteHop_set_fee_msat(this_ptr_conv, val);
6865 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
6866 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6867 return RouteHop_get_cltv_expiry_delta(this_ptr_conv);
6870 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6871 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6872 return RouteHop_set_cltv_expiry_delta(this_ptr_conv, val);
6875 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1new(JNIEnv * _env, jclass _b, jlong pubkey_arg, jlong node_features_arg, jlong short_channel_id_arg, jlong channel_features_arg, jlong fee_msat_arg, jint cltv_expiry_delta_arg) {
6876 LDKPublicKey pubkey_arg_conv = *(LDKPublicKey*)pubkey_arg;
6877 FREE((void*)pubkey_arg);
6878 LDKNodeFeatures node_features_arg_conv = *(LDKNodeFeatures*)node_features_arg;
6879 FREE((void*)node_features_arg);
6880 node_features_arg_conv.is_owned = true;
6881 LDKChannelFeatures channel_features_arg_conv = *(LDKChannelFeatures*)channel_features_arg;
6882 FREE((void*)channel_features_arg);
6883 channel_features_arg_conv.is_owned = true;
6884 LDKRouteHop* ret = MALLOC(sizeof(LDKRouteHop), "LDKRouteHop");
6885 *ret = RouteHop_new(pubkey_arg_conv, node_features_arg_conv, short_channel_id_arg, channel_features_arg_conv, fee_msat_arg, cltv_expiry_delta_arg);
6886 assert(ret->is_owned);
6887 ret->is_owned = false;
6891 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6892 LDKRoute this_ptr_conv = *(LDKRoute*)this_ptr;
6893 FREE((void*)this_ptr);
6894 this_ptr_conv.is_owned = true;
6895 return Route_free(this_ptr_conv);
6898 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1paths(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6899 LDKRoute* this_ptr_conv = (LDKRoute*)this_ptr;
6900 LDKCVec_CVec_RouteHopZZ val_conv = *(LDKCVec_CVec_RouteHopZZ*)val;
6902 return Route_set_paths(this_ptr_conv, val_conv);
6905 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv * _env, jclass _b, jlong paths_arg) {
6906 LDKCVec_CVec_RouteHopZZ paths_arg_conv = *(LDKCVec_CVec_RouteHopZZ*)paths_arg;
6907 FREE((void*)paths_arg);
6908 LDKRoute* ret = MALLOC(sizeof(LDKRoute), "LDKRoute");
6909 *ret = Route_new(paths_arg_conv);
6910 assert(ret->is_owned);
6911 ret->is_owned = false;
6915 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1write(JNIEnv * _env, jclass _b, jlong obj) {
6916 LDKRoute* obj_conv = (LDKRoute*)obj;
6917 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6918 *ret = Route_write(obj_conv);
6922 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1read(JNIEnv * _env, jclass _b, jlong ser) {
6923 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6925 LDKRoute* ret = MALLOC(sizeof(LDKRoute), "LDKRoute");
6926 *ret = Route_read(ser_conv);
6927 assert(ret->is_owned);
6928 ret->is_owned = false;
6932 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6933 LDKRouteHint this_ptr_conv = *(LDKRouteHint*)this_ptr;
6934 FREE((void*)this_ptr);
6935 this_ptr_conv.is_owned = true;
6936 return RouteHint_free(this_ptr_conv);
6939 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1src_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6940 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6941 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6942 *ret = RouteHint_get_src_node_id(this_ptr_conv);
6946 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1src_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6947 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6948 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6950 return RouteHint_set_src_node_id(this_ptr_conv, val_conv);
6953 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6954 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6955 return RouteHint_get_short_channel_id(this_ptr_conv);
6958 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6959 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6960 return RouteHint_set_short_channel_id(this_ptr_conv, val);
6963 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1fees(JNIEnv * _env, jclass _b, jlong this_ptr) {
6964 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6965 LDKRoutingFees* ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
6966 *ret = RouteHint_get_fees(this_ptr_conv);
6967 assert(ret->is_owned);
6968 ret->is_owned = false;
6972 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1fees(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6973 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6974 LDKRoutingFees val_conv = *(LDKRoutingFees*)val;
6976 val_conv.is_owned = true;
6977 return RouteHint_set_fees(this_ptr_conv, val_conv);
6980 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
6981 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6982 return RouteHint_get_cltv_expiry_delta(this_ptr_conv);
6985 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
6986 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6987 return RouteHint_set_cltv_expiry_delta(this_ptr_conv, val);
6990 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
6991 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6992 return RouteHint_get_htlc_minimum_msat(this_ptr_conv);
6995 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6996 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6997 return RouteHint_set_htlc_minimum_msat(this_ptr_conv, val);
7000 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) {
7001 LDKPublicKey src_node_id_arg_conv = *(LDKPublicKey*)src_node_id_arg;
7002 FREE((void*)src_node_id_arg);
7003 LDKRoutingFees fees_arg_conv = *(LDKRoutingFees*)fees_arg;
7004 FREE((void*)fees_arg);
7005 fees_arg_conv.is_owned = true;
7006 LDKRouteHint* ret = MALLOC(sizeof(LDKRouteHint), "LDKRouteHint");
7007 *ret = RouteHint_new(src_node_id_arg_conv, short_channel_id_arg, fees_arg_conv, cltv_expiry_delta_arg, htlc_minimum_msat_arg);
7008 assert(ret->is_owned);
7009 ret->is_owned = false;
7013 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) {
7014 LDKPublicKey our_node_id_conv = *(LDKPublicKey*)our_node_id;
7015 FREE((void*)our_node_id);
7016 LDKNetworkGraph* network_conv = (LDKNetworkGraph*)network;
7017 LDKPublicKey target_conv = *(LDKPublicKey*)target;
7018 FREE((void*)target);
7019 LDKCVec_ChannelDetailsZ* first_hops_conv = (LDKCVec_ChannelDetailsZ*)first_hops;
7020 LDKCVec_RouteHintZ last_hops_conv = *(LDKCVec_RouteHintZ*)last_hops;
7021 FREE((void*)last_hops);
7022 LDKLogger logger_conv = *(LDKLogger*)logger;
7023 if (logger_conv.free == LDKLogger_JCalls_free) {
7024 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
7025 LDKLogger_JCalls_clone(logger_conv.this_arg);
7027 LDKCResult_RouteLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
7028 *ret = get_route(our_node_id_conv, network_conv, target_conv, first_hops_conv, last_hops_conv, final_value_msat, final_cltv, logger_conv);
7032 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7033 LDKNetworkGraph this_ptr_conv = *(LDKNetworkGraph*)this_ptr;
7034 FREE((void*)this_ptr);
7035 this_ptr_conv.is_owned = true;
7036 return NetworkGraph_free(this_ptr_conv);
7039 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockedNetworkGraph_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7040 LDKLockedNetworkGraph this_ptr_conv = *(LDKLockedNetworkGraph*)this_ptr;
7041 FREE((void*)this_ptr);
7042 this_ptr_conv.is_owned = true;
7043 return LockedNetworkGraph_free(this_ptr_conv);
7046 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7047 LDKNetGraphMsgHandler this_ptr_conv = *(LDKNetGraphMsgHandler*)this_ptr;
7048 FREE((void*)this_ptr);
7049 this_ptr_conv.is_owned = true;
7050 return NetGraphMsgHandler_free(this_ptr_conv);
7053 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new(JNIEnv * _env, jclass _b, jlong chain_access, jlong logger) {
7054 LDKAccess* chain_access_conv = (LDKAccess*)chain_access;
7055 LDKLogger logger_conv = *(LDKLogger*)logger;
7056 if (logger_conv.free == LDKLogger_JCalls_free) {
7057 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
7058 LDKLogger_JCalls_clone(logger_conv.this_arg);
7060 LDKNetGraphMsgHandler* ret = MALLOC(sizeof(LDKNetGraphMsgHandler), "LDKNetGraphMsgHandler");
7061 *ret = NetGraphMsgHandler_new(chain_access_conv, logger_conv);
7062 assert(ret->is_owned);
7063 ret->is_owned = false;
7067 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1from_1net_1graph(JNIEnv * _env, jclass _b, jlong chain_access, jlong logger, jlong network_graph) {
7068 LDKAccess* chain_access_conv = (LDKAccess*)chain_access;
7069 LDKLogger logger_conv = *(LDKLogger*)logger;
7070 if (logger_conv.free == LDKLogger_JCalls_free) {
7071 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
7072 LDKLogger_JCalls_clone(logger_conv.this_arg);
7074 LDKNetworkGraph network_graph_conv = *(LDKNetworkGraph*)network_graph;
7075 FREE((void*)network_graph);
7076 network_graph_conv.is_owned = true;
7077 LDKNetGraphMsgHandler* ret = MALLOC(sizeof(LDKNetGraphMsgHandler), "LDKNetGraphMsgHandler");
7078 *ret = NetGraphMsgHandler_from_net_graph(chain_access_conv, logger_conv, network_graph_conv);
7079 assert(ret->is_owned);
7080 ret->is_owned = false;
7084 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1read_1locked_1graph(JNIEnv * _env, jclass _b, jlong this_arg) {
7085 LDKNetGraphMsgHandler* this_arg_conv = (LDKNetGraphMsgHandler*)this_arg;
7086 LDKLockedNetworkGraph* ret = MALLOC(sizeof(LDKLockedNetworkGraph), "LDKLockedNetworkGraph");
7087 *ret = NetGraphMsgHandler_read_locked_graph(this_arg_conv);
7088 assert(ret->is_owned);
7089 ret->is_owned = false;
7093 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LockedNetworkGraph_1graph(JNIEnv * _env, jclass _b, jlong this_arg) {
7094 LDKLockedNetworkGraph* this_arg_conv = (LDKLockedNetworkGraph*)this_arg;
7095 LDKNetworkGraph* ret = MALLOC(sizeof(LDKNetworkGraph), "LDKNetworkGraph");
7096 *ret = LockedNetworkGraph_graph(this_arg_conv);
7097 assert(ret->is_owned);
7098 ret->is_owned = false;
7102 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1RoutingMessageHandler(JNIEnv * _env, jclass _b, jlong this_arg) {
7103 LDKNetGraphMsgHandler* this_arg_conv = (LDKNetGraphMsgHandler*)this_arg;
7104 LDKRoutingMessageHandler* ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
7105 *ret = NetGraphMsgHandler_as_RoutingMessageHandler(this_arg_conv);
7109 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7110 LDKDirectionalChannelInfo this_ptr_conv = *(LDKDirectionalChannelInfo*)this_ptr;
7111 FREE((void*)this_ptr);
7112 this_ptr_conv.is_owned = true;
7113 return DirectionalChannelInfo_free(this_ptr_conv);
7116 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr) {
7117 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7118 return DirectionalChannelInfo_get_last_update(this_ptr_conv);
7121 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
7122 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7123 return DirectionalChannelInfo_set_last_update(this_ptr_conv, val);
7126 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1enabled(JNIEnv * _env, jclass _b, jlong this_ptr) {
7127 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7128 return DirectionalChannelInfo_get_enabled(this_ptr_conv);
7131 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1enabled(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
7132 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7133 return DirectionalChannelInfo_set_enabled(this_ptr_conv, val);
7136 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
7137 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7138 return DirectionalChannelInfo_get_cltv_expiry_delta(this_ptr_conv);
7141 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
7142 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7143 return DirectionalChannelInfo_set_cltv_expiry_delta(this_ptr_conv, val);
7146 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
7147 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7148 return DirectionalChannelInfo_get_htlc_minimum_msat(this_ptr_conv);
7151 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7152 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7153 return DirectionalChannelInfo_set_htlc_minimum_msat(this_ptr_conv, val);
7156 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1last_1update_1message(JNIEnv * _env, jclass _b, jlong this_ptr) {
7157 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7158 LDKChannelUpdate* ret = MALLOC(sizeof(LDKChannelUpdate), "LDKChannelUpdate");
7159 *ret = DirectionalChannelInfo_get_last_update_message(this_ptr_conv);
7160 assert(ret->is_owned);
7161 ret->is_owned = false;
7165 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1last_1update_1message(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7166 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7167 LDKChannelUpdate val_conv = *(LDKChannelUpdate*)val;
7169 val_conv.is_owned = true;
7170 return DirectionalChannelInfo_set_last_update_message(this_ptr_conv, val_conv);
7173 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
7174 LDKDirectionalChannelInfo* obj_conv = (LDKDirectionalChannelInfo*)obj;
7175 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7176 *ret = DirectionalChannelInfo_write(obj_conv);
7180 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
7181 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7183 LDKDirectionalChannelInfo* ret = MALLOC(sizeof(LDKDirectionalChannelInfo), "LDKDirectionalChannelInfo");
7184 *ret = DirectionalChannelInfo_read(ser_conv);
7185 assert(ret->is_owned);
7186 ret->is_owned = false;
7190 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7191 LDKChannelInfo this_ptr_conv = *(LDKChannelInfo*)this_ptr;
7192 FREE((void*)this_ptr);
7193 this_ptr_conv.is_owned = true;
7194 return ChannelInfo_free(this_ptr_conv);
7197 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
7198 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7199 LDKChannelFeatures* ret = MALLOC(sizeof(LDKChannelFeatures), "LDKChannelFeatures");
7200 *ret = ChannelInfo_get_features(this_ptr_conv);
7201 assert(ret->is_owned);
7202 ret->is_owned = false;
7206 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7207 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7208 LDKChannelFeatures val_conv = *(LDKChannelFeatures*)val;
7210 val_conv.is_owned = true;
7211 return ChannelInfo_set_features(this_ptr_conv, val_conv);
7214 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1one(JNIEnv * _env, jclass _b, jlong this_ptr) {
7215 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7216 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
7217 *ret = ChannelInfo_get_node_one(this_ptr_conv);
7221 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1one(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7222 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7223 LDKPublicKey val_conv = *(LDKPublicKey*)val;
7225 return ChannelInfo_set_node_one(this_ptr_conv, val_conv);
7228 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1one_1to_1two(JNIEnv * _env, jclass _b, jlong this_ptr) {
7229 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7230 LDKDirectionalChannelInfo* ret = MALLOC(sizeof(LDKDirectionalChannelInfo), "LDKDirectionalChannelInfo");
7231 *ret = ChannelInfo_get_one_to_two(this_ptr_conv);
7232 assert(ret->is_owned);
7233 ret->is_owned = false;
7237 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1one_1to_1two(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7238 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7239 LDKDirectionalChannelInfo val_conv = *(LDKDirectionalChannelInfo*)val;
7241 val_conv.is_owned = true;
7242 return ChannelInfo_set_one_to_two(this_ptr_conv, val_conv);
7245 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1two(JNIEnv * _env, jclass _b, jlong this_ptr) {
7246 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7247 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
7248 *ret = ChannelInfo_get_node_two(this_ptr_conv);
7252 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1two(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7253 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7254 LDKPublicKey val_conv = *(LDKPublicKey*)val;
7256 return ChannelInfo_set_node_two(this_ptr_conv, val_conv);
7259 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1two_1to_1one(JNIEnv * _env, jclass _b, jlong this_ptr) {
7260 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7261 LDKDirectionalChannelInfo* ret = MALLOC(sizeof(LDKDirectionalChannelInfo), "LDKDirectionalChannelInfo");
7262 *ret = ChannelInfo_get_two_to_one(this_ptr_conv);
7263 assert(ret->is_owned);
7264 ret->is_owned = false;
7268 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1two_1to_1one(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7269 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7270 LDKDirectionalChannelInfo val_conv = *(LDKDirectionalChannelInfo*)val;
7272 val_conv.is_owned = true;
7273 return ChannelInfo_set_two_to_one(this_ptr_conv, val_conv);
7276 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1announcement_1message(JNIEnv * _env, jclass _b, jlong this_ptr) {
7277 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7278 LDKChannelAnnouncement* ret = MALLOC(sizeof(LDKChannelAnnouncement), "LDKChannelAnnouncement");
7279 *ret = ChannelInfo_get_announcement_message(this_ptr_conv);
7280 assert(ret->is_owned);
7281 ret->is_owned = false;
7285 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1announcement_1message(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7286 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7287 LDKChannelAnnouncement val_conv = *(LDKChannelAnnouncement*)val;
7289 val_conv.is_owned = true;
7290 return ChannelInfo_set_announcement_message(this_ptr_conv, val_conv);
7293 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
7294 LDKChannelInfo* obj_conv = (LDKChannelInfo*)obj;
7295 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7296 *ret = ChannelInfo_write(obj_conv);
7300 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
7301 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7303 LDKChannelInfo* ret = MALLOC(sizeof(LDKChannelInfo), "LDKChannelInfo");
7304 *ret = ChannelInfo_read(ser_conv);
7305 assert(ret->is_owned);
7306 ret->is_owned = false;
7310 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7311 LDKRoutingFees this_ptr_conv = *(LDKRoutingFees*)this_ptr;
7312 FREE((void*)this_ptr);
7313 this_ptr_conv.is_owned = true;
7314 return RoutingFees_free(this_ptr_conv);
7317 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
7318 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
7319 return RoutingFees_get_base_msat(this_ptr_conv);
7322 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
7323 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
7324 return RoutingFees_set_base_msat(this_ptr_conv, val);
7327 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr) {
7328 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
7329 return RoutingFees_get_proportional_millionths(this_ptr_conv);
7332 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
7333 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
7334 return RoutingFees_set_proportional_millionths(this_ptr_conv, val);
7337 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1new(JNIEnv * _env, jclass _b, jint base_msat_arg, jint proportional_millionths_arg) {
7338 LDKRoutingFees* ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
7339 *ret = RoutingFees_new(base_msat_arg, proportional_millionths_arg);
7340 assert(ret->is_owned);
7341 ret->is_owned = false;
7345 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1read(JNIEnv * _env, jclass _b, jlong ser) {
7346 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7348 LDKRoutingFees* ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
7349 *ret = RoutingFees_read(ser_conv);
7350 assert(ret->is_owned);
7351 ret->is_owned = false;
7355 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1write(JNIEnv * _env, jclass _b, jlong obj) {
7356 LDKRoutingFees* obj_conv = (LDKRoutingFees*)obj;
7357 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7358 *ret = RoutingFees_write(obj_conv);
7362 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7363 LDKNodeAnnouncementInfo this_ptr_conv = *(LDKNodeAnnouncementInfo*)this_ptr;
7364 FREE((void*)this_ptr);
7365 this_ptr_conv.is_owned = true;
7366 return NodeAnnouncementInfo_free(this_ptr_conv);
7369 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
7370 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
7371 LDKNodeFeatures* ret = MALLOC(sizeof(LDKNodeFeatures), "LDKNodeFeatures");
7372 *ret = NodeAnnouncementInfo_get_features(this_ptr_conv);
7373 assert(ret->is_owned);
7374 ret->is_owned = false;
7378 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7379 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
7380 LDKNodeFeatures val_conv = *(LDKNodeFeatures*)val;
7382 val_conv.is_owned = true;
7383 return NodeAnnouncementInfo_set_features(this_ptr_conv, val_conv);
7386 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr) {
7387 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
7388 return NodeAnnouncementInfo_get_last_update(this_ptr_conv);
7391 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
7392 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
7393 return NodeAnnouncementInfo_set_last_update(this_ptr_conv, val);
7396 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr) {
7397 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
7398 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 3);
7399 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 3, *NodeAnnouncementInfo_get_rgb(this_ptr_conv));
7403 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7404 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
7405 LDKThreeBytes val_conv = *(LDKThreeBytes*)val;
7407 return NodeAnnouncementInfo_set_rgb(this_ptr_conv, val_conv);
7410 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1alias(JNIEnv * _env, jclass _b, jlong this_ptr) {
7411 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
7412 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
7413 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *NodeAnnouncementInfo_get_alias(this_ptr_conv));
7417 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1alias(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7418 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
7419 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
7421 return NodeAnnouncementInfo_set_alias(this_ptr_conv, val_conv);
7424 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1addresses(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7425 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
7426 LDKCVec_NetAddressZ val_conv = *(LDKCVec_NetAddressZ*)val;
7428 return NodeAnnouncementInfo_set_addresses(this_ptr_conv, val_conv);
7431 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1announcement_1message(JNIEnv * _env, jclass _b, jlong this_ptr) {
7432 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
7433 LDKNodeAnnouncement* ret = MALLOC(sizeof(LDKNodeAnnouncement), "LDKNodeAnnouncement");
7434 *ret = NodeAnnouncementInfo_get_announcement_message(this_ptr_conv);
7435 assert(ret->is_owned);
7436 ret->is_owned = false;
7440 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1announcement_1message(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7441 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
7442 LDKNodeAnnouncement val_conv = *(LDKNodeAnnouncement*)val;
7444 val_conv.is_owned = true;
7445 return NodeAnnouncementInfo_set_announcement_message(this_ptr_conv, val_conv);
7448 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1new(JNIEnv * _env, jclass _b, jlong features_arg, jint last_update_arg, jlong rgb_arg, jlong alias_arg, jlong addresses_arg, jlong announcement_message_arg) {
7449 LDKNodeFeatures features_arg_conv = *(LDKNodeFeatures*)features_arg;
7450 FREE((void*)features_arg);
7451 features_arg_conv.is_owned = true;
7452 LDKThreeBytes rgb_arg_conv = *(LDKThreeBytes*)rgb_arg;
7453 FREE((void*)rgb_arg);
7454 LDKThirtyTwoBytes alias_arg_conv = *(LDKThirtyTwoBytes*)alias_arg;
7455 FREE((void*)alias_arg);
7456 LDKCVec_NetAddressZ addresses_arg_conv = *(LDKCVec_NetAddressZ*)addresses_arg;
7457 FREE((void*)addresses_arg);
7458 LDKNodeAnnouncement announcement_message_arg_conv = *(LDKNodeAnnouncement*)announcement_message_arg;
7459 FREE((void*)announcement_message_arg);
7460 announcement_message_arg_conv.is_owned = true;
7461 LDKNodeAnnouncementInfo* ret = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo");
7462 *ret = NodeAnnouncementInfo_new(features_arg_conv, last_update_arg, rgb_arg_conv, alias_arg_conv, addresses_arg_conv, announcement_message_arg_conv);
7463 assert(ret->is_owned);
7464 ret->is_owned = false;
7468 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
7469 LDKNodeAnnouncementInfo* obj_conv = (LDKNodeAnnouncementInfo*)obj;
7470 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7471 *ret = NodeAnnouncementInfo_write(obj_conv);
7475 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
7476 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7478 LDKNodeAnnouncementInfo* ret = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo");
7479 *ret = NodeAnnouncementInfo_read(ser_conv);
7480 assert(ret->is_owned);
7481 ret->is_owned = false;
7485 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7486 LDKNodeInfo this_ptr_conv = *(LDKNodeInfo*)this_ptr;
7487 FREE((void*)this_ptr);
7488 this_ptr_conv.is_owned = true;
7489 return NodeInfo_free(this_ptr_conv);
7492 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1channels(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7493 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
7494 LDKCVec_u64Z val_conv = *(LDKCVec_u64Z*)val;
7496 return NodeInfo_set_channels(this_ptr_conv, val_conv);
7499 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1lowest_1inbound_1channel_1fees(JNIEnv * _env, jclass _b, jlong this_ptr) {
7500 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
7501 LDKRoutingFees* ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
7502 *ret = NodeInfo_get_lowest_inbound_channel_fees(this_ptr_conv);
7503 assert(ret->is_owned);
7504 ret->is_owned = false;
7508 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1lowest_1inbound_1channel_1fees(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7509 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
7510 LDKRoutingFees val_conv = *(LDKRoutingFees*)val;
7512 val_conv.is_owned = true;
7513 return NodeInfo_set_lowest_inbound_channel_fees(this_ptr_conv, val_conv);
7516 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1announcement_1info(JNIEnv * _env, jclass _b, jlong this_ptr) {
7517 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
7518 LDKNodeAnnouncementInfo* ret = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo");
7519 *ret = NodeInfo_get_announcement_info(this_ptr_conv);
7520 assert(ret->is_owned);
7521 ret->is_owned = false;
7525 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1announcement_1info(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7526 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
7527 LDKNodeAnnouncementInfo val_conv = *(LDKNodeAnnouncementInfo*)val;
7529 val_conv.is_owned = true;
7530 return NodeInfo_set_announcement_info(this_ptr_conv, val_conv);
7533 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) {
7534 LDKCVec_u64Z channels_arg_conv = *(LDKCVec_u64Z*)channels_arg;
7535 FREE((void*)channels_arg);
7536 LDKRoutingFees lowest_inbound_channel_fees_arg_conv = *(LDKRoutingFees*)lowest_inbound_channel_fees_arg;
7537 FREE((void*)lowest_inbound_channel_fees_arg);
7538 lowest_inbound_channel_fees_arg_conv.is_owned = true;
7539 LDKNodeAnnouncementInfo announcement_info_arg_conv = *(LDKNodeAnnouncementInfo*)announcement_info_arg;
7540 FREE((void*)announcement_info_arg);
7541 announcement_info_arg_conv.is_owned = true;
7542 LDKNodeInfo* ret = MALLOC(sizeof(LDKNodeInfo), "LDKNodeInfo");
7543 *ret = NodeInfo_new(channels_arg_conv, lowest_inbound_channel_fees_arg_conv, announcement_info_arg_conv);
7544 assert(ret->is_owned);
7545 ret->is_owned = false;
7549 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
7550 LDKNodeInfo* obj_conv = (LDKNodeInfo*)obj;
7551 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7552 *ret = NodeInfo_write(obj_conv);
7556 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
7557 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7559 LDKNodeInfo* ret = MALLOC(sizeof(LDKNodeInfo), "LDKNodeInfo");
7560 *ret = NodeInfo_read(ser_conv);
7561 assert(ret->is_owned);
7562 ret->is_owned = false;
7566 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1write(JNIEnv * _env, jclass _b, jlong obj) {
7567 LDKNetworkGraph* obj_conv = (LDKNetworkGraph*)obj;
7568 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7569 *ret = NetworkGraph_write(obj_conv);
7573 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read(JNIEnv * _env, jclass _b, jlong ser) {
7574 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7576 LDKNetworkGraph* ret = MALLOC(sizeof(LDKNetworkGraph), "LDKNetworkGraph");
7577 *ret = NetworkGraph_read(ser_conv);
7578 assert(ret->is_owned);
7579 ret->is_owned = false;
7583 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new(JNIEnv * _env, jclass _b) {
7584 LDKNetworkGraph* ret = MALLOC(sizeof(LDKNetworkGraph), "LDKNetworkGraph");
7585 *ret = NetworkGraph_new();
7586 assert(ret->is_owned);
7587 ret->is_owned = false;
7591 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) {
7592 LDKNetworkGraph* this_arg_conv = (LDKNetworkGraph*)this_arg;
7593 return NetworkGraph_close_channel_from_update(this_arg_conv, short_channel_id, is_permanent);