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 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
256 return ((LDKCResult_NoneChannelMonitorUpdateErrZ*)arg)->result_ok;
258 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneChannelMonitorUpdateErrZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
259 if (((LDKCResult_NoneChannelMonitorUpdateErrZ*)arg)->result_ok) {
260 return (long)((LDKCResult_NoneChannelMonitorUpdateErrZ*)arg)->contents.result;
262 return (long)((LDKCResult_NoneChannelMonitorUpdateErrZ*)arg)->contents.err;
265 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
266 return ((LDKCResult_NoneMonitorUpdateErrorZ*)arg)->result_ok;
268 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneMonitorUpdateErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
269 if (((LDKCResult_NoneMonitorUpdateErrorZ*)arg)->result_ok) {
270 return (long)((LDKCResult_NoneMonitorUpdateErrorZ*)arg)->contents.result;
272 return (long)((LDKCResult_NoneMonitorUpdateErrorZ*)arg)->contents.err;
275 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
276 return ((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg)->result_ok;
278 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
279 if (((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg)->result_ok) {
280 return (long)((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg)->contents.result;
282 return (long)((LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg)->contents.err;
285 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignatureNoneZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
286 return ((LDKCResult_SignatureNoneZ*)arg)->result_ok;
288 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SignatureNoneZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
289 if (((LDKCResult_SignatureNoneZ*)arg)->result_ok) {
290 return (long)((LDKCResult_SignatureNoneZ*)arg)->contents.result;
292 return (long)((LDKCResult_SignatureNoneZ*)arg)->contents.err;
295 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
296 return ((LDKCResult_CVec_SignatureZNoneZ*)arg)->result_ok;
298 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1SignatureZNoneZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
299 if (((LDKCResult_CVec_SignatureZNoneZ*)arg)->result_ok) {
300 return (long)((LDKCResult_CVec_SignatureZNoneZ*)arg)->contents.result;
302 return (long)((LDKCResult_CVec_SignatureZNoneZ*)arg)->contents.err;
305 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
306 return ((LDKCResult_NoneAPIErrorZ*)arg)->result_ok;
308 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NoneAPIErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
309 if (((LDKCResult_NoneAPIErrorZ*)arg)->result_ok) {
310 return (long)((LDKCResult_NoneAPIErrorZ*)arg)->contents.result;
312 return (long)((LDKCResult_NoneAPIErrorZ*)arg)->contents.err;
315 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
316 return ((LDKCResult_NonePaymentSendFailureZ*)arg)->result_ok;
318 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePaymentSendFailureZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
319 if (((LDKCResult_NonePaymentSendFailureZ*)arg)->result_ok) {
320 return (long)((LDKCResult_NonePaymentSendFailureZ*)arg)->contents.result;
322 return (long)((LDKCResult_NonePaymentSendFailureZ*)arg)->contents.err;
325 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
326 return ((LDKCResult_NonePeerHandleErrorZ*)arg)->result_ok;
328 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1NonePeerHandleErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
329 if (((LDKCResult_NonePeerHandleErrorZ*)arg)->result_ok) {
330 return (long)((LDKCResult_NonePeerHandleErrorZ*)arg)->contents.result;
332 return (long)((LDKCResult_NonePeerHandleErrorZ*)arg)->contents.err;
335 typedef struct LDKMessageSendEventsProvider_JCalls {
336 atomic_size_t refcnt;
339 jmethodID get_and_clear_pending_msg_events_meth;
340 } LDKMessageSendEventsProvider_JCalls;
341 LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_jcall(const void* this_arg) {
342 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
343 LDKCVec_MessageSendEventZ* ret = (LDKCVec_MessageSendEventZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_and_clear_pending_msg_events_meth);
344 LDKCVec_MessageSendEventZ res = *ret;
348 static void LDKMessageSendEventsProvider_JCalls_free(void* this_arg) {
349 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
350 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
351 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
355 static void* LDKMessageSendEventsProvider_JCalls_clone(const void* this_arg) {
356 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
357 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
358 return (void*) this_arg;
360 static inline LDKMessageSendEventsProvider LDKMessageSendEventsProvider_init (JNIEnv * env, jclass _a, jobject o) {
361 jclass c = (*env)->GetObjectClass(env, o);
363 LDKMessageSendEventsProvider_JCalls *calls = MALLOC(sizeof(LDKMessageSendEventsProvider_JCalls), "LDKMessageSendEventsProvider_JCalls");
364 atomic_init(&calls->refcnt, 1);
366 calls->o = (*env)->NewGlobalRef(env, o);
367 calls->get_and_clear_pending_msg_events_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_msg_events", "()J");
368 assert(calls->get_and_clear_pending_msg_events_meth != NULL);
370 LDKMessageSendEventsProvider ret = {
371 .this_arg = (void*) calls,
372 .get_and_clear_pending_msg_events = get_and_clear_pending_msg_events_jcall,
373 .free = LDKMessageSendEventsProvider_JCalls_free,
377 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1new (JNIEnv * env, jclass _a, jobject o) {
378 LDKMessageSendEventsProvider *res_ptr = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
379 *res_ptr = LDKMessageSendEventsProvider_init(env, _a, o);
380 return (long)res_ptr;
382 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKMessageSendEventsProvider_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
383 return ((LDKMessageSendEventsProvider_JCalls*)val)->o;
385 typedef struct LDKEventsProvider_JCalls {
386 atomic_size_t refcnt;
389 jmethodID get_and_clear_pending_events_meth;
390 } LDKEventsProvider_JCalls;
391 LDKCVec_EventZ get_and_clear_pending_events_jcall(const void* this_arg) {
392 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
393 LDKCVec_EventZ* ret = (LDKCVec_EventZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_and_clear_pending_events_meth);
394 LDKCVec_EventZ res = *ret;
398 static void LDKEventsProvider_JCalls_free(void* this_arg) {
399 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
400 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
401 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
405 static void* LDKEventsProvider_JCalls_clone(const void* this_arg) {
406 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
407 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
408 return (void*) this_arg;
410 static inline LDKEventsProvider LDKEventsProvider_init (JNIEnv * env, jclass _a, jobject o) {
411 jclass c = (*env)->GetObjectClass(env, o);
413 LDKEventsProvider_JCalls *calls = MALLOC(sizeof(LDKEventsProvider_JCalls), "LDKEventsProvider_JCalls");
414 atomic_init(&calls->refcnt, 1);
416 calls->o = (*env)->NewGlobalRef(env, o);
417 calls->get_and_clear_pending_events_meth = (*env)->GetMethodID(env, c, "get_and_clear_pending_events", "()J");
418 assert(calls->get_and_clear_pending_events_meth != NULL);
420 LDKEventsProvider ret = {
421 .this_arg = (void*) calls,
422 .get_and_clear_pending_events = get_and_clear_pending_events_jcall,
423 .free = LDKEventsProvider_JCalls_free,
427 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1new (JNIEnv * env, jclass _a, jobject o) {
428 LDKEventsProvider *res_ptr = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
429 *res_ptr = LDKEventsProvider_init(env, _a, o);
430 return (long)res_ptr;
432 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKEventsProvider_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
433 return ((LDKEventsProvider_JCalls*)val)->o;
435 typedef struct LDKLogger_JCalls {
436 atomic_size_t refcnt;
441 void log_jcall(const void* this_arg, const char *record) {
442 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
443 jstring record_conv = (*j_calls->env)->NewStringUTF(j_calls->env, record);
444 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->log_meth, record_conv);
446 static void LDKLogger_JCalls_free(void* this_arg) {
447 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
448 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
449 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
453 static void* LDKLogger_JCalls_clone(const void* this_arg) {
454 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
455 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
456 return (void*) this_arg;
458 static inline LDKLogger LDKLogger_init (JNIEnv * env, jclass _a, jobject o) {
459 jclass c = (*env)->GetObjectClass(env, o);
461 LDKLogger_JCalls *calls = MALLOC(sizeof(LDKLogger_JCalls), "LDKLogger_JCalls");
462 atomic_init(&calls->refcnt, 1);
464 calls->o = (*env)->NewGlobalRef(env, o);
465 calls->log_meth = (*env)->GetMethodID(env, c, "log", "(Ljava/lang/String;)V");
466 assert(calls->log_meth != NULL);
469 .this_arg = (void*) calls,
471 .free = LDKLogger_JCalls_free,
475 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKLogger_1new (JNIEnv * env, jclass _a, jobject o) {
476 LDKLogger *res_ptr = MALLOC(sizeof(LDKLogger), "LDKLogger");
477 *res_ptr = LDKLogger_init(env, _a, o);
478 return (long)res_ptr;
480 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKLogger_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
481 return ((LDKLogger_JCalls*)val)->o;
483 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
484 return ((LDKCResult_TxOutAccessErrorZ*)arg)->result_ok;
486 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxOutAccessErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
487 if (((LDKCResult_TxOutAccessErrorZ*)arg)->result_ok) {
488 return (long)((LDKCResult_TxOutAccessErrorZ*)arg)->contents.result;
490 return (long)((LDKCResult_TxOutAccessErrorZ*)arg)->contents.err;
493 typedef struct LDKAccess_JCalls {
494 atomic_size_t refcnt;
497 jmethodID get_utxo_meth;
499 LDKCResult_TxOutAccessErrorZ get_utxo_jcall(const void* this_arg, const uint8_t (*genesis_hash)[32], uint64_t short_channel_id) {
500 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
501 jbyteArray genesis_hash_arr = (*j_calls->env)->NewByteArray(j_calls->env, 32);
502 (*j_calls->env)->SetByteArrayRegion(j_calls->env, genesis_hash_arr, 0, 32, *genesis_hash);
503 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);
504 LDKCResult_TxOutAccessErrorZ res = *ret;
508 static void LDKAccess_JCalls_free(void* this_arg) {
509 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
510 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
511 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
515 static void* LDKAccess_JCalls_clone(const void* this_arg) {
516 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
517 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
518 return (void*) this_arg;
520 static inline LDKAccess LDKAccess_init (JNIEnv * env, jclass _a, jobject o) {
521 jclass c = (*env)->GetObjectClass(env, o);
523 LDKAccess_JCalls *calls = MALLOC(sizeof(LDKAccess_JCalls), "LDKAccess_JCalls");
524 atomic_init(&calls->refcnt, 1);
526 calls->o = (*env)->NewGlobalRef(env, o);
527 calls->get_utxo_meth = (*env)->GetMethodID(env, c, "get_utxo", "([BJ)J");
528 assert(calls->get_utxo_meth != NULL);
531 .this_arg = (void*) calls,
532 .get_utxo = get_utxo_jcall,
533 .free = LDKAccess_JCalls_free,
537 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKAccess_1new (JNIEnv * env, jclass _a, jobject o) {
538 LDKAccess *res_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess");
539 *res_ptr = LDKAccess_init(env, _a, o);
540 return (long)res_ptr;
542 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKAccess_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
543 return ((LDKAccess_JCalls*)val)->o;
545 typedef struct LDKChannelKeys_JCalls {
546 atomic_size_t refcnt;
549 jmethodID get_per_commitment_point_meth;
550 jmethodID release_commitment_secret_meth;
551 jmethodID key_derivation_params_meth;
552 jmethodID sign_counterparty_commitment_meth;
553 jmethodID sign_holder_commitment_meth;
554 jmethodID sign_holder_commitment_htlc_transactions_meth;
555 jmethodID sign_justice_transaction_meth;
556 jmethodID sign_counterparty_htlc_transaction_meth;
557 jmethodID sign_closing_transaction_meth;
558 jmethodID sign_channel_announcement_meth;
559 jmethodID on_accept_meth;
560 } LDKChannelKeys_JCalls;
561 LDKPublicKey get_per_commitment_point_jcall(const void* this_arg, uint64_t idx) {
562 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
563 LDKPublicKey* ret = (LDKPublicKey*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_per_commitment_point_meth, idx);
564 LDKPublicKey res = *ret;
568 LDKThirtyTwoBytes release_commitment_secret_jcall(const void* this_arg, uint64_t idx) {
569 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
570 LDKThirtyTwoBytes* ret = (LDKThirtyTwoBytes*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->release_commitment_secret_meth, idx);
571 LDKThirtyTwoBytes res = *ret;
575 LDKC2Tuple_u64u64Z key_derivation_params_jcall(const void* this_arg) {
576 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
577 LDKC2Tuple_u64u64Z* ret = (LDKC2Tuple_u64u64Z*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->key_derivation_params_meth);
578 LDKC2Tuple_u64u64Z res = *ret;
582 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) {
583 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
584 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);
585 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ res = *ret;
589 LDKCResult_SignatureNoneZ sign_holder_commitment_jcall(const void* this_arg, const LDKHolderCommitmentTransaction *holder_commitment_tx) {
590 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
591 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->sign_holder_commitment_meth, holder_commitment_tx);
592 LDKCResult_SignatureNoneZ res = *ret;
596 LDKCResult_CVec_SignatureZNoneZ sign_holder_commitment_htlc_transactions_jcall(const void* this_arg, const LDKHolderCommitmentTransaction *holder_commitment_tx) {
597 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
598 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);
599 LDKCResult_CVec_SignatureZNoneZ res = *ret;
603 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) {
604 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
605 jbyteArray per_commitment_key_arr = (*j_calls->env)->NewByteArray(j_calls->env, 32);
606 (*j_calls->env)->SetByteArrayRegion(j_calls->env, per_commitment_key_arr, 0, 32, *per_commitment_key);
607 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);
608 LDKCResult_SignatureNoneZ res = *ret;
612 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) {
613 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
614 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);
615 LDKCResult_SignatureNoneZ res = *ret;
619 LDKCResult_SignatureNoneZ sign_closing_transaction_jcall(const void* this_arg, LDKTransaction closing_tx) {
620 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
621 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->sign_closing_transaction_meth, closing_tx);
622 LDKCResult_SignatureNoneZ res = *ret;
626 LDKCResult_SignatureNoneZ sign_channel_announcement_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement *msg) {
627 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
628 LDKCResult_SignatureNoneZ* ret = (LDKCResult_SignatureNoneZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->sign_channel_announcement_meth, msg);
629 LDKCResult_SignatureNoneZ res = *ret;
633 void on_accept_jcall(void* this_arg, const LDKChannelPublicKeys *channel_points, uint16_t counterparty_selected_contest_delay, uint16_t holder_selected_contest_delay) {
634 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
635 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);
637 static void LDKChannelKeys_JCalls_free(void* this_arg) {
638 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
639 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
640 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
644 static void* LDKChannelKeys_JCalls_clone(const void* this_arg) {
645 LDKChannelKeys_JCalls *j_calls = (LDKChannelKeys_JCalls*) this_arg;
646 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
647 return (void*) this_arg;
649 static inline LDKChannelKeys LDKChannelKeys_init (JNIEnv * env, jclass _a, jobject o) {
650 jclass c = (*env)->GetObjectClass(env, o);
652 LDKChannelKeys_JCalls *calls = MALLOC(sizeof(LDKChannelKeys_JCalls), "LDKChannelKeys_JCalls");
653 atomic_init(&calls->refcnt, 1);
655 calls->o = (*env)->NewGlobalRef(env, o);
656 calls->get_per_commitment_point_meth = (*env)->GetMethodID(env, c, "get_per_commitment_point", "(J)J");
657 assert(calls->get_per_commitment_point_meth != NULL);
658 calls->release_commitment_secret_meth = (*env)->GetMethodID(env, c, "release_commitment_secret", "(J)J");
659 assert(calls->release_commitment_secret_meth != NULL);
660 calls->key_derivation_params_meth = (*env)->GetMethodID(env, c, "key_derivation_params", "()J");
661 assert(calls->key_derivation_params_meth != NULL);
662 calls->sign_counterparty_commitment_meth = (*env)->GetMethodID(env, c, "sign_counterparty_commitment", "(IJJJ)J");
663 assert(calls->sign_counterparty_commitment_meth != NULL);
664 calls->sign_holder_commitment_meth = (*env)->GetMethodID(env, c, "sign_holder_commitment", "(J)J");
665 assert(calls->sign_holder_commitment_meth != NULL);
666 calls->sign_holder_commitment_htlc_transactions_meth = (*env)->GetMethodID(env, c, "sign_holder_commitment_htlc_transactions", "(J)J");
667 assert(calls->sign_holder_commitment_htlc_transactions_meth != NULL);
668 calls->sign_justice_transaction_meth = (*env)->GetMethodID(env, c, "sign_justice_transaction", "(JJJ[BJ)J");
669 assert(calls->sign_justice_transaction_meth != NULL);
670 calls->sign_counterparty_htlc_transaction_meth = (*env)->GetMethodID(env, c, "sign_counterparty_htlc_transaction", "(JJJJJ)J");
671 assert(calls->sign_counterparty_htlc_transaction_meth != NULL);
672 calls->sign_closing_transaction_meth = (*env)->GetMethodID(env, c, "sign_closing_transaction", "(J)J");
673 assert(calls->sign_closing_transaction_meth != NULL);
674 calls->sign_channel_announcement_meth = (*env)->GetMethodID(env, c, "sign_channel_announcement", "(J)J");
675 assert(calls->sign_channel_announcement_meth != NULL);
676 calls->on_accept_meth = (*env)->GetMethodID(env, c, "on_accept", "(JSS)V");
677 assert(calls->on_accept_meth != NULL);
679 LDKChannelKeys ret = {
680 .this_arg = (void*) calls,
681 .get_per_commitment_point = get_per_commitment_point_jcall,
682 .release_commitment_secret = release_commitment_secret_jcall,
683 .key_derivation_params = key_derivation_params_jcall,
684 .sign_counterparty_commitment = sign_counterparty_commitment_jcall,
685 .sign_holder_commitment = sign_holder_commitment_jcall,
686 .sign_holder_commitment_htlc_transactions = sign_holder_commitment_htlc_transactions_jcall,
687 .sign_justice_transaction = sign_justice_transaction_jcall,
688 .sign_counterparty_htlc_transaction = sign_counterparty_htlc_transaction_jcall,
689 .sign_closing_transaction = sign_closing_transaction_jcall,
690 .sign_channel_announcement = sign_channel_announcement_jcall,
691 .on_accept = on_accept_jcall,
692 .clone = LDKChannelKeys_JCalls_clone,
693 .free = LDKChannelKeys_JCalls_free,
697 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1new (JNIEnv * env, jclass _a, jobject o) {
698 LDKChannelKeys *res_ptr = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys");
699 *res_ptr = LDKChannelKeys_init(env, _a, o);
700 return (long)res_ptr;
702 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKChannelKeys_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
703 return ((LDKChannelKeys_JCalls*)val)->o;
705 typedef struct LDKWatch_JCalls {
706 atomic_size_t refcnt;
709 jmethodID watch_channel_meth;
710 jmethodID update_channel_meth;
711 jmethodID release_pending_monitor_events_meth;
713 LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) {
714 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
715 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->watch_channel_meth, funding_txo, monitor);
716 LDKCResult_NoneChannelMonitorUpdateErrZ res = *ret;
720 LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate update) {
721 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
722 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = (LDKCResult_NoneChannelMonitorUpdateErrZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->update_channel_meth, funding_txo, update);
723 LDKCResult_NoneChannelMonitorUpdateErrZ res = *ret;
727 LDKCVec_MonitorEventZ release_pending_monitor_events_jcall(const void* this_arg) {
728 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
729 LDKCVec_MonitorEventZ* ret = (LDKCVec_MonitorEventZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->release_pending_monitor_events_meth);
730 LDKCVec_MonitorEventZ res = *ret;
734 static void LDKWatch_JCalls_free(void* this_arg) {
735 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
736 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
737 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
741 static void* LDKWatch_JCalls_clone(const void* this_arg) {
742 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
743 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
744 return (void*) this_arg;
746 static inline LDKWatch LDKWatch_init (JNIEnv * env, jclass _a, jobject o) {
747 jclass c = (*env)->GetObjectClass(env, o);
749 LDKWatch_JCalls *calls = MALLOC(sizeof(LDKWatch_JCalls), "LDKWatch_JCalls");
750 atomic_init(&calls->refcnt, 1);
752 calls->o = (*env)->NewGlobalRef(env, o);
753 calls->watch_channel_meth = (*env)->GetMethodID(env, c, "watch_channel", "(JJ)J");
754 assert(calls->watch_channel_meth != NULL);
755 calls->update_channel_meth = (*env)->GetMethodID(env, c, "update_channel", "(JJ)J");
756 assert(calls->update_channel_meth != NULL);
757 calls->release_pending_monitor_events_meth = (*env)->GetMethodID(env, c, "release_pending_monitor_events", "()J");
758 assert(calls->release_pending_monitor_events_meth != NULL);
761 .this_arg = (void*) calls,
762 .watch_channel = watch_channel_jcall,
763 .update_channel = update_channel_jcall,
764 .release_pending_monitor_events = release_pending_monitor_events_jcall,
765 .free = LDKWatch_JCalls_free,
769 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKWatch_1new (JNIEnv * env, jclass _a, jobject o) {
770 LDKWatch *res_ptr = MALLOC(sizeof(LDKWatch), "LDKWatch");
771 *res_ptr = LDKWatch_init(env, _a, o);
772 return (long)res_ptr;
774 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKWatch_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
775 return ((LDKWatch_JCalls*)val)->o;
777 typedef struct LDKFilter_JCalls {
778 atomic_size_t refcnt;
781 jmethodID register_tx_meth;
782 jmethodID register_output_meth;
784 void register_tx_jcall(const void* this_arg, const uint8_t (*txid)[32], LDKu8slice script_pubkey) {
785 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
786 jbyteArray txid_arr = (*j_calls->env)->NewByteArray(j_calls->env, 32);
787 (*j_calls->env)->SetByteArrayRegion(j_calls->env, txid_arr, 0, 32, *txid);
788 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->register_tx_meth, txid_arr, script_pubkey);
790 void register_output_jcall(const void* this_arg, const LDKOutPoint *outpoint, LDKu8slice script_pubkey) {
791 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
792 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->register_output_meth, outpoint, script_pubkey);
794 static void LDKFilter_JCalls_free(void* this_arg) {
795 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
796 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
797 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
801 static void* LDKFilter_JCalls_clone(const void* this_arg) {
802 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
803 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
804 return (void*) this_arg;
806 static inline LDKFilter LDKFilter_init (JNIEnv * env, jclass _a, jobject o) {
807 jclass c = (*env)->GetObjectClass(env, o);
809 LDKFilter_JCalls *calls = MALLOC(sizeof(LDKFilter_JCalls), "LDKFilter_JCalls");
810 atomic_init(&calls->refcnt, 1);
812 calls->o = (*env)->NewGlobalRef(env, o);
813 calls->register_tx_meth = (*env)->GetMethodID(env, c, "register_tx", "([BJ)V");
814 assert(calls->register_tx_meth != NULL);
815 calls->register_output_meth = (*env)->GetMethodID(env, c, "register_output", "(JJ)V");
816 assert(calls->register_output_meth != NULL);
819 .this_arg = (void*) calls,
820 .register_tx = register_tx_jcall,
821 .register_output = register_output_jcall,
822 .free = LDKFilter_JCalls_free,
826 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKFilter_1new (JNIEnv * env, jclass _a, jobject o) {
827 LDKFilter *res_ptr = MALLOC(sizeof(LDKFilter), "LDKFilter");
828 *res_ptr = LDKFilter_init(env, _a, o);
829 return (long)res_ptr;
831 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFilter_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
832 return ((LDKFilter_JCalls*)val)->o;
834 typedef struct LDKBroadcasterInterface_JCalls {
835 atomic_size_t refcnt;
838 jmethodID broadcast_transaction_meth;
839 } LDKBroadcasterInterface_JCalls;
840 void broadcast_transaction_jcall(const void* this_arg, LDKTransaction tx) {
841 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
842 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->broadcast_transaction_meth, tx);
844 static void LDKBroadcasterInterface_JCalls_free(void* this_arg) {
845 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
846 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
847 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
851 static void* LDKBroadcasterInterface_JCalls_clone(const void* this_arg) {
852 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
853 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
854 return (void*) this_arg;
856 static inline LDKBroadcasterInterface LDKBroadcasterInterface_init (JNIEnv * env, jclass _a, jobject o) {
857 jclass c = (*env)->GetObjectClass(env, o);
859 LDKBroadcasterInterface_JCalls *calls = MALLOC(sizeof(LDKBroadcasterInterface_JCalls), "LDKBroadcasterInterface_JCalls");
860 atomic_init(&calls->refcnt, 1);
862 calls->o = (*env)->NewGlobalRef(env, o);
863 calls->broadcast_transaction_meth = (*env)->GetMethodID(env, c, "broadcast_transaction", "(J)V");
864 assert(calls->broadcast_transaction_meth != NULL);
866 LDKBroadcasterInterface ret = {
867 .this_arg = (void*) calls,
868 .broadcast_transaction = broadcast_transaction_jcall,
869 .free = LDKBroadcasterInterface_JCalls_free,
873 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1new (JNIEnv * env, jclass _a, jobject o) {
874 LDKBroadcasterInterface *res_ptr = MALLOC(sizeof(LDKBroadcasterInterface), "LDKBroadcasterInterface");
875 *res_ptr = LDKBroadcasterInterface_init(env, _a, o);
876 return (long)res_ptr;
878 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKBroadcasterInterface_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
879 return ((LDKBroadcasterInterface_JCalls*)val)->o;
881 typedef struct LDKFeeEstimator_JCalls {
882 atomic_size_t refcnt;
885 jmethodID get_est_sat_per_1000_weight_meth;
886 } LDKFeeEstimator_JCalls;
887 uint32_t get_est_sat_per_1000_weight_jcall(const void* this_arg, LDKConfirmationTarget confirmation_target) {
888 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
889 jclass confirmation_target_conv = LDKConfirmationTarget_to_java(j_calls->env, confirmation_target);
890 return (*j_calls->env)->CallIntMethod(j_calls->env, j_calls->o, j_calls->get_est_sat_per_1000_weight_meth, confirmation_target_conv);
892 static void LDKFeeEstimator_JCalls_free(void* this_arg) {
893 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
894 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
895 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
899 static void* LDKFeeEstimator_JCalls_clone(const void* this_arg) {
900 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
901 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
902 return (void*) this_arg;
904 static inline LDKFeeEstimator LDKFeeEstimator_init (JNIEnv * env, jclass _a, jobject o) {
905 jclass c = (*env)->GetObjectClass(env, o);
907 LDKFeeEstimator_JCalls *calls = MALLOC(sizeof(LDKFeeEstimator_JCalls), "LDKFeeEstimator_JCalls");
908 atomic_init(&calls->refcnt, 1);
910 calls->o = (*env)->NewGlobalRef(env, o);
911 calls->get_est_sat_per_1000_weight_meth = (*env)->GetMethodID(env, c, "get_est_sat_per_1000_weight", "(Lorg/ldk/impl/bindings$LDKConfirmationTarget;)I");
912 assert(calls->get_est_sat_per_1000_weight_meth != NULL);
914 LDKFeeEstimator ret = {
915 .this_arg = (void*) calls,
916 .get_est_sat_per_1000_weight = get_est_sat_per_1000_weight_jcall,
917 .free = LDKFeeEstimator_JCalls_free,
921 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1new (JNIEnv * env, jclass _a, jobject o) {
922 LDKFeeEstimator *res_ptr = MALLOC(sizeof(LDKFeeEstimator), "LDKFeeEstimator");
923 *res_ptr = LDKFeeEstimator_init(env, _a, o);
924 return (long)res_ptr;
926 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKFeeEstimator_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
927 return ((LDKFeeEstimator_JCalls*)val)->o;
929 typedef struct LDKKeysInterface_JCalls {
930 atomic_size_t refcnt;
933 jmethodID get_node_secret_meth;
934 jmethodID get_destination_script_meth;
935 jmethodID get_shutdown_pubkey_meth;
936 jmethodID get_channel_keys_meth;
937 jmethodID get_secure_random_bytes_meth;
938 } LDKKeysInterface_JCalls;
939 LDKSecretKey get_node_secret_jcall(const void* this_arg) {
940 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
941 LDKSecretKey* ret = (LDKSecretKey*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_node_secret_meth);
942 LDKSecretKey res = *ret;
946 LDKCVec_u8Z get_destination_script_jcall(const void* this_arg) {
947 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
948 LDKCVec_u8Z* ret = (LDKCVec_u8Z*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_destination_script_meth);
949 LDKCVec_u8Z res = *ret;
953 LDKPublicKey get_shutdown_pubkey_jcall(const void* this_arg) {
954 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
955 LDKPublicKey* ret = (LDKPublicKey*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_shutdown_pubkey_meth);
956 LDKPublicKey res = *ret;
960 LDKChannelKeys get_channel_keys_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) {
961 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
962 LDKChannelKeys* ret = (LDKChannelKeys*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_channel_keys_meth, inbound, channel_value_satoshis);
963 LDKChannelKeys res = *ret;
967 LDKThirtyTwoBytes get_secure_random_bytes_jcall(const void* this_arg) {
968 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
969 LDKThirtyTwoBytes* ret = (LDKThirtyTwoBytes*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->get_secure_random_bytes_meth);
970 LDKThirtyTwoBytes res = *ret;
974 static void LDKKeysInterface_JCalls_free(void* this_arg) {
975 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
976 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
977 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
981 static void* LDKKeysInterface_JCalls_clone(const void* this_arg) {
982 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
983 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
984 return (void*) this_arg;
986 static inline LDKKeysInterface LDKKeysInterface_init (JNIEnv * env, jclass _a, jobject o) {
987 jclass c = (*env)->GetObjectClass(env, o);
989 LDKKeysInterface_JCalls *calls = MALLOC(sizeof(LDKKeysInterface_JCalls), "LDKKeysInterface_JCalls");
990 atomic_init(&calls->refcnt, 1);
992 calls->o = (*env)->NewGlobalRef(env, o);
993 calls->get_node_secret_meth = (*env)->GetMethodID(env, c, "get_node_secret", "()J");
994 assert(calls->get_node_secret_meth != NULL);
995 calls->get_destination_script_meth = (*env)->GetMethodID(env, c, "get_destination_script", "()J");
996 assert(calls->get_destination_script_meth != NULL);
997 calls->get_shutdown_pubkey_meth = (*env)->GetMethodID(env, c, "get_shutdown_pubkey", "()J");
998 assert(calls->get_shutdown_pubkey_meth != NULL);
999 calls->get_channel_keys_meth = (*env)->GetMethodID(env, c, "get_channel_keys", "(ZJ)J");
1000 assert(calls->get_channel_keys_meth != NULL);
1001 calls->get_secure_random_bytes_meth = (*env)->GetMethodID(env, c, "get_secure_random_bytes", "()J");
1002 assert(calls->get_secure_random_bytes_meth != NULL);
1004 LDKKeysInterface ret = {
1005 .this_arg = (void*) calls,
1006 .get_node_secret = get_node_secret_jcall,
1007 .get_destination_script = get_destination_script_jcall,
1008 .get_shutdown_pubkey = get_shutdown_pubkey_jcall,
1009 .get_channel_keys = get_channel_keys_jcall,
1010 .get_secure_random_bytes = get_secure_random_bytes_jcall,
1011 .free = LDKKeysInterface_JCalls_free,
1015 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1new (JNIEnv * env, jclass _a, jobject o) {
1016 LDKKeysInterface *res_ptr = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
1017 *res_ptr = LDKKeysInterface_init(env, _a, o);
1018 return (long)res_ptr;
1020 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKKeysInterface_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
1021 return ((LDKKeysInterface_JCalls*)val)->o;
1023 typedef struct LDKChannelMessageHandler_JCalls {
1024 atomic_size_t refcnt;
1027 LDKMessageSendEventsProvider_JCalls* MessageSendEventsProvider;
1028 jmethodID handle_open_channel_meth;
1029 jmethodID handle_accept_channel_meth;
1030 jmethodID handle_funding_created_meth;
1031 jmethodID handle_funding_signed_meth;
1032 jmethodID handle_funding_locked_meth;
1033 jmethodID handle_shutdown_meth;
1034 jmethodID handle_closing_signed_meth;
1035 jmethodID handle_update_add_htlc_meth;
1036 jmethodID handle_update_fulfill_htlc_meth;
1037 jmethodID handle_update_fail_htlc_meth;
1038 jmethodID handle_update_fail_malformed_htlc_meth;
1039 jmethodID handle_commitment_signed_meth;
1040 jmethodID handle_revoke_and_ack_meth;
1041 jmethodID handle_update_fee_meth;
1042 jmethodID handle_announcement_signatures_meth;
1043 jmethodID peer_disconnected_meth;
1044 jmethodID peer_connected_meth;
1045 jmethodID handle_channel_reestablish_meth;
1046 jmethodID handle_error_meth;
1047 } LDKChannelMessageHandler_JCalls;
1048 void handle_open_channel_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKOpenChannel *msg) {
1049 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1050 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_open_channel_meth, their_node_id, their_features, msg);
1052 void handle_accept_channel_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKAcceptChannel *msg) {
1053 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1054 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_accept_channel_meth, their_node_id, their_features, msg);
1056 void handle_funding_created_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated *msg) {
1057 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1058 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_funding_created_meth, their_node_id, msg);
1060 void handle_funding_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned *msg) {
1061 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1062 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_funding_signed_meth, their_node_id, msg);
1064 void handle_funding_locked_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingLocked *msg) {
1065 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1066 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_funding_locked_meth, their_node_id, msg);
1068 void handle_shutdown_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKShutdown *msg) {
1069 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1070 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_shutdown_meth, their_node_id, msg);
1072 void handle_closing_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned *msg) {
1073 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1074 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_closing_signed_meth, their_node_id, msg);
1076 void handle_update_add_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC *msg) {
1077 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1078 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_update_add_htlc_meth, their_node_id, msg);
1080 void handle_update_fulfill_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC *msg) {
1081 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1082 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_update_fulfill_htlc_meth, their_node_id, msg);
1084 void handle_update_fail_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC *msg) {
1085 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1086 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_update_fail_htlc_meth, their_node_id, msg);
1088 void handle_update_fail_malformed_htlc_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC *msg) {
1089 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1090 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_update_fail_malformed_htlc_meth, their_node_id, msg);
1092 void handle_commitment_signed_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned *msg) {
1093 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1094 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_commitment_signed_meth, their_node_id, msg);
1096 void handle_revoke_and_ack_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK *msg) {
1097 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1098 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_revoke_and_ack_meth, their_node_id, msg);
1100 void handle_update_fee_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee *msg) {
1101 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1102 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_update_fee_meth, their_node_id, msg);
1104 void handle_announcement_signatures_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures *msg) {
1105 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1106 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_announcement_signatures_meth, their_node_id, msg);
1108 void peer_disconnected_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) {
1109 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1110 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->peer_disconnected_meth, their_node_id, no_connection_possible);
1112 void peer_connected_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit *msg) {
1113 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1114 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->peer_connected_meth, their_node_id, msg);
1116 void handle_channel_reestablish_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReestablish *msg) {
1117 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1118 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_channel_reestablish_meth, their_node_id, msg);
1120 void handle_error_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage *msg) {
1121 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1122 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_error_meth, their_node_id, msg);
1124 static void LDKChannelMessageHandler_JCalls_free(void* this_arg) {
1125 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1126 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1127 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
1131 static void* LDKChannelMessageHandler_JCalls_clone(const void* this_arg) {
1132 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
1133 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1134 atomic_fetch_add_explicit(&j_calls->MessageSendEventsProvider->refcnt, 1, memory_order_release);
1135 return (void*) this_arg;
1137 static inline LDKChannelMessageHandler LDKChannelMessageHandler_init (JNIEnv * env, jclass _a, jobject o, jobject MessageSendEventsProvider) {
1138 jclass c = (*env)->GetObjectClass(env, o);
1140 LDKChannelMessageHandler_JCalls *calls = MALLOC(sizeof(LDKChannelMessageHandler_JCalls), "LDKChannelMessageHandler_JCalls");
1141 atomic_init(&calls->refcnt, 1);
1143 calls->o = (*env)->NewGlobalRef(env, o);
1144 calls->handle_open_channel_meth = (*env)->GetMethodID(env, c, "handle_open_channel", "(JJJ)V");
1145 assert(calls->handle_open_channel_meth != NULL);
1146 calls->handle_accept_channel_meth = (*env)->GetMethodID(env, c, "handle_accept_channel", "(JJJ)V");
1147 assert(calls->handle_accept_channel_meth != NULL);
1148 calls->handle_funding_created_meth = (*env)->GetMethodID(env, c, "handle_funding_created", "(JJ)V");
1149 assert(calls->handle_funding_created_meth != NULL);
1150 calls->handle_funding_signed_meth = (*env)->GetMethodID(env, c, "handle_funding_signed", "(JJ)V");
1151 assert(calls->handle_funding_signed_meth != NULL);
1152 calls->handle_funding_locked_meth = (*env)->GetMethodID(env, c, "handle_funding_locked", "(JJ)V");
1153 assert(calls->handle_funding_locked_meth != NULL);
1154 calls->handle_shutdown_meth = (*env)->GetMethodID(env, c, "handle_shutdown", "(JJ)V");
1155 assert(calls->handle_shutdown_meth != NULL);
1156 calls->handle_closing_signed_meth = (*env)->GetMethodID(env, c, "handle_closing_signed", "(JJ)V");
1157 assert(calls->handle_closing_signed_meth != NULL);
1158 calls->handle_update_add_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_add_htlc", "(JJ)V");
1159 assert(calls->handle_update_add_htlc_meth != NULL);
1160 calls->handle_update_fulfill_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fulfill_htlc", "(JJ)V");
1161 assert(calls->handle_update_fulfill_htlc_meth != NULL);
1162 calls->handle_update_fail_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fail_htlc", "(JJ)V");
1163 assert(calls->handle_update_fail_htlc_meth != NULL);
1164 calls->handle_update_fail_malformed_htlc_meth = (*env)->GetMethodID(env, c, "handle_update_fail_malformed_htlc", "(JJ)V");
1165 assert(calls->handle_update_fail_malformed_htlc_meth != NULL);
1166 calls->handle_commitment_signed_meth = (*env)->GetMethodID(env, c, "handle_commitment_signed", "(JJ)V");
1167 assert(calls->handle_commitment_signed_meth != NULL);
1168 calls->handle_revoke_and_ack_meth = (*env)->GetMethodID(env, c, "handle_revoke_and_ack", "(JJ)V");
1169 assert(calls->handle_revoke_and_ack_meth != NULL);
1170 calls->handle_update_fee_meth = (*env)->GetMethodID(env, c, "handle_update_fee", "(JJ)V");
1171 assert(calls->handle_update_fee_meth != NULL);
1172 calls->handle_announcement_signatures_meth = (*env)->GetMethodID(env, c, "handle_announcement_signatures", "(JJ)V");
1173 assert(calls->handle_announcement_signatures_meth != NULL);
1174 calls->peer_disconnected_meth = (*env)->GetMethodID(env, c, "peer_disconnected", "(JZ)V");
1175 assert(calls->peer_disconnected_meth != NULL);
1176 calls->peer_connected_meth = (*env)->GetMethodID(env, c, "peer_connected", "(JJ)V");
1177 assert(calls->peer_connected_meth != NULL);
1178 calls->handle_channel_reestablish_meth = (*env)->GetMethodID(env, c, "handle_channel_reestablish", "(JJ)V");
1179 assert(calls->handle_channel_reestablish_meth != NULL);
1180 calls->handle_error_meth = (*env)->GetMethodID(env, c, "handle_error", "(JJ)V");
1181 assert(calls->handle_error_meth != NULL);
1183 LDKChannelMessageHandler ret = {
1184 .this_arg = (void*) calls,
1185 .handle_open_channel = handle_open_channel_jcall,
1186 .handle_accept_channel = handle_accept_channel_jcall,
1187 .handle_funding_created = handle_funding_created_jcall,
1188 .handle_funding_signed = handle_funding_signed_jcall,
1189 .handle_funding_locked = handle_funding_locked_jcall,
1190 .handle_shutdown = handle_shutdown_jcall,
1191 .handle_closing_signed = handle_closing_signed_jcall,
1192 .handle_update_add_htlc = handle_update_add_htlc_jcall,
1193 .handle_update_fulfill_htlc = handle_update_fulfill_htlc_jcall,
1194 .handle_update_fail_htlc = handle_update_fail_htlc_jcall,
1195 .handle_update_fail_malformed_htlc = handle_update_fail_malformed_htlc_jcall,
1196 .handle_commitment_signed = handle_commitment_signed_jcall,
1197 .handle_revoke_and_ack = handle_revoke_and_ack_jcall,
1198 .handle_update_fee = handle_update_fee_jcall,
1199 .handle_announcement_signatures = handle_announcement_signatures_jcall,
1200 .peer_disconnected = peer_disconnected_jcall,
1201 .peer_connected = peer_connected_jcall,
1202 .handle_channel_reestablish = handle_channel_reestablish_jcall,
1203 .handle_error = handle_error_jcall,
1204 .free = LDKChannelMessageHandler_JCalls_free,
1205 .MessageSendEventsProvider = LDKMessageSendEventsProvider_init(env, _a, MessageSendEventsProvider),
1207 calls->MessageSendEventsProvider = ret.MessageSendEventsProvider.this_arg;
1210 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1new (JNIEnv * env, jclass _a, jobject o, jobject MessageSendEventsProvider) {
1211 LDKChannelMessageHandler *res_ptr = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
1212 *res_ptr = LDKChannelMessageHandler_init(env, _a, o, MessageSendEventsProvider);
1213 return (long)res_ptr;
1215 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKChannelMessageHandler_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
1216 return ((LDKChannelMessageHandler_JCalls*)val)->o;
1218 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
1219 return ((LDKCResult_boolLightningErrorZ*)arg)->result_ok;
1221 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolLightningErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
1222 if (((LDKCResult_boolLightningErrorZ*)arg)->result_ok) {
1223 return (long)((LDKCResult_boolLightningErrorZ*)arg)->contents.result;
1225 return (long)((LDKCResult_boolLightningErrorZ*)arg)->contents.err;
1228 typedef struct LDKRoutingMessageHandler_JCalls {
1229 atomic_size_t refcnt;
1232 jmethodID handle_node_announcement_meth;
1233 jmethodID handle_channel_announcement_meth;
1234 jmethodID handle_channel_update_meth;
1235 jmethodID handle_htlc_fail_channel_update_meth;
1236 jmethodID get_next_channel_announcements_meth;
1237 jmethodID get_next_node_announcements_meth;
1238 jmethodID should_request_full_sync_meth;
1239 } LDKRoutingMessageHandler_JCalls;
1240 LDKCResult_boolLightningErrorZ handle_node_announcement_jcall(const void* this_arg, const LDKNodeAnnouncement *msg) {
1241 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1242 LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->handle_node_announcement_meth, msg);
1243 LDKCResult_boolLightningErrorZ res = *ret;
1247 LDKCResult_boolLightningErrorZ handle_channel_announcement_jcall(const void* this_arg, const LDKChannelAnnouncement *msg) {
1248 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1249 LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->handle_channel_announcement_meth, msg);
1250 LDKCResult_boolLightningErrorZ res = *ret;
1254 LDKCResult_boolLightningErrorZ handle_channel_update_jcall(const void* this_arg, const LDKChannelUpdate *msg) {
1255 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1256 LDKCResult_boolLightningErrorZ* ret = (LDKCResult_boolLightningErrorZ*)(*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->handle_channel_update_meth, msg);
1257 LDKCResult_boolLightningErrorZ res = *ret;
1261 void handle_htlc_fail_channel_update_jcall(const void* this_arg, const LDKHTLCFailChannelUpdate *update) {
1262 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1263 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->handle_htlc_fail_channel_update_meth, update);
1265 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcements_jcall(const void* this_arg, uint64_t starting_point, uint8_t batch_amount) {
1266 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1267 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);
1268 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ res = *ret;
1272 LDKCVec_NodeAnnouncementZ get_next_node_announcements_jcall(const void* this_arg, LDKPublicKey starting_point, uint8_t batch_amount) {
1273 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1274 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);
1275 LDKCVec_NodeAnnouncementZ res = *ret;
1279 bool should_request_full_sync_jcall(const void* this_arg, LDKPublicKey node_id) {
1280 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1281 return (*j_calls->env)->CallBooleanMethod(j_calls->env, j_calls->o, j_calls->should_request_full_sync_meth, node_id);
1283 static void LDKRoutingMessageHandler_JCalls_free(void* this_arg) {
1284 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1285 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1286 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
1290 static void* LDKRoutingMessageHandler_JCalls_clone(const void* this_arg) {
1291 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
1292 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1293 return (void*) this_arg;
1295 static inline LDKRoutingMessageHandler LDKRoutingMessageHandler_init (JNIEnv * env, jclass _a, jobject o) {
1296 jclass c = (*env)->GetObjectClass(env, o);
1298 LDKRoutingMessageHandler_JCalls *calls = MALLOC(sizeof(LDKRoutingMessageHandler_JCalls), "LDKRoutingMessageHandler_JCalls");
1299 atomic_init(&calls->refcnt, 1);
1301 calls->o = (*env)->NewGlobalRef(env, o);
1302 calls->handle_node_announcement_meth = (*env)->GetMethodID(env, c, "handle_node_announcement", "(J)J");
1303 assert(calls->handle_node_announcement_meth != NULL);
1304 calls->handle_channel_announcement_meth = (*env)->GetMethodID(env, c, "handle_channel_announcement", "(J)J");
1305 assert(calls->handle_channel_announcement_meth != NULL);
1306 calls->handle_channel_update_meth = (*env)->GetMethodID(env, c, "handle_channel_update", "(J)J");
1307 assert(calls->handle_channel_update_meth != NULL);
1308 calls->handle_htlc_fail_channel_update_meth = (*env)->GetMethodID(env, c, "handle_htlc_fail_channel_update", "(J)V");
1309 assert(calls->handle_htlc_fail_channel_update_meth != NULL);
1310 calls->get_next_channel_announcements_meth = (*env)->GetMethodID(env, c, "get_next_channel_announcements", "(JB)J");
1311 assert(calls->get_next_channel_announcements_meth != NULL);
1312 calls->get_next_node_announcements_meth = (*env)->GetMethodID(env, c, "get_next_node_announcements", "(JB)J");
1313 assert(calls->get_next_node_announcements_meth != NULL);
1314 calls->should_request_full_sync_meth = (*env)->GetMethodID(env, c, "should_request_full_sync", "(J)Z");
1315 assert(calls->should_request_full_sync_meth != NULL);
1317 LDKRoutingMessageHandler ret = {
1318 .this_arg = (void*) calls,
1319 .handle_node_announcement = handle_node_announcement_jcall,
1320 .handle_channel_announcement = handle_channel_announcement_jcall,
1321 .handle_channel_update = handle_channel_update_jcall,
1322 .handle_htlc_fail_channel_update = handle_htlc_fail_channel_update_jcall,
1323 .get_next_channel_announcements = get_next_channel_announcements_jcall,
1324 .get_next_node_announcements = get_next_node_announcements_jcall,
1325 .should_request_full_sync = should_request_full_sync_jcall,
1326 .free = LDKRoutingMessageHandler_JCalls_free,
1330 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1new (JNIEnv * env, jclass _a, jobject o) {
1331 LDKRoutingMessageHandler *res_ptr = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
1332 *res_ptr = LDKRoutingMessageHandler_init(env, _a, o);
1333 return (long)res_ptr;
1335 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKRoutingMessageHandler_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
1336 return ((LDKRoutingMessageHandler_JCalls*)val)->o;
1338 typedef struct LDKSocketDescriptor_JCalls {
1339 atomic_size_t refcnt;
1342 jmethodID send_data_meth;
1343 jmethodID disconnect_socket_meth;
1345 jmethodID hash_meth;
1346 } LDKSocketDescriptor_JCalls;
1347 uintptr_t send_data_jcall(void* this_arg, LDKu8slice data, bool resume_read) {
1348 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
1349 return (*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->send_data_meth, data, resume_read);
1351 void disconnect_socket_jcall(void* this_arg) {
1352 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
1353 return (*j_calls->env)->CallVoidMethod(j_calls->env, j_calls->o, j_calls->disconnect_socket_meth);
1355 bool eq_jcall(const void* this_arg, const void *other_arg) {
1356 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
1357 return (*j_calls->env)->CallBooleanMethod(j_calls->env, j_calls->o, j_calls->eq_meth, other_arg);
1359 uint64_t hash_jcall(const void* this_arg) {
1360 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
1361 return (*j_calls->env)->CallLongMethod(j_calls->env, j_calls->o, j_calls->hash_meth);
1363 static void LDKSocketDescriptor_JCalls_free(void* this_arg) {
1364 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
1365 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
1366 (*j_calls->env)->DeleteGlobalRef(j_calls->env, j_calls->o);
1370 static void* LDKSocketDescriptor_JCalls_clone(const void* this_arg) {
1371 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
1372 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
1373 return (void*) this_arg;
1375 static inline LDKSocketDescriptor LDKSocketDescriptor_init (JNIEnv * env, jclass _a, jobject o) {
1376 jclass c = (*env)->GetObjectClass(env, o);
1378 LDKSocketDescriptor_JCalls *calls = MALLOC(sizeof(LDKSocketDescriptor_JCalls), "LDKSocketDescriptor_JCalls");
1379 atomic_init(&calls->refcnt, 1);
1381 calls->o = (*env)->NewGlobalRef(env, o);
1382 calls->send_data_meth = (*env)->GetMethodID(env, c, "send_data", "(JZ)J");
1383 assert(calls->send_data_meth != NULL);
1384 calls->disconnect_socket_meth = (*env)->GetMethodID(env, c, "disconnect_socket", "()V");
1385 assert(calls->disconnect_socket_meth != NULL);
1386 calls->eq_meth = (*env)->GetMethodID(env, c, "eq", "(J)Z");
1387 assert(calls->eq_meth != NULL);
1388 calls->hash_meth = (*env)->GetMethodID(env, c, "hash", "()J");
1389 assert(calls->hash_meth != NULL);
1391 LDKSocketDescriptor ret = {
1392 .this_arg = (void*) calls,
1393 .send_data = send_data_jcall,
1394 .disconnect_socket = disconnect_socket_jcall,
1397 .clone = LDKSocketDescriptor_JCalls_clone,
1398 .free = LDKSocketDescriptor_JCalls_free,
1402 JNIEXPORT long JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1new (JNIEnv * env, jclass _a, jobject o) {
1403 LDKSocketDescriptor *res_ptr = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
1404 *res_ptr = LDKSocketDescriptor_init(env, _a, o);
1405 return (long)res_ptr;
1407 JNIEXPORT jobject JNICALL Java_org_ldk_impl_bindings_LDKSocketDescriptor_1get_1obj_1from_1jcalls (JNIEnv * env, jclass _a, jlong val) {
1408 return ((LDKSocketDescriptor_JCalls*)val)->o;
1410 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
1411 return ((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->result_ok;
1413 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1CVec_1u8ZPeerHandleErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
1414 if (((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->result_ok) {
1415 return (long)((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->contents.result;
1417 return (long)((LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg)->contents.err;
1420 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
1421 return ((LDKCResult_boolPeerHandleErrorZ*)arg)->result_ok;
1423 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1boolPeerHandleErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
1424 if (((LDKCResult_boolPeerHandleErrorZ*)arg)->result_ok) {
1425 return (long)((LDKCResult_boolPeerHandleErrorZ*)arg)->contents.result;
1427 return (long)((LDKCResult_boolPeerHandleErrorZ*)arg)->contents.err;
1430 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeySecpErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
1431 return ((LDKCResult_SecretKeySecpErrorZ*)arg)->result_ok;
1433 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1SecretKeySecpErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
1434 if (((LDKCResult_SecretKeySecpErrorZ*)arg)->result_ok) {
1435 return (long)((LDKCResult_SecretKeySecpErrorZ*)arg)->contents.result;
1437 return (long)((LDKCResult_SecretKeySecpErrorZ*)arg)->contents.err;
1440 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeySecpErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
1441 return ((LDKCResult_PublicKeySecpErrorZ*)arg)->result_ok;
1443 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1PublicKeySecpErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
1444 if (((LDKCResult_PublicKeySecpErrorZ*)arg)->result_ok) {
1445 return (long)((LDKCResult_PublicKeySecpErrorZ*)arg)->contents.result;
1447 return (long)((LDKCResult_PublicKeySecpErrorZ*)arg)->contents.err;
1450 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysSecpErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
1451 return ((LDKCResult_TxCreationKeysSecpErrorZ*)arg)->result_ok;
1453 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1TxCreationKeysSecpErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
1454 if (((LDKCResult_TxCreationKeysSecpErrorZ*)arg)->result_ok) {
1455 return (long)((LDKCResult_TxCreationKeysSecpErrorZ*)arg)->contents.result;
1457 return (long)((LDKCResult_TxCreationKeysSecpErrorZ*)arg)->contents.err;
1460 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1result_1ok (JNIEnv * env, jclass _a, jlong arg) {
1461 return ((LDKCResult_RouteLightningErrorZ*)arg)->result_ok;
1463 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LDKCResult_1RouteLightningErrorZ_1get_1inner (JNIEnv * env, jclass _a, jlong arg) {
1464 if (((LDKCResult_RouteLightningErrorZ*)arg)->result_ok) {
1465 return (long)((LDKCResult_RouteLightningErrorZ*)arg)->contents.result;
1467 return (long)((LDKCResult_RouteLightningErrorZ*)arg)->contents.err;
1470 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HTLCOutputInCommitmentSignatureZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1471 LDKC2Tuple_HTLCOutputInCommitmentSignatureZ arg_conv = *(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ*)arg;
1473 return C2Tuple_HTLCOutputInCommitmentSignatureZ_free(arg_conv);
1476 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1477 LDKC2Tuple_OutPointScriptZ arg_conv = *(LDKC2Tuple_OutPointScriptZ*)arg;
1479 return C2Tuple_OutPointScriptZ_free(arg_conv);
1482 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1483 LDKC2Tuple_SignatureCVec_SignatureZZ arg_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)arg;
1485 return C2Tuple_SignatureCVec_SignatureZZ_free(arg_conv);
1488 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1TxOutZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1489 LDKC2Tuple_TxidCVec_TxOutZZ arg_conv = *(LDKC2Tuple_TxidCVec_TxOutZZ*)arg;
1491 return C2Tuple_TxidCVec_TxOutZZ_free(arg_conv);
1494 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
1495 LDKC2Tuple_u64u64Z arg_conv = *(LDKC2Tuple_u64u64Z*)arg;
1497 return C2Tuple_u64u64Z_free(arg_conv);
1500 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1501 LDKC2Tuple_usizeTransactionZ arg_conv = *(LDKC2Tuple_usizeTransactionZ*)arg;
1503 return C2Tuple_usizeTransactionZ_free(arg_conv);
1506 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1507 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ arg_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)arg;
1509 return C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(arg_conv);
1512 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1513 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ arg_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)arg;
1515 return CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(arg_conv);
1518 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1519 LDKC2Tuple_SignatureCVec_SignatureZZ arg_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)arg;
1521 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
1522 *ret = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(arg_conv);
1526 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1527 LDKCResult_CVec_SignatureZNoneZ arg_conv = *(LDKCResult_CVec_SignatureZNoneZ*)arg;
1529 return CResult_CVec_SignatureZNoneZ_free(arg_conv);
1532 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1533 LDKCVec_SignatureZ arg_conv = *(LDKCVec_SignatureZ*)arg;
1535 LDKCResult_CVec_SignatureZNoneZ* ret = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
1536 *ret = CResult_CVec_SignatureZNoneZ_ok(arg_conv);
1540 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1541 LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg;
1543 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
1544 *ret = CResult_CVec_u8ZPeerHandleErrorZ_err(arg_conv);
1548 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1549 LDKCResult_CVec_u8ZPeerHandleErrorZ arg_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)arg;
1551 return CResult_CVec_u8ZPeerHandleErrorZ_free(arg_conv);
1554 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1u8ZPeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1555 LDKCVec_u8Z arg_conv = *(LDKCVec_u8Z*)arg;
1557 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
1558 *ret = CResult_CVec_u8ZPeerHandleErrorZ_ok(arg_conv);
1562 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1563 LDKAPIError arg_conv = *(LDKAPIError*)arg;
1565 LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
1566 *ret = CResult_NoneAPIErrorZ_err(arg_conv);
1570 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1571 LDKCResult_NoneAPIErrorZ arg_conv = *(LDKCResult_NoneAPIErrorZ*)arg;
1573 return CResult_NoneAPIErrorZ_free(arg_conv);
1576 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
1577 LDKChannelMonitorUpdateErr arg_conv = *(LDKChannelMonitorUpdateErr*)arg;
1579 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
1580 *ret = CResult_NoneChannelMonitorUpdateErrZ_err(arg_conv);
1584 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1585 LDKCResult_NoneChannelMonitorUpdateErrZ arg_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)arg;
1587 return CResult_NoneChannelMonitorUpdateErrZ_free(arg_conv);
1590 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1591 LDKMonitorUpdateError arg_conv = *(LDKMonitorUpdateError*)arg;
1593 LDKCResult_NoneMonitorUpdateErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
1594 *ret = CResult_NoneMonitorUpdateErrorZ_err(arg_conv);
1598 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1599 LDKCResult_NoneMonitorUpdateErrorZ arg_conv = *(LDKCResult_NoneMonitorUpdateErrorZ*)arg;
1601 return CResult_NoneMonitorUpdateErrorZ_free(arg_conv);
1604 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1605 LDKPaymentSendFailure arg_conv = *(LDKPaymentSendFailure*)arg;
1607 LDKCResult_NonePaymentSendFailureZ* ret = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
1608 *ret = CResult_NonePaymentSendFailureZ_err(arg_conv);
1612 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1613 LDKCResult_NonePaymentSendFailureZ arg_conv = *(LDKCResult_NonePaymentSendFailureZ*)arg;
1615 return CResult_NonePaymentSendFailureZ_free(arg_conv);
1618 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1619 LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg;
1621 LDKCResult_NonePeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
1622 *ret = CResult_NonePeerHandleErrorZ_err(arg_conv);
1626 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1627 LDKCResult_NonePeerHandleErrorZ arg_conv = *(LDKCResult_NonePeerHandleErrorZ*)arg;
1629 return CResult_NonePeerHandleErrorZ_free(arg_conv);
1632 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
1633 LDKSecp256k1Error arg_conv = *(LDKSecp256k1Error*)arg;
1635 LDKCResult_PublicKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ");
1636 *ret = CResult_PublicKeySecpErrorZ_err(arg_conv);
1640 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1641 LDKCResult_PublicKeySecpErrorZ arg_conv = *(LDKCResult_PublicKeySecpErrorZ*)arg;
1643 return CResult_PublicKeySecpErrorZ_free(arg_conv);
1646 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1PublicKeySecpErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1647 LDKPublicKey arg_conv = *(LDKPublicKey*)arg;
1649 LDKCResult_PublicKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ");
1650 *ret = CResult_PublicKeySecpErrorZ_ok(arg_conv);
1654 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1655 LDKLightningError arg_conv = *(LDKLightningError*)arg;
1657 LDKCResult_RouteLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
1658 *ret = CResult_RouteLightningErrorZ_err(arg_conv);
1662 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1663 LDKCResult_RouteLightningErrorZ arg_conv = *(LDKCResult_RouteLightningErrorZ*)arg;
1665 return CResult_RouteLightningErrorZ_free(arg_conv);
1668 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1RouteLightningErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1669 LDKRoute arg_conv = *(LDKRoute*)arg;
1671 LDKCResult_RouteLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
1672 *ret = CResult_RouteLightningErrorZ_ok(arg_conv);
1676 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
1677 LDKSecp256k1Error arg_conv = *(LDKSecp256k1Error*)arg;
1679 LDKCResult_SecretKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ");
1680 *ret = CResult_SecretKeySecpErrorZ_err(arg_conv);
1684 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1685 LDKCResult_SecretKeySecpErrorZ arg_conv = *(LDKCResult_SecretKeySecpErrorZ*)arg;
1687 return CResult_SecretKeySecpErrorZ_free(arg_conv);
1690 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SecretKeySecpErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1691 LDKSecretKey arg_conv = *(LDKSecretKey*)arg;
1693 LDKCResult_SecretKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ");
1694 *ret = CResult_SecretKeySecpErrorZ_ok(arg_conv);
1698 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1699 LDKCResult_SignatureNoneZ arg_conv = *(LDKCResult_SignatureNoneZ*)arg;
1701 return CResult_SignatureNoneZ_free(arg_conv);
1704 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1705 LDKSignature arg_conv = *(LDKSignature*)arg;
1707 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
1708 *ret = CResult_SignatureNoneZ_ok(arg_conv);
1712 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
1713 LDKSecp256k1Error arg_conv = *(LDKSecp256k1Error*)arg;
1715 LDKCResult_TxCreationKeysSecpErrorZ* ret = MALLOC(sizeof(LDKCResult_TxCreationKeysSecpErrorZ), "LDKCResult_TxCreationKeysSecpErrorZ");
1716 *ret = CResult_TxCreationKeysSecpErrorZ_err(arg_conv);
1720 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1721 LDKCResult_TxCreationKeysSecpErrorZ arg_conv = *(LDKCResult_TxCreationKeysSecpErrorZ*)arg;
1723 return CResult_TxCreationKeysSecpErrorZ_free(arg_conv);
1726 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxCreationKeysSecpErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1727 LDKTxCreationKeys arg_conv = *(LDKTxCreationKeys*)arg;
1729 LDKCResult_TxCreationKeysSecpErrorZ* ret = MALLOC(sizeof(LDKCResult_TxCreationKeysSecpErrorZ), "LDKCResult_TxCreationKeysSecpErrorZ");
1730 *ret = CResult_TxCreationKeysSecpErrorZ_ok(arg_conv);
1734 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1err(JNIEnv * _env, jclass _b, jclass arg) {
1735 LDKAccessError arg_conv = *(LDKAccessError*)arg;
1737 LDKCResult_TxOutAccessErrorZ* ret = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
1738 *ret = CResult_TxOutAccessErrorZ_err(arg_conv);
1742 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1743 LDKCResult_TxOutAccessErrorZ arg_conv = *(LDKCResult_TxOutAccessErrorZ*)arg;
1745 return CResult_TxOutAccessErrorZ_free(arg_conv);
1748 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1TxOutAccessErrorZ_1ok(JNIEnv * _env, jclass _b, jlong arg) {
1749 LDKTxOut arg_conv = *(LDKTxOut*)arg;
1751 LDKCResult_TxOutAccessErrorZ* ret = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
1752 *ret = CResult_TxOutAccessErrorZ_ok(arg_conv);
1756 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1757 LDKLightningError arg_conv = *(LDKLightningError*)arg;
1759 LDKCResult_boolLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
1760 *ret = CResult_boolLightningErrorZ_err(arg_conv);
1764 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1765 LDKCResult_boolLightningErrorZ arg_conv = *(LDKCResult_boolLightningErrorZ*)arg;
1767 return CResult_boolLightningErrorZ_free(arg_conv);
1770 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolLightningErrorZ_1ok(JNIEnv * _env, jclass _b, jboolean arg) {
1771 LDKCResult_boolLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
1772 *ret = CResult_boolLightningErrorZ_ok(arg);
1776 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1err(JNIEnv * _env, jclass _b, jlong arg) {
1777 LDKPeerHandleError arg_conv = *(LDKPeerHandleError*)arg;
1779 LDKCResult_boolPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
1780 *ret = CResult_boolPeerHandleErrorZ_err(arg_conv);
1784 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1785 LDKCResult_boolPeerHandleErrorZ arg_conv = *(LDKCResult_boolPeerHandleErrorZ*)arg;
1787 return CResult_boolPeerHandleErrorZ_free(arg_conv);
1790 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1boolPeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b, jboolean arg) {
1791 LDKCResult_boolPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
1792 *ret = CResult_boolPeerHandleErrorZ_ok(arg);
1796 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1HTLCOutputInCommitmentSignatureZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1797 LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ arg_conv = *(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ*)arg;
1799 return CVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ_free(arg_conv);
1802 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1TxidCVec_1TxOutZZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1803 LDKCVec_C2Tuple_TxidCVec_TxOutZZZ arg_conv = *(LDKCVec_C2Tuple_TxidCVec_TxOutZZZ*)arg;
1805 return CVec_C2Tuple_TxidCVec_TxOutZZZ_free(arg_conv);
1808 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C2Tuple_1usizeTransactionZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1809 LDKCVec_C2Tuple_usizeTransactionZZ arg_conv = *(LDKCVec_C2Tuple_usizeTransactionZZ*)arg;
1811 return CVec_C2Tuple_usizeTransactionZZ_free(arg_conv);
1814 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1815 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ arg_conv = *(LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)arg;
1817 return CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(arg_conv);
1820 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1CVec_1RouteHopZZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1821 LDKCVec_CVec_RouteHopZZ arg_conv = *(LDKCVec_CVec_RouteHopZZ*)arg;
1823 return CVec_CVec_RouteHopZZ_free(arg_conv);
1826 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelDetailsZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1827 LDKCVec_ChannelDetailsZ arg_conv = *(LDKCVec_ChannelDetailsZ*)arg;
1829 return CVec_ChannelDetailsZ_free(arg_conv);
1832 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1ChannelMonitorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1833 LDKCVec_ChannelMonitorZ arg_conv = *(LDKCVec_ChannelMonitorZ*)arg;
1835 return CVec_ChannelMonitorZ_free(arg_conv);
1838 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1EventZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1839 LDKCVec_EventZ arg_conv = *(LDKCVec_EventZ*)arg;
1841 return CVec_EventZ_free(arg_conv);
1844 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1HTLCOutputInCommitmentZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1845 LDKCVec_HTLCOutputInCommitmentZ arg_conv = *(LDKCVec_HTLCOutputInCommitmentZ*)arg;
1847 return CVec_HTLCOutputInCommitmentZ_free(arg_conv);
1850 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MessageSendEventZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1851 LDKCVec_MessageSendEventZ arg_conv = *(LDKCVec_MessageSendEventZ*)arg;
1853 return CVec_MessageSendEventZ_free(arg_conv);
1856 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1MonitorEventZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1857 LDKCVec_MonitorEventZ arg_conv = *(LDKCVec_MonitorEventZ*)arg;
1859 return CVec_MonitorEventZ_free(arg_conv);
1862 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NetAddressZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1863 LDKCVec_NetAddressZ arg_conv = *(LDKCVec_NetAddressZ*)arg;
1865 return CVec_NetAddressZ_free(arg_conv);
1868 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1NodeAnnouncementZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1869 LDKCVec_NodeAnnouncementZ arg_conv = *(LDKCVec_NodeAnnouncementZ*)arg;
1871 return CVec_NodeAnnouncementZ_free(arg_conv);
1874 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1PublicKeyZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1875 LDKCVec_PublicKeyZ arg_conv = *(LDKCVec_PublicKeyZ*)arg;
1877 return CVec_PublicKeyZ_free(arg_conv);
1880 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHintZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1881 LDKCVec_RouteHintZ arg_conv = *(LDKCVec_RouteHintZ*)arg;
1883 return CVec_RouteHintZ_free(arg_conv);
1886 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1RouteHopZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1887 LDKCVec_RouteHopZ arg_conv = *(LDKCVec_RouteHopZ*)arg;
1889 return CVec_RouteHopZ_free(arg_conv);
1892 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SignatureZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1893 LDKCVec_SignatureZ arg_conv = *(LDKCVec_SignatureZ*)arg;
1895 return CVec_SignatureZ_free(arg_conv);
1898 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1SpendableOutputDescriptorZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1899 LDKCVec_SpendableOutputDescriptorZ arg_conv = *(LDKCVec_SpendableOutputDescriptorZ*)arg;
1901 return CVec_SpendableOutputDescriptorZ_free(arg_conv);
1904 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TransactionZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1905 LDKCVec_TransactionZ arg_conv = *(LDKCVec_TransactionZ*)arg;
1907 return CVec_TransactionZ_free(arg_conv);
1910 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1TxOutZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1911 LDKCVec_TxOutZ arg_conv = *(LDKCVec_TxOutZ*)arg;
1913 return CVec_TxOutZ_free(arg_conv);
1916 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateAddHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1917 LDKCVec_UpdateAddHTLCZ arg_conv = *(LDKCVec_UpdateAddHTLCZ*)arg;
1919 return CVec_UpdateAddHTLCZ_free(arg_conv);
1922 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1923 LDKCVec_UpdateFailHTLCZ arg_conv = *(LDKCVec_UpdateFailHTLCZ*)arg;
1925 return CVec_UpdateFailHTLCZ_free(arg_conv);
1928 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFailMalformedHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1929 LDKCVec_UpdateFailMalformedHTLCZ arg_conv = *(LDKCVec_UpdateFailMalformedHTLCZ*)arg;
1931 return CVec_UpdateFailMalformedHTLCZ_free(arg_conv);
1934 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1UpdateFulfillHTLCZ_1free(JNIEnv * _env, jclass _b, jlong arg) {
1935 LDKCVec_UpdateFulfillHTLCZ arg_conv = *(LDKCVec_UpdateFulfillHTLCZ*)arg;
1937 return CVec_UpdateFulfillHTLCZ_free(arg_conv);
1940 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u64Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
1941 LDKCVec_u64Z arg_conv = *(LDKCVec_u64Z*)arg;
1943 return CVec_u64Z_free(arg_conv);
1946 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CVec_1u8Z_1free(JNIEnv * _env, jclass _b, jlong arg) {
1947 LDKCVec_u8Z arg_conv = *(LDKCVec_u8Z*)arg;
1949 return CVec_u8Z_free(arg_conv);
1952 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Transaction_1free(JNIEnv * _env, jclass _b, jlong _res) {
1953 LDKTransaction _res_conv = *(LDKTransaction*)_res;
1955 return Transaction_free(_res_conv);
1958 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxOut_1free(JNIEnv * _env, jclass _b, jlong _res) {
1959 LDKTxOut _res_conv = *(LDKTxOut*)_res;
1961 return TxOut_free(_res_conv);
1964 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1usizeTransactionZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
1965 LDKTransaction b_conv = *(LDKTransaction*)b;
1967 LDKC2Tuple_usizeTransactionZ* ret = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
1968 *ret = C2Tuple_usizeTransactionZ_new(a, b_conv);
1972 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneChannelMonitorUpdateErrZ_1ok(JNIEnv * _env, jclass _b) {
1973 LDKCResult_NoneChannelMonitorUpdateErrZ* ret = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
1974 *ret = CResult_NoneChannelMonitorUpdateErrZ_ok();
1978 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneMonitorUpdateErrorZ_1ok(JNIEnv * _env, jclass _b) {
1979 LDKCResult_NoneMonitorUpdateErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
1980 *ret = CResult_NoneMonitorUpdateErrorZ_ok();
1984 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1OutPointScriptZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
1985 LDKOutPoint a_conv = *(LDKOutPoint*)a;
1987 a_conv.is_owned = true;
1988 LDKCVec_u8Z b_conv = *(LDKCVec_u8Z*)b;
1990 LDKC2Tuple_OutPointScriptZ* ret = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
1991 *ret = C2Tuple_OutPointScriptZ_new(a_conv, b_conv);
1995 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1TxidCVec_1TxOutZZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
1996 LDKThirtyTwoBytes a_conv = *(LDKThirtyTwoBytes*)a;
1998 LDKCVec_TxOutZ b_conv = *(LDKCVec_TxOutZ*)b;
2000 LDKC2Tuple_TxidCVec_TxOutZZ* ret = MALLOC(sizeof(LDKC2Tuple_TxidCVec_TxOutZZ), "LDKC2Tuple_TxidCVec_TxOutZZ");
2001 *ret = C2Tuple_TxidCVec_TxOutZZ_new(a_conv, b_conv);
2005 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1u64u64Z_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
2006 LDKC2Tuple_u64u64Z* ret = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
2007 *ret = C2Tuple_u64u64Z_new(a, b);
2011 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1SignatureCVec_1SignatureZZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
2012 LDKSignature a_conv = *(LDKSignature*)a;
2014 LDKCVec_SignatureZ b_conv = *(LDKCVec_SignatureZ*)b;
2016 LDKC2Tuple_SignatureCVec_SignatureZZ* ret = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
2017 *ret = C2Tuple_SignatureCVec_SignatureZZ_new(a_conv, b_conv);
2021 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1C2Tuple_1SignatureCVec_1SignatureZZNoneZ_1err(JNIEnv * _env, jclass _b) {
2022 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
2023 *ret = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err();
2027 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1SignatureNoneZ_1err(JNIEnv * _env, jclass _b) {
2028 LDKCResult_SignatureNoneZ* ret = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
2029 *ret = CResult_SignatureNoneZ_err();
2033 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1CVec_1SignatureZNoneZ_1err(JNIEnv * _env, jclass _b) {
2034 LDKCResult_CVec_SignatureZNoneZ* ret = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
2035 *ret = CResult_CVec_SignatureZNoneZ_err();
2039 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NoneAPIErrorZ_1ok(JNIEnv * _env, jclass _b) {
2040 LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
2041 *ret = CResult_NoneAPIErrorZ_ok();
2045 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePaymentSendFailureZ_1ok(JNIEnv * _env, jclass _b) {
2046 LDKCResult_NonePaymentSendFailureZ* ret = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
2047 *ret = CResult_NonePaymentSendFailureZ_ok();
2051 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C3Tuple_1ChannelAnnouncementChannelUpdateChannelUpdateZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b, jlong c) {
2052 LDKChannelAnnouncement a_conv = *(LDKChannelAnnouncement*)a;
2054 a_conv.is_owned = true;
2055 LDKChannelUpdate b_conv = *(LDKChannelUpdate*)b;
2057 b_conv.is_owned = true;
2058 LDKChannelUpdate c_conv = *(LDKChannelUpdate*)c;
2060 c_conv.is_owned = true;
2061 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
2062 *ret = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a_conv, b_conv, c_conv);
2066 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CResult_1NonePeerHandleErrorZ_1ok(JNIEnv * _env, jclass _b) {
2067 LDKCResult_NonePeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
2068 *ret = CResult_NonePeerHandleErrorZ_ok();
2072 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_C2Tuple_1HTLCOutputInCommitmentSignatureZ_1new(JNIEnv * _env, jclass _b, jlong a, jlong b) {
2073 LDKHTLCOutputInCommitment a_conv = *(LDKHTLCOutputInCommitment*)a;
2075 a_conv.is_owned = true;
2076 LDKSignature b_conv = *(LDKSignature*)b;
2078 LDKC2Tuple_HTLCOutputInCommitmentSignatureZ* ret = MALLOC(sizeof(LDKC2Tuple_HTLCOutputInCommitmentSignatureZ), "LDKC2Tuple_HTLCOutputInCommitmentSignatureZ");
2079 *ret = C2Tuple_HTLCOutputInCommitmentSignatureZ_new(a_conv, b_conv);
2083 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Event_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2084 LDKEvent this_ptr_conv = *(LDKEvent*)this_ptr;
2085 FREE((void*)this_ptr);
2086 return Event_free(this_ptr_conv);
2089 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEvent_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2090 LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)this_ptr;
2091 FREE((void*)this_ptr);
2092 return MessageSendEvent_free(this_ptr_conv);
2095 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageSendEventsProvider_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2096 LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)this_ptr;
2097 FREE((void*)this_ptr);
2098 return MessageSendEventsProvider_free(this_ptr_conv);
2101 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_EventsProvider_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2102 LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)this_ptr;
2103 FREE((void*)this_ptr);
2104 return EventsProvider_free(this_ptr_conv);
2107 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_APIError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2108 LDKAPIError this_ptr_conv = *(LDKAPIError*)this_ptr;
2109 FREE((void*)this_ptr);
2110 return APIError_free(this_ptr_conv);
2113 JNIEXPORT jclass JNICALL Java_org_ldk_impl_bindings_Level_1max(JNIEnv * _env, jclass _b) {
2114 jclass ret = LDKLevel_to_java(_env, Level_max());
2118 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Logger_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2119 LDKLogger this_ptr_conv = *(LDKLogger*)this_ptr;
2120 FREE((void*)this_ptr);
2121 return Logger_free(this_ptr_conv);
2124 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2125 LDKChannelHandshakeConfig this_ptr_conv = *(LDKChannelHandshakeConfig*)this_ptr;
2126 FREE((void*)this_ptr);
2127 this_ptr_conv.is_owned = true;
2128 return ChannelHandshakeConfig_free(this_ptr_conv);
2131 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr) {
2132 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
2133 return ChannelHandshakeConfig_get_minimum_depth(this_ptr_conv);
2136 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
2137 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
2138 return ChannelHandshakeConfig_set_minimum_depth(this_ptr_conv, val);
2141 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
2142 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
2143 return ChannelHandshakeConfig_get_our_to_self_delay(this_ptr_conv);
2146 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
2147 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
2148 return ChannelHandshakeConfig_set_our_to_self_delay(this_ptr_conv, val);
2151 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1get_1our_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
2152 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
2153 return ChannelHandshakeConfig_get_our_htlc_minimum_msat(this_ptr_conv);
2156 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1set_1our_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2157 LDKChannelHandshakeConfig* this_ptr_conv = (LDKChannelHandshakeConfig*)this_ptr;
2158 return ChannelHandshakeConfig_set_our_htlc_minimum_msat(this_ptr_conv, val);
2161 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) {
2162 LDKChannelHandshakeConfig* ret = MALLOC(sizeof(LDKChannelHandshakeConfig), "LDKChannelHandshakeConfig");
2163 *ret = ChannelHandshakeConfig_new(minimum_depth_arg, our_to_self_delay_arg, our_htlc_minimum_msat_arg);
2164 assert(ret->is_owned);
2165 ret->is_owned = false;
2169 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeConfig_1default(JNIEnv * _env, jclass _b) {
2170 LDKChannelHandshakeConfig* ret = MALLOC(sizeof(LDKChannelHandshakeConfig), "LDKChannelHandshakeConfig");
2171 *ret = ChannelHandshakeConfig_default();
2172 assert(ret->is_owned);
2173 ret->is_owned = false;
2177 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2178 LDKChannelHandshakeLimits this_ptr_conv = *(LDKChannelHandshakeLimits*)this_ptr;
2179 FREE((void*)this_ptr);
2180 this_ptr_conv.is_owned = true;
2181 return ChannelHandshakeLimits_free(this_ptr_conv);
2184 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
2185 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2186 return ChannelHandshakeLimits_get_min_funding_satoshis(this_ptr_conv);
2189 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2190 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2191 return ChannelHandshakeLimits_set_min_funding_satoshis(this_ptr_conv, val);
2194 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
2195 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2196 return ChannelHandshakeLimits_get_max_htlc_minimum_msat(this_ptr_conv);
2199 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2200 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2201 return ChannelHandshakeLimits_set_max_htlc_minimum_msat(this_ptr_conv, val);
2204 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
2205 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2206 return ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(this_ptr_conv);
2209 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) {
2210 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2211 return ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(this_ptr_conv, val);
2214 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
2215 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2216 return ChannelHandshakeLimits_get_max_channel_reserve_satoshis(this_ptr_conv);
2219 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2220 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2221 return ChannelHandshakeLimits_set_max_channel_reserve_satoshis(this_ptr_conv, val);
2224 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr) {
2225 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2226 return ChannelHandshakeLimits_get_min_max_accepted_htlcs(this_ptr_conv);
2229 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
2230 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2231 return ChannelHandshakeLimits_set_min_max_accepted_htlcs(this_ptr_conv, val);
2234 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1min_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
2235 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2236 return ChannelHandshakeLimits_get_min_dust_limit_satoshis(this_ptr_conv);
2239 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1min_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2240 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2241 return ChannelHandshakeLimits_set_min_dust_limit_satoshis(this_ptr_conv, val);
2244 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
2245 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2246 return ChannelHandshakeLimits_get_max_dust_limit_satoshis(this_ptr_conv);
2249 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2250 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2251 return ChannelHandshakeLimits_set_max_dust_limit_satoshis(this_ptr_conv, val);
2254 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1max_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr) {
2255 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2256 return ChannelHandshakeLimits_get_max_minimum_depth(this_ptr_conv);
2259 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1max_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
2260 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2261 return ChannelHandshakeLimits_set_max_minimum_depth(this_ptr_conv, val);
2264 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1force_1announced_1channel_1preference(JNIEnv * _env, jclass _b, jlong this_ptr) {
2265 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2266 return ChannelHandshakeLimits_get_force_announced_channel_preference(this_ptr_conv);
2269 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1force_1announced_1channel_1preference(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
2270 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2271 return ChannelHandshakeLimits_set_force_announced_channel_preference(this_ptr_conv, val);
2274 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1get_1their_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
2275 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2276 return ChannelHandshakeLimits_get_their_to_self_delay(this_ptr_conv);
2279 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1set_1their_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
2280 LDKChannelHandshakeLimits* this_ptr_conv = (LDKChannelHandshakeLimits*)this_ptr;
2281 return ChannelHandshakeLimits_set_their_to_self_delay(this_ptr_conv, val);
2284 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) {
2285 LDKChannelHandshakeLimits* ret = MALLOC(sizeof(LDKChannelHandshakeLimits), "LDKChannelHandshakeLimits");
2286 *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);
2287 assert(ret->is_owned);
2288 ret->is_owned = false;
2292 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelHandshakeLimits_1default(JNIEnv * _env, jclass _b) {
2293 LDKChannelHandshakeLimits* ret = MALLOC(sizeof(LDKChannelHandshakeLimits), "LDKChannelHandshakeLimits");
2294 *ret = ChannelHandshakeLimits_default();
2295 assert(ret->is_owned);
2296 ret->is_owned = false;
2300 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2301 LDKChannelConfig this_ptr_conv = *(LDKChannelConfig*)this_ptr;
2302 FREE((void*)this_ptr);
2303 this_ptr_conv.is_owned = true;
2304 return ChannelConfig_free(this_ptr_conv);
2307 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr) {
2308 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
2309 return ChannelConfig_get_fee_proportional_millionths(this_ptr_conv);
2312 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
2313 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
2314 return ChannelConfig_set_fee_proportional_millionths(this_ptr_conv, val);
2317 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1announced_1channel(JNIEnv * _env, jclass _b, jlong this_ptr) {
2318 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
2319 return ChannelConfig_get_announced_channel(this_ptr_conv);
2322 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1announced_1channel(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
2323 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
2324 return ChannelConfig_set_announced_channel(this_ptr_conv, val);
2327 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1get_1commit_1upfront_1shutdown_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
2328 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
2329 return ChannelConfig_get_commit_upfront_shutdown_pubkey(this_ptr_conv);
2332 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1set_1commit_1upfront_1shutdown_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
2333 LDKChannelConfig* this_ptr_conv = (LDKChannelConfig*)this_ptr;
2334 return ChannelConfig_set_commit_upfront_shutdown_pubkey(this_ptr_conv, val);
2337 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) {
2338 LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
2339 *ret = ChannelConfig_new(fee_proportional_millionths_arg, announced_channel_arg, commit_upfront_shutdown_pubkey_arg);
2340 assert(ret->is_owned);
2341 ret->is_owned = false;
2345 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1default(JNIEnv * _env, jclass _b) {
2346 LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
2347 *ret = ChannelConfig_default();
2348 assert(ret->is_owned);
2349 ret->is_owned = false;
2353 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1write(JNIEnv * _env, jclass _b, jlong obj) {
2354 LDKChannelConfig* obj_conv = (LDKChannelConfig*)obj;
2355 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
2356 *ret = ChannelConfig_write(obj_conv);
2360 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelConfig_1read(JNIEnv * _env, jclass _b, jlong ser) {
2361 LDKu8slice ser_conv = *(LDKu8slice*)ser;
2363 LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
2364 *ret = ChannelConfig_read(ser_conv);
2365 assert(ret->is_owned);
2366 ret->is_owned = false;
2370 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2371 LDKUserConfig this_ptr_conv = *(LDKUserConfig*)this_ptr;
2372 FREE((void*)this_ptr);
2373 this_ptr_conv.is_owned = true;
2374 return UserConfig_free(this_ptr_conv);
2377 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1own_1channel_1config(JNIEnv * _env, jclass _b, jlong this_ptr) {
2378 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
2379 LDKChannelHandshakeConfig* ret = MALLOC(sizeof(LDKChannelHandshakeConfig), "LDKChannelHandshakeConfig");
2380 *ret = UserConfig_get_own_channel_config(this_ptr_conv);
2381 assert(ret->is_owned);
2382 ret->is_owned = false;
2386 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1own_1channel_1config(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2387 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
2388 LDKChannelHandshakeConfig val_conv = *(LDKChannelHandshakeConfig*)val;
2390 val_conv.is_owned = true;
2391 return UserConfig_set_own_channel_config(this_ptr_conv, val_conv);
2394 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1peer_1channel_1config_1limits(JNIEnv * _env, jclass _b, jlong this_ptr) {
2395 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
2396 LDKChannelHandshakeLimits* ret = MALLOC(sizeof(LDKChannelHandshakeLimits), "LDKChannelHandshakeLimits");
2397 *ret = UserConfig_get_peer_channel_config_limits(this_ptr_conv);
2398 assert(ret->is_owned);
2399 ret->is_owned = false;
2403 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1peer_1channel_1config_1limits(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2404 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
2405 LDKChannelHandshakeLimits val_conv = *(LDKChannelHandshakeLimits*)val;
2407 val_conv.is_owned = true;
2408 return UserConfig_set_peer_channel_config_limits(this_ptr_conv, val_conv);
2411 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1get_1channel_1options(JNIEnv * _env, jclass _b, jlong this_ptr) {
2412 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
2413 LDKChannelConfig* ret = MALLOC(sizeof(LDKChannelConfig), "LDKChannelConfig");
2414 *ret = UserConfig_get_channel_options(this_ptr_conv);
2415 assert(ret->is_owned);
2416 ret->is_owned = false;
2420 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UserConfig_1set_1channel_1options(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2421 LDKUserConfig* this_ptr_conv = (LDKUserConfig*)this_ptr;
2422 LDKChannelConfig val_conv = *(LDKChannelConfig*)val;
2424 val_conv.is_owned = true;
2425 return UserConfig_set_channel_options(this_ptr_conv, val_conv);
2428 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) {
2429 LDKChannelHandshakeConfig own_channel_config_arg_conv = *(LDKChannelHandshakeConfig*)own_channel_config_arg;
2430 FREE((void*)own_channel_config_arg);
2431 own_channel_config_arg_conv.is_owned = true;
2432 LDKChannelHandshakeLimits peer_channel_config_limits_arg_conv = *(LDKChannelHandshakeLimits*)peer_channel_config_limits_arg;
2433 FREE((void*)peer_channel_config_limits_arg);
2434 peer_channel_config_limits_arg_conv.is_owned = true;
2435 LDKChannelConfig channel_options_arg_conv = *(LDKChannelConfig*)channel_options_arg;
2436 FREE((void*)channel_options_arg);
2437 channel_options_arg_conv.is_owned = true;
2438 LDKUserConfig* ret = MALLOC(sizeof(LDKUserConfig), "LDKUserConfig");
2439 *ret = UserConfig_new(own_channel_config_arg_conv, peer_channel_config_limits_arg_conv, channel_options_arg_conv);
2440 assert(ret->is_owned);
2441 ret->is_owned = false;
2445 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UserConfig_1default(JNIEnv * _env, jclass _b) {
2446 LDKUserConfig* ret = MALLOC(sizeof(LDKUserConfig), "LDKUserConfig");
2447 *ret = UserConfig_default();
2448 assert(ret->is_owned);
2449 ret->is_owned = false;
2453 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Access_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2454 LDKAccess this_ptr_conv = *(LDKAccess*)this_ptr;
2455 FREE((void*)this_ptr);
2456 return Access_free(this_ptr_conv);
2459 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Watch_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2460 LDKWatch this_ptr_conv = *(LDKWatch*)this_ptr;
2461 FREE((void*)this_ptr);
2462 return Watch_free(this_ptr_conv);
2465 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Filter_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2466 LDKFilter this_ptr_conv = *(LDKFilter*)this_ptr;
2467 FREE((void*)this_ptr);
2468 return Filter_free(this_ptr_conv);
2471 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_BroadcasterInterface_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2472 LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)this_ptr;
2473 FREE((void*)this_ptr);
2474 return BroadcasterInterface_free(this_ptr_conv);
2477 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FeeEstimator_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2478 LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)this_ptr;
2479 FREE((void*)this_ptr);
2480 return FeeEstimator_free(this_ptr_conv);
2483 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2484 LDKChainMonitor this_ptr_conv = *(LDKChainMonitor*)this_ptr;
2485 FREE((void*)this_ptr);
2486 this_ptr_conv.is_owned = true;
2487 return ChainMonitor_free(this_ptr_conv);
2490 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1block_1connected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jlong txdata, jint height) {
2491 LDKChainMonitor* this_arg_conv = (LDKChainMonitor*)this_arg;
2492 unsigned char header_arr[80];
2493 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
2494 unsigned char (*header_ref)[80] = &header_arr;
2495 LDKCVec_C2Tuple_usizeTransactionZZ txdata_conv = *(LDKCVec_C2Tuple_usizeTransactionZZ*)txdata;
2496 FREE((void*)txdata);
2497 return ChainMonitor_block_connected(this_arg_conv, header_ref, txdata_conv, height);
2500 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1block_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jint disconnected_height) {
2501 LDKChainMonitor* this_arg_conv = (LDKChainMonitor*)this_arg;
2502 unsigned char header_arr[80];
2503 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
2504 unsigned char (*header_ref)[80] = &header_arr;
2505 return ChainMonitor_block_disconnected(this_arg_conv, header_ref, disconnected_height);
2508 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1new(JNIEnv * _env, jclass _b, jlong chain_source, jlong broadcaster, jlong logger, jlong feeest) {
2509 LDKFilter* chain_source_conv = (LDKFilter*)chain_source;
2510 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)broadcaster;
2511 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
2512 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2513 LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
2515 LDKLogger logger_conv = *(LDKLogger*)logger;
2516 if (logger_conv.free == LDKLogger_JCalls_free) {
2517 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2518 LDKLogger_JCalls_clone(logger_conv.this_arg);
2520 LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)feeest;
2521 if (feeest_conv.free == LDKFeeEstimator_JCalls_free) {
2522 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2523 LDKFeeEstimator_JCalls_clone(feeest_conv.this_arg);
2525 LDKChainMonitor* ret = MALLOC(sizeof(LDKChainMonitor), "LDKChainMonitor");
2526 *ret = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv);
2527 assert(ret->is_owned);
2528 ret->is_owned = false;
2532 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1Watch(JNIEnv * _env, jclass _b, jlong this_arg) {
2533 LDKChainMonitor* this_arg_conv = (LDKChainMonitor*)this_arg;
2534 LDKWatch* ret = MALLOC(sizeof(LDKWatch), "LDKWatch");
2535 *ret = ChainMonitor_as_Watch(this_arg_conv);
2539 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChainMonitor_1as_1EventsProvider(JNIEnv * _env, jclass _b, jlong this_arg) {
2540 LDKChainMonitor* this_arg_conv = (LDKChainMonitor*)this_arg;
2541 LDKEventsProvider* ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
2542 *ret = ChainMonitor_as_EventsProvider(this_arg_conv);
2546 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2547 LDKChannelMonitorUpdate this_ptr_conv = *(LDKChannelMonitorUpdate*)this_ptr;
2548 FREE((void*)this_ptr);
2549 this_ptr_conv.is_owned = true;
2550 return ChannelMonitorUpdate_free(this_ptr_conv);
2553 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1get_1update_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
2554 LDKChannelMonitorUpdate* this_ptr_conv = (LDKChannelMonitorUpdate*)this_ptr;
2555 return ChannelMonitorUpdate_get_update_id(this_ptr_conv);
2558 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1set_1update_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2559 LDKChannelMonitorUpdate* this_ptr_conv = (LDKChannelMonitorUpdate*)this_ptr;
2560 return ChannelMonitorUpdate_set_update_id(this_ptr_conv, val);
2563 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
2564 LDKChannelMonitorUpdate* obj_conv = (LDKChannelMonitorUpdate*)obj;
2565 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
2566 *ret = ChannelMonitorUpdate_write(obj_conv);
2570 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitorUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
2571 LDKu8slice ser_conv = *(LDKu8slice*)ser;
2573 LDKChannelMonitorUpdate* ret = MALLOC(sizeof(LDKChannelMonitorUpdate), "LDKChannelMonitorUpdate");
2574 *ret = ChannelMonitorUpdate_read(ser_conv);
2575 assert(ret->is_owned);
2576 ret->is_owned = false;
2580 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorUpdateError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2581 LDKMonitorUpdateError this_ptr_conv = *(LDKMonitorUpdateError*)this_ptr;
2582 FREE((void*)this_ptr);
2583 this_ptr_conv.is_owned = true;
2584 return MonitorUpdateError_free(this_ptr_conv);
2587 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MonitorEvent_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2588 LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)this_ptr;
2589 FREE((void*)this_ptr);
2590 this_ptr_conv.is_owned = true;
2591 return MonitorEvent_free(this_ptr_conv);
2594 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2595 LDKHTLCUpdate this_ptr_conv = *(LDKHTLCUpdate*)this_ptr;
2596 FREE((void*)this_ptr);
2597 this_ptr_conv.is_owned = true;
2598 return HTLCUpdate_free(this_ptr_conv);
2601 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
2602 LDKHTLCUpdate* obj_conv = (LDKHTLCUpdate*)obj;
2603 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
2604 *ret = HTLCUpdate_write(obj_conv);
2608 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
2609 LDKu8slice ser_conv = *(LDKu8slice*)ser;
2611 LDKHTLCUpdate* ret = MALLOC(sizeof(LDKHTLCUpdate), "LDKHTLCUpdate");
2612 *ret = HTLCUpdate_read(ser_conv);
2613 assert(ret->is_owned);
2614 ret->is_owned = false;
2618 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2619 LDKChannelMonitor this_ptr_conv = *(LDKChannelMonitor*)this_ptr;
2620 FREE((void*)this_ptr);
2621 this_ptr_conv.is_owned = true;
2622 return ChannelMonitor_free(this_ptr_conv);
2625 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1update_1monitor(JNIEnv * _env, jclass _b, jlong this_arg, jlong updates, jlong broadcaster, jlong logger) {
2626 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2627 LDKChannelMonitorUpdate updates_conv = *(LDKChannelMonitorUpdate*)updates;
2628 FREE((void*)updates);
2629 updates_conv.is_owned = true;
2630 LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster;
2631 LDKLogger* logger_conv = (LDKLogger*)logger;
2632 LDKCResult_NoneMonitorUpdateErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneMonitorUpdateErrorZ), "LDKCResult_NoneMonitorUpdateErrorZ");
2633 *ret = ChannelMonitor_update_monitor(this_arg_conv, updates_conv, broadcaster_conv, logger_conv);
2637 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1update_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
2638 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2639 return ChannelMonitor_get_latest_update_id(this_arg_conv);
2642 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1funding_1txo(JNIEnv * _env, jclass _b, jlong this_arg) {
2643 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2644 LDKC2Tuple_OutPointScriptZ* ret = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
2645 *ret = ChannelMonitor_get_funding_txo(this_arg_conv);
2649 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1monitor_1events(JNIEnv * _env, jclass _b, jlong this_arg) {
2650 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2651 LDKCVec_MonitorEventZ* ret = MALLOC(sizeof(LDKCVec_MonitorEventZ), "LDKCVec_MonitorEventZ");
2652 *ret = ChannelMonitor_get_and_clear_pending_monitor_events(this_arg_conv);
2656 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1and_1clear_1pending_1events(JNIEnv * _env, jclass _b, jlong this_arg) {
2657 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2658 LDKCVec_EventZ* ret = MALLOC(sizeof(LDKCVec_EventZ), "LDKCVec_EventZ");
2659 *ret = ChannelMonitor_get_and_clear_pending_events(this_arg_conv);
2663 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelMonitor_1get_1latest_1holder_1commitment_1txn(JNIEnv * _env, jclass _b, jlong this_arg, jlong logger) {
2664 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2665 LDKLogger* logger_conv = (LDKLogger*)logger;
2666 LDKCVec_TransactionZ* ret = MALLOC(sizeof(LDKCVec_TransactionZ), "LDKCVec_TransactionZ");
2667 *ret = ChannelMonitor_get_latest_holder_commitment_txn(this_arg_conv, logger_conv);
2671 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) {
2672 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2673 unsigned char header_arr[80];
2674 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
2675 unsigned char (*header_ref)[80] = &header_arr;
2676 LDKCVec_C2Tuple_usizeTransactionZZ txdata_conv = *(LDKCVec_C2Tuple_usizeTransactionZZ*)txdata;
2677 FREE((void*)txdata);
2678 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)broadcaster;
2679 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
2680 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2681 LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
2683 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)fee_estimator;
2684 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
2685 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2686 LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
2688 LDKLogger logger_conv = *(LDKLogger*)logger;
2689 if (logger_conv.free == LDKLogger_JCalls_free) {
2690 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2691 LDKLogger_JCalls_clone(logger_conv.this_arg);
2693 LDKCVec_C2Tuple_TxidCVec_TxOutZZZ* ret = MALLOC(sizeof(LDKCVec_C2Tuple_TxidCVec_TxOutZZZ), "LDKCVec_C2Tuple_TxidCVec_TxOutZZZ");
2694 *ret = ChannelMonitor_block_connected(this_arg_conv, header_ref, txdata_conv, height, broadcaster_conv, fee_estimator_conv, logger_conv);
2698 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) {
2699 LDKChannelMonitor* this_arg_conv = (LDKChannelMonitor*)this_arg;
2700 unsigned char header_arr[80];
2701 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
2702 unsigned char (*header_ref)[80] = &header_arr;
2703 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)broadcaster;
2704 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
2705 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2706 LDKBroadcasterInterface_JCalls_clone(broadcaster_conv.this_arg);
2708 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)fee_estimator;
2709 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
2710 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2711 LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
2713 LDKLogger logger_conv = *(LDKLogger*)logger;
2714 if (logger_conv.free == LDKLogger_JCalls_free) {
2715 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2716 LDKLogger_JCalls_clone(logger_conv.this_arg);
2718 return ChannelMonitor_block_disconnected(this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
2721 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2722 LDKOutPoint this_ptr_conv = *(LDKOutPoint*)this_ptr;
2723 FREE((void*)this_ptr);
2724 this_ptr_conv.is_owned = true;
2725 return OutPoint_free(this_ptr_conv);
2728 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1txid(JNIEnv * _env, jclass _b, jlong this_ptr) {
2729 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
2730 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2731 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OutPoint_get_txid(this_ptr_conv));
2735 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1txid(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2736 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
2737 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
2739 return OutPoint_set_txid(this_ptr_conv, val_conv);
2742 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OutPoint_1get_1index(JNIEnv * _env, jclass _b, jlong this_ptr) {
2743 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
2744 return OutPoint_get_index(this_ptr_conv);
2747 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OutPoint_1set_1index(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
2748 LDKOutPoint* this_ptr_conv = (LDKOutPoint*)this_ptr;
2749 return OutPoint_set_index(this_ptr_conv, val);
2752 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1new(JNIEnv * _env, jclass _b, jlong txid_arg, jshort index_arg) {
2753 LDKThirtyTwoBytes txid_arg_conv = *(LDKThirtyTwoBytes*)txid_arg;
2754 FREE((void*)txid_arg);
2755 LDKOutPoint* ret = MALLOC(sizeof(LDKOutPoint), "LDKOutPoint");
2756 *ret = OutPoint_new(txid_arg_conv, index_arg);
2757 assert(ret->is_owned);
2758 ret->is_owned = false;
2762 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1to_1channel_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
2763 LDKOutPoint* this_arg_conv = (LDKOutPoint*)this_arg;
2764 LDKThirtyTwoBytes* ret = MALLOC(sizeof(LDKThirtyTwoBytes), "LDKThirtyTwoBytes");
2765 *ret = OutPoint_to_channel_id(this_arg_conv);
2769 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1write(JNIEnv * _env, jclass _b, jlong obj) {
2770 LDKOutPoint* obj_conv = (LDKOutPoint*)obj;
2771 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
2772 *ret = OutPoint_write(obj_conv);
2776 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OutPoint_1read(JNIEnv * _env, jclass _b, jlong ser) {
2777 LDKu8slice ser_conv = *(LDKu8slice*)ser;
2779 LDKOutPoint* ret = MALLOC(sizeof(LDKOutPoint), "LDKOutPoint");
2780 *ret = OutPoint_read(ser_conv);
2781 assert(ret->is_owned);
2782 ret->is_owned = false;
2786 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SpendableOutputDescriptor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2787 LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)this_ptr;
2788 FREE((void*)this_ptr);
2789 return SpendableOutputDescriptor_free(this_ptr_conv);
2792 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2793 LDKChannelKeys this_ptr_conv = *(LDKChannelKeys*)this_ptr;
2794 FREE((void*)this_ptr);
2795 return ChannelKeys_free(this_ptr_conv);
2798 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysInterface_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2799 LDKKeysInterface this_ptr_conv = *(LDKKeysInterface*)this_ptr;
2800 FREE((void*)this_ptr);
2801 return KeysInterface_free(this_ptr_conv);
2804 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2805 LDKInMemoryChannelKeys this_ptr_conv = *(LDKInMemoryChannelKeys*)this_ptr;
2806 FREE((void*)this_ptr);
2807 this_ptr_conv.is_owned = true;
2808 return InMemoryChannelKeys_free(this_ptr_conv);
2811 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1funding_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
2812 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2813 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2814 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_funding_key(this_ptr_conv));
2818 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1funding_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2819 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2820 LDKSecretKey val_conv = *(LDKSecretKey*)val;
2822 return InMemoryChannelKeys_set_funding_key(this_ptr_conv, val_conv);
2825 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1revocation_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
2826 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2827 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2828 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_revocation_base_key(this_ptr_conv));
2832 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1revocation_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2833 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2834 LDKSecretKey val_conv = *(LDKSecretKey*)val;
2836 return InMemoryChannelKeys_set_revocation_base_key(this_ptr_conv, val_conv);
2839 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
2840 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2841 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2842 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_payment_key(this_ptr_conv));
2846 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2847 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2848 LDKSecretKey val_conv = *(LDKSecretKey*)val;
2850 return InMemoryChannelKeys_set_payment_key(this_ptr_conv, val_conv);
2853 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1delayed_1payment_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
2854 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2855 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2856 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_delayed_payment_base_key(this_ptr_conv));
2860 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1delayed_1payment_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2861 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2862 LDKSecretKey val_conv = *(LDKSecretKey*)val;
2864 return InMemoryChannelKeys_set_delayed_payment_base_key(this_ptr_conv, val_conv);
2867 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1htlc_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
2868 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2869 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2870 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_htlc_base_key(this_ptr_conv));
2874 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1htlc_1base_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2875 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2876 LDKSecretKey val_conv = *(LDKSecretKey*)val;
2878 return InMemoryChannelKeys_set_htlc_base_key(this_ptr_conv, val_conv);
2881 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1get_1commitment_1seed(JNIEnv * _env, jclass _b, jlong this_ptr) {
2882 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2883 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
2884 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *InMemoryChannelKeys_get_commitment_seed(this_ptr_conv));
2888 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1set_1commitment_1seed(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
2889 LDKInMemoryChannelKeys* this_ptr_conv = (LDKInMemoryChannelKeys*)this_ptr;
2890 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
2892 return InMemoryChannelKeys_set_commitment_seed(this_ptr_conv, val_conv);
2895 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) {
2896 LDKSecretKey funding_key_conv = *(LDKSecretKey*)funding_key;
2897 FREE((void*)funding_key);
2898 LDKSecretKey revocation_base_key_conv = *(LDKSecretKey*)revocation_base_key;
2899 FREE((void*)revocation_base_key);
2900 LDKSecretKey payment_key_conv = *(LDKSecretKey*)payment_key;
2901 FREE((void*)payment_key);
2902 LDKSecretKey delayed_payment_base_key_conv = *(LDKSecretKey*)delayed_payment_base_key;
2903 FREE((void*)delayed_payment_base_key);
2904 LDKSecretKey htlc_base_key_conv = *(LDKSecretKey*)htlc_base_key;
2905 FREE((void*)htlc_base_key);
2906 LDKThirtyTwoBytes commitment_seed_conv = *(LDKThirtyTwoBytes*)commitment_seed;
2907 FREE((void*)commitment_seed);
2908 LDKC2Tuple_u64u64Z key_derivation_params_conv = *(LDKC2Tuple_u64u64Z*)key_derivation_params;
2909 FREE((void*)key_derivation_params);
2910 LDKInMemoryChannelKeys* ret = MALLOC(sizeof(LDKInMemoryChannelKeys), "LDKInMemoryChannelKeys");
2911 *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);
2912 assert(ret->is_owned);
2913 ret->is_owned = false;
2917 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1counterparty_1pubkeys(JNIEnv * _env, jclass _b, jlong this_arg) {
2918 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
2919 LDKChannelPublicKeys* ret = MALLOC(sizeof(LDKChannelPublicKeys), "LDKChannelPublicKeys");
2920 *ret = InMemoryChannelKeys_counterparty_pubkeys(this_arg_conv);
2921 assert(ret->is_owned);
2922 ret->is_owned = false;
2926 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1counterparty_1selected_1contest_1delay(JNIEnv * _env, jclass _b, jlong this_arg) {
2927 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
2928 return InMemoryChannelKeys_counterparty_selected_contest_delay(this_arg_conv);
2931 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1holder_1selected_1contest_1delay(JNIEnv * _env, jclass _b, jlong this_arg) {
2932 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
2933 return InMemoryChannelKeys_holder_selected_contest_delay(this_arg_conv);
2936 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1as_1ChannelKeys(JNIEnv * _env, jclass _b, jlong this_arg) {
2937 LDKInMemoryChannelKeys* this_arg_conv = (LDKInMemoryChannelKeys*)this_arg;
2938 LDKChannelKeys* ret = MALLOC(sizeof(LDKChannelKeys), "LDKChannelKeys");
2939 *ret = InMemoryChannelKeys_as_ChannelKeys(this_arg_conv);
2943 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1write(JNIEnv * _env, jclass _b, jlong obj) {
2944 LDKInMemoryChannelKeys* obj_conv = (LDKInMemoryChannelKeys*)obj;
2945 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
2946 *ret = InMemoryChannelKeys_write(obj_conv);
2950 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_InMemoryChannelKeys_1read(JNIEnv * _env, jclass _b, jlong ser) {
2951 LDKu8slice ser_conv = *(LDKu8slice*)ser;
2953 LDKInMemoryChannelKeys* ret = MALLOC(sizeof(LDKInMemoryChannelKeys), "LDKInMemoryChannelKeys");
2954 *ret = InMemoryChannelKeys_read(ser_conv);
2955 assert(ret->is_owned);
2956 ret->is_owned = false;
2960 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_KeysManager_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2961 LDKKeysManager this_ptr_conv = *(LDKKeysManager*)this_ptr;
2962 FREE((void*)this_ptr);
2963 this_ptr_conv.is_owned = true;
2964 return KeysManager_free(this_ptr_conv);
2967 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) {
2968 unsigned char seed_arr[32];
2969 (*_env)->GetByteArrayRegion (_env, seed, 0, 32, seed_arr);
2970 unsigned char (*seed_ref)[32] = &seed_arr;
2971 LDKNetwork network_conv = LDKNetwork_from_java(_env, network);
2972 LDKKeysManager* ret = MALLOC(sizeof(LDKKeysManager), "LDKKeysManager");
2973 *ret = KeysManager_new(seed_ref, network_conv, starting_time_secs, starting_time_nanos);
2974 assert(ret->is_owned);
2975 ret->is_owned = false;
2979 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) {
2980 LDKKeysManager* this_arg_conv = (LDKKeysManager*)this_arg;
2981 LDKInMemoryChannelKeys* ret = MALLOC(sizeof(LDKInMemoryChannelKeys), "LDKInMemoryChannelKeys");
2982 *ret = KeysManager_derive_channel_keys(this_arg_conv, channel_value_satoshis, params_1, params_2);
2983 assert(ret->is_owned);
2984 ret->is_owned = false;
2988 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_KeysManager_1as_1KeysInterface(JNIEnv * _env, jclass _b, jlong this_arg) {
2989 LDKKeysManager* this_arg_conv = (LDKKeysManager*)this_arg;
2990 LDKKeysInterface* ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
2991 *ret = KeysManager_as_KeysInterface(this_arg_conv);
2995 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
2996 LDKChannelManager this_ptr_conv = *(LDKChannelManager*)this_ptr;
2997 FREE((void*)this_ptr);
2998 this_ptr_conv.is_owned = true;
2999 return ChannelManager_free(this_ptr_conv);
3002 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3003 LDKChannelDetails this_ptr_conv = *(LDKChannelDetails*)this_ptr;
3004 FREE((void*)this_ptr);
3005 this_ptr_conv.is_owned = true;
3006 return ChannelDetails_free(this_ptr_conv);
3009 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3010 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
3011 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3012 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ChannelDetails_get_channel_id(this_ptr_conv));
3016 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3017 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
3018 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3020 return ChannelDetails_set_channel_id(this_ptr_conv, val_conv);
3023 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1remote_1network_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3024 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
3025 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3026 *ret = ChannelDetails_get_remote_network_id(this_ptr_conv);
3030 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1remote_1network_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3031 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
3032 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3034 return ChannelDetails_set_remote_network_id(this_ptr_conv, val_conv);
3037 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1counterparty_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
3038 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
3039 LDKInitFeatures* ret = MALLOC(sizeof(LDKInitFeatures), "LDKInitFeatures");
3040 *ret = ChannelDetails_get_counterparty_features(this_ptr_conv);
3041 assert(ret->is_owned);
3042 ret->is_owned = false;
3046 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1counterparty_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3047 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
3048 LDKInitFeatures val_conv = *(LDKInitFeatures*)val;
3050 val_conv.is_owned = true;
3051 return ChannelDetails_set_counterparty_features(this_ptr_conv, val_conv);
3054 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1channel_1value_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3055 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
3056 return ChannelDetails_get_channel_value_satoshis(this_ptr_conv);
3059 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1channel_1value_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3060 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
3061 return ChannelDetails_set_channel_value_satoshis(this_ptr_conv, val);
3064 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1user_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3065 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
3066 return ChannelDetails_get_user_id(this_ptr_conv);
3069 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1user_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3070 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
3071 return ChannelDetails_set_user_id(this_ptr_conv, val);
3074 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1outbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3075 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
3076 return ChannelDetails_get_outbound_capacity_msat(this_ptr_conv);
3079 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1outbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3080 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
3081 return ChannelDetails_set_outbound_capacity_msat(this_ptr_conv, val);
3084 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1inbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3085 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
3086 return ChannelDetails_get_inbound_capacity_msat(this_ptr_conv);
3089 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1inbound_1capacity_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3090 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
3091 return ChannelDetails_set_inbound_capacity_msat(this_ptr_conv, val);
3094 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1get_1is_1live(JNIEnv * _env, jclass _b, jlong this_ptr) {
3095 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
3096 return ChannelDetails_get_is_live(this_ptr_conv);
3099 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelDetails_1set_1is_1live(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
3100 LDKChannelDetails* this_ptr_conv = (LDKChannelDetails*)this_ptr;
3101 return ChannelDetails_set_is_live(this_ptr_conv, val);
3104 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PaymentSendFailure_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3105 LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)this_ptr;
3106 FREE((void*)this_ptr);
3107 this_ptr_conv.is_owned = true;
3108 return PaymentSendFailure_free(this_ptr_conv);
3111 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) {
3112 LDKNetwork network_conv = LDKNetwork_from_java(_env, network);
3113 LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)fee_est;
3114 if (fee_est_conv.free == LDKFeeEstimator_JCalls_free) {
3115 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3116 LDKFeeEstimator_JCalls_clone(fee_est_conv.this_arg);
3118 LDKWatch chain_monitor_conv = *(LDKWatch*)chain_monitor;
3119 if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
3120 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3121 LDKWatch_JCalls_clone(chain_monitor_conv.this_arg);
3123 LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)tx_broadcaster;
3124 if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
3125 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3126 LDKBroadcasterInterface_JCalls_clone(tx_broadcaster_conv.this_arg);
3128 LDKLogger logger_conv = *(LDKLogger*)logger;
3129 if (logger_conv.free == LDKLogger_JCalls_free) {
3130 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3131 LDKLogger_JCalls_clone(logger_conv.this_arg);
3133 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)keys_manager;
3134 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
3135 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3136 LDKKeysInterface_JCalls_clone(keys_manager_conv.this_arg);
3138 LDKUserConfig config_conv = *(LDKUserConfig*)config;
3139 FREE((void*)config);
3140 config_conv.is_owned = true;
3141 LDKChannelManager* ret = MALLOC(sizeof(LDKChannelManager), "LDKChannelManager");
3142 *ret = ChannelManager_new(network_conv, fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, keys_manager_conv, config_conv, current_blockchain_height);
3143 assert(ret->is_owned);
3144 ret->is_owned = false;
3148 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) {
3149 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3150 LDKPublicKey their_network_key_conv = *(LDKPublicKey*)their_network_key;
3151 FREE((void*)their_network_key);
3152 LDKUserConfig override_config_conv = *(LDKUserConfig*)override_config;
3153 FREE((void*)override_config);
3154 override_config_conv.is_owned = true;
3155 LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
3156 *ret = ChannelManager_create_channel(this_arg_conv, their_network_key_conv, channel_value_satoshis, push_msat, user_id, override_config_conv);
3160 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
3161 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3162 LDKCVec_ChannelDetailsZ* ret = MALLOC(sizeof(LDKCVec_ChannelDetailsZ), "LDKCVec_ChannelDetailsZ");
3163 *ret = ChannelManager_list_channels(this_arg_conv);
3167 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1list_1usable_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
3168 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3169 LDKCVec_ChannelDetailsZ* ret = MALLOC(sizeof(LDKCVec_ChannelDetailsZ), "LDKCVec_ChannelDetailsZ");
3170 *ret = ChannelManager_list_usable_channels(this_arg_conv);
3174 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1close_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray channel_id) {
3175 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3176 unsigned char channel_id_arr[32];
3177 (*_env)->GetByteArrayRegion (_env, channel_id, 0, 32, channel_id_arr);
3178 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
3179 LDKCResult_NoneAPIErrorZ* ret = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
3180 *ret = ChannelManager_close_channel(this_arg_conv, channel_id_ref);
3184 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1channel(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray channel_id) {
3185 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3186 unsigned char channel_id_arr[32];
3187 (*_env)->GetByteArrayRegion (_env, channel_id, 0, 32, channel_id_arr);
3188 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
3189 return ChannelManager_force_close_channel(this_arg_conv, channel_id_ref);
3192 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1force_1close_1all_1channels(JNIEnv * _env, jclass _b, jlong this_arg) {
3193 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3194 return ChannelManager_force_close_all_channels(this_arg_conv);
3197 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) {
3198 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3199 LDKRoute* route_conv = (LDKRoute*)route;
3200 LDKThirtyTwoBytes payment_hash_conv = *(LDKThirtyTwoBytes*)payment_hash;
3201 FREE((void*)payment_hash);
3202 LDKThirtyTwoBytes payment_secret_conv = *(LDKThirtyTwoBytes*)payment_secret;
3203 FREE((void*)payment_secret);
3204 LDKCResult_NonePaymentSendFailureZ* ret = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
3205 *ret = ChannelManager_send_payment(this_arg_conv, route_conv, payment_hash_conv, payment_secret_conv);
3209 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) {
3210 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3211 unsigned char temporary_channel_id_arr[32];
3212 (*_env)->GetByteArrayRegion (_env, temporary_channel_id, 0, 32, temporary_channel_id_arr);
3213 unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
3214 LDKOutPoint funding_txo_conv = *(LDKOutPoint*)funding_txo;
3215 FREE((void*)funding_txo);
3216 funding_txo_conv.is_owned = true;
3217 return ChannelManager_funding_transaction_generated(this_arg_conv, temporary_channel_id_ref, funding_txo_conv);
3220 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) {
3221 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3222 LDKThreeBytes rgb_conv = *(LDKThreeBytes*)rgb;
3224 LDKThirtyTwoBytes alias_conv = *(LDKThirtyTwoBytes*)alias;
3226 LDKCVec_NetAddressZ addresses_conv = *(LDKCVec_NetAddressZ*)addresses;
3227 FREE((void*)addresses);
3228 return ChannelManager_broadcast_node_announcement(this_arg_conv, rgb_conv, alias_conv, addresses_conv);
3231 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1process_1pending_1htlc_1forwards(JNIEnv * _env, jclass _b, jlong this_arg) {
3232 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3233 return ChannelManager_process_pending_htlc_forwards(this_arg_conv);
3236 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1timer_1chan_1freshness_1every_1min(JNIEnv * _env, jclass _b, jlong this_arg) {
3237 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3238 return ChannelManager_timer_chan_freshness_every_min(this_arg_conv);
3241 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) {
3242 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3243 unsigned char payment_hash_arr[32];
3244 (*_env)->GetByteArrayRegion (_env, payment_hash, 0, 32, payment_hash_arr);
3245 unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
3246 LDKThirtyTwoBytes payment_secret_conv = *(LDKThirtyTwoBytes*)payment_secret;
3247 FREE((void*)payment_secret);
3248 return ChannelManager_fail_htlc_backwards(this_arg_conv, payment_hash_ref, payment_secret_conv);
3251 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) {
3252 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3253 LDKThirtyTwoBytes payment_preimage_conv = *(LDKThirtyTwoBytes*)payment_preimage;
3254 FREE((void*)payment_preimage);
3255 LDKThirtyTwoBytes payment_secret_conv = *(LDKThirtyTwoBytes*)payment_secret;
3256 FREE((void*)payment_secret);
3257 return ChannelManager_claim_funds(this_arg_conv, payment_preimage_conv, payment_secret_conv, expected_amount);
3260 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1get_1our_1node_1id(JNIEnv * _env, jclass _b, jlong this_arg) {
3261 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3262 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3263 *ret = ChannelManager_get_our_node_id(this_arg_conv);
3267 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) {
3268 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3269 LDKOutPoint* funding_txo_conv = (LDKOutPoint*)funding_txo;
3270 return ChannelManager_channel_monitor_updated(this_arg_conv, funding_txo_conv, highest_applied_update_id);
3273 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1MessageSendEventsProvider(JNIEnv * _env, jclass _b, jlong this_arg) {
3274 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3275 LDKMessageSendEventsProvider* ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
3276 *ret = ChannelManager_as_MessageSendEventsProvider(this_arg_conv);
3280 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1EventsProvider(JNIEnv * _env, jclass _b, jlong this_arg) {
3281 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3282 LDKEventsProvider* ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
3283 *ret = ChannelManager_as_EventsProvider(this_arg_conv);
3287 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1block_1connected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header, jlong txdata, jint height) {
3288 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3289 unsigned char header_arr[80];
3290 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
3291 unsigned char (*header_ref)[80] = &header_arr;
3292 LDKCVec_C2Tuple_usizeTransactionZZ txdata_conv = *(LDKCVec_C2Tuple_usizeTransactionZZ*)txdata;
3293 FREE((void*)txdata);
3294 return ChannelManager_block_connected(this_arg_conv, header_ref, txdata_conv, height);
3297 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManager_1block_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jbyteArray header) {
3298 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3299 unsigned char header_arr[80];
3300 (*_env)->GetByteArrayRegion (_env, header, 0, 80, header_arr);
3301 unsigned char (*header_ref)[80] = &header_arr;
3302 return ChannelManager_block_disconnected(this_arg_conv, header_ref);
3305 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManager_1as_1ChannelMessageHandler(JNIEnv * _env, jclass _b, jlong this_arg) {
3306 LDKChannelManager* this_arg_conv = (LDKChannelManager*)this_arg;
3307 LDKChannelMessageHandler* ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
3308 *ret = ChannelManager_as_ChannelMessageHandler(this_arg_conv);
3312 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3313 LDKChannelManagerReadArgs this_ptr_conv = *(LDKChannelManagerReadArgs*)this_ptr;
3314 FREE((void*)this_ptr);
3315 this_ptr_conv.is_owned = true;
3316 return ChannelManagerReadArgs_free(this_ptr_conv);
3319 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1keys_1manager(JNIEnv * _env, jclass _b, jlong this_ptr) {
3320 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3321 long ret = (long)ChannelManagerReadArgs_get_keys_manager(this_ptr_conv);
3325 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1keys_1manager(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3326 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3327 LDKKeysInterface val_conv = *(LDKKeysInterface*)val;
3328 if (val_conv.free == LDKKeysInterface_JCalls_free) {
3329 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3330 LDKKeysInterface_JCalls_clone(val_conv.this_arg);
3332 return ChannelManagerReadArgs_set_keys_manager(this_ptr_conv, val_conv);
3335 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1fee_1estimator(JNIEnv * _env, jclass _b, jlong this_ptr) {
3336 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3337 long ret = (long)ChannelManagerReadArgs_get_fee_estimator(this_ptr_conv);
3341 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1fee_1estimator(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3342 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3343 LDKFeeEstimator val_conv = *(LDKFeeEstimator*)val;
3344 if (val_conv.free == LDKFeeEstimator_JCalls_free) {
3345 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3346 LDKFeeEstimator_JCalls_clone(val_conv.this_arg);
3348 return ChannelManagerReadArgs_set_fee_estimator(this_ptr_conv, val_conv);
3351 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1chain_1monitor(JNIEnv * _env, jclass _b, jlong this_ptr) {
3352 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3353 long ret = (long)ChannelManagerReadArgs_get_chain_monitor(this_ptr_conv);
3357 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1chain_1monitor(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3358 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3359 LDKWatch val_conv = *(LDKWatch*)val;
3360 if (val_conv.free == LDKWatch_JCalls_free) {
3361 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3362 LDKWatch_JCalls_clone(val_conv.this_arg);
3364 return ChannelManagerReadArgs_set_chain_monitor(this_ptr_conv, val_conv);
3367 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1tx_1broadcaster(JNIEnv * _env, jclass _b, jlong this_ptr) {
3368 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3369 long ret = (long)ChannelManagerReadArgs_get_tx_broadcaster(this_ptr_conv);
3373 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1tx_1broadcaster(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3374 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3375 LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)val;
3376 if (val_conv.free == LDKBroadcasterInterface_JCalls_free) {
3377 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3378 LDKBroadcasterInterface_JCalls_clone(val_conv.this_arg);
3380 return ChannelManagerReadArgs_set_tx_broadcaster(this_ptr_conv, val_conv);
3383 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1logger(JNIEnv * _env, jclass _b, jlong this_ptr) {
3384 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3385 long ret = (long)ChannelManagerReadArgs_get_logger(this_ptr_conv);
3389 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1logger(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3390 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3391 LDKLogger val_conv = *(LDKLogger*)val;
3392 if (val_conv.free == LDKLogger_JCalls_free) {
3393 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3394 LDKLogger_JCalls_clone(val_conv.this_arg);
3396 return ChannelManagerReadArgs_set_logger(this_ptr_conv, val_conv);
3399 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1get_1default_1config(JNIEnv * _env, jclass _b, jlong this_ptr) {
3400 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3401 LDKUserConfig* ret = MALLOC(sizeof(LDKUserConfig), "LDKUserConfig");
3402 *ret = ChannelManagerReadArgs_get_default_config(this_ptr_conv);
3403 assert(ret->is_owned);
3404 ret->is_owned = false;
3408 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelManagerReadArgs_1set_1default_1config(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3409 LDKChannelManagerReadArgs* this_ptr_conv = (LDKChannelManagerReadArgs*)this_ptr;
3410 LDKUserConfig val_conv = *(LDKUserConfig*)val;
3412 val_conv.is_owned = true;
3413 return ChannelManagerReadArgs_set_default_config(this_ptr_conv, val_conv);
3416 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) {
3417 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)keys_manager;
3418 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
3419 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3420 LDKKeysInterface_JCalls_clone(keys_manager_conv.this_arg);
3422 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)fee_estimator;
3423 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
3424 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3425 LDKFeeEstimator_JCalls_clone(fee_estimator_conv.this_arg);
3427 LDKWatch chain_monitor_conv = *(LDKWatch*)chain_monitor;
3428 if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
3429 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3430 LDKWatch_JCalls_clone(chain_monitor_conv.this_arg);
3432 LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)tx_broadcaster;
3433 if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
3434 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3435 LDKBroadcasterInterface_JCalls_clone(tx_broadcaster_conv.this_arg);
3437 LDKLogger logger_conv = *(LDKLogger*)logger;
3438 if (logger_conv.free == LDKLogger_JCalls_free) {
3439 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
3440 LDKLogger_JCalls_clone(logger_conv.this_arg);
3442 LDKUserConfig default_config_conv = *(LDKUserConfig*)default_config;
3443 FREE((void*)default_config);
3444 default_config_conv.is_owned = true;
3445 LDKCVec_ChannelMonitorZ channel_monitors_conv = *(LDKCVec_ChannelMonitorZ*)channel_monitors;
3446 FREE((void*)channel_monitors);
3447 LDKChannelManagerReadArgs* ret = MALLOC(sizeof(LDKChannelManagerReadArgs), "LDKChannelManagerReadArgs");
3448 *ret = ChannelManagerReadArgs_new(keys_manager_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, default_config_conv, channel_monitors_conv);
3449 assert(ret->is_owned);
3450 ret->is_owned = false;
3454 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DecodeError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3455 LDKDecodeError this_ptr_conv = *(LDKDecodeError*)this_ptr;
3456 FREE((void*)this_ptr);
3457 this_ptr_conv.is_owned = true;
3458 return DecodeError_free(this_ptr_conv);
3461 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Init_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3462 LDKInit this_ptr_conv = *(LDKInit*)this_ptr;
3463 FREE((void*)this_ptr);
3464 this_ptr_conv.is_owned = true;
3465 return Init_free(this_ptr_conv);
3468 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3469 LDKErrorMessage this_ptr_conv = *(LDKErrorMessage*)this_ptr;
3470 FREE((void*)this_ptr);
3471 this_ptr_conv.is_owned = true;
3472 return ErrorMessage_free(this_ptr_conv);
3475 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3476 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
3477 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3478 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ErrorMessage_get_channel_id(this_ptr_conv));
3482 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3483 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
3484 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3486 return ErrorMessage_set_channel_id(this_ptr_conv, val_conv);
3489 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1get_1data(JNIEnv * _env, jclass _b, jlong this_ptr) {
3490 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
3491 LDKStr* ret = MALLOC(sizeof(LDKStr), "LDKStr");
3492 *ret = ErrorMessage_get_data(this_ptr_conv);
3496 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1set_1data(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3497 LDKErrorMessage* this_ptr_conv = (LDKErrorMessage*)this_ptr;
3498 LDKCVec_u8Z val_conv = *(LDKCVec_u8Z*)val;
3500 return ErrorMessage_set_data(this_ptr_conv, val_conv);
3503 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong data_arg) {
3504 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
3505 FREE((void*)channel_id_arg);
3506 LDKCVec_u8Z data_arg_conv = *(LDKCVec_u8Z*)data_arg;
3507 FREE((void*)data_arg);
3508 LDKErrorMessage* ret = MALLOC(sizeof(LDKErrorMessage), "LDKErrorMessage");
3509 *ret = ErrorMessage_new(channel_id_arg_conv, data_arg_conv);
3510 assert(ret->is_owned);
3511 ret->is_owned = false;
3515 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3516 LDKPing this_ptr_conv = *(LDKPing*)this_ptr;
3517 FREE((void*)this_ptr);
3518 this_ptr_conv.is_owned = true;
3519 return Ping_free(this_ptr_conv);
3522 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Ping_1get_1ponglen(JNIEnv * _env, jclass _b, jlong this_ptr) {
3523 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
3524 return Ping_get_ponglen(this_ptr_conv);
3527 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1ponglen(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3528 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
3529 return Ping_set_ponglen(this_ptr_conv, val);
3532 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Ping_1get_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr) {
3533 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
3534 return Ping_get_byteslen(this_ptr_conv);
3537 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Ping_1set_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3538 LDKPing* this_ptr_conv = (LDKPing*)this_ptr;
3539 return Ping_set_byteslen(this_ptr_conv, val);
3542 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1new(JNIEnv * _env, jclass _b, jshort ponglen_arg, jshort byteslen_arg) {
3543 LDKPing* ret = MALLOC(sizeof(LDKPing), "LDKPing");
3544 *ret = Ping_new(ponglen_arg, byteslen_arg);
3545 assert(ret->is_owned);
3546 ret->is_owned = false;
3550 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3551 LDKPong this_ptr_conv = *(LDKPong*)this_ptr;
3552 FREE((void*)this_ptr);
3553 this_ptr_conv.is_owned = true;
3554 return Pong_free(this_ptr_conv);
3557 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_Pong_1get_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr) {
3558 LDKPong* this_ptr_conv = (LDKPong*)this_ptr;
3559 return Pong_get_byteslen(this_ptr_conv);
3562 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Pong_1set_1byteslen(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3563 LDKPong* this_ptr_conv = (LDKPong*)this_ptr;
3564 return Pong_set_byteslen(this_ptr_conv, val);
3567 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1new(JNIEnv * _env, jclass _b, jshort byteslen_arg) {
3568 LDKPong* ret = MALLOC(sizeof(LDKPong), "LDKPong");
3569 *ret = Pong_new(byteslen_arg);
3570 assert(ret->is_owned);
3571 ret->is_owned = false;
3575 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3576 LDKOpenChannel this_ptr_conv = *(LDKOpenChannel*)this_ptr;
3577 FREE((void*)this_ptr);
3578 this_ptr_conv.is_owned = true;
3579 return OpenChannel_free(this_ptr_conv);
3582 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
3583 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3584 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3585 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OpenChannel_get_chain_hash(this_ptr_conv));
3589 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3590 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3591 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3593 return OpenChannel_set_chain_hash(this_ptr_conv, val_conv);
3596 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3597 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3598 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3599 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *OpenChannel_get_temporary_channel_id(this_ptr_conv));
3603 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3604 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3605 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3607 return OpenChannel_set_temporary_channel_id(this_ptr_conv, val_conv);
3610 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3611 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3612 return OpenChannel_get_funding_satoshis(this_ptr_conv);
3615 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3616 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3617 return OpenChannel_set_funding_satoshis(this_ptr_conv, val);
3620 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1push_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3621 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3622 return OpenChannel_get_push_msat(this_ptr_conv);
3625 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1push_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3626 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3627 return OpenChannel_set_push_msat(this_ptr_conv, val);
3630 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3631 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3632 return OpenChannel_get_dust_limit_satoshis(this_ptr_conv);
3635 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3636 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3637 return OpenChannel_set_dust_limit_satoshis(this_ptr_conv, val);
3640 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3641 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3642 return OpenChannel_get_max_htlc_value_in_flight_msat(this_ptr_conv);
3645 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) {
3646 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3647 return OpenChannel_set_max_htlc_value_in_flight_msat(this_ptr_conv, val);
3650 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3651 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3652 return OpenChannel_get_channel_reserve_satoshis(this_ptr_conv);
3655 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3656 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3657 return OpenChannel_set_channel_reserve_satoshis(this_ptr_conv, val);
3660 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3661 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3662 return OpenChannel_get_htlc_minimum_msat(this_ptr_conv);
3665 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3666 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3667 return OpenChannel_set_htlc_minimum_msat(this_ptr_conv, val);
3670 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr) {
3671 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3672 return OpenChannel_get_feerate_per_kw(this_ptr_conv);
3675 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
3676 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3677 return OpenChannel_set_feerate_per_kw(this_ptr_conv, val);
3680 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
3681 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3682 return OpenChannel_get_to_self_delay(this_ptr_conv);
3685 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3686 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3687 return OpenChannel_set_to_self_delay(this_ptr_conv, val);
3690 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr) {
3691 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3692 return OpenChannel_get_max_accepted_htlcs(this_ptr_conv);
3695 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3696 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3697 return OpenChannel_set_max_accepted_htlcs(this_ptr_conv, val);
3700 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
3701 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3702 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3703 *ret = OpenChannel_get_funding_pubkey(this_ptr_conv);
3707 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3708 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3709 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3711 return OpenChannel_set_funding_pubkey(this_ptr_conv, val_conv);
3714 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
3715 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3716 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3717 *ret = OpenChannel_get_revocation_basepoint(this_ptr_conv);
3721 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3722 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3723 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3725 return OpenChannel_set_revocation_basepoint(this_ptr_conv, val_conv);
3728 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
3729 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3730 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3731 *ret = OpenChannel_get_payment_point(this_ptr_conv);
3735 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3736 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3737 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3739 return OpenChannel_set_payment_point(this_ptr_conv, val_conv);
3742 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
3743 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3744 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3745 *ret = OpenChannel_get_delayed_payment_basepoint(this_ptr_conv);
3749 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3750 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3751 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3753 return OpenChannel_set_delayed_payment_basepoint(this_ptr_conv, val_conv);
3756 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
3757 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3758 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3759 *ret = OpenChannel_get_htlc_basepoint(this_ptr_conv);
3763 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3764 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3765 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3767 return OpenChannel_set_htlc_basepoint(this_ptr_conv, val_conv);
3770 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
3771 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3772 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3773 *ret = OpenChannel_get_first_per_commitment_point(this_ptr_conv);
3777 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3778 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3779 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3781 return OpenChannel_set_first_per_commitment_point(this_ptr_conv, val_conv);
3784 JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_OpenChannel_1get_1channel_1flags(JNIEnv * _env, jclass _b, jlong this_ptr) {
3785 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3786 return OpenChannel_get_channel_flags(this_ptr_conv);
3789 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_OpenChannel_1set_1channel_1flags(JNIEnv * _env, jclass _b, jlong this_ptr, jbyte val) {
3790 LDKOpenChannel* this_ptr_conv = (LDKOpenChannel*)this_ptr;
3791 return OpenChannel_set_channel_flags(this_ptr_conv, val);
3794 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3795 LDKAcceptChannel this_ptr_conv = *(LDKAcceptChannel*)this_ptr;
3796 FREE((void*)this_ptr);
3797 this_ptr_conv.is_owned = true;
3798 return AcceptChannel_free(this_ptr_conv);
3801 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3802 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3803 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3804 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *AcceptChannel_get_temporary_channel_id(this_ptr_conv));
3808 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3809 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3810 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3812 return AcceptChannel_set_temporary_channel_id(this_ptr_conv, val_conv);
3815 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3816 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3817 return AcceptChannel_get_dust_limit_satoshis(this_ptr_conv);
3820 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1dust_1limit_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3821 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3822 return AcceptChannel_set_dust_limit_satoshis(this_ptr_conv, val);
3825 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1htlc_1value_1in_1flight_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3826 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3827 return AcceptChannel_get_max_htlc_value_in_flight_msat(this_ptr_conv);
3830 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) {
3831 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3832 return AcceptChannel_set_max_htlc_value_in_flight_msat(this_ptr_conv, val);
3835 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
3836 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3837 return AcceptChannel_get_channel_reserve_satoshis(this_ptr_conv);
3840 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1channel_1reserve_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3841 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3842 return AcceptChannel_set_channel_reserve_satoshis(this_ptr_conv, val);
3845 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
3846 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3847 return AcceptChannel_get_htlc_minimum_msat(this_ptr_conv);
3850 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3851 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3852 return AcceptChannel_set_htlc_minimum_msat(this_ptr_conv, val);
3855 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr) {
3856 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3857 return AcceptChannel_get_minimum_depth(this_ptr_conv);
3860 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1minimum_1depth(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
3861 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3862 return AcceptChannel_set_minimum_depth(this_ptr_conv, val);
3865 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr) {
3866 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3867 return AcceptChannel_get_to_self_delay(this_ptr_conv);
3870 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1to_1self_1delay(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3871 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3872 return AcceptChannel_set_to_self_delay(this_ptr_conv, val);
3875 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr) {
3876 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3877 return AcceptChannel_get_max_accepted_htlcs(this_ptr_conv);
3880 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1max_1accepted_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
3881 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3882 return AcceptChannel_set_max_accepted_htlcs(this_ptr_conv, val);
3885 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
3886 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3887 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3888 *ret = AcceptChannel_get_funding_pubkey(this_ptr_conv);
3892 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3893 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3894 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3896 return AcceptChannel_set_funding_pubkey(this_ptr_conv, val_conv);
3899 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
3900 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3901 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3902 *ret = AcceptChannel_get_revocation_basepoint(this_ptr_conv);
3906 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3907 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3908 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3910 return AcceptChannel_set_revocation_basepoint(this_ptr_conv, val_conv);
3913 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
3914 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3915 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3916 *ret = AcceptChannel_get_payment_point(this_ptr_conv);
3920 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3921 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3922 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3924 return AcceptChannel_set_payment_point(this_ptr_conv, val_conv);
3927 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
3928 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3929 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3930 *ret = AcceptChannel_get_delayed_payment_basepoint(this_ptr_conv);
3934 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3935 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3936 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3938 return AcceptChannel_set_delayed_payment_basepoint(this_ptr_conv, val_conv);
3941 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
3942 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3943 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3944 *ret = AcceptChannel_get_htlc_basepoint(this_ptr_conv);
3948 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3949 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3950 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3952 return AcceptChannel_set_htlc_basepoint(this_ptr_conv, val_conv);
3955 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1get_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
3956 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3957 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
3958 *ret = AcceptChannel_get_first_per_commitment_point(this_ptr_conv);
3962 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1set_1first_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3963 LDKAcceptChannel* this_ptr_conv = (LDKAcceptChannel*)this_ptr;
3964 LDKPublicKey val_conv = *(LDKPublicKey*)val;
3966 return AcceptChannel_set_first_per_commitment_point(this_ptr_conv, val_conv);
3969 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
3970 LDKFundingCreated this_ptr_conv = *(LDKFundingCreated*)this_ptr;
3971 FREE((void*)this_ptr);
3972 this_ptr_conv.is_owned = true;
3973 return FundingCreated_free(this_ptr_conv);
3976 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
3977 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3978 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3979 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingCreated_get_temporary_channel_id(this_ptr_conv));
3983 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1temporary_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3984 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3985 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
3987 return FundingCreated_set_temporary_channel_id(this_ptr_conv, val_conv);
3990 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1txid(JNIEnv * _env, jclass _b, jlong this_ptr) {
3991 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3992 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
3993 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingCreated_get_funding_txid(this_ptr_conv));
3997 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1txid(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
3998 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
3999 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4001 return FundingCreated_set_funding_txid(this_ptr_conv, val_conv);
4004 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1funding_1output_1index(JNIEnv * _env, jclass _b, jlong this_ptr) {
4005 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
4006 return FundingCreated_get_funding_output_index(this_ptr_conv);
4009 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1funding_1output_1index(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
4010 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
4011 return FundingCreated_set_funding_output_index(this_ptr_conv, val);
4014 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
4015 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
4016 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4017 *ret = FundingCreated_get_signature(this_ptr_conv);
4021 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingCreated_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4022 LDKFundingCreated* this_ptr_conv = (LDKFundingCreated*)this_ptr;
4023 LDKSignature val_conv = *(LDKSignature*)val;
4025 return FundingCreated_set_signature(this_ptr_conv, val_conv);
4028 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) {
4029 LDKThirtyTwoBytes temporary_channel_id_arg_conv = *(LDKThirtyTwoBytes*)temporary_channel_id_arg;
4030 FREE((void*)temporary_channel_id_arg);
4031 LDKThirtyTwoBytes funding_txid_arg_conv = *(LDKThirtyTwoBytes*)funding_txid_arg;
4032 FREE((void*)funding_txid_arg);
4033 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
4034 FREE((void*)signature_arg);
4035 LDKFundingCreated* ret = MALLOC(sizeof(LDKFundingCreated), "LDKFundingCreated");
4036 *ret = FundingCreated_new(temporary_channel_id_arg_conv, funding_txid_arg_conv, funding_output_index_arg, signature_arg_conv);
4037 assert(ret->is_owned);
4038 ret->is_owned = false;
4042 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4043 LDKFundingSigned this_ptr_conv = *(LDKFundingSigned*)this_ptr;
4044 FREE((void*)this_ptr);
4045 this_ptr_conv.is_owned = true;
4046 return FundingSigned_free(this_ptr_conv);
4049 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4050 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
4051 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4052 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingSigned_get_channel_id(this_ptr_conv));
4056 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4057 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
4058 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4060 return FundingSigned_set_channel_id(this_ptr_conv, val_conv);
4063 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
4064 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
4065 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4066 *ret = FundingSigned_get_signature(this_ptr_conv);
4070 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingSigned_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4071 LDKFundingSigned* this_ptr_conv = (LDKFundingSigned*)this_ptr;
4072 LDKSignature val_conv = *(LDKSignature*)val;
4074 return FundingSigned_set_signature(this_ptr_conv, val_conv);
4077 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong signature_arg) {
4078 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4079 FREE((void*)channel_id_arg);
4080 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
4081 FREE((void*)signature_arg);
4082 LDKFundingSigned* ret = MALLOC(sizeof(LDKFundingSigned), "LDKFundingSigned");
4083 *ret = FundingSigned_new(channel_id_arg_conv, signature_arg_conv);
4084 assert(ret->is_owned);
4085 ret->is_owned = false;
4089 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4090 LDKFundingLocked this_ptr_conv = *(LDKFundingLocked*)this_ptr;
4091 FREE((void*)this_ptr);
4092 this_ptr_conv.is_owned = true;
4093 return FundingLocked_free(this_ptr_conv);
4096 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4097 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
4098 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4099 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *FundingLocked_get_channel_id(this_ptr_conv));
4103 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4104 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
4105 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4107 return FundingLocked_set_channel_id(this_ptr_conv, val_conv);
4110 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1get_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
4111 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
4112 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4113 *ret = FundingLocked_get_next_per_commitment_point(this_ptr_conv);
4117 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_FundingLocked_1set_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4118 LDKFundingLocked* this_ptr_conv = (LDKFundingLocked*)this_ptr;
4119 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4121 return FundingLocked_set_next_per_commitment_point(this_ptr_conv, val_conv);
4124 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong next_per_commitment_point_arg) {
4125 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4126 FREE((void*)channel_id_arg);
4127 LDKPublicKey next_per_commitment_point_arg_conv = *(LDKPublicKey*)next_per_commitment_point_arg;
4128 FREE((void*)next_per_commitment_point_arg);
4129 LDKFundingLocked* ret = MALLOC(sizeof(LDKFundingLocked), "LDKFundingLocked");
4130 *ret = FundingLocked_new(channel_id_arg_conv, next_per_commitment_point_arg_conv);
4131 assert(ret->is_owned);
4132 ret->is_owned = false;
4136 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4137 LDKShutdown this_ptr_conv = *(LDKShutdown*)this_ptr;
4138 FREE((void*)this_ptr);
4139 this_ptr_conv.is_owned = true;
4140 return Shutdown_free(this_ptr_conv);
4143 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4144 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
4145 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4146 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *Shutdown_get_channel_id(this_ptr_conv));
4150 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4151 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
4152 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4154 return Shutdown_set_channel_id(this_ptr_conv, val_conv);
4157 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1get_1scriptpubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
4158 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
4159 LDKu8slice* ret = MALLOC(sizeof(LDKu8slice), "LDKu8slice");
4160 *ret = Shutdown_get_scriptpubkey(this_ptr_conv);
4164 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Shutdown_1set_1scriptpubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4165 LDKShutdown* this_ptr_conv = (LDKShutdown*)this_ptr;
4166 LDKCVec_u8Z val_conv = *(LDKCVec_u8Z*)val;
4168 return Shutdown_set_scriptpubkey(this_ptr_conv, val_conv);
4171 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jlong scriptpubkey_arg) {
4172 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4173 FREE((void*)channel_id_arg);
4174 LDKCVec_u8Z scriptpubkey_arg_conv = *(LDKCVec_u8Z*)scriptpubkey_arg;
4175 FREE((void*)scriptpubkey_arg);
4176 LDKShutdown* ret = MALLOC(sizeof(LDKShutdown), "LDKShutdown");
4177 *ret = Shutdown_new(channel_id_arg_conv, scriptpubkey_arg_conv);
4178 assert(ret->is_owned);
4179 ret->is_owned = false;
4183 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4184 LDKClosingSigned this_ptr_conv = *(LDKClosingSigned*)this_ptr;
4185 FREE((void*)this_ptr);
4186 this_ptr_conv.is_owned = true;
4187 return ClosingSigned_free(this_ptr_conv);
4190 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4191 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
4192 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4193 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ClosingSigned_get_channel_id(this_ptr_conv));
4197 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4198 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
4199 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4201 return ClosingSigned_set_channel_id(this_ptr_conv, val_conv);
4204 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1fee_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr) {
4205 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
4206 return ClosingSigned_get_fee_satoshis(this_ptr_conv);
4209 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1fee_1satoshis(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4210 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
4211 return ClosingSigned_set_fee_satoshis(this_ptr_conv, val);
4214 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
4215 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
4216 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4217 *ret = ClosingSigned_get_signature(this_ptr_conv);
4221 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4222 LDKClosingSigned* this_ptr_conv = (LDKClosingSigned*)this_ptr;
4223 LDKSignature val_conv = *(LDKSignature*)val;
4225 return ClosingSigned_set_signature(this_ptr_conv, val_conv);
4228 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) {
4229 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4230 FREE((void*)channel_id_arg);
4231 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
4232 FREE((void*)signature_arg);
4233 LDKClosingSigned* ret = MALLOC(sizeof(LDKClosingSigned), "LDKClosingSigned");
4234 *ret = ClosingSigned_new(channel_id_arg_conv, fee_satoshis_arg, signature_arg_conv);
4235 assert(ret->is_owned);
4236 ret->is_owned = false;
4240 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4241 LDKUpdateAddHTLC this_ptr_conv = *(LDKUpdateAddHTLC*)this_ptr;
4242 FREE((void*)this_ptr);
4243 this_ptr_conv.is_owned = true;
4244 return UpdateAddHTLC_free(this_ptr_conv);
4247 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4248 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4249 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4250 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateAddHTLC_get_channel_id(this_ptr_conv));
4254 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4255 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4256 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4258 return UpdateAddHTLC_set_channel_id(this_ptr_conv, val_conv);
4261 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4262 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4263 return UpdateAddHTLC_get_htlc_id(this_ptr_conv);
4266 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4267 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4268 return UpdateAddHTLC_set_htlc_id(this_ptr_conv, val);
4271 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
4272 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4273 return UpdateAddHTLC_get_amount_msat(this_ptr_conv);
4276 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4277 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4278 return UpdateAddHTLC_set_amount_msat(this_ptr_conv, val);
4281 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
4282 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4283 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4284 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateAddHTLC_get_payment_hash(this_ptr_conv));
4288 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4289 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4290 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4292 return UpdateAddHTLC_set_payment_hash(this_ptr_conv, val_conv);
4295 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1get_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr) {
4296 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4297 return UpdateAddHTLC_get_cltv_expiry(this_ptr_conv);
4300 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1set_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
4301 LDKUpdateAddHTLC* this_ptr_conv = (LDKUpdateAddHTLC*)this_ptr;
4302 return UpdateAddHTLC_set_cltv_expiry(this_ptr_conv, val);
4305 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4306 LDKUpdateFulfillHTLC this_ptr_conv = *(LDKUpdateFulfillHTLC*)this_ptr;
4307 FREE((void*)this_ptr);
4308 this_ptr_conv.is_owned = true;
4309 return UpdateFulfillHTLC_free(this_ptr_conv);
4312 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4313 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
4314 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4315 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_channel_id(this_ptr_conv));
4319 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4320 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
4321 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4323 return UpdateFulfillHTLC_set_channel_id(this_ptr_conv, val_conv);
4326 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4327 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
4328 return UpdateFulfillHTLC_get_htlc_id(this_ptr_conv);
4331 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4332 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
4333 return UpdateFulfillHTLC_set_htlc_id(this_ptr_conv, val);
4336 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1get_1payment_1preimage(JNIEnv * _env, jclass _b, jlong this_ptr) {
4337 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
4338 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4339 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFulfillHTLC_get_payment_preimage(this_ptr_conv));
4343 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1set_1payment_1preimage(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4344 LDKUpdateFulfillHTLC* this_ptr_conv = (LDKUpdateFulfillHTLC*)this_ptr;
4345 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4347 return UpdateFulfillHTLC_set_payment_preimage(this_ptr_conv, val_conv);
4350 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) {
4351 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4352 FREE((void*)channel_id_arg);
4353 LDKThirtyTwoBytes payment_preimage_arg_conv = *(LDKThirtyTwoBytes*)payment_preimage_arg;
4354 FREE((void*)payment_preimage_arg);
4355 LDKUpdateFulfillHTLC* ret = MALLOC(sizeof(LDKUpdateFulfillHTLC), "LDKUpdateFulfillHTLC");
4356 *ret = UpdateFulfillHTLC_new(channel_id_arg_conv, htlc_id_arg, payment_preimage_arg_conv);
4357 assert(ret->is_owned);
4358 ret->is_owned = false;
4362 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4363 LDKUpdateFailHTLC this_ptr_conv = *(LDKUpdateFailHTLC*)this_ptr;
4364 FREE((void*)this_ptr);
4365 this_ptr_conv.is_owned = true;
4366 return UpdateFailHTLC_free(this_ptr_conv);
4369 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4370 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
4371 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4372 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFailHTLC_get_channel_id(this_ptr_conv));
4376 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4377 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
4378 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4380 return UpdateFailHTLC_set_channel_id(this_ptr_conv, val_conv);
4383 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4384 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
4385 return UpdateFailHTLC_get_htlc_id(this_ptr_conv);
4388 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4389 LDKUpdateFailHTLC* this_ptr_conv = (LDKUpdateFailHTLC*)this_ptr;
4390 return UpdateFailHTLC_set_htlc_id(this_ptr_conv, val);
4393 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4394 LDKUpdateFailMalformedHTLC this_ptr_conv = *(LDKUpdateFailMalformedHTLC*)this_ptr;
4395 FREE((void*)this_ptr);
4396 this_ptr_conv.is_owned = true;
4397 return UpdateFailMalformedHTLC_free(this_ptr_conv);
4400 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4401 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
4402 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4403 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFailMalformedHTLC_get_channel_id(this_ptr_conv));
4407 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4408 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
4409 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4411 return UpdateFailMalformedHTLC_set_channel_id(this_ptr_conv, val_conv);
4414 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4415 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
4416 return UpdateFailMalformedHTLC_get_htlc_id(this_ptr_conv);
4419 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1htlc_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4420 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
4421 return UpdateFailMalformedHTLC_set_htlc_id(this_ptr_conv, val);
4424 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1get_1failure_1code(JNIEnv * _env, jclass _b, jlong this_ptr) {
4425 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
4426 return UpdateFailMalformedHTLC_get_failure_code(this_ptr_conv);
4429 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1set_1failure_1code(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
4430 LDKUpdateFailMalformedHTLC* this_ptr_conv = (LDKUpdateFailMalformedHTLC*)this_ptr;
4431 return UpdateFailMalformedHTLC_set_failure_code(this_ptr_conv, val);
4434 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4435 LDKCommitmentSigned this_ptr_conv = *(LDKCommitmentSigned*)this_ptr;
4436 FREE((void*)this_ptr);
4437 this_ptr_conv.is_owned = true;
4438 return CommitmentSigned_free(this_ptr_conv);
4441 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4442 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
4443 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4444 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *CommitmentSigned_get_channel_id(this_ptr_conv));
4448 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4449 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
4450 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4452 return CommitmentSigned_set_channel_id(this_ptr_conv, val_conv);
4455 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
4456 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
4457 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4458 *ret = CommitmentSigned_get_signature(this_ptr_conv);
4462 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4463 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
4464 LDKSignature val_conv = *(LDKSignature*)val;
4466 return CommitmentSigned_set_signature(this_ptr_conv, val_conv);
4469 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1set_1htlc_1signatures(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4470 LDKCommitmentSigned* this_ptr_conv = (LDKCommitmentSigned*)this_ptr;
4471 LDKCVec_SignatureZ val_conv = *(LDKCVec_SignatureZ*)val;
4473 return CommitmentSigned_set_htlc_signatures(this_ptr_conv, val_conv);
4476 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) {
4477 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4478 FREE((void*)channel_id_arg);
4479 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
4480 FREE((void*)signature_arg);
4481 LDKCVec_SignatureZ htlc_signatures_arg_conv = *(LDKCVec_SignatureZ*)htlc_signatures_arg;
4482 FREE((void*)htlc_signatures_arg);
4483 LDKCommitmentSigned* ret = MALLOC(sizeof(LDKCommitmentSigned), "LDKCommitmentSigned");
4484 *ret = CommitmentSigned_new(channel_id_arg_conv, signature_arg_conv, htlc_signatures_arg_conv);
4485 assert(ret->is_owned);
4486 ret->is_owned = false;
4490 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4491 LDKRevokeAndACK this_ptr_conv = *(LDKRevokeAndACK*)this_ptr;
4492 FREE((void*)this_ptr);
4493 this_ptr_conv.is_owned = true;
4494 return RevokeAndACK_free(this_ptr_conv);
4497 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4498 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
4499 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4500 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *RevokeAndACK_get_channel_id(this_ptr_conv));
4504 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4505 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
4506 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4508 return RevokeAndACK_set_channel_id(this_ptr_conv, val_conv);
4511 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr) {
4512 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
4513 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4514 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *RevokeAndACK_get_per_commitment_secret(this_ptr_conv));
4518 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4519 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
4520 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4522 return RevokeAndACK_set_per_commitment_secret(this_ptr_conv, val_conv);
4525 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1get_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
4526 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
4527 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4528 *ret = RevokeAndACK_get_next_per_commitment_point(this_ptr_conv);
4532 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1set_1next_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4533 LDKRevokeAndACK* this_ptr_conv = (LDKRevokeAndACK*)this_ptr;
4534 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4536 return RevokeAndACK_set_next_per_commitment_point(this_ptr_conv, val_conv);
4539 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) {
4540 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4541 FREE((void*)channel_id_arg);
4542 LDKThirtyTwoBytes per_commitment_secret_arg_conv = *(LDKThirtyTwoBytes*)per_commitment_secret_arg;
4543 FREE((void*)per_commitment_secret_arg);
4544 LDKPublicKey next_per_commitment_point_arg_conv = *(LDKPublicKey*)next_per_commitment_point_arg;
4545 FREE((void*)next_per_commitment_point_arg);
4546 LDKRevokeAndACK* ret = MALLOC(sizeof(LDKRevokeAndACK), "LDKRevokeAndACK");
4547 *ret = RevokeAndACK_new(channel_id_arg_conv, per_commitment_secret_arg_conv, next_per_commitment_point_arg_conv);
4548 assert(ret->is_owned);
4549 ret->is_owned = false;
4553 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4554 LDKUpdateFee this_ptr_conv = *(LDKUpdateFee*)this_ptr;
4555 FREE((void*)this_ptr);
4556 this_ptr_conv.is_owned = true;
4557 return UpdateFee_free(this_ptr_conv);
4560 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4561 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
4562 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4563 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UpdateFee_get_channel_id(this_ptr_conv));
4567 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4568 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
4569 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4571 return UpdateFee_set_channel_id(this_ptr_conv, val_conv);
4574 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UpdateFee_1get_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr) {
4575 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
4576 return UpdateFee_get_feerate_per_kw(this_ptr_conv);
4579 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UpdateFee_1set_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
4580 LDKUpdateFee* this_ptr_conv = (LDKUpdateFee*)this_ptr;
4581 return UpdateFee_set_feerate_per_kw(this_ptr_conv, val);
4584 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1new(JNIEnv * _env, jclass _b, jlong channel_id_arg, jint feerate_per_kw_arg) {
4585 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4586 FREE((void*)channel_id_arg);
4587 LDKUpdateFee* ret = MALLOC(sizeof(LDKUpdateFee), "LDKUpdateFee");
4588 *ret = UpdateFee_new(channel_id_arg_conv, feerate_per_kw_arg);
4589 assert(ret->is_owned);
4590 ret->is_owned = false;
4594 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4595 LDKDataLossProtect this_ptr_conv = *(LDKDataLossProtect*)this_ptr;
4596 FREE((void*)this_ptr);
4597 this_ptr_conv.is_owned = true;
4598 return DataLossProtect_free(this_ptr_conv);
4601 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1your_1last_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr) {
4602 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
4603 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4604 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *DataLossProtect_get_your_last_per_commitment_secret(this_ptr_conv));
4608 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1your_1last_1per_1commitment_1secret(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4609 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
4610 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4612 return DataLossProtect_set_your_last_per_commitment_secret(this_ptr_conv, val_conv);
4615 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1get_1my_1current_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
4616 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
4617 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4618 *ret = DataLossProtect_get_my_current_per_commitment_point(this_ptr_conv);
4622 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DataLossProtect_1set_1my_1current_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4623 LDKDataLossProtect* this_ptr_conv = (LDKDataLossProtect*)this_ptr;
4624 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4626 return DataLossProtect_set_my_current_per_commitment_point(this_ptr_conv, val_conv);
4629 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) {
4630 LDKThirtyTwoBytes your_last_per_commitment_secret_arg_conv = *(LDKThirtyTwoBytes*)your_last_per_commitment_secret_arg;
4631 FREE((void*)your_last_per_commitment_secret_arg);
4632 LDKPublicKey my_current_per_commitment_point_arg_conv = *(LDKPublicKey*)my_current_per_commitment_point_arg;
4633 FREE((void*)my_current_per_commitment_point_arg);
4634 LDKDataLossProtect* ret = MALLOC(sizeof(LDKDataLossProtect), "LDKDataLossProtect");
4635 *ret = DataLossProtect_new(your_last_per_commitment_secret_arg_conv, my_current_per_commitment_point_arg_conv);
4636 assert(ret->is_owned);
4637 ret->is_owned = false;
4641 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4642 LDKChannelReestablish this_ptr_conv = *(LDKChannelReestablish*)this_ptr;
4643 FREE((void*)this_ptr);
4644 this_ptr_conv.is_owned = true;
4645 return ChannelReestablish_free(this_ptr_conv);
4648 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4649 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
4650 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4651 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ChannelReestablish_get_channel_id(this_ptr_conv));
4655 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4656 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
4657 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4659 return ChannelReestablish_set_channel_id(this_ptr_conv, val_conv);
4662 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1local_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr) {
4663 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
4664 return ChannelReestablish_get_next_local_commitment_number(this_ptr_conv);
4667 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1local_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4668 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
4669 return ChannelReestablish_set_next_local_commitment_number(this_ptr_conv, val);
4672 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1get_1next_1remote_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr) {
4673 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
4674 return ChannelReestablish_get_next_remote_commitment_number(this_ptr_conv);
4677 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1set_1next_1remote_1commitment_1number(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4678 LDKChannelReestablish* this_ptr_conv = (LDKChannelReestablish*)this_ptr;
4679 return ChannelReestablish_set_next_remote_commitment_number(this_ptr_conv, val);
4682 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4683 LDKAnnouncementSignatures this_ptr_conv = *(LDKAnnouncementSignatures*)this_ptr;
4684 FREE((void*)this_ptr);
4685 this_ptr_conv.is_owned = true;
4686 return AnnouncementSignatures_free(this_ptr_conv);
4689 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4690 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4691 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4692 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *AnnouncementSignatures_get_channel_id(this_ptr_conv));
4696 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4697 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4698 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4700 return AnnouncementSignatures_set_channel_id(this_ptr_conv, val_conv);
4703 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4704 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4705 return AnnouncementSignatures_get_short_channel_id(this_ptr_conv);
4708 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4709 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4710 return AnnouncementSignatures_set_short_channel_id(this_ptr_conv, val);
4713 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1node_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
4714 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4715 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4716 *ret = AnnouncementSignatures_get_node_signature(this_ptr_conv);
4720 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1node_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4721 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4722 LDKSignature val_conv = *(LDKSignature*)val;
4724 return AnnouncementSignatures_set_node_signature(this_ptr_conv, val_conv);
4727 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1get_1bitcoin_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
4728 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4729 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4730 *ret = AnnouncementSignatures_get_bitcoin_signature(this_ptr_conv);
4734 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1set_1bitcoin_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4735 LDKAnnouncementSignatures* this_ptr_conv = (LDKAnnouncementSignatures*)this_ptr;
4736 LDKSignature val_conv = *(LDKSignature*)val;
4738 return AnnouncementSignatures_set_bitcoin_signature(this_ptr_conv, val_conv);
4741 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) {
4742 LDKThirtyTwoBytes channel_id_arg_conv = *(LDKThirtyTwoBytes*)channel_id_arg;
4743 FREE((void*)channel_id_arg);
4744 LDKSignature node_signature_arg_conv = *(LDKSignature*)node_signature_arg;
4745 FREE((void*)node_signature_arg);
4746 LDKSignature bitcoin_signature_arg_conv = *(LDKSignature*)bitcoin_signature_arg;
4747 FREE((void*)bitcoin_signature_arg);
4748 LDKAnnouncementSignatures* ret = MALLOC(sizeof(LDKAnnouncementSignatures), "LDKAnnouncementSignatures");
4749 *ret = AnnouncementSignatures_new(channel_id_arg_conv, short_channel_id_arg, node_signature_arg_conv, bitcoin_signature_arg_conv);
4750 assert(ret->is_owned);
4751 ret->is_owned = false;
4755 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetAddress_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4756 LDKNetAddress this_ptr_conv = *(LDKNetAddress*)this_ptr;
4757 FREE((void*)this_ptr);
4758 return NetAddress_free(this_ptr_conv);
4761 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4762 LDKUnsignedNodeAnnouncement this_ptr_conv = *(LDKUnsignedNodeAnnouncement*)this_ptr;
4763 FREE((void*)this_ptr);
4764 this_ptr_conv.is_owned = true;
4765 return UnsignedNodeAnnouncement_free(this_ptr_conv);
4768 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
4769 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4770 LDKNodeFeatures* ret = MALLOC(sizeof(LDKNodeFeatures), "LDKNodeFeatures");
4771 *ret = UnsignedNodeAnnouncement_get_features(this_ptr_conv);
4772 assert(ret->is_owned);
4773 ret->is_owned = false;
4777 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4778 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4779 LDKNodeFeatures val_conv = *(LDKNodeFeatures*)val;
4781 val_conv.is_owned = true;
4782 return UnsignedNodeAnnouncement_set_features(this_ptr_conv, val_conv);
4785 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr) {
4786 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4787 return UnsignedNodeAnnouncement_get_timestamp(this_ptr_conv);
4790 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
4791 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4792 return UnsignedNodeAnnouncement_set_timestamp(this_ptr_conv, val);
4795 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4796 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4797 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4798 *ret = UnsignedNodeAnnouncement_get_node_id(this_ptr_conv);
4802 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4803 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4804 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4806 return UnsignedNodeAnnouncement_set_node_id(this_ptr_conv, val_conv);
4809 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr) {
4810 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4811 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 3);
4812 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 3, *UnsignedNodeAnnouncement_get_rgb(this_ptr_conv));
4816 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4817 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4818 LDKThreeBytes val_conv = *(LDKThreeBytes*)val;
4820 return UnsignedNodeAnnouncement_set_rgb(this_ptr_conv, val_conv);
4823 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1get_1alias(JNIEnv * _env, jclass _b, jlong this_ptr) {
4824 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4825 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4826 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedNodeAnnouncement_get_alias(this_ptr_conv));
4830 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1alias(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4831 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4832 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4834 return UnsignedNodeAnnouncement_set_alias(this_ptr_conv, val_conv);
4837 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1set_1addresses(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4838 LDKUnsignedNodeAnnouncement* this_ptr_conv = (LDKUnsignedNodeAnnouncement*)this_ptr;
4839 LDKCVec_NetAddressZ val_conv = *(LDKCVec_NetAddressZ*)val;
4841 return UnsignedNodeAnnouncement_set_addresses(this_ptr_conv, val_conv);
4844 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4845 LDKNodeAnnouncement this_ptr_conv = *(LDKNodeAnnouncement*)this_ptr;
4846 FREE((void*)this_ptr);
4847 this_ptr_conv.is_owned = true;
4848 return NodeAnnouncement_free(this_ptr_conv);
4851 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
4852 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
4853 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
4854 *ret = NodeAnnouncement_get_signature(this_ptr_conv);
4858 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4859 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
4860 LDKSignature val_conv = *(LDKSignature*)val;
4862 return NodeAnnouncement_set_signature(this_ptr_conv, val_conv);
4865 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1get_1contents(JNIEnv * _env, jclass _b, jlong this_ptr) {
4866 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
4867 LDKUnsignedNodeAnnouncement* ret = MALLOC(sizeof(LDKUnsignedNodeAnnouncement), "LDKUnsignedNodeAnnouncement");
4868 *ret = NodeAnnouncement_get_contents(this_ptr_conv);
4869 assert(ret->is_owned);
4870 ret->is_owned = false;
4874 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1set_1contents(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4875 LDKNodeAnnouncement* this_ptr_conv = (LDKNodeAnnouncement*)this_ptr;
4876 LDKUnsignedNodeAnnouncement val_conv = *(LDKUnsignedNodeAnnouncement*)val;
4878 val_conv.is_owned = true;
4879 return NodeAnnouncement_set_contents(this_ptr_conv, val_conv);
4882 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1new(JNIEnv * _env, jclass _b, jlong signature_arg, jlong contents_arg) {
4883 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
4884 FREE((void*)signature_arg);
4885 LDKUnsignedNodeAnnouncement contents_arg_conv = *(LDKUnsignedNodeAnnouncement*)contents_arg;
4886 FREE((void*)contents_arg);
4887 contents_arg_conv.is_owned = true;
4888 LDKNodeAnnouncement* ret = MALLOC(sizeof(LDKNodeAnnouncement), "LDKNodeAnnouncement");
4889 *ret = NodeAnnouncement_new(signature_arg_conv, contents_arg_conv);
4890 assert(ret->is_owned);
4891 ret->is_owned = false;
4895 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
4896 LDKUnsignedChannelAnnouncement this_ptr_conv = *(LDKUnsignedChannelAnnouncement*)this_ptr;
4897 FREE((void*)this_ptr);
4898 this_ptr_conv.is_owned = true;
4899 return UnsignedChannelAnnouncement_free(this_ptr_conv);
4902 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
4903 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4904 LDKChannelFeatures* ret = MALLOC(sizeof(LDKChannelFeatures), "LDKChannelFeatures");
4905 *ret = UnsignedChannelAnnouncement_get_features(this_ptr_conv);
4906 assert(ret->is_owned);
4907 ret->is_owned = false;
4911 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4912 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4913 LDKChannelFeatures val_conv = *(LDKChannelFeatures*)val;
4915 val_conv.is_owned = true;
4916 return UnsignedChannelAnnouncement_set_features(this_ptr_conv, val_conv);
4919 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
4920 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4921 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
4922 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedChannelAnnouncement_get_chain_hash(this_ptr_conv));
4926 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4927 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4928 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
4930 return UnsignedChannelAnnouncement_set_chain_hash(this_ptr_conv, val_conv);
4933 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
4934 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4935 return UnsignedChannelAnnouncement_get_short_channel_id(this_ptr_conv);
4938 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4939 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4940 return UnsignedChannelAnnouncement_set_short_channel_id(this_ptr_conv, val);
4943 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
4944 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4945 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4946 *ret = UnsignedChannelAnnouncement_get_node_id_1(this_ptr_conv);
4950 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4951 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4952 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4954 return UnsignedChannelAnnouncement_set_node_id_1(this_ptr_conv, val_conv);
4957 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1node_1id_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
4958 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4959 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4960 *ret = UnsignedChannelAnnouncement_get_node_id_2(this_ptr_conv);
4964 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1node_1id_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4965 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4966 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4968 return UnsignedChannelAnnouncement_set_node_id_2(this_ptr_conv, val_conv);
4971 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
4972 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4973 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4974 *ret = UnsignedChannelAnnouncement_get_bitcoin_key_1(this_ptr_conv);
4978 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4979 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4980 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4982 return UnsignedChannelAnnouncement_set_bitcoin_key_1(this_ptr_conv, val_conv);
4985 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1get_1bitcoin_1key_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
4986 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4987 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
4988 *ret = UnsignedChannelAnnouncement_get_bitcoin_key_2(this_ptr_conv);
4992 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1set_1bitcoin_1key_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
4993 LDKUnsignedChannelAnnouncement* this_ptr_conv = (LDKUnsignedChannelAnnouncement*)this_ptr;
4994 LDKPublicKey val_conv = *(LDKPublicKey*)val;
4996 return UnsignedChannelAnnouncement_set_bitcoin_key_2(this_ptr_conv, val_conv);
4999 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5000 LDKChannelAnnouncement this_ptr_conv = *(LDKChannelAnnouncement*)this_ptr;
5001 FREE((void*)this_ptr);
5002 this_ptr_conv.is_owned = true;
5003 return ChannelAnnouncement_free(this_ptr_conv);
5006 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
5007 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
5008 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
5009 *ret = ChannelAnnouncement_get_node_signature_1(this_ptr_conv);
5013 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5014 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
5015 LDKSignature val_conv = *(LDKSignature*)val;
5017 return ChannelAnnouncement_set_node_signature_1(this_ptr_conv, val_conv);
5020 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1node_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
5021 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
5022 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
5023 *ret = ChannelAnnouncement_get_node_signature_2(this_ptr_conv);
5027 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1node_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5028 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
5029 LDKSignature val_conv = *(LDKSignature*)val;
5031 return ChannelAnnouncement_set_node_signature_2(this_ptr_conv, val_conv);
5034 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr) {
5035 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
5036 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
5037 *ret = ChannelAnnouncement_get_bitcoin_signature_1(this_ptr_conv);
5041 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_11(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5042 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
5043 LDKSignature val_conv = *(LDKSignature*)val;
5045 return ChannelAnnouncement_set_bitcoin_signature_1(this_ptr_conv, val_conv);
5048 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1bitcoin_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr) {
5049 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
5050 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
5051 *ret = ChannelAnnouncement_get_bitcoin_signature_2(this_ptr_conv);
5055 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1bitcoin_1signature_12(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5056 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
5057 LDKSignature val_conv = *(LDKSignature*)val;
5059 return ChannelAnnouncement_set_bitcoin_signature_2(this_ptr_conv, val_conv);
5062 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1get_1contents(JNIEnv * _env, jclass _b, jlong this_ptr) {
5063 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
5064 LDKUnsignedChannelAnnouncement* ret = MALLOC(sizeof(LDKUnsignedChannelAnnouncement), "LDKUnsignedChannelAnnouncement");
5065 *ret = ChannelAnnouncement_get_contents(this_ptr_conv);
5066 assert(ret->is_owned);
5067 ret->is_owned = false;
5071 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1set_1contents(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5072 LDKChannelAnnouncement* this_ptr_conv = (LDKChannelAnnouncement*)this_ptr;
5073 LDKUnsignedChannelAnnouncement val_conv = *(LDKUnsignedChannelAnnouncement*)val;
5075 val_conv.is_owned = true;
5076 return ChannelAnnouncement_set_contents(this_ptr_conv, val_conv);
5079 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) {
5080 LDKSignature node_signature_1_arg_conv = *(LDKSignature*)node_signature_1_arg;
5081 FREE((void*)node_signature_1_arg);
5082 LDKSignature node_signature_2_arg_conv = *(LDKSignature*)node_signature_2_arg;
5083 FREE((void*)node_signature_2_arg);
5084 LDKSignature bitcoin_signature_1_arg_conv = *(LDKSignature*)bitcoin_signature_1_arg;
5085 FREE((void*)bitcoin_signature_1_arg);
5086 LDKSignature bitcoin_signature_2_arg_conv = *(LDKSignature*)bitcoin_signature_2_arg;
5087 FREE((void*)bitcoin_signature_2_arg);
5088 LDKUnsignedChannelAnnouncement contents_arg_conv = *(LDKUnsignedChannelAnnouncement*)contents_arg;
5089 FREE((void*)contents_arg);
5090 contents_arg_conv.is_owned = true;
5091 LDKChannelAnnouncement* ret = MALLOC(sizeof(LDKChannelAnnouncement), "LDKChannelAnnouncement");
5092 *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);
5093 assert(ret->is_owned);
5094 ret->is_owned = false;
5098 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5099 LDKUnsignedChannelUpdate this_ptr_conv = *(LDKUnsignedChannelUpdate*)this_ptr;
5100 FREE((void*)this_ptr);
5101 this_ptr_conv.is_owned = true;
5102 return UnsignedChannelUpdate_free(this_ptr_conv);
5105 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
5106 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5107 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5108 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *UnsignedChannelUpdate_get_chain_hash(this_ptr_conv));
5112 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5113 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5114 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5116 return UnsignedChannelUpdate_set_chain_hash(this_ptr_conv, val_conv);
5119 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
5120 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5121 return UnsignedChannelUpdate_get_short_channel_id(this_ptr_conv);
5124 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5125 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5126 return UnsignedChannelUpdate_set_short_channel_id(this_ptr_conv, val);
5129 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr) {
5130 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5131 return UnsignedChannelUpdate_get_timestamp(this_ptr_conv);
5134 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5135 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5136 return UnsignedChannelUpdate_set_timestamp(this_ptr_conv, val);
5139 JNIEXPORT jbyte JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1flags(JNIEnv * _env, jclass _b, jlong this_ptr) {
5140 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5141 return UnsignedChannelUpdate_get_flags(this_ptr_conv);
5144 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1flags(JNIEnv * _env, jclass _b, jlong this_ptr, jbyte val) {
5145 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5146 return UnsignedChannelUpdate_set_flags(this_ptr_conv, val);
5149 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
5150 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5151 return UnsignedChannelUpdate_get_cltv_expiry_delta(this_ptr_conv);
5154 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
5155 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5156 return UnsignedChannelUpdate_set_cltv_expiry_delta(this_ptr_conv, val);
5159 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
5160 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5161 return UnsignedChannelUpdate_get_htlc_minimum_msat(this_ptr_conv);
5164 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5165 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5166 return UnsignedChannelUpdate_set_htlc_minimum_msat(this_ptr_conv, val);
5169 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
5170 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5171 return UnsignedChannelUpdate_get_fee_base_msat(this_ptr_conv);
5174 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5175 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5176 return UnsignedChannelUpdate_set_fee_base_msat(this_ptr_conv, val);
5179 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1get_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr) {
5180 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5181 return UnsignedChannelUpdate_get_fee_proportional_millionths(this_ptr_conv);
5184 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1set_1fee_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5185 LDKUnsignedChannelUpdate* this_ptr_conv = (LDKUnsignedChannelUpdate*)this_ptr;
5186 return UnsignedChannelUpdate_set_fee_proportional_millionths(this_ptr_conv, val);
5189 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5190 LDKChannelUpdate this_ptr_conv = *(LDKChannelUpdate*)this_ptr;
5191 FREE((void*)this_ptr);
5192 this_ptr_conv.is_owned = true;
5193 return ChannelUpdate_free(this_ptr_conv);
5196 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1signature(JNIEnv * _env, jclass _b, jlong this_ptr) {
5197 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
5198 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
5199 *ret = ChannelUpdate_get_signature(this_ptr_conv);
5203 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1signature(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5204 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
5205 LDKSignature val_conv = *(LDKSignature*)val;
5207 return ChannelUpdate_set_signature(this_ptr_conv, val_conv);
5210 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1get_1contents(JNIEnv * _env, jclass _b, jlong this_ptr) {
5211 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
5212 LDKUnsignedChannelUpdate* ret = MALLOC(sizeof(LDKUnsignedChannelUpdate), "LDKUnsignedChannelUpdate");
5213 *ret = ChannelUpdate_get_contents(this_ptr_conv);
5214 assert(ret->is_owned);
5215 ret->is_owned = false;
5219 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1set_1contents(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5220 LDKChannelUpdate* this_ptr_conv = (LDKChannelUpdate*)this_ptr;
5221 LDKUnsignedChannelUpdate val_conv = *(LDKUnsignedChannelUpdate*)val;
5223 val_conv.is_owned = true;
5224 return ChannelUpdate_set_contents(this_ptr_conv, val_conv);
5227 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1new(JNIEnv * _env, jclass _b, jlong signature_arg, jlong contents_arg) {
5228 LDKSignature signature_arg_conv = *(LDKSignature*)signature_arg;
5229 FREE((void*)signature_arg);
5230 LDKUnsignedChannelUpdate contents_arg_conv = *(LDKUnsignedChannelUpdate*)contents_arg;
5231 FREE((void*)contents_arg);
5232 contents_arg_conv.is_owned = true;
5233 LDKChannelUpdate* ret = MALLOC(sizeof(LDKChannelUpdate), "LDKChannelUpdate");
5234 *ret = ChannelUpdate_new(signature_arg_conv, contents_arg_conv);
5235 assert(ret->is_owned);
5236 ret->is_owned = false;
5240 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5241 LDKQueryChannelRange this_ptr_conv = *(LDKQueryChannelRange*)this_ptr;
5242 FREE((void*)this_ptr);
5243 this_ptr_conv.is_owned = true;
5244 return QueryChannelRange_free(this_ptr_conv);
5247 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
5248 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
5249 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5250 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *QueryChannelRange_get_chain_hash(this_ptr_conv));
5254 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5255 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
5256 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5258 return QueryChannelRange_set_chain_hash(this_ptr_conv, val_conv);
5261 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1first_1blocknum(JNIEnv * _env, jclass _b, jlong this_ptr) {
5262 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
5263 return QueryChannelRange_get_first_blocknum(this_ptr_conv);
5266 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1first_1blocknum(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5267 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
5268 return QueryChannelRange_set_first_blocknum(this_ptr_conv, val);
5271 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1get_1number_1of_1blocks(JNIEnv * _env, jclass _b, jlong this_ptr) {
5272 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
5273 return QueryChannelRange_get_number_of_blocks(this_ptr_conv);
5276 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1set_1number_1of_1blocks(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5277 LDKQueryChannelRange* this_ptr_conv = (LDKQueryChannelRange*)this_ptr;
5278 return QueryChannelRange_set_number_of_blocks(this_ptr_conv, val);
5281 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) {
5282 LDKThirtyTwoBytes chain_hash_arg_conv = *(LDKThirtyTwoBytes*)chain_hash_arg;
5283 FREE((void*)chain_hash_arg);
5284 LDKQueryChannelRange* ret = MALLOC(sizeof(LDKQueryChannelRange), "LDKQueryChannelRange");
5285 *ret = QueryChannelRange_new(chain_hash_arg_conv, first_blocknum_arg, number_of_blocks_arg);
5286 assert(ret->is_owned);
5287 ret->is_owned = false;
5291 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5292 LDKReplyChannelRange this_ptr_conv = *(LDKReplyChannelRange*)this_ptr;
5293 FREE((void*)this_ptr);
5294 this_ptr_conv.is_owned = true;
5295 return ReplyChannelRange_free(this_ptr_conv);
5298 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
5299 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5300 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5301 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ReplyChannelRange_get_chain_hash(this_ptr_conv));
5305 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5306 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5307 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5309 return ReplyChannelRange_set_chain_hash(this_ptr_conv, val_conv);
5312 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1first_1blocknum(JNIEnv * _env, jclass _b, jlong this_ptr) {
5313 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5314 return ReplyChannelRange_get_first_blocknum(this_ptr_conv);
5317 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1first_1blocknum(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5318 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5319 return ReplyChannelRange_set_first_blocknum(this_ptr_conv, val);
5322 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1number_1of_1blocks(JNIEnv * _env, jclass _b, jlong this_ptr) {
5323 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5324 return ReplyChannelRange_get_number_of_blocks(this_ptr_conv);
5327 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1number_1of_1blocks(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5328 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5329 return ReplyChannelRange_set_number_of_blocks(this_ptr_conv, val);
5332 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1get_1full_1information(JNIEnv * _env, jclass _b, jlong this_ptr) {
5333 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5334 return ReplyChannelRange_get_full_information(this_ptr_conv);
5337 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1full_1information(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
5338 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5339 return ReplyChannelRange_set_full_information(this_ptr_conv, val);
5342 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1set_1short_1channel_1ids(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5343 LDKReplyChannelRange* this_ptr_conv = (LDKReplyChannelRange*)this_ptr;
5344 LDKCVec_u64Z val_conv = *(LDKCVec_u64Z*)val;
5346 return ReplyChannelRange_set_short_channel_ids(this_ptr_conv, val_conv);
5349 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) {
5350 LDKThirtyTwoBytes chain_hash_arg_conv = *(LDKThirtyTwoBytes*)chain_hash_arg;
5351 FREE((void*)chain_hash_arg);
5352 LDKCVec_u64Z short_channel_ids_arg_conv = *(LDKCVec_u64Z*)short_channel_ids_arg;
5353 FREE((void*)short_channel_ids_arg);
5354 LDKReplyChannelRange* ret = MALLOC(sizeof(LDKReplyChannelRange), "LDKReplyChannelRange");
5355 *ret = ReplyChannelRange_new(chain_hash_arg_conv, first_blocknum_arg, number_of_blocks_arg, full_information_arg, short_channel_ids_arg_conv);
5356 assert(ret->is_owned);
5357 ret->is_owned = false;
5361 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5362 LDKQueryShortChannelIds this_ptr_conv = *(LDKQueryShortChannelIds*)this_ptr;
5363 FREE((void*)this_ptr);
5364 this_ptr_conv.is_owned = true;
5365 return QueryShortChannelIds_free(this_ptr_conv);
5368 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
5369 LDKQueryShortChannelIds* this_ptr_conv = (LDKQueryShortChannelIds*)this_ptr;
5370 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5371 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *QueryShortChannelIds_get_chain_hash(this_ptr_conv));
5375 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5376 LDKQueryShortChannelIds* this_ptr_conv = (LDKQueryShortChannelIds*)this_ptr;
5377 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5379 return QueryShortChannelIds_set_chain_hash(this_ptr_conv, val_conv);
5382 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1set_1short_1channel_1ids(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5383 LDKQueryShortChannelIds* this_ptr_conv = (LDKQueryShortChannelIds*)this_ptr;
5384 LDKCVec_u64Z val_conv = *(LDKCVec_u64Z*)val;
5386 return QueryShortChannelIds_set_short_channel_ids(this_ptr_conv, val_conv);
5389 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1new(JNIEnv * _env, jclass _b, jlong chain_hash_arg, jlong short_channel_ids_arg) {
5390 LDKThirtyTwoBytes chain_hash_arg_conv = *(LDKThirtyTwoBytes*)chain_hash_arg;
5391 FREE((void*)chain_hash_arg);
5392 LDKCVec_u64Z short_channel_ids_arg_conv = *(LDKCVec_u64Z*)short_channel_ids_arg;
5393 FREE((void*)short_channel_ids_arg);
5394 LDKQueryShortChannelIds* ret = MALLOC(sizeof(LDKQueryShortChannelIds), "LDKQueryShortChannelIds");
5395 *ret = QueryShortChannelIds_new(chain_hash_arg_conv, short_channel_ids_arg_conv);
5396 assert(ret->is_owned);
5397 ret->is_owned = false;
5401 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5402 LDKReplyShortChannelIdsEnd this_ptr_conv = *(LDKReplyShortChannelIdsEnd*)this_ptr;
5403 FREE((void*)this_ptr);
5404 this_ptr_conv.is_owned = true;
5405 return ReplyShortChannelIdsEnd_free(this_ptr_conv);
5408 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
5409 LDKReplyShortChannelIdsEnd* this_ptr_conv = (LDKReplyShortChannelIdsEnd*)this_ptr;
5410 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5411 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *ReplyShortChannelIdsEnd_get_chain_hash(this_ptr_conv));
5415 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5416 LDKReplyShortChannelIdsEnd* this_ptr_conv = (LDKReplyShortChannelIdsEnd*)this_ptr;
5417 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5419 return ReplyShortChannelIdsEnd_set_chain_hash(this_ptr_conv, val_conv);
5422 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1get_1full_1information(JNIEnv * _env, jclass _b, jlong this_ptr) {
5423 LDKReplyShortChannelIdsEnd* this_ptr_conv = (LDKReplyShortChannelIdsEnd*)this_ptr;
5424 return ReplyShortChannelIdsEnd_get_full_information(this_ptr_conv);
5427 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1set_1full_1information(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
5428 LDKReplyShortChannelIdsEnd* this_ptr_conv = (LDKReplyShortChannelIdsEnd*)this_ptr;
5429 return ReplyShortChannelIdsEnd_set_full_information(this_ptr_conv, val);
5432 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1new(JNIEnv * _env, jclass _b, jlong chain_hash_arg, jboolean full_information_arg) {
5433 LDKThirtyTwoBytes chain_hash_arg_conv = *(LDKThirtyTwoBytes*)chain_hash_arg;
5434 FREE((void*)chain_hash_arg);
5435 LDKReplyShortChannelIdsEnd* ret = MALLOC(sizeof(LDKReplyShortChannelIdsEnd), "LDKReplyShortChannelIdsEnd");
5436 *ret = ReplyShortChannelIdsEnd_new(chain_hash_arg_conv, full_information_arg);
5437 assert(ret->is_owned);
5438 ret->is_owned = false;
5442 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5443 LDKGossipTimestampFilter this_ptr_conv = *(LDKGossipTimestampFilter*)this_ptr;
5444 FREE((void*)this_ptr);
5445 this_ptr_conv.is_owned = true;
5446 return GossipTimestampFilter_free(this_ptr_conv);
5449 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
5450 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
5451 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
5452 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *GossipTimestampFilter_get_chain_hash(this_ptr_conv));
5456 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1chain_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5457 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
5458 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
5460 return GossipTimestampFilter_set_chain_hash(this_ptr_conv, val_conv);
5463 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1first_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr) {
5464 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
5465 return GossipTimestampFilter_get_first_timestamp(this_ptr_conv);
5468 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1first_1timestamp(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5469 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
5470 return GossipTimestampFilter_set_first_timestamp(this_ptr_conv, val);
5473 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1get_1timestamp_1range(JNIEnv * _env, jclass _b, jlong this_ptr) {
5474 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
5475 return GossipTimestampFilter_get_timestamp_range(this_ptr_conv);
5478 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1set_1timestamp_1range(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
5479 LDKGossipTimestampFilter* this_ptr_conv = (LDKGossipTimestampFilter*)this_ptr;
5480 return GossipTimestampFilter_set_timestamp_range(this_ptr_conv, val);
5483 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) {
5484 LDKThirtyTwoBytes chain_hash_arg_conv = *(LDKThirtyTwoBytes*)chain_hash_arg;
5485 FREE((void*)chain_hash_arg);
5486 LDKGossipTimestampFilter* ret = MALLOC(sizeof(LDKGossipTimestampFilter), "LDKGossipTimestampFilter");
5487 *ret = GossipTimestampFilter_new(chain_hash_arg_conv, first_timestamp_arg, timestamp_range_arg);
5488 assert(ret->is_owned);
5489 ret->is_owned = false;
5493 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ErrorAction_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5494 LDKErrorAction this_ptr_conv = *(LDKErrorAction*)this_ptr;
5495 FREE((void*)this_ptr);
5496 return ErrorAction_free(this_ptr_conv);
5499 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5500 LDKLightningError this_ptr_conv = *(LDKLightningError*)this_ptr;
5501 FREE((void*)this_ptr);
5502 this_ptr_conv.is_owned = true;
5503 return LightningError_free(this_ptr_conv);
5506 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1err(JNIEnv * _env, jclass _b, jlong this_ptr) {
5507 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
5508 LDKStr* ret = MALLOC(sizeof(LDKStr), "LDKStr");
5509 *ret = LightningError_get_err(this_ptr_conv);
5513 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1err(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5514 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
5515 LDKCVec_u8Z val_conv = *(LDKCVec_u8Z*)val;
5517 return LightningError_set_err(this_ptr_conv, val_conv);
5520 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1get_1action(JNIEnv * _env, jclass _b, jlong this_ptr) {
5521 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
5522 LDKErrorAction* ret = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
5523 *ret = LightningError_get_action(this_ptr_conv);
5527 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LightningError_1set_1action(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5528 LDKLightningError* this_ptr_conv = (LDKLightningError*)this_ptr;
5529 LDKErrorAction val_conv = *(LDKErrorAction*)val;
5531 return LightningError_set_action(this_ptr_conv, val_conv);
5534 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LightningError_1new(JNIEnv * _env, jclass _b, jlong err_arg, jlong action_arg) {
5535 LDKCVec_u8Z err_arg_conv = *(LDKCVec_u8Z*)err_arg;
5536 FREE((void*)err_arg);
5537 LDKErrorAction action_arg_conv = *(LDKErrorAction*)action_arg;
5538 FREE((void*)action_arg);
5539 LDKLightningError* ret = MALLOC(sizeof(LDKLightningError), "LDKLightningError");
5540 *ret = LightningError_new(err_arg_conv, action_arg_conv);
5541 assert(ret->is_owned);
5542 ret->is_owned = false;
5546 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5547 LDKCommitmentUpdate this_ptr_conv = *(LDKCommitmentUpdate*)this_ptr;
5548 FREE((void*)this_ptr);
5549 this_ptr_conv.is_owned = true;
5550 return CommitmentUpdate_free(this_ptr_conv);
5553 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1add_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5554 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
5555 LDKCVec_UpdateAddHTLCZ val_conv = *(LDKCVec_UpdateAddHTLCZ*)val;
5557 return CommitmentUpdate_set_update_add_htlcs(this_ptr_conv, val_conv);
5560 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fulfill_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5561 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
5562 LDKCVec_UpdateFulfillHTLCZ val_conv = *(LDKCVec_UpdateFulfillHTLCZ*)val;
5564 return CommitmentUpdate_set_update_fulfill_htlcs(this_ptr_conv, val_conv);
5567 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5568 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
5569 LDKCVec_UpdateFailHTLCZ val_conv = *(LDKCVec_UpdateFailHTLCZ*)val;
5571 return CommitmentUpdate_set_update_fail_htlcs(this_ptr_conv, val_conv);
5574 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fail_1malformed_1htlcs(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5575 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
5576 LDKCVec_UpdateFailMalformedHTLCZ val_conv = *(LDKCVec_UpdateFailMalformedHTLCZ*)val;
5578 return CommitmentUpdate_set_update_fail_malformed_htlcs(this_ptr_conv, val_conv);
5581 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1update_1fee(JNIEnv * _env, jclass _b, jlong this_ptr) {
5582 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
5583 LDKUpdateFee* ret = MALLOC(sizeof(LDKUpdateFee), "LDKUpdateFee");
5584 *ret = CommitmentUpdate_get_update_fee(this_ptr_conv);
5585 assert(ret->is_owned);
5586 ret->is_owned = false;
5590 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1update_1fee(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5591 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
5592 LDKUpdateFee val_conv = *(LDKUpdateFee*)val;
5594 val_conv.is_owned = true;
5595 return CommitmentUpdate_set_update_fee(this_ptr_conv, val_conv);
5598 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1get_1commitment_1signed(JNIEnv * _env, jclass _b, jlong this_ptr) {
5599 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
5600 LDKCommitmentSigned* ret = MALLOC(sizeof(LDKCommitmentSigned), "LDKCommitmentSigned");
5601 *ret = CommitmentUpdate_get_commitment_signed(this_ptr_conv);
5602 assert(ret->is_owned);
5603 ret->is_owned = false;
5607 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_CommitmentUpdate_1set_1commitment_1signed(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
5608 LDKCommitmentUpdate* this_ptr_conv = (LDKCommitmentUpdate*)this_ptr;
5609 LDKCommitmentSigned val_conv = *(LDKCommitmentSigned*)val;
5611 val_conv.is_owned = true;
5612 return CommitmentUpdate_set_commitment_signed(this_ptr_conv, val_conv);
5615 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) {
5616 LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg_conv = *(LDKCVec_UpdateAddHTLCZ*)update_add_htlcs_arg;
5617 FREE((void*)update_add_htlcs_arg);
5618 LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg_conv = *(LDKCVec_UpdateFulfillHTLCZ*)update_fulfill_htlcs_arg;
5619 FREE((void*)update_fulfill_htlcs_arg);
5620 LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg_conv = *(LDKCVec_UpdateFailHTLCZ*)update_fail_htlcs_arg;
5621 FREE((void*)update_fail_htlcs_arg);
5622 LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg_conv = *(LDKCVec_UpdateFailMalformedHTLCZ*)update_fail_malformed_htlcs_arg;
5623 FREE((void*)update_fail_malformed_htlcs_arg);
5624 LDKUpdateFee update_fee_arg_conv = *(LDKUpdateFee*)update_fee_arg;
5625 FREE((void*)update_fee_arg);
5626 update_fee_arg_conv.is_owned = true;
5627 LDKCommitmentSigned commitment_signed_arg_conv = *(LDKCommitmentSigned*)commitment_signed_arg;
5628 FREE((void*)commitment_signed_arg);
5629 commitment_signed_arg_conv.is_owned = true;
5630 LDKCommitmentUpdate* ret = MALLOC(sizeof(LDKCommitmentUpdate), "LDKCommitmentUpdate");
5631 *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);
5632 assert(ret->is_owned);
5633 ret->is_owned = false;
5637 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCFailChannelUpdate_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5638 LDKHTLCFailChannelUpdate this_ptr_conv = *(LDKHTLCFailChannelUpdate*)this_ptr;
5639 FREE((void*)this_ptr);
5640 return HTLCFailChannelUpdate_free(this_ptr_conv);
5643 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelMessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5644 LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)this_ptr;
5645 FREE((void*)this_ptr);
5646 return ChannelMessageHandler_free(this_ptr_conv);
5649 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingMessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
5650 LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)this_ptr;
5651 FREE((void*)this_ptr);
5652 return RoutingMessageHandler_free(this_ptr_conv);
5655 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1write(JNIEnv * _env, jclass _b, jlong obj) {
5656 LDKAcceptChannel* obj_conv = (LDKAcceptChannel*)obj;
5657 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5658 *ret = AcceptChannel_write(obj_conv);
5662 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AcceptChannel_1read(JNIEnv * _env, jclass _b, jlong ser) {
5663 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5665 LDKAcceptChannel* ret = MALLOC(sizeof(LDKAcceptChannel), "LDKAcceptChannel");
5666 *ret = AcceptChannel_read(ser_conv);
5667 assert(ret->is_owned);
5668 ret->is_owned = false;
5672 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1write(JNIEnv * _env, jclass _b, jlong obj) {
5673 LDKAnnouncementSignatures* obj_conv = (LDKAnnouncementSignatures*)obj;
5674 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5675 *ret = AnnouncementSignatures_write(obj_conv);
5679 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_AnnouncementSignatures_1read(JNIEnv * _env, jclass _b, jlong ser) {
5680 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5682 LDKAnnouncementSignatures* ret = MALLOC(sizeof(LDKAnnouncementSignatures), "LDKAnnouncementSignatures");
5683 *ret = AnnouncementSignatures_read(ser_conv);
5684 assert(ret->is_owned);
5685 ret->is_owned = false;
5689 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1write(JNIEnv * _env, jclass _b, jlong obj) {
5690 LDKChannelReestablish* obj_conv = (LDKChannelReestablish*)obj;
5691 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5692 *ret = ChannelReestablish_write(obj_conv);
5696 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelReestablish_1read(JNIEnv * _env, jclass _b, jlong ser) {
5697 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5699 LDKChannelReestablish* ret = MALLOC(sizeof(LDKChannelReestablish), "LDKChannelReestablish");
5700 *ret = ChannelReestablish_read(ser_conv);
5701 assert(ret->is_owned);
5702 ret->is_owned = false;
5706 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
5707 LDKClosingSigned* obj_conv = (LDKClosingSigned*)obj;
5708 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5709 *ret = ClosingSigned_write(obj_conv);
5713 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ClosingSigned_1read(JNIEnv * _env, jclass _b, jlong ser) {
5714 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5716 LDKClosingSigned* ret = MALLOC(sizeof(LDKClosingSigned), "LDKClosingSigned");
5717 *ret = ClosingSigned_read(ser_conv);
5718 assert(ret->is_owned);
5719 ret->is_owned = false;
5723 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
5724 LDKCommitmentSigned* obj_conv = (LDKCommitmentSigned*)obj;
5725 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5726 *ret = CommitmentSigned_write(obj_conv);
5730 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_CommitmentSigned_1read(JNIEnv * _env, jclass _b, jlong ser) {
5731 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5733 LDKCommitmentSigned* ret = MALLOC(sizeof(LDKCommitmentSigned), "LDKCommitmentSigned");
5734 *ret = CommitmentSigned_read(ser_conv);
5735 assert(ret->is_owned);
5736 ret->is_owned = false;
5740 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1write(JNIEnv * _env, jclass _b, jlong obj) {
5741 LDKFundingCreated* obj_conv = (LDKFundingCreated*)obj;
5742 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5743 *ret = FundingCreated_write(obj_conv);
5747 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingCreated_1read(JNIEnv * _env, jclass _b, jlong ser) {
5748 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5750 LDKFundingCreated* ret = MALLOC(sizeof(LDKFundingCreated), "LDKFundingCreated");
5751 *ret = FundingCreated_read(ser_conv);
5752 assert(ret->is_owned);
5753 ret->is_owned = false;
5757 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1write(JNIEnv * _env, jclass _b, jlong obj) {
5758 LDKFundingSigned* obj_conv = (LDKFundingSigned*)obj;
5759 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5760 *ret = FundingSigned_write(obj_conv);
5764 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingSigned_1read(JNIEnv * _env, jclass _b, jlong ser) {
5765 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5767 LDKFundingSigned* ret = MALLOC(sizeof(LDKFundingSigned), "LDKFundingSigned");
5768 *ret = FundingSigned_read(ser_conv);
5769 assert(ret->is_owned);
5770 ret->is_owned = false;
5774 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1write(JNIEnv * _env, jclass _b, jlong obj) {
5775 LDKFundingLocked* obj_conv = (LDKFundingLocked*)obj;
5776 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5777 *ret = FundingLocked_write(obj_conv);
5781 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_FundingLocked_1read(JNIEnv * _env, jclass _b, jlong ser) {
5782 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5784 LDKFundingLocked* ret = MALLOC(sizeof(LDKFundingLocked), "LDKFundingLocked");
5785 *ret = FundingLocked_read(ser_conv);
5786 assert(ret->is_owned);
5787 ret->is_owned = false;
5791 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1write(JNIEnv * _env, jclass _b, jlong obj) {
5792 LDKInit* obj_conv = (LDKInit*)obj;
5793 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5794 *ret = Init_write(obj_conv);
5798 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Init_1read(JNIEnv * _env, jclass _b, jlong ser) {
5799 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5801 LDKInit* ret = MALLOC(sizeof(LDKInit), "LDKInit");
5802 *ret = Init_read(ser_conv);
5803 assert(ret->is_owned);
5804 ret->is_owned = false;
5808 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1write(JNIEnv * _env, jclass _b, jlong obj) {
5809 LDKOpenChannel* obj_conv = (LDKOpenChannel*)obj;
5810 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5811 *ret = OpenChannel_write(obj_conv);
5815 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_OpenChannel_1read(JNIEnv * _env, jclass _b, jlong ser) {
5816 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5818 LDKOpenChannel* ret = MALLOC(sizeof(LDKOpenChannel), "LDKOpenChannel");
5819 *ret = OpenChannel_read(ser_conv);
5820 assert(ret->is_owned);
5821 ret->is_owned = false;
5825 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1write(JNIEnv * _env, jclass _b, jlong obj) {
5826 LDKRevokeAndACK* obj_conv = (LDKRevokeAndACK*)obj;
5827 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5828 *ret = RevokeAndACK_write(obj_conv);
5832 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RevokeAndACK_1read(JNIEnv * _env, jclass _b, jlong ser) {
5833 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5835 LDKRevokeAndACK* ret = MALLOC(sizeof(LDKRevokeAndACK), "LDKRevokeAndACK");
5836 *ret = RevokeAndACK_read(ser_conv);
5837 assert(ret->is_owned);
5838 ret->is_owned = false;
5842 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1write(JNIEnv * _env, jclass _b, jlong obj) {
5843 LDKShutdown* obj_conv = (LDKShutdown*)obj;
5844 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5845 *ret = Shutdown_write(obj_conv);
5849 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Shutdown_1read(JNIEnv * _env, jclass _b, jlong ser) {
5850 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5852 LDKShutdown* ret = MALLOC(sizeof(LDKShutdown), "LDKShutdown");
5853 *ret = Shutdown_read(ser_conv);
5854 assert(ret->is_owned);
5855 ret->is_owned = false;
5859 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
5860 LDKUpdateFailHTLC* obj_conv = (LDKUpdateFailHTLC*)obj;
5861 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5862 *ret = UpdateFailHTLC_write(obj_conv);
5866 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
5867 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5869 LDKUpdateFailHTLC* ret = MALLOC(sizeof(LDKUpdateFailHTLC), "LDKUpdateFailHTLC");
5870 *ret = UpdateFailHTLC_read(ser_conv);
5871 assert(ret->is_owned);
5872 ret->is_owned = false;
5876 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
5877 LDKUpdateFailMalformedHTLC* obj_conv = (LDKUpdateFailMalformedHTLC*)obj;
5878 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5879 *ret = UpdateFailMalformedHTLC_write(obj_conv);
5883 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFailMalformedHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
5884 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5886 LDKUpdateFailMalformedHTLC* ret = MALLOC(sizeof(LDKUpdateFailMalformedHTLC), "LDKUpdateFailMalformedHTLC");
5887 *ret = UpdateFailMalformedHTLC_read(ser_conv);
5888 assert(ret->is_owned);
5889 ret->is_owned = false;
5893 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1write(JNIEnv * _env, jclass _b, jlong obj) {
5894 LDKUpdateFee* obj_conv = (LDKUpdateFee*)obj;
5895 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5896 *ret = UpdateFee_write(obj_conv);
5900 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFee_1read(JNIEnv * _env, jclass _b, jlong ser) {
5901 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5903 LDKUpdateFee* ret = MALLOC(sizeof(LDKUpdateFee), "LDKUpdateFee");
5904 *ret = UpdateFee_read(ser_conv);
5905 assert(ret->is_owned);
5906 ret->is_owned = false;
5910 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
5911 LDKUpdateFulfillHTLC* obj_conv = (LDKUpdateFulfillHTLC*)obj;
5912 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5913 *ret = UpdateFulfillHTLC_write(obj_conv);
5917 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateFulfillHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
5918 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5920 LDKUpdateFulfillHTLC* ret = MALLOC(sizeof(LDKUpdateFulfillHTLC), "LDKUpdateFulfillHTLC");
5921 *ret = UpdateFulfillHTLC_read(ser_conv);
5922 assert(ret->is_owned);
5923 ret->is_owned = false;
5927 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1write(JNIEnv * _env, jclass _b, jlong obj) {
5928 LDKUpdateAddHTLC* obj_conv = (LDKUpdateAddHTLC*)obj;
5929 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5930 *ret = UpdateAddHTLC_write(obj_conv);
5934 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UpdateAddHTLC_1read(JNIEnv * _env, jclass _b, jlong ser) {
5935 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5937 LDKUpdateAddHTLC* ret = MALLOC(sizeof(LDKUpdateAddHTLC), "LDKUpdateAddHTLC");
5938 *ret = UpdateAddHTLC_read(ser_conv);
5939 assert(ret->is_owned);
5940 ret->is_owned = false;
5944 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1write(JNIEnv * _env, jclass _b, jlong obj) {
5945 LDKPing* obj_conv = (LDKPing*)obj;
5946 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5947 *ret = Ping_write(obj_conv);
5951 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Ping_1read(JNIEnv * _env, jclass _b, jlong ser) {
5952 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5954 LDKPing* ret = MALLOC(sizeof(LDKPing), "LDKPing");
5955 *ret = Ping_read(ser_conv);
5956 assert(ret->is_owned);
5957 ret->is_owned = false;
5961 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1write(JNIEnv * _env, jclass _b, jlong obj) {
5962 LDKPong* obj_conv = (LDKPong*)obj;
5963 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5964 *ret = Pong_write(obj_conv);
5968 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Pong_1read(JNIEnv * _env, jclass _b, jlong ser) {
5969 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5971 LDKPong* ret = MALLOC(sizeof(LDKPong), "LDKPong");
5972 *ret = Pong_read(ser_conv);
5973 assert(ret->is_owned);
5974 ret->is_owned = false;
5978 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
5979 LDKUnsignedChannelAnnouncement* obj_conv = (LDKUnsignedChannelAnnouncement*)obj;
5980 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5981 *ret = UnsignedChannelAnnouncement_write(obj_conv);
5985 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
5986 LDKu8slice ser_conv = *(LDKu8slice*)ser;
5988 LDKUnsignedChannelAnnouncement* ret = MALLOC(sizeof(LDKUnsignedChannelAnnouncement), "LDKUnsignedChannelAnnouncement");
5989 *ret = UnsignedChannelAnnouncement_read(ser_conv);
5990 assert(ret->is_owned);
5991 ret->is_owned = false;
5995 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
5996 LDKChannelAnnouncement* obj_conv = (LDKChannelAnnouncement*)obj;
5997 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
5998 *ret = ChannelAnnouncement_write(obj_conv);
6002 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
6003 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6005 LDKChannelAnnouncement* ret = MALLOC(sizeof(LDKChannelAnnouncement), "LDKChannelAnnouncement");
6006 *ret = ChannelAnnouncement_read(ser_conv);
6007 assert(ret->is_owned);
6008 ret->is_owned = false;
6012 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
6013 LDKUnsignedChannelUpdate* obj_conv = (LDKUnsignedChannelUpdate*)obj;
6014 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6015 *ret = UnsignedChannelUpdate_write(obj_conv);
6019 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedChannelUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
6020 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6022 LDKUnsignedChannelUpdate* ret = MALLOC(sizeof(LDKUnsignedChannelUpdate), "LDKUnsignedChannelUpdate");
6023 *ret = UnsignedChannelUpdate_read(ser_conv);
6024 assert(ret->is_owned);
6025 ret->is_owned = false;
6029 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1write(JNIEnv * _env, jclass _b, jlong obj) {
6030 LDKChannelUpdate* obj_conv = (LDKChannelUpdate*)obj;
6031 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6032 *ret = ChannelUpdate_write(obj_conv);
6036 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelUpdate_1read(JNIEnv * _env, jclass _b, jlong ser) {
6037 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6039 LDKChannelUpdate* ret = MALLOC(sizeof(LDKChannelUpdate), "LDKChannelUpdate");
6040 *ret = ChannelUpdate_read(ser_conv);
6041 assert(ret->is_owned);
6042 ret->is_owned = false;
6046 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1write(JNIEnv * _env, jclass _b, jlong obj) {
6047 LDKErrorMessage* obj_conv = (LDKErrorMessage*)obj;
6048 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6049 *ret = ErrorMessage_write(obj_conv);
6053 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ErrorMessage_1read(JNIEnv * _env, jclass _b, jlong ser) {
6054 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6056 LDKErrorMessage* ret = MALLOC(sizeof(LDKErrorMessage), "LDKErrorMessage");
6057 *ret = ErrorMessage_read(ser_conv);
6058 assert(ret->is_owned);
6059 ret->is_owned = false;
6063 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
6064 LDKUnsignedNodeAnnouncement* obj_conv = (LDKUnsignedNodeAnnouncement*)obj;
6065 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6066 *ret = UnsignedNodeAnnouncement_write(obj_conv);
6070 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_UnsignedNodeAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
6071 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6073 LDKUnsignedNodeAnnouncement* ret = MALLOC(sizeof(LDKUnsignedNodeAnnouncement), "LDKUnsignedNodeAnnouncement");
6074 *ret = UnsignedNodeAnnouncement_read(ser_conv);
6075 assert(ret->is_owned);
6076 ret->is_owned = false;
6080 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1write(JNIEnv * _env, jclass _b, jlong obj) {
6081 LDKNodeAnnouncement* obj_conv = (LDKNodeAnnouncement*)obj;
6082 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6083 *ret = NodeAnnouncement_write(obj_conv);
6087 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncement_1read(JNIEnv * _env, jclass _b, jlong ser) {
6088 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6090 LDKNodeAnnouncement* ret = MALLOC(sizeof(LDKNodeAnnouncement), "LDKNodeAnnouncement");
6091 *ret = NodeAnnouncement_read(ser_conv);
6092 assert(ret->is_owned);
6093 ret->is_owned = false;
6097 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1read(JNIEnv * _env, jclass _b, jlong ser) {
6098 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6100 LDKQueryShortChannelIds* ret = MALLOC(sizeof(LDKQueryShortChannelIds), "LDKQueryShortChannelIds");
6101 *ret = QueryShortChannelIds_read(ser_conv);
6102 assert(ret->is_owned);
6103 ret->is_owned = false;
6107 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryShortChannelIds_1write(JNIEnv * _env, jclass _b, jlong obj) {
6108 LDKQueryShortChannelIds* obj_conv = (LDKQueryShortChannelIds*)obj;
6109 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6110 *ret = QueryShortChannelIds_write(obj_conv);
6114 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1read(JNIEnv * _env, jclass _b, jlong ser) {
6115 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6117 LDKReplyShortChannelIdsEnd* ret = MALLOC(sizeof(LDKReplyShortChannelIdsEnd), "LDKReplyShortChannelIdsEnd");
6118 *ret = ReplyShortChannelIdsEnd_read(ser_conv);
6119 assert(ret->is_owned);
6120 ret->is_owned = false;
6124 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyShortChannelIdsEnd_1write(JNIEnv * _env, jclass _b, jlong obj) {
6125 LDKReplyShortChannelIdsEnd* obj_conv = (LDKReplyShortChannelIdsEnd*)obj;
6126 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6127 *ret = ReplyShortChannelIdsEnd_write(obj_conv);
6131 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1read(JNIEnv * _env, jclass _b, jlong ser) {
6132 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6134 LDKQueryChannelRange* ret = MALLOC(sizeof(LDKQueryChannelRange), "LDKQueryChannelRange");
6135 *ret = QueryChannelRange_read(ser_conv);
6136 assert(ret->is_owned);
6137 ret->is_owned = false;
6141 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_QueryChannelRange_1write(JNIEnv * _env, jclass _b, jlong obj) {
6142 LDKQueryChannelRange* obj_conv = (LDKQueryChannelRange*)obj;
6143 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6144 *ret = QueryChannelRange_write(obj_conv);
6148 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1read(JNIEnv * _env, jclass _b, jlong ser) {
6149 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6151 LDKReplyChannelRange* ret = MALLOC(sizeof(LDKReplyChannelRange), "LDKReplyChannelRange");
6152 *ret = ReplyChannelRange_read(ser_conv);
6153 assert(ret->is_owned);
6154 ret->is_owned = false;
6158 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ReplyChannelRange_1write(JNIEnv * _env, jclass _b, jlong obj) {
6159 LDKReplyChannelRange* obj_conv = (LDKReplyChannelRange*)obj;
6160 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6161 *ret = ReplyChannelRange_write(obj_conv);
6165 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1read(JNIEnv * _env, jclass _b, jlong ser) {
6166 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6168 LDKGossipTimestampFilter* ret = MALLOC(sizeof(LDKGossipTimestampFilter), "LDKGossipTimestampFilter");
6169 *ret = GossipTimestampFilter_read(ser_conv);
6170 assert(ret->is_owned);
6171 ret->is_owned = false;
6175 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_GossipTimestampFilter_1write(JNIEnv * _env, jclass _b, jlong obj) {
6176 LDKGossipTimestampFilter* obj_conv = (LDKGossipTimestampFilter*)obj;
6177 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6178 *ret = GossipTimestampFilter_write(obj_conv);
6182 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6183 LDKMessageHandler this_ptr_conv = *(LDKMessageHandler*)this_ptr;
6184 FREE((void*)this_ptr);
6185 this_ptr_conv.is_owned = true;
6186 return MessageHandler_free(this_ptr_conv);
6189 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1chan_1handler(JNIEnv * _env, jclass _b, jlong this_ptr) {
6190 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
6191 long ret = (long)MessageHandler_get_chan_handler(this_ptr_conv);
6195 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1chan_1handler(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6196 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
6197 LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)val;
6198 if (val_conv.free == LDKChannelMessageHandler_JCalls_free) {
6199 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
6200 LDKChannelMessageHandler_JCalls_clone(val_conv.this_arg);
6202 return MessageHandler_set_chan_handler(this_ptr_conv, val_conv);
6205 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1get_1route_1handler(JNIEnv * _env, jclass _b, jlong this_ptr) {
6206 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
6207 long ret = (long)MessageHandler_get_route_handler(this_ptr_conv);
6211 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_MessageHandler_1set_1route_1handler(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6212 LDKMessageHandler* this_ptr_conv = (LDKMessageHandler*)this_ptr;
6213 LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)val;
6214 if (val_conv.free == LDKRoutingMessageHandler_JCalls_free) {
6215 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
6216 LDKRoutingMessageHandler_JCalls_clone(val_conv.this_arg);
6218 return MessageHandler_set_route_handler(this_ptr_conv, val_conv);
6221 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_MessageHandler_1new(JNIEnv * _env, jclass _b, jlong chan_handler_arg, jlong route_handler_arg) {
6222 LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)chan_handler_arg;
6223 if (chan_handler_arg_conv.free == LDKChannelMessageHandler_JCalls_free) {
6224 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
6225 LDKChannelMessageHandler_JCalls_clone(chan_handler_arg_conv.this_arg);
6227 LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)route_handler_arg;
6228 if (route_handler_arg_conv.free == LDKRoutingMessageHandler_JCalls_free) {
6229 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
6230 LDKRoutingMessageHandler_JCalls_clone(route_handler_arg_conv.this_arg);
6232 LDKMessageHandler* ret = MALLOC(sizeof(LDKMessageHandler), "LDKMessageHandler");
6233 *ret = MessageHandler_new(chan_handler_arg_conv, route_handler_arg_conv);
6234 assert(ret->is_owned);
6235 ret->is_owned = false;
6239 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_SocketDescriptor_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6240 LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)this_ptr;
6241 FREE((void*)this_ptr);
6242 return SocketDescriptor_free(this_ptr_conv);
6245 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6246 LDKPeerHandleError this_ptr_conv = *(LDKPeerHandleError*)this_ptr;
6247 FREE((void*)this_ptr);
6248 this_ptr_conv.is_owned = true;
6249 return PeerHandleError_free(this_ptr_conv);
6252 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1get_1no_1connection_1possible(JNIEnv * _env, jclass _b, jlong this_ptr) {
6253 LDKPeerHandleError* this_ptr_conv = (LDKPeerHandleError*)this_ptr;
6254 return PeerHandleError_get_no_connection_possible(this_ptr_conv);
6257 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1set_1no_1connection_1possible(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
6258 LDKPeerHandleError* this_ptr_conv = (LDKPeerHandleError*)this_ptr;
6259 return PeerHandleError_set_no_connection_possible(this_ptr_conv, val);
6262 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerHandleError_1new(JNIEnv * _env, jclass _b, jboolean no_connection_possible_arg) {
6263 LDKPeerHandleError* ret = MALLOC(sizeof(LDKPeerHandleError), "LDKPeerHandleError");
6264 *ret = PeerHandleError_new(no_connection_possible_arg);
6265 assert(ret->is_owned);
6266 ret->is_owned = false;
6270 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6271 LDKPeerManager this_ptr_conv = *(LDKPeerManager*)this_ptr;
6272 FREE((void*)this_ptr);
6273 this_ptr_conv.is_owned = true;
6274 return PeerManager_free(this_ptr_conv);
6277 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) {
6278 LDKMessageHandler message_handler_conv = *(LDKMessageHandler*)message_handler;
6279 FREE((void*)message_handler);
6280 message_handler_conv.is_owned = true;
6281 LDKSecretKey our_node_secret_conv = *(LDKSecretKey*)our_node_secret;
6282 FREE((void*)our_node_secret);
6283 unsigned char ephemeral_random_data_arr[32];
6284 (*_env)->GetByteArrayRegion (_env, ephemeral_random_data, 0, 32, ephemeral_random_data_arr);
6285 unsigned char (*ephemeral_random_data_ref)[32] = &ephemeral_random_data_arr;
6286 LDKLogger logger_conv = *(LDKLogger*)logger;
6287 if (logger_conv.free == LDKLogger_JCalls_free) {
6288 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
6289 LDKLogger_JCalls_clone(logger_conv.this_arg);
6291 LDKPeerManager* ret = MALLOC(sizeof(LDKPeerManager), "LDKPeerManager");
6292 *ret = PeerManager_new(message_handler_conv, our_node_secret_conv, ephemeral_random_data_ref, logger_conv);
6293 assert(ret->is_owned);
6294 ret->is_owned = false;
6298 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1get_1peer_1node_1ids(JNIEnv * _env, jclass _b, jlong this_arg) {
6299 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
6300 LDKCVec_PublicKeyZ* ret = MALLOC(sizeof(LDKCVec_PublicKeyZ), "LDKCVec_PublicKeyZ");
6301 *ret = PeerManager_get_peer_node_ids(this_arg_conv);
6305 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) {
6306 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
6307 LDKPublicKey their_node_id_conv = *(LDKPublicKey*)their_node_id;
6308 FREE((void*)their_node_id);
6309 LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)descriptor;
6310 if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
6311 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
6312 LDKSocketDescriptor_JCalls_clone(descriptor_conv.this_arg);
6314 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
6315 *ret = PeerManager_new_outbound_connection(this_arg_conv, their_node_id_conv, descriptor_conv);
6319 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1new_1inbound_1connection(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) {
6320 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
6321 LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)descriptor;
6322 if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
6323 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
6324 LDKSocketDescriptor_JCalls_clone(descriptor_conv.this_arg);
6326 LDKCResult_NonePeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
6327 *ret = PeerManager_new_inbound_connection(this_arg_conv, descriptor_conv);
6331 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1write_1buffer_1space_1avail(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) {
6332 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
6333 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor;
6334 LDKCResult_NonePeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
6335 *ret = PeerManager_write_buffer_space_avail(this_arg_conv, descriptor_conv);
6339 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PeerManager_1read_1event(JNIEnv * _env, jclass _b, jlong this_arg, jlong peer_descriptor, jlong data) {
6340 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
6341 LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor;
6342 LDKu8slice data_conv = *(LDKu8slice*)data;
6344 LDKCResult_boolPeerHandleErrorZ* ret = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
6345 *ret = PeerManager_read_event(this_arg_conv, peer_descriptor_conv, data_conv);
6349 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1process_1events(JNIEnv * _env, jclass _b, jlong this_arg) {
6350 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
6351 return PeerManager_process_events(this_arg_conv);
6354 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1socket_1disconnected(JNIEnv * _env, jclass _b, jlong this_arg, jlong descriptor) {
6355 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
6356 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor;
6357 return PeerManager_socket_disconnected(this_arg_conv, descriptor_conv);
6360 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PeerManager_1timer_1tick_1occured(JNIEnv * _env, jclass _b, jlong this_arg) {
6361 LDKPeerManager* this_arg_conv = (LDKPeerManager*)this_arg;
6362 return PeerManager_timer_tick_occured(this_arg_conv);
6365 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_build_1commitment_1secret(JNIEnv * _env, jclass _b, jbyteArray commitment_seed, jlong idx) {
6366 unsigned char commitment_seed_arr[32];
6367 (*_env)->GetByteArrayRegion (_env, commitment_seed, 0, 32, commitment_seed_arr);
6368 unsigned char (*commitment_seed_ref)[32] = &commitment_seed_arr;
6369 LDKThirtyTwoBytes* ret = MALLOC(sizeof(LDKThirtyTwoBytes), "LDKThirtyTwoBytes");
6370 *ret = build_commitment_secret(commitment_seed_ref, idx);
6374 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1private_1key(JNIEnv * _env, jclass _b, jlong per_commitment_point, jbyteArray base_secret) {
6375 LDKPublicKey per_commitment_point_conv = *(LDKPublicKey*)per_commitment_point;
6376 FREE((void*)per_commitment_point);
6377 unsigned char base_secret_arr[32];
6378 (*_env)->GetByteArrayRegion (_env, base_secret, 0, 32, base_secret_arr);
6379 unsigned char (*base_secret_ref)[32] = &base_secret_arr;
6380 LDKCResult_SecretKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ");
6381 *ret = derive_private_key(per_commitment_point_conv, base_secret_ref);
6385 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_derive_1public_1key(JNIEnv * _env, jclass _b, jlong per_commitment_point, jlong base_point) {
6386 LDKPublicKey per_commitment_point_conv = *(LDKPublicKey*)per_commitment_point;
6387 FREE((void*)per_commitment_point);
6388 LDKPublicKey base_point_conv = *(LDKPublicKey*)base_point;
6389 FREE((void*)base_point);
6390 LDKCResult_PublicKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ");
6391 *ret = derive_public_key(per_commitment_point_conv, base_point_conv);
6395 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) {
6396 unsigned char per_commitment_secret_arr[32];
6397 (*_env)->GetByteArrayRegion (_env, per_commitment_secret, 0, 32, per_commitment_secret_arr);
6398 unsigned char (*per_commitment_secret_ref)[32] = &per_commitment_secret_arr;
6399 unsigned char countersignatory_revocation_base_secret_arr[32];
6400 (*_env)->GetByteArrayRegion (_env, countersignatory_revocation_base_secret, 0, 32, countersignatory_revocation_base_secret_arr);
6401 unsigned char (*countersignatory_revocation_base_secret_ref)[32] = &countersignatory_revocation_base_secret_arr;
6402 LDKCResult_SecretKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_SecretKeySecpErrorZ), "LDKCResult_SecretKeySecpErrorZ");
6403 *ret = derive_private_revocation_key(per_commitment_secret_ref, countersignatory_revocation_base_secret_ref);
6407 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) {
6408 LDKPublicKey per_commitment_point_conv = *(LDKPublicKey*)per_commitment_point;
6409 FREE((void*)per_commitment_point);
6410 LDKPublicKey countersignatory_revocation_base_point_conv = *(LDKPublicKey*)countersignatory_revocation_base_point;
6411 FREE((void*)countersignatory_revocation_base_point);
6412 LDKCResult_PublicKeySecpErrorZ* ret = MALLOC(sizeof(LDKCResult_PublicKeySecpErrorZ), "LDKCResult_PublicKeySecpErrorZ");
6413 *ret = derive_public_revocation_key(per_commitment_point_conv, countersignatory_revocation_base_point_conv);
6417 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6418 LDKTxCreationKeys this_ptr_conv = *(LDKTxCreationKeys*)this_ptr;
6419 FREE((void*)this_ptr);
6420 this_ptr_conv.is_owned = true;
6421 return TxCreationKeys_free(this_ptr_conv);
6424 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
6425 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6426 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6427 *ret = TxCreationKeys_get_per_commitment_point(this_ptr_conv);
6431 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6432 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6433 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6435 return TxCreationKeys_set_per_commitment_point(this_ptr_conv, val_conv);
6438 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1revocation_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
6439 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6440 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6441 *ret = TxCreationKeys_get_revocation_key(this_ptr_conv);
6445 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1revocation_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6446 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6447 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6449 return TxCreationKeys_set_revocation_key(this_ptr_conv, val_conv);
6452 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
6453 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6454 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6455 *ret = TxCreationKeys_get_broadcaster_htlc_key(this_ptr_conv);
6459 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6460 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6461 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6463 return TxCreationKeys_set_broadcaster_htlc_key(this_ptr_conv, val_conv);
6466 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1countersignatory_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
6467 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6468 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6469 *ret = TxCreationKeys_get_countersignatory_htlc_key(this_ptr_conv);
6473 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1countersignatory_1htlc_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6474 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6475 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6477 return TxCreationKeys_set_countersignatory_htlc_key(this_ptr_conv, val_conv);
6480 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1get_1broadcaster_1delayed_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr) {
6481 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6482 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6483 *ret = TxCreationKeys_get_broadcaster_delayed_payment_key(this_ptr_conv);
6487 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1set_1broadcaster_1delayed_1payment_1key(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6488 LDKTxCreationKeys* this_ptr_conv = (LDKTxCreationKeys*)this_ptr;
6489 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6491 return TxCreationKeys_set_broadcaster_delayed_payment_key(this_ptr_conv, val_conv);
6494 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) {
6495 LDKPublicKey per_commitment_point_arg_conv = *(LDKPublicKey*)per_commitment_point_arg;
6496 FREE((void*)per_commitment_point_arg);
6497 LDKPublicKey revocation_key_arg_conv = *(LDKPublicKey*)revocation_key_arg;
6498 FREE((void*)revocation_key_arg);
6499 LDKPublicKey broadcaster_htlc_key_arg_conv = *(LDKPublicKey*)broadcaster_htlc_key_arg;
6500 FREE((void*)broadcaster_htlc_key_arg);
6501 LDKPublicKey countersignatory_htlc_key_arg_conv = *(LDKPublicKey*)countersignatory_htlc_key_arg;
6502 FREE((void*)countersignatory_htlc_key_arg);
6503 LDKPublicKey broadcaster_delayed_payment_key_arg_conv = *(LDKPublicKey*)broadcaster_delayed_payment_key_arg;
6504 FREE((void*)broadcaster_delayed_payment_key_arg);
6505 LDKTxCreationKeys* ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
6506 *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);
6507 assert(ret->is_owned);
6508 ret->is_owned = false;
6512 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1write(JNIEnv * _env, jclass _b, jlong obj) {
6513 LDKTxCreationKeys* obj_conv = (LDKTxCreationKeys*)obj;
6514 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6515 *ret = TxCreationKeys_write(obj_conv);
6519 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_TxCreationKeys_1read(JNIEnv * _env, jclass _b, jlong ser) {
6520 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6522 LDKTxCreationKeys* ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
6523 *ret = TxCreationKeys_read(ser_conv);
6524 assert(ret->is_owned);
6525 ret->is_owned = false;
6529 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6530 LDKPreCalculatedTxCreationKeys this_ptr_conv = *(LDKPreCalculatedTxCreationKeys*)this_ptr;
6531 FREE((void*)this_ptr);
6532 this_ptr_conv.is_owned = true;
6533 return PreCalculatedTxCreationKeys_free(this_ptr_conv);
6536 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1new(JNIEnv * _env, jclass _b, jlong keys) {
6537 LDKTxCreationKeys keys_conv = *(LDKTxCreationKeys*)keys;
6539 keys_conv.is_owned = true;
6540 LDKPreCalculatedTxCreationKeys* ret = MALLOC(sizeof(LDKPreCalculatedTxCreationKeys), "LDKPreCalculatedTxCreationKeys");
6541 *ret = PreCalculatedTxCreationKeys_new(keys_conv);
6542 assert(ret->is_owned);
6543 ret->is_owned = false;
6547 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1trust_1key_1derivation(JNIEnv * _env, jclass _b, jlong this_arg) {
6548 LDKPreCalculatedTxCreationKeys* this_arg_conv = (LDKPreCalculatedTxCreationKeys*)this_arg;
6549 LDKTxCreationKeys* ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
6550 *ret = PreCalculatedTxCreationKeys_trust_key_derivation(this_arg_conv);
6551 assert(ret->is_owned);
6552 ret->is_owned = false;
6556 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_PreCalculatedTxCreationKeys_1per_1commitment_1point(JNIEnv * _env, jclass _b, jlong this_arg) {
6557 LDKPreCalculatedTxCreationKeys* this_arg_conv = (LDKPreCalculatedTxCreationKeys*)this_arg;
6558 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6559 *ret = PreCalculatedTxCreationKeys_per_commitment_point(this_arg_conv);
6563 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6564 LDKChannelPublicKeys this_ptr_conv = *(LDKChannelPublicKeys*)this_ptr;
6565 FREE((void*)this_ptr);
6566 this_ptr_conv.is_owned = true;
6567 return ChannelPublicKeys_free(this_ptr_conv);
6570 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
6571 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
6572 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6573 *ret = ChannelPublicKeys_get_funding_pubkey(this_ptr_conv);
6577 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1funding_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6578 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
6579 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6581 return ChannelPublicKeys_set_funding_pubkey(this_ptr_conv, val_conv);
6584 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
6585 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
6586 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6587 *ret = ChannelPublicKeys_get_revocation_basepoint(this_ptr_conv);
6591 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1revocation_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6592 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
6593 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6595 return ChannelPublicKeys_set_revocation_basepoint(this_ptr_conv, val_conv);
6598 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr) {
6599 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
6600 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6601 *ret = ChannelPublicKeys_get_payment_point(this_ptr_conv);
6605 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1payment_1point(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6606 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
6607 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6609 return ChannelPublicKeys_set_payment_point(this_ptr_conv, val_conv);
6612 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
6613 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
6614 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6615 *ret = ChannelPublicKeys_get_delayed_payment_basepoint(this_ptr_conv);
6619 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1delayed_1payment_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6620 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
6621 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6623 return ChannelPublicKeys_set_delayed_payment_basepoint(this_ptr_conv, val_conv);
6626 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1get_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr) {
6627 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
6628 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6629 *ret = ChannelPublicKeys_get_htlc_basepoint(this_ptr_conv);
6633 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1set_1htlc_1basepoint(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6634 LDKChannelPublicKeys* this_ptr_conv = (LDKChannelPublicKeys*)this_ptr;
6635 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6637 return ChannelPublicKeys_set_htlc_basepoint(this_ptr_conv, val_conv);
6640 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) {
6641 LDKPublicKey funding_pubkey_arg_conv = *(LDKPublicKey*)funding_pubkey_arg;
6642 FREE((void*)funding_pubkey_arg);
6643 LDKPublicKey revocation_basepoint_arg_conv = *(LDKPublicKey*)revocation_basepoint_arg;
6644 FREE((void*)revocation_basepoint_arg);
6645 LDKPublicKey payment_point_arg_conv = *(LDKPublicKey*)payment_point_arg;
6646 FREE((void*)payment_point_arg);
6647 LDKPublicKey delayed_payment_basepoint_arg_conv = *(LDKPublicKey*)delayed_payment_basepoint_arg;
6648 FREE((void*)delayed_payment_basepoint_arg);
6649 LDKPublicKey htlc_basepoint_arg_conv = *(LDKPublicKey*)htlc_basepoint_arg;
6650 FREE((void*)htlc_basepoint_arg);
6651 LDKChannelPublicKeys* ret = MALLOC(sizeof(LDKChannelPublicKeys), "LDKChannelPublicKeys");
6652 *ret = ChannelPublicKeys_new(funding_pubkey_arg_conv, revocation_basepoint_arg_conv, payment_point_arg_conv, delayed_payment_basepoint_arg_conv, htlc_basepoint_arg_conv);
6653 assert(ret->is_owned);
6654 ret->is_owned = false;
6658 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1write(JNIEnv * _env, jclass _b, jlong obj) {
6659 LDKChannelPublicKeys* obj_conv = (LDKChannelPublicKeys*)obj;
6660 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6661 *ret = ChannelPublicKeys_write(obj_conv);
6665 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelPublicKeys_1read(JNIEnv * _env, jclass _b, jlong ser) {
6666 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6668 LDKChannelPublicKeys* ret = MALLOC(sizeof(LDKChannelPublicKeys), "LDKChannelPublicKeys");
6669 *ret = ChannelPublicKeys_read(ser_conv);
6670 assert(ret->is_owned);
6671 ret->is_owned = false;
6675 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) {
6676 LDKPublicKey per_commitment_point_conv = *(LDKPublicKey*)per_commitment_point;
6677 FREE((void*)per_commitment_point);
6678 LDKPublicKey broadcaster_delayed_payment_base_conv = *(LDKPublicKey*)broadcaster_delayed_payment_base;
6679 FREE((void*)broadcaster_delayed_payment_base);
6680 LDKPublicKey broadcaster_htlc_base_conv = *(LDKPublicKey*)broadcaster_htlc_base;
6681 FREE((void*)broadcaster_htlc_base);
6682 LDKPublicKey countersignatory_revocation_base_conv = *(LDKPublicKey*)countersignatory_revocation_base;
6683 FREE((void*)countersignatory_revocation_base);
6684 LDKPublicKey countersignatory_htlc_base_conv = *(LDKPublicKey*)countersignatory_htlc_base;
6685 FREE((void*)countersignatory_htlc_base);
6686 LDKCResult_TxCreationKeysSecpErrorZ* ret = MALLOC(sizeof(LDKCResult_TxCreationKeysSecpErrorZ), "LDKCResult_TxCreationKeysSecpErrorZ");
6687 *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);
6691 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) {
6692 LDKPublicKey revocation_key_conv = *(LDKPublicKey*)revocation_key;
6693 FREE((void*)revocation_key);
6694 LDKPublicKey broadcaster_delayed_payment_key_conv = *(LDKPublicKey*)broadcaster_delayed_payment_key;
6695 FREE((void*)broadcaster_delayed_payment_key);
6696 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6697 *ret = get_revokeable_redeemscript(revocation_key_conv, contest_delay, broadcaster_delayed_payment_key_conv);
6701 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6702 LDKHTLCOutputInCommitment this_ptr_conv = *(LDKHTLCOutputInCommitment*)this_ptr;
6703 FREE((void*)this_ptr);
6704 this_ptr_conv.is_owned = true;
6705 return HTLCOutputInCommitment_free(this_ptr_conv);
6708 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1offered(JNIEnv * _env, jclass _b, jlong this_ptr) {
6709 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
6710 return HTLCOutputInCommitment_get_offered(this_ptr_conv);
6713 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1offered(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
6714 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
6715 return HTLCOutputInCommitment_set_offered(this_ptr_conv, val);
6718 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
6719 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
6720 return HTLCOutputInCommitment_get_amount_msat(this_ptr_conv);
6723 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1amount_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6724 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
6725 return HTLCOutputInCommitment_set_amount_msat(this_ptr_conv, val);
6728 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr) {
6729 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
6730 return HTLCOutputInCommitment_get_cltv_expiry(this_ptr_conv);
6733 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1cltv_1expiry(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6734 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
6735 return HTLCOutputInCommitment_set_cltv_expiry(this_ptr_conv, val);
6738 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1get_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr) {
6739 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
6740 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
6741 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *HTLCOutputInCommitment_get_payment_hash(this_ptr_conv));
6745 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1set_1payment_1hash(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6746 LDKHTLCOutputInCommitment* this_ptr_conv = (LDKHTLCOutputInCommitment*)this_ptr;
6747 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
6749 return HTLCOutputInCommitment_set_payment_hash(this_ptr_conv, val_conv);
6752 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1write(JNIEnv * _env, jclass _b, jlong obj) {
6753 LDKHTLCOutputInCommitment* obj_conv = (LDKHTLCOutputInCommitment*)obj;
6754 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6755 *ret = HTLCOutputInCommitment_write(obj_conv);
6759 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HTLCOutputInCommitment_1read(JNIEnv * _env, jclass _b, jlong ser) {
6760 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6762 LDKHTLCOutputInCommitment* ret = MALLOC(sizeof(LDKHTLCOutputInCommitment), "LDKHTLCOutputInCommitment");
6763 *ret = HTLCOutputInCommitment_read(ser_conv);
6764 assert(ret->is_owned);
6765 ret->is_owned = false;
6769 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_get_1htlc_1redeemscript(JNIEnv * _env, jclass _b, jlong htlc, jlong keys) {
6770 LDKHTLCOutputInCommitment* htlc_conv = (LDKHTLCOutputInCommitment*)htlc;
6771 LDKTxCreationKeys* keys_conv = (LDKTxCreationKeys*)keys;
6772 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6773 *ret = get_htlc_redeemscript(htlc_conv, keys_conv);
6777 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_make_1funding_1redeemscript(JNIEnv * _env, jclass _b, jlong broadcaster, jlong countersignatory) {
6778 LDKPublicKey broadcaster_conv = *(LDKPublicKey*)broadcaster;
6779 FREE((void*)broadcaster);
6780 LDKPublicKey countersignatory_conv = *(LDKPublicKey*)countersignatory;
6781 FREE((void*)countersignatory);
6782 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6783 *ret = make_funding_redeemscript(broadcaster_conv, countersignatory_conv);
6787 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) {
6788 unsigned char prev_hash_arr[32];
6789 (*_env)->GetByteArrayRegion (_env, prev_hash, 0, 32, prev_hash_arr);
6790 unsigned char (*prev_hash_ref)[32] = &prev_hash_arr;
6791 LDKHTLCOutputInCommitment* htlc_conv = (LDKHTLCOutputInCommitment*)htlc;
6792 LDKPublicKey broadcaster_delayed_payment_key_conv = *(LDKPublicKey*)broadcaster_delayed_payment_key;
6793 FREE((void*)broadcaster_delayed_payment_key);
6794 LDKPublicKey revocation_key_conv = *(LDKPublicKey*)revocation_key;
6795 FREE((void*)revocation_key);
6796 LDKTransaction* ret = MALLOC(sizeof(LDKTransaction), "LDKTransaction");
6797 *ret = build_htlc_transaction(prev_hash_ref, feerate_per_kw, contest_delay, htlc_conv, broadcaster_delayed_payment_key_conv, revocation_key_conv);
6801 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6802 LDKHolderCommitmentTransaction this_ptr_conv = *(LDKHolderCommitmentTransaction*)this_ptr;
6803 FREE((void*)this_ptr);
6804 this_ptr_conv.is_owned = true;
6805 return HolderCommitmentTransaction_free(this_ptr_conv);
6808 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1unsigned_1tx(JNIEnv * _env, jclass _b, jlong this_ptr) {
6809 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
6810 LDKTransaction* ret = MALLOC(sizeof(LDKTransaction), "LDKTransaction");
6811 *ret = HolderCommitmentTransaction_get_unsigned_tx(this_ptr_conv);
6815 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1unsigned_1tx(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6816 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
6817 LDKTransaction val_conv = *(LDKTransaction*)val;
6819 return HolderCommitmentTransaction_set_unsigned_tx(this_ptr_conv, val_conv);
6822 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1counterparty_1sig(JNIEnv * _env, jclass _b, jlong this_ptr) {
6823 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
6824 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
6825 *ret = HolderCommitmentTransaction_get_counterparty_sig(this_ptr_conv);
6829 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1counterparty_1sig(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6830 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
6831 LDKSignature val_conv = *(LDKSignature*)val;
6833 return HolderCommitmentTransaction_set_counterparty_sig(this_ptr_conv, val_conv);
6836 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1get_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr) {
6837 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
6838 return HolderCommitmentTransaction_get_feerate_per_kw(this_ptr_conv);
6841 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1feerate_1per_1kw(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
6842 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
6843 return HolderCommitmentTransaction_set_feerate_per_kw(this_ptr_conv, val);
6846 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1set_1per_1htlc(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6847 LDKHolderCommitmentTransaction* this_ptr_conv = (LDKHolderCommitmentTransaction*)this_ptr;
6848 LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ val_conv = *(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ*)val;
6850 return HolderCommitmentTransaction_set_per_htlc(this_ptr_conv, val_conv);
6853 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) {
6854 LDKTransaction unsigned_tx_conv = *(LDKTransaction*)unsigned_tx;
6855 FREE((void*)unsigned_tx);
6856 LDKSignature counterparty_sig_conv = *(LDKSignature*)counterparty_sig;
6857 FREE((void*)counterparty_sig);
6858 LDKPublicKey holder_funding_key_conv = *(LDKPublicKey*)holder_funding_key;
6859 FREE((void*)holder_funding_key);
6860 LDKPublicKey counterparty_funding_key_conv = *(LDKPublicKey*)counterparty_funding_key;
6861 FREE((void*)counterparty_funding_key);
6862 LDKTxCreationKeys keys_conv = *(LDKTxCreationKeys*)keys;
6864 keys_conv.is_owned = true;
6865 LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ htlc_data_conv = *(LDKCVec_C2Tuple_HTLCOutputInCommitmentSignatureZZ*)htlc_data;
6866 FREE((void*)htlc_data);
6867 LDKHolderCommitmentTransaction* ret = MALLOC(sizeof(LDKHolderCommitmentTransaction), "LDKHolderCommitmentTransaction");
6868 *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);
6869 assert(ret->is_owned);
6870 ret->is_owned = false;
6874 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1trust_1key_1derivation(JNIEnv * _env, jclass _b, jlong this_arg) {
6875 LDKHolderCommitmentTransaction* this_arg_conv = (LDKHolderCommitmentTransaction*)this_arg;
6876 LDKTxCreationKeys* ret = MALLOC(sizeof(LDKTxCreationKeys), "LDKTxCreationKeys");
6877 *ret = HolderCommitmentTransaction_trust_key_derivation(this_arg_conv);
6878 assert(ret->is_owned);
6879 ret->is_owned = false;
6883 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1txid(JNIEnv * _env, jclass _b, jlong this_arg) {
6884 LDKHolderCommitmentTransaction* this_arg_conv = (LDKHolderCommitmentTransaction*)this_arg;
6885 LDKThirtyTwoBytes* ret = MALLOC(sizeof(LDKThirtyTwoBytes), "LDKThirtyTwoBytes");
6886 *ret = HolderCommitmentTransaction_txid(this_arg_conv);
6890 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) {
6891 LDKHolderCommitmentTransaction* this_arg_conv = (LDKHolderCommitmentTransaction*)this_arg;
6892 unsigned char funding_key_arr[32];
6893 (*_env)->GetByteArrayRegion (_env, funding_key, 0, 32, funding_key_arr);
6894 unsigned char (*funding_key_ref)[32] = &funding_key_arr;
6895 LDKu8slice funding_redeemscript_conv = *(LDKu8slice*)funding_redeemscript;
6896 FREE((void*)funding_redeemscript);
6897 LDKSignature* ret = MALLOC(sizeof(LDKSignature), "LDKSignature");
6898 *ret = HolderCommitmentTransaction_get_holder_sig(this_arg_conv, funding_key_ref, funding_redeemscript_conv, channel_value_satoshis);
6902 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) {
6903 LDKHolderCommitmentTransaction* this_arg_conv = (LDKHolderCommitmentTransaction*)this_arg;
6904 unsigned char htlc_base_key_arr[32];
6905 (*_env)->GetByteArrayRegion (_env, htlc_base_key, 0, 32, htlc_base_key_arr);
6906 unsigned char (*htlc_base_key_ref)[32] = &htlc_base_key_arr;
6907 LDKCResult_CVec_SignatureZNoneZ* ret = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
6908 *ret = HolderCommitmentTransaction_get_htlc_sigs(this_arg_conv, htlc_base_key_ref, counterparty_selected_contest_delay);
6912 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1write(JNIEnv * _env, jclass _b, jlong obj) {
6913 LDKHolderCommitmentTransaction* obj_conv = (LDKHolderCommitmentTransaction*)obj;
6914 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
6915 *ret = HolderCommitmentTransaction_write(obj_conv);
6919 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_HolderCommitmentTransaction_1read(JNIEnv * _env, jclass _b, jlong ser) {
6920 LDKu8slice ser_conv = *(LDKu8slice*)ser;
6922 LDKHolderCommitmentTransaction* ret = MALLOC(sizeof(LDKHolderCommitmentTransaction), "LDKHolderCommitmentTransaction");
6923 *ret = HolderCommitmentTransaction_read(ser_conv);
6924 assert(ret->is_owned);
6925 ret->is_owned = false;
6929 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_InitFeatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6930 LDKInitFeatures this_ptr_conv = *(LDKInitFeatures*)this_ptr;
6931 FREE((void*)this_ptr);
6932 this_ptr_conv.is_owned = true;
6933 return InitFeatures_free(this_ptr_conv);
6936 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeFeatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6937 LDKNodeFeatures this_ptr_conv = *(LDKNodeFeatures*)this_ptr;
6938 FREE((void*)this_ptr);
6939 this_ptr_conv.is_owned = true;
6940 return NodeFeatures_free(this_ptr_conv);
6943 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelFeatures_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6944 LDKChannelFeatures this_ptr_conv = *(LDKChannelFeatures*)this_ptr;
6945 FREE((void*)this_ptr);
6946 this_ptr_conv.is_owned = true;
6947 return ChannelFeatures_free(this_ptr_conv);
6950 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
6951 LDKRouteHop this_ptr_conv = *(LDKRouteHop*)this_ptr;
6952 FREE((void*)this_ptr);
6953 this_ptr_conv.is_owned = true;
6954 return RouteHop_free(this_ptr_conv);
6957 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr) {
6958 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6959 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
6960 *ret = RouteHop_get_pubkey(this_ptr_conv);
6964 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1pubkey(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6965 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6966 LDKPublicKey val_conv = *(LDKPublicKey*)val;
6968 return RouteHop_set_pubkey(this_ptr_conv, val_conv);
6971 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1node_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
6972 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6973 LDKNodeFeatures* ret = MALLOC(sizeof(LDKNodeFeatures), "LDKNodeFeatures");
6974 *ret = RouteHop_get_node_features(this_ptr_conv);
6975 assert(ret->is_owned);
6976 ret->is_owned = false;
6980 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1node_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6981 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6982 LDKNodeFeatures val_conv = *(LDKNodeFeatures*)val;
6984 val_conv.is_owned = true;
6985 return RouteHop_set_node_features(this_ptr_conv, val_conv);
6988 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
6989 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6990 return RouteHop_get_short_channel_id(this_ptr_conv);
6993 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
6994 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
6995 return RouteHop_set_short_channel_id(this_ptr_conv, val);
6998 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1channel_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
6999 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
7000 LDKChannelFeatures* ret = MALLOC(sizeof(LDKChannelFeatures), "LDKChannelFeatures");
7001 *ret = RouteHop_get_channel_features(this_ptr_conv);
7002 assert(ret->is_owned);
7003 ret->is_owned = false;
7007 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1channel_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7008 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
7009 LDKChannelFeatures val_conv = *(LDKChannelFeatures*)val;
7011 val_conv.is_owned = true;
7012 return RouteHop_set_channel_features(this_ptr_conv, val_conv);
7015 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1fee_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
7016 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
7017 return RouteHop_get_fee_msat(this_ptr_conv);
7020 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1fee_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7021 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
7022 return RouteHop_set_fee_msat(this_ptr_conv, val);
7025 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RouteHop_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
7026 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
7027 return RouteHop_get_cltv_expiry_delta(this_ptr_conv);
7030 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHop_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
7031 LDKRouteHop* this_ptr_conv = (LDKRouteHop*)this_ptr;
7032 return RouteHop_set_cltv_expiry_delta(this_ptr_conv, val);
7035 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) {
7036 LDKPublicKey pubkey_arg_conv = *(LDKPublicKey*)pubkey_arg;
7037 FREE((void*)pubkey_arg);
7038 LDKNodeFeatures node_features_arg_conv = *(LDKNodeFeatures*)node_features_arg;
7039 FREE((void*)node_features_arg);
7040 node_features_arg_conv.is_owned = true;
7041 LDKChannelFeatures channel_features_arg_conv = *(LDKChannelFeatures*)channel_features_arg;
7042 FREE((void*)channel_features_arg);
7043 channel_features_arg_conv.is_owned = true;
7044 LDKRouteHop* ret = MALLOC(sizeof(LDKRouteHop), "LDKRouteHop");
7045 *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);
7046 assert(ret->is_owned);
7047 ret->is_owned = false;
7051 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7052 LDKRoute this_ptr_conv = *(LDKRoute*)this_ptr;
7053 FREE((void*)this_ptr);
7054 this_ptr_conv.is_owned = true;
7055 return Route_free(this_ptr_conv);
7058 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_Route_1set_1paths(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7059 LDKRoute* this_ptr_conv = (LDKRoute*)this_ptr;
7060 LDKCVec_CVec_RouteHopZZ val_conv = *(LDKCVec_CVec_RouteHopZZ*)val;
7062 return Route_set_paths(this_ptr_conv, val_conv);
7065 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1new(JNIEnv * _env, jclass _b, jlong paths_arg) {
7066 LDKCVec_CVec_RouteHopZZ paths_arg_conv = *(LDKCVec_CVec_RouteHopZZ*)paths_arg;
7067 FREE((void*)paths_arg);
7068 LDKRoute* ret = MALLOC(sizeof(LDKRoute), "LDKRoute");
7069 *ret = Route_new(paths_arg_conv);
7070 assert(ret->is_owned);
7071 ret->is_owned = false;
7075 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1write(JNIEnv * _env, jclass _b, jlong obj) {
7076 LDKRoute* obj_conv = (LDKRoute*)obj;
7077 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7078 *ret = Route_write(obj_conv);
7082 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_Route_1read(JNIEnv * _env, jclass _b, jlong ser) {
7083 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7085 LDKRoute* ret = MALLOC(sizeof(LDKRoute), "LDKRoute");
7086 *ret = Route_read(ser_conv);
7087 assert(ret->is_owned);
7088 ret->is_owned = false;
7092 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7093 LDKRouteHint this_ptr_conv = *(LDKRouteHint*)this_ptr;
7094 FREE((void*)this_ptr);
7095 this_ptr_conv.is_owned = true;
7096 return RouteHint_free(this_ptr_conv);
7099 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1src_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
7100 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
7101 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
7102 *ret = RouteHint_get_src_node_id(this_ptr_conv);
7106 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1src_1node_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7107 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
7108 LDKPublicKey val_conv = *(LDKPublicKey*)val;
7110 return RouteHint_set_src_node_id(this_ptr_conv, val_conv);
7113 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr) {
7114 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
7115 return RouteHint_get_short_channel_id(this_ptr_conv);
7118 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1short_1channel_1id(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7119 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
7120 return RouteHint_set_short_channel_id(this_ptr_conv, val);
7123 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1fees(JNIEnv * _env, jclass _b, jlong this_ptr) {
7124 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
7125 LDKRoutingFees* ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
7126 *ret = RouteHint_get_fees(this_ptr_conv);
7127 assert(ret->is_owned);
7128 ret->is_owned = false;
7132 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1fees(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7133 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
7134 LDKRoutingFees val_conv = *(LDKRoutingFees*)val;
7136 val_conv.is_owned = true;
7137 return RouteHint_set_fees(this_ptr_conv, val_conv);
7140 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
7141 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
7142 return RouteHint_get_cltv_expiry_delta(this_ptr_conv);
7145 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
7146 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
7147 return RouteHint_set_cltv_expiry_delta(this_ptr_conv, val);
7150 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RouteHint_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
7151 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
7152 return RouteHint_get_htlc_minimum_msat(this_ptr_conv);
7155 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RouteHint_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7156 LDKRouteHint* this_ptr_conv = (LDKRouteHint*)this_ptr;
7157 return RouteHint_set_htlc_minimum_msat(this_ptr_conv, val);
7160 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) {
7161 LDKPublicKey src_node_id_arg_conv = *(LDKPublicKey*)src_node_id_arg;
7162 FREE((void*)src_node_id_arg);
7163 LDKRoutingFees fees_arg_conv = *(LDKRoutingFees*)fees_arg;
7164 FREE((void*)fees_arg);
7165 fees_arg_conv.is_owned = true;
7166 LDKRouteHint* ret = MALLOC(sizeof(LDKRouteHint), "LDKRouteHint");
7167 *ret = RouteHint_new(src_node_id_arg_conv, short_channel_id_arg, fees_arg_conv, cltv_expiry_delta_arg, htlc_minimum_msat_arg);
7168 assert(ret->is_owned);
7169 ret->is_owned = false;
7173 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) {
7174 LDKPublicKey our_node_id_conv = *(LDKPublicKey*)our_node_id;
7175 FREE((void*)our_node_id);
7176 LDKNetworkGraph* network_conv = (LDKNetworkGraph*)network;
7177 LDKPublicKey target_conv = *(LDKPublicKey*)target;
7178 FREE((void*)target);
7179 LDKCVec_ChannelDetailsZ* first_hops_conv = (LDKCVec_ChannelDetailsZ*)first_hops;
7180 LDKCVec_RouteHintZ last_hops_conv = *(LDKCVec_RouteHintZ*)last_hops;
7181 FREE((void*)last_hops);
7182 LDKLogger logger_conv = *(LDKLogger*)logger;
7183 if (logger_conv.free == LDKLogger_JCalls_free) {
7184 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
7185 LDKLogger_JCalls_clone(logger_conv.this_arg);
7187 LDKCResult_RouteLightningErrorZ* ret = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
7188 *ret = get_route(our_node_id_conv, network_conv, target_conv, first_hops_conv, last_hops_conv, final_value_msat, final_cltv, logger_conv);
7192 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7193 LDKNetworkGraph this_ptr_conv = *(LDKNetworkGraph*)this_ptr;
7194 FREE((void*)this_ptr);
7195 this_ptr_conv.is_owned = true;
7196 return NetworkGraph_free(this_ptr_conv);
7199 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_LockedNetworkGraph_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7200 LDKLockedNetworkGraph this_ptr_conv = *(LDKLockedNetworkGraph*)this_ptr;
7201 FREE((void*)this_ptr);
7202 this_ptr_conv.is_owned = true;
7203 return LockedNetworkGraph_free(this_ptr_conv);
7206 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7207 LDKNetGraphMsgHandler this_ptr_conv = *(LDKNetGraphMsgHandler*)this_ptr;
7208 FREE((void*)this_ptr);
7209 this_ptr_conv.is_owned = true;
7210 return NetGraphMsgHandler_free(this_ptr_conv);
7213 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1new(JNIEnv * _env, jclass _b, jlong chain_access, jlong logger) {
7214 LDKAccess* chain_access_conv = (LDKAccess*)chain_access;
7215 LDKLogger logger_conv = *(LDKLogger*)logger;
7216 if (logger_conv.free == LDKLogger_JCalls_free) {
7217 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
7218 LDKLogger_JCalls_clone(logger_conv.this_arg);
7220 LDKNetGraphMsgHandler* ret = MALLOC(sizeof(LDKNetGraphMsgHandler), "LDKNetGraphMsgHandler");
7221 *ret = NetGraphMsgHandler_new(chain_access_conv, logger_conv);
7222 assert(ret->is_owned);
7223 ret->is_owned = false;
7227 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1from_1net_1graph(JNIEnv * _env, jclass _b, jlong chain_access, jlong logger, jlong network_graph) {
7228 LDKAccess* chain_access_conv = (LDKAccess*)chain_access;
7229 LDKLogger logger_conv = *(LDKLogger*)logger;
7230 if (logger_conv.free == LDKLogger_JCalls_free) {
7231 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
7232 LDKLogger_JCalls_clone(logger_conv.this_arg);
7234 LDKNetworkGraph network_graph_conv = *(LDKNetworkGraph*)network_graph;
7235 FREE((void*)network_graph);
7236 network_graph_conv.is_owned = true;
7237 LDKNetGraphMsgHandler* ret = MALLOC(sizeof(LDKNetGraphMsgHandler), "LDKNetGraphMsgHandler");
7238 *ret = NetGraphMsgHandler_from_net_graph(chain_access_conv, logger_conv, network_graph_conv);
7239 assert(ret->is_owned);
7240 ret->is_owned = false;
7244 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1read_1locked_1graph(JNIEnv * _env, jclass _b, jlong this_arg) {
7245 LDKNetGraphMsgHandler* this_arg_conv = (LDKNetGraphMsgHandler*)this_arg;
7246 LDKLockedNetworkGraph* ret = MALLOC(sizeof(LDKLockedNetworkGraph), "LDKLockedNetworkGraph");
7247 *ret = NetGraphMsgHandler_read_locked_graph(this_arg_conv);
7248 assert(ret->is_owned);
7249 ret->is_owned = false;
7253 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_LockedNetworkGraph_1graph(JNIEnv * _env, jclass _b, jlong this_arg) {
7254 LDKLockedNetworkGraph* this_arg_conv = (LDKLockedNetworkGraph*)this_arg;
7255 LDKNetworkGraph* ret = MALLOC(sizeof(LDKNetworkGraph), "LDKNetworkGraph");
7256 *ret = LockedNetworkGraph_graph(this_arg_conv);
7257 assert(ret->is_owned);
7258 ret->is_owned = false;
7262 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetGraphMsgHandler_1as_1RoutingMessageHandler(JNIEnv * _env, jclass _b, jlong this_arg) {
7263 LDKNetGraphMsgHandler* this_arg_conv = (LDKNetGraphMsgHandler*)this_arg;
7264 LDKRoutingMessageHandler* ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
7265 *ret = NetGraphMsgHandler_as_RoutingMessageHandler(this_arg_conv);
7269 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7270 LDKDirectionalChannelInfo this_ptr_conv = *(LDKDirectionalChannelInfo*)this_ptr;
7271 FREE((void*)this_ptr);
7272 this_ptr_conv.is_owned = true;
7273 return DirectionalChannelInfo_free(this_ptr_conv);
7276 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr) {
7277 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7278 return DirectionalChannelInfo_get_last_update(this_ptr_conv);
7281 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
7282 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7283 return DirectionalChannelInfo_set_last_update(this_ptr_conv, val);
7286 JNIEXPORT jboolean JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1enabled(JNIEnv * _env, jclass _b, jlong this_ptr) {
7287 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7288 return DirectionalChannelInfo_get_enabled(this_ptr_conv);
7291 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1enabled(JNIEnv * _env, jclass _b, jlong this_ptr, jboolean val) {
7292 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7293 return DirectionalChannelInfo_set_enabled(this_ptr_conv, val);
7296 JNIEXPORT jshort JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr) {
7297 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7298 return DirectionalChannelInfo_get_cltv_expiry_delta(this_ptr_conv);
7301 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1cltv_1expiry_1delta(JNIEnv * _env, jclass _b, jlong this_ptr, jshort val) {
7302 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7303 return DirectionalChannelInfo_set_cltv_expiry_delta(this_ptr_conv, val);
7306 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
7307 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7308 return DirectionalChannelInfo_get_htlc_minimum_msat(this_ptr_conv);
7311 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1htlc_1minimum_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7312 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7313 return DirectionalChannelInfo_set_htlc_minimum_msat(this_ptr_conv, val);
7316 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1get_1last_1update_1message(JNIEnv * _env, jclass _b, jlong this_ptr) {
7317 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7318 LDKChannelUpdate* ret = MALLOC(sizeof(LDKChannelUpdate), "LDKChannelUpdate");
7319 *ret = DirectionalChannelInfo_get_last_update_message(this_ptr_conv);
7320 assert(ret->is_owned);
7321 ret->is_owned = false;
7325 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1set_1last_1update_1message(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7326 LDKDirectionalChannelInfo* this_ptr_conv = (LDKDirectionalChannelInfo*)this_ptr;
7327 LDKChannelUpdate val_conv = *(LDKChannelUpdate*)val;
7329 val_conv.is_owned = true;
7330 return DirectionalChannelInfo_set_last_update_message(this_ptr_conv, val_conv);
7333 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
7334 LDKDirectionalChannelInfo* obj_conv = (LDKDirectionalChannelInfo*)obj;
7335 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7336 *ret = DirectionalChannelInfo_write(obj_conv);
7340 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_DirectionalChannelInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
7341 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7343 LDKDirectionalChannelInfo* ret = MALLOC(sizeof(LDKDirectionalChannelInfo), "LDKDirectionalChannelInfo");
7344 *ret = DirectionalChannelInfo_read(ser_conv);
7345 assert(ret->is_owned);
7346 ret->is_owned = false;
7350 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7351 LDKChannelInfo this_ptr_conv = *(LDKChannelInfo*)this_ptr;
7352 FREE((void*)this_ptr);
7353 this_ptr_conv.is_owned = true;
7354 return ChannelInfo_free(this_ptr_conv);
7357 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
7358 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7359 LDKChannelFeatures* ret = MALLOC(sizeof(LDKChannelFeatures), "LDKChannelFeatures");
7360 *ret = ChannelInfo_get_features(this_ptr_conv);
7361 assert(ret->is_owned);
7362 ret->is_owned = false;
7366 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7367 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7368 LDKChannelFeatures val_conv = *(LDKChannelFeatures*)val;
7370 val_conv.is_owned = true;
7371 return ChannelInfo_set_features(this_ptr_conv, val_conv);
7374 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1one(JNIEnv * _env, jclass _b, jlong this_ptr) {
7375 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7376 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
7377 *ret = ChannelInfo_get_node_one(this_ptr_conv);
7381 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1one(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7382 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7383 LDKPublicKey val_conv = *(LDKPublicKey*)val;
7385 return ChannelInfo_set_node_one(this_ptr_conv, val_conv);
7388 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1one_1to_1two(JNIEnv * _env, jclass _b, jlong this_ptr) {
7389 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7390 LDKDirectionalChannelInfo* ret = MALLOC(sizeof(LDKDirectionalChannelInfo), "LDKDirectionalChannelInfo");
7391 *ret = ChannelInfo_get_one_to_two(this_ptr_conv);
7392 assert(ret->is_owned);
7393 ret->is_owned = false;
7397 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1one_1to_1two(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7398 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7399 LDKDirectionalChannelInfo val_conv = *(LDKDirectionalChannelInfo*)val;
7401 val_conv.is_owned = true;
7402 return ChannelInfo_set_one_to_two(this_ptr_conv, val_conv);
7405 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1node_1two(JNIEnv * _env, jclass _b, jlong this_ptr) {
7406 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7407 LDKPublicKey* ret = MALLOC(sizeof(LDKPublicKey), "LDKPublicKey");
7408 *ret = ChannelInfo_get_node_two(this_ptr_conv);
7412 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1node_1two(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7413 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7414 LDKPublicKey val_conv = *(LDKPublicKey*)val;
7416 return ChannelInfo_set_node_two(this_ptr_conv, val_conv);
7419 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1two_1to_1one(JNIEnv * _env, jclass _b, jlong this_ptr) {
7420 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7421 LDKDirectionalChannelInfo* ret = MALLOC(sizeof(LDKDirectionalChannelInfo), "LDKDirectionalChannelInfo");
7422 *ret = ChannelInfo_get_two_to_one(this_ptr_conv);
7423 assert(ret->is_owned);
7424 ret->is_owned = false;
7428 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1two_1to_1one(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7429 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7430 LDKDirectionalChannelInfo val_conv = *(LDKDirectionalChannelInfo*)val;
7432 val_conv.is_owned = true;
7433 return ChannelInfo_set_two_to_one(this_ptr_conv, val_conv);
7436 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1get_1announcement_1message(JNIEnv * _env, jclass _b, jlong this_ptr) {
7437 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7438 LDKChannelAnnouncement* ret = MALLOC(sizeof(LDKChannelAnnouncement), "LDKChannelAnnouncement");
7439 *ret = ChannelInfo_get_announcement_message(this_ptr_conv);
7440 assert(ret->is_owned);
7441 ret->is_owned = false;
7445 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1set_1announcement_1message(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7446 LDKChannelInfo* this_ptr_conv = (LDKChannelInfo*)this_ptr;
7447 LDKChannelAnnouncement val_conv = *(LDKChannelAnnouncement*)val;
7449 val_conv.is_owned = true;
7450 return ChannelInfo_set_announcement_message(this_ptr_conv, val_conv);
7453 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
7454 LDKChannelInfo* obj_conv = (LDKChannelInfo*)obj;
7455 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7456 *ret = ChannelInfo_write(obj_conv);
7460 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_ChannelInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
7461 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7463 LDKChannelInfo* ret = MALLOC(sizeof(LDKChannelInfo), "LDKChannelInfo");
7464 *ret = ChannelInfo_read(ser_conv);
7465 assert(ret->is_owned);
7466 ret->is_owned = false;
7470 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7471 LDKRoutingFees this_ptr_conv = *(LDKRoutingFees*)this_ptr;
7472 FREE((void*)this_ptr);
7473 this_ptr_conv.is_owned = true;
7474 return RoutingFees_free(this_ptr_conv);
7477 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr) {
7478 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
7479 return RoutingFees_get_base_msat(this_ptr_conv);
7482 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1base_1msat(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
7483 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
7484 return RoutingFees_set_base_msat(this_ptr_conv, val);
7487 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_RoutingFees_1get_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr) {
7488 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
7489 return RoutingFees_get_proportional_millionths(this_ptr_conv);
7492 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_RoutingFees_1set_1proportional_1millionths(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
7493 LDKRoutingFees* this_ptr_conv = (LDKRoutingFees*)this_ptr;
7494 return RoutingFees_set_proportional_millionths(this_ptr_conv, val);
7497 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1new(JNIEnv * _env, jclass _b, jint base_msat_arg, jint proportional_millionths_arg) {
7498 LDKRoutingFees* ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
7499 *ret = RoutingFees_new(base_msat_arg, proportional_millionths_arg);
7500 assert(ret->is_owned);
7501 ret->is_owned = false;
7505 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1read(JNIEnv * _env, jclass _b, jlong ser) {
7506 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7508 LDKRoutingFees* ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
7509 *ret = RoutingFees_read(ser_conv);
7510 assert(ret->is_owned);
7511 ret->is_owned = false;
7515 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_RoutingFees_1write(JNIEnv * _env, jclass _b, jlong obj) {
7516 LDKRoutingFees* obj_conv = (LDKRoutingFees*)obj;
7517 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7518 *ret = RoutingFees_write(obj_conv);
7522 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7523 LDKNodeAnnouncementInfo this_ptr_conv = *(LDKNodeAnnouncementInfo*)this_ptr;
7524 FREE((void*)this_ptr);
7525 this_ptr_conv.is_owned = true;
7526 return NodeAnnouncementInfo_free(this_ptr_conv);
7529 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1features(JNIEnv * _env, jclass _b, jlong this_ptr) {
7530 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
7531 LDKNodeFeatures* ret = MALLOC(sizeof(LDKNodeFeatures), "LDKNodeFeatures");
7532 *ret = NodeAnnouncementInfo_get_features(this_ptr_conv);
7533 assert(ret->is_owned);
7534 ret->is_owned = false;
7538 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1features(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7539 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
7540 LDKNodeFeatures val_conv = *(LDKNodeFeatures*)val;
7542 val_conv.is_owned = true;
7543 return NodeAnnouncementInfo_set_features(this_ptr_conv, val_conv);
7546 JNIEXPORT jint JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr) {
7547 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
7548 return NodeAnnouncementInfo_get_last_update(this_ptr_conv);
7551 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1last_1update(JNIEnv * _env, jclass _b, jlong this_ptr, jint val) {
7552 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
7553 return NodeAnnouncementInfo_set_last_update(this_ptr_conv, val);
7556 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr) {
7557 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
7558 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 3);
7559 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 3, *NodeAnnouncementInfo_get_rgb(this_ptr_conv));
7563 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1rgb(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7564 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
7565 LDKThreeBytes val_conv = *(LDKThreeBytes*)val;
7567 return NodeAnnouncementInfo_set_rgb(this_ptr_conv, val_conv);
7570 JNIEXPORT jbyteArray JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1alias(JNIEnv * _env, jclass _b, jlong this_ptr) {
7571 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
7572 jbyteArray ret_arr = (*_env)->NewByteArray(_env, 32);
7573 (*_env)->SetByteArrayRegion(_env, ret_arr, 0, 32, *NodeAnnouncementInfo_get_alias(this_ptr_conv));
7577 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1alias(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7578 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
7579 LDKThirtyTwoBytes val_conv = *(LDKThirtyTwoBytes*)val;
7581 return NodeAnnouncementInfo_set_alias(this_ptr_conv, val_conv);
7584 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1addresses(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7585 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
7586 LDKCVec_NetAddressZ val_conv = *(LDKCVec_NetAddressZ*)val;
7588 return NodeAnnouncementInfo_set_addresses(this_ptr_conv, val_conv);
7591 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1get_1announcement_1message(JNIEnv * _env, jclass _b, jlong this_ptr) {
7592 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
7593 LDKNodeAnnouncement* ret = MALLOC(sizeof(LDKNodeAnnouncement), "LDKNodeAnnouncement");
7594 *ret = NodeAnnouncementInfo_get_announcement_message(this_ptr_conv);
7595 assert(ret->is_owned);
7596 ret->is_owned = false;
7600 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1set_1announcement_1message(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7601 LDKNodeAnnouncementInfo* this_ptr_conv = (LDKNodeAnnouncementInfo*)this_ptr;
7602 LDKNodeAnnouncement val_conv = *(LDKNodeAnnouncement*)val;
7604 val_conv.is_owned = true;
7605 return NodeAnnouncementInfo_set_announcement_message(this_ptr_conv, val_conv);
7608 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) {
7609 LDKNodeFeatures features_arg_conv = *(LDKNodeFeatures*)features_arg;
7610 FREE((void*)features_arg);
7611 features_arg_conv.is_owned = true;
7612 LDKThreeBytes rgb_arg_conv = *(LDKThreeBytes*)rgb_arg;
7613 FREE((void*)rgb_arg);
7614 LDKThirtyTwoBytes alias_arg_conv = *(LDKThirtyTwoBytes*)alias_arg;
7615 FREE((void*)alias_arg);
7616 LDKCVec_NetAddressZ addresses_arg_conv = *(LDKCVec_NetAddressZ*)addresses_arg;
7617 FREE((void*)addresses_arg);
7618 LDKNodeAnnouncement announcement_message_arg_conv = *(LDKNodeAnnouncement*)announcement_message_arg;
7619 FREE((void*)announcement_message_arg);
7620 announcement_message_arg_conv.is_owned = true;
7621 LDKNodeAnnouncementInfo* ret = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo");
7622 *ret = NodeAnnouncementInfo_new(features_arg_conv, last_update_arg, rgb_arg_conv, alias_arg_conv, addresses_arg_conv, announcement_message_arg_conv);
7623 assert(ret->is_owned);
7624 ret->is_owned = false;
7628 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
7629 LDKNodeAnnouncementInfo* obj_conv = (LDKNodeAnnouncementInfo*)obj;
7630 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7631 *ret = NodeAnnouncementInfo_write(obj_conv);
7635 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeAnnouncementInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
7636 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7638 LDKNodeAnnouncementInfo* ret = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo");
7639 *ret = NodeAnnouncementInfo_read(ser_conv);
7640 assert(ret->is_owned);
7641 ret->is_owned = false;
7645 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1free(JNIEnv * _env, jclass _b, jlong this_ptr) {
7646 LDKNodeInfo this_ptr_conv = *(LDKNodeInfo*)this_ptr;
7647 FREE((void*)this_ptr);
7648 this_ptr_conv.is_owned = true;
7649 return NodeInfo_free(this_ptr_conv);
7652 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1channels(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7653 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
7654 LDKCVec_u64Z val_conv = *(LDKCVec_u64Z*)val;
7656 return NodeInfo_set_channels(this_ptr_conv, val_conv);
7659 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1lowest_1inbound_1channel_1fees(JNIEnv * _env, jclass _b, jlong this_ptr) {
7660 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
7661 LDKRoutingFees* ret = MALLOC(sizeof(LDKRoutingFees), "LDKRoutingFees");
7662 *ret = NodeInfo_get_lowest_inbound_channel_fees(this_ptr_conv);
7663 assert(ret->is_owned);
7664 ret->is_owned = false;
7668 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1lowest_1inbound_1channel_1fees(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7669 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
7670 LDKRoutingFees val_conv = *(LDKRoutingFees*)val;
7672 val_conv.is_owned = true;
7673 return NodeInfo_set_lowest_inbound_channel_fees(this_ptr_conv, val_conv);
7676 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1get_1announcement_1info(JNIEnv * _env, jclass _b, jlong this_ptr) {
7677 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
7678 LDKNodeAnnouncementInfo* ret = MALLOC(sizeof(LDKNodeAnnouncementInfo), "LDKNodeAnnouncementInfo");
7679 *ret = NodeInfo_get_announcement_info(this_ptr_conv);
7680 assert(ret->is_owned);
7681 ret->is_owned = false;
7685 JNIEXPORT void JNICALL Java_org_ldk_impl_bindings_NodeInfo_1set_1announcement_1info(JNIEnv * _env, jclass _b, jlong this_ptr, jlong val) {
7686 LDKNodeInfo* this_ptr_conv = (LDKNodeInfo*)this_ptr;
7687 LDKNodeAnnouncementInfo val_conv = *(LDKNodeAnnouncementInfo*)val;
7689 val_conv.is_owned = true;
7690 return NodeInfo_set_announcement_info(this_ptr_conv, val_conv);
7693 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) {
7694 LDKCVec_u64Z channels_arg_conv = *(LDKCVec_u64Z*)channels_arg;
7695 FREE((void*)channels_arg);
7696 LDKRoutingFees lowest_inbound_channel_fees_arg_conv = *(LDKRoutingFees*)lowest_inbound_channel_fees_arg;
7697 FREE((void*)lowest_inbound_channel_fees_arg);
7698 lowest_inbound_channel_fees_arg_conv.is_owned = true;
7699 LDKNodeAnnouncementInfo announcement_info_arg_conv = *(LDKNodeAnnouncementInfo*)announcement_info_arg;
7700 FREE((void*)announcement_info_arg);
7701 announcement_info_arg_conv.is_owned = true;
7702 LDKNodeInfo* ret = MALLOC(sizeof(LDKNodeInfo), "LDKNodeInfo");
7703 *ret = NodeInfo_new(channels_arg_conv, lowest_inbound_channel_fees_arg_conv, announcement_info_arg_conv);
7704 assert(ret->is_owned);
7705 ret->is_owned = false;
7709 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1write(JNIEnv * _env, jclass _b, jlong obj) {
7710 LDKNodeInfo* obj_conv = (LDKNodeInfo*)obj;
7711 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7712 *ret = NodeInfo_write(obj_conv);
7716 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NodeInfo_1read(JNIEnv * _env, jclass _b, jlong ser) {
7717 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7719 LDKNodeInfo* ret = MALLOC(sizeof(LDKNodeInfo), "LDKNodeInfo");
7720 *ret = NodeInfo_read(ser_conv);
7721 assert(ret->is_owned);
7722 ret->is_owned = false;
7726 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1write(JNIEnv * _env, jclass _b, jlong obj) {
7727 LDKNetworkGraph* obj_conv = (LDKNetworkGraph*)obj;
7728 LDKCVec_u8Z* ret = MALLOC(sizeof(LDKCVec_u8Z), "LDKCVec_u8Z");
7729 *ret = NetworkGraph_write(obj_conv);
7733 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1read(JNIEnv * _env, jclass _b, jlong ser) {
7734 LDKu8slice ser_conv = *(LDKu8slice*)ser;
7736 LDKNetworkGraph* ret = MALLOC(sizeof(LDKNetworkGraph), "LDKNetworkGraph");
7737 *ret = NetworkGraph_read(ser_conv);
7738 assert(ret->is_owned);
7739 ret->is_owned = false;
7743 JNIEXPORT jlong JNICALL Java_org_ldk_impl_bindings_NetworkGraph_1new(JNIEnv * _env, jclass _b) {
7744 LDKNetworkGraph* ret = MALLOC(sizeof(LDKNetworkGraph), "LDKNetworkGraph");
7745 *ret = NetworkGraph_new();
7746 assert(ret->is_owned);
7747 ret->is_owned = false;
7751 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) {
7752 LDKNetworkGraph* this_arg_conv = (LDKNetworkGraph*)this_arg;
7753 return NetworkGraph_close_channel_from_update(this_arg_conv, short_channel_id, is_permanent);