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 typedef struct LDKEventsProvider_JCalls {
303 atomic_size_t refcnt;
306 jmethodID get_and_clear_pending_events_meth;
307 } LDKEventsProvider_JCalls;
308 LDKCVec_EventZ get_and_clear_pending_events_jcall(const void* this_arg) {
309 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
310 LDKCVec_EventZ* ret = (LDKCVec_EventZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_and_clear_pending_events_meth);
311 LDKCVec_EventZ res = *ret;
315 static void LDKEventsProvider_JCalls_free(void* this_arg) {
316 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
317 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
318 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
322 static void* LDKEventsProvider_JCalls_clone(const void* this_arg) {
323 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
324 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
325 return (void*) this_arg;
327 static inline LDKEventsProvider LDKEventsProvider_init (JNIEnv * env, jclass _a, jobject o) {
328 jclass c = (*env)->GetObjectClass(env, o);
330 LDKEventsProvider_JCalls *calls = MALLOC(sizeof(LDKEventsProvider_JCalls), "LDKEventsProvider_JCalls");
331 atomic_init(&calls->refcnt, 1);
333 calls->o = (*env)->NewGlobalRef(env, o);
334 calls->get_and_clear_pending_events_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_events", "()J");
335 assert(calls->get_and_clear_pending_events_meth != NULL);
337 LDKEventsProvider ret = {
338 .this_arg = (void*) calls,
339 .get_and_clear_pending_events = get_and_clear_pending_events_jcall,
340 .free = LDKEventsProvider_JCalls_free,
344 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1new (JNIEnv * env, jclass _a, jobject o) {
345 LDKEventsProvider *res_ptr = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
346 *res_ptr = LDKEventsProvider_init(env, _a, o);
347 return (long)res_ptr;
349 typedef struct LDKLogger_JCalls {
350 atomic_size_t refcnt;
355 void log_jcall(const void* this_arg, const char *record) {
356 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
357 jstring record_conv = (*j_calls->env)->NewStringUTF(j_calls->env, record);
358 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->log_meth, record_conv);
360 static void LDKLogger_JCalls_free(void* this_arg) {
361 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
362 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
363 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
367 static void* LDKLogger_JCalls_clone(const void* this_arg) {
368 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
369 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
370 return (void*) this_arg;
372 static inline LDKLogger LDKLogger_init (JNIEnv * env, jclass _a, jobject o) {
373 jclass c = (*env)->GetObjectClass(env, o);
375 LDKLogger_JCalls *calls = MALLOC(sizeof(LDKLogger_JCalls), "LDKLogger_JCalls");
376 atomic_init(&calls->refcnt, 1);
378 calls->o = (*env)->NewGlobalRef(env, o);
379 calls->log_meth = (*env)->GetMethodID(env, c, "log", "(Ljava/lang/String;)V");
380 assert(calls->log_meth != NULL);
383 .this_arg = (void*) calls,
385 .free = LDKLogger_JCalls_free,
389 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKLogger_1new (JNIEnv * env, jclass _a, jobject o) {
390 LDKLogger *res_ptr = MALLOC(sizeof(LDKLogger), "LDKLogger");
391 *res_ptr = LDKLogger_init(env, _a, o);
392 return (long)res_ptr;
394 typedef struct LDKAccess_JCalls {
395 atomic_size_t refcnt;
398 jmethodID get_utxo_meth;
400 LDKCResult_TxOutAccessErrorZ get_utxo_jcall(const void* this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id) {
401 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
402 jbyteArray genesis_hash_arr = (*j_calls->env)->NewByteArray(j_calls->env, 32);
403 (*j_calls->env)->SetByteArrayRegion(j_calls->env, genesis_hash_arr, 0, 32, *genesis_hash);
404 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);
405 LDKCResult_TxOutAccessErrorZ res = *ret;
409 static void LDKAccess_JCalls_free(void* this_arg) {
410 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
411 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
412 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
416 static void* LDKAccess_JCalls_clone(const void* this_arg) {
417 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
418 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
419 return (void*) this_arg;
421 static inline LDKAccess LDKAccess_init (JNIEnv * env, jclass _a, jobject o) {
422 jclass c = (*env)->GetObjectClass(env, o);
424 LDKAccess_JCalls *calls = MALLOC(sizeof(LDKAccess_JCalls), "LDKAccess_JCalls");
425 atomic_init(&calls->refcnt, 1);
427 calls->o = (*env)->NewGlobalRef(env, o);
428 calls->get_utxo_meth = (*env)->GetMethodID(env, c, "get_utxo", "([BJ)J");
429 assert(calls->get_utxo_meth != NULL);
432 .this_arg = (void*) calls,
433 .get_utxo = get_utxo_jcall,
434 .free = LDKAccess_JCalls_free,
438 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKAccess_1new (JNIEnv * env, jclass _a, jobject o) {
439 LDKAccess *res_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess");
440 *res_ptr = LDKAccess_init(env, _a, o);
441 return (long)res_ptr;
443 typedef struct LDKChannelKeys_JCalls {
444 atomic_size_t refcnt;
447 jmethodID get_per_commitment_point_meth;
448 jmethodID release_commitment_secret_meth;
449 jmethodID key_derivation_params_meth;
450 jmethodID sign_counterparty_commitment_meth;
451 jmethodID sign_holder_commitment_meth;
452 jmethodID sign_holder_commitment_htlc_transactions_meth;
453 jmethodID sign_justice_transaction_meth;
454 jmethodID sign_counterparty_htlc_transaction_meth;
455 jmethodID sign_closing_transaction_meth;
456 jmethodID sign_channel_announcement_meth;
457 jmethodID on_accept_meth;
458 } LDKChannelKeys_JCalls;
459 LDKPublicKey get_per_commitment_point_jcall(const void* this_arg, uint64_t idx) {
460 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
461 LDKPublicKey* ret = (LDKPublicKey*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_per_commitment_point_meth, idx);
462 LDKPublicKey res = *ret;
466 LDKThirtyTwoBytes release_commitment_secret_jcall(const void* this_arg, uint64_t idx) {
467 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
468 LDKThirtyTwoBytes* ret = (LDKThirtyTwoBytes*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->release_commitment_secret_meth, idx);
469 LDKThirtyTwoBytes res = *ret;
473 LDKC2Tuple_u64u64Z key_derivation_params_jcall(const void* this_arg) {
474 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
475 LDKC2Tuple_u64u64Z* ret = (LDKC2Tuple_u64u64Z*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->key_derivation_params_meth);
476 LDKC2Tuple_u64u64Z res = *ret;
480 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) {
481 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
482 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);
483 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ res = *ret;
487 LDKCResult_SignatureNoneZ sign_holder_commitment_jcall(const void* this_arg, const LDKHolderCommitmentTransaction *holder_commitment_tx) {
488 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
489 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->sign_holder_commitment_meth, holder_commitment_tx);
490 LDKCResult_SignatureNoneZ res = *ret;
494 LDKCResult_CVec_SignatureZNoneZ sign_holder_commitment_htlc_transactions_jcall(const void* this_arg, const LDKHolderCommitmentTransaction *holder_commitment_tx) {
495 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
496 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);
497 LDKCResult_CVec_SignatureZNoneZ res = *ret;
501 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) {
502 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
503 jbyteArray per_commitment_key_arr = (*j_calls->env)->NewByteArray(j_calls->env, 32);
504 (*j_calls->env)->SetByteArrayRegion(j_calls->env, per_commitment_key_arr, 0, 32, *per_commitment_key);
505 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);
506 LDKCResult_SignatureNoneZ res = *ret;
510 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) {
511 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
512 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);
513 LDKCResult_SignatureNoneZ res = *ret;
517 LDKCResult_SignatureNoneZ sign_closing_transaction_jcall(const void* this_arg, LDKTransaction closing_tx) {
518 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
519 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->sign_closing_transaction_meth, closing_tx);
520 LDKCResult_SignatureNoneZ res = *ret;
524 LDKCResult_SignatureNoneZ sign_channel_announcement_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement *msg) {
525 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
526 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->sign_channel_announcement_meth, msg);
527 LDKCResult_SignatureNoneZ res = *ret;
531 void on_accept_jcall(void* this_arg, const LDKChannelPublicKeys *channel_points, uint16_t counterparty_selected_contest_delay, uint16_t holder_selected_contest_delay) {
532 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
533 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);
535 static void LDKChannelKeys_JCalls_free(void* this_arg) {
536 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
537 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
538 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
542 static void* LDKChannelKeys_JCalls_clone(const void* this_arg) {
543 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
544 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
545 return (void*) this_arg;
547 static inline LDKChannelKeys LDKChannelKeys_init (JNIEnv * env, jclass _a, jobject o) {
548 jclass c = (*env)->GetObjectClass(env, o);
550 LDKChannelKeys_JCalls *calls = MALLOC(sizeof(LDKChannelKeys_JCalls), "LDKChannelKeys_JCalls");
551 atomic_init(&calls->refcnt, 1);
553 calls->o = (*env)->NewGlobalRef(env, o);
554 calls->get_per_commitment_point_meth = (*env)->GetMethodID(env, c, "get_per_commitment_point", "(J)J");
555 assert(calls->get_per_commitment_point_meth != NULL);
556 calls->release_commitment_secret_meth = (*env)->GetMethodID(env, c, "release_commitment_secret", "(J)J");
557 assert(calls->release_commitment_secret_meth != NULL);
558 calls->key_derivation_params_meth = (*env)->GetMethodID(env, c, "key_derivation_params", "()J");
559 assert(calls->key_derivation_params_meth != NULL);
560 calls->sign_counterparty_commitment_meth = (*env)->GetMethodID(env, c, "sign_counterparty_commitment", "(IJJJ)J");
561 assert(calls->sign_counterparty_commitment_meth != NULL);
562 calls->sign_holder_commitment_meth = (*env)->GetMethodID(env, c, "sign_holder_commitment", "(J)J");
563 assert(calls->sign_holder_commitment_meth != NULL);
564 calls->sign_holder_commitment_htlc_transactions_meth = (*env)->GetMethodID(env, c, "sign_holder_commitment_htlc_transactions", "(J)J");
565 assert(calls->sign_holder_commitment_htlc_transactions_meth != NULL);
566 calls->sign_justice_transaction_meth = (*env)->GetMethodID(env, c, "sign_justice_transaction", "(JJJ[BJ)J");
567 assert(calls->sign_justice_transaction_meth != NULL);
568 calls->sign_counterparty_htlc_transaction_meth = (*env)->GetMethodID(env, c, "sign_counterparty_htlc_transaction", "(JJJJJ)J");
569 assert(calls->sign_counterparty_htlc_transaction_meth != NULL);
570 calls->sign_closing_transaction_meth = (*env)->GetMethodID(env, c, "sign_closing_transaction", "(J)J");
571 assert(calls->sign_closing_transaction_meth != NULL);
572 calls->sign_channel_announcement_meth = (*env)->GetMethodID(env, c, "sign_channel_announcement", "(J)J");
573 assert(calls->sign_channel_announcement_meth != NULL);
574 calls->on_accept_meth = (*env)->GetMethodID(env, c, "on_accept", "(JSS)V");
575 assert(calls->on_accept_meth != NULL);
577 LDKChannelKeys ret = {
578 .this_arg = (void*) calls,
579 .get_per_commitment_point = get_per_commitment_point_jcall,
580 .release_commitment_secret = release_commitment_secret_jcall,
581 .key_derivation_params = key_derivation_params_jcall,
582 .sign_counterparty_commitment = sign_counterparty_commitment_jcall,
583 .sign_holder_commitment = sign_holder_commitment_jcall,
584 .sign_holder_commitment_htlc_transactions = sign_holder_commitment_htlc_transactions_jcall,
585 .sign_justice_transaction = sign_justice_transaction_jcall,
586 .sign_counterparty_htlc_transaction = sign_counterparty_htlc_transaction_jcall,
587 .sign_closing_transaction = sign_closing_transaction_jcall,
588 .sign_channel_announcement = sign_channel_announcement_jcall,
589 .on_accept = on_accept_jcall,
590 .clone = LDKChannelKeys_JCalls_clone,
591 .free = LDKChannelKeys_JCalls_free,
595 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1new (JNIEnv * env, jclass _a, jobject o) {
596 LDKChannelKeys *res_ptr = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys");
597 *res_ptr = LDKChannelKeys_init(env, _a, o);
598 return (long)res_ptr;
600 typedef struct LDKWatch_JCalls {
601 atomic_size_t refcnt;
604 jmethodID watch_channel_meth;
605 jmethodID update_channel_meth;
606 jmethodID release_pending_monitor_events_meth;
608 LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) {
609 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
610 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->watch_channel_meth, funding_txo, monitor);
611 LDKCResult_NoneChannelMonitorUpdateErrZ res = *ret;
615 LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate update) {
616 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
617 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->update_channel_meth, funding_txo, update);
618 LDKCResult_NoneChannelMonitorUpdateErrZ res = *ret;
622 LDKCVec_MonitorEventZ release_pending_monitor_events_jcall(const void* this_arg) {
623 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
624 LDKCVec_MonitorEventZ* ret = (LDKCVec_MonitorEventZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->release_pending_monitor_events_meth);
625 LDKCVec_MonitorEventZ res = *ret;
629 static void LDKWatch_JCalls_free(void* this_arg) {
630 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
631 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
632 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
636 static void* LDKWatch_JCalls_clone(const void* this_arg) {
637 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
638 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
639 return (void*) this_arg;
641 static inline LDKWatch LDKWatch_init (JNIEnv * env, jclass _a, jobject o) {
642 jclass c = (*env)->GetObjectClass(env, o);
644 LDKWatch_JCalls *calls = MALLOC(sizeof(LDKWatch_JCalls), "LDKWatch_JCalls");
645 atomic_init(&calls->refcnt, 1);
647 calls->o = (*env)->NewGlobalRef(env, o);
648 calls->watch_channel_meth = (*env)->GetMethodID(env, c, "watch_channel", "(JJ)J");
649 assert(calls->watch_channel_meth != NULL);
650 calls->update_channel_meth = (*env)->GetMethodID(env, c, "update_channel", "(JJ)J");
651 assert(calls->update_channel_meth != NULL);
652 calls->release_pending_monitor_events_meth = (*env)->GetMethodID(env, c, "release_pending_monitor_events", "()J");
653 assert(calls->release_pending_monitor_events_meth != NULL);
656 .this_arg = (void*) calls,
657 .watch_channel = watch_channel_jcall,
658 .update_channel = update_channel_jcall,
659 .release_pending_monitor_events = release_pending_monitor_events_jcall,
660 .free = LDKWatch_JCalls_free,
664 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKWatch_1new (JNIEnv * env, jclass _a, jobject o) {
665 LDKWatch *res_ptr = MALLOC(sizeof(LDKWatch), "LDKWatch");
666 *res_ptr = LDKWatch_init(env, _a, o);
667 return (long)res_ptr;
669 typedef struct LDKFilter_JCalls {
670 atomic_size_t refcnt;
673 jmethodID register_tx_meth;
674 jmethodID register_output_meth;
676 void register_tx_jcall(const void* this_arg, const uint8_t (*txid)[32], LDKu8slice script_pubkey) {
677 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
678 jbyteArray txid_arr = (*j_calls->env)->NewByteArray(j_calls->env, 32);
679 (*j_calls->env)->SetByteArrayRegion(j_calls->env, txid_arr, 0, 32, *txid);
680 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->register_tx_meth, txid_arr, script_pubkey);
682 void register_output_jcall(const void* this_arg, const LDKOutPoint *outpoint, LDKu8slice script_pubkey) {
683 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
684 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->register_output_meth, outpoint, script_pubkey);
686 static void LDKFilter_JCalls_free(void* this_arg) {
687 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
688 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
689 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
693 static void* LDKFilter_JCalls_clone(const void* this_arg) {
694 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
695 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
696 return (void*) this_arg;
698 static inline LDKFilter LDKFilter_init (JNIEnv * env, jclass _a, jobject o) {
699 jclass c = (*env)->GetObjectClass(env, o);
701 LDKFilter_JCalls *calls = MALLOC(sizeof(LDKFilter_JCalls), "LDKFilter_JCalls");
702 atomic_init(&calls->refcnt, 1);
704 calls->o = (*env)->NewGlobalRef(env, o);
705 calls->register_tx_meth = (*env)->GetMethodID(env, c, "register_tx", "([BJ)V");
706 assert(calls->register_tx_meth != NULL);
707 calls->register_output_meth = (*env)->GetMethodID(env, c, "register_output", "(JJ)V");
708 assert(calls->register_output_meth != NULL);
711 .this_arg = (void*) calls,
712 .register_tx = register_tx_jcall,
713 .register_output = register_output_jcall,
714 .free = LDKFilter_JCalls_free,
718 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKFilter_1new (JNIEnv * env, jclass _a, jobject o) {
719 LDKFilter *res_ptr = MALLOC(sizeof(LDKFilter), "LDKFilter");
720 *res_ptr = LDKFilter_init(env, _a, o);
721 return (long)res_ptr;
723 typedef struct LDKBroadcasterInterface_JCalls {
724 atomic_size_t refcnt;
727 jmethodID broadcast_transaction_meth;
728 } LDKBroadcasterInterface_JCalls;
729 void broadcast_transaction_jcall(const void* this_arg, LDKTransaction tx) {
730 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
731 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->broadcast_transaction_meth, tx);
733 static void LDKBroadcasterInterface_JCalls_free(void* this_arg) {
734 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
735 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
736 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
740 static void* LDKBroadcasterInterface_JCalls_clone(const void* this_arg) {
741 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
742 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
743 return (void*) this_arg;
745 static inline LDKBroadcasterInterface LDKBroadcasterInterface_init (JNIEnv * env, jclass _a, jobject o) {
746 jclass c = (*env)->GetObjectClass(env, o);
748 LDKBroadcasterInterface_JCalls *calls = MALLOC(sizeof(LDKBroadcasterInterface_JCalls), "LDKBroadcasterInterface_JCalls");
749 atomic_init(&calls->refcnt, 1);
751 calls->o = (*env)->NewGlobalRef(env, o);
752 calls->broadcast_transaction_meth = (*env)->GetMethodID(env, c, "broadcast_transaction", "(J)V");
753 assert(calls->broadcast_transaction_meth != NULL);
755 LDKBroadcasterInterface ret = {
756 .this_arg = (void*) calls,
757 .broadcast_transaction = broadcast_transaction_jcall,
758 .free = LDKBroadcasterInterface_JCalls_free,
762 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1new (JNIEnv * env, jclass _a, jobject o) {
763 LDKBroadcasterInterface *res_ptr = MALLOC(sizeof(LDKBroadcasterInterface), "LDKBroadcasterInterface");
764 *res_ptr = LDKBroadcasterInterface_init(env, _a, o);
765 return (long)res_ptr;
767 typedef struct LDKFeeEstimator_JCalls {
768 atomic_size_t refcnt;
771 jmethodID get_est_sat_per_1000_weight_meth;
772 } LDKFeeEstimator_JCalls;
773 uint32_t get_est_sat_per_1000_weight_jcall(const void* this_arg, LDKConfirmationTarget confirmation_target) {
774 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
775 jclass confirmation_target_conv = LDKConfirmationTarget_to_java(j_calls->env, confirmation_target);
776 return (*j_calls->env)->CallIntMethod(j_calls->env, j_calls->o, j_calls->get_est_sat_per_1000_weight_meth, confirmation_target_conv);
778 static void LDKFeeEstimator_JCalls_free(void* this_arg) {
779 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
780 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
781 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
785 static void* LDKFeeEstimator_JCalls_clone(const void* this_arg) {
786 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
787 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
788 return (void*) this_arg;
790 static inline LDKFeeEstimator LDKFeeEstimator_init (JNIEnv * env, jclass _a, jobject o) {
791 jclass c = (*env)->GetObjectClass(env, o);
793 LDKFeeEstimator_JCalls *calls = MALLOC(sizeof(LDKFeeEstimator_JCalls), "LDKFeeEstimator_JCalls");
794 atomic_init(&calls->refcnt, 1);
796 calls->o = (*env)->NewGlobalRef(env, o);
797 calls->get_est_sat_per_1000_weight_meth = (*env)->GetMethodID(env, c, "get_est_sat_per_1000_weight", "(Lorg/ldk/impl/bindings$LDKConfirmationTarget;)I");
798 assert(calls->get_est_sat_per_1000_weight_meth != NULL);
800 LDKFeeEstimator ret = {
801 .this_arg = (void*) calls,
802 .get_est_sat_per_1000_weight = get_est_sat_per_1000_weight_jcall,
803 .free = LDKFeeEstimator_JCalls_free,
807 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1new (JNIEnv * env, jclass _a, jobject o) {
808 LDKFeeEstimator *res_ptr = MALLOC(sizeof(LDKFeeEstimator), "LDKFeeEstimator");
809 *res_ptr = LDKFeeEstimator_init(env, _a, o);
810 return (long)res_ptr;
812 typedef struct LDKKeysInterface_JCalls {
813 atomic_size_t refcnt;
816 jmethodID get_node_secret_meth;
817 jmethodID get_destination_script_meth;
818 jmethodID get_shutdown_pubkey_meth;
819 jmethodID get_channel_keys_meth;
820 jmethodID get_secure_random_bytes_meth;
821 } LDKKeysInterface_JCalls;
822 LDKSecretKey get_node_secret_jcall(const void* this_arg) {
823 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
824 LDKSecretKey* ret = (LDKSecretKey*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_node_secret_meth);
825 LDKSecretKey res = *ret;
829 LDKCVec_u8Z get_destination_script_jcall(const void* this_arg) {
830 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
831 LDKCVec_u8Z* ret = (LDKCVec_u8Z*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_destination_script_meth);
832 LDKCVec_u8Z res = *ret;
836 LDKPublicKey get_shutdown_pubkey_jcall(const void* this_arg) {
837 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
838 LDKPublicKey* ret = (LDKPublicKey*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_shutdown_pubkey_meth);
839 LDKPublicKey res = *ret;
843 LDKChannelKeys get_channel_keys_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) {
844 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
845 LDKChannelKeys* ret = (LDKChannelKeys*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_channel_keys_meth, inbound, channel_value_satoshis);
846 LDKChannelKeys res = *ret;
850 LDKThirtyTwoBytes get_secure_random_bytes_jcall(const void* this_arg) {
851 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
852 LDKThirtyTwoBytes* ret = (LDKThirtyTwoBytes*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_secure_random_bytes_meth);
853 LDKThirtyTwoBytes res = *ret;
857 static void LDKKeysInterface_JCalls_free(void* this_arg) {
858 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
859 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
860 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
864 static void* LDKKeysInterface_JCalls_clone(const void* this_arg) {
865 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
866 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
867 return (void*) this_arg;
869 static inline LDKKeysInterface LDKKeysInterface_init (JNIEnv * env, jclass _a, jobject o) {
870 jclass c = (*env)->GetObjectClass(env, o);
872 LDKKeysInterface_JCalls *calls = MALLOC(sizeof(LDKKeysInterface_JCalls), "LDKKeysInterface_JCalls");
873 atomic_init(&calls->refcnt, 1);
875 calls->o = (*env)->NewGlobalRef(env, o);
876 calls->get_node_secret_meth = (*env)->GetMethodID(env, c, "get_node_secret", "()J");
877 assert(calls->get_node_secret_meth != NULL);
878 calls->get_destination_script_meth = (*env)->GetMethodID(env, c, "get_destination_script", "()J");
879 assert(calls->get_destination_script_meth != NULL);
880 calls->get_shutdown_pubkey_meth = (*env)->GetMethodID(env, c, "get_shutdown_pubkey", "()J");
881 assert(calls->get_shutdown_pubkey_meth != NULL);
882 calls->get_channel_keys_meth = (*env)->GetMethodID(env, c, "get_channel_keys", "(ZJ)J");
883 assert(calls->get_channel_keys_meth != NULL);
884 calls->get_secure_random_bytes_meth = (*env)->GetMethodID(env, c, "get_secure_random_bytes", "()J");
885 assert(calls->get_secure_random_bytes_meth != NULL);
887 LDKKeysInterface ret = {
888 .this_arg = (void*) calls,
889 .get_node_secret = get_node_secret_jcall,
890 .get_destination_script = get_destination_script_jcall,
891 .get_shutdown_pubkey = get_shutdown_pubkey_jcall,
892 .get_channel_keys = get_channel_keys_jcall,
893 .get_secure_random_bytes = get_secure_random_bytes_jcall,
894 .free = LDKKeysInterface_JCalls_free,
898 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1new (JNIEnv * env, jclass _a, jobject o) {
899 LDKKeysInterface *res_ptr = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
900 *res_ptr = LDKKeysInterface_init(env, _a, o);
901 return (long)res_ptr;
903 typedef struct LDKChannelMessageHandler_JCalls {
904 atomic_size_t refcnt;
907 LDKMessageSendEventsProvider_JCalls* MessageSendEventsProvider;
908 jmethodID handle_open_channel_meth;
909 jmethodID handle_accept_channel_meth;
910 jmethodID handle_funding_created_meth;
911 jmethodID handle_funding_signed_meth;
912 jmethodID handle_funding_locked_meth;
913 jmethodID handle_shutdown_meth;
914 jmethodID handle_closing_signed_meth;
915 jmethodID handle_update_add_htlc_meth;
916 jmethodID handle_update_fulfill_htlc_meth;
917 jmethodID handle_update_fail_htlc_meth;
918 jmethodID handle_update_fail_malformed_htlc_meth;
919 jmethodID handle_commitment_signed_meth;
920 jmethodID handle_revoke_and_ack_meth;
921 jmethodID handle_update_fee_meth;
922 jmethodID handle_announcement_signatures_meth;
923 jmethodID peer_disconnected_meth;
924 jmethodID peer_connected_meth;
925 jmethodID handle_channel_reestablish_meth;
926 jmethodID handle_error_meth;
927 } LDKChannelMessageHandler_JCalls;
928 void handle_open_channel_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKOpenChannel *msg) {
929 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
930 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_open_channel_meth, their_node_id, their_features, msg);
932 void handle_accept_channel_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKAcceptChannel *msg) {
933 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
934 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_accept_channel_meth, their_node_id, their_features, msg);
936 void handle_funding_created_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated *msg) {
937 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
938 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_funding_created_meth, their_node_id, msg);
940 void handle_funding_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned *msg) {
941 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
942 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_funding_signed_meth, their_node_id, msg);
944 void handle_funding_locked_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingLocked *msg) {
945 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
946 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_funding_locked_meth, their_node_id, msg);
948 void handle_shutdown_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKShutdown *msg) {
949 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
950 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_shutdown_meth, their_node_id, msg);
952 void handle_closing_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned *msg) {
953 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
954 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_closing_signed_meth, their_node_id, msg);
956 void handle_update_add_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC *msg) {
957 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
958 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_update_add_htlc_meth, their_node_id, msg);
960 void handle_update_fulfill_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC *msg) {
961 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
962 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_update_fulfill_htlc_meth, their_node_id, msg);
964 void handle_update_fail_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC *msg) {
965 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
966 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_update_fail_htlc_meth, their_node_id, msg);
968 void handle_update_fail_malformed_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC *msg) {
969 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
970 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_update_fail_malformed_htlc_meth, their_node_id, msg);
972 void handle_commitment_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned *msg) {
973 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
974 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_commitment_signed_meth, their_node_id, msg);
976 void handle_revoke_and_ack_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK *msg) {
977 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
978 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_revoke_and_ack_meth, their_node_id, msg);
980 void handle_update_fee_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee *msg) {
981 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
982 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_update_fee_meth, their_node_id, msg);
984 void handle_announcement_signatures_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures *msg) {
985 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
986 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_announcement_signatures_meth, their_node_id, msg);
988 void peer_disconnected_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) {
989 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
990 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->peer_disconnected_meth, their_node_id, no_connection_possible);
992 void peer_connected_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit *msg) {
993 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
994 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->peer_connected_meth, their_node_id, msg);
996 void handle_channel_reestablish_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReestablish *msg) {
997 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
998 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_channel_reestablish_meth, their_node_id, msg);
1000 void handle_error_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage *msg) {
1001 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1002 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_error_meth, their_node_id, msg);
1004 static void LDKChannelMessageHandler_JCalls_free(void* this_arg) {
1005 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1006 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1007 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
1011 static void* LDKChannelMessageHandler_JCalls_clone(const void* this_arg) {
1012 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1013 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1014 atomic_fetch_add_explicit(&j_calls->MessageSendEventsProvider->refcnt, 1, memory_order_release);
1015 return (void*) this_arg;
1017 static inline LDKChannelMessageHandler LDKChannelMessageHandler_init (JNIEnv * env, jclass _a, jobject o, jobject MessageSendEventsProvider) {
1018 jclass c = (*env)->GetObjectClass(env, o);
1020 LDKChannelMessageHandler_JCalls *calls = MALLOC(sizeof(LDKChannelMessageHandler_JCalls), "LDKChannelMessageHandler_JCalls");
1021 atomic_init(&calls->refcnt, 1);
1023 calls->o = (*env)->NewGlobalRef(env, o);
1024 calls->handle_open_channel_meth = (*env)->GetMethodID(env, c, "handle_open_channel", "(JJJ)V");
1025 assert(calls->handle_open_channel_meth != NULL);
1026 calls->handle_accept_channel_meth = (*env)->GetMethodID(env, c, "handle_accept_channel", "(JJJ)V");
1027 assert(calls->handle_accept_channel_meth != NULL);
1028 calls->handle_funding_created_meth = (*env)->GetMethodID(env, c, "handle_funding_created", "(JJ)V");
1029 assert(calls->handle_funding_created_meth != NULL);
1030 calls->handle_funding_signed_meth = (*env)->GetMethodID(env, c, "handle_funding_signed", "(JJ)V");
1031 assert(calls->handle_funding_signed_meth != NULL);
1032 calls->handle_funding_locked_meth = (*env)->GetMethodID(env, c, "handle_funding_locked", "(JJ)V");
1033 assert(calls->handle_funding_locked_meth != NULL);
1034 calls->handle_shutdown_meth = (*env)->GetMethodID(env, c, "handle_shutdown", "(JJ)V");
1035 assert(calls->handle_shutdown_meth != NULL);
1036 calls->handle_closing_signed_meth = (*env)->GetMethodID(env, c, "handle_closing_signed", "(JJ)V");
1037 assert(calls->handle_closing_signed_meth != NULL);
1038 calls->handle_update_add_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_add_htlc", "(JJ)V");
1039 assert(calls->handle_update_add_htlc_meth != NULL);
1040 calls->handle_update_fulfill_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fulfill_htlc", "(JJ)V");
1041 assert(calls->handle_update_fulfill_htlc_meth != NULL);
1042 calls->handle_update_fail_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fail_htlc", "(JJ)V");
1043 assert(calls->handle_update_fail_htlc_meth != NULL);
1044 calls->handle_update_fail_malformed_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fail_malformed_htlc", "(JJ)V");
1045 assert(calls->handle_update_fail_malformed_htlc_meth != NULL);
1046 calls->handle_commitment_signed_meth = (*env)->GetMethodID(env, c, "handle_commitment_signed", "(JJ)V");
1047 assert(calls->handle_commitment_signed_meth != NULL);
1048 calls->handle_revoke_and_ack_meth = (*env)->GetMethodID(env, c, "handle_revoke_and_ack", "(JJ)V");
1049 assert(calls->handle_revoke_and_ack_meth != NULL);
1050 calls->handle_update_fee_meth = (*env)->GetMethodID(env, c, "handle_update_fee", "(JJ)V");
1051 assert(calls->handle_update_fee_meth != NULL);
1052 calls->handle_announcement_signatures_meth = (*env)->GetMethodID(env, c, "handle_announcement_signatures", "(JJ)V");
1053 assert(calls->handle_announcement_signatures_meth != NULL);
1054 calls->peer_disconnected_meth = (*env)->GetMethodID(env, c, "peer_disconnected", "(JZ)V");
1055 assert(calls->peer_disconnected_meth != NULL);
1056 calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "(JJ)V");
1057 assert(calls->peer_connected_meth != NULL);
1058 calls->handle_channel_reestablish_meth = (*env)->GetMethodID(env, c, "handle_channel_reestablish", "(JJ)V");
1059 assert(calls->handle_channel_reestablish_meth != NULL);
1060 calls->handle_error_meth = (*env)->GetMethodID(env, c, "handle_error", "(JJ)V");
1061 assert(calls->handle_error_meth != NULL);
1063 LDKChannelMessageHandler ret = {
1064 .this_arg = (void*) calls,
1065 .handle_open_channel = handle_open_channel_jcall,
1066 .handle_accept_channel = handle_accept_channel_jcall,
1067 .handle_funding_created = handle_funding_created_jcall,
1068 .handle_funding_signed = handle_funding_signed_jcall,
1069 .handle_funding_locked = handle_funding_locked_jcall,
1070 .handle_shutdown = handle_shutdown_jcall,
1071 .handle_closing_signed = handle_closing_signed_jcall,
1072 .handle_update_add_htlc = handle_update_add_htlc_jcall,
1073 .handle_update_fulfill_htlc = handle_update_fulfill_htlc_jcall,
1074 .handle_update_fail_htlc = handle_update_fail_htlc_jcall,
1075 .handle_update_fail_malformed_htlc = handle_update_fail_malformed_htlc_jcall,
1076 .handle_commitment_signed = handle_commitment_signed_jcall,
1077 .handle_revoke_and_ack = handle_revoke_and_ack_jcall,
1078 .handle_update_fee = handle_update_fee_jcall,
1079 .handle_announcement_signatures = handle_announcement_signatures_jcall,
1080 .peer_disconnected = peer_disconnected_jcall,
1081 .peer_connected = peer_connected_jcall,
1082 .handle_channel_reestablish = handle_channel_reestablish_jcall,
1083 .handle_error = handle_error_jcall,
1084 .free = LDKChannelMessageHandler_JCalls_free,
1085 .MessageSendEventsProvider = LDKMessageSendEventsProvider_init(env, _a, MessageSendEventsProvider),
1087 calls->MessageSendEventsProvider = ret.MessageSendEventsProvider.this_arg;
1090 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1new (JNIEnv * env, jclass _a, jobject o, jobject MessageSendEventsProvider) {
1091 LDKChannelMessageHandler *res_ptr = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
1092 *res_ptr = LDKChannelMessageHandler_init(env, _a, o, MessageSendEventsProvider);
1093 return (long)res_ptr;
1095 typedef struct LDKRoutingMessageHandler_JCalls {
1096 atomic_size_t refcnt;
1099 jmethodID handle_node_announcement_meth;
1100 jmethodID handle_channel_announcement_meth;
1101 jmethodID handle_channel_update_meth;
1102 jmethodID handle_htlc_fail_channel_update_meth;
1103 jmethodID get_next_channel_announcements_meth;
1104 jmethodID get_next_node_announcements_meth;
1105 jmethodID should_request_full_sync_meth;
1106 } LDKRoutingMessageHandler_JCalls;
1107 LDKCResult_boolLightningErrorZ handle_node_announcement_jcall(const void* this_arg, const LDKNodeAnnouncement *msg) {
1108 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1109 LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->handle_node_announcement_meth, msg);
1110 LDKCResult_boolLightningErrorZ res = *ret;
1114 LDKCResult_boolLightningErrorZ handle_channel_announcement_jcall(const void* this_arg, const LDKChannelAnnouncement *msg) {
1115 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1116 LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->handle_channel_announcement_meth, msg);
1117 LDKCResult_boolLightningErrorZ res = *ret;
1121 LDKCResult_boolLightningErrorZ handle_channel_update_jcall(const void* this_arg, const LDKChannelUpdate *msg) {
1122 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1123 LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->handle_channel_update_meth, msg);
1124 LDKCResult_boolLightningErrorZ res = *ret;
1128 void handle_htlc_fail_channel_update_jcall(const void* this_arg, const LDKHTLCFailChannelUpdate *update) {
1129 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1130 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_htlc_fail_channel_update_meth, update);
1132 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcements_jcall(const void* this_arg, uint64_t starting_point, uint8_t batch_amount) {
1133 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1134 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);
1135 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ res = *ret;
1139 LDKCVec_NodeAnnouncementZ get_next_node_announcements_jcall(const void* this_arg, LDKPublicKey starting_point, uint8_t batch_amount) {
1140 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1141 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);
1142 LDKCVec_NodeAnnouncementZ res = *ret;
1146 bool should_request_full_sync_jcall(const void* this_arg, LDKPublicKey node_id) {
1147 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1148 return (*j_calls->env)->CallBooleanMethod(j_calls->env, j_calls->o, j_calls->should_request_full_sync_meth, node_id);
1150 static void LDKRoutingMessageHandler_JCalls_free(void* this_arg) {
1151 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1152 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1153 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
1157 static void* LDKRoutingMessageHandler_JCalls_clone(const void* this_arg) {
1158 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1159 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1160 return (void*) this_arg;
1162 static inline LDKRoutingMessageHandler LDKRoutingMessageHandler_init (JNIEnv * env, jclass _a, jobject o) {
1163 jclass c = (*env)->GetObjectClass(env, o);
1165 LDKRoutingMessageHandler_JCalls *calls = MALLOC(sizeof(LDKRoutingMessageHandler_JCalls), "LDKRoutingMessageHandler_JCalls");
1166 atomic_init(&calls->refcnt, 1);
1168 calls->o = (*env)->NewGlobalRef(env, o);
1169 calls->handle_node_announcement_meth = (*env)->GetMethodID(env, c, "handle_node_announcement", "(J)J");
1170 assert(calls->handle_node_announcement_meth != NULL);
1171 calls->handle_channel_announcement_meth = (*env)->GetMethodID(env, c, "handle_channel_announcement", "(J)J");
1172 assert(calls->handle_channel_announcement_meth != NULL);
1173 calls->handle_channel_update_meth = (*env)->GetMethodID(env, c, "handle_channel_update", "(J)J");
1174 assert(calls->handle_channel_update_meth != NULL);
1175 calls->handle_htlc_fail_channel_update_meth = (*env)->GetMethodID(env, c, "handle_htlc_fail_channel_update", "(J)V");
1176 assert(calls->handle_htlc_fail_channel_update_meth != NULL);
1177 calls->get_next_channel_announcements_meth = (*env)->GetMethodID(env, c, "get_next_channel_announcements", "(JB)J");
1178 assert(calls->get_next_channel_announcements_meth != NULL);
1179 calls->get_next_node_announcements_meth = (*env)->GetMethodID(env, c, "get_next_node_announcements", "(JB)J");
1180 assert(calls->get_next_node_announcements_meth != NULL);
1181 calls->should_request_full_sync_meth = (*env)->GetMethodID(env, c, "should_request_full_sync", "(J)Z");
1182 assert(calls->should_request_full_sync_meth != NULL);
1184 LDKRoutingMessageHandler ret = {
1185 .this_arg = (void*) calls,
1186 .handle_node_announcement = handle_node_announcement_jcall,
1187 .handle_channel_announcement = handle_channel_announcement_jcall,
1188 .handle_channel_update = handle_channel_update_jcall,
1189 .handle_htlc_fail_channel_update = handle_htlc_fail_channel_update_jcall,
1190 .get_next_channel_announcements = get_next_channel_announcements_jcall,
1191 .get_next_node_announcements = get_next_node_announcements_jcall,
1192 .should_request_full_sync = should_request_full_sync_jcall,
1193 .free = LDKRoutingMessageHandler_JCalls_free,
1197 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1new (JNIEnv * env, jclass _a, jobject o) {
1198 LDKRoutingMessageHandler *res_ptr = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
1199 *res_ptr = LDKRoutingMessageHandler_init(env, _a, o);
1200 return (long)res_ptr;
1202 typedef struct LDKSocketDescriptor_JCalls {
1203 atomic_size_t refcnt;
1206 jmethodID send_data_meth;
1207 jmethodID disconnect_socket_meth;
1209 jmethodID hash_meth;
1210 } LDKSocketDescriptor_JCalls;
1211 uintptr_t send_data_jcall(void* this_arg, LDKu8slice data, bool resume_read) {
1212 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
1213 return (*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->send_data_meth, data, resume_read);
1215 void disconnect_socket_jcall(void* this_arg) {
1216 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
1217 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->disconnect_socket_meth);
1219 bool eq_jcall(const void* this_arg, const void *other_arg) {
1220 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
1221 return (*j_calls->env)->CallBooleanMethod(j_calls->env, j_calls->o, j_calls->eq_meth, other_arg);
1223 uint64_t hash_jcall(const void* this_arg) {
1224 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
1225 return (*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->hash_meth);
1227 static void LDKSocketDescriptor_JCalls_free(void* this_arg) {
1228 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
1229 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1230 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
1234 static void* LDKSocketDescriptor_JCalls_clone(const void* this_arg) {
1235 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
1236 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1237 return (void*) this_arg;
1239 static inline LDKSocketDescriptor LDKSocketDescriptor_init (JNIEnv * env, jclass _a, jobject o) {
1240 jclass c = (*env)->GetObjectClass(env, o);
1242 LDKSocketDescriptor_JCalls *calls = MALLOC(sizeof(LDKSocketDescriptor_JCalls), "LDKSocketDescriptor_JCalls");
1243 atomic_init(&calls->refcnt, 1);
1245 calls->o = (*env)->NewGlobalRef(env, o);
1246 calls->send_data_meth = (*env)->GetMethodID(env, c, "send_data", "(JZ)J");
1247 assert(calls->send_data_meth != NULL);
1248 calls->disconnect_socket_meth = (*env)->GetMethodID(env, c, "disconnect_socket", "()V");
1249 assert(calls->disconnect_socket_meth != NULL);
1250 calls->eq_meth = (*env)->GetMethodID(env, c, "eq", "(V)Z");
1251 assert(calls->eq_meth != NULL);
1252 calls->hash_meth = (*env)->GetMethodID(env, c, "hash", "()J");
1253 assert(calls->hash_meth != NULL);
1255 LDKSocketDescriptor ret = {
1256 .this_arg = (void*) calls,
1257 .send_data = send_data_jcall,
1258 .disconnect_socket = disconnect_socket_jcall,
1261 .clone = LDKSocketDescriptor_JCalls_clone,
1262 .free = LDKSocketDescriptor_JCalls_free,
1266 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1new (JNIEnv * env, jclass _a, jobject o) {
1267 LDKSocketDescriptor *res_ptr = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
1268 *res_ptr = LDKSocketDescriptor_init(env, _a, o);
1269 return (long)res_ptr;
1271 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HTLCOutputInCommitmentSignatureZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1272 LDKC2Tuple_HTLCOutputInCommitmentSignatureZ arg_conv = *(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ*)arg;
1274 return C2Tuple_HTLCOutputInCommitmentSignatureZ_free(arg_conv);
1277 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1278 LDKC2Tuple_OutPointScriptZ arg_conv = *(LDKC2Tuple_OutPointScriptZ*)arg;
1280 return C2Tuple_OutPointScriptZ_free(arg_conv);
1283 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1284 LDKC2Tuple_SignatureCVec_SignatureZZ arg_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)arg;
1286 return C2Tuple_SignatureCVec_SignatureZZ_free(arg_conv);
1289 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1TxOutZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1290 LDKC2Tuple_TxidCVec_TxOutZZ arg_conv = *(LDKC2Tuple_TxidCVec_TxOutZZ*)arg;
1292 return C2Tuple_TxidCVec_TxOutZZ_free(arg_conv);
1295 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
1296 LDKC2Tuple_u64u64Z arg_conv = *(LDKC2Tuple_u64u64Z*)arg;
1298 return C2Tuple_u64u64Z_free(arg_conv);
1301 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1302 LDKC2Tuple_usizeTransactionZ arg_conv = *(LDKC2Tuple_usizeTransactionZ*)arg;
1304 return C2Tuple_usizeTransactionZ_free(arg_conv);
1307 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1308 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arg_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)arg;
1310 return C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(arg_conv);
1313 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1314 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ arg_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg;
1316 return CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(arg_conv);
1319 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1320 LDKC2Tuple_SignatureCVec_SignatureZZ arg_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)arg;
1322 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
1323 *ret = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(arg_conv);
1327 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1328 LDKCResult_CVec_SignatureZNoneZ arg_conv = *(LDKCResult_CVec_SignatureZNoneZ*)arg;
1330 return CResult_CVec_SignatureZNoneZ_free(arg_conv);
1333 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1334 LDKCVec_SignatureZ arg_conv = *(LDKCVec_SignatureZ*)arg;
1336 LDKCResult_CVec_SignatureZNoneZ* ret = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
1337 *ret = CResult_CVec_SignatureZNoneZ_ok(arg_conv);
1341 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1342 LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg;
1344 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
1345 *ret = CResult_CVec_u8ZPeerHandleErrorZ_err(arg_conv);
1349 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1350 LDKCResult_CVec_u8ZPeerHandleErrorZ arg_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg;
1352 return CResult_CVec_u8ZPeerHandleErrorZ_free(arg_conv);
1355 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1356 LDKCVec_u8Z arg_conv = *(LDKCVec_u8Z*)arg;
1358 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
1359 *ret = CResult_CVec_u8ZPeerHandleErrorZ_ok(arg_conv);
1363 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1364 LDKAPIError arg_conv = *(LDKAPIError*)arg;
1366 LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
1367 *ret = CResult_NoneAPIErrorZ_err(arg_conv);
1371 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1372 LDKCResult_NoneAPIErrorZ arg_conv = *(LDKCResult_NoneAPIErrorZ*)arg;
1374 return CResult_NoneAPIErrorZ_free(arg_conv);
1377 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
1378 LDKChannelMonitorUpdateErr arg_conv = *(LDKChannelMonitorUpdateErr*)arg;
1380 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
1381 *ret = CResult_NoneChannelMonitorUpdateErrZ_err(arg_conv);
1385 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1386 LDKCResult_NoneChannelMonitorUpdateErrZ arg_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)arg;
1388 return CResult_NoneChannelMonitorUpdateErrZ_free(arg_conv);
1391 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1392 LDKMonitorUpdateError arg_conv = *(LDKMonitorUpdateError*)arg;
1394 LDKCResult_NoneMonitorUpdateErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
1395 *ret = CResult_NoneMonitorUpdateErrorZ_err(arg_conv);
1399 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1400 LDKCResult_NoneMonitorUpdateErrorZ arg_conv = *(LDKCResult_NoneMonitorUpdateErrorZ*)arg;
1402 return CResult_NoneMonitorUpdateErrorZ_free(arg_conv);
1405 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1406 LDKPaymentSendFailure arg_conv = *(LDKPaymentSendFailure*)arg;
1408 LDKCResult_NonePaymentSendFailureZ* ret = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
1409 *ret = CResult_NonePaymentSendFailureZ_err(arg_conv);
1413 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1414 LDKCResult_NonePaymentSendFailureZ arg_conv = *(LDKCResult_NonePaymentSendFailureZ*)arg;
1416 return CResult_NonePaymentSendFailureZ_free(arg_conv);
1419 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1420 LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg;
1422 LDKCResult_NonePeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
1423 *ret = CResult_NonePeerHandleErrorZ_err(arg_conv);
1427 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1428 LDKCResult_NonePeerHandleErrorZ arg_conv = *(LDKCResult_NonePeerHandleErrorZ*)arg;
1430 return CResult_NonePeerHandleErrorZ_free(arg_conv);
1433 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
1434 LDKSecp256k1Error arg_conv = *(LDKSecp256k1Error*)arg;
1436 LDKCResult_PublicKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ");
1437 *ret = CResult_PublicKeySecpErrorZ_err(arg_conv);
1441 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1442 LDKCResult_PublicKeySecpErrorZ arg_conv = *(LDKCResult_PublicKeySecpErrorZ*)arg;
1444 return CResult_PublicKeySecpErrorZ_free(arg_conv);
1447 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1448 LDKPublicKey arg_conv = *(LDKPublicKey*)arg;
1450 LDKCResult_PublicKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ");
1451 *ret = CResult_PublicKeySecpErrorZ_ok(arg_conv);
1455 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1456 LDKLightningError arg_conv = *(LDKLightningError*)arg;
1458 LDKCResult_RouteLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
1459 *ret = CResult_RouteLightningErrorZ_err(arg_conv);
1463 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1464 LDKCResult_RouteLightningErrorZ arg_conv = *(LDKCResult_RouteLightningErrorZ*)arg;
1466 return CResult_RouteLightningErrorZ_free(arg_conv);
1469 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1470 LDKRoute arg_conv = *(LDKRoute*)arg;
1472 LDKCResult_RouteLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
1473 *ret = CResult_RouteLightningErrorZ_ok(arg_conv);
1477 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
1478 LDKSecp256k1Error arg_conv = *(LDKSecp256k1Error*)arg;
1480 LDKCResult_SecretKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ");
1481 *ret = CResult_SecretKeySecpErrorZ_err(arg_conv);
1485 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1486 LDKCResult_SecretKeySecpErrorZ arg_conv = *(LDKCResult_SecretKeySecpErrorZ*)arg;
1488 return CResult_SecretKeySecpErrorZ_free(arg_conv);
1491 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1492 LDKSecretKey arg_conv = *(LDKSecretKey*)arg;
1494 LDKCResult_SecretKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ");
1495 *ret = CResult_SecretKeySecpErrorZ_ok(arg_conv);
1499 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1500 LDKCResult_SignatureNoneZ arg_conv = *(LDKCResult_SignatureNoneZ*)arg;
1502 return CResult_SignatureNoneZ_free(arg_conv);
1505 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1506 LDKSignature arg_conv = *(LDKSignature*)arg;
1508 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
1509 *ret = CResult_SignatureNoneZ_ok(arg_conv);
1513 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
1514 LDKSecp256k1Error arg_conv = *(LDKSecp256k1Error*)arg;
1516 LDKCResult_TxCreationKeysSecpErrorZ* ret = MALLOC(sizeof(LDKCResult_TxCreationKeysSecpErrorZ), "LDKCResult_TxCreationKeysSecpErrorZ");
1517 *ret = CResult_TxCreationKeysSecpErrorZ_err(arg_conv);
1521 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1522 LDKCResult_TxCreationKeysSecpErrorZ arg_conv = *(LDKCResult_TxCreationKeysSecpErrorZ*)arg;
1524 return CResult_TxCreationKeysSecpErrorZ_free(arg_conv);
1527 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1528 LDKTxCreationKeys arg_conv = *(LDKTxCreationKeys*)arg;
1530 LDKCResult_TxCreationKeysSecpErrorZ* ret = MALLOC(sizeof(LDKCResult_TxCreationKeysSecpErrorZ), "LDKCResult_TxCreationKeysSecpErrorZ");
1531 *ret = CResult_TxCreationKeysSecpErrorZ_ok(arg_conv);
1535 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
1536 LDKAccessError arg_conv = *(LDKAccessError*)arg;
1538 LDKCResult_TxOutAccessErrorZ* ret = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
1539 *ret = CResult_TxOutAccessErrorZ_err(arg_conv);
1543 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1544 LDKCResult_TxOutAccessErrorZ arg_conv = *(LDKCResult_TxOutAccessErrorZ*)arg;
1546 return CResult_TxOutAccessErrorZ_free(arg_conv);
1549 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1550 LDKTxOut arg_conv = *(LDKTxOut*)arg;
1552 LDKCResult_TxOutAccessErrorZ* ret = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
1553 *ret = CResult_TxOutAccessErrorZ_ok(arg_conv);
1557 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1558 LDKLightningError arg_conv = *(LDKLightningError*)arg;
1560 LDKCResult_boolLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
1561 *ret = CResult_boolLightningErrorZ_err(arg_conv);
1565 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1566 LDKCResult_boolLightningErrorZ arg_conv = *(LDKCResult_boolLightningErrorZ*)arg;
1568 return CResult_boolLightningErrorZ_free(arg_conv);
1571 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1ok(JNIEnv * _env, jclass _b, jboolean arg) {
1572 LDKCResult_boolLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
1573 *ret = CResult_boolLightningErrorZ_ok(arg);
1577 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1578 LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg;
1580 LDKCResult_boolPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
1581 *ret = CResult_boolPeerHandleErrorZ_err(arg_conv);
1585 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1586 LDKCResult_boolPeerHandleErrorZ arg_conv = *(LDKCResult_boolPeerHandleErrorZ*)arg;
1588 return CResult_boolPeerHandleErrorZ_free(arg_conv);
1591 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b, jboolean arg) {
1592 LDKCResult_boolPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
1593 *ret = CResult_boolPeerHandleErrorZ_ok(arg);
1597 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1HTLCOutputInCommitmentSignatureZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1598 LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ arg_conv = *(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ*)arg;
1600 return CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ_free(arg_conv);
1603 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1TxOutZZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1604 LDKCVec_C2Tuple_TxidCVec_TxOutZZZ arg_conv = *(LDKCVec_C2Tuple_TxidCVec_TxOutZZZ*)arg;
1606 return CVec_C2Tuple_TxidCVec_TxOutZZZ_free(arg_conv);
1609 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1usizeTransactionZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1610 LDKCVec_C2Tuple_usizeTransactionZZ arg_conv = *(LDKCVec_C2Tuple_usizeTransactionZZ*)arg;
1612 return CVec_C2Tuple_usizeTransactionZZ_free(arg_conv);
1615 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1616 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ arg_conv = *(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)arg;
1618 return CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(arg_conv);
1621 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1RouteHopZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1622 LDKCVec_CVec_RouteHopZZ arg_conv = *(LDKCVec_CVec_RouteHopZZ*)arg;
1624 return CVec_CVec_RouteHopZZ_free(arg_conv);
1627 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1628 LDKCVec_ChannelDetailsZ arg_conv = *(LDKCVec_ChannelDetailsZ*)arg;
1630 return CVec_ChannelDetailsZ_free(arg_conv);
1633 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelMonitorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1634 LDKCVec_ChannelMonitorZ arg_conv = *(LDKCVec_ChannelMonitorZ*)arg;
1636 return CVec_ChannelMonitorZ_free(arg_conv);
1639 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1EventZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1640 LDKCVec_EventZ arg_conv = *(LDKCVec_EventZ*)arg;
1642 return CVec_EventZ_free(arg_conv);
1645 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1HTLCOutputInCommitmentZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1646 LDKCVec_HTLCOutputInCommitmentZ arg_conv = *(LDKCVec_HTLCOutputInCommitmentZ*)arg;
1648 return CVec_HTLCOutputInCommitmentZ_free(arg_conv);
1651 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MessageSendEventZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1652 LDKCVec_MessageSendEventZ arg_conv = *(LDKCVec_MessageSendEventZ*)arg;
1654 return CVec_MessageSendEventZ_free(arg_conv);
1657 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorEventZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1658 LDKCVec_MonitorEventZ arg_conv = *(LDKCVec_MonitorEventZ*)arg;
1660 return CVec_MonitorEventZ_free(arg_conv);
1663 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NetAddressZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1664 LDKCVec_NetAddressZ arg_conv = *(LDKCVec_NetAddressZ*)arg;
1666 return CVec_NetAddressZ_free(arg_conv);
1669 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NodeAnnouncementZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1670 LDKCVec_NodeAnnouncementZ arg_conv = *(LDKCVec_NodeAnnouncementZ*)arg;
1672 return CVec_NodeAnnouncementZ_free(arg_conv);
1675 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PublicKeyZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1676 LDKCVec_PublicKeyZ arg_conv = *(LDKCVec_PublicKeyZ*)arg;
1678 return CVec_PublicKeyZ_free(arg_conv);
1681 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1682 LDKCVec_RouteHintZ arg_conv = *(LDKCVec_RouteHintZ*)arg;
1684 return CVec_RouteHintZ_free(arg_conv);
1687 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHopZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1688 LDKCVec_RouteHopZ arg_conv = *(LDKCVec_RouteHopZ*)arg;
1690 return CVec_RouteHopZ_free(arg_conv);
1693 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SignatureZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1694 LDKCVec_SignatureZ arg_conv = *(LDKCVec_SignatureZ*)arg;
1696 return CVec_SignatureZ_free(arg_conv);
1699 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SpendableOutputDescriptorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1700 LDKCVec_SpendableOutputDescriptorZ arg_conv = *(LDKCVec_SpendableOutputDescriptorZ*)arg;
1702 return CVec_SpendableOutputDescriptorZ_free(arg_conv);
1705 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1706 LDKCVec_TransactionZ arg_conv = *(LDKCVec_TransactionZ*)arg;
1708 return CVec_TransactionZ_free(arg_conv);
1711 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TxOutZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1712 LDKCVec_TxOutZ arg_conv = *(LDKCVec_TxOutZ*)arg;
1714 return CVec_TxOutZ_free(arg_conv);
1717 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateAddHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1718 LDKCVec_UpdateAddHTLCZ arg_conv = *(LDKCVec_UpdateAddHTLCZ*)arg;
1720 return CVec_UpdateAddHTLCZ_free(arg_conv);
1723 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1724 LDKCVec_UpdateFailHTLCZ arg_conv = *(LDKCVec_UpdateFailHTLCZ*)arg;
1726 return CVec_UpdateFailHTLCZ_free(arg_conv);
1729 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailMalformedHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1730 LDKCVec_UpdateFailMalformedHTLCZ arg_conv = *(LDKCVec_UpdateFailMalformedHTLCZ*)arg;
1732 return CVec_UpdateFailMalformedHTLCZ_free(arg_conv);
1735 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFulfillHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1736 LDKCVec_UpdateFulfillHTLCZ arg_conv = *(LDKCVec_UpdateFulfillHTLCZ*)arg;
1738 return CVec_UpdateFulfillHTLCZ_free(arg_conv);
1741 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u64Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
1742 LDKCVec_u64Z arg_conv = *(LDKCVec_u64Z*)arg;
1744 return CVec_u64Z_free(arg_conv);
1747 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u8Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
1748 LDKCVec_u8Z arg_conv = *(LDKCVec_u8Z*)arg;
1750 return CVec_u8Z_free(arg_conv);
1753 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Transaction_1free(JNIEnv * _env, jclass _b, jlong _res) {
1754 LDKTransaction _res_conv = *(LDKTransaction*)_res;
1756 return Transaction_free(_res_conv);
1759 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_1free(JNIEnv * _env, jclass _b, jlong _res) {
1760 LDKTxOut _res_conv = *(LDKTxOut*)_res;
1762 return TxOut_free(_res_conv);
1765 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
1766 LDKTransaction b_conv = *(LDKTransaction*)b;
1768 LDKC2Tuple_usizeTransactionZ* ret = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
1769 *ret = C2Tuple_usizeTransactionZ_new(a, b_conv);
1773 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1ok(JNIEnv * _env, jclass _b) {
1774 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
1775 *ret = CResult_NoneChannelMonitorUpdateErrZ_ok();
1779 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1ok(JNIEnv * _env, jclass _b) {
1780 LDKCResult_NoneMonitorUpdateErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
1781 *ret = CResult_NoneMonitorUpdateErrorZ_ok();
1785 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
1786 LDKOutPoint a_conv = *(LDKOutPoint*)a;
1788 a_conv.is_owned = true;
1789 LDKCVec_u8Z b_conv = *(LDKCVec_u8Z*)b;
1791 LDKC2Tuple_OutPointScriptZ* ret = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
1792 *ret = C2Tuple_OutPointScriptZ_new(a_conv, b_conv);
1796 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1TxOutZZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
1797 LDKThirtyTwoBytes a_conv = *(LDKThirtyTwoBytes*)a;
1799 LDKCVec_TxOutZ b_conv = *(LDKCVec_TxOutZ*)b;
1801 LDKC2Tuple_TxidCVec_TxOutZZ* ret = MALLOC(sizeof(LDKC2Tuple_TxidCVec_TxOutZZ), "LDKC2Tuple_TxidCVec_TxOutZZ");
1802 *ret = C2Tuple_TxidCVec_TxOutZZ_new(a_conv, b_conv);
1806 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
1807 LDKC2Tuple_u64u64Z* ret = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
1808 *ret = C2Tuple_u64u64Z_new(a, b);
1812 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
1813 LDKSignature a_conv = *(LDKSignature*)a;
1815 LDKCVec_SignatureZ b_conv = *(LDKCVec_SignatureZ*)b;
1817 LDKC2Tuple_SignatureCVec_SignatureZZ* ret = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
1818 *ret = C2Tuple_SignatureCVec_SignatureZZ_new(a_conv, b_conv);
1822 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1err(JNIEnv * _env, jclass _b) {
1823 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
1824 *ret = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err();
1828 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1err(JNIEnv * _env, jclass _b) {
1829 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
1830 *ret = CResult_SignatureNoneZ_err();
1834 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1err(JNIEnv * _env, jclass _b) {
1835 LDKCResult_CVec_SignatureZNoneZ* ret = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
1836 *ret = CResult_CVec_SignatureZNoneZ_err();
1840 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1ok(JNIEnv * _env, jclass _b) {
1841 LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
1842 *ret = CResult_NoneAPIErrorZ_ok();
1846 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1ok(JNIEnv * _env, jclass _b) {
1847 LDKCResult_NonePaymentSendFailureZ* ret = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
1848 *ret = CResult_NonePaymentSendFailureZ_ok();
1852 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b, jlong c) {
1853 LDKChannelAnnouncement a_conv = *(LDKChannelAnnouncement*)a;
1855 a_conv.is_owned = true;
1856 LDKChannelUpdate b_conv = *(LDKChannelUpdate*)b;
1858 b_conv.is_owned = true;
1859 LDKChannelUpdate c_conv = *(LDKChannelUpdate*)c;
1861 c_conv.is_owned = true;
1862 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
1863 *ret = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a_conv, b_conv, c_conv);
1867 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b) {
1868 LDKCResult_NonePeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
1869 *ret = CResult_NonePeerHandleErrorZ_ok();
1873 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HTLCOutputInCommitmentSignatureZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
1874 LDKHTLCOutputInCommitment a_conv = *(LDKHTLCOutputInCommitment*)a;
1876 a_conv.is_owned = true;
1877 LDKSignature b_conv = *(LDKSignature*)b;
1879 LDKC2Tuple_HTLCOutputInCommitmentSignatureZ* ret = MALLOC(sizeof(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ), "LDKC2Tuple_HTLCOutputInCommitmentSignatureZ");
1880 *ret = C2Tuple_HTLCOutputInCommitmentSignatureZ_new(a_conv, b_conv);
1884 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1885 LDKEvent this_ptr_conv = *(LDKEvent*)this_ptr;
1886 FREE((void*)this_ptr);
1887 return Event_free(this_ptr_conv);
1890 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1891 LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)this_ptr;
1892 FREE((void*)this_ptr);
1893 return MessageSendEvent_free(this_ptr_conv);
1896 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1897 LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)this_ptr;
1898 FREE((void*)this_ptr);
1899 return MessageSendEventsProvider_free(this_ptr_conv);
1902 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1903 LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)this_ptr;
1904 FREE((void*)this_ptr);
1905 return EventsProvider_free(this_ptr_conv);
1908 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_APIError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1909 LDKAPIError this_ptr_conv = *(LDKAPIError*)this_ptr;
1910 FREE((void*)this_ptr);
1911 return APIError_free(this_ptr_conv);
1914 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1max(JNIEnv * _env, jclass _b) {
1915 jclass ret = LDKLevel_to_java(_env, Level_max());
1919 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Logger_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1920 LDKLogger this_ptr_conv = *(LDKLogger*)this_ptr;
1921 FREE((void*)this_ptr);
1922 return Logger_free(this_ptr_conv);
1925 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1926 LDKChannelHandshakeConfig this_ptr_conv = *(LDKChannelHandshakeConfig*)this_ptr;
1927 FREE((void*)this_ptr);
1928 this_ptr_conv.is_owned = true;
1929 return ChannelHandshakeConfig_free(this_ptr_conv);
1932 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr) {
1933 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
1934 return ChannelHandshakeConfig_get_minimum_depth(this_ptr_conv);
1937 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
1938 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
1939 return ChannelHandshakeConfig_set_minimum_depth(this_ptr_conv, val);
1942 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
1943 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
1944 return ChannelHandshakeConfig_get_our_to_self_delay(this_ptr_conv);
1947 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
1948 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
1949 return ChannelHandshakeConfig_set_our_to_self_delay(this_ptr_conv, val);
1952 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
1953 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
1954 return ChannelHandshakeConfig_get_our_htlc_minimum_msat(this_ptr_conv);
1957 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1958 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
1959 return ChannelHandshakeConfig_set_our_htlc_minimum_msat(this_ptr_conv, val);
1962 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) {
1963 LDKChannelHandshakeConfig* ret = MALLOC(sizeof(LDKChannelHandshakeConfig), "LDKChannelHandshakeConfig");
1964 *ret = ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg);
1965 assert(ret->is_owned);
1966 ret->is_owned = false;
1970 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1default(JNIEnv * _env, jclass _b) {
1971 LDKChannelHandshakeConfig* ret = MALLOC(sizeof(LDKChannelHandshakeConfig), "LDKChannelHandshakeConfig");
1972 *ret = ChannelHandshakeConfig_default();
1973 assert(ret->is_owned);
1974 ret->is_owned = false;
1978 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
1979 LDKChannelHandshakeLimits this_ptr_conv = *(LDKChannelHandshakeLimits*)this_ptr;
1980 FREE((void*)this_ptr);
1981 this_ptr_conv.is_owned = true;
1982 return ChannelHandshakeLimits_free(this_ptr_conv);
1985 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
1986 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1987 return ChannelHandshakeLimits_get_min_funding_satoshis(this_ptr_conv);
1990 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
1991 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1992 return ChannelHandshakeLimits_set_min_funding_satoshis(this_ptr_conv, val);
1995 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
1996 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
1997 return ChannelHandshakeLimits_get_max_htlc_minimum_msat(this_ptr_conv);
2000 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2001 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2002 return ChannelHandshakeLimits_set_max_htlc_minimum_msat(this_ptr_conv, val);
2005 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
2006 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2007 return ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(this_ptr_conv);
2010 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) {
2011 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2012 return ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(this_ptr_conv, val);
2015 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
2016 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2017 return ChannelHandshakeLimits_get_max_channel_reserve_satoshis(this_ptr_conv);
2020 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2021 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2022 return ChannelHandshakeLimits_set_max_channel_reserve_satoshis(this_ptr_conv, val);
2025 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr) {
2026 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2027 return ChannelHandshakeLimits_get_min_max_accepted_htlcs(this_ptr_conv);
2030 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
2031 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2032 return ChannelHandshakeLimits_set_min_max_accepted_htlcs(this_ptr_conv, val);
2035 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
2036 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2037 return ChannelHandshakeLimits_get_min_dust_limit_satoshis(this_ptr_conv);
2040 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2041 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2042 return ChannelHandshakeLimits_set_min_dust_limit_satoshis(this_ptr_conv, val);
2045 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
2046 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2047 return ChannelHandshakeLimits_get_max_dust_limit_satoshis(this_ptr_conv);
2050 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2051 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2052 return ChannelHandshakeLimits_set_max_dust_limit_satoshis(this_ptr_conv, val);
2055 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr) {
2056 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2057 return ChannelHandshakeLimits_get_max_minimum_depth(this_ptr_conv);
2060 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
2061 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2062 return ChannelHandshakeLimits_set_max_minimum_depth(this_ptr_conv, val);
2065 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1force_1announced_1channel_1preference(JNIEnv * _env, jclass _b, jlong this_ptr) {
2066 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2067 return ChannelHandshakeLimits_get_force_announced_channel_preference(this_ptr_conv);
2070 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1force_1announced_1channel_1preference(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
2071 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2072 return ChannelHandshakeLimits_set_force_announced_channel_preference(this_ptr_conv, val);
2075 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1their_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
2076 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2077 return ChannelHandshakeLimits_get_their_to_self_delay(this_ptr_conv);
2080 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1their_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
2081 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2082 return ChannelHandshakeLimits_set_their_to_self_delay(this_ptr_conv, val);
2085 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) {
2086 LDKChannelHandshakeLimits* ret = MALLOC(sizeof(LDKChannelHandshakeLimits), "LDKChannelHandshakeLimits");
2087 *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);
2088 assert(ret->is_owned);
2089 ret->is_owned = false;
2093 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1default(JNIEnv * _env, jclass _b) {
2094 LDKChannelHandshakeLimits* ret = MALLOC(sizeof(LDKChannelHandshakeLimits), "LDKChannelHandshakeLimits");
2095 *ret = ChannelHandshakeLimits_default();
2096 assert(ret->is_owned);
2097 ret->is_owned = false;
2101 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2102 LDKChannelConfig this_ptr_conv = *(LDKChannelConfig*)this_ptr;
2103 FREE((void*)this_ptr);
2104 this_ptr_conv.is_owned = true;
2105 return ChannelConfig_free(this_ptr_conv);
2108 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr) {
2109 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
2110 return ChannelConfig_get_fee_proportional_millionths(this_ptr_conv);
2113 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
2114 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
2115 return ChannelConfig_set_fee_proportional_millionths(this_ptr_conv, val);
2118 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1announced_1channel(JNIEnv * _env, jclass _b, jlong this_ptr) {
2119 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
2120 return ChannelConfig_get_announced_channel(this_ptr_conv);
2123 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1announced_1channel(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
2124 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
2125 return ChannelConfig_set_announced_channel(this_ptr_conv, val);
2128 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1commit_1upfront_1shutdown_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
2129 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
2130 return ChannelConfig_get_commit_upfront_shutdown_pubkey(this_ptr_conv);
2133 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1commit_1upfront_1shutdown_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
2134 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
2135 return ChannelConfig_set_commit_upfront_shutdown_pubkey(this_ptr_conv, val);
2138 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) {
2139 LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
2140 *ret = ChannelConfig_new(fee_proportional_millionths_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg);
2141 assert(ret->is_owned);
2142 ret->is_owned = false;
2146 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1default(JNIEnv * _env, jclass _b) {
2147 LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
2148 *ret = ChannelConfig_default();
2149 assert(ret->is_owned);
2150 ret->is_owned = false;
2154 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1write(JNIEnv * _env, jclass _b, jlong obj) {
2155 LDKChannelConfig* obj_conv = (LDKChannelConfig*)obj;
2156 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
2157 *ret = ChannelConfig_write(obj_conv);
2161 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1read(JNIEnv * _env, jclass _b, jlong ser) {
2162 LDKu8slice ser_conv = *(LDKu8slice*)ser;
2164 LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
2165 *ret = ChannelConfig_read(ser_conv);
2166 assert(ret->is_owned);
2167 ret->is_owned = false;
2171 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2172 LDKUserConfig this_ptr_conv = *(LDKUserConfig*)this_ptr;
2173 FREE((void*)this_ptr);
2174 this_ptr_conv.is_owned = true;
2175 return UserConfig_free(this_ptr_conv);
2178 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1own_1channel_1config(JNIEnv * _env, jclass _b, jlong this_ptr) {
2179 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
2180 LDKChannelHandshakeConfig* ret = MALLOC(sizeof(LDKChannelHandshakeConfig), "LDKChannelHandshakeConfig");
2181 *ret = UserConfig_get_own_channel_config(this_ptr_conv);
2182 assert(ret->is_owned);
2183 ret->is_owned = false;
2187 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1own_1channel_1config(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2188 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
2189 LDKChannelHandshakeConfig val_conv = *(LDKChannelHandshakeConfig*)val;
2191 val_conv.is_owned = true;
2192 return UserConfig_set_own_channel_config(this_ptr_conv, val_conv);
2195 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1peer_1channel_1config_1limits(JNIEnv * _env, jclass _b, jlong this_ptr) {
2196 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
2197 LDKChannelHandshakeLimits* ret = MALLOC(sizeof(LDKChannelHandshakeLimits), "LDKChannelHandshakeLimits");
2198 *ret = UserConfig_get_peer_channel_config_limits(this_ptr_conv);
2199 assert(ret->is_owned);
2200 ret->is_owned = false;
2204 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1peer_1channel_1config_1limits(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2205 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
2206 LDKChannelHandshakeLimits val_conv = *(LDKChannelHandshakeLimits*)val;
2208 val_conv.is_owned = true;
2209 return UserConfig_set_peer_channel_config_limits(this_ptr_conv, val_conv);
2212 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1channel_1options(JNIEnv * _env, jclass _b, jlong this_ptr) {
2213 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
2214 LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
2215 *ret = UserConfig_get_channel_options(this_ptr_conv);
2216 assert(ret->is_owned);
2217 ret->is_owned = false;
2221 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1channel_1options(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2222 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
2223 LDKChannelConfig val_conv = *(LDKChannelConfig*)val;
2225 val_conv.is_owned = true;
2226 return UserConfig_set_channel_options(this_ptr_conv, val_conv);
2229 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) {
2230 LDKChannelHandshakeConfig own_channel_config_arg_conv = *(LDKChannelHandshakeConfig*)own_channel_config_arg;
2231 FREE((void*)own_channel_config_arg);
2232 own_channel_config_arg_conv.is_owned = true;
2233 LDKChannelHandshakeLimits peer_channel_config_limits_arg_conv = *(LDKChannelHandshakeLimits*)peer_channel_config_limits_arg;
2234 FREE((void*)peer_channel_config_limits_arg);
2235 peer_channel_config_limits_arg_conv.is_owned = true;
2236 LDKChannelConfig channel_options_arg_conv = *(LDKChannelConfig*)channel_options_arg;
2237 FREE((void*)channel_options_arg);
2238 channel_options_arg_conv.is_owned = true;
2239 LDKUserConfig* ret = MALLOC(sizeof(LDKUserConfig), "LDKUserConfig");
2240 *ret = UserConfig_new(own_channel_config_arg_conv, peer_channel_config_limits_arg_conv, channel_options_arg_conv);
2241 assert(ret->is_owned);
2242 ret->is_owned = false;
2246 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1default(JNIEnv * _env, jclass _b) {
2247 LDKUserConfig* ret = MALLOC(sizeof(LDKUserConfig), "LDKUserConfig");
2248 *ret = UserConfig_default();
2249 assert(ret->is_owned);
2250 ret->is_owned = false;
2254 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Access_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2255 LDKAccess this_ptr_conv = *(LDKAccess*)this_ptr;
2256 FREE((void*)this_ptr);
2257 return Access_free(this_ptr_conv);
2260 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Watch_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2261 LDKWatch this_ptr_conv = *(LDKWatch*)this_ptr;
2262 FREE((void*)this_ptr);
2263 return Watch_free(this_ptr_conv);
2266 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2267 LDKFilter this_ptr_conv = *(LDKFilter*)this_ptr;
2268 FREE((void*)this_ptr);
2269 return Filter_free(this_ptr_conv);
2272 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2273 LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)this_ptr;
2274 FREE((void*)this_ptr);
2275 return BroadcasterInterface_free(this_ptr_conv);
2278 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2279 LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)this_ptr;
2280 FREE((void*)this_ptr);
2281 return FeeEstimator_free(this_ptr_conv);
2284 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2285 LDKChainMonitor this_ptr_conv = *(LDKChainMonitor*)this_ptr;
2286 FREE((void*)this_ptr);
2287 this_ptr_conv.is_owned = true;
2288 return ChainMonitor_free(this_ptr_conv);
2291 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1block_1connected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jlong txdata, jint height) {
2292 LDKChainMonitor* this_arg_conv = (LDKChainMonitor*)this_arg;
2293 unsigned char header_arr[80];
2294 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
2295 unsigned char (*header_ref)[80] = &header_arr;
2296 LDKCVec_C2Tuple_usizeTransactionZZ txdata_conv = *(LDKCVec_C2Tuple_usizeTransactionZZ*)txdata;
2297 FREE((void*)txdata);
2298 return ChainMonitor_block_connected(this_arg_conv, header_ref, txdata_conv, height);
2301 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1block_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jint disconnected_height) {
2302 LDKChainMonitor* this_arg_conv = (LDKChainMonitor*)this_arg;
2303 unsigned char header_arr[80];
2304 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
2305 unsigned char (*header_ref)[80] = &header_arr;
2306 return ChainMonitor_block_disconnected(this_arg_conv, header_ref, disconnected_height);
2309 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1new(JNIEnv * _env, jclass _b, jlong chain_source, jlong broadcaster, jlong logger, jlong feeest) {
2310 LDKFilter* chain_source_conv = (LDKFilter*)chain_source;
2311 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)broadcaster;
2312 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
2313 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2314 LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
2316 LDKLogger logger_conv = *(LDKLogger*)logger;
2317 if (logger_conv.free == LDKLogger_JCalls_free) {
2318 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2319 LDKLogger_JCalls_clone(logger_conv.this_arg);
2321 LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)feeest;
2322 if (feeest_conv.free == LDKFeeEstimator_JCalls_free) {
2323 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2324 LDKFeeEstimator_JCalls_clone(feeest_conv.this_arg);
2326 LDKChainMonitor* ret = MALLOC(sizeof(LDKChainMonitor), "LDKChainMonitor");
2327 *ret = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv);
2328 assert(ret->is_owned);
2329 ret->is_owned = false;
2333 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Watch(JNIEnv * _env, jclass _b, jlong this_arg) {
2334 LDKChainMonitor* this_arg_conv = (LDKChainMonitor*)this_arg;
2335 LDKWatch* ret = MALLOC(sizeof(LDKWatch), "LDKWatch");
2336 *ret = ChainMonitor_as_Watch(this_arg_conv);
2340 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1EventsProvider(JNIEnv * _env, jclass _b, jlong this_arg) {
2341 LDKChainMonitor* this_arg_conv = (LDKChainMonitor*)this_arg;
2342 LDKEventsProvider* ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
2343 *ret = ChainMonitor_as_EventsProvider(this_arg_conv);
2347 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2348 LDKChannelMonitorUpdate this_ptr_conv = *(LDKChannelMonitorUpdate*)this_ptr;
2349 FREE((void*)this_ptr);
2350 this_ptr_conv.is_owned = true;
2351 return ChannelMonitorUpdate_free(this_ptr_conv);
2354 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1get_1update_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
2355 LDKChannelMonitorUpdate* this_ptr_conv = (LDKChannelMonitorUpdate*)this_ptr;
2356 return ChannelMonitorUpdate_get_update_id(this_ptr_conv);
2359 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1set_1update_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2360 LDKChannelMonitorUpdate* this_ptr_conv = (LDKChannelMonitorUpdate*)this_ptr;
2361 return ChannelMonitorUpdate_set_update_id(this_ptr_conv, val);
2364 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
2365 LDKChannelMonitorUpdate* obj_conv = (LDKChannelMonitorUpdate*)obj;
2366 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
2367 *ret = ChannelMonitorUpdate_write(obj_conv);
2371 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
2372 LDKu8slice ser_conv = *(LDKu8slice*)ser;
2374 LDKChannelMonitorUpdate* ret = MALLOC(sizeof(LDKChannelMonitorUpdate), "LDKChannelMonitorUpdate");
2375 *ret = ChannelMonitorUpdate_read(ser_conv);
2376 assert(ret->is_owned);
2377 ret->is_owned = false;
2381 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2382 LDKMonitorUpdateError this_ptr_conv = *(LDKMonitorUpdateError*)this_ptr;
2383 FREE((void*)this_ptr);
2384 this_ptr_conv.is_owned = true;
2385 return MonitorUpdateError_free(this_ptr_conv);
2388 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2389 LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)this_ptr;
2390 FREE((void*)this_ptr);
2391 this_ptr_conv.is_owned = true;
2392 return MonitorEvent_free(this_ptr_conv);
2395 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2396 LDKHTLCUpdate this_ptr_conv = *(LDKHTLCUpdate*)this_ptr;
2397 FREE((void*)this_ptr);
2398 this_ptr_conv.is_owned = true;
2399 return HTLCUpdate_free(this_ptr_conv);
2402 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
2403 LDKHTLCUpdate* obj_conv = (LDKHTLCUpdate*)obj;
2404 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
2405 *ret = HTLCUpdate_write(obj_conv);
2409 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
2410 LDKu8slice ser_conv = *(LDKu8slice*)ser;
2412 LDKHTLCUpdate* ret = MALLOC(sizeof(LDKHTLCUpdate), "LDKHTLCUpdate");
2413 *ret = HTLCUpdate_read(ser_conv);
2414 assert(ret->is_owned);
2415 ret->is_owned = false;
2419 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2420 LDKChannelMonitor this_ptr_conv = *(LDKChannelMonitor*)this_ptr;
2421 FREE((void*)this_ptr);
2422 this_ptr_conv.is_owned = true;
2423 return ChannelMonitor_free(this_ptr_conv);
2426 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1update_1monitor(JNIEnv * _env, jclass _b, jlong this_arg, jlong updates, jlong broadcaster, jlong logger) {
2427 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2428 LDKChannelMonitorUpdate updates_conv = *(LDKChannelMonitorUpdate*)updates;
2429 FREE((void*)updates);
2430 updates_conv.is_owned = true;
2431 LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster;
2432 LDKLogger* logger_conv = (LDKLogger*)logger;
2433 LDKCResult_NoneMonitorUpdateErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
2434 *ret = ChannelMonitor_update_monitor(this_arg_conv, updates_conv, broadcaster_conv, logger_conv);
2438 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1update_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
2439 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2440 return ChannelMonitor_get_latest_update_id(this_arg_conv);
2443 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1funding_1txo(JNIEnv * _env, jclass _b, jlong this_arg) {
2444 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2445 LDKC2Tuple_OutPointScriptZ* ret = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
2446 *ret = ChannelMonitor_get_funding_txo(this_arg_conv);
2450 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1monitor_1events(JNIEnv * _env, jclass _b, jlong this_arg) {
2451 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2452 LDKCVec_MonitorEventZ* ret = MALLOC(sizeof(LDKCVec_MonitorEventZ), "LDKCVec_MonitorEventZ");
2453 *ret = ChannelMonitor_get_and_clear_pending_monitor_events(this_arg_conv);
2457 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1events(JNIEnv * _env, jclass _b, jlong this_arg) {
2458 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2459 LDKCVec_EventZ* ret = MALLOC(sizeof(LDKCVec_EventZ), "LDKCVec_EventZ");
2460 *ret = ChannelMonitor_get_and_clear_pending_events(this_arg_conv);
2464 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1holder_1commitment_1txn(JNIEnv * _env, jclass _b, jlong this_arg, jlong logger) {
2465 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2466 LDKLogger* logger_conv = (LDKLogger*)logger;
2467 LDKCVec_TransactionZ* ret = MALLOC(sizeof(LDKCVec_TransactionZ), "LDKCVec_TransactionZ");
2468 *ret = ChannelMonitor_get_latest_holder_commitment_txn(this_arg_conv, logger_conv);
2472 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) {
2473 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2474 unsigned char header_arr[80];
2475 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
2476 unsigned char (*header_ref)[80] = &header_arr;
2477 LDKCVec_C2Tuple_usizeTransactionZZ txdata_conv = *(LDKCVec_C2Tuple_usizeTransactionZZ*)txdata;
2478 FREE((void*)txdata);
2479 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)broadcaster;
2480 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
2481 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2482 LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
2484 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)fee_estimator;
2485 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
2486 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2487 LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
2489 LDKLogger logger_conv = *(LDKLogger*)logger;
2490 if (logger_conv.free == LDKLogger_JCalls_free) {
2491 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2492 LDKLogger_JCalls_clone(logger_conv.this_arg);
2494 LDKCVec_C2Tuple_TxidCVec_TxOutZZZ* ret = MALLOC(sizeof(LDKCVec_C2Tuple_TxidCVec_TxOutZZZ), "LDKCVec_C2Tuple_TxidCVec_TxOutZZZ");
2495 *ret = ChannelMonitor_block_connected(this_arg_conv, header_ref, txdata_conv, height, broadcaster_conv, fee_estimator_conv, logger_conv);
2499 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) {
2500 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2501 unsigned char header_arr[80];
2502 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
2503 unsigned char (*header_ref)[80] = &header_arr;
2504 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)broadcaster;
2505 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
2506 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2507 LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
2509 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)fee_estimator;
2510 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
2511 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2512 LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
2514 LDKLogger logger_conv = *(LDKLogger*)logger;
2515 if (logger_conv.free == LDKLogger_JCalls_free) {
2516 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2517 LDKLogger_JCalls_clone(logger_conv.this_arg);
2519 return ChannelMonitor_block_disconnected(this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
2522 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2523 LDKOutPoint this_ptr_conv = *(LDKOutPoint*)this_ptr;
2524 FREE((void*)this_ptr);
2525 this_ptr_conv.is_owned = true;
2526 return OutPoint_free(this_ptr_conv);
2529 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1txid(JNIEnv * _env, jclass _b, jlong this_ptr) {
2530 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
2531 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2532 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OutPoint_get_txid(this_ptr_conv));
2536 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1txid(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2537 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
2538 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
2540 return OutPoint_set_txid(this_ptr_conv, val_conv);
2543 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1index(JNIEnv * _env, jclass _b, jlong this_ptr) {
2544 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
2545 return OutPoint_get_index(this_ptr_conv);
2548 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1index(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
2549 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
2550 return OutPoint_set_index(this_ptr_conv, val);
2553 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1new(JNIEnv * _env, jclass _b, jlong txid_arg, jshort index_arg) {
2554 LDKThirtyTwoBytes txid_arg_conv = *(LDKThirtyTwoBytes*)txid_arg;
2555 FREE((void*)txid_arg);
2556 LDKOutPoint* ret = MALLOC(sizeof(LDKOutPoint), "LDKOutPoint");
2557 *ret = OutPoint_new(txid_arg_conv, index_arg);
2558 assert(ret->is_owned);
2559 ret->is_owned = false;
2563 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1to_1channel_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
2564 LDKOutPoint* this_arg_conv = (LDKOutPoint*)this_arg;
2565 LDKThirtyTwoBytes* ret = MALLOC(sizeof(LDKThirtyTwoBytes), "LDKThirtyTwoBytes");
2566 *ret = OutPoint_to_channel_id(this_arg_conv);
2570 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1write(JNIEnv * _env, jclass _b, jlong obj) {
2571 LDKOutPoint* obj_conv = (LDKOutPoint*)obj;
2572 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
2573 *ret = OutPoint_write(obj_conv);
2577 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1read(JNIEnv * _env, jclass _b, jlong ser) {
2578 LDKu8slice ser_conv = *(LDKu8slice*)ser;
2580 LDKOutPoint* ret = MALLOC(sizeof(LDKOutPoint), "LDKOutPoint");
2581 *ret = OutPoint_read(ser_conv);
2582 assert(ret->is_owned);
2583 ret->is_owned = false;
2587 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2588 LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)this_ptr;
2589 FREE((void*)this_ptr);
2590 return SpendableOutputDescriptor_free(this_ptr_conv);
2593 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2594 LDKChannelKeys this_ptr_conv = *(LDKChannelKeys*)this_ptr;
2595 FREE((void*)this_ptr);
2596 return ChannelKeys_free(this_ptr_conv);
2599 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysInterface_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2600 LDKKeysInterface this_ptr_conv = *(LDKKeysInterface*)this_ptr;
2601 FREE((void*)this_ptr);
2602 return KeysInterface_free(this_ptr_conv);
2605 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2606 LDKInMemoryChannelKeys this_ptr_conv = *(LDKInMemoryChannelKeys*)this_ptr;
2607 FREE((void*)this_ptr);
2608 this_ptr_conv.is_owned = true;
2609 return InMemoryChannelKeys_free(this_ptr_conv);
2612 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1funding_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
2613 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2614 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2615 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_funding_key(this_ptr_conv));
2619 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1funding_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2620 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2621 LDKSecretKey val_conv = *(LDKSecretKey*)val;
2623 return InMemoryChannelKeys_set_funding_key(this_ptr_conv, val_conv);
2626 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1revocation_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
2627 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2628 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2629 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_revocation_base_key(this_ptr_conv));
2633 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1revocation_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2634 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2635 LDKSecretKey val_conv = *(LDKSecretKey*)val;
2637 return InMemoryChannelKeys_set_revocation_base_key(this_ptr_conv, val_conv);
2640 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
2641 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2642 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2643 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_payment_key(this_ptr_conv));
2647 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2648 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2649 LDKSecretKey val_conv = *(LDKSecretKey*)val;
2651 return InMemoryChannelKeys_set_payment_key(this_ptr_conv, val_conv);
2654 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1delayed_1payment_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
2655 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2656 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2657 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_delayed_payment_base_key(this_ptr_conv));
2661 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1delayed_1payment_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2662 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2663 LDKSecretKey val_conv = *(LDKSecretKey*)val;
2665 return InMemoryChannelKeys_set_delayed_payment_base_key(this_ptr_conv, val_conv);
2668 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1htlc_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
2669 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2670 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2671 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_htlc_base_key(this_ptr_conv));
2675 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1htlc_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2676 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2677 LDKSecretKey val_conv = *(LDKSecretKey*)val;
2679 return InMemoryChannelKeys_set_htlc_base_key(this_ptr_conv, val_conv);
2682 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1commitment_1seed(JNIEnv * _env, jclass _b, jlong this_ptr) {
2683 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2684 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2685 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_commitment_seed(this_ptr_conv));
2689 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1commitment_1seed(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2690 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2691 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
2693 return InMemoryChannelKeys_set_commitment_seed(this_ptr_conv, val_conv);
2696 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) {
2697 LDKSecretKey funding_key_conv = *(LDKSecretKey*)funding_key;
2698 FREE((void*)funding_key);
2699 LDKSecretKey revocation_base_key_conv = *(LDKSecretKey*)revocation_base_key;
2700 FREE((void*)revocation_base_key);
2701 LDKSecretKey payment_key_conv = *(LDKSecretKey*)payment_key;
2702 FREE((void*)payment_key);
2703 LDKSecretKey delayed_payment_base_key_conv = *(LDKSecretKey*)delayed_payment_base_key;
2704 FREE((void*)delayed_payment_base_key);
2705 LDKSecretKey htlc_base_key_conv = *(LDKSecretKey*)htlc_base_key;
2706 FREE((void*)htlc_base_key);
2707 LDKThirtyTwoBytes commitment_seed_conv = *(LDKThirtyTwoBytes*)commitment_seed;
2708 FREE((void*)commitment_seed);
2709 LDKC2Tuple_u64u64Z key_derivation_params_conv = *(LDKC2Tuple_u64u64Z*)key_derivation_params;
2710 FREE((void*)key_derivation_params);
2711 LDKInMemoryChannelKeys* ret = MALLOC(sizeof(LDKInMemoryChannelKeys), "LDKInMemoryChannelKeys");
2712 *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);
2713 assert(ret->is_owned);
2714 ret->is_owned = false;
2718 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1counterparty_1pubkeys(JNIEnv * _env, jclass _b, jlong this_arg) {
2719 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
2720 LDKChannelPublicKeys* ret = MALLOC(sizeof(LDKChannelPublicKeys), "LDKChannelPublicKeys");
2721 *ret = InMemoryChannelKeys_counterparty_pubkeys(this_arg_conv);
2722 assert(ret->is_owned);
2723 ret->is_owned = false;
2727 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1counterparty_1selected_1contest_1delay(JNIEnv * _env, jclass _b, jlong this_arg) {
2728 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
2729 return InMemoryChannelKeys_counterparty_selected_contest_delay(this_arg_conv);
2732 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1holder_1selected_1contest_1delay(JNIEnv * _env, jclass _b, jlong this_arg) {
2733 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
2734 return InMemoryChannelKeys_holder_selected_contest_delay(this_arg_conv);
2737 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1as_1ChannelKeys(JNIEnv * _env, jclass _b, jlong this_arg) {
2738 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
2739 LDKChannelKeys* ret = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys");
2740 *ret = InMemoryChannelKeys_as_ChannelKeys(this_arg_conv);
2744 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1write(JNIEnv * _env, jclass _b, jlong obj) {
2745 LDKInMemoryChannelKeys* obj_conv = (LDKInMemoryChannelKeys*)obj;
2746 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
2747 *ret = InMemoryChannelKeys_write(obj_conv);
2751 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1read(JNIEnv * _env, jclass _b, jlong ser) {
2752 LDKu8slice ser_conv = *(LDKu8slice*)ser;
2754 LDKInMemoryChannelKeys* ret = MALLOC(sizeof(LDKInMemoryChannelKeys), "LDKInMemoryChannelKeys");
2755 *ret = InMemoryChannelKeys_read(ser_conv);
2756 assert(ret->is_owned);
2757 ret->is_owned = false;
2761 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysManager_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2762 LDKKeysManager this_ptr_conv = *(LDKKeysManager*)this_ptr;
2763 FREE((void*)this_ptr);
2764 this_ptr_conv.is_owned = true;
2765 return KeysManager_free(this_ptr_conv);
2768 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) {
2769 unsigned char seed_arr[32];
2770 (*_env)->GetByteArrayRegion (_env, seed, 0, 32, seed_arr);
2771 unsigned char (*seed_ref)[32] = &seed_arr;
2772 LDKNetwork network_conv = LDKNetwork_from_java(_env, network);
2773 LDKKeysManager* ret = MALLOC(sizeof(LDKKeysManager), "LDKKeysManager");
2774 *ret = KeysManager_new(seed_ref, network_conv, starting_time_secs, starting_time_nanos);
2775 assert(ret->is_owned);
2776 ret->is_owned = false;
2780 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) {
2781 LDKKeysManager* this_arg_conv = (LDKKeysManager*)this_arg;
2782 LDKInMemoryChannelKeys* ret = MALLOC(sizeof(LDKInMemoryChannelKeys), "LDKInMemoryChannelKeys");
2783 *ret = KeysManager_derive_channel_keys(this_arg_conv, channel_value_satoshis, params_1, params_2);
2784 assert(ret->is_owned);
2785 ret->is_owned = false;
2789 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1KeysInterface(JNIEnv * _env, jclass _b, jlong this_arg) {
2790 LDKKeysManager* this_arg_conv = (LDKKeysManager*)this_arg;
2791 LDKKeysInterface* ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
2792 *ret = KeysManager_as_KeysInterface(this_arg_conv);
2796 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2797 LDKChannelManager this_ptr_conv = *(LDKChannelManager*)this_ptr;
2798 FREE((void*)this_ptr);
2799 this_ptr_conv.is_owned = true;
2800 return ChannelManager_free(this_ptr_conv);
2803 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2804 LDKChannelDetails this_ptr_conv = *(LDKChannelDetails*)this_ptr;
2805 FREE((void*)this_ptr);
2806 this_ptr_conv.is_owned = true;
2807 return ChannelDetails_free(this_ptr_conv);
2810 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
2811 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2812 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2813 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ChannelDetails_get_channel_id(this_ptr_conv));
2817 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2818 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2819 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
2821 return ChannelDetails_set_channel_id(this_ptr_conv, val_conv);
2824 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1remote_1network_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
2825 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2826 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
2827 *ret = ChannelDetails_get_remote_network_id(this_ptr_conv);
2831 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1remote_1network_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2832 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2833 LDKPublicKey val_conv = *(LDKPublicKey*)val;
2835 return ChannelDetails_set_remote_network_id(this_ptr_conv, val_conv);
2838 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1counterparty_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
2839 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2840 LDKInitFeatures* ret = MALLOC(sizeof(LDKInitFeatures), "LDKInitFeatures");
2841 *ret = ChannelDetails_get_counterparty_features(this_ptr_conv);
2842 assert(ret->is_owned);
2843 ret->is_owned = false;
2847 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1counterparty_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2848 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2849 LDKInitFeatures val_conv = *(LDKInitFeatures*)val;
2851 val_conv.is_owned = true;
2852 return ChannelDetails_set_counterparty_features(this_ptr_conv, val_conv);
2855 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1value_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
2856 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2857 return ChannelDetails_get_channel_value_satoshis(this_ptr_conv);
2860 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1value_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2861 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2862 return ChannelDetails_set_channel_value_satoshis(this_ptr_conv, val);
2865 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1user_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
2866 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2867 return ChannelDetails_get_user_id(this_ptr_conv);
2870 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1user_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2871 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2872 return ChannelDetails_set_user_id(this_ptr_conv, val);
2875 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
2876 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2877 return ChannelDetails_get_outbound_capacity_msat(this_ptr_conv);
2880 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1outbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2881 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2882 return ChannelDetails_set_outbound_capacity_msat(this_ptr_conv, val);
2885 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
2886 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2887 return ChannelDetails_get_inbound_capacity_msat(this_ptr_conv);
2890 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2891 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2892 return ChannelDetails_set_inbound_capacity_msat(this_ptr_conv, val);
2895 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1live(JNIEnv * _env, jclass _b, jlong this_ptr) {
2896 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2897 return ChannelDetails_get_is_live(this_ptr_conv);
2900 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1live(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
2901 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
2902 return ChannelDetails_set_is_live(this_ptr_conv, val);
2905 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2906 LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)this_ptr;
2907 FREE((void*)this_ptr);
2908 this_ptr_conv.is_owned = true;
2909 return PaymentSendFailure_free(this_ptr_conv);
2912 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) {
2913 LDKNetwork network_conv = LDKNetwork_from_java(_env, network);
2914 LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)fee_est;
2915 if (fee_est_conv.free == LDKFeeEstimator_JCalls_free) {
2916 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2917 LDKFeeEstimator_JCalls_clone(fee_est_conv.this_arg);
2919 LDKWatch chain_monitor_conv = *(LDKWatch*)chain_monitor;
2920 if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
2921 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2922 LDKWatch_JCalls_clone(chain_monitor_conv.this_arg);
2924 LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)tx_broadcaster;
2925 if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
2926 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2927 LDKBroadcasterInterface_JCalls_clone(tx_broadcaster_conv.this_arg);
2929 LDKLogger logger_conv = *(LDKLogger*)logger;
2930 if (logger_conv.free == LDKLogger_JCalls_free) {
2931 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2932 LDKLogger_JCalls_clone(logger_conv.this_arg);
2934 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)keys_manager;
2935 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
2936 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2937 LDKKeysInterface_JCalls_clone(keys_manager_conv.this_arg);
2939 LDKUserConfig config_conv = *(LDKUserConfig*)config;
2940 FREE((void*)config);
2941 config_conv.is_owned = true;
2942 LDKChannelManager* ret = MALLOC(sizeof(LDKChannelManager), "LDKChannelManager");
2943 *ret = ChannelManager_new(network_conv, fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, keys_manager_conv, config_conv, current_blockchain_height);
2944 assert(ret->is_owned);
2945 ret->is_owned = false;
2949 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) {
2950 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2951 LDKPublicKey their_network_key_conv = *(LDKPublicKey*)their_network_key;
2952 FREE((void*)their_network_key);
2953 LDKUserConfig override_config_conv = *(LDKUserConfig*)override_config;
2954 FREE((void*)override_config);
2955 override_config_conv.is_owned = true;
2956 LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
2957 *ret = ChannelManager_create_channel(this_arg_conv, their_network_key_conv, channel_value_satoshis, push_msat, user_id, override_config_conv);
2961 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
2962 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2963 LDKCVec_ChannelDetailsZ* ret = MALLOC(sizeof(LDKCVec_ChannelDetailsZ), "LDKCVec_ChannelDetailsZ");
2964 *ret = ChannelManager_list_channels(this_arg_conv);
2968 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1usable_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
2969 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2970 LDKCVec_ChannelDetailsZ* ret = MALLOC(sizeof(LDKCVec_ChannelDetailsZ), "LDKCVec_ChannelDetailsZ");
2971 *ret = ChannelManager_list_usable_channels(this_arg_conv);
2975 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray channel_id) {
2976 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2977 unsigned char channel_id_arr[32];
2978 (*_env)->GetByteArrayRegion (_env, channel_id, 0, 32, channel_id_arr);
2979 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
2980 LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
2981 *ret = ChannelManager_close_channel(this_arg_conv, channel_id_ref);
2985 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray channel_id) {
2986 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2987 unsigned char channel_id_arr[32];
2988 (*_env)->GetByteArrayRegion (_env, channel_id, 0, 32, channel_id_arr);
2989 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
2990 return ChannelManager_force_close_channel(this_arg_conv, channel_id_ref);
2993 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1all_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
2994 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
2995 return ChannelManager_force_close_all_channels(this_arg_conv);
2998 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) {
2999 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3000 LDKRoute* route_conv = (LDKRoute*)route;
3001 LDKThirtyTwoBytes payment_hash_conv = *(LDKThirtyTwoBytes*)payment_hash;
3002 FREE((void*)payment_hash);
3003 LDKThirtyTwoBytes payment_secret_conv = *(LDKThirtyTwoBytes*)payment_secret;
3004 FREE((void*)payment_secret);
3005 LDKCResult_NonePaymentSendFailureZ* ret = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
3006 *ret = ChannelManager_send_payment(this_arg_conv, route_conv, payment_hash_conv, payment_secret_conv);
3010 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) {
3011 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3012 unsigned char temporary_channel_id_arr[32];
3013 (*_env)->GetByteArrayRegion (_env, temporary_channel_id, 0, 32, temporary_channel_id_arr);
3014 unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
3015 LDKOutPoint funding_txo_conv = *(LDKOutPoint*)funding_txo;
3016 FREE((void*)funding_txo);
3017 funding_txo_conv.is_owned = true;
3018 return ChannelManager_funding_transaction_generated(this_arg_conv, temporary_channel_id_ref, funding_txo_conv);
3021 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) {
3022 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3023 LDKThreeBytes rgb_conv = *(LDKThreeBytes*)rgb;
3025 LDKThirtyTwoBytes alias_conv = *(LDKThirtyTwoBytes*)alias;
3027 LDKCVec_NetAddressZ addresses_conv = *(LDKCVec_NetAddressZ*)addresses;
3028 FREE((void*)addresses);
3029 return ChannelManager_broadcast_node_announcement(this_arg_conv, rgb_conv, alias_conv, addresses_conv);
3032 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1process_1pending_1htlc_1forwards(JNIEnv * _env, jclass _b, jlong this_arg) {
3033 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3034 return ChannelManager_process_pending_htlc_forwards(this_arg_conv);
3037 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1timer_1chan_1freshness_1every_1min(JNIEnv * _env, jclass _b, jlong this_arg) {
3038 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3039 return ChannelManager_timer_chan_freshness_every_min(this_arg_conv);
3042 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) {
3043 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3044 unsigned char payment_hash_arr[32];
3045 (*_env)->GetByteArrayRegion (_env, payment_hash, 0, 32, payment_hash_arr);
3046 unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
3047 LDKThirtyTwoBytes payment_secret_conv = *(LDKThirtyTwoBytes*)payment_secret;
3048 FREE((void*)payment_secret);
3049 return ChannelManager_fail_htlc_backwards(this_arg_conv, payment_hash_ref, payment_secret_conv);
3052 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) {
3053 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3054 LDKThirtyTwoBytes payment_preimage_conv = *(LDKThirtyTwoBytes*)payment_preimage;
3055 FREE((void*)payment_preimage);
3056 LDKThirtyTwoBytes payment_secret_conv = *(LDKThirtyTwoBytes*)payment_secret;
3057 FREE((void*)payment_secret);
3058 return ChannelManager_claim_funds(this_arg_conv, payment_preimage_conv, payment_secret_conv, expected_amount);
3061 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1our_1node_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
3062 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3063 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3064 *ret = ChannelManager_get_our_node_id(this_arg_conv);
3068 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) {
3069 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3070 LDKOutPoint* funding_txo_conv = (LDKOutPoint*)funding_txo;
3071 return ChannelManager_channel_monitor_updated(this_arg_conv, funding_txo_conv, highest_applied_update_id);
3074 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1MessageSendEventsProvider(JNIEnv * _env, jclass _b, jlong this_arg) {
3075 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3076 LDKMessageSendEventsProvider* ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
3077 *ret = ChannelManager_as_MessageSendEventsProvider(this_arg_conv);
3081 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1EventsProvider(JNIEnv * _env, jclass _b, jlong this_arg) {
3082 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3083 LDKEventsProvider* ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
3084 *ret = ChannelManager_as_EventsProvider(this_arg_conv);
3088 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1block_1connected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jlong txdata, jint height) {
3089 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3090 unsigned char header_arr[80];
3091 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
3092 unsigned char (*header_ref)[80] = &header_arr;
3093 LDKCVec_C2Tuple_usizeTransactionZZ txdata_conv = *(LDKCVec_C2Tuple_usizeTransactionZZ*)txdata;
3094 FREE((void*)txdata);
3095 return ChannelManager_block_connected(this_arg_conv, header_ref, txdata_conv, height);
3098 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1block_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header) {
3099 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3100 unsigned char header_arr[80];
3101 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
3102 unsigned char (*header_ref)[80] = &header_arr;
3103 return ChannelManager_block_disconnected(this_arg_conv, header_ref);
3106 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1ChannelMessageHandler(JNIEnv * _env, jclass _b, jlong this_arg) {
3107 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3108 LDKChannelMessageHandler* ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
3109 *ret = ChannelManager_as_ChannelMessageHandler(this_arg_conv);
3113 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3114 LDKChannelManagerReadArgs this_ptr_conv = *(LDKChannelManagerReadArgs*)this_ptr;
3115 FREE((void*)this_ptr);
3116 this_ptr_conv.is_owned = true;
3117 return ChannelManagerReadArgs_free(this_ptr_conv);
3120 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1keys_1manager(JNIEnv * _env, jclass _b, jlong this_ptr) {
3121 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3122 long ret = (long)ChannelManagerReadArgs_get_keys_manager(this_ptr_conv);
3126 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1keys_1manager(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3127 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3128 LDKKeysInterface val_conv = *(LDKKeysInterface*)val;
3129 if (val_conv.free == LDKKeysInterface_JCalls_free) {
3130 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3131 LDKKeysInterface_JCalls_clone(val_conv.this_arg);
3133 return ChannelManagerReadArgs_set_keys_manager(this_ptr_conv, val_conv);
3136 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1fee_1estimator(JNIEnv * _env, jclass _b, jlong this_ptr) {
3137 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3138 long ret = (long)ChannelManagerReadArgs_get_fee_estimator(this_ptr_conv);
3142 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1fee_1estimator(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3143 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3144 LDKFeeEstimator val_conv = *(LDKFeeEstimator*)val;
3145 if (val_conv.free == LDKFeeEstimator_JCalls_free) {
3146 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3147 LDKFeeEstimator_JCalls_clone(val_conv.this_arg);
3149 return ChannelManagerReadArgs_set_fee_estimator(this_ptr_conv, val_conv);
3152 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1chain_1monitor(JNIEnv * _env, jclass _b, jlong this_ptr) {
3153 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3154 long ret = (long)ChannelManagerReadArgs_get_chain_monitor(this_ptr_conv);
3158 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1chain_1monitor(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3159 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3160 LDKWatch val_conv = *(LDKWatch*)val;
3161 if (val_conv.free == LDKWatch_JCalls_free) {
3162 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3163 LDKWatch_JCalls_clone(val_conv.this_arg);
3165 return ChannelManagerReadArgs_set_chain_monitor(this_ptr_conv, val_conv);
3168 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1tx_1broadcaster(JNIEnv * _env, jclass _b, jlong this_ptr) {
3169 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3170 long ret = (long)ChannelManagerReadArgs_get_tx_broadcaster(this_ptr_conv);
3174 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1tx_1broadcaster(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3175 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3176 LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)val;
3177 if (val_conv.free == LDKBroadcasterInterface_JCalls_free) {
3178 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3179 LDKBroadcasterInterface_JCalls_clone(val_conv.this_arg);
3181 return ChannelManagerReadArgs_set_tx_broadcaster(this_ptr_conv, val_conv);
3184 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1logger(JNIEnv * _env, jclass _b, jlong this_ptr) {
3185 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3186 long ret = (long)ChannelManagerReadArgs_get_logger(this_ptr_conv);
3190 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1logger(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3191 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3192 LDKLogger val_conv = *(LDKLogger*)val;
3193 if (val_conv.free == LDKLogger_JCalls_free) {
3194 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3195 LDKLogger_JCalls_clone(val_conv.this_arg);
3197 return ChannelManagerReadArgs_set_logger(this_ptr_conv, val_conv);
3200 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1default_1config(JNIEnv * _env, jclass _b, jlong this_ptr) {
3201 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3202 LDKUserConfig* ret = MALLOC(sizeof(LDKUserConfig), "LDKUserConfig");
3203 *ret = ChannelManagerReadArgs_get_default_config(this_ptr_conv);
3204 assert(ret->is_owned);
3205 ret->is_owned = false;
3209 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1default_1config(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3210 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3211 LDKUserConfig val_conv = *(LDKUserConfig*)val;
3213 val_conv.is_owned = true;
3214 return ChannelManagerReadArgs_set_default_config(this_ptr_conv, val_conv);
3217 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) {
3218 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)keys_manager;
3219 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
3220 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3221 LDKKeysInterface_JCalls_clone(keys_manager_conv.this_arg);
3223 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)fee_estimator;
3224 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
3225 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3226 LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
3228 LDKWatch chain_monitor_conv = *(LDKWatch*)chain_monitor;
3229 if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
3230 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3231 LDKWatch_JCalls_clone(chain_monitor_conv.this_arg);
3233 LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)tx_broadcaster;
3234 if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
3235 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3236 LDKBroadcasterInterface_JCalls_clone(tx_broadcaster_conv.this_arg);
3238 LDKLogger logger_conv = *(LDKLogger*)logger;
3239 if (logger_conv.free == LDKLogger_JCalls_free) {
3240 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3241 LDKLogger_JCalls_clone(logger_conv.this_arg);
3243 LDKUserConfig default_config_conv = *(LDKUserConfig*)default_config;
3244 FREE((void*)default_config);
3245 default_config_conv.is_owned = true;
3246 LDKCVec_ChannelMonitorZ channel_monitors_conv = *(LDKCVec_ChannelMonitorZ*)channel_monitors;
3247 FREE((void*)channel_monitors);
3248 LDKChannelManagerReadArgs* ret = MALLOC(sizeof(LDKChannelManagerReadArgs), "LDKChannelManagerReadArgs");
3249 *ret = ChannelManagerReadArgs_new(keys_manager_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, default_config_conv, channel_monitors_conv);
3250 assert(ret->is_owned);
3251 ret->is_owned = false;
3255 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DecodeError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3256 LDKDecodeError this_ptr_conv = *(LDKDecodeError*)this_ptr;
3257 FREE((void*)this_ptr);
3258 this_ptr_conv.is_owned = true;
3259 return DecodeError_free(this_ptr_conv);
3262 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3263 LDKInit this_ptr_conv = *(LDKInit*)this_ptr;
3264 FREE((void*)this_ptr);
3265 this_ptr_conv.is_owned = true;
3266 return Init_free(this_ptr_conv);
3269 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3270 LDKErrorMessage this_ptr_conv = *(LDKErrorMessage*)this_ptr;
3271 FREE((void*)this_ptr);
3272 this_ptr_conv.is_owned = true;
3273 return ErrorMessage_free(this_ptr_conv);
3276 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3277 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
3278 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3279 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ErrorMessage_get_channel_id(this_ptr_conv));
3283 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3284 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
3285 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3287 return ErrorMessage_set_channel_id(this_ptr_conv, val_conv);
3290 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1data(JNIEnv * _env, jclass _b, jlong this_ptr) {
3291 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
3292 LDKStr* ret = MALLOC(sizeof(LDKStr), "LDKStr");
3293 *ret = ErrorMessage_get_data(this_ptr_conv);
3297 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1data(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3298 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
3299 LDKCVec_u8Z val_conv = *(LDKCVec_u8Z*)val;
3301 return ErrorMessage_set_data(this_ptr_conv, val_conv);
3304 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong data_arg) {
3305 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
3306 FREE((void*)channel_id_arg);
3307 LDKCVec_u8Z data_arg_conv = *(LDKCVec_u8Z*)data_arg;
3308 FREE((void*)data_arg);
3309 LDKErrorMessage* ret = MALLOC(sizeof(LDKErrorMessage), "LDKErrorMessage");
3310 *ret = ErrorMessage_new(channel_id_arg_conv, data_arg_conv);
3311 assert(ret->is_owned);
3312 ret->is_owned = false;
3316 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3317 LDKPing this_ptr_conv = *(LDKPing*)this_ptr;
3318 FREE((void*)this_ptr);
3319 this_ptr_conv.is_owned = true;
3320 return Ping_free(this_ptr_conv);
3323 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Ping_1get_1ponglen(JNIEnv * _env, jclass _b, jlong this_ptr) {
3324 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
3325 return Ping_get_ponglen(this_ptr_conv);
3328 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1ponglen(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3329 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
3330 return Ping_set_ponglen(this_ptr_conv, val);
3333 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Ping_1get_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr) {
3334 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
3335 return Ping_get_byteslen(this_ptr_conv);
3338 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3339 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
3340 return Ping_set_byteslen(this_ptr_conv, val);
3343 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1new(JNIEnv * _env, jclass _b, jshort ponglen_arg, jshort byteslen_arg) {
3344 LDKPing* ret = MALLOC(sizeof(LDKPing), "LDKPing");
3345 *ret = Ping_new(ponglen_arg, byteslen_arg);
3346 assert(ret->is_owned);
3347 ret->is_owned = false;
3351 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3352 LDKPong this_ptr_conv = *(LDKPong*)this_ptr;
3353 FREE((void*)this_ptr);
3354 this_ptr_conv.is_owned = true;
3355 return Pong_free(this_ptr_conv);
3358 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Pong_1get_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr) {
3359 LDKPong* this_ptr_conv = (LDKPong*)this_ptr;
3360 return Pong_get_byteslen(this_ptr_conv);
3363 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1set_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3364 LDKPong* this_ptr_conv = (LDKPong*)this_ptr;
3365 return Pong_set_byteslen(this_ptr_conv, val);
3368 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1new(JNIEnv * _env, jclass _b, jshort byteslen_arg) {
3369 LDKPong* ret = MALLOC(sizeof(LDKPong), "LDKPong");
3370 *ret = Pong_new(byteslen_arg);
3371 assert(ret->is_owned);
3372 ret->is_owned = false;
3376 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3377 LDKOpenChannel this_ptr_conv = *(LDKOpenChannel*)this_ptr;
3378 FREE((void*)this_ptr);
3379 this_ptr_conv.is_owned = true;
3380 return OpenChannel_free(this_ptr_conv);
3383 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
3384 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3385 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3386 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OpenChannel_get_chain_hash(this_ptr_conv));
3390 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3391 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3392 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3394 return OpenChannel_set_chain_hash(this_ptr_conv, val_conv);
3397 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3398 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3399 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3400 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OpenChannel_get_temporary_channel_id(this_ptr_conv));
3404 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3405 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3406 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3408 return OpenChannel_set_temporary_channel_id(this_ptr_conv, val_conv);
3411 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3412 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3413 return OpenChannel_get_funding_satoshis(this_ptr_conv);
3416 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3417 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3418 return OpenChannel_set_funding_satoshis(this_ptr_conv, val);
3421 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1push_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3422 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3423 return OpenChannel_get_push_msat(this_ptr_conv);
3426 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1push_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3427 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3428 return OpenChannel_set_push_msat(this_ptr_conv, val);
3431 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3432 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3433 return OpenChannel_get_dust_limit_satoshis(this_ptr_conv);
3436 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3437 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3438 return OpenChannel_set_dust_limit_satoshis(this_ptr_conv, val);
3441 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3442 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3443 return OpenChannel_get_max_htlc_value_in_flight_msat(this_ptr_conv);
3446 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) {
3447 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3448 return OpenChannel_set_max_htlc_value_in_flight_msat(this_ptr_conv, val);
3451 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3452 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3453 return OpenChannel_get_channel_reserve_satoshis(this_ptr_conv);
3456 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3457 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3458 return OpenChannel_set_channel_reserve_satoshis(this_ptr_conv, val);
3461 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3462 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3463 return OpenChannel_get_htlc_minimum_msat(this_ptr_conv);
3466 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3467 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3468 return OpenChannel_set_htlc_minimum_msat(this_ptr_conv, val);
3471 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr) {
3472 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3473 return OpenChannel_get_feerate_per_kw(this_ptr_conv);
3476 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
3477 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3478 return OpenChannel_set_feerate_per_kw(this_ptr_conv, val);
3481 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
3482 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3483 return OpenChannel_get_to_self_delay(this_ptr_conv);
3486 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3487 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3488 return OpenChannel_set_to_self_delay(this_ptr_conv, val);
3491 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr) {
3492 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3493 return OpenChannel_get_max_accepted_htlcs(this_ptr_conv);
3496 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3497 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3498 return OpenChannel_set_max_accepted_htlcs(this_ptr_conv, val);
3501 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
3502 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3503 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3504 *ret = OpenChannel_get_funding_pubkey(this_ptr_conv);
3508 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3509 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3510 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3512 return OpenChannel_set_funding_pubkey(this_ptr_conv, val_conv);
3515 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
3516 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3517 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3518 *ret = OpenChannel_get_revocation_basepoint(this_ptr_conv);
3522 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3523 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3524 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3526 return OpenChannel_set_revocation_basepoint(this_ptr_conv, val_conv);
3529 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
3530 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3531 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3532 *ret = OpenChannel_get_payment_point(this_ptr_conv);
3536 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3537 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3538 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3540 return OpenChannel_set_payment_point(this_ptr_conv, val_conv);
3543 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
3544 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3545 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3546 *ret = OpenChannel_get_delayed_payment_basepoint(this_ptr_conv);
3550 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3551 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3552 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3554 return OpenChannel_set_delayed_payment_basepoint(this_ptr_conv, val_conv);
3557 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
3558 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3559 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3560 *ret = OpenChannel_get_htlc_basepoint(this_ptr_conv);
3564 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3565 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3566 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3568 return OpenChannel_set_htlc_basepoint(this_ptr_conv, val_conv);
3571 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
3572 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3573 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3574 *ret = OpenChannel_get_first_per_commitment_point(this_ptr_conv);
3578 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3579 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3580 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3582 return OpenChannel_set_first_per_commitment_point(this_ptr_conv, val_conv);
3585 JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1flags(JNIEnv * _env, jclass _b, jlong this_ptr) {
3586 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3587 return OpenChannel_get_channel_flags(this_ptr_conv);
3590 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1flags(JNIEnv * _env, jclass _b, jlong this_ptr, jbyte val) {
3591 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3592 return OpenChannel_set_channel_flags(this_ptr_conv, val);
3595 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3596 LDKAcceptChannel this_ptr_conv = *(LDKAcceptChannel*)this_ptr;
3597 FREE((void*)this_ptr);
3598 this_ptr_conv.is_owned = true;
3599 return AcceptChannel_free(this_ptr_conv);
3602 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3603 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3604 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3605 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *AcceptChannel_get_temporary_channel_id(this_ptr_conv));
3609 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3610 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3611 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3613 return AcceptChannel_set_temporary_channel_id(this_ptr_conv, val_conv);
3616 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3617 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3618 return AcceptChannel_get_dust_limit_satoshis(this_ptr_conv);
3621 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3622 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3623 return AcceptChannel_set_dust_limit_satoshis(this_ptr_conv, val);
3626 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3627 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3628 return AcceptChannel_get_max_htlc_value_in_flight_msat(this_ptr_conv);
3631 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) {
3632 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3633 return AcceptChannel_set_max_htlc_value_in_flight_msat(this_ptr_conv, val);
3636 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3637 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3638 return AcceptChannel_get_channel_reserve_satoshis(this_ptr_conv);
3641 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3642 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3643 return AcceptChannel_set_channel_reserve_satoshis(this_ptr_conv, val);
3646 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3647 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3648 return AcceptChannel_get_htlc_minimum_msat(this_ptr_conv);
3651 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3652 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3653 return AcceptChannel_set_htlc_minimum_msat(this_ptr_conv, val);
3656 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr) {
3657 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3658 return AcceptChannel_get_minimum_depth(this_ptr_conv);
3661 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
3662 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3663 return AcceptChannel_set_minimum_depth(this_ptr_conv, val);
3666 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
3667 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3668 return AcceptChannel_get_to_self_delay(this_ptr_conv);
3671 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3672 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3673 return AcceptChannel_set_to_self_delay(this_ptr_conv, val);
3676 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr) {
3677 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3678 return AcceptChannel_get_max_accepted_htlcs(this_ptr_conv);
3681 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3682 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3683 return AcceptChannel_set_max_accepted_htlcs(this_ptr_conv, val);
3686 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
3687 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3688 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3689 *ret = AcceptChannel_get_funding_pubkey(this_ptr_conv);
3693 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3694 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3695 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3697 return AcceptChannel_set_funding_pubkey(this_ptr_conv, val_conv);
3700 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
3701 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3702 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3703 *ret = AcceptChannel_get_revocation_basepoint(this_ptr_conv);
3707 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3708 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3709 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3711 return AcceptChannel_set_revocation_basepoint(this_ptr_conv, val_conv);
3714 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
3715 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3716 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3717 *ret = AcceptChannel_get_payment_point(this_ptr_conv);
3721 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3722 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3723 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3725 return AcceptChannel_set_payment_point(this_ptr_conv, val_conv);
3728 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
3729 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3730 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3731 *ret = AcceptChannel_get_delayed_payment_basepoint(this_ptr_conv);
3735 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3736 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3737 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3739 return AcceptChannel_set_delayed_payment_basepoint(this_ptr_conv, val_conv);
3742 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
3743 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3744 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3745 *ret = AcceptChannel_get_htlc_basepoint(this_ptr_conv);
3749 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3750 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3751 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3753 return AcceptChannel_set_htlc_basepoint(this_ptr_conv, val_conv);
3756 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
3757 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3758 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3759 *ret = AcceptChannel_get_first_per_commitment_point(this_ptr_conv);
3763 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3764 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3765 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3767 return AcceptChannel_set_first_per_commitment_point(this_ptr_conv, val_conv);
3770 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3771 LDKFundingCreated this_ptr_conv = *(LDKFundingCreated*)this_ptr;
3772 FREE((void*)this_ptr);
3773 this_ptr_conv.is_owned = true;
3774 return FundingCreated_free(this_ptr_conv);
3777 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3778 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3779 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3780 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingCreated_get_temporary_channel_id(this_ptr_conv));
3784 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3785 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3786 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3788 return FundingCreated_set_temporary_channel_id(this_ptr_conv, val_conv);
3791 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1txid(JNIEnv * _env, jclass _b, jlong this_ptr) {
3792 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3793 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3794 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingCreated_get_funding_txid(this_ptr_conv));
3798 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1txid(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3799 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3800 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3802 return FundingCreated_set_funding_txid(this_ptr_conv, val_conv);
3805 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1output_1index(JNIEnv * _env, jclass _b, jlong this_ptr) {
3806 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3807 return FundingCreated_get_funding_output_index(this_ptr_conv);
3810 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1output_1index(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3811 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3812 return FundingCreated_set_funding_output_index(this_ptr_conv, val);
3815 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
3816 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3817 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
3818 *ret = FundingCreated_get_signature(this_ptr_conv);
3822 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3823 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3824 LDKSignature val_conv = *(LDKSignature*)val;
3826 return FundingCreated_set_signature(this_ptr_conv, val_conv);
3829 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) {
3830 LDKThirtyTwoBytes temporary_channel_id_arg_conv = *(LDKThirtyTwoBytes*)temporary_channel_id_arg;
3831 FREE((void*)temporary_channel_id_arg);
3832 LDKThirtyTwoBytes funding_txid_arg_conv = *(LDKThirtyTwoBytes*)funding_txid_arg;
3833 FREE((void*)funding_txid_arg);
3834 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
3835 FREE((void*)signature_arg);
3836 LDKFundingCreated* ret = MALLOC(sizeof(LDKFundingCreated), "LDKFundingCreated");
3837 *ret = FundingCreated_new(temporary_channel_id_arg_conv, funding_txid_arg_conv, funding_output_index_arg, signature_arg_conv);
3838 assert(ret->is_owned);
3839 ret->is_owned = false;
3843 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3844 LDKFundingSigned this_ptr_conv = *(LDKFundingSigned*)this_ptr;
3845 FREE((void*)this_ptr);
3846 this_ptr_conv.is_owned = true;
3847 return FundingSigned_free(this_ptr_conv);
3850 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3851 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
3852 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3853 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingSigned_get_channel_id(this_ptr_conv));
3857 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3858 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
3859 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3861 return FundingSigned_set_channel_id(this_ptr_conv, val_conv);
3864 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
3865 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
3866 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
3867 *ret = FundingSigned_get_signature(this_ptr_conv);
3871 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3872 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
3873 LDKSignature val_conv = *(LDKSignature*)val;
3875 return FundingSigned_set_signature(this_ptr_conv, val_conv);
3878 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong signature_arg) {
3879 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
3880 FREE((void*)channel_id_arg);
3881 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
3882 FREE((void*)signature_arg);
3883 LDKFundingSigned* ret = MALLOC(sizeof(LDKFundingSigned), "LDKFundingSigned");
3884 *ret = FundingSigned_new(channel_id_arg_conv, signature_arg_conv);
3885 assert(ret->is_owned);
3886 ret->is_owned = false;
3890 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3891 LDKFundingLocked this_ptr_conv = *(LDKFundingLocked*)this_ptr;
3892 FREE((void*)this_ptr);
3893 this_ptr_conv.is_owned = true;
3894 return FundingLocked_free(this_ptr_conv);
3897 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3898 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
3899 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3900 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingLocked_get_channel_id(this_ptr_conv));
3904 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3905 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
3906 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3908 return FundingLocked_set_channel_id(this_ptr_conv, val_conv);
3911 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
3912 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
3913 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3914 *ret = FundingLocked_get_next_per_commitment_point(this_ptr_conv);
3918 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3919 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
3920 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3922 return FundingLocked_set_next_per_commitment_point(this_ptr_conv, val_conv);
3925 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong next_per_commitment_point_arg) {
3926 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
3927 FREE((void*)channel_id_arg);
3928 LDKPublicKey next_per_commitment_point_arg_conv = *(LDKPublicKey*)next_per_commitment_point_arg;
3929 FREE((void*)next_per_commitment_point_arg);
3930 LDKFundingLocked* ret = MALLOC(sizeof(LDKFundingLocked), "LDKFundingLocked");
3931 *ret = FundingLocked_new(channel_id_arg_conv, next_per_commitment_point_arg_conv);
3932 assert(ret->is_owned);
3933 ret->is_owned = false;
3937 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3938 LDKShutdown this_ptr_conv = *(LDKShutdown*)this_ptr;
3939 FREE((void*)this_ptr);
3940 this_ptr_conv.is_owned = true;
3941 return Shutdown_free(this_ptr_conv);
3944 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3945 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
3946 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3947 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *Shutdown_get_channel_id(this_ptr_conv));
3951 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3952 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
3953 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3955 return Shutdown_set_channel_id(this_ptr_conv, val_conv);
3958 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1scriptpubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
3959 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
3960 LDKu8slice* ret = MALLOC(sizeof(LDKu8slice), "LDKu8slice");
3961 *ret = Shutdown_get_scriptpubkey(this_ptr_conv);
3965 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1scriptpubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3966 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
3967 LDKCVec_u8Z val_conv = *(LDKCVec_u8Z*)val;
3969 return Shutdown_set_scriptpubkey(this_ptr_conv, val_conv);
3972 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong scriptpubkey_arg) {
3973 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
3974 FREE((void*)channel_id_arg);
3975 LDKCVec_u8Z scriptpubkey_arg_conv = *(LDKCVec_u8Z*)scriptpubkey_arg;
3976 FREE((void*)scriptpubkey_arg);
3977 LDKShutdown* ret = MALLOC(sizeof(LDKShutdown), "LDKShutdown");
3978 *ret = Shutdown_new(channel_id_arg_conv, scriptpubkey_arg_conv);
3979 assert(ret->is_owned);
3980 ret->is_owned = false;
3984 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3985 LDKClosingSigned this_ptr_conv = *(LDKClosingSigned*)this_ptr;
3986 FREE((void*)this_ptr);
3987 this_ptr_conv.is_owned = true;
3988 return ClosingSigned_free(this_ptr_conv);
3991 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3992 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
3993 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3994 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ClosingSigned_get_channel_id(this_ptr_conv));
3998 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3999 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
4000 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4002 return ClosingSigned_set_channel_id(this_ptr_conv, val_conv);
4005 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
4006 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
4007 return ClosingSigned_get_fee_satoshis(this_ptr_conv);
4010 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4011 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
4012 return ClosingSigned_set_fee_satoshis(this_ptr_conv, val);
4015 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
4016 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
4017 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4018 *ret = ClosingSigned_get_signature(this_ptr_conv);
4022 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4023 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
4024 LDKSignature val_conv = *(LDKSignature*)val;
4026 return ClosingSigned_set_signature(this_ptr_conv, val_conv);
4029 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) {
4030 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4031 FREE((void*)channel_id_arg);
4032 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
4033 FREE((void*)signature_arg);
4034 LDKClosingSigned* ret = MALLOC(sizeof(LDKClosingSigned), "LDKClosingSigned");
4035 *ret = ClosingSigned_new(channel_id_arg_conv, fee_satoshis_arg, signature_arg_conv);
4036 assert(ret->is_owned);
4037 ret->is_owned = false;
4041 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4042 LDKUpdateAddHTLC this_ptr_conv = *(LDKUpdateAddHTLC*)this_ptr;
4043 FREE((void*)this_ptr);
4044 this_ptr_conv.is_owned = true;
4045 return UpdateAddHTLC_free(this_ptr_conv);
4048 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4049 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4050 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4051 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateAddHTLC_get_channel_id(this_ptr_conv));
4055 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4056 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4057 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4059 return UpdateAddHTLC_set_channel_id(this_ptr_conv, val_conv);
4062 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4063 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4064 return UpdateAddHTLC_get_htlc_id(this_ptr_conv);
4067 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4068 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4069 return UpdateAddHTLC_set_htlc_id(this_ptr_conv, val);
4072 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
4073 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4074 return UpdateAddHTLC_get_amount_msat(this_ptr_conv);
4077 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4078 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4079 return UpdateAddHTLC_set_amount_msat(this_ptr_conv, val);
4082 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
4083 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4084 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4085 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateAddHTLC_get_payment_hash(this_ptr_conv));
4089 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4090 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4091 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4093 return UpdateAddHTLC_set_payment_hash(this_ptr_conv, val_conv);
4096 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr) {
4097 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4098 return UpdateAddHTLC_get_cltv_expiry(this_ptr_conv);
4101 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
4102 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4103 return UpdateAddHTLC_set_cltv_expiry(this_ptr_conv, val);
4106 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4107 LDKUpdateFulfillHTLC this_ptr_conv = *(LDKUpdateFulfillHTLC*)this_ptr;
4108 FREE((void*)this_ptr);
4109 this_ptr_conv.is_owned = true;
4110 return UpdateFulfillHTLC_free(this_ptr_conv);
4113 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4114 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
4115 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4116 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_channel_id(this_ptr_conv));
4120 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4121 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
4122 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4124 return UpdateFulfillHTLC_set_channel_id(this_ptr_conv, val_conv);
4127 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4128 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
4129 return UpdateFulfillHTLC_get_htlc_id(this_ptr_conv);
4132 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4133 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
4134 return UpdateFulfillHTLC_set_htlc_id(this_ptr_conv, val);
4137 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1payment_1preimage(JNIEnv * _env, jclass _b, jlong this_ptr) {
4138 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
4139 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4140 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_payment_preimage(this_ptr_conv));
4144 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1payment_1preimage(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4145 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
4146 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4148 return UpdateFulfillHTLC_set_payment_preimage(this_ptr_conv, val_conv);
4151 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) {
4152 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4153 FREE((void*)channel_id_arg);
4154 LDKThirtyTwoBytes payment_preimage_arg_conv = *(LDKThirtyTwoBytes*)payment_preimage_arg;
4155 FREE((void*)payment_preimage_arg);
4156 LDKUpdateFulfillHTLC* ret = MALLOC(sizeof(LDKUpdateFulfillHTLC), "LDKUpdateFulfillHTLC");
4157 *ret = UpdateFulfillHTLC_new(channel_id_arg_conv, htlc_id_arg, payment_preimage_arg_conv);
4158 assert(ret->is_owned);
4159 ret->is_owned = false;
4163 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4164 LDKUpdateFailHTLC this_ptr_conv = *(LDKUpdateFailHTLC*)this_ptr;
4165 FREE((void*)this_ptr);
4166 this_ptr_conv.is_owned = true;
4167 return UpdateFailHTLC_free(this_ptr_conv);
4170 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4171 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
4172 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4173 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFailHTLC_get_channel_id(this_ptr_conv));
4177 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4178 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
4179 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4181 return UpdateFailHTLC_set_channel_id(this_ptr_conv, val_conv);
4184 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4185 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
4186 return UpdateFailHTLC_get_htlc_id(this_ptr_conv);
4189 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4190 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
4191 return UpdateFailHTLC_set_htlc_id(this_ptr_conv, val);
4194 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4195 LDKUpdateFailMalformedHTLC this_ptr_conv = *(LDKUpdateFailMalformedHTLC*)this_ptr;
4196 FREE((void*)this_ptr);
4197 this_ptr_conv.is_owned = true;
4198 return UpdateFailMalformedHTLC_free(this_ptr_conv);
4201 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4202 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
4203 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4204 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFailMalformedHTLC_get_channel_id(this_ptr_conv));
4208 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4209 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
4210 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4212 return UpdateFailMalformedHTLC_set_channel_id(this_ptr_conv, val_conv);
4215 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4216 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
4217 return UpdateFailMalformedHTLC_get_htlc_id(this_ptr_conv);
4220 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4221 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
4222 return UpdateFailMalformedHTLC_set_htlc_id(this_ptr_conv, val);
4225 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1failure_1code(JNIEnv * _env, jclass _b, jlong this_ptr) {
4226 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
4227 return UpdateFailMalformedHTLC_get_failure_code(this_ptr_conv);
4230 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1failure_1code(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
4231 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
4232 return UpdateFailMalformedHTLC_set_failure_code(this_ptr_conv, val);
4235 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4236 LDKCommitmentSigned this_ptr_conv = *(LDKCommitmentSigned*)this_ptr;
4237 FREE((void*)this_ptr);
4238 this_ptr_conv.is_owned = true;
4239 return CommitmentSigned_free(this_ptr_conv);
4242 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4243 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
4244 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4245 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *CommitmentSigned_get_channel_id(this_ptr_conv));
4249 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4250 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
4251 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4253 return CommitmentSigned_set_channel_id(this_ptr_conv, val_conv);
4256 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
4257 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
4258 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4259 *ret = CommitmentSigned_get_signature(this_ptr_conv);
4263 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4264 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
4265 LDKSignature val_conv = *(LDKSignature*)val;
4267 return CommitmentSigned_set_signature(this_ptr_conv, val_conv);
4270 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1htlc_1signatures(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4271 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
4272 LDKCVec_SignatureZ val_conv = *(LDKCVec_SignatureZ*)val;
4274 return CommitmentSigned_set_htlc_signatures(this_ptr_conv, val_conv);
4277 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) {
4278 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4279 FREE((void*)channel_id_arg);
4280 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
4281 FREE((void*)signature_arg);
4282 LDKCVec_SignatureZ htlc_signatures_arg_conv = *(LDKCVec_SignatureZ*)htlc_signatures_arg;
4283 FREE((void*)htlc_signatures_arg);
4284 LDKCommitmentSigned* ret = MALLOC(sizeof(LDKCommitmentSigned), "LDKCommitmentSigned");
4285 *ret = CommitmentSigned_new(channel_id_arg_conv, signature_arg_conv, htlc_signatures_arg_conv);
4286 assert(ret->is_owned);
4287 ret->is_owned = false;
4291 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4292 LDKRevokeAndACK this_ptr_conv = *(LDKRevokeAndACK*)this_ptr;
4293 FREE((void*)this_ptr);
4294 this_ptr_conv.is_owned = true;
4295 return RevokeAndACK_free(this_ptr_conv);
4298 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4299 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
4300 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4301 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *RevokeAndACK_get_channel_id(this_ptr_conv));
4305 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4306 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
4307 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4309 return RevokeAndACK_set_channel_id(this_ptr_conv, val_conv);
4312 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr) {
4313 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
4314 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4315 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *RevokeAndACK_get_per_commitment_secret(this_ptr_conv));
4319 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4320 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
4321 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4323 return RevokeAndACK_set_per_commitment_secret(this_ptr_conv, val_conv);
4326 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
4327 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
4328 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4329 *ret = RevokeAndACK_get_next_per_commitment_point(this_ptr_conv);
4333 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4334 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
4335 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4337 return RevokeAndACK_set_next_per_commitment_point(this_ptr_conv, val_conv);
4340 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) {
4341 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4342 FREE((void*)channel_id_arg);
4343 LDKThirtyTwoBytes per_commitment_secret_arg_conv = *(LDKThirtyTwoBytes*)per_commitment_secret_arg;
4344 FREE((void*)per_commitment_secret_arg);
4345 LDKPublicKey next_per_commitment_point_arg_conv = *(LDKPublicKey*)next_per_commitment_point_arg;
4346 FREE((void*)next_per_commitment_point_arg);
4347 LDKRevokeAndACK* ret = MALLOC(sizeof(LDKRevokeAndACK), "LDKRevokeAndACK");
4348 *ret = RevokeAndACK_new(channel_id_arg_conv, per_commitment_secret_arg_conv, next_per_commitment_point_arg_conv);
4349 assert(ret->is_owned);
4350 ret->is_owned = false;
4354 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4355 LDKUpdateFee this_ptr_conv = *(LDKUpdateFee*)this_ptr;
4356 FREE((void*)this_ptr);
4357 this_ptr_conv.is_owned = true;
4358 return UpdateFee_free(this_ptr_conv);
4361 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4362 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
4363 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4364 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFee_get_channel_id(this_ptr_conv));
4368 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4369 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
4370 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4372 return UpdateFee_set_channel_id(this_ptr_conv, val_conv);
4375 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr) {
4376 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
4377 return UpdateFee_get_feerate_per_kw(this_ptr_conv);
4380 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
4381 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
4382 return UpdateFee_set_feerate_per_kw(this_ptr_conv, val);
4385 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jint feerate_per_kw_arg) {
4386 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4387 FREE((void*)channel_id_arg);
4388 LDKUpdateFee* ret = MALLOC(sizeof(LDKUpdateFee), "LDKUpdateFee");
4389 *ret = UpdateFee_new(channel_id_arg_conv, feerate_per_kw_arg);
4390 assert(ret->is_owned);
4391 ret->is_owned = false;
4395 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4396 LDKDataLossProtect this_ptr_conv = *(LDKDataLossProtect*)this_ptr;
4397 FREE((void*)this_ptr);
4398 this_ptr_conv.is_owned = true;
4399 return DataLossProtect_free(this_ptr_conv);
4402 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1your_1last_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr) {
4403 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
4404 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4405 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *DataLossProtect_get_your_last_per_commitment_secret(this_ptr_conv));
4409 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1your_1last_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4410 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
4411 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4413 return DataLossProtect_set_your_last_per_commitment_secret(this_ptr_conv, val_conv);
4416 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1my_1current_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
4417 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
4418 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4419 *ret = DataLossProtect_get_my_current_per_commitment_point(this_ptr_conv);
4423 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1my_1current_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4424 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
4425 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4427 return DataLossProtect_set_my_current_per_commitment_point(this_ptr_conv, val_conv);
4430 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) {
4431 LDKThirtyTwoBytes your_last_per_commitment_secret_arg_conv = *(LDKThirtyTwoBytes*)your_last_per_commitment_secret_arg;
4432 FREE((void*)your_last_per_commitment_secret_arg);
4433 LDKPublicKey my_current_per_commitment_point_arg_conv = *(LDKPublicKey*)my_current_per_commitment_point_arg;
4434 FREE((void*)my_current_per_commitment_point_arg);
4435 LDKDataLossProtect* ret = MALLOC(sizeof(LDKDataLossProtect), "LDKDataLossProtect");
4436 *ret = DataLossProtect_new(your_last_per_commitment_secret_arg_conv, my_current_per_commitment_point_arg_conv);
4437 assert(ret->is_owned);
4438 ret->is_owned = false;
4442 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4443 LDKChannelReestablish this_ptr_conv = *(LDKChannelReestablish*)this_ptr;
4444 FREE((void*)this_ptr);
4445 this_ptr_conv.is_owned = true;
4446 return ChannelReestablish_free(this_ptr_conv);
4449 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4450 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
4451 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4452 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ChannelReestablish_get_channel_id(this_ptr_conv));
4456 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4457 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
4458 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4460 return ChannelReestablish_set_channel_id(this_ptr_conv, val_conv);
4463 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1local_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr) {
4464 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
4465 return ChannelReestablish_get_next_local_commitment_number(this_ptr_conv);
4468 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1local_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4469 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
4470 return ChannelReestablish_set_next_local_commitment_number(this_ptr_conv, val);
4473 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1remote_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr) {
4474 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
4475 return ChannelReestablish_get_next_remote_commitment_number(this_ptr_conv);
4478 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1remote_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4479 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
4480 return ChannelReestablish_set_next_remote_commitment_number(this_ptr_conv, val);
4483 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4484 LDKAnnouncementSignatures this_ptr_conv = *(LDKAnnouncementSignatures*)this_ptr;
4485 FREE((void*)this_ptr);
4486 this_ptr_conv.is_owned = true;
4487 return AnnouncementSignatures_free(this_ptr_conv);
4490 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4491 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4492 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4493 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *AnnouncementSignatures_get_channel_id(this_ptr_conv));
4497 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4498 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4499 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4501 return AnnouncementSignatures_set_channel_id(this_ptr_conv, val_conv);
4504 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4505 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4506 return AnnouncementSignatures_get_short_channel_id(this_ptr_conv);
4509 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4510 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4511 return AnnouncementSignatures_set_short_channel_id(this_ptr_conv, val);
4514 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1node_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
4515 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4516 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4517 *ret = AnnouncementSignatures_get_node_signature(this_ptr_conv);
4521 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1node_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4522 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4523 LDKSignature val_conv = *(LDKSignature*)val;
4525 return AnnouncementSignatures_set_node_signature(this_ptr_conv, val_conv);
4528 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1bitcoin_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
4529 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4530 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4531 *ret = AnnouncementSignatures_get_bitcoin_signature(this_ptr_conv);
4535 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1bitcoin_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4536 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4537 LDKSignature val_conv = *(LDKSignature*)val;
4539 return AnnouncementSignatures_set_bitcoin_signature(this_ptr_conv, val_conv);
4542 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) {
4543 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4544 FREE((void*)channel_id_arg);
4545 LDKSignature node_signature_arg_conv = *(LDKSignature*)node_signature_arg;
4546 FREE((void*)node_signature_arg);
4547 LDKSignature bitcoin_signature_arg_conv = *(LDKSignature*)bitcoin_signature_arg;
4548 FREE((void*)bitcoin_signature_arg);
4549 LDKAnnouncementSignatures* ret = MALLOC(sizeof(LDKAnnouncementSignatures), "LDKAnnouncementSignatures");
4550 *ret = AnnouncementSignatures_new(channel_id_arg_conv, short_channel_id_arg, node_signature_arg_conv, bitcoin_signature_arg_conv);
4551 assert(ret->is_owned);
4552 ret->is_owned = false;
4556 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetAddress_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4557 LDKNetAddress this_ptr_conv = *(LDKNetAddress*)this_ptr;
4558 FREE((void*)this_ptr);
4559 return NetAddress_free(this_ptr_conv);
4562 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4563 LDKUnsignedNodeAnnouncement this_ptr_conv = *(LDKUnsignedNodeAnnouncement*)this_ptr;
4564 FREE((void*)this_ptr);
4565 this_ptr_conv.is_owned = true;
4566 return UnsignedNodeAnnouncement_free(this_ptr_conv);
4569 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
4570 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4571 LDKNodeFeatures* ret = MALLOC(sizeof(LDKNodeFeatures), "LDKNodeFeatures");
4572 *ret = UnsignedNodeAnnouncement_get_features(this_ptr_conv);
4573 assert(ret->is_owned);
4574 ret->is_owned = false;
4578 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4579 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4580 LDKNodeFeatures val_conv = *(LDKNodeFeatures*)val;
4582 val_conv.is_owned = true;
4583 return UnsignedNodeAnnouncement_set_features(this_ptr_conv, val_conv);
4586 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr) {
4587 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4588 return UnsignedNodeAnnouncement_get_timestamp(this_ptr_conv);
4591 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
4592 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4593 return UnsignedNodeAnnouncement_set_timestamp(this_ptr_conv, val);
4596 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4597 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4598 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4599 *ret = UnsignedNodeAnnouncement_get_node_id(this_ptr_conv);
4603 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4604 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4605 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4607 return UnsignedNodeAnnouncement_set_node_id(this_ptr_conv, val_conv);
4610 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr) {
4611 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4612 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 3);
4613 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 3, *UnsignedNodeAnnouncement_get_rgb(this_ptr_conv));
4617 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4618 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4619 LDKThreeBytes val_conv = *(LDKThreeBytes*)val;
4621 return UnsignedNodeAnnouncement_set_rgb(this_ptr_conv, val_conv);
4624 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1alias(JNIEnv * _env, jclass _b, jlong this_ptr) {
4625 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4626 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4627 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedNodeAnnouncement_get_alias(this_ptr_conv));
4631 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1alias(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4632 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4633 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4635 return UnsignedNodeAnnouncement_set_alias(this_ptr_conv, val_conv);
4638 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1addresses(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4639 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4640 LDKCVec_NetAddressZ val_conv = *(LDKCVec_NetAddressZ*)val;
4642 return UnsignedNodeAnnouncement_set_addresses(this_ptr_conv, val_conv);
4645 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4646 LDKNodeAnnouncement this_ptr_conv = *(LDKNodeAnnouncement*)this_ptr;
4647 FREE((void*)this_ptr);
4648 this_ptr_conv.is_owned = true;
4649 return NodeAnnouncement_free(this_ptr_conv);
4652 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
4653 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
4654 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4655 *ret = NodeAnnouncement_get_signature(this_ptr_conv);
4659 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4660 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
4661 LDKSignature val_conv = *(LDKSignature*)val;
4663 return NodeAnnouncement_set_signature(this_ptr_conv, val_conv);
4666 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1contents(JNIEnv * _env, jclass _b, jlong this_ptr) {
4667 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
4668 LDKUnsignedNodeAnnouncement* ret = MALLOC(sizeof(LDKUnsignedNodeAnnouncement), "LDKUnsignedNodeAnnouncement");
4669 *ret = NodeAnnouncement_get_contents(this_ptr_conv);
4670 assert(ret->is_owned);
4671 ret->is_owned = false;
4675 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1contents(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4676 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
4677 LDKUnsignedNodeAnnouncement val_conv = *(LDKUnsignedNodeAnnouncement*)val;
4679 val_conv.is_owned = true;
4680 return NodeAnnouncement_set_contents(this_ptr_conv, val_conv);
4683 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1new(JNIEnv * _env, jclass _b, jlong signature_arg, jlong contents_arg) {
4684 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
4685 FREE((void*)signature_arg);
4686 LDKUnsignedNodeAnnouncement contents_arg_conv = *(LDKUnsignedNodeAnnouncement*)contents_arg;
4687 FREE((void*)contents_arg);
4688 contents_arg_conv.is_owned = true;
4689 LDKNodeAnnouncement* ret = MALLOC(sizeof(LDKNodeAnnouncement), "LDKNodeAnnouncement");
4690 *ret = NodeAnnouncement_new(signature_arg_conv, contents_arg_conv);
4691 assert(ret->is_owned);
4692 ret->is_owned = false;
4696 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4697 LDKUnsignedChannelAnnouncement this_ptr_conv = *(LDKUnsignedChannelAnnouncement*)this_ptr;
4698 FREE((void*)this_ptr);
4699 this_ptr_conv.is_owned = true;
4700 return UnsignedChannelAnnouncement_free(this_ptr_conv);
4703 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
4704 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4705 LDKChannelFeatures* ret = MALLOC(sizeof(LDKChannelFeatures), "LDKChannelFeatures");
4706 *ret = UnsignedChannelAnnouncement_get_features(this_ptr_conv);
4707 assert(ret->is_owned);
4708 ret->is_owned = false;
4712 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4713 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4714 LDKChannelFeatures val_conv = *(LDKChannelFeatures*)val;
4716 val_conv.is_owned = true;
4717 return UnsignedChannelAnnouncement_set_features(this_ptr_conv, val_conv);
4720 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
4721 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4722 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4723 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedChannelAnnouncement_get_chain_hash(this_ptr_conv));
4727 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4728 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4729 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4731 return UnsignedChannelAnnouncement_set_chain_hash(this_ptr_conv, val_conv);
4734 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4735 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4736 return UnsignedChannelAnnouncement_get_short_channel_id(this_ptr_conv);
4739 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4740 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4741 return UnsignedChannelAnnouncement_set_short_channel_id(this_ptr_conv, val);
4744 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
4745 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4746 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4747 *ret = UnsignedChannelAnnouncement_get_node_id_1(this_ptr_conv);
4751 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4752 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4753 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4755 return UnsignedChannelAnnouncement_set_node_id_1(this_ptr_conv, val_conv);
4758 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
4759 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4760 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4761 *ret = UnsignedChannelAnnouncement_get_node_id_2(this_ptr_conv);
4765 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4766 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4767 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4769 return UnsignedChannelAnnouncement_set_node_id_2(this_ptr_conv, val_conv);
4772 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
4773 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4774 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4775 *ret = UnsignedChannelAnnouncement_get_bitcoin_key_1(this_ptr_conv);
4779 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4780 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4781 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4783 return UnsignedChannelAnnouncement_set_bitcoin_key_1(this_ptr_conv, val_conv);
4786 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
4787 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4788 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4789 *ret = UnsignedChannelAnnouncement_get_bitcoin_key_2(this_ptr_conv);
4793 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4794 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4795 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4797 return UnsignedChannelAnnouncement_set_bitcoin_key_2(this_ptr_conv, val_conv);
4800 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4801 LDKChannelAnnouncement this_ptr_conv = *(LDKChannelAnnouncement*)this_ptr;
4802 FREE((void*)this_ptr);
4803 this_ptr_conv.is_owned = true;
4804 return ChannelAnnouncement_free(this_ptr_conv);
4807 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
4808 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4809 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4810 *ret = ChannelAnnouncement_get_node_signature_1(this_ptr_conv);
4814 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4815 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4816 LDKSignature val_conv = *(LDKSignature*)val;
4818 return ChannelAnnouncement_set_node_signature_1(this_ptr_conv, val_conv);
4821 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
4822 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4823 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4824 *ret = ChannelAnnouncement_get_node_signature_2(this_ptr_conv);
4828 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4829 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4830 LDKSignature val_conv = *(LDKSignature*)val;
4832 return ChannelAnnouncement_set_node_signature_2(this_ptr_conv, val_conv);
4835 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
4836 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4837 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4838 *ret = ChannelAnnouncement_get_bitcoin_signature_1(this_ptr_conv);
4842 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4843 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4844 LDKSignature val_conv = *(LDKSignature*)val;
4846 return ChannelAnnouncement_set_bitcoin_signature_1(this_ptr_conv, val_conv);
4849 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
4850 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4851 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4852 *ret = ChannelAnnouncement_get_bitcoin_signature_2(this_ptr_conv);
4856 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4857 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4858 LDKSignature val_conv = *(LDKSignature*)val;
4860 return ChannelAnnouncement_set_bitcoin_signature_2(this_ptr_conv, val_conv);
4863 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1contents(JNIEnv * _env, jclass _b, jlong this_ptr) {
4864 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4865 LDKUnsignedChannelAnnouncement* ret = MALLOC(sizeof(LDKUnsignedChannelAnnouncement), "LDKUnsignedChannelAnnouncement");
4866 *ret = ChannelAnnouncement_get_contents(this_ptr_conv);
4867 assert(ret->is_owned);
4868 ret->is_owned = false;
4872 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1contents(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4873 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
4874 LDKUnsignedChannelAnnouncement val_conv = *(LDKUnsignedChannelAnnouncement*)val;
4876 val_conv.is_owned = true;
4877 return ChannelAnnouncement_set_contents(this_ptr_conv, val_conv);
4880 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) {
4881 LDKSignature node_signature_1_arg_conv = *(LDKSignature*)node_signature_1_arg;
4882 FREE((void*)node_signature_1_arg);
4883 LDKSignature node_signature_2_arg_conv = *(LDKSignature*)node_signature_2_arg;
4884 FREE((void*)node_signature_2_arg);
4885 LDKSignature bitcoin_signature_1_arg_conv = *(LDKSignature*)bitcoin_signature_1_arg;
4886 FREE((void*)bitcoin_signature_1_arg);
4887 LDKSignature bitcoin_signature_2_arg_conv = *(LDKSignature*)bitcoin_signature_2_arg;
4888 FREE((void*)bitcoin_signature_2_arg);
4889 LDKUnsignedChannelAnnouncement contents_arg_conv = *(LDKUnsignedChannelAnnouncement*)contents_arg;
4890 FREE((void*)contents_arg);
4891 contents_arg_conv.is_owned = true;
4892 LDKChannelAnnouncement* ret = MALLOC(sizeof(LDKChannelAnnouncement), "LDKChannelAnnouncement");
4893 *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);
4894 assert(ret->is_owned);
4895 ret->is_owned = false;
4899 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4900 LDKUnsignedChannelUpdate this_ptr_conv = *(LDKUnsignedChannelUpdate*)this_ptr;
4901 FREE((void*)this_ptr);
4902 this_ptr_conv.is_owned = true;
4903 return UnsignedChannelUpdate_free(this_ptr_conv);
4906 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
4907 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4908 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4909 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedChannelUpdate_get_chain_hash(this_ptr_conv));
4913 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4914 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4915 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4917 return UnsignedChannelUpdate_set_chain_hash(this_ptr_conv, val_conv);
4920 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4921 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4922 return UnsignedChannelUpdate_get_short_channel_id(this_ptr_conv);
4925 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4926 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4927 return UnsignedChannelUpdate_set_short_channel_id(this_ptr_conv, val);
4930 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr) {
4931 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4932 return UnsignedChannelUpdate_get_timestamp(this_ptr_conv);
4935 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
4936 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4937 return UnsignedChannelUpdate_set_timestamp(this_ptr_conv, val);
4940 JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1flags(JNIEnv * _env, jclass _b, jlong this_ptr) {
4941 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4942 return UnsignedChannelUpdate_get_flags(this_ptr_conv);
4945 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1flags(JNIEnv * _env, jclass _b, jlong this_ptr, jbyte val) {
4946 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4947 return UnsignedChannelUpdate_set_flags(this_ptr_conv, val);
4950 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
4951 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4952 return UnsignedChannelUpdate_get_cltv_expiry_delta(this_ptr_conv);
4955 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
4956 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4957 return UnsignedChannelUpdate_set_cltv_expiry_delta(this_ptr_conv, val);
4960 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
4961 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4962 return UnsignedChannelUpdate_get_htlc_minimum_msat(this_ptr_conv);
4965 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4966 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4967 return UnsignedChannelUpdate_set_htlc_minimum_msat(this_ptr_conv, val);
4970 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
4971 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4972 return UnsignedChannelUpdate_get_fee_base_msat(this_ptr_conv);
4975 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
4976 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4977 return UnsignedChannelUpdate_set_fee_base_msat(this_ptr_conv, val);
4980 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr) {
4981 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4982 return UnsignedChannelUpdate_get_fee_proportional_millionths(this_ptr_conv);
4985 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
4986 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
4987 return UnsignedChannelUpdate_set_fee_proportional_millionths(this_ptr_conv, val);
4990 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4991 LDKChannelUpdate this_ptr_conv = *(LDKChannelUpdate*)this_ptr;
4992 FREE((void*)this_ptr);
4993 this_ptr_conv.is_owned = true;
4994 return ChannelUpdate_free(this_ptr_conv);
4997 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
4998 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
4999 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
5000 *ret = ChannelUpdate_get_signature(this_ptr_conv);
5004 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5005 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
5006 LDKSignature val_conv = *(LDKSignature*)val;
5008 return ChannelUpdate_set_signature(this_ptr_conv, val_conv);
5011 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1contents(JNIEnv * _env, jclass _b, jlong this_ptr) {
5012 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
5013 LDKUnsignedChannelUpdate* ret = MALLOC(sizeof(LDKUnsignedChannelUpdate), "LDKUnsignedChannelUpdate");
5014 *ret = ChannelUpdate_get_contents(this_ptr_conv);
5015 assert(ret->is_owned);
5016 ret->is_owned = false;
5020 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1contents(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5021 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
5022 LDKUnsignedChannelUpdate val_conv = *(LDKUnsignedChannelUpdate*)val;
5024 val_conv.is_owned = true;
5025 return ChannelUpdate_set_contents(this_ptr_conv, val_conv);
5028 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1new(JNIEnv * _env, jclass _b, jlong signature_arg, jlong contents_arg) {
5029 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
5030 FREE((void*)signature_arg);
5031 LDKUnsignedChannelUpdate contents_arg_conv = *(LDKUnsignedChannelUpdate*)contents_arg;
5032 FREE((void*)contents_arg);
5033 contents_arg_conv.is_owned = true;
5034 LDKChannelUpdate* ret = MALLOC(sizeof(LDKChannelUpdate), "LDKChannelUpdate");
5035 *ret = ChannelUpdate_new(signature_arg_conv, contents_arg_conv);
5036 assert(ret->is_owned);
5037 ret->is_owned = false;
5041 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5042 LDKQueryChannelRange this_ptr_conv = *(LDKQueryChannelRange*)this_ptr;
5043 FREE((void*)this_ptr);
5044 this_ptr_conv.is_owned = true;
5045 return QueryChannelRange_free(this_ptr_conv);
5048 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
5049 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
5050 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5051 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *QueryChannelRange_get_chain_hash(this_ptr_conv));
5055 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5056 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
5057 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5059 return QueryChannelRange_set_chain_hash(this_ptr_conv, val_conv);
5062 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1first_1blocknum(JNIEnv * _env, jclass _b, jlong this_ptr) {
5063 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
5064 return QueryChannelRange_get_first_blocknum(this_ptr_conv);
5067 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1first_1blocknum(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5068 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
5069 return QueryChannelRange_set_first_blocknum(this_ptr_conv, val);
5072 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1number_1of_1blocks(JNIEnv * _env, jclass _b, jlong this_ptr) {
5073 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
5074 return QueryChannelRange_get_number_of_blocks(this_ptr_conv);
5077 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1number_1of_1blocks(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5078 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
5079 return QueryChannelRange_set_number_of_blocks(this_ptr_conv, val);
5082 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) {
5083 LDKThirtyTwoBytes chain_hash_arg_conv = *(LDKThirtyTwoBytes*)chain_hash_arg;
5084 FREE((void*)chain_hash_arg);
5085 LDKQueryChannelRange* ret = MALLOC(sizeof(LDKQueryChannelRange), "LDKQueryChannelRange");
5086 *ret = QueryChannelRange_new(chain_hash_arg_conv, first_blocknum_arg, number_of_blocks_arg);
5087 assert(ret->is_owned);
5088 ret->is_owned = false;
5092 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5093 LDKReplyChannelRange this_ptr_conv = *(LDKReplyChannelRange*)this_ptr;
5094 FREE((void*)this_ptr);
5095 this_ptr_conv.is_owned = true;
5096 return ReplyChannelRange_free(this_ptr_conv);
5099 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
5100 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5101 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5102 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ReplyChannelRange_get_chain_hash(this_ptr_conv));
5106 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5107 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5108 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5110 return ReplyChannelRange_set_chain_hash(this_ptr_conv, val_conv);
5113 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1first_1blocknum(JNIEnv * _env, jclass _b, jlong this_ptr) {
5114 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5115 return ReplyChannelRange_get_first_blocknum(this_ptr_conv);
5118 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1first_1blocknum(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5119 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5120 return ReplyChannelRange_set_first_blocknum(this_ptr_conv, val);
5123 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1number_1of_1blocks(JNIEnv * _env, jclass _b, jlong this_ptr) {
5124 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5125 return ReplyChannelRange_get_number_of_blocks(this_ptr_conv);
5128 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1number_1of_1blocks(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5129 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5130 return ReplyChannelRange_set_number_of_blocks(this_ptr_conv, val);
5133 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1full_1information(JNIEnv * _env, jclass _b, jlong this_ptr) {
5134 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5135 return ReplyChannelRange_get_full_information(this_ptr_conv);
5138 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1full_1information(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
5139 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5140 return ReplyChannelRange_set_full_information(this_ptr_conv, val);
5143 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1short_1channel_1ids(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5144 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5145 LDKCVec_u64Z val_conv = *(LDKCVec_u64Z*)val;
5147 return ReplyChannelRange_set_short_channel_ids(this_ptr_conv, val_conv);
5150 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) {
5151 LDKThirtyTwoBytes chain_hash_arg_conv = *(LDKThirtyTwoBytes*)chain_hash_arg;
5152 FREE((void*)chain_hash_arg);
5153 LDKCVec_u64Z short_channel_ids_arg_conv = *(LDKCVec_u64Z*)short_channel_ids_arg;
5154 FREE((void*)short_channel_ids_arg);
5155 LDKReplyChannelRange* ret = MALLOC(sizeof(LDKReplyChannelRange), "LDKReplyChannelRange");
5156 *ret = ReplyChannelRange_new(chain_hash_arg_conv, first_blocknum_arg, number_of_blocks_arg, full_information_arg, short_channel_ids_arg_conv);
5157 assert(ret->is_owned);
5158 ret->is_owned = false;
5162 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5163 LDKQueryShortChannelIds this_ptr_conv = *(LDKQueryShortChannelIds*)this_ptr;
5164 FREE((void*)this_ptr);
5165 this_ptr_conv.is_owned = true;
5166 return QueryShortChannelIds_free(this_ptr_conv);
5169 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
5170 LDKQueryShortChannelIds* this_ptr_conv = (LDKQueryShortChannelIds*)this_ptr;
5171 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5172 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *QueryShortChannelIds_get_chain_hash(this_ptr_conv));
5176 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5177 LDKQueryShortChannelIds* this_ptr_conv = (LDKQueryShortChannelIds*)this_ptr;
5178 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5180 return QueryShortChannelIds_set_chain_hash(this_ptr_conv, val_conv);
5183 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1short_1channel_1ids(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5184 LDKQueryShortChannelIds* this_ptr_conv = (LDKQueryShortChannelIds*)this_ptr;
5185 LDKCVec_u64Z val_conv = *(LDKCVec_u64Z*)val;
5187 return QueryShortChannelIds_set_short_channel_ids(this_ptr_conv, val_conv);
5190 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1new(JNIEnv * _env, jclass _b, jlong chain_hash_arg, jlong short_channel_ids_arg) {
5191 LDKThirtyTwoBytes chain_hash_arg_conv = *(LDKThirtyTwoBytes*)chain_hash_arg;
5192 FREE((void*)chain_hash_arg);
5193 LDKCVec_u64Z short_channel_ids_arg_conv = *(LDKCVec_u64Z*)short_channel_ids_arg;
5194 FREE((void*)short_channel_ids_arg);
5195 LDKQueryShortChannelIds* ret = MALLOC(sizeof(LDKQueryShortChannelIds), "LDKQueryShortChannelIds");
5196 *ret = QueryShortChannelIds_new(chain_hash_arg_conv, short_channel_ids_arg_conv);
5197 assert(ret->is_owned);
5198 ret->is_owned = false;
5202 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5203 LDKReplyShortChannelIdsEnd this_ptr_conv = *(LDKReplyShortChannelIdsEnd*)this_ptr;
5204 FREE((void*)this_ptr);
5205 this_ptr_conv.is_owned = true;
5206 return ReplyShortChannelIdsEnd_free(this_ptr_conv);
5209 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
5210 LDKReplyShortChannelIdsEnd* this_ptr_conv = (LDKReplyShortChannelIdsEnd*)this_ptr;
5211 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5212 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ReplyShortChannelIdsEnd_get_chain_hash(this_ptr_conv));
5216 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5217 LDKReplyShortChannelIdsEnd* this_ptr_conv = (LDKReplyShortChannelIdsEnd*)this_ptr;
5218 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5220 return ReplyShortChannelIdsEnd_set_chain_hash(this_ptr_conv, val_conv);
5223 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1full_1information(JNIEnv * _env, jclass _b, jlong this_ptr) {
5224 LDKReplyShortChannelIdsEnd* this_ptr_conv = (LDKReplyShortChannelIdsEnd*)this_ptr;
5225 return ReplyShortChannelIdsEnd_get_full_information(this_ptr_conv);
5228 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1full_1information(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
5229 LDKReplyShortChannelIdsEnd* this_ptr_conv = (LDKReplyShortChannelIdsEnd*)this_ptr;
5230 return ReplyShortChannelIdsEnd_set_full_information(this_ptr_conv, val);
5233 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1new(JNIEnv * _env, jclass _b, jlong chain_hash_arg, jboolean full_information_arg) {
5234 LDKThirtyTwoBytes chain_hash_arg_conv = *(LDKThirtyTwoBytes*)chain_hash_arg;
5235 FREE((void*)chain_hash_arg);
5236 LDKReplyShortChannelIdsEnd* ret = MALLOC(sizeof(LDKReplyShortChannelIdsEnd), "LDKReplyShortChannelIdsEnd");
5237 *ret = ReplyShortChannelIdsEnd_new(chain_hash_arg_conv, full_information_arg);
5238 assert(ret->is_owned);
5239 ret->is_owned = false;
5243 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5244 LDKGossipTimestampFilter this_ptr_conv = *(LDKGossipTimestampFilter*)this_ptr;
5245 FREE((void*)this_ptr);
5246 this_ptr_conv.is_owned = true;
5247 return GossipTimestampFilter_free(this_ptr_conv);
5250 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
5251 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
5252 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5253 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *GossipTimestampFilter_get_chain_hash(this_ptr_conv));
5257 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5258 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
5259 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5261 return GossipTimestampFilter_set_chain_hash(this_ptr_conv, val_conv);
5264 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1first_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr) {
5265 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
5266 return GossipTimestampFilter_get_first_timestamp(this_ptr_conv);
5269 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1first_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5270 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
5271 return GossipTimestampFilter_set_first_timestamp(this_ptr_conv, val);
5274 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1timestamp_1range(JNIEnv * _env, jclass _b, jlong this_ptr) {
5275 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
5276 return GossipTimestampFilter_get_timestamp_range(this_ptr_conv);
5279 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1timestamp_1range(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5280 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
5281 return GossipTimestampFilter_set_timestamp_range(this_ptr_conv, val);
5284 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) {
5285 LDKThirtyTwoBytes chain_hash_arg_conv = *(LDKThirtyTwoBytes*)chain_hash_arg;
5286 FREE((void*)chain_hash_arg);
5287 LDKGossipTimestampFilter* ret = MALLOC(sizeof(LDKGossipTimestampFilter), "LDKGossipTimestampFilter");
5288 *ret = GossipTimestampFilter_new(chain_hash_arg_conv, first_timestamp_arg, timestamp_range_arg);
5289 assert(ret->is_owned);
5290 ret->is_owned = false;
5294 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorAction_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5295 LDKErrorAction this_ptr_conv = *(LDKErrorAction*)this_ptr;
5296 FREE((void*)this_ptr);
5297 return ErrorAction_free(this_ptr_conv);
5300 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5301 LDKLightningError this_ptr_conv = *(LDKLightningError*)this_ptr;
5302 FREE((void*)this_ptr);
5303 this_ptr_conv.is_owned = true;
5304 return LightningError_free(this_ptr_conv);
5307 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1err(JNIEnv * _env, jclass _b, jlong this_ptr) {
5308 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
5309 LDKStr* ret = MALLOC(sizeof(LDKStr), "LDKStr");
5310 *ret = LightningError_get_err(this_ptr_conv);
5314 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1err(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5315 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
5316 LDKCVec_u8Z val_conv = *(LDKCVec_u8Z*)val;
5318 return LightningError_set_err(this_ptr_conv, val_conv);
5321 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1action(JNIEnv * _env, jclass _b, jlong this_ptr) {
5322 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
5323 LDKErrorAction* ret = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
5324 *ret = LightningError_get_action(this_ptr_conv);
5328 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1action(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5329 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
5330 LDKErrorAction val_conv = *(LDKErrorAction*)val;
5332 return LightningError_set_action(this_ptr_conv, val_conv);
5335 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1new(JNIEnv * _env, jclass _b, jlong err_arg, jlong action_arg) {
5336 LDKCVec_u8Z err_arg_conv = *(LDKCVec_u8Z*)err_arg;
5337 FREE((void*)err_arg);
5338 LDKErrorAction action_arg_conv = *(LDKErrorAction*)action_arg;
5339 FREE((void*)action_arg);
5340 LDKLightningError* ret = MALLOC(sizeof(LDKLightningError), "LDKLightningError");
5341 *ret = LightningError_new(err_arg_conv, action_arg_conv);
5342 assert(ret->is_owned);
5343 ret->is_owned = false;
5347 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5348 LDKCommitmentUpdate this_ptr_conv = *(LDKCommitmentUpdate*)this_ptr;
5349 FREE((void*)this_ptr);
5350 this_ptr_conv.is_owned = true;
5351 return CommitmentUpdate_free(this_ptr_conv);
5354 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1add_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5355 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
5356 LDKCVec_UpdateAddHTLCZ val_conv = *(LDKCVec_UpdateAddHTLCZ*)val;
5358 return CommitmentUpdate_set_update_add_htlcs(this_ptr_conv, val_conv);
5361 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fulfill_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5362 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
5363 LDKCVec_UpdateFulfillHTLCZ val_conv = *(LDKCVec_UpdateFulfillHTLCZ*)val;
5365 return CommitmentUpdate_set_update_fulfill_htlcs(this_ptr_conv, val_conv);
5368 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5369 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
5370 LDKCVec_UpdateFailHTLCZ val_conv = *(LDKCVec_UpdateFailHTLCZ*)val;
5372 return CommitmentUpdate_set_update_fail_htlcs(this_ptr_conv, val_conv);
5375 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1malformed_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5376 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
5377 LDKCVec_UpdateFailMalformedHTLCZ val_conv = *(LDKCVec_UpdateFailMalformedHTLCZ*)val;
5379 return CommitmentUpdate_set_update_fail_malformed_htlcs(this_ptr_conv, val_conv);
5382 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fee(JNIEnv * _env, jclass _b, jlong this_ptr) {
5383 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
5384 LDKUpdateFee* ret = MALLOC(sizeof(LDKUpdateFee), "LDKUpdateFee");
5385 *ret = CommitmentUpdate_get_update_fee(this_ptr_conv);
5386 assert(ret->is_owned);
5387 ret->is_owned = false;
5391 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fee(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5392 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
5393 LDKUpdateFee val_conv = *(LDKUpdateFee*)val;
5395 val_conv.is_owned = true;
5396 return CommitmentUpdate_set_update_fee(this_ptr_conv, val_conv);
5399 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1commitment_1signed(JNIEnv * _env, jclass _b, jlong this_ptr) {
5400 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
5401 LDKCommitmentSigned* ret = MALLOC(sizeof(LDKCommitmentSigned), "LDKCommitmentSigned");
5402 *ret = CommitmentUpdate_get_commitment_signed(this_ptr_conv);
5403 assert(ret->is_owned);
5404 ret->is_owned = false;
5408 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1commitment_1signed(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5409 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
5410 LDKCommitmentSigned val_conv = *(LDKCommitmentSigned*)val;
5412 val_conv.is_owned = true;
5413 return CommitmentUpdate_set_commitment_signed(this_ptr_conv, val_conv);
5416 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) {
5417 LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg_conv = *(LDKCVec_UpdateAddHTLCZ*)update_add_htlcs_arg;
5418 FREE((void*)update_add_htlcs_arg);
5419 LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg_conv = *(LDKCVec_UpdateFulfillHTLCZ*)update_fulfill_htlcs_arg;
5420 FREE((void*)update_fulfill_htlcs_arg);
5421 LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg_conv = *(LDKCVec_UpdateFailHTLCZ*)update_fail_htlcs_arg;
5422 FREE((void*)update_fail_htlcs_arg);
5423 LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg_conv = *(LDKCVec_UpdateFailMalformedHTLCZ*)update_fail_malformed_htlcs_arg;
5424 FREE((void*)update_fail_malformed_htlcs_arg);
5425 LDKUpdateFee update_fee_arg_conv = *(LDKUpdateFee*)update_fee_arg;
5426 FREE((void*)update_fee_arg);
5427 update_fee_arg_conv.is_owned = true;
5428 LDKCommitmentSigned commitment_signed_arg_conv = *(LDKCommitmentSigned*)commitment_signed_arg;
5429 FREE((void*)commitment_signed_arg);
5430 commitment_signed_arg_conv.is_owned = true;
5431 LDKCommitmentUpdate* ret = MALLOC(sizeof(LDKCommitmentUpdate), "LDKCommitmentUpdate");
5432 *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);
5433 assert(ret->is_owned);
5434 ret->is_owned = false;
5438 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCFailChannelUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5439 LDKHTLCFailChannelUpdate this_ptr_conv = *(LDKHTLCFailChannelUpdate*)this_ptr;
5440 FREE((void*)this_ptr);
5441 return HTLCFailChannelUpdate_free(this_ptr_conv);
5444 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5445 LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)this_ptr;
5446 FREE((void*)this_ptr);
5447 return ChannelMessageHandler_free(this_ptr_conv);
5450 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5451 LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)this_ptr;
5452 FREE((void*)this_ptr);
5453 return RoutingMessageHandler_free(this_ptr_conv);
5456 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1write(JNIEnv * _env, jclass _b, jlong obj) {
5457 LDKAcceptChannel* obj_conv = (LDKAcceptChannel*)obj;
5458 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5459 *ret = AcceptChannel_write(obj_conv);
5463 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1read(JNIEnv * _env, jclass _b, jlong ser) {
5464 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5466 LDKAcceptChannel* ret = MALLOC(sizeof(LDKAcceptChannel), "LDKAcceptChannel");
5467 *ret = AcceptChannel_read(ser_conv);
5468 assert(ret->is_owned);
5469 ret->is_owned = false;
5473 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1write(JNIEnv * _env, jclass _b, jlong obj) {
5474 LDKAnnouncementSignatures* obj_conv = (LDKAnnouncementSignatures*)obj;
5475 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5476 *ret = AnnouncementSignatures_write(obj_conv);
5480 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1read(JNIEnv * _env, jclass _b, jlong ser) {
5481 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5483 LDKAnnouncementSignatures* ret = MALLOC(sizeof(LDKAnnouncementSignatures), "LDKAnnouncementSignatures");
5484 *ret = AnnouncementSignatures_read(ser_conv);
5485 assert(ret->is_owned);
5486 ret->is_owned = false;
5490 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1write(JNIEnv * _env, jclass _b, jlong obj) {
5491 LDKChannelReestablish* obj_conv = (LDKChannelReestablish*)obj;
5492 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5493 *ret = ChannelReestablish_write(obj_conv);
5497 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1read(JNIEnv * _env, jclass _b, jlong ser) {
5498 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5500 LDKChannelReestablish* ret = MALLOC(sizeof(LDKChannelReestablish), "LDKChannelReestablish");
5501 *ret = ChannelReestablish_read(ser_conv);
5502 assert(ret->is_owned);
5503 ret->is_owned = false;
5507 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
5508 LDKClosingSigned* obj_conv = (LDKClosingSigned*)obj;
5509 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5510 *ret = ClosingSigned_write(obj_conv);
5514 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1read(JNIEnv * _env, jclass _b, jlong ser) {
5515 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5517 LDKClosingSigned* ret = MALLOC(sizeof(LDKClosingSigned), "LDKClosingSigned");
5518 *ret = ClosingSigned_read(ser_conv);
5519 assert(ret->is_owned);
5520 ret->is_owned = false;
5524 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
5525 LDKCommitmentSigned* obj_conv = (LDKCommitmentSigned*)obj;
5526 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5527 *ret = CommitmentSigned_write(obj_conv);
5531 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1read(JNIEnv * _env, jclass _b, jlong ser) {
5532 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5534 LDKCommitmentSigned* ret = MALLOC(sizeof(LDKCommitmentSigned), "LDKCommitmentSigned");
5535 *ret = CommitmentSigned_read(ser_conv);
5536 assert(ret->is_owned);
5537 ret->is_owned = false;
5541 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1write(JNIEnv * _env, jclass _b, jlong obj) {
5542 LDKFundingCreated* obj_conv = (LDKFundingCreated*)obj;
5543 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5544 *ret = FundingCreated_write(obj_conv);
5548 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1read(JNIEnv * _env, jclass _b, jlong ser) {
5549 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5551 LDKFundingCreated* ret = MALLOC(sizeof(LDKFundingCreated), "LDKFundingCreated");
5552 *ret = FundingCreated_read(ser_conv);
5553 assert(ret->is_owned);
5554 ret->is_owned = false;
5558 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
5559 LDKFundingSigned* obj_conv = (LDKFundingSigned*)obj;
5560 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5561 *ret = FundingSigned_write(obj_conv);
5565 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1read(JNIEnv * _env, jclass _b, jlong ser) {
5566 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5568 LDKFundingSigned* ret = MALLOC(sizeof(LDKFundingSigned), "LDKFundingSigned");
5569 *ret = FundingSigned_read(ser_conv);
5570 assert(ret->is_owned);
5571 ret->is_owned = false;
5575 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1write(JNIEnv * _env, jclass _b, jlong obj) {
5576 LDKFundingLocked* obj_conv = (LDKFundingLocked*)obj;
5577 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5578 *ret = FundingLocked_write(obj_conv);
5582 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1read(JNIEnv * _env, jclass _b, jlong ser) {
5583 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5585 LDKFundingLocked* ret = MALLOC(sizeof(LDKFundingLocked), "LDKFundingLocked");
5586 *ret = FundingLocked_read(ser_conv);
5587 assert(ret->is_owned);
5588 ret->is_owned = false;
5592 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1write(JNIEnv * _env, jclass _b, jlong obj) {
5593 LDKInit* obj_conv = (LDKInit*)obj;
5594 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5595 *ret = Init_write(obj_conv);
5599 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1read(JNIEnv * _env, jclass _b, jlong ser) {
5600 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5602 LDKInit* ret = MALLOC(sizeof(LDKInit), "LDKInit");
5603 *ret = Init_read(ser_conv);
5604 assert(ret->is_owned);
5605 ret->is_owned = false;
5609 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1write(JNIEnv * _env, jclass _b, jlong obj) {
5610 LDKOpenChannel* obj_conv = (LDKOpenChannel*)obj;
5611 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5612 *ret = OpenChannel_write(obj_conv);
5616 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1read(JNIEnv * _env, jclass _b, jlong ser) {
5617 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5619 LDKOpenChannel* ret = MALLOC(sizeof(LDKOpenChannel), "LDKOpenChannel");
5620 *ret = OpenChannel_read(ser_conv);
5621 assert(ret->is_owned);
5622 ret->is_owned = false;
5626 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1write(JNIEnv * _env, jclass _b, jlong obj) {
5627 LDKRevokeAndACK* obj_conv = (LDKRevokeAndACK*)obj;
5628 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5629 *ret = RevokeAndACK_write(obj_conv);
5633 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1read(JNIEnv * _env, jclass _b, jlong ser) {
5634 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5636 LDKRevokeAndACK* ret = MALLOC(sizeof(LDKRevokeAndACK), "LDKRevokeAndACK");
5637 *ret = RevokeAndACK_read(ser_conv);
5638 assert(ret->is_owned);
5639 ret->is_owned = false;
5643 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1write(JNIEnv * _env, jclass _b, jlong obj) {
5644 LDKShutdown* obj_conv = (LDKShutdown*)obj;
5645 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5646 *ret = Shutdown_write(obj_conv);
5650 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1read(JNIEnv * _env, jclass _b, jlong ser) {
5651 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5653 LDKShutdown* ret = MALLOC(sizeof(LDKShutdown), "LDKShutdown");
5654 *ret = Shutdown_read(ser_conv);
5655 assert(ret->is_owned);
5656 ret->is_owned = false;
5660 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
5661 LDKUpdateFailHTLC* obj_conv = (LDKUpdateFailHTLC*)obj;
5662 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5663 *ret = UpdateFailHTLC_write(obj_conv);
5667 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
5668 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5670 LDKUpdateFailHTLC* ret = MALLOC(sizeof(LDKUpdateFailHTLC), "LDKUpdateFailHTLC");
5671 *ret = UpdateFailHTLC_read(ser_conv);
5672 assert(ret->is_owned);
5673 ret->is_owned = false;
5677 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
5678 LDKUpdateFailMalformedHTLC* obj_conv = (LDKUpdateFailMalformedHTLC*)obj;
5679 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5680 *ret = UpdateFailMalformedHTLC_write(obj_conv);
5684 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
5685 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5687 LDKUpdateFailMalformedHTLC* ret = MALLOC(sizeof(LDKUpdateFailMalformedHTLC), "LDKUpdateFailMalformedHTLC");
5688 *ret = UpdateFailMalformedHTLC_read(ser_conv);
5689 assert(ret->is_owned);
5690 ret->is_owned = false;
5694 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1write(JNIEnv * _env, jclass _b, jlong obj) {
5695 LDKUpdateFee* obj_conv = (LDKUpdateFee*)obj;
5696 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5697 *ret = UpdateFee_write(obj_conv);
5701 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1read(JNIEnv * _env, jclass _b, jlong ser) {
5702 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5704 LDKUpdateFee* ret = MALLOC(sizeof(LDKUpdateFee), "LDKUpdateFee");
5705 *ret = UpdateFee_read(ser_conv);
5706 assert(ret->is_owned);
5707 ret->is_owned = false;
5711 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
5712 LDKUpdateFulfillHTLC* obj_conv = (LDKUpdateFulfillHTLC*)obj;
5713 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5714 *ret = UpdateFulfillHTLC_write(obj_conv);
5718 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
5719 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5721 LDKUpdateFulfillHTLC* ret = MALLOC(sizeof(LDKUpdateFulfillHTLC), "LDKUpdateFulfillHTLC");
5722 *ret = UpdateFulfillHTLC_read(ser_conv);
5723 assert(ret->is_owned);
5724 ret->is_owned = false;
5728 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
5729 LDKUpdateAddHTLC* obj_conv = (LDKUpdateAddHTLC*)obj;
5730 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5731 *ret = UpdateAddHTLC_write(obj_conv);
5735 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
5736 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5738 LDKUpdateAddHTLC* ret = MALLOC(sizeof(LDKUpdateAddHTLC), "LDKUpdateAddHTLC");
5739 *ret = UpdateAddHTLC_read(ser_conv);
5740 assert(ret->is_owned);
5741 ret->is_owned = false;
5745 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1write(JNIEnv * _env, jclass _b, jlong obj) {
5746 LDKPing* obj_conv = (LDKPing*)obj;
5747 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5748 *ret = Ping_write(obj_conv);
5752 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1read(JNIEnv * _env, jclass _b, jlong ser) {
5753 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5755 LDKPing* ret = MALLOC(sizeof(LDKPing), "LDKPing");
5756 *ret = Ping_read(ser_conv);
5757 assert(ret->is_owned);
5758 ret->is_owned = false;
5762 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1write(JNIEnv * _env, jclass _b, jlong obj) {
5763 LDKPong* obj_conv = (LDKPong*)obj;
5764 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5765 *ret = Pong_write(obj_conv);
5769 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1read(JNIEnv * _env, jclass _b, jlong ser) {
5770 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5772 LDKPong* ret = MALLOC(sizeof(LDKPong), "LDKPong");
5773 *ret = Pong_read(ser_conv);
5774 assert(ret->is_owned);
5775 ret->is_owned = false;
5779 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
5780 LDKUnsignedChannelAnnouncement* obj_conv = (LDKUnsignedChannelAnnouncement*)obj;
5781 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5782 *ret = UnsignedChannelAnnouncement_write(obj_conv);
5786 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
5787 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5789 LDKUnsignedChannelAnnouncement* ret = MALLOC(sizeof(LDKUnsignedChannelAnnouncement), "LDKUnsignedChannelAnnouncement");
5790 *ret = UnsignedChannelAnnouncement_read(ser_conv);
5791 assert(ret->is_owned);
5792 ret->is_owned = false;
5796 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
5797 LDKChannelAnnouncement* obj_conv = (LDKChannelAnnouncement*)obj;
5798 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5799 *ret = ChannelAnnouncement_write(obj_conv);
5803 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
5804 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5806 LDKChannelAnnouncement* ret = MALLOC(sizeof(LDKChannelAnnouncement), "LDKChannelAnnouncement");
5807 *ret = ChannelAnnouncement_read(ser_conv);
5808 assert(ret->is_owned);
5809 ret->is_owned = false;
5813 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
5814 LDKUnsignedChannelUpdate* obj_conv = (LDKUnsignedChannelUpdate*)obj;
5815 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5816 *ret = UnsignedChannelUpdate_write(obj_conv);
5820 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
5821 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5823 LDKUnsignedChannelUpdate* ret = MALLOC(sizeof(LDKUnsignedChannelUpdate), "LDKUnsignedChannelUpdate");
5824 *ret = UnsignedChannelUpdate_read(ser_conv);
5825 assert(ret->is_owned);
5826 ret->is_owned = false;
5830 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
5831 LDKChannelUpdate* obj_conv = (LDKChannelUpdate*)obj;
5832 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5833 *ret = ChannelUpdate_write(obj_conv);
5837 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
5838 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5840 LDKChannelUpdate* ret = MALLOC(sizeof(LDKChannelUpdate), "LDKChannelUpdate");
5841 *ret = ChannelUpdate_read(ser_conv);
5842 assert(ret->is_owned);
5843 ret->is_owned = false;
5847 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1write(JNIEnv * _env, jclass _b, jlong obj) {
5848 LDKErrorMessage* obj_conv = (LDKErrorMessage*)obj;
5849 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5850 *ret = ErrorMessage_write(obj_conv);
5854 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1read(JNIEnv * _env, jclass _b, jlong ser) {
5855 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5857 LDKErrorMessage* ret = MALLOC(sizeof(LDKErrorMessage), "LDKErrorMessage");
5858 *ret = ErrorMessage_read(ser_conv);
5859 assert(ret->is_owned);
5860 ret->is_owned = false;
5864 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
5865 LDKUnsignedNodeAnnouncement* obj_conv = (LDKUnsignedNodeAnnouncement*)obj;
5866 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5867 *ret = UnsignedNodeAnnouncement_write(obj_conv);
5871 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
5872 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5874 LDKUnsignedNodeAnnouncement* ret = MALLOC(sizeof(LDKUnsignedNodeAnnouncement), "LDKUnsignedNodeAnnouncement");
5875 *ret = UnsignedNodeAnnouncement_read(ser_conv);
5876 assert(ret->is_owned);
5877 ret->is_owned = false;
5881 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
5882 LDKNodeAnnouncement* obj_conv = (LDKNodeAnnouncement*)obj;
5883 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5884 *ret = NodeAnnouncement_write(obj_conv);
5888 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
5889 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5891 LDKNodeAnnouncement* ret = MALLOC(sizeof(LDKNodeAnnouncement), "LDKNodeAnnouncement");
5892 *ret = NodeAnnouncement_read(ser_conv);
5893 assert(ret->is_owned);
5894 ret->is_owned = false;
5898 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1read(JNIEnv * _env, jclass _b, jlong ser) {
5899 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5901 LDKQueryShortChannelIds* ret = MALLOC(sizeof(LDKQueryShortChannelIds), "LDKQueryShortChannelIds");
5902 *ret = QueryShortChannelIds_read(ser_conv);
5903 assert(ret->is_owned);
5904 ret->is_owned = false;
5908 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1write(JNIEnv * _env, jclass _b, jlong obj) {
5909 LDKQueryShortChannelIds* obj_conv = (LDKQueryShortChannelIds*)obj;
5910 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5911 *ret = QueryShortChannelIds_write(obj_conv);
5915 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1read(JNIEnv * _env, jclass _b, jlong ser) {
5916 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5918 LDKReplyShortChannelIdsEnd* ret = MALLOC(sizeof(LDKReplyShortChannelIdsEnd), "LDKReplyShortChannelIdsEnd");
5919 *ret = ReplyShortChannelIdsEnd_read(ser_conv);
5920 assert(ret->is_owned);
5921 ret->is_owned = false;
5925 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1write(JNIEnv * _env, jclass _b, jlong obj) {
5926 LDKReplyShortChannelIdsEnd* obj_conv = (LDKReplyShortChannelIdsEnd*)obj;
5927 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5928 *ret = ReplyShortChannelIdsEnd_write(obj_conv);
5932 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1read(JNIEnv * _env, jclass _b, jlong ser) {
5933 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5935 LDKQueryChannelRange* ret = MALLOC(sizeof(LDKQueryChannelRange), "LDKQueryChannelRange");
5936 *ret = QueryChannelRange_read(ser_conv);
5937 assert(ret->is_owned);
5938 ret->is_owned = false;
5942 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1write(JNIEnv * _env, jclass _b, jlong obj) {
5943 LDKQueryChannelRange* obj_conv = (LDKQueryChannelRange*)obj;
5944 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5945 *ret = QueryChannelRange_write(obj_conv);
5949 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1read(JNIEnv * _env, jclass _b, jlong ser) {
5950 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5952 LDKReplyChannelRange* ret = MALLOC(sizeof(LDKReplyChannelRange), "LDKReplyChannelRange");
5953 *ret = ReplyChannelRange_read(ser_conv);
5954 assert(ret->is_owned);
5955 ret->is_owned = false;
5959 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1write(JNIEnv * _env, jclass _b, jlong obj) {
5960 LDKReplyChannelRange* obj_conv = (LDKReplyChannelRange*)obj;
5961 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5962 *ret = ReplyChannelRange_write(obj_conv);
5966 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1read(JNIEnv * _env, jclass _b, jlong ser) {
5967 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5969 LDKGossipTimestampFilter* ret = MALLOC(sizeof(LDKGossipTimestampFilter), "LDKGossipTimestampFilter");
5970 *ret = GossipTimestampFilter_read(ser_conv);
5971 assert(ret->is_owned);
5972 ret->is_owned = false;
5976 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1write(JNIEnv * _env, jclass _b, jlong obj) {
5977 LDKGossipTimestampFilter* obj_conv = (LDKGossipTimestampFilter*)obj;
5978 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5979 *ret = GossipTimestampFilter_write(obj_conv);
5983 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5984 LDKMessageHandler this_ptr_conv = *(LDKMessageHandler*)this_ptr;
5985 FREE((void*)this_ptr);
5986 this_ptr_conv.is_owned = true;
5987 return MessageHandler_free(this_ptr_conv);
5990 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1chan_1handler(JNIEnv * _env, jclass _b, jlong this_ptr) {
5991 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
5992 long ret = (long)MessageHandler_get_chan_handler(this_ptr_conv);
5996 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1chan_1handler(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5997 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
5998 LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)val;
5999 if (val_conv.free == LDKChannelMessageHandler_JCalls_free) {
6000 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
6001 LDKChannelMessageHandler_JCalls_clone(val_conv.this_arg);
6003 return MessageHandler_set_chan_handler(this_ptr_conv, val_conv);
6006 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1route_1handler(JNIEnv * _env, jclass _b, jlong this_ptr) {
6007 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
6008 long ret = (long)MessageHandler_get_route_handler(this_ptr_conv);
6012 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1route_1handler(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6013 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
6014 LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)val;
6015 if (val_conv.free == LDKRoutingMessageHandler_JCalls_free) {
6016 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
6017 LDKRoutingMessageHandler_JCalls_clone(val_conv.this_arg);
6019 return MessageHandler_set_route_handler(this_ptr_conv, val_conv);
6022 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new(JNIEnv * _env, jclass _b, jlong chan_handler_arg, jlong route_handler_arg) {
6023 LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)chan_handler_arg;
6024 if (chan_handler_arg_conv.free == LDKChannelMessageHandler_JCalls_free) {
6025 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
6026 LDKChannelMessageHandler_JCalls_clone(chan_handler_arg_conv.this_arg);
6028 LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)route_handler_arg;
6029 if (route_handler_arg_conv.free == LDKRoutingMessageHandler_JCalls_free) {
6030 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
6031 LDKRoutingMessageHandler_JCalls_clone(route_handler_arg_conv.this_arg);
6033 LDKMessageHandler* ret = MALLOC(sizeof(LDKMessageHandler), "LDKMessageHandler");
6034 *ret = MessageHandler_new(chan_handler_arg_conv, route_handler_arg_conv);
6035 assert(ret->is_owned);
6036 ret->is_owned = false;
6040 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6041 LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)this_ptr;
6042 FREE((void*)this_ptr);
6043 return SocketDescriptor_free(this_ptr_conv);
6046 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6047 LDKPeerHandleError this_ptr_conv = *(LDKPeerHandleError*)this_ptr;
6048 FREE((void*)this_ptr);
6049 this_ptr_conv.is_owned = true;
6050 return PeerHandleError_free(this_ptr_conv);
6053 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1get_1no_1connection_1possible(JNIEnv * _env, jclass _b, jlong this_ptr) {
6054 LDKPeerHandleError* this_ptr_conv = (LDKPeerHandleError*)this_ptr;
6055 return PeerHandleError_get_no_connection_possible(this_ptr_conv);
6058 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1set_1no_1connection_1possible(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
6059 LDKPeerHandleError* this_ptr_conv = (LDKPeerHandleError*)this_ptr;
6060 return PeerHandleError_set_no_connection_possible(this_ptr_conv, val);
6063 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new(JNIEnv * _env, jclass _b, jboolean no_connection_possible_arg) {
6064 LDKPeerHandleError* ret = MALLOC(sizeof(LDKPeerHandleError), "LDKPeerHandleError");
6065 *ret = PeerHandleError_new(no_connection_possible_arg);
6066 assert(ret->is_owned);
6067 ret->is_owned = false;
6071 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6072 LDKPeerManager this_ptr_conv = *(LDKPeerManager*)this_ptr;
6073 FREE((void*)this_ptr);
6074 this_ptr_conv.is_owned = true;
6075 return PeerManager_free(this_ptr_conv);
6078 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) {
6079 LDKMessageHandler message_handler_conv = *(LDKMessageHandler*)message_handler;
6080 FREE((void*)message_handler);
6081 message_handler_conv.is_owned = true;
6082 LDKSecretKey our_node_secret_conv = *(LDKSecretKey*)our_node_secret;
6083 FREE((void*)our_node_secret);
6084 unsigned char ephemeral_random_data_arr[32];
6085 (*_env)->GetByteArrayRegion (_env, ephemeral_random_data, 0, 32, ephemeral_random_data_arr);
6086 unsigned char (*ephemeral_random_data_ref)[32] = &ephemeral_random_data_arr;
6087 LDKLogger logger_conv = *(LDKLogger*)logger;
6088 if (logger_conv.free == LDKLogger_JCalls_free) {
6089 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
6090 LDKLogger_JCalls_clone(logger_conv.this_arg);
6092 LDKPeerManager* ret = MALLOC(sizeof(LDKPeerManager), "LDKPeerManager");
6093 *ret = PeerManager_new(message_handler_conv, our_node_secret_conv, ephemeral_random_data_ref, logger_conv);
6094 assert(ret->is_owned);
6095 ret->is_owned = false;
6099 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1get_1peer_1node_1ids(JNIEnv * _env, jclass _b, jlong this_arg) {
6100 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
6101 LDKCVec_PublicKeyZ* ret = MALLOC(sizeof(LDKCVec_PublicKeyZ), "LDKCVec_PublicKeyZ");
6102 *ret = PeerManager_get_peer_node_ids(this_arg_conv);
6106 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) {
6107 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
6108 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
6109 FREE((void*)their_node_id);
6110 LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)descriptor;
6111 if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
6112 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
6113 LDKSocketDescriptor_JCalls_clone(descriptor_conv.this_arg);
6115 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
6116 *ret = PeerManager_new_outbound_connection(this_arg_conv, their_node_id_conv, descriptor_conv);
6120 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1inbound_1connection(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) {
6121 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
6122 LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)descriptor;
6123 if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
6124 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
6125 LDKSocketDescriptor_JCalls_clone(descriptor_conv.this_arg);
6127 LDKCResult_NonePeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
6128 *ret = PeerManager_new_inbound_connection(this_arg_conv, descriptor_conv);
6132 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1write_1buffer_1space_1avail(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) {
6133 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
6134 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor;
6135 LDKCResult_NonePeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
6136 *ret = PeerManager_write_buffer_space_avail(this_arg_conv, descriptor_conv);
6140 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1read_1event(JNIEnv * _env, jclass _b, jlong this_arg, jlong peer_descriptor, jlong data) {
6141 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
6142 LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor;
6143 LDKu8slice data_conv = *(LDKu8slice*)data;
6145 LDKCResult_boolPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
6146 *ret = PeerManager_read_event(this_arg_conv, peer_descriptor_conv, data_conv);
6150 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1process_1events(JNIEnv * _env, jclass _b, jlong this_arg) {
6151 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
6152 return PeerManager_process_events(this_arg_conv);
6155 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1socket_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) {
6156 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
6157 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor;
6158 return PeerManager_socket_disconnected(this_arg_conv, descriptor_conv);
6161 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1timer_1tick_1occured(JNIEnv * _env, jclass _b, jlong this_arg) {
6162 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
6163 return PeerManager_timer_tick_occured(this_arg_conv);
6166 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_build_1commitment_1secret(JNIEnv * _env, jclass _b, jbyteArray commitment_seed, jlong idx) {
6167 unsigned char commitment_seed_arr[32];
6168 (*_env)->GetByteArrayRegion (_env, commitment_seed, 0, 32, commitment_seed_arr);
6169 unsigned char (*commitment_seed_ref)[32] = &commitment_seed_arr;
6170 LDKThirtyTwoBytes* ret = MALLOC(sizeof(LDKThirtyTwoBytes), "LDKThirtyTwoBytes");
6171 *ret = build_commitment_secret(commitment_seed_ref, idx);
6175 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1private_1key(JNIEnv * _env, jclass _b, jlong per_commitment_point, jbyteArray base_secret) {
6176 LDKPublicKey per_commitment_point_conv = *(LDKPublicKey*)per_commitment_point;
6177 FREE((void*)per_commitment_point);
6178 unsigned char base_secret_arr[32];
6179 (*_env)->GetByteArrayRegion (_env, base_secret, 0, 32, base_secret_arr);
6180 unsigned char (*base_secret_ref)[32] = &base_secret_arr;
6181 LDKCResult_SecretKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ");
6182 *ret = derive_private_key(per_commitment_point_conv, base_secret_ref);
6186 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1public_1key(JNIEnv * _env, jclass _b, jlong per_commitment_point, jlong base_point) {
6187 LDKPublicKey per_commitment_point_conv = *(LDKPublicKey*)per_commitment_point;
6188 FREE((void*)per_commitment_point);
6189 LDKPublicKey base_point_conv = *(LDKPublicKey*)base_point;
6190 FREE((void*)base_point);
6191 LDKCResult_PublicKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ");
6192 *ret = derive_public_key(per_commitment_point_conv, base_point_conv);
6196 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) {
6197 unsigned char per_commitment_secret_arr[32];
6198 (*_env)->GetByteArrayRegion (_env, per_commitment_secret, 0, 32, per_commitment_secret_arr);
6199 unsigned char (*per_commitment_secret_ref)[32] = &per_commitment_secret_arr;
6200 unsigned char countersignatory_revocation_base_secret_arr[32];
6201 (*_env)->GetByteArrayRegion (_env, countersignatory_revocation_base_secret, 0, 32, countersignatory_revocation_base_secret_arr);
6202 unsigned char (*countersignatory_revocation_base_secret_ref)[32] = &countersignatory_revocation_base_secret_arr;
6203 LDKCResult_SecretKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ");
6204 *ret = derive_private_revocation_key(per_commitment_secret_ref, countersignatory_revocation_base_secret_ref);
6208 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) {
6209 LDKPublicKey per_commitment_point_conv = *(LDKPublicKey*)per_commitment_point;
6210 FREE((void*)per_commitment_point);
6211 LDKPublicKey countersignatory_revocation_base_point_conv = *(LDKPublicKey*)countersignatory_revocation_base_point;
6212 FREE((void*)countersignatory_revocation_base_point);
6213 LDKCResult_PublicKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ");
6214 *ret = derive_public_revocation_key(per_commitment_point_conv, countersignatory_revocation_base_point_conv);
6218 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6219 LDKTxCreationKeys this_ptr_conv = *(LDKTxCreationKeys*)this_ptr;
6220 FREE((void*)this_ptr);
6221 this_ptr_conv.is_owned = true;
6222 return TxCreationKeys_free(this_ptr_conv);
6225 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
6226 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6227 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6228 *ret = TxCreationKeys_get_per_commitment_point(this_ptr_conv);
6232 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6233 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6234 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6236 return TxCreationKeys_set_per_commitment_point(this_ptr_conv, val_conv);
6239 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1revocation_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
6240 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6241 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6242 *ret = TxCreationKeys_get_revocation_key(this_ptr_conv);
6246 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1revocation_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6247 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6248 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6250 return TxCreationKeys_set_revocation_key(this_ptr_conv, val_conv);
6253 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
6254 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6255 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6256 *ret = TxCreationKeys_get_broadcaster_htlc_key(this_ptr_conv);
6260 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6261 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6262 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6264 return TxCreationKeys_set_broadcaster_htlc_key(this_ptr_conv, val_conv);
6267 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1countersignatory_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
6268 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6269 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6270 *ret = TxCreationKeys_get_countersignatory_htlc_key(this_ptr_conv);
6274 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1countersignatory_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6275 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6276 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6278 return TxCreationKeys_set_countersignatory_htlc_key(this_ptr_conv, val_conv);
6281 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1delayed_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
6282 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6283 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6284 *ret = TxCreationKeys_get_broadcaster_delayed_payment_key(this_ptr_conv);
6288 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1delayed_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6289 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6290 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6292 return TxCreationKeys_set_broadcaster_delayed_payment_key(this_ptr_conv, val_conv);
6295 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) {
6296 LDKPublicKey per_commitment_point_arg_conv = *(LDKPublicKey*)per_commitment_point_arg;
6297 FREE((void*)per_commitment_point_arg);
6298 LDKPublicKey revocation_key_arg_conv = *(LDKPublicKey*)revocation_key_arg;
6299 FREE((void*)revocation_key_arg);
6300 LDKPublicKey broadcaster_htlc_key_arg_conv = *(LDKPublicKey*)broadcaster_htlc_key_arg;
6301 FREE((void*)broadcaster_htlc_key_arg);
6302 LDKPublicKey countersignatory_htlc_key_arg_conv = *(LDKPublicKey*)countersignatory_htlc_key_arg;
6303 FREE((void*)countersignatory_htlc_key_arg);
6304 LDKPublicKey broadcaster_delayed_payment_key_arg_conv = *(LDKPublicKey*)broadcaster_delayed_payment_key_arg;
6305 FREE((void*)broadcaster_delayed_payment_key_arg);
6306 LDKTxCreationKeys* ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
6307 *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);
6308 assert(ret->is_owned);
6309 ret->is_owned = false;
6313 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1write(JNIEnv * _env, jclass _b, jlong obj) {
6314 LDKTxCreationKeys* obj_conv = (LDKTxCreationKeys*)obj;
6315 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6316 *ret = TxCreationKeys_write(obj_conv);
6320 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1read(JNIEnv * _env, jclass _b, jlong ser) {
6321 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6323 LDKTxCreationKeys* ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
6324 *ret = TxCreationKeys_read(ser_conv);
6325 assert(ret->is_owned);
6326 ret->is_owned = false;
6330 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6331 LDKPreCalculatedTxCreationKeys this_ptr_conv = *(LDKPreCalculatedTxCreationKeys*)this_ptr;
6332 FREE((void*)this_ptr);
6333 this_ptr_conv.is_owned = true;
6334 return PreCalculatedTxCreationKeys_free(this_ptr_conv);
6337 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1new(JNIEnv * _env, jclass _b, jlong keys) {
6338 LDKTxCreationKeys keys_conv = *(LDKTxCreationKeys*)keys;
6340 keys_conv.is_owned = true;
6341 LDKPreCalculatedTxCreationKeys* ret = MALLOC(sizeof(LDKPreCalculatedTxCreationKeys), "LDKPreCalculatedTxCreationKeys");
6342 *ret = PreCalculatedTxCreationKeys_new(keys_conv);
6343 assert(ret->is_owned);
6344 ret->is_owned = false;
6348 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1trust_1key_1derivation(JNIEnv * _env, jclass _b, jlong this_arg) {
6349 LDKPreCalculatedTxCreationKeys* this_arg_conv = (LDKPreCalculatedTxCreationKeys*)this_arg;
6350 LDKTxCreationKeys* ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
6351 *ret = PreCalculatedTxCreationKeys_trust_key_derivation(this_arg_conv);
6352 assert(ret->is_owned);
6353 ret->is_owned = false;
6357 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_arg) {
6358 LDKPreCalculatedTxCreationKeys* this_arg_conv = (LDKPreCalculatedTxCreationKeys*)this_arg;
6359 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6360 *ret = PreCalculatedTxCreationKeys_per_commitment_point(this_arg_conv);
6364 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6365 LDKChannelPublicKeys this_ptr_conv = *(LDKChannelPublicKeys*)this_ptr;
6366 FREE((void*)this_ptr);
6367 this_ptr_conv.is_owned = true;
6368 return ChannelPublicKeys_free(this_ptr_conv);
6371 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
6372 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
6373 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6374 *ret = ChannelPublicKeys_get_funding_pubkey(this_ptr_conv);
6378 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6379 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
6380 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6382 return ChannelPublicKeys_set_funding_pubkey(this_ptr_conv, val_conv);
6385 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
6386 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
6387 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6388 *ret = ChannelPublicKeys_get_revocation_basepoint(this_ptr_conv);
6392 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6393 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
6394 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6396 return ChannelPublicKeys_set_revocation_basepoint(this_ptr_conv, val_conv);
6399 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
6400 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
6401 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6402 *ret = ChannelPublicKeys_get_payment_point(this_ptr_conv);
6406 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6407 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
6408 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6410 return ChannelPublicKeys_set_payment_point(this_ptr_conv, val_conv);
6413 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
6414 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
6415 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6416 *ret = ChannelPublicKeys_get_delayed_payment_basepoint(this_ptr_conv);
6420 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6421 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
6422 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6424 return ChannelPublicKeys_set_delayed_payment_basepoint(this_ptr_conv, val_conv);
6427 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
6428 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
6429 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6430 *ret = ChannelPublicKeys_get_htlc_basepoint(this_ptr_conv);
6434 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6435 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
6436 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6438 return ChannelPublicKeys_set_htlc_basepoint(this_ptr_conv, val_conv);
6441 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) {
6442 LDKPublicKey funding_pubkey_arg_conv = *(LDKPublicKey*)funding_pubkey_arg;
6443 FREE((void*)funding_pubkey_arg);
6444 LDKPublicKey revocation_basepoint_arg_conv = *(LDKPublicKey*)revocation_basepoint_arg;
6445 FREE((void*)revocation_basepoint_arg);
6446 LDKPublicKey payment_point_arg_conv = *(LDKPublicKey*)payment_point_arg;
6447 FREE((void*)payment_point_arg);
6448 LDKPublicKey delayed_payment_basepoint_arg_conv = *(LDKPublicKey*)delayed_payment_basepoint_arg;
6449 FREE((void*)delayed_payment_basepoint_arg);
6450 LDKPublicKey htlc_basepoint_arg_conv = *(LDKPublicKey*)htlc_basepoint_arg;
6451 FREE((void*)htlc_basepoint_arg);
6452 LDKChannelPublicKeys* ret = MALLOC(sizeof(LDKChannelPublicKeys), "LDKChannelPublicKeys");
6453 *ret = ChannelPublicKeys_new(funding_pubkey_arg_conv, revocation_basepoint_arg_conv, payment_point_arg_conv, delayed_payment_basepoint_arg_conv, htlc_basepoint_arg_conv);
6454 assert(ret->is_owned);
6455 ret->is_owned = false;
6459 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1write(JNIEnv * _env, jclass _b, jlong obj) {
6460 LDKChannelPublicKeys* obj_conv = (LDKChannelPublicKeys*)obj;
6461 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6462 *ret = ChannelPublicKeys_write(obj_conv);
6466 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1read(JNIEnv * _env, jclass _b, jlong ser) {
6467 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6469 LDKChannelPublicKeys* ret = MALLOC(sizeof(LDKChannelPublicKeys), "LDKChannelPublicKeys");
6470 *ret = ChannelPublicKeys_read(ser_conv);
6471 assert(ret->is_owned);
6472 ret->is_owned = false;
6476 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) {
6477 LDKPublicKey per_commitment_point_conv = *(LDKPublicKey*)per_commitment_point;
6478 FREE((void*)per_commitment_point);
6479 LDKPublicKey broadcaster_delayed_payment_base_conv = *(LDKPublicKey*)broadcaster_delayed_payment_base;
6480 FREE((void*)broadcaster_delayed_payment_base);
6481 LDKPublicKey broadcaster_htlc_base_conv = *(LDKPublicKey*)broadcaster_htlc_base;
6482 FREE((void*)broadcaster_htlc_base);
6483 LDKPublicKey countersignatory_revocation_base_conv = *(LDKPublicKey*)countersignatory_revocation_base;
6484 FREE((void*)countersignatory_revocation_base);
6485 LDKPublicKey countersignatory_htlc_base_conv = *(LDKPublicKey*)countersignatory_htlc_base;
6486 FREE((void*)countersignatory_htlc_base);
6487 LDKCResult_TxCreationKeysSecpErrorZ* ret = MALLOC(sizeof(LDKCResult_TxCreationKeysSecpErrorZ), "LDKCResult_TxCreationKeysSecpErrorZ");
6488 *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);
6492 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) {
6493 LDKPublicKey revocation_key_conv = *(LDKPublicKey*)revocation_key;
6494 FREE((void*)revocation_key);
6495 LDKPublicKey broadcaster_delayed_payment_key_conv = *(LDKPublicKey*)broadcaster_delayed_payment_key;
6496 FREE((void*)broadcaster_delayed_payment_key);
6497 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6498 *ret = get_revokeable_redeemscript(revocation_key_conv, contest_delay, broadcaster_delayed_payment_key_conv);
6502 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6503 LDKHTLCOutputInCommitment this_ptr_conv = *(LDKHTLCOutputInCommitment*)this_ptr;
6504 FREE((void*)this_ptr);
6505 this_ptr_conv.is_owned = true;
6506 return HTLCOutputInCommitment_free(this_ptr_conv);
6509 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1offered(JNIEnv * _env, jclass _b, jlong this_ptr) {
6510 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
6511 return HTLCOutputInCommitment_get_offered(this_ptr_conv);
6514 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1offered(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
6515 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
6516 return HTLCOutputInCommitment_set_offered(this_ptr_conv, val);
6519 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
6520 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
6521 return HTLCOutputInCommitment_get_amount_msat(this_ptr_conv);
6524 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6525 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
6526 return HTLCOutputInCommitment_set_amount_msat(this_ptr_conv, val);
6529 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr) {
6530 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
6531 return HTLCOutputInCommitment_get_cltv_expiry(this_ptr_conv);
6534 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6535 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
6536 return HTLCOutputInCommitment_set_cltv_expiry(this_ptr_conv, val);
6539 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
6540 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
6541 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6542 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *HTLCOutputInCommitment_get_payment_hash(this_ptr_conv));
6546 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6547 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
6548 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
6550 return HTLCOutputInCommitment_set_payment_hash(this_ptr_conv, val_conv);
6553 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1write(JNIEnv * _env, jclass _b, jlong obj) {
6554 LDKHTLCOutputInCommitment* obj_conv = (LDKHTLCOutputInCommitment*)obj;
6555 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6556 *ret = HTLCOutputInCommitment_write(obj_conv);
6560 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1read(JNIEnv * _env, jclass _b, jlong ser) {
6561 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6563 LDKHTLCOutputInCommitment* ret = MALLOC(sizeof(LDKHTLCOutputInCommitment), "LDKHTLCOutputInCommitment");
6564 *ret = HTLCOutputInCommitment_read(ser_conv);
6565 assert(ret->is_owned);
6566 ret->is_owned = false;
6570 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_get_1htlc_1redeemscript(JNIEnv * _env, jclass _b, jlong htlc, jlong keys) {
6571 LDKHTLCOutputInCommitment* htlc_conv = (LDKHTLCOutputInCommitment*)htlc;
6572 LDKTxCreationKeys* keys_conv = (LDKTxCreationKeys*)keys;
6573 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6574 *ret = get_htlc_redeemscript(htlc_conv, keys_conv);
6578 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_make_1funding_1redeemscript(JNIEnv * _env, jclass _b, jlong broadcaster, jlong countersignatory) {
6579 LDKPublicKey broadcaster_conv = *(LDKPublicKey*)broadcaster;
6580 FREE((void*)broadcaster);
6581 LDKPublicKey countersignatory_conv = *(LDKPublicKey*)countersignatory;
6582 FREE((void*)countersignatory);
6583 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6584 *ret = make_funding_redeemscript(broadcaster_conv, countersignatory_conv);
6588 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) {
6589 unsigned char prev_hash_arr[32];
6590 (*_env)->GetByteArrayRegion (_env, prev_hash, 0, 32, prev_hash_arr);
6591 unsigned char (*prev_hash_ref)[32] = &prev_hash_arr;
6592 LDKHTLCOutputInCommitment* htlc_conv = (LDKHTLCOutputInCommitment*)htlc;
6593 LDKPublicKey broadcaster_delayed_payment_key_conv = *(LDKPublicKey*)broadcaster_delayed_payment_key;
6594 FREE((void*)broadcaster_delayed_payment_key);
6595 LDKPublicKey revocation_key_conv = *(LDKPublicKey*)revocation_key;
6596 FREE((void*)revocation_key);
6597 LDKTransaction* ret = MALLOC(sizeof(LDKTransaction), "LDKTransaction");
6598 *ret = build_htlc_transaction(prev_hash_ref, feerate_per_kw, contest_delay, htlc_conv, broadcaster_delayed_payment_key_conv, revocation_key_conv);
6602 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6603 LDKHolderCommitmentTransaction this_ptr_conv = *(LDKHolderCommitmentTransaction*)this_ptr;
6604 FREE((void*)this_ptr);
6605 this_ptr_conv.is_owned = true;
6606 return HolderCommitmentTransaction_free(this_ptr_conv);
6609 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1unsigned_1tx(JNIEnv * _env, jclass _b, jlong this_ptr) {
6610 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
6611 LDKTransaction* ret = MALLOC(sizeof(LDKTransaction), "LDKTransaction");
6612 *ret = HolderCommitmentTransaction_get_unsigned_tx(this_ptr_conv);
6616 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1unsigned_1tx(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6617 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
6618 LDKTransaction val_conv = *(LDKTransaction*)val;
6620 return HolderCommitmentTransaction_set_unsigned_tx(this_ptr_conv, val_conv);
6623 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1counterparty_1sig(JNIEnv * _env, jclass _b, jlong this_ptr) {
6624 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
6625 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
6626 *ret = HolderCommitmentTransaction_get_counterparty_sig(this_ptr_conv);
6630 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1sig(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6631 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
6632 LDKSignature val_conv = *(LDKSignature*)val;
6634 return HolderCommitmentTransaction_set_counterparty_sig(this_ptr_conv, val_conv);
6637 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr) {
6638 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
6639 return HolderCommitmentTransaction_get_feerate_per_kw(this_ptr_conv);
6642 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6643 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
6644 return HolderCommitmentTransaction_set_feerate_per_kw(this_ptr_conv, val);
6647 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1per_1htlc(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6648 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
6649 LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ val_conv = *(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ*)val;
6651 return HolderCommitmentTransaction_set_per_htlc(this_ptr_conv, val_conv);
6654 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) {
6655 LDKTransaction unsigned_tx_conv = *(LDKTransaction*)unsigned_tx;
6656 FREE((void*)unsigned_tx);
6657 LDKSignature counterparty_sig_conv = *(LDKSignature*)counterparty_sig;
6658 FREE((void*)counterparty_sig);
6659 LDKPublicKey holder_funding_key_conv = *(LDKPublicKey*)holder_funding_key;
6660 FREE((void*)holder_funding_key);
6661 LDKPublicKey counterparty_funding_key_conv = *(LDKPublicKey*)counterparty_funding_key;
6662 FREE((void*)counterparty_funding_key);
6663 LDKTxCreationKeys keys_conv = *(LDKTxCreationKeys*)keys;
6665 keys_conv.is_owned = true;
6666 LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ htlc_data_conv = *(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ*)htlc_data;
6667 FREE((void*)htlc_data);
6668 LDKHolderCommitmentTransaction* ret = MALLOC(sizeof(LDKHolderCommitmentTransaction), "LDKHolderCommitmentTransaction");
6669 *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);
6670 assert(ret->is_owned);
6671 ret->is_owned = false;
6675 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1trust_1key_1derivation(JNIEnv * _env, jclass _b, jlong this_arg) {
6676 LDKHolderCommitmentTransaction* this_arg_conv = (LDKHolderCommitmentTransaction*)this_arg;
6677 LDKTxCreationKeys* ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
6678 *ret = HolderCommitmentTransaction_trust_key_derivation(this_arg_conv);
6679 assert(ret->is_owned);
6680 ret->is_owned = false;
6684 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1txid(JNIEnv * _env, jclass _b, jlong this_arg) {
6685 LDKHolderCommitmentTransaction* this_arg_conv = (LDKHolderCommitmentTransaction*)this_arg;
6686 LDKThirtyTwoBytes* ret = MALLOC(sizeof(LDKThirtyTwoBytes), "LDKThirtyTwoBytes");
6687 *ret = HolderCommitmentTransaction_txid(this_arg_conv);
6691 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) {
6692 LDKHolderCommitmentTransaction* this_arg_conv = (LDKHolderCommitmentTransaction*)this_arg;
6693 unsigned char funding_key_arr[32];
6694 (*_env)->GetByteArrayRegion (_env, funding_key, 0, 32, funding_key_arr);
6695 unsigned char (*funding_key_ref)[32] = &funding_key_arr;
6696 LDKu8slice funding_redeemscript_conv = *(LDKu8slice*)funding_redeemscript;
6697 FREE((void*)funding_redeemscript);
6698 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
6699 *ret = HolderCommitmentTransaction_get_holder_sig(this_arg_conv, funding_key_ref, funding_redeemscript_conv, channel_value_satoshis);
6703 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) {
6704 LDKHolderCommitmentTransaction* this_arg_conv = (LDKHolderCommitmentTransaction*)this_arg;
6705 unsigned char htlc_base_key_arr[32];
6706 (*_env)->GetByteArrayRegion (_env, htlc_base_key, 0, 32, htlc_base_key_arr);
6707 unsigned char (*htlc_base_key_ref)[32] = &htlc_base_key_arr;
6708 LDKCResult_CVec_SignatureZNoneZ* ret = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
6709 *ret = HolderCommitmentTransaction_get_htlc_sigs(this_arg_conv, htlc_base_key_ref, counterparty_selected_contest_delay);
6713 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1write(JNIEnv * _env, jclass _b, jlong obj) {
6714 LDKHolderCommitmentTransaction* obj_conv = (LDKHolderCommitmentTransaction*)obj;
6715 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6716 *ret = HolderCommitmentTransaction_write(obj_conv);
6720 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1read(JNIEnv * _env, jclass _b, jlong ser) {
6721 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6723 LDKHolderCommitmentTransaction* ret = MALLOC(sizeof(LDKHolderCommitmentTransaction), "LDKHolderCommitmentTransaction");
6724 *ret = HolderCommitmentTransaction_read(ser_conv);
6725 assert(ret->is_owned);
6726 ret->is_owned = false;
6730 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6731 LDKInitFeatures this_ptr_conv = *(LDKInitFeatures*)this_ptr;
6732 FREE((void*)this_ptr);
6733 this_ptr_conv.is_owned = true;
6734 return InitFeatures_free(this_ptr_conv);
6737 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6738 LDKNodeFeatures this_ptr_conv = *(LDKNodeFeatures*)this_ptr;
6739 FREE((void*)this_ptr);
6740 this_ptr_conv.is_owned = true;
6741 return NodeFeatures_free(this_ptr_conv);
6744 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6745 LDKChannelFeatures this_ptr_conv = *(LDKChannelFeatures*)this_ptr;
6746 FREE((void*)this_ptr);
6747 this_ptr_conv.is_owned = true;
6748 return ChannelFeatures_free(this_ptr_conv);
6751 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6752 LDKRouteHop this_ptr_conv = *(LDKRouteHop*)this_ptr;
6753 FREE((void*)this_ptr);
6754 this_ptr_conv.is_owned = true;
6755 return RouteHop_free(this_ptr_conv);
6758 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
6759 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6760 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6761 *ret = RouteHop_get_pubkey(this_ptr_conv);
6765 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6766 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6767 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6769 return RouteHop_set_pubkey(this_ptr_conv, val_conv);
6772 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1node_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
6773 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6774 LDKNodeFeatures* ret = MALLOC(sizeof(LDKNodeFeatures), "LDKNodeFeatures");
6775 *ret = RouteHop_get_node_features(this_ptr_conv);
6776 assert(ret->is_owned);
6777 ret->is_owned = false;
6781 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1node_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6782 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6783 LDKNodeFeatures val_conv = *(LDKNodeFeatures*)val;
6785 val_conv.is_owned = true;
6786 return RouteHop_set_node_features(this_ptr_conv, val_conv);
6789 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6790 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6791 return RouteHop_get_short_channel_id(this_ptr_conv);
6794 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6795 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6796 return RouteHop_set_short_channel_id(this_ptr_conv, val);
6799 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1channel_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
6800 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6801 LDKChannelFeatures* ret = MALLOC(sizeof(LDKChannelFeatures), "LDKChannelFeatures");
6802 *ret = RouteHop_get_channel_features(this_ptr_conv);
6803 assert(ret->is_owned);
6804 ret->is_owned = false;
6808 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1channel_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6809 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6810 LDKChannelFeatures val_conv = *(LDKChannelFeatures*)val;
6812 val_conv.is_owned = true;
6813 return RouteHop_set_channel_features(this_ptr_conv, val_conv);
6816 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1fee_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
6817 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6818 return RouteHop_get_fee_msat(this_ptr_conv);
6821 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1fee_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6822 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6823 return RouteHop_set_fee_msat(this_ptr_conv, val);
6826 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
6827 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6828 return RouteHop_get_cltv_expiry_delta(this_ptr_conv);
6831 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6832 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6833 return RouteHop_set_cltv_expiry_delta(this_ptr_conv, val);
6836 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) {
6837 LDKPublicKey pubkey_arg_conv = *(LDKPublicKey*)pubkey_arg;
6838 FREE((void*)pubkey_arg);
6839 LDKNodeFeatures node_features_arg_conv = *(LDKNodeFeatures*)node_features_arg;
6840 FREE((void*)node_features_arg);
6841 node_features_arg_conv.is_owned = true;
6842 LDKChannelFeatures channel_features_arg_conv = *(LDKChannelFeatures*)channel_features_arg;
6843 FREE((void*)channel_features_arg);
6844 channel_features_arg_conv.is_owned = true;
6845 LDKRouteHop* ret = MALLOC(sizeof(LDKRouteHop), "LDKRouteHop");
6846 *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);
6847 assert(ret->is_owned);
6848 ret->is_owned = false;
6852 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6853 LDKRoute this_ptr_conv = *(LDKRoute*)this_ptr;
6854 FREE((void*)this_ptr);
6855 this_ptr_conv.is_owned = true;
6856 return Route_free(this_ptr_conv);
6859 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1paths(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6860 LDKRoute* this_ptr_conv = (LDKRoute*)this_ptr;
6861 LDKCVec_CVec_RouteHopZZ val_conv = *(LDKCVec_CVec_RouteHopZZ*)val;
6863 return Route_set_paths(this_ptr_conv, val_conv);
6866 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv * _env, jclass _b, jlong paths_arg) {
6867 LDKCVec_CVec_RouteHopZZ paths_arg_conv = *(LDKCVec_CVec_RouteHopZZ*)paths_arg;
6868 FREE((void*)paths_arg);
6869 LDKRoute* ret = MALLOC(sizeof(LDKRoute), "LDKRoute");
6870 *ret = Route_new(paths_arg_conv);
6871 assert(ret->is_owned);
6872 ret->is_owned = false;
6876 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1write(JNIEnv * _env, jclass _b, jlong obj) {
6877 LDKRoute* obj_conv = (LDKRoute*)obj;
6878 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6879 *ret = Route_write(obj_conv);
6883 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1read(JNIEnv * _env, jclass _b, jlong ser) {
6884 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6886 LDKRoute* ret = MALLOC(sizeof(LDKRoute), "LDKRoute");
6887 *ret = Route_read(ser_conv);
6888 assert(ret->is_owned);
6889 ret->is_owned = false;
6893 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6894 LDKRouteHint this_ptr_conv = *(LDKRouteHint*)this_ptr;
6895 FREE((void*)this_ptr);
6896 this_ptr_conv.is_owned = true;
6897 return RouteHint_free(this_ptr_conv);
6900 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1src_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6901 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6902 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6903 *ret = RouteHint_get_src_node_id(this_ptr_conv);
6907 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1src_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6908 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6909 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6911 return RouteHint_set_src_node_id(this_ptr_conv, val_conv);
6914 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6915 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6916 return RouteHint_get_short_channel_id(this_ptr_conv);
6919 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6920 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6921 return RouteHint_set_short_channel_id(this_ptr_conv, val);
6924 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1fees(JNIEnv * _env, jclass _b, jlong this_ptr) {
6925 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6926 LDKRoutingFees* ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
6927 *ret = RouteHint_get_fees(this_ptr_conv);
6928 assert(ret->is_owned);
6929 ret->is_owned = false;
6933 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1fees(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6934 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6935 LDKRoutingFees val_conv = *(LDKRoutingFees*)val;
6937 val_conv.is_owned = true;
6938 return RouteHint_set_fees(this_ptr_conv, val_conv);
6941 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
6942 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6943 return RouteHint_get_cltv_expiry_delta(this_ptr_conv);
6946 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
6947 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6948 return RouteHint_set_cltv_expiry_delta(this_ptr_conv, val);
6951 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
6952 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6953 return RouteHint_get_htlc_minimum_msat(this_ptr_conv);
6956 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6957 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
6958 return RouteHint_set_htlc_minimum_msat(this_ptr_conv, val);
6961 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) {
6962 LDKPublicKey src_node_id_arg_conv = *(LDKPublicKey*)src_node_id_arg;
6963 FREE((void*)src_node_id_arg);
6964 LDKRoutingFees fees_arg_conv = *(LDKRoutingFees*)fees_arg;
6965 FREE((void*)fees_arg);
6966 fees_arg_conv.is_owned = true;
6967 LDKRouteHint* ret = MALLOC(sizeof(LDKRouteHint), "LDKRouteHint");
6968 *ret = RouteHint_new(src_node_id_arg_conv, short_channel_id_arg, fees_arg_conv, cltv_expiry_delta_arg, htlc_minimum_msat_arg);
6969 assert(ret->is_owned);
6970 ret->is_owned = false;
6974 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) {
6975 LDKPublicKey our_node_id_conv = *(LDKPublicKey*)our_node_id;
6976 FREE((void*)our_node_id);
6977 LDKNetworkGraph* network_conv = (LDKNetworkGraph*)network;
6978 LDKPublicKey target_conv = *(LDKPublicKey*)target;
6979 FREE((void*)target);
6980 LDKCVec_ChannelDetailsZ* first_hops_conv = (LDKCVec_ChannelDetailsZ*)first_hops;
6981 LDKCVec_RouteHintZ last_hops_conv = *(LDKCVec_RouteHintZ*)last_hops;
6982 FREE((void*)last_hops);
6983 LDKLogger logger_conv = *(LDKLogger*)logger;
6984 if (logger_conv.free == LDKLogger_JCalls_free) {
6985 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
6986 LDKLogger_JCalls_clone(logger_conv.this_arg);
6988 LDKCResult_RouteLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
6989 *ret = get_route(our_node_id_conv, network_conv, target_conv, first_hops_conv, last_hops_conv, final_value_msat, final_cltv, logger_conv);
6993 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6994 LDKNetworkGraph this_ptr_conv = *(LDKNetworkGraph*)this_ptr;
6995 FREE((void*)this_ptr);
6996 this_ptr_conv.is_owned = true;
6997 return NetworkGraph_free(this_ptr_conv);
7000 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockedNetworkGraph_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7001 LDKLockedNetworkGraph this_ptr_conv = *(LDKLockedNetworkGraph*)this_ptr;
7002 FREE((void*)this_ptr);
7003 this_ptr_conv.is_owned = true;
7004 return LockedNetworkGraph_free(this_ptr_conv);
7007 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7008 LDKNetGraphMsgHandler this_ptr_conv = *(LDKNetGraphMsgHandler*)this_ptr;
7009 FREE((void*)this_ptr);
7010 this_ptr_conv.is_owned = true;
7011 return NetGraphMsgHandler_free(this_ptr_conv);
7014 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new(JNIEnv * _env, jclass _b, jlong chain_access, jlong logger) {
7015 LDKAccess* chain_access_conv = (LDKAccess*)chain_access;
7016 LDKLogger logger_conv = *(LDKLogger*)logger;
7017 if (logger_conv.free == LDKLogger_JCalls_free) {
7018 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
7019 LDKLogger_JCalls_clone(logger_conv.this_arg);
7021 LDKNetGraphMsgHandler* ret = MALLOC(sizeof(LDKNetGraphMsgHandler), "LDKNetGraphMsgHandler");
7022 *ret = NetGraphMsgHandler_new(chain_access_conv, logger_conv);
7023 assert(ret->is_owned);
7024 ret->is_owned = false;
7028 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1from_1net_1graph(JNIEnv * _env, jclass _b, jlong chain_access, jlong logger, jlong network_graph) {
7029 LDKAccess* chain_access_conv = (LDKAccess*)chain_access;
7030 LDKLogger logger_conv = *(LDKLogger*)logger;
7031 if (logger_conv.free == LDKLogger_JCalls_free) {
7032 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
7033 LDKLogger_JCalls_clone(logger_conv.this_arg);
7035 LDKNetworkGraph network_graph_conv = *(LDKNetworkGraph*)network_graph;
7036 FREE((void*)network_graph);
7037 network_graph_conv.is_owned = true;
7038 LDKNetGraphMsgHandler* ret = MALLOC(sizeof(LDKNetGraphMsgHandler), "LDKNetGraphMsgHandler");
7039 *ret = NetGraphMsgHandler_from_net_graph(chain_access_conv, logger_conv, network_graph_conv);
7040 assert(ret->is_owned);
7041 ret->is_owned = false;
7045 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1read_1locked_1graph(JNIEnv * _env, jclass _b, jlong this_arg) {
7046 LDKNetGraphMsgHandler* this_arg_conv = (LDKNetGraphMsgHandler*)this_arg;
7047 LDKLockedNetworkGraph* ret = MALLOC(sizeof(LDKLockedNetworkGraph), "LDKLockedNetworkGraph");
7048 *ret = NetGraphMsgHandler_read_locked_graph(this_arg_conv);
7049 assert(ret->is_owned);
7050 ret->is_owned = false;
7054 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LockedNetworkGraph_1graph(JNIEnv * _env, jclass _b, jlong this_arg) {
7055 LDKLockedNetworkGraph* this_arg_conv = (LDKLockedNetworkGraph*)this_arg;
7056 LDKNetworkGraph* ret = MALLOC(sizeof(LDKNetworkGraph), "LDKNetworkGraph");
7057 *ret = LockedNetworkGraph_graph(this_arg_conv);
7058 assert(ret->is_owned);
7059 ret->is_owned = false;
7063 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1RoutingMessageHandler(JNIEnv * _env, jclass _b, jlong this_arg) {
7064 LDKNetGraphMsgHandler* this_arg_conv = (LDKNetGraphMsgHandler*)this_arg;
7065 LDKRoutingMessageHandler* ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
7066 *ret = NetGraphMsgHandler_as_RoutingMessageHandler(this_arg_conv);
7070 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7071 LDKDirectionalChannelInfo this_ptr_conv = *(LDKDirectionalChannelInfo*)this_ptr;
7072 FREE((void*)this_ptr);
7073 this_ptr_conv.is_owned = true;
7074 return DirectionalChannelInfo_free(this_ptr_conv);
7077 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr) {
7078 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7079 return DirectionalChannelInfo_get_last_update(this_ptr_conv);
7082 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
7083 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7084 return DirectionalChannelInfo_set_last_update(this_ptr_conv, val);
7087 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1enabled(JNIEnv * _env, jclass _b, jlong this_ptr) {
7088 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7089 return DirectionalChannelInfo_get_enabled(this_ptr_conv);
7092 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1enabled(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
7093 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7094 return DirectionalChannelInfo_set_enabled(this_ptr_conv, val);
7097 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
7098 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7099 return DirectionalChannelInfo_get_cltv_expiry_delta(this_ptr_conv);
7102 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
7103 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7104 return DirectionalChannelInfo_set_cltv_expiry_delta(this_ptr_conv, val);
7107 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
7108 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7109 return DirectionalChannelInfo_get_htlc_minimum_msat(this_ptr_conv);
7112 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7113 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7114 return DirectionalChannelInfo_set_htlc_minimum_msat(this_ptr_conv, val);
7117 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1last_1update_1message(JNIEnv * _env, jclass _b, jlong this_ptr) {
7118 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7119 LDKChannelUpdate* ret = MALLOC(sizeof(LDKChannelUpdate), "LDKChannelUpdate");
7120 *ret = DirectionalChannelInfo_get_last_update_message(this_ptr_conv);
7121 assert(ret->is_owned);
7122 ret->is_owned = false;
7126 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1last_1update_1message(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7127 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7128 LDKChannelUpdate val_conv = *(LDKChannelUpdate*)val;
7130 val_conv.is_owned = true;
7131 return DirectionalChannelInfo_set_last_update_message(this_ptr_conv, val_conv);
7134 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
7135 LDKDirectionalChannelInfo* obj_conv = (LDKDirectionalChannelInfo*)obj;
7136 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7137 *ret = DirectionalChannelInfo_write(obj_conv);
7141 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
7142 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7144 LDKDirectionalChannelInfo* ret = MALLOC(sizeof(LDKDirectionalChannelInfo), "LDKDirectionalChannelInfo");
7145 *ret = DirectionalChannelInfo_read(ser_conv);
7146 assert(ret->is_owned);
7147 ret->is_owned = false;
7151 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7152 LDKChannelInfo this_ptr_conv = *(LDKChannelInfo*)this_ptr;
7153 FREE((void*)this_ptr);
7154 this_ptr_conv.is_owned = true;
7155 return ChannelInfo_free(this_ptr_conv);
7158 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
7159 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7160 LDKChannelFeatures* ret = MALLOC(sizeof(LDKChannelFeatures), "LDKChannelFeatures");
7161 *ret = ChannelInfo_get_features(this_ptr_conv);
7162 assert(ret->is_owned);
7163 ret->is_owned = false;
7167 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7168 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7169 LDKChannelFeatures val_conv = *(LDKChannelFeatures*)val;
7171 val_conv.is_owned = true;
7172 return ChannelInfo_set_features(this_ptr_conv, val_conv);
7175 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1one(JNIEnv * _env, jclass _b, jlong this_ptr) {
7176 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7177 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
7178 *ret = ChannelInfo_get_node_one(this_ptr_conv);
7182 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1one(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7183 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7184 LDKPublicKey val_conv = *(LDKPublicKey*)val;
7186 return ChannelInfo_set_node_one(this_ptr_conv, val_conv);
7189 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1one_1to_1two(JNIEnv * _env, jclass _b, jlong this_ptr) {
7190 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7191 LDKDirectionalChannelInfo* ret = MALLOC(sizeof(LDKDirectionalChannelInfo), "LDKDirectionalChannelInfo");
7192 *ret = ChannelInfo_get_one_to_two(this_ptr_conv);
7193 assert(ret->is_owned);
7194 ret->is_owned = false;
7198 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1one_1to_1two(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7199 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7200 LDKDirectionalChannelInfo val_conv = *(LDKDirectionalChannelInfo*)val;
7202 val_conv.is_owned = true;
7203 return ChannelInfo_set_one_to_two(this_ptr_conv, val_conv);
7206 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1two(JNIEnv * _env, jclass _b, jlong this_ptr) {
7207 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7208 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
7209 *ret = ChannelInfo_get_node_two(this_ptr_conv);
7213 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1two(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7214 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7215 LDKPublicKey val_conv = *(LDKPublicKey*)val;
7217 return ChannelInfo_set_node_two(this_ptr_conv, val_conv);
7220 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1two_1to_1one(JNIEnv * _env, jclass _b, jlong this_ptr) {
7221 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7222 LDKDirectionalChannelInfo* ret = MALLOC(sizeof(LDKDirectionalChannelInfo), "LDKDirectionalChannelInfo");
7223 *ret = ChannelInfo_get_two_to_one(this_ptr_conv);
7224 assert(ret->is_owned);
7225 ret->is_owned = false;
7229 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1two_1to_1one(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7230 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7231 LDKDirectionalChannelInfo val_conv = *(LDKDirectionalChannelInfo*)val;
7233 val_conv.is_owned = true;
7234 return ChannelInfo_set_two_to_one(this_ptr_conv, val_conv);
7237 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1announcement_1message(JNIEnv * _env, jclass _b, jlong this_ptr) {
7238 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7239 LDKChannelAnnouncement* ret = MALLOC(sizeof(LDKChannelAnnouncement), "LDKChannelAnnouncement");
7240 *ret = ChannelInfo_get_announcement_message(this_ptr_conv);
7241 assert(ret->is_owned);
7242 ret->is_owned = false;
7246 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1announcement_1message(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7247 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7248 LDKChannelAnnouncement val_conv = *(LDKChannelAnnouncement*)val;
7250 val_conv.is_owned = true;
7251 return ChannelInfo_set_announcement_message(this_ptr_conv, val_conv);
7254 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
7255 LDKChannelInfo* obj_conv = (LDKChannelInfo*)obj;
7256 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7257 *ret = ChannelInfo_write(obj_conv);
7261 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
7262 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7264 LDKChannelInfo* ret = MALLOC(sizeof(LDKChannelInfo), "LDKChannelInfo");
7265 *ret = ChannelInfo_read(ser_conv);
7266 assert(ret->is_owned);
7267 ret->is_owned = false;
7271 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7272 LDKRoutingFees this_ptr_conv = *(LDKRoutingFees*)this_ptr;
7273 FREE((void*)this_ptr);
7274 this_ptr_conv.is_owned = true;
7275 return RoutingFees_free(this_ptr_conv);
7278 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
7279 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
7280 return RoutingFees_get_base_msat(this_ptr_conv);
7283 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
7284 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
7285 return RoutingFees_set_base_msat(this_ptr_conv, val);
7288 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr) {
7289 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
7290 return RoutingFees_get_proportional_millionths(this_ptr_conv);
7293 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
7294 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
7295 return RoutingFees_set_proportional_millionths(this_ptr_conv, val);
7298 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1new(JNIEnv * _env, jclass _b, jint base_msat_arg, jint proportional_millionths_arg) {
7299 LDKRoutingFees* ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
7300 *ret = RoutingFees_new(base_msat_arg, proportional_millionths_arg);
7301 assert(ret->is_owned);
7302 ret->is_owned = false;
7306 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1read(JNIEnv * _env, jclass _b, jlong ser) {
7307 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7309 LDKRoutingFees* ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
7310 *ret = RoutingFees_read(ser_conv);
7311 assert(ret->is_owned);
7312 ret->is_owned = false;
7316 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1write(JNIEnv * _env, jclass _b, jlong obj) {
7317 LDKRoutingFees* obj_conv = (LDKRoutingFees*)obj;
7318 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7319 *ret = RoutingFees_write(obj_conv);
7323 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7324 LDKNodeAnnouncementInfo this_ptr_conv = *(LDKNodeAnnouncementInfo*)this_ptr;
7325 FREE((void*)this_ptr);
7326 this_ptr_conv.is_owned = true;
7327 return NodeAnnouncementInfo_free(this_ptr_conv);
7330 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
7331 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
7332 LDKNodeFeatures* ret = MALLOC(sizeof(LDKNodeFeatures), "LDKNodeFeatures");
7333 *ret = NodeAnnouncementInfo_get_features(this_ptr_conv);
7334 assert(ret->is_owned);
7335 ret->is_owned = false;
7339 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7340 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
7341 LDKNodeFeatures val_conv = *(LDKNodeFeatures*)val;
7343 val_conv.is_owned = true;
7344 return NodeAnnouncementInfo_set_features(this_ptr_conv, val_conv);
7347 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr) {
7348 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
7349 return NodeAnnouncementInfo_get_last_update(this_ptr_conv);
7352 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
7353 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
7354 return NodeAnnouncementInfo_set_last_update(this_ptr_conv, val);
7357 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr) {
7358 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
7359 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 3);
7360 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 3, *NodeAnnouncementInfo_get_rgb(this_ptr_conv));
7364 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7365 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
7366 LDKThreeBytes val_conv = *(LDKThreeBytes*)val;
7368 return NodeAnnouncementInfo_set_rgb(this_ptr_conv, val_conv);
7371 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1alias(JNIEnv * _env, jclass _b, jlong this_ptr) {
7372 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
7373 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
7374 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *NodeAnnouncementInfo_get_alias(this_ptr_conv));
7378 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1alias(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7379 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
7380 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
7382 return NodeAnnouncementInfo_set_alias(this_ptr_conv, val_conv);
7385 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1addresses(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7386 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
7387 LDKCVec_NetAddressZ val_conv = *(LDKCVec_NetAddressZ*)val;
7389 return NodeAnnouncementInfo_set_addresses(this_ptr_conv, val_conv);
7392 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1announcement_1message(JNIEnv * _env, jclass _b, jlong this_ptr) {
7393 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
7394 LDKNodeAnnouncement* ret = MALLOC(sizeof(LDKNodeAnnouncement), "LDKNodeAnnouncement");
7395 *ret = NodeAnnouncementInfo_get_announcement_message(this_ptr_conv);
7396 assert(ret->is_owned);
7397 ret->is_owned = false;
7401 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1announcement_1message(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7402 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
7403 LDKNodeAnnouncement val_conv = *(LDKNodeAnnouncement*)val;
7405 val_conv.is_owned = true;
7406 return NodeAnnouncementInfo_set_announcement_message(this_ptr_conv, val_conv);
7409 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) {
7410 LDKNodeFeatures features_arg_conv = *(LDKNodeFeatures*)features_arg;
7411 FREE((void*)features_arg);
7412 features_arg_conv.is_owned = true;
7413 LDKThreeBytes rgb_arg_conv = *(LDKThreeBytes*)rgb_arg;
7414 FREE((void*)rgb_arg);
7415 LDKThirtyTwoBytes alias_arg_conv = *(LDKThirtyTwoBytes*)alias_arg;
7416 FREE((void*)alias_arg);
7417 LDKCVec_NetAddressZ addresses_arg_conv = *(LDKCVec_NetAddressZ*)addresses_arg;
7418 FREE((void*)addresses_arg);
7419 LDKNodeAnnouncement announcement_message_arg_conv = *(LDKNodeAnnouncement*)announcement_message_arg;
7420 FREE((void*)announcement_message_arg);
7421 announcement_message_arg_conv.is_owned = true;
7422 LDKNodeAnnouncementInfo* ret = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo");
7423 *ret = NodeAnnouncementInfo_new(features_arg_conv, last_update_arg, rgb_arg_conv, alias_arg_conv, addresses_arg_conv, announcement_message_arg_conv);
7424 assert(ret->is_owned);
7425 ret->is_owned = false;
7429 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
7430 LDKNodeAnnouncementInfo* obj_conv = (LDKNodeAnnouncementInfo*)obj;
7431 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7432 *ret = NodeAnnouncementInfo_write(obj_conv);
7436 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
7437 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7439 LDKNodeAnnouncementInfo* ret = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo");
7440 *ret = NodeAnnouncementInfo_read(ser_conv);
7441 assert(ret->is_owned);
7442 ret->is_owned = false;
7446 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7447 LDKNodeInfo this_ptr_conv = *(LDKNodeInfo*)this_ptr;
7448 FREE((void*)this_ptr);
7449 this_ptr_conv.is_owned = true;
7450 return NodeInfo_free(this_ptr_conv);
7453 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1channels(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7454 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
7455 LDKCVec_u64Z val_conv = *(LDKCVec_u64Z*)val;
7457 return NodeInfo_set_channels(this_ptr_conv, val_conv);
7460 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1lowest_1inbound_1channel_1fees(JNIEnv * _env, jclass _b, jlong this_ptr) {
7461 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
7462 LDKRoutingFees* ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
7463 *ret = NodeInfo_get_lowest_inbound_channel_fees(this_ptr_conv);
7464 assert(ret->is_owned);
7465 ret->is_owned = false;
7469 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1lowest_1inbound_1channel_1fees(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7470 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
7471 LDKRoutingFees val_conv = *(LDKRoutingFees*)val;
7473 val_conv.is_owned = true;
7474 return NodeInfo_set_lowest_inbound_channel_fees(this_ptr_conv, val_conv);
7477 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1announcement_1info(JNIEnv * _env, jclass _b, jlong this_ptr) {
7478 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
7479 LDKNodeAnnouncementInfo* ret = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo");
7480 *ret = NodeInfo_get_announcement_info(this_ptr_conv);
7481 assert(ret->is_owned);
7482 ret->is_owned = false;
7486 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1announcement_1info(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7487 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
7488 LDKNodeAnnouncementInfo val_conv = *(LDKNodeAnnouncementInfo*)val;
7490 val_conv.is_owned = true;
7491 return NodeInfo_set_announcement_info(this_ptr_conv, val_conv);
7494 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) {
7495 LDKCVec_u64Z channels_arg_conv = *(LDKCVec_u64Z*)channels_arg;
7496 FREE((void*)channels_arg);
7497 LDKRoutingFees lowest_inbound_channel_fees_arg_conv = *(LDKRoutingFees*)lowest_inbound_channel_fees_arg;
7498 FREE((void*)lowest_inbound_channel_fees_arg);
7499 lowest_inbound_channel_fees_arg_conv.is_owned = true;
7500 LDKNodeAnnouncementInfo announcement_info_arg_conv = *(LDKNodeAnnouncementInfo*)announcement_info_arg;
7501 FREE((void*)announcement_info_arg);
7502 announcement_info_arg_conv.is_owned = true;
7503 LDKNodeInfo* ret = MALLOC(sizeof(LDKNodeInfo), "LDKNodeInfo");
7504 *ret = NodeInfo_new(channels_arg_conv, lowest_inbound_channel_fees_arg_conv, announcement_info_arg_conv);
7505 assert(ret->is_owned);
7506 ret->is_owned = false;
7510 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
7511 LDKNodeInfo* obj_conv = (LDKNodeInfo*)obj;
7512 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7513 *ret = NodeInfo_write(obj_conv);
7517 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
7518 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7520 LDKNodeInfo* ret = MALLOC(sizeof(LDKNodeInfo), "LDKNodeInfo");
7521 *ret = NodeInfo_read(ser_conv);
7522 assert(ret->is_owned);
7523 ret->is_owned = false;
7527 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1write(JNIEnv * _env, jclass _b, jlong obj) {
7528 LDKNetworkGraph* obj_conv = (LDKNetworkGraph*)obj;
7529 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7530 *ret = NetworkGraph_write(obj_conv);
7534 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read(JNIEnv * _env, jclass _b, jlong ser) {
7535 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7537 LDKNetworkGraph* ret = MALLOC(sizeof(LDKNetworkGraph), "LDKNetworkGraph");
7538 *ret = NetworkGraph_read(ser_conv);
7539 assert(ret->is_owned);
7540 ret->is_owned = false;
7544 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new(JNIEnv * _env, jclass _b) {
7545 LDKNetworkGraph* ret = MALLOC(sizeof(LDKNetworkGraph), "LDKNetworkGraph");
7546 *ret = NetworkGraph_new();
7547 assert(ret->is_owned);
7548 ret->is_owned = false;
7552 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) {
7553 LDKNetworkGraph* this_arg_conv = (LDKNetworkGraph*)this_arg;
7554 return NetworkGraph_close_channel_from_update(this_arg_conv, short_channel_id, is_permanent);